diff --git a/Mage.Client/config/config.xml b/Mage.Client/config/config.xml index f545396985..cc832e984a 100644 --- a/Mage.Client/config/config.xml +++ b/Mage.Client/config/config.xml @@ -1,28 +1,28 @@ - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Mage.Client/pom.xml b/Mage.Client/pom.xml index 93518e8ba6..f18f3d0ab6 100644 --- a/Mage.Client/pom.xml +++ b/Mage.Client/pom.xml @@ -155,7 +155,7 @@ - + - - org.eclipse.m2e - lifecycle-mapping - 1.0.0 - - - - - - - org.jvnet.jaxb2.maven2 - - - maven-jaxb2-plugin - - - [0.7.4,) - - - generate - - - - - - - - - - - + + + + org.eclipse.m2e + lifecycle-mapping + 1.0.0 + + + + + + + org.jvnet.jaxb2.maven2 + + + maven-jaxb2-plugin + + + [0.7.4,) + + + generate + + + + + + + + + + + diff --git a/Mage.Server/release/config/config.xml b/Mage.Server/release/config/config.xml index f6e5f68792..b6bb903412 100644 --- a/Mage.Server/release/config/config.xml +++ b/Mage.Server/release/config/config.xml @@ -1,27 +1,27 @@ - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Mage.Server/src/main/java/mage/server/ChatManager.java b/Mage.Server/src/main/java/mage/server/ChatManager.java index 62586ecfcf..b29589879d 100644 --- a/Mage.Server/src/main/java/mage/server/ChatManager.java +++ b/Mage.Server/src/main/java/mage/server/ChatManager.java @@ -39,59 +39,59 @@ import java.util.concurrent.ConcurrentHashMap; */ public class ChatManager { - private final static ChatManager INSTANCE = new ChatManager(); + private final static ChatManager INSTANCE = new ChatManager(); - public static ChatManager getInstance() { - return INSTANCE; - } + public static ChatManager getInstance() { + return INSTANCE; + } - private ChatManager() {} + private ChatManager() {} - private ConcurrentHashMap chatSessions = new ConcurrentHashMap(); + private ConcurrentHashMap chatSessions = new ConcurrentHashMap(); - public UUID createChatSession() { - ChatSession chatSession = new ChatSession(); - chatSessions.put(chatSession.getChatId(), chatSession); - return chatSession.getChatId(); - } + public UUID createChatSession() { + ChatSession chatSession = new ChatSession(); + chatSessions.put(chatSession.getChatId(), chatSession); + return chatSession.getChatId(); + } - public void joinChat(UUID chatId, UUID userId) { - chatSessions.get(chatId).join(userId); - } + public void joinChat(UUID chatId, UUID userId) { + chatSessions.get(chatId).join(userId); + } - public void leaveChat(UUID chatId, UUID userId) { - chatSessions.get(chatId).kill(userId); - } + public void leaveChat(UUID chatId, UUID userId) { + chatSessions.get(chatId).kill(userId); + } - public void destroyChatSession(UUID chatId) { - chatSessions.remove(chatId); - } + public void destroyChatSession(UUID chatId) { + chatSessions.remove(chatId); + } - public void broadcast(UUID chatId, String userName, String message, MessageColor color) { - chatSessions.get(chatId).broadcast(userName, message, color); - } + public void broadcast(UUID chatId, String userName, String message, MessageColor color) { + chatSessions.get(chatId).broadcast(userName, message, color); + } - /** - * - * use mainly for announcing that a user connection was lost or that a user has reconnected - * - * @param userId - * @param message - * @param color - */ - public void broadcast(UUID userId, String message, MessageColor color) { - User user = UserManager.getInstance().getUser(userId); - if (user != null) { - for (ChatSession chat: chatSessions.values()) { - if (chat.hasUser(userId)) - chat.broadcast(user.getName(), message, color); - } - } - } + /** + * + * use mainly for announcing that a user connection was lost or that a user has reconnected + * + * @param userId + * @param message + * @param color + */ + public void broadcast(UUID userId, String message, MessageColor color) { + User user = UserManager.getInstance().getUser(userId); + if (user != null) { + for (ChatSession chat: chatSessions.values()) { + if (chat.hasUser(userId)) + chat.broadcast(user.getName(), message, color); + } + } + } - public void removeUser(UUID userId) { - for (ChatSession chat: chatSessions.values()) { - chat.kill(userId); - } - } + public void removeUser(UUID userId) { + for (ChatSession chat: chatSessions.values()) { + chat.kill(userId); + } + } } diff --git a/Mage.Server/src/main/java/mage/server/ChatSession.java b/Mage.Server/src/main/java/mage/server/ChatSession.java index 41b92d70dd..35ee26e7f4 100644 --- a/Mage.Server/src/main/java/mage/server/ChatSession.java +++ b/Mage.Server/src/main/java/mage/server/ChatSession.java @@ -45,58 +45,58 @@ import org.apache.log4j.Logger; */ public class ChatSession { - private final static Logger logger = Logger.getLogger(ChatSession.class); - private ConcurrentHashMap clients = new ConcurrentHashMap(); - private UUID chatId; - private DateFormat timeFormatter = SimpleDateFormat.getTimeInstance(SimpleDateFormat.SHORT); + private final static Logger logger = Logger.getLogger(ChatSession.class); + private ConcurrentHashMap clients = new ConcurrentHashMap(); + private UUID chatId; + private DateFormat timeFormatter = SimpleDateFormat.getTimeInstance(SimpleDateFormat.SHORT); - public ChatSession() { - chatId = UUID.randomUUID(); - } + public ChatSession() { + chatId = UUID.randomUUID(); + } - public void join(UUID userId) { - User user = UserManager.getInstance().getUser(userId); - if (user != null) { - String userName = user.getName(); - clients.put(userId, userName); - broadcast(userName, " has joined", MessageColor.BLACK); - logger.info(userName + " joined chat " + chatId); - } - } + public void join(UUID userId) { + User user = UserManager.getInstance().getUser(userId); + if (user != null) { + String userName = user.getName(); + clients.put(userId, userName); + broadcast(userName, " has joined", MessageColor.BLACK); + logger.info(userName + " joined chat " + chatId); + } + } - public void kill(UUID userId) { - if (userId != null && clients.containsKey(userId)) { - String userName = clients.get(userId); - clients.remove(userId); - broadcast(userName, " has left", MessageColor.BLACK); - logger.info(userName + " has left chat " + chatId); - } - } + public void kill(UUID userId) { + if (userId != null && clients.containsKey(userId)) { + String userName = clients.get(userId); + clients.remove(userId); + broadcast(userName, " has left", MessageColor.BLACK); + logger.info(userName + " has left chat " + chatId); + } + } - public void broadcast(String userName, String message, MessageColor color) { - Calendar cal = new GregorianCalendar(); - final String msg = message; - final String time = timeFormatter.format(cal.getTime()); - final String username = userName; - logger.debug("Broadcasting '" + msg + "' for " + chatId); - for (UUID userId: clients.keySet()) { - User user = UserManager.getInstance().getUser(userId); - if (user != null) - user.fireCallback(new ClientCallback("chatMessage", chatId, new ChatMessage(username, msg, time, color))); - else - kill(userId); - } - } + public void broadcast(String userName, String message, MessageColor color) { + Calendar cal = new GregorianCalendar(); + final String msg = message; + final String time = timeFormatter.format(cal.getTime()); + final String username = userName; + logger.debug("Broadcasting '" + msg + "' for " + chatId); + for (UUID userId: clients.keySet()) { + User user = UserManager.getInstance().getUser(userId); + if (user != null) + user.fireCallback(new ClientCallback("chatMessage", chatId, new ChatMessage(username, msg, time, color))); + else + kill(userId); + } + } - /** - * @return the chatId - */ - public UUID getChatId() { - return chatId; - } + /** + * @return the chatId + */ + public UUID getChatId() { + return chatId; + } - public boolean hasUser(UUID userId) { - return clients.containsKey(userId); - } + public boolean hasUser(UUID userId) { + return clients.containsKey(userId); + } } diff --git a/Mage.Server/src/main/java/mage/server/MageServerImpl.java b/Mage.Server/src/main/java/mage/server/MageServerImpl.java index 9d67fc2369..ff3dfc40c7 100644 --- a/Mage.Server/src/main/java/mage/server/MageServerImpl.java +++ b/Mage.Server/src/main/java/mage/server/MageServerImpl.java @@ -66,61 +66,61 @@ import java.util.concurrent.ExecutorService; */ public class MageServerImpl implements MageServer { - private final static Logger logger = Logger.getLogger(MageServerImpl.class); - private static ExecutorService callExecutor = ThreadExecutor.getInstance().getCallExecutor(); + private final static Logger logger = Logger.getLogger(MageServerImpl.class); + private static ExecutorService callExecutor = ThreadExecutor.getInstance().getCallExecutor(); - private String password; - private boolean testMode; + private String password; + private boolean testMode; - public MageServerImpl(String password, boolean testMode) { - this.password = password; - this.testMode = testMode; - ServerMessagesUtil.getInstance().getMessages(); - } + public MageServerImpl(String password, boolean testMode) { + this.password = password; + this.testMode = testMode; + ServerMessagesUtil.getInstance().getMessages(); + } - @Override - public boolean registerClient(String userName, String sessionId, MageVersion version) throws MageException { - try { - if (version.compareTo(Main.getVersion()) != 0) { - logger.info("MageVersionException: userName=" + userName + ", version=" + version); + @Override + public boolean registerClient(String userName, String sessionId, MageVersion version) throws MageException { + try { + if (version.compareTo(Main.getVersion()) != 0) { + logger.info("MageVersionException: userName=" + userName + ", version=" + version); LogServiceImpl.instance.log(LogKeys.KEY_WRONG_VERSION, userName, version.toString(), Main.getVersion().toString(), sessionId); - throw new MageVersionException(version, Main.getVersion()); - } - return SessionManager.getInstance().registerUser(sessionId, userName); - } catch (Exception ex) { + throw new MageVersionException(version, Main.getVersion()); + } + return SessionManager.getInstance().registerUser(sessionId, userName); + } catch (Exception ex) { if (ex instanceof MageVersionException) throw (MageVersionException)ex; - handleException(ex); - } - return false; - } + handleException(ex); + } + return false; + } - @Override - public boolean setUserData(final String userName, final String sessionId, final UserDataView userDataView) throws MageException { + @Override + public boolean setUserData(final String userName, final String sessionId, final UserDataView userDataView) throws MageException { return executeWithResult("setUserData", sessionId, new ActionWithBooleanResult() { public Boolean execute() throws MageException { return SessionManager.getInstance().setUserData(userName, sessionId, userDataView); } }); - } + } - @Override - public boolean registerAdmin(String password, String sessionId, MageVersion version) throws MageException { - try { - if (version.compareTo(Main.getVersion()) != 0) - throw new MageException("Wrong client version " + version + ", expecting version " + Main.getVersion()); - if (!password.equals(this.password)) - throw new MageException("Wrong password"); - return SessionManager.getInstance().registerAdmin(sessionId); - } catch (Exception ex) { - handleException(ex); - } - return false; - } + @Override + public boolean registerAdmin(String password, String sessionId, MageVersion version) throws MageException { + try { + if (version.compareTo(Main.getVersion()) != 0) + throw new MageException("Wrong client version " + version + ", expecting version " + Main.getVersion()); + if (!password.equals(this.password)) + throw new MageException("Wrong password"); + return SessionManager.getInstance().registerAdmin(sessionId); + } catch (Exception ex) { + handleException(ex); + } + return false; + } - @Override - public TableView createTable(final String sessionId, final UUID roomId, final MatchOptions options) throws MageException { - return executeWithResult("createTable", sessionId, new ActionWithTableViewResult() { + @Override + public TableView createTable(final String sessionId, final UUID roomId, final MatchOptions options) throws MageException { + return executeWithResult("createTable", sessionId, new ActionWithTableViewResult() { public TableView execute() throws MageException { UUID userId = SessionManager.getInstance().getSession(sessionId).getUserId(); TableView table = GamesRoomManager.getInstance().getRoom(roomId).createTable(userId, options); @@ -129,10 +129,10 @@ public class MageServerImpl implements MageServer { return table; } }); - } + } - @Override - public TableView createTournamentTable(final String sessionId, final UUID roomId, final TournamentOptions options) throws MageException { + @Override + public TableView createTournamentTable(final String sessionId, final UUID roomId, final TournamentOptions options) throws MageException { return executeWithResult("createTournamentTable", sessionId, new ActionWithTableViewResult() { public TableView execute() throws MageException { UUID userId = SessionManager.getInstance().getSession(sessionId).getUserId(); @@ -142,21 +142,21 @@ public class MageServerImpl implements MageServer { return table; } }); - } + } - @Override - public void removeTable(final String sessionId, final UUID roomId, final UUID tableId) throws MageException { + @Override + public void removeTable(final String sessionId, final UUID roomId, final UUID tableId) throws MageException { execute("removeTable", sessionId, new Action() { public void execute() { UUID userId = SessionManager.getInstance().getSession(sessionId).getUserId(); TableManager.getInstance().removeTable(userId, tableId); } }); - } + } - @Override - public boolean joinTable(final String sessionId, final UUID roomId, final UUID tableId, final String name, final String playerType, final int skill, final DeckCardLists deckList) throws MageException, GameException { - return executeWithResult("joinTable", sessionId, new ActionWithBooleanResult() { + @Override + public boolean joinTable(final String sessionId, final UUID roomId, final UUID tableId, final String name, final String playerType, final int skill, final DeckCardLists deckList) throws MageException, GameException { + return executeWithResult("joinTable", sessionId, new ActionWithBooleanResult() { public Boolean execute() throws MageException { UUID userId = SessionManager.getInstance().getSession(sessionId).getUserId(); boolean ret = GamesRoomManager.getInstance().getRoom(roomId).joinTable(userId, tableId, name, playerType, skill, deckList); @@ -164,11 +164,11 @@ public class MageServerImpl implements MageServer { return ret; } }); - } + } - @Override - public boolean joinTournamentTable(final String sessionId, final UUID roomId, final UUID tableId, final String name, final String playerType, final int skill) throws MageException, GameException { - return executeWithResult("joinTournamentTable", sessionId, new ActionWithBooleanResult() { + @Override + public boolean joinTournamentTable(final String sessionId, final UUID roomId, final UUID tableId, final String name, final String playerType, final int skill) throws MageException, GameException { + return executeWithResult("joinTournamentTable", sessionId, new ActionWithBooleanResult() { public Boolean execute() throws MageException { UUID userId = SessionManager.getInstance().getSession(sessionId).getUserId(); boolean ret = GamesRoomManager.getInstance().getRoom(roomId).joinTournamentTable(userId, tableId, name, playerType, skill); @@ -176,106 +176,106 @@ public class MageServerImpl implements MageServer { return ret; } }); - } + } - @Override - public boolean submitDeck(final String sessionId, final UUID tableId, final DeckCardLists deckList) throws MageException, GameException { + @Override + public boolean submitDeck(final String sessionId, final UUID tableId, final DeckCardLists deckList) throws MageException, GameException { return executeWithResult("submitDeck", sessionId, new ActionWithBooleanResult() { public Boolean execute() throws MageException { UUID userId = SessionManager.getInstance().getSession(sessionId).getUserId(); - boolean ret = TableManager.getInstance().submitDeck(userId, tableId, deckList); - logger.info("Session " + sessionId + " submitted deck"); - return ret; + boolean ret = TableManager.getInstance().submitDeck(userId, tableId, deckList); + logger.info("Session " + sessionId + " submitted deck"); + return ret; } }); - } + } - @Override - public void updateDeck(final String sessionId, final UUID tableId, final DeckCardLists deckList) throws MageException, GameException { - execute("updateDeck", sessionId, new Action() { + @Override + public void updateDeck(final String sessionId, final UUID tableId, final DeckCardLists deckList) throws MageException, GameException { + execute("updateDeck", sessionId, new Action() { public void execute() throws MageException { UUID userId = SessionManager.getInstance().getSession(sessionId).getUserId(); TableManager.getInstance().updateDeck(userId, tableId, deckList); logger.debug("Session " + sessionId + " updated deck"); } }); - } + } @Override //FIXME: why no sessionId here??? - public List getTables(UUID roomId) throws MageException { + public List getTables(UUID roomId) throws MageException { try { - return GamesRoomManager.getInstance().getRoom(roomId).getTables(); - } - catch (Exception ex) { - handleException(ex); - } - return null; - } - - @Override - //FIXME: why no sessionId here??? - public List getFinishedMatches(UUID roomId) throws MageException { - try { - return GamesRoomManager.getInstance().getRoom(roomId).getFinished(); - } - catch (Exception ex) { - handleException(ex); - } - return null; - } + return GamesRoomManager.getInstance().getRoom(roomId).getTables(); + } + catch (Exception ex) { + handleException(ex); + } + return null; + } @Override //FIXME: why no sessionId here??? - public List getConnectedPlayers(UUID roomId) throws MageException { - try { - return GamesRoomManager.getInstance().getRoom(roomId).getPlayers(); - } - catch (Exception ex) { - handleException(ex); - } - return null; - } + public List getFinishedMatches(UUID roomId) throws MageException { + try { + return GamesRoomManager.getInstance().getRoom(roomId).getFinished(); + } + catch (Exception ex) { + handleException(ex); + } + return null; + } - @Override + @Override //FIXME: why no sessionId here??? - public TableView getTable(UUID roomId, UUID tableId) throws MageException { - try { - return GamesRoomManager.getInstance().getRoom(roomId).getTable(tableId); - } - catch (Exception ex) { - handleException(ex); - } - return null; - } - + public List getConnectedPlayers(UUID roomId) throws MageException { + try { + return GamesRoomManager.getInstance().getRoom(roomId).getPlayers(); + } + catch (Exception ex) { + handleException(ex); + } + return null; + } + + @Override + //FIXME: why no sessionId here??? + public TableView getTable(UUID roomId, UUID tableId) throws MageException { + try { + return GamesRoomManager.getInstance().getRoom(roomId).getTable(tableId); + } + catch (Exception ex) { + handleException(ex); + } + return null; + } + @Override public boolean ping(String sessionId) { return SessionManager.getInstance().extendUserSession(sessionId); } - @Override - public void deregisterClient(final String sessionId) throws MageException { - execute("deregisterClient", sessionId, new Action() { + @Override + public void deregisterClient(final String sessionId) throws MageException { + execute("deregisterClient", sessionId, new Action() { public void execute() { SessionManager.getInstance().disconnect(sessionId, true); logger.info("Client deregistered ..."); } }); - } + } - @Override - public void startMatch(final String sessionId, final UUID roomId, final UUID tableId) throws MageException { + @Override + public void startMatch(final String sessionId, final UUID roomId, final UUID tableId) throws MageException { execute("startMatch", sessionId, new Action() { public void execute() { UUID userId = SessionManager.getInstance().getSession(sessionId).getUserId(); - TableManager.getInstance().startMatch(userId, roomId, tableId); + TableManager.getInstance().startMatch(userId, roomId, tableId); } }); - } + } - @Override - public void startChallenge(final String sessionId, final UUID roomId, final UUID tableId, final UUID challengeId) throws MageException { + @Override + public void startChallenge(final String sessionId, final UUID roomId, final UUID tableId, final UUID challengeId) throws MageException { execute("startChallenge", sessionId, new Action() { public void execute() { UUID userId = SessionManager.getInstance().getSession(sessionId).getUserId(); @@ -284,185 +284,185 @@ public class MageServerImpl implements MageServer { }); } - @Override - public void startTournament(final String sessionId, final UUID roomId, final UUID tableId) throws MageException { + @Override + public void startTournament(final String sessionId, final UUID roomId, final UUID tableId) throws MageException { execute("startTournament", sessionId, new Action() { public void execute() { UUID userId = SessionManager.getInstance().getSession(sessionId).getUserId(); TableManager.getInstance().startTournament(userId, roomId, tableId); } }); - } + } - @Override + @Override //FIXME: why no sessionId here??? - public TournamentView getTournament(UUID tournamentId) throws MageException { - try { - return TournamentManager.getInstance().getTournamentView(tournamentId); - } - catch (Exception ex) { - handleException(ex); - } - return null; - } + public TournamentView getTournament(UUID tournamentId) throws MageException { + try { + return TournamentManager.getInstance().getTournamentView(tournamentId); + } + catch (Exception ex) { + handleException(ex); + } + return null; + } - @Override + @Override //FIXME: why no sessionId here??? - public void sendChatMessage(final UUID chatId, final String userName, final String message) throws MageException { - try { - callExecutor.execute( - new Runnable() { - @Override - public void run() { - ChatManager.getInstance().broadcast(chatId, userName, message, MessageColor.BLUE); - } - } - ); - } - catch (Exception ex) { - handleException(ex); - } - } + public void sendChatMessage(final UUID chatId, final String userName, final String message) throws MageException { + try { + callExecutor.execute( + new Runnable() { + @Override + public void run() { + ChatManager.getInstance().broadcast(chatId, userName, message, MessageColor.BLUE); + } + } + ); + } + catch (Exception ex) { + handleException(ex); + } + } - @Override - public void joinChat(final UUID chatId, final String sessionId, final String userName) throws MageException { + @Override + public void joinChat(final UUID chatId, final String sessionId, final String userName) throws MageException { execute("joinChat", sessionId, new Action() { public void execute() { UUID userId = SessionManager.getInstance().getSession(sessionId).getUserId(); ChatManager.getInstance().joinChat(chatId, userId); } }); - } + } - @Override - public void leaveChat(final UUID chatId, final String sessionId) throws MageException { + @Override + public void leaveChat(final UUID chatId, final String sessionId) throws MageException { execute("leaveChat", sessionId, new Action() { public void execute() { UUID userId = SessionManager.getInstance().getSession(sessionId).getUserId(); ChatManager.getInstance().leaveChat(chatId, userId); } }); - } + } - @Override + @Override //FIXME: why no sessionId here??? - public UUID getMainRoomId() throws MageException { - try { - return GamesRoomManager.getInstance().getMainRoomId(); - } - catch (Exception ex) { - handleException(ex); - } - return null; - } + public UUID getMainRoomId() throws MageException { + try { + return GamesRoomManager.getInstance().getMainRoomId(); + } + catch (Exception ex) { + handleException(ex); + } + return null; + } - @Override + @Override //FIXME: why no sessionId here??? - public UUID getRoomChatId(UUID roomId) throws MageException { - try { - return GamesRoomManager.getInstance().getRoom(roomId).getChatId(); - } - catch (Exception ex) { - handleException(ex); - } - return null; - } + public UUID getRoomChatId(UUID roomId) throws MageException { + try { + return GamesRoomManager.getInstance().getRoom(roomId).getChatId(); + } + catch (Exception ex) { + handleException(ex); + } + return null; + } - @Override - public boolean isTableOwner(final String sessionId, UUID roomId, final UUID tableId) throws MageException { - return executeWithResult("isTableOwner", sessionId, new ActionWithBooleanResult() { + @Override + public boolean isTableOwner(final String sessionId, UUID roomId, final UUID tableId) throws MageException { + return executeWithResult("isTableOwner", sessionId, new ActionWithBooleanResult() { public Boolean execute() { UUID userId = SessionManager.getInstance().getSession(sessionId).getUserId(); return TableManager.getInstance().isTableOwner(tableId, userId); } }); - } + } - @Override - public void swapSeats(final String sessionId, final UUID roomId, final UUID tableId, final int seatNum1, final int seatNum2) throws MageException { + @Override + public void swapSeats(final String sessionId, final UUID roomId, final UUID tableId, final int seatNum1, final int seatNum2) throws MageException { execute("swapSeats", sessionId, new Action() { public void execute() { UUID userId = SessionManager.getInstance().getSession(sessionId).getUserId(); TableManager.getInstance().swapSeats(tableId, userId, seatNum1, seatNum2); } }); - } + } - @Override - public void leaveTable(final String sessionId, final UUID roomId, final UUID tableId) throws MageException { + @Override + public void leaveTable(final String sessionId, final UUID roomId, final UUID tableId) throws MageException { execute("leaveTable", sessionId, new Action() { public void execute() { UUID userId = SessionManager.getInstance().getSession(sessionId).getUserId(); GamesRoomManager.getInstance().getRoom(roomId).leaveTable(userId, tableId); } }); - } + } - @Override + @Override //FIXME: why no sessionId here??? - public UUID getTableChatId(UUID tableId) throws MageException { - try { - return TableManager.getInstance().getChatId(tableId); - } - catch (Exception ex) { - handleException(ex); - } - return null; - } + public UUID getTableChatId(UUID tableId) throws MageException { + try { + return TableManager.getInstance().getChatId(tableId); + } + catch (Exception ex) { + handleException(ex); + } + return null; + } - @Override - public void joinGame(final UUID gameId, final String sessionId) throws MageException { + @Override + public void joinGame(final UUID gameId, final String sessionId) throws MageException { execute("joinGame", sessionId, new Action() { public void execute() { UUID userId = SessionManager.getInstance().getSession(sessionId).getUserId(); GameManager.getInstance().joinGame(gameId, userId); } }); - } + } - @Override - public void joinDraft(final UUID draftId, final String sessionId) throws MageException { + @Override + public void joinDraft(final UUID draftId, final String sessionId) throws MageException { execute("joinDraft", sessionId, new Action() { public void execute() { UUID userId = SessionManager.getInstance().getSession(sessionId).getUserId(); DraftManager.getInstance().joinDraft(draftId, userId); } }); - } + } - @Override - public void joinTournament(final UUID tournamentId, final String sessionId) throws MageException { + @Override + public void joinTournament(final UUID tournamentId, final String sessionId) throws MageException { execute("joinTournament", sessionId, new Action() { public void execute() { UUID userId = SessionManager.getInstance().getSession(sessionId).getUserId(); TournamentManager.getInstance().joinTournament(tournamentId, userId); } }); - } + } - @Override + @Override //FIXME: why no sessionId here??? - public UUID getGameChatId(UUID gameId) throws MageException { - try { - return GameManager.getInstance().getChatId(gameId); - } - catch (Exception ex) { - handleException(ex); - } - return null; - } + public UUID getGameChatId(UUID gameId) throws MageException { + try { + return GameManager.getInstance().getChatId(gameId); + } + catch (Exception ex) { + handleException(ex); + } + return null; + } - @Override + @Override //FIXME: why no sessionId here??? - public UUID getTournamentChatId(UUID tournamentId) throws MageException { - try { - return TournamentManager.getInstance().getChatId(tournamentId); - } - catch (Exception ex) { - handleException(ex); - } - return null; - } + public UUID getTournamentChatId(UUID tournamentId) throws MageException { + try { + return TournamentManager.getInstance().getChatId(tournamentId); + } + catch (Exception ex) { + handleException(ex); + } + return null; + } @Override public void sendPlayerUUID(final UUID gameId, final String sessionId, final UUID data) throws MageException { @@ -474,7 +474,7 @@ public class MageServerImpl implements MageServer { }); } - @Override + @Override public void sendPlayerString(final UUID gameId, final String sessionId, final String data) throws MageException { execute("sendPlayerString", sessionId, new Action() { public void execute() { @@ -482,20 +482,20 @@ public class MageServerImpl implements MageServer { user.sendPlayerString(gameId, data); } }); - } + } - @Override - public void sendPlayerBoolean(final UUID gameId, final String sessionId, final Boolean data) throws MageException { + @Override + public void sendPlayerBoolean(final UUID gameId, final String sessionId, final Boolean data) throws MageException { execute("sendPlayerBoolean", sessionId, new Action() { public void execute() { User user = SessionManager.getInstance().getUser(sessionId); user.sendPlayerBoolean(gameId, data); } }); - } + } - @Override - public void sendPlayerInteger(final UUID gameId, final String sessionId, final Integer data) throws MageException { + @Override + public void sendPlayerInteger(final UUID gameId, final String sessionId, final Integer data) throws MageException { execute("sendPlayerInteger", sessionId, new Action() { public void execute() { User user = SessionManager.getInstance().getUser(sessionId); @@ -504,15 +504,15 @@ public class MageServerImpl implements MageServer { }); } - @Override - public DraftPickView sendCardPick(final UUID draftId, final String sessionId, final UUID cardPick) throws MageException { - return executeWithResult("sendCardPick", sessionId, new ActionWithNullNegativeResult() { + @Override + public DraftPickView sendCardPick(final UUID draftId, final String sessionId, final UUID cardPick) throws MageException { + return executeWithResult("sendCardPick", sessionId, new ActionWithNullNegativeResult() { public DraftPickView execute() { UUID userId = SessionManager.getInstance().getSession(sessionId).getUserId(); - return DraftManager.getInstance().sendCardPick(draftId, userId, cardPick); + return DraftManager.getInstance().sendCardPick(draftId, userId, cardPick); } }); - } + } @Override public void concedeGame(final UUID gameId, final String sessionId) throws MageException { @@ -524,15 +524,15 @@ public class MageServerImpl implements MageServer { }); } - @Override - public boolean watchTable(final String sessionId, final UUID roomId, final UUID tableId) throws MageException { - return executeWithResult("setUserData", sessionId, new ActionWithBooleanResult() { + @Override + public boolean watchTable(final String sessionId, final UUID roomId, final UUID tableId) throws MageException { + return executeWithResult("setUserData", sessionId, new ActionWithBooleanResult() { public Boolean execute() throws MageException { UUID userId = SessionManager.getInstance().getSession(sessionId).getUserId(); - return GamesRoomManager.getInstance().getRoom(roomId).watchTable(userId, tableId); + return GamesRoomManager.getInstance().getRoom(roomId).watchTable(userId, tableId); } }); - } + } @Override public void watchGame(final UUID gameId, final String sessionId) throws MageException { @@ -554,15 +554,15 @@ public class MageServerImpl implements MageServer { }); } - @Override - public void replayGame(final UUID gameId, final String sessionId) throws MageException { + @Override + public void replayGame(final UUID gameId, final String sessionId) throws MageException { execute("replayGame", sessionId, new Action() { public void execute() { UUID userId = SessionManager.getInstance().getSession(sessionId).getUserId(); ReplayManager.getInstance().replayGame(gameId, userId); } }); - } + } @Override public void startReplay(final UUID gameId, final String sessionId) throws MageException { @@ -574,17 +574,17 @@ public class MageServerImpl implements MageServer { }); } - @Override - public void stopReplay(final UUID gameId, final String sessionId) throws MageException { + @Override + public void stopReplay(final UUID gameId, final String sessionId) throws MageException { execute("stopReplay", sessionId, new Action() { public void execute() { UUID userId = SessionManager.getInstance().getSession(sessionId).getUserId(); ReplayManager.getInstance().stopReplay(gameId, userId); } }); - } + } - @Override + @Override public void nextPlay(final UUID gameId, final String sessionId) throws MageException { execute("nextPlay", sessionId, new Action() { public void execute() { @@ -594,15 +594,15 @@ public class MageServerImpl implements MageServer { }); } - @Override - public void previousPlay(final UUID gameId, final String sessionId) throws MageException { + @Override + public void previousPlay(final UUID gameId, final String sessionId) throws MageException { execute("previousPlay", sessionId, new Action() { public void execute() { UUID userId = SessionManager.getInstance().getSession(sessionId).getUserId(); ReplayManager.getInstance().previousPlay(gameId, userId); } }); - } + } @Override public void skipForward(final UUID gameId, final String sessionId, final int moves) throws MageException { @@ -616,21 +616,21 @@ public class MageServerImpl implements MageServer { @Override //TODO: check how often it is used - public ServerState getServerState() throws MageException { - try { - return new ServerState( - GameFactory.getInstance().getGameTypes(), - TournamentFactory.getInstance().getTournamentTypes(), - PlayerFactory.getInstance().getPlayerTypes().toArray(new String[0]), - DeckValidatorFactory.getInstance().getDeckTypes().toArray(new String[0]), - testMode, - Main.getVersion()); - } - catch (Exception ex) { - handleException(ex); - } - return null; - } + public ServerState getServerState() throws MageException { + try { + return new ServerState( + GameFactory.getInstance().getGameTypes(), + TournamentFactory.getInstance().getTournamentTypes(), + PlayerFactory.getInstance().getPlayerTypes().toArray(new String[0]), + DeckValidatorFactory.getInstance().getDeckTypes().toArray(new String[0]), + testMode, + Main.getVersion()); + } + catch (Exception ex) { + handleException(ex); + } + return null; + } @Override public void cheat(final UUID gameId, final String sessionId, final UUID playerId, final DeckCardLists deckList) throws MageException { @@ -645,7 +645,7 @@ public class MageServerImpl implements MageServer { } @Override - public boolean cheat(final UUID gameId, final String sessionId, final UUID playerId, final String cardName) throws MageException { + public boolean cheat(final UUID gameId, final String sessionId, final UUID playerId, final String cardName) throws MageException { return executeWithResult("cheatOne", sessionId, new ActionWithBooleanResult() { public Boolean execute() { if (testMode) { @@ -655,16 +655,16 @@ public class MageServerImpl implements MageServer { return false; } }); - } + } - public void handleException(Exception ex) throws MageException { - logger.fatal("", ex); - throw new MageException("Server error: " + ex.getMessage()); - } + public void handleException(Exception ex) throws MageException { + logger.fatal("", ex); + throw new MageException("Server error: " + ex.getMessage()); + } - @Override + @Override public GameView getGameView(final UUID gameId, final String sessionId, final UUID playerId) throws MageException { - return executeWithResult("getGameView", sessionId, new ActionWithNullNegativeResult() { + return executeWithResult("getGameView", sessionId, new ActionWithNullNegativeResult() { public GameView execute() throws MageException { UUID userId = SessionManager.getInstance().getSession(sessionId).getUserId(); return GameManager.getInstance().getGameView(gameId, userId, playerId); @@ -672,8 +672,8 @@ public class MageServerImpl implements MageServer { }); } - @Override - public List getUsers(String sessionId) throws MageException { + @Override + public List getUsers(String sessionId) throws MageException { return executeWithResult("getUsers", sessionId, new ActionWithNullNegativeResult>() { public List execute() throws MageException { List users = new ArrayList(); @@ -683,35 +683,35 @@ public class MageServerImpl implements MageServer { return users; } }, true); - } + } - @Override - public void disconnectUser(final String sessionId, final String userSessionId) throws MageException { + @Override + public void disconnectUser(final String sessionId, final String userSessionId) throws MageException { execute("disconnectUser", sessionId, new Action() { public void execute() { SessionManager.getInstance().disconnectUser(sessionId, userSessionId); } }); - } + } - @Override - public void removeTable(final String sessionId, final UUID tableId) throws MageException { + @Override + public void removeTable(final String sessionId, final UUID tableId) throws MageException { execute("removeTable", sessionId, new Action() { public void execute() { UUID userId = SessionManager.getInstance().getSession(sessionId).getUserId(); TableManager.getInstance().removeTable(userId, tableId); } }); - } + } - @Override - public Object getServerMessagesCompressed(String sessionId) throws MageException { - return executeWithResult("getGameView", sessionId, new ActionWithNullNegativeResult() { + @Override + public Object getServerMessagesCompressed(String sessionId) throws MageException { + return executeWithResult("getGameView", sessionId, new ActionWithNullNegativeResult() { public Object execute() throws MageException { return CompressUtil.compress(ServerMessagesUtil.getInstance().getMessages()); } }); - } + } @Override public void sendFeedbackMessage(final String sessionId, final String username, final String title, final String type, final String message, final String email) throws MageException { @@ -754,11 +754,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)) { - try { - callExecutor.execute( - new Runnable() { - @Override - public void run() { + try { + callExecutor.execute( + new Runnable() { + @Override + public void run() { if (SessionManager.getInstance().isValidSession(sessionId)) { try { action.execute(); @@ -768,14 +768,14 @@ public class MageServerImpl implements MageServer { } else { LogServiceImpl.instance.log(LogKeys.KEY_NOT_VALID_SESSION_INTERNAL, actionName, sessionId); } - } - } - ); - } - catch (Exception ex) { - handleException(ex); - } - } else { + } + } + ); + } + catch (Exception ex) { + handleException(ex); + } + } else { LogServiceImpl.instance.log(LogKeys.KEY_NOT_VALID_SESSION, actionName, sessionId); } } diff --git a/Mage.Server/src/main/java/mage/server/Main.java b/Mage.Server/src/main/java/mage/server/Main.java index 4c0c44f3d1..e059e60f76 100644 --- a/Mage.Server/src/main/java/mage/server/Main.java +++ b/Mage.Server/src/main/java/mage/server/Main.java @@ -66,51 +66,51 @@ import java.util.Map; */ public class Main { - private static Logger logger = Logger.getLogger(Main.class); + private static Logger logger = Logger.getLogger(Main.class); - private final static String testModeArg = "-testMode="; - private final static String adminPasswordArg = "-adminPassword="; - private final static String pluginFolder = "plugins"; - private static MageVersion version = new MageVersion(0, 8, 6, "r5"); + private final static String testModeArg = "-testMode="; + private final static String adminPasswordArg = "-adminPassword="; + private final static String pluginFolder = "plugins"; + private static MageVersion version = new MageVersion(0, 8, 6, "r5"); - public static PluginClassLoader classLoader = new PluginClassLoader(); - public static TransporterServer server; - protected static boolean testMode; + public static PluginClassLoader classLoader = new PluginClassLoader(); + public static TransporterServer server; + protected static boolean testMode; /** * @param args the command line arguments */ public static void main(String[] args) { - logger.info("Starting MAGE server version " + version); - logger.info("Logging level: " + logger.getEffectiveLevel()); - deleteSavedGames(); - ConfigSettings config = ConfigSettings.getInstance(); - for (GamePlugin plugin: config.getGameTypes()) { - GameFactory.getInstance().addGameType(plugin.getName(), loadGameType(plugin), loadPlugin(plugin)); - } - for (GamePlugin plugin: config.getTournamentTypes()) { - TournamentFactory.getInstance().addTournamentType(plugin.getName(), loadTournamentType(plugin), loadPlugin(plugin)); - } - for (Plugin plugin: config.getPlayerTypes()) { - PlayerFactory.getInstance().addPlayerType(plugin.getName(), loadPlugin(plugin)); - } - for (Plugin plugin: config.getDeckTypes()) { - DeckValidatorFactory.getInstance().addDeckType(plugin.getName(), loadPlugin(plugin)); - } - String adminPassword = ""; - for (String arg: args) { - if (arg.startsWith(testModeArg)) { - testMode = Boolean.valueOf(arg.replace(testModeArg, "")); - } - else if (arg.startsWith(adminPasswordArg)) { - adminPassword = arg.replace(adminPasswordArg, ""); - } - } - Connection connection = new Connection(); - connection.setHost(config.getServerAddress()); - connection.setPort(config.getPort()); - try { - InvokerLocator serverLocator = new InvokerLocator(connection.getURI()); + logger.info("Starting MAGE server version " + version); + logger.info("Logging level: " + logger.getEffectiveLevel()); + deleteSavedGames(); + ConfigSettings config = ConfigSettings.getInstance(); + for (GamePlugin plugin: config.getGameTypes()) { + GameFactory.getInstance().addGameType(plugin.getName(), loadGameType(plugin), loadPlugin(plugin)); + } + for (GamePlugin plugin: config.getTournamentTypes()) { + TournamentFactory.getInstance().addTournamentType(plugin.getName(), loadTournamentType(plugin), loadPlugin(plugin)); + } + for (Plugin plugin: config.getPlayerTypes()) { + PlayerFactory.getInstance().addPlayerType(plugin.getName(), loadPlugin(plugin)); + } + for (Plugin plugin: config.getDeckTypes()) { + DeckValidatorFactory.getInstance().addDeckType(plugin.getName(), loadPlugin(plugin)); + } + String adminPassword = ""; + for (String arg: args) { + if (arg.startsWith(testModeArg)) { + testMode = Boolean.valueOf(arg.replace(testModeArg, "")); + } + else if (arg.startsWith(adminPasswordArg)) { + adminPassword = arg.replace(adminPasswordArg, ""); + } + } + Connection connection = new Connection(); + connection.setHost(config.getServerAddress()); + connection.setPort(config.getPort()); + try { + InvokerLocator serverLocator = new InvokerLocator(connection.getURI()); if (!isAlreadyRunning(serverLocator)) { server = new MageTransporterServer(serverLocator, new MageServerImpl(adminPassword, testMode), MageServer.class.getName(), new MageServerInvocationHandler()); server.start(); @@ -122,11 +122,11 @@ public class Main { else { logger.fatal("Unable to start MAGE server - another server is already started"); } - } catch (IOException ex) { - logger.fatal("Failed to start server - " + connection.toString(), ex); - } catch (Exception ex) { - logger.fatal("Failed to start server - " + connection.toString(), ex); - } + } catch (IOException ex) { + logger.fatal("Failed to start server - " + connection.toString(), ex); + } catch (Exception ex) { + logger.fatal("Failed to start server - " + connection.toString(), ex); + } } @@ -136,8 +136,8 @@ public class Main { static boolean isAlreadyRunning(InvokerLocator serverLocator) { Map metadata = new HashMap(); - metadata.put(SocketWrapper.WRITE_TIMEOUT, "2000"); - metadata.put("generalizeSocketException", "true"); + metadata.put(SocketWrapper.WRITE_TIMEOUT, "2000"); + metadata.put("generalizeSocketException", "true"); try { MageServer testServer = (MageServer) TransporterClient.createTransporterClient(serverLocator.getLocatorURI(), MageServer.class, metadata); if (testServer != null) { @@ -149,64 +149,64 @@ public class Main { } return false; } - - static class ClientConnectionListener implements ConnectionListener { - @Override - public void handleConnectionException(Throwable throwable, Client client) { - Session session = SessionManager.getInstance().getSession(client.getSessionId()); - if (session != null) { - String sessionName; - User user = UserManager.getInstance().getUser(session.getUserId()); - if (user != null) - sessionName = user.getName() + " at " + session.getHost(); - else - sessionName = session.getHost(); - if (throwable instanceof ClientDisconnectedException) { - SessionManager.getInstance().disconnect(client.getSessionId(), false); - logger.info("client disconnected - " + sessionName); - } - else { - SessionManager.getInstance().disconnect(client.getSessionId(), false); - logger.info("connection to client lost - " + sessionName); - } - } - } - } - static class MageTransporterServer extends TransporterServer { - - protected Connector connector; - - public MageTransporterServer(InvokerLocator locator, Object target, String subsystem, MageServerInvocationHandler callback) throws Exception { - super(locator, target, subsystem); - connector.addInvocationHandler("callback", callback); - connector.setLeasePeriod(5000); - connector.addConnectionListener(new ClientConnectionListener()); - } - - public Connector getConnector() throws Exception { - return connector; - } - - @Override - protected Connector getConnector(InvokerLocator locator, Map config, Element xmlConfig) throws Exception { - Connector c = super.getConnector(locator, config, xmlConfig); - this.connector = c; - return c; - } - } - - static class MageServerInvocationHandler implements ServerInvocationHandler { + static class ClientConnectionListener implements ConnectionListener { + @Override + public void handleConnectionException(Throwable throwable, Client client) { + Session session = SessionManager.getInstance().getSession(client.getSessionId()); + if (session != null) { + String sessionName; + User user = UserManager.getInstance().getUser(session.getUserId()); + if (user != null) + sessionName = user.getName() + " at " + session.getHost(); + else + sessionName = session.getHost(); + if (throwable instanceof ClientDisconnectedException) { + SessionManager.getInstance().disconnect(client.getSessionId(), false); + logger.info("client disconnected - " + sessionName); + } + else { + SessionManager.getInstance().disconnect(client.getSessionId(), false); + logger.info("connection to client lost - " + sessionName); + } + } + } + } - @Override - public void setMBeanServer(MBeanServer server) {} + static class MageTransporterServer extends TransporterServer { - @Override - public void setInvoker(ServerInvoker invoker) {} + protected Connector connector; - @Override - public Object invoke(final InvocationRequest invocation) throws Throwable { - String sessionId = invocation.getSessionId(); + public MageTransporterServer(InvokerLocator locator, Object target, String subsystem, MageServerInvocationHandler callback) throws Exception { + super(locator, target, subsystem); + connector.addInvocationHandler("callback", callback); + connector.setLeasePeriod(5000); + connector.addConnectionListener(new ClientConnectionListener()); + } + + public Connector getConnector() throws Exception { + return connector; + } + + @Override + protected Connector getConnector(InvokerLocator locator, Map config, Element xmlConfig) throws Exception { + Connector c = super.getConnector(locator, config, xmlConfig); + this.connector = c; + return c; + } + } + + static class MageServerInvocationHandler implements ServerInvocationHandler { + + @Override + public void setMBeanServer(MBeanServer server) {} + + @Override + public void setInvoker(ServerInvoker invoker) {} + + @Override + public Object invoke(final InvocationRequest invocation) throws Throwable { + String sessionId = invocation.getSessionId(); Map map = invocation.getRequestPayload(); String host; if (map != null) { @@ -216,92 +216,92 @@ public class Main { host = "localhost"; } SessionManager.getInstance().getSession(sessionId).setHost(host); - return null; - } + return null; + } - @Override - public void addListener(InvokerCallbackHandler callbackHandler) { - ServerInvokerCallbackHandler handler = (ServerInvokerCallbackHandler) callbackHandler; - try { - String sessionId = handler.getClientSessionId(); - SessionManager.getInstance().createSession(sessionId, callbackHandler); - } catch (Throwable ex) { - logger.fatal("", ex); - } - } + @Override + public void addListener(InvokerCallbackHandler callbackHandler) { + ServerInvokerCallbackHandler handler = (ServerInvokerCallbackHandler) callbackHandler; + try { + String sessionId = handler.getClientSessionId(); + SessionManager.getInstance().createSession(sessionId, callbackHandler); + } catch (Throwable ex) { + logger.fatal("", ex); + } + } - @Override - public void removeListener(InvokerCallbackHandler callbackHandler) { - logger.fatal("removeListener called"); -// ServerInvokerCallbackHandler handler = (ServerInvokerCallbackHandler) callbackHandler; -// String sessionId = handler.getCallbackClient().getSessionId(); -// SessionManager.getInstance().disconnect(sessionId); - } - - } - - private static Class loadPlugin(Plugin plugin) { - try { - classLoader.addURL(new File(pluginFolder + "/" + plugin.getJar()).toURI().toURL()); - logger.info("Loading plugin: " + plugin.getClassName()); - return Class.forName(plugin.getClassName(), true, classLoader); - } catch (ClassNotFoundException ex) { - logger.warn("Plugin not Found:" + plugin.getJar() + " - check plugin folder"); - } catch (Exception ex) { - logger.fatal("Error loading plugin " + plugin.getJar(), ex); - } - return null; - } + @Override + public void removeListener(InvokerCallbackHandler callbackHandler) { + logger.fatal("removeListener called"); +// ServerInvokerCallbackHandler handler = (ServerInvokerCallbackHandler) callbackHandler; +// String sessionId = handler.getCallbackClient().getSessionId(); +// SessionManager.getInstance().disconnect(sessionId); + } - private static MatchType loadGameType(GamePlugin plugin) { - try { - classLoader.addURL(new File(pluginFolder + "/" + plugin.getJar()).toURI().toURL()); - logger.info("Loading game type: " + plugin.getClassName()); - return (MatchType) Class.forName(plugin.getTypeName(), true, classLoader).newInstance(); - } catch (ClassNotFoundException ex) { - logger.warn("Game type not found:" + plugin.getJar() + " - check plugin folder"); - } catch (Exception ex) { - logger.fatal("Error loading game type " + plugin.getJar(), ex); - } - return null; - } + } - private static TournamentType loadTournamentType(GamePlugin plugin) { - try { - classLoader.addURL(new File(pluginFolder + "/" + plugin.getJar()).toURI().toURL()); - logger.info("Loading tournament type: " + plugin.getClassName()); - return (TournamentType) Class.forName(plugin.getTypeName(), true, classLoader).newInstance(); - } catch (ClassNotFoundException ex) { - logger.warn("Tournament type not found:" + plugin.getJar() + " - check plugin folder"); - } catch (Exception ex) { - logger.fatal("Error loading game type " + plugin.getJar(), ex); - } - return null; - } + private static Class loadPlugin(Plugin plugin) { + try { + classLoader.addURL(new File(pluginFolder + "/" + plugin.getJar()).toURI().toURL()); + logger.info("Loading plugin: " + plugin.getClassName()); + return Class.forName(plugin.getClassName(), true, classLoader); + } catch (ClassNotFoundException ex) { + logger.warn("Plugin not Found:" + plugin.getJar() + " - check plugin folder"); + } catch (Exception ex) { + logger.fatal("Error loading plugin " + plugin.getJar(), ex); + } + return null; + } - private static void deleteSavedGames() { - File directory = new File("saved/"); - if (!directory.exists()) - directory.mkdirs(); - File[] files = directory.listFiles( - new FilenameFilter() { - @Override - public boolean accept(File dir, String name) { - return name.endsWith(".game"); - } - } - ); - for (File file : files) - { - file.delete(); - } - } + private static MatchType loadGameType(GamePlugin plugin) { + try { + classLoader.addURL(new File(pluginFolder + "/" + plugin.getJar()).toURI().toURL()); + logger.info("Loading game type: " + plugin.getClassName()); + return (MatchType) Class.forName(plugin.getTypeName(), true, classLoader).newInstance(); + } catch (ClassNotFoundException ex) { + logger.warn("Game type not found:" + plugin.getJar() + " - check plugin folder"); + } catch (Exception ex) { + logger.fatal("Error loading game type " + plugin.getJar(), ex); + } + return null; + } - public static MageVersion getVersion() { - return version; - } + private static TournamentType loadTournamentType(GamePlugin plugin) { + try { + classLoader.addURL(new File(pluginFolder + "/" + plugin.getJar()).toURI().toURL()); + logger.info("Loading tournament type: " + plugin.getClassName()); + return (TournamentType) Class.forName(plugin.getTypeName(), true, classLoader).newInstance(); + } catch (ClassNotFoundException ex) { + logger.warn("Tournament type not found:" + plugin.getJar() + " - check plugin folder"); + } catch (Exception ex) { + logger.fatal("Error loading game type " + plugin.getJar(), ex); + } + return null; + } - public static boolean isTestMode() { - return testMode; - } + private static void deleteSavedGames() { + File directory = new File("saved/"); + if (!directory.exists()) + directory.mkdirs(); + File[] files = directory.listFiles( + new FilenameFilter() { + @Override + public boolean accept(File dir, String name) { + return name.endsWith(".game"); + } + } + ); + for (File file : files) + { + file.delete(); + } + } + + public static MageVersion getVersion() { + return version; + } + + public static boolean isTestMode() { + return testMode; + } } diff --git a/Mage.Server/src/main/java/mage/server/Room.java b/Mage.Server/src/main/java/mage/server/Room.java index 7c8c662592..12baaa294f 100644 --- a/Mage.Server/src/main/java/mage/server/Room.java +++ b/Mage.Server/src/main/java/mage/server/Room.java @@ -36,6 +36,6 @@ import java.util.UUID; * @author BetaSteward_at_googlemail.com */ public interface Room extends Remote { - public UUID getChatId(); - public UUID getRoomId(); + public UUID getChatId(); + public UUID getRoomId(); } diff --git a/Mage.Server/src/main/java/mage/server/RoomImpl.java b/Mage.Server/src/main/java/mage/server/RoomImpl.java index bad0725492..aca939e722 100644 --- a/Mage.Server/src/main/java/mage/server/RoomImpl.java +++ b/Mage.Server/src/main/java/mage/server/RoomImpl.java @@ -36,29 +36,29 @@ import java.util.UUID; */ public abstract class RoomImpl implements Room { - private UUID chatId; - private UUID roomId; + private UUID chatId; + private UUID roomId; - public RoomImpl() { - roomId = UUID.randomUUID(); - chatId = ChatManager.getInstance().createChatSession(); - } + public RoomImpl() { + roomId = UUID.randomUUID(); + chatId = ChatManager.getInstance().createChatSession(); + } - /** - * @return the chatId - */ - @Override - public UUID getChatId() { - return chatId; - } + /** + * @return the chatId + */ + @Override + public UUID getChatId() { + return chatId; + } - /** - * @return the roomId - */ - @Override - public UUID getRoomId() { - return roomId; - } + /** + * @return the roomId + */ + @Override + public UUID getRoomId() { + return roomId; + } diff --git a/Mage.Server/src/main/java/mage/server/Session.java b/Mage.Server/src/main/java/mage/server/Session.java index 3d0bbad25c..6a961f2b1f 100644 --- a/Mage.Server/src/main/java/mage/server/Session.java +++ b/Mage.Server/src/main/java/mage/server/Session.java @@ -48,137 +48,137 @@ import java.util.UUID; */ public class Session { - private final static Logger logger = Logger.getLogger(Session.class); + private final static Logger logger = Logger.getLogger(Session.class); - private String sessionId; - private UUID userId; - private String host; - private int messageId = 0; - private Date timeConnected; - private boolean isAdmin = false; - private AsynchInvokerCallbackHandler callbackHandler; + private String sessionId; + private UUID userId; + private String host; + private int messageId = 0; + private Date timeConnected; + private boolean isAdmin = false; + private AsynchInvokerCallbackHandler callbackHandler; - public Session(String sessionId, InvokerCallbackHandler callbackHandler) { - this.sessionId = sessionId; - this.callbackHandler = (AsynchInvokerCallbackHandler) callbackHandler; - this.isAdmin = false; - this.timeConnected = new Date(); - } - - public void registerUser(String userName) throws MageException { - this.isAdmin = false; - if (userName.equals("Admin")) - throw new MageException("User name already in use"); - User user = UserManager.getInstance().createUser(userName, host); - if (user == null) { // user already exists - user = UserManager.getInstance().findUser(userName); - if (user.getHost().equals(host)) { - if (user.getSessionId().isEmpty()) - logger.info("Reconnecting session for " + userName); - else { - //throw new MageException("This machine is already connected"); + public Session(String sessionId, InvokerCallbackHandler callbackHandler) { + this.sessionId = sessionId; + this.callbackHandler = (AsynchInvokerCallbackHandler) callbackHandler; + this.isAdmin = false; + this.timeConnected = new Date(); + } + + public void registerUser(String userName) throws MageException { + this.isAdmin = false; + if (userName.equals("Admin")) + throw new MageException("User name already in use"); + User user = UserManager.getInstance().createUser(userName, host); + if (user == null) { // user already exists + user = UserManager.getInstance().findUser(userName); + if (user.getHost().equals(host)) { + if (user.getSessionId().isEmpty()) + logger.info("Reconnecting session for " + userName); + else { + //throw new MageException("This machine is already connected"); //disconnect previous one logger.info("Disconnecting another user instance: " + userName); UserManager.getInstance().disconnect(user.getId()); } - } - else { - throw new MageException("User name already in use"); - } - } - if (!UserManager.getInstance().connectToSession(sessionId, user.getId())) - throw new MageException("Error connecting"); - this.userId = user.getId(); - } - - public void registerAdmin() { - this.isAdmin = true; - User user = UserManager.getInstance().createUser("Admin", host); + } + else { + throw new MageException("User name already in use"); + } + } + if (!UserManager.getInstance().connectToSession(sessionId, user.getId())) + throw new MageException("Error connecting"); + this.userId = user.getId(); + } + + public void registerAdmin() { + this.isAdmin = true; + User user = UserManager.getInstance().createUser("Admin", host); if (user == null) { user = UserManager.getInstance().findUser("Admin"); } - user.setUserData(new UserData(UserGroup.ADMIN, 0)); - this.userId = user.getId(); - } + user.setUserData(new UserData(UserGroup.ADMIN, 0)); + this.userId = user.getId(); + } - public boolean setUserData(String userName, UserDataView userDataView) { - User user = UserManager.getInstance().findUser(userName); - if (user != null) { - UserData userData = new UserData(UserGroup.PLAYER, userDataView.getAvatarId()); - updateAvatar(userName, userData); - user.setUserData(userData); - return true; - } - return false; - } + public boolean setUserData(String userName, UserDataView userDataView) { + User user = UserManager.getInstance().findUser(userName); + if (user != null) { + UserData userData = new UserData(UserGroup.PLAYER, userDataView.getAvatarId()); + updateAvatar(userName, userData); + user.setUserData(userData); + return true; + } + return false; + } - private void updateAvatar(String userName, UserData userData) { - //TODO: move to separate class - //TODO: add for checking for private key - if (userName.equals("nantuko")) { - userData.setAvatarId(1000); - } else if (userName.equals("i_no_k")) { - userData.setAvatarId(1002); - } else if (userName.equals("Askael")) { - userData.setAvatarId(1004); - } else if (userName.equals("North")) { - userData.setAvatarId(1006); - } else if (userName.equals("BetaSteward")) { - userData.setAvatarId(1008); - } else if (userName.equals("Arching")) { - userData.setAvatarId(1010); - } else if (userName.equals("loki")) { - userData.setAvatarId(1012); - } else if (userName.equals("Alive")) { - userData.setAvatarId(1014); - } else if (userName.equals("Rahan")) { - userData.setAvatarId(1016); - } else if (userName.equals("Ayrat")) { - userData.setAvatarId(1018); - } - } - - public String getId() { - return sessionId; - } - - public void disconnect() { + private void updateAvatar(String userName, UserData userData) { + //TODO: move to separate class + //TODO: add for checking for private key + if (userName.equals("nantuko")) { + userData.setAvatarId(1000); + } else if (userName.equals("i_no_k")) { + userData.setAvatarId(1002); + } else if (userName.equals("Askael")) { + userData.setAvatarId(1004); + } else if (userName.equals("North")) { + userData.setAvatarId(1006); + } else if (userName.equals("BetaSteward")) { + userData.setAvatarId(1008); + } else if (userName.equals("Arching")) { + userData.setAvatarId(1010); + } else if (userName.equals("loki")) { + userData.setAvatarId(1012); + } else if (userName.equals("Alive")) { + userData.setAvatarId(1014); + } else if (userName.equals("Rahan")) { + userData.setAvatarId(1016); + } else if (userName.equals("Ayrat")) { + userData.setAvatarId(1018); + } + } + + public String getId() { + return sessionId; + } + + public void disconnect() { logger.info("session disconnected for user " + userId); - UserManager.getInstance().disconnect(userId); - } - - public void kill() { + UserManager.getInstance().disconnect(userId); + } + + public void kill() { logger.info("session killed for user " + userId); - UserManager.getInstance().removeUser(userId); - } - - synchronized void fireCallback(final ClientCallback call) { - try { - call.setMessageId(messageId++); - callbackHandler.handleCallbackOneway(new Callback(call)); - } catch (HandleCallbackException ex) { - logger.fatal("Session fireCallback error: " + ex.getMessage(), ex); - disconnect(); - } - } + UserManager.getInstance().removeUser(userId); + } - public UUID getUserId() { - return userId; - } + synchronized void fireCallback(final ClientCallback call) { + try { + call.setMessageId(messageId++); + callbackHandler.handleCallbackOneway(new Callback(call)); + } catch (HandleCallbackException ex) { + logger.fatal("Session fireCallback error: " + ex.getMessage(), ex); + disconnect(); + } + } - public boolean isAdmin() { - return isAdmin; - } + public UUID getUserId() { + return userId; + } - public String getHost() { - return host; - } - - public Date getConnectionTime() { - return timeConnected; - } + public boolean isAdmin() { + return isAdmin; + } - void setHost(String hostAddress) { - this.host = hostAddress; - } + public String getHost() { + return host; + } + + public Date getConnectionTime() { + return timeConnected; + } + + void setHost(String hostAddress) { + this.host = hostAddress; + } } diff --git a/Mage.Server/src/main/java/mage/server/SessionManager.java b/Mage.Server/src/main/java/mage/server/SessionManager.java index 00a7d04ccb..42f1bfb19d 100644 --- a/Mage.Server/src/main/java/mage/server/SessionManager.java +++ b/Mage.Server/src/main/java/mage/server/SessionManager.java @@ -45,107 +45,107 @@ import java.util.concurrent.ConcurrentHashMap; */ public class SessionManager { - private final static Logger logger = Logger.getLogger(SessionManager.class); - private final static SessionManager INSTANCE = new SessionManager(); + private final static Logger logger = Logger.getLogger(SessionManager.class); + private final static SessionManager INSTANCE = new SessionManager(); - public static SessionManager getInstance() { - return INSTANCE; - } + public static SessionManager getInstance() { + return INSTANCE; + } - private ConcurrentHashMap sessions = new ConcurrentHashMap(); + private ConcurrentHashMap sessions = new ConcurrentHashMap(); - public Session getSession(String sessionId) { - if (sessions == null || sessionId == null) return null; - return sessions.get(sessionId); - } + public Session getSession(String sessionId) { + if (sessions == null || sessionId == null) return null; + return sessions.get(sessionId); + } - public void createSession(String sessionId, InvokerCallbackHandler callbackHandler) { - Session session = new Session(sessionId, callbackHandler); - sessions.put(sessionId, session); - } - - public boolean registerUser(String sessionId, String userName) throws MageException { - Session session = sessions.get(sessionId); - if (session != null) { - session.registerUser(userName); + public void createSession(String sessionId, InvokerCallbackHandler callbackHandler) { + Session session = new Session(sessionId, callbackHandler); + sessions.put(sessionId, session); + } + + public boolean registerUser(String sessionId, String userName) throws MageException { + Session session = sessions.get(sessionId); + if (session != null) { + session.registerUser(userName); LogServiceImpl.instance.log(LogKeys.KEY_USER_CONNECTED, userName, session.getHost(), sessionId); - logger.info("User " + userName + " connected from " + session.getHost() + " sessionId: " + sessionId); - return true; - } - return false; - } - - public boolean registerAdmin(String sessionId) { - Session session = sessions.get(sessionId); - if (session != null) { - session.registerAdmin(); - LogServiceImpl.instance.log(LogKeys.KEY_ADMIN_CONNECTED, "Admin", session.getHost(), sessionId); - logger.info("Admin connected from " + session.getHost()); - return true; - } - return false; - } + logger.info("User " + userName + " connected from " + session.getHost() + " sessionId: " + sessionId); + return true; + } + return false; + } - public boolean setUserData(String userName, String sessionId, UserDataView userDataView) throws MageException { - Session session = sessions.get(sessionId); - if (session != null) { - session.setUserData(userName, userDataView); - return true; - } - return false; - } - - public synchronized void disconnect(String sessionId, boolean voluntary) { - Session session = sessions.get(sessionId); - sessions.remove(sessionId); - if (session != null) { - if (voluntary) { - session.kill(); + public boolean registerAdmin(String sessionId) { + Session session = sessions.get(sessionId); + if (session != null) { + session.registerAdmin(); + LogServiceImpl.instance.log(LogKeys.KEY_ADMIN_CONNECTED, "Admin", session.getHost(), sessionId); + logger.info("Admin connected from " + session.getHost()); + return true; + } + return false; + } + + public boolean setUserData(String userName, String sessionId, UserDataView userDataView) throws MageException { + Session session = sessions.get(sessionId); + if (session != null) { + session.setUserData(userName, userDataView); + return true; + } + return false; + } + + public synchronized void disconnect(String sessionId, boolean voluntary) { + Session session = sessions.get(sessionId); + sessions.remove(sessionId); + if (session != null) { + if (voluntary) { + session.kill(); LogServiceImpl.instance.log(LogKeys.KEY_SESSION_KILLED, sessionId); } else { - session.disconnect(); + session.disconnect(); LogServiceImpl.instance.log(LogKeys.KEY_SESSION_DISCONNECTED, sessionId); } - } else { + } else { logger.info("could not find session with id " + sessionId); } - } - - public Map getSessions() { - Map map = new HashMap(); - for (Map.Entry entry : sessions.entrySet()) { - map.put(entry.getKey(), entry.getValue()); - } - return map; - } + } - public void disconnectUser(String sessionId, String userSessionId) { - if (isAdmin(sessionId)) { - disconnect(userSessionId, true); + public Map getSessions() { + Map map = new HashMap(); + for (Map.Entry entry : sessions.entrySet()) { + map.put(entry.getKey(), entry.getValue()); + } + return map; + } + + public void disconnectUser(String sessionId, String userSessionId) { + if (isAdmin(sessionId)) { + disconnect(userSessionId, true); LogServiceImpl.instance.log(LogKeys.KEY_SESSION_DISCONNECTED_BY_ADMIN, sessionId, userSessionId); - } - } + } + } - public boolean isAdmin(String sessionId) { - Session admin = sessions.get(sessionId); - if (admin != null) { - return admin.isAdmin(); - } - return false; - } + public boolean isAdmin(String sessionId) { + Session admin = sessions.get(sessionId); + if (admin != null) { + return admin.isAdmin(); + } + return false; + } - public boolean isValidSession(String sessionId) { - if (sessions.containsKey(sessionId)) - return true; - return false; - } + public boolean isValidSession(String sessionId) { + if (sessions.containsKey(sessionId)) + return true; + return false; + } - public User getUser(String sessionId) { - if (sessions.containsKey(sessionId)) { - return UserManager.getInstance().getUser(sessions.get(sessionId).getUserId()); - } - return null; - } + public User getUser(String sessionId) { + if (sessions.containsKey(sessionId)) { + return UserManager.getInstance().getUser(sessions.get(sessionId).getUserId()); + } + return null; + } public boolean extendUserSession(String sessionId) { if (sessions.containsKey(sessionId)) { diff --git a/Mage.Server/src/main/java/mage/server/TableController.java b/Mage.Server/src/main/java/mage/server/TableController.java index aa5d74a42b..1469f9bab9 100644 --- a/Mage.Server/src/main/java/mage/server/TableController.java +++ b/Mage.Server/src/main/java/mage/server/TableController.java @@ -72,274 +72,274 @@ import java.util.concurrent.TimeUnit; */ public class TableController { - private final static Logger logger = Logger.getLogger(TableController.class); + private final static Logger logger = Logger.getLogger(TableController.class); - private UUID userId; - private UUID chatId; - private String controllerName; - private Table table; - private Match match; - private MatchOptions options; - private Tournament tournament; - private ConcurrentHashMap userPlayerMap = new ConcurrentHashMap(); - - private ScheduledFuture futureTimeout; - protected static ScheduledExecutorService timeoutExecutor = ThreadExecutor.getInstance().getTimeoutExecutor(); + private UUID userId; + private UUID chatId; + private String controllerName; + private Table table; + private Match match; + private MatchOptions options; + private Tournament tournament; + private ConcurrentHashMap userPlayerMap = new ConcurrentHashMap(); - public TableController(UUID roomId, UUID userId, MatchOptions options) { - this.userId = userId; - chatId = ChatManager.getInstance().createChatSession(); - this.options = options; - match = GameFactory.getInstance().createMatch(options.getGameType(), options); - if (userId != null) { - User user = UserManager.getInstance().getUser(userId); - controllerName = user.getName(); - } - else - controllerName = "System"; - table = new Table(roomId, options.getGameType(), options.getName(), controllerName, DeckValidatorFactory.getInstance().createDeckValidator(options.getDeckType()), options.getPlayerTypes(), match); - init(); - } + private ScheduledFuture futureTimeout; + protected static ScheduledExecutorService timeoutExecutor = ThreadExecutor.getInstance().getTimeoutExecutor(); - public TableController(UUID roomId, UUID userId, TournamentOptions options) { - this.userId = userId; - chatId = ChatManager.getInstance().createChatSession(); - tournament = TournamentFactory.getInstance().createTournament(options.getTournamentType(), options); - if (userId != null) { - User user = UserManager.getInstance().getUser(userId); - controllerName = user.getName(); - } - else - controllerName = "System"; - table = new Table(roomId, options.getTournamentType(), options.getName(), controllerName, DeckValidatorFactory.getInstance().createDeckValidator(options.getMatchOptions().getDeckType()), options.getPlayerTypes(), tournament); - } + public TableController(UUID roomId, UUID userId, MatchOptions options) { + this.userId = userId; + chatId = ChatManager.getInstance().createChatSession(); + this.options = options; + match = GameFactory.getInstance().createMatch(options.getGameType(), options); + if (userId != null) { + User user = UserManager.getInstance().getUser(userId); + controllerName = user.getName(); + } + else + controllerName = "System"; + table = new Table(roomId, options.getGameType(), options.getName(), controllerName, DeckValidatorFactory.getInstance().createDeckValidator(options.getDeckType()), options.getPlayerTypes(), match); + init(); + } - private void init() { - match.addTableEventListener( - new Listener () { - @Override - public void event(TableEvent event) { - try { - switch (event.getEventType()) { - case SIDEBOARD: - sideboard(event.getPlayerId(), event.getDeck()); - break; - } - } catch (MageException ex) { - logger.fatal("Table event listener error", ex); - } - } - } - ); - } + public TableController(UUID roomId, UUID userId, TournamentOptions options) { + this.userId = userId; + chatId = ChatManager.getInstance().createChatSession(); + tournament = TournamentFactory.getInstance().createTournament(options.getTournamentType(), options); + if (userId != null) { + User user = UserManager.getInstance().getUser(userId); + controllerName = user.getName(); + } + else + controllerName = "System"; + table = new Table(roomId, options.getTournamentType(), options.getName(), controllerName, DeckValidatorFactory.getInstance().createDeckValidator(options.getMatchOptions().getDeckType()), options.getPlayerTypes(), tournament); + } - public synchronized boolean joinTournament(UUID userId, String name, String playerType, int skill) throws GameException { - if (table.getState() != TableState.WAITING) { - return false; - } - Seat seat = table.getNextAvailableSeat(playerType); - if (seat == null) { - throw new GameException("No available seats."); - } - Player player = createPlayer(name, seat.getPlayerType(), skill); - tournament.addPlayer(player, seat.getPlayerType()); - table.joinTable(player, seat); + private void init() { + match.addTableEventListener( + new Listener () { + @Override + public void event(TableEvent event) { + try { + switch (event.getEventType()) { + case SIDEBOARD: + sideboard(event.getPlayerId(), event.getDeck()); + break; + } + } catch (MageException ex) { + logger.fatal("Table event listener error", ex); + } + } + } + ); + } + + public synchronized boolean joinTournament(UUID userId, String name, String playerType, int skill) throws GameException { + if (table.getState() != TableState.WAITING) { + return false; + } + Seat seat = table.getNextAvailableSeat(playerType); + if (seat == null) { + throw new GameException("No available seats."); + } + Player player = createPlayer(name, seat.getPlayerType(), skill); + tournament.addPlayer(player, seat.getPlayerType()); + table.joinTable(player, seat); User user = UserManager.getInstance().getUser(userId); user.addTable(player.getId(), table); user.joinedTable(table.getRoomId(), table.getId(), true); - logger.info("player joined " + player.getId()); - //only add human players to sessionPlayerMap - if (seat.getPlayer().isHuman()) { - userPlayerMap.put(userId, player.getId()); - } + logger.info("player joined " + player.getId()); + //only add human players to sessionPlayerMap + if (seat.getPlayer().isHuman()) { + userPlayerMap.put(userId, player.getId()); + } - return true; - } + return true; + } - public synchronized boolean joinTable(UUID userId, String name, String playerType, int skill, DeckCardLists deckList) throws MageException { - if (table.getState() != TableState.WAITING) { - return false; - } - Seat seat = table.getNextAvailableSeat(playerType); - if (seat == null) { - throw new GameException("No available seats."); - } - Deck deck = Deck.load(deckList); - if (!Main.isTestMode() && !table.getValidator().validate(deck)) { - throw new InvalidDeckException(name + " has an invalid deck for this format", table.getValidator().getInvalid()); - } - - Player player = createPlayer(name, seat.getPlayerType(), skill); - match.addPlayer(player, deck); - table.joinTable(player, seat); + public synchronized boolean joinTable(UUID userId, String name, String playerType, int skill, DeckCardLists deckList) throws MageException { + if (table.getState() != TableState.WAITING) { + return false; + } + Seat seat = table.getNextAvailableSeat(playerType); + if (seat == null) { + throw new GameException("No available seats."); + } + Deck deck = Deck.load(deckList); + if (!Main.isTestMode() && !table.getValidator().validate(deck)) { + throw new InvalidDeckException(name + " has an invalid deck for this format", table.getValidator().getInvalid()); + } + + Player player = createPlayer(name, seat.getPlayerType(), skill); + match.addPlayer(player, deck); + table.joinTable(player, seat); User user = UserManager.getInstance().getUser(userId); user.addTable(player.getId(), table); user.joinedTable(table.getRoomId(), table.getId(), false); - logger.info("player joined " + player.getId()); - //only add human players to sessionPlayerMap - if (seat.getPlayer().isHuman()) { - userPlayerMap.put(userId, player.getId()); - } + logger.info("player joined " + player.getId()); + //only add human players to sessionPlayerMap + if (seat.getPlayer().isHuman()) { + userPlayerMap.put(userId, player.getId()); + } - return true; - } + return true; + } - public void addPlayer(UUID userId, Player player, String playerType, Deck deck) throws GameException { - if (table.getState() != TableState.WAITING) { - return; - } - Seat seat = table.getNextAvailableSeat(playerType); - if (seat == null) { - throw new GameException("No available seats."); - } - match.addPlayer(player, deck); - table.joinTable(player, seat); - if (player.isHuman()) { - userPlayerMap.put(userId, player.getId()); - } - } - - public synchronized boolean submitDeck(UUID userId, DeckCardLists deckList) throws MageException { - UUID playerId = userPlayerMap.get(userId); - if (table.getState() != TableState.SIDEBOARDING && table.getState() != TableState.CONSTRUCTING) { - return false; - } - Deck deck = Deck.load(deckList); - if (!Main.isTestMode() && !table.getValidator().validate(deck)) { - throw new InvalidDeckException("Invalid deck for this format", table.getValidator().getInvalid()); - } - submitDeck(userId, playerId, deck); - return true; - } + public void addPlayer(UUID userId, Player player, String playerType, Deck deck) throws GameException { + if (table.getState() != TableState.WAITING) { + return; + } + Seat seat = table.getNextAvailableSeat(playerType); + if (seat == null) { + throw new GameException("No available seats."); + } + match.addPlayer(player, deck); + table.joinTable(player, seat); + if (player.isHuman()) { + userPlayerMap.put(userId, player.getId()); + } + } - public void updateDeck(UUID userId, DeckCardLists deckList) throws MageException { - UUID playerId = userPlayerMap.get(userId); - if (table.getState() != TableState.SIDEBOARDING && table.getState() != TableState.CONSTRUCTING) { - return; - } - Deck deck = Deck.load(deckList); - updateDeck(userId, playerId, deck); - } + public synchronized boolean submitDeck(UUID userId, DeckCardLists deckList) throws MageException { + UUID playerId = userPlayerMap.get(userId); + if (table.getState() != TableState.SIDEBOARDING && table.getState() != TableState.CONSTRUCTING) { + return false; + } + Deck deck = Deck.load(deckList); + if (!Main.isTestMode() && !table.getValidator().validate(deck)) { + throw new InvalidDeckException("Invalid deck for this format", table.getValidator().getInvalid()); + } + submitDeck(userId, playerId, deck); + return true; + } + + public void updateDeck(UUID userId, DeckCardLists deckList) throws MageException { + UUID playerId = userPlayerMap.get(userId); + if (table.getState() != TableState.SIDEBOARDING && table.getState() != TableState.CONSTRUCTING) { + return; + } + Deck deck = Deck.load(deckList); + updateDeck(userId, playerId, deck); + } private void submitDeck(UUID userId, UUID playerId, Deck deck) { - if (table.getState() == TableState.SIDEBOARDING) { - match.submitDeck(playerId, deck); + if (table.getState() == TableState.SIDEBOARDING) { + match.submitDeck(playerId, deck); UserManager.getInstance().getUser(userId).removeSideboarding(table.getId()); - } - else { - TournamentManager.getInstance().submitDeck(tournament.getId(), playerId, deck); + } + else { + TournamentManager.getInstance().submitDeck(tournament.getId(), playerId, deck); UserManager.getInstance().getUser(userId).removeConstructing(table.getId()); - } - } + } + } private void updateDeck(UUID userId, UUID playerId, Deck deck) { - if (table.getState() == TableState.SIDEBOARDING) { - match.updateDeck(playerId, deck); - } - else { - TournamentManager.getInstance().updateDeck(tournament.getId(), playerId, deck); - } - } + if (table.getState() == TableState.SIDEBOARDING) { + match.updateDeck(playerId, deck); + } + else { + TournamentManager.getInstance().updateDeck(tournament.getId(), playerId, deck); + } + } public boolean watchTable(UUID userId) { - if (table.getState() != TableState.DUELING) { - return false; - } - UserManager.getInstance().getUser(userId).watchGame(match.getGame().getId()); - return true; - } + if (table.getState() != TableState.DUELING) { + return false; + } + UserManager.getInstance().getUser(userId).watchGame(match.getGame().getId()); + return true; + } - public boolean replayTable(UUID userId) { - if (table.getState() != TableState.FINISHED) { - return false; - } - ReplayManager.getInstance().replayGame(table.getId(), userId); - return true; - } + public boolean replayTable(UUID userId) { + if (table.getState() != TableState.FINISHED) { + return false; + } + ReplayManager.getInstance().replayGame(table.getId(), userId); + return true; + } - private Player createPlayer(String name, String playerType, int skill) { - Player player; - if (options == null) { - player = PlayerFactory.getInstance().createPlayer(playerType, name, RangeOfInfluence.ALL, skill); - } - else { - player = PlayerFactory.getInstance().createPlayer(playerType, name, options.getRange(), skill); - } + private Player createPlayer(String name, String playerType, int skill) { + Player player; + if (options == null) { + player = PlayerFactory.getInstance().createPlayer(playerType, name, RangeOfInfluence.ALL, skill); + } + else { + player = PlayerFactory.getInstance().createPlayer(playerType, name, options.getRange(), skill); + } if (player != null) logger.info("Player created " + player.getId()); - return player; - } + return player; + } - public void kill(UUID userId) { - leaveTable(userId); - userPlayerMap.remove(userId); - } - - public synchronized void leaveTable(UUID userId) { - if (table.getState() == TableState.WAITING || table.getState() == TableState.STARTING) - table.leaveTable(userPlayerMap.get(userId)); - } + public void kill(UUID userId) { + leaveTable(userId); + userPlayerMap.remove(userId); + } - public synchronized void startMatch(UUID userId) { - if (userId.equals(this.userId)) { - startMatch(); - } - } + public synchronized void leaveTable(UUID userId) { + if (table.getState() == TableState.WAITING || table.getState() == TableState.STARTING) + table.leaveTable(userPlayerMap.get(userId)); + } - public synchronized void startChallenge(UUID userId, UUID challengeId) { - if (userId.equals(this.userId)) { - try { - match.startMatch(); - match.startGame(); - table.initGame(); - GameOptions options = new GameOptions(); - options.testMode = true; -// match.getGame().setGameOptions(options); - GameManager.getInstance().createGameSession(match.getGame(), userPlayerMap, table.getId(), null); - ChallengeManager.getInstance().prepareChallenge(getPlayerId(), match); - for (Entry entry: userPlayerMap.entrySet()) { - UserManager.getInstance().getUser(entry.getKey()).gameStarted(match.getGame().getId(), entry.getValue()); - } - } catch (GameException ex) { - logger.fatal(null, ex); - } - } - } + public synchronized void startMatch(UUID userId) { + if (userId.equals(this.userId)) { + startMatch(); + } + } - private UUID getPlayerId() throws GameException { - UUID playerId = null; - for (Entry entry : userPlayerMap.entrySet()) { - playerId = entry.getValue(); - break; - } - if (playerId == null) - throw new GameException("Couldn't find a player in challenge mode."); - return playerId; - } + public synchronized void startChallenge(UUID userId, UUID challengeId) { + if (userId.equals(this.userId)) { + try { + match.startMatch(); + match.startGame(); + table.initGame(); + GameOptions options = new GameOptions(); + options.testMode = true; +// match.getGame().setGameOptions(options); + GameManager.getInstance().createGameSession(match.getGame(), userPlayerMap, table.getId(), null); + ChallengeManager.getInstance().prepareChallenge(getPlayerId(), match); + for (Entry entry: userPlayerMap.entrySet()) { + UserManager.getInstance().getUser(entry.getKey()).gameStarted(match.getGame().getId(), entry.getValue()); + } + } catch (GameException ex) { + logger.fatal(null, ex); + } + } + } - public synchronized void startMatch() { - if (table.getState() == TableState.STARTING) { - try { - match.startMatch(); - startGame(null); - } catch (GameException ex) { - logger.fatal("Error starting match ", ex); - match.endGame(); - } - } - } + private UUID getPlayerId() throws GameException { + UUID playerId = null; + for (Entry entry : userPlayerMap.entrySet()) { + playerId = entry.getValue(); + break; + } + if (playerId == null) + throw new GameException("Couldn't find a player in challenge mode."); + return playerId; + } - private void startGame(UUID choosingPlayerId) throws GameException { - try { - match.startGame(); - table.initGame(); - GameManager.getInstance().createGameSession(match.getGame(), userPlayerMap, table.getId(), choosingPlayerId); + public synchronized void startMatch() { + if (table.getState() == TableState.STARTING) { + try { + match.startMatch(); + startGame(null); + } catch (GameException ex) { + logger.fatal("Error starting match ", ex); + match.endGame(); + } + } + } + + private void startGame(UUID choosingPlayerId) throws GameException { + try { + match.startGame(); + table.initGame(); + GameManager.getInstance().createGameSession(match.getGame(), userPlayerMap, table.getId(), choosingPlayerId); String creator = null; String opponent = null; - for (Entry entry: userPlayerMap.entrySet()) { - User user = UserManager.getInstance().getUser(entry.getKey()); - if (user != null) { - user.gameStarted(match.getGame().getId(), entry.getValue()); + for (Entry entry: userPlayerMap.entrySet()) { + User user = UserManager.getInstance().getUser(entry.getKey()); + if (user != null) { + user.gameStarted(match.getGame().getId(), entry.getValue()); if (creator == null) { creator = user.getName(); } else { @@ -347,121 +347,121 @@ public class TableController { opponent = user.getName(); } } - } - else { - TableManager.getInstance().removeTable(table.getId()); - GameManager.getInstance().removeGame(match.getGame().getId()); - logger.warn("Unable to find player " + entry.getKey()); - break; - } - } + } + else { + TableManager.getInstance().removeTable(table.getId()); + GameManager.getInstance().removeGame(match.getGame().getId()); + logger.warn("Unable to find player " + entry.getKey()); + break; + } + } ServerMessagesUtil.getInstance().incGamesStarted(); // log about game started LogServiceImpl.instance.log(LogKeys.KEY_GAME_STARTED, String.valueOf(userPlayerMap.size()), creator, opponent); - } - catch (Exception ex) { - logger.fatal("Error starting game", ex); - TableManager.getInstance().removeTable(table.getId()); - GameManager.getInstance().removeGame(match.getGame().getId()); - } - } + } + catch (Exception ex) { + logger.fatal("Error starting game", ex); + TableManager.getInstance().removeTable(table.getId()); + GameManager.getInstance().removeGame(match.getGame().getId()); + } + } - public synchronized void startTournament(UUID userId) { - try { - if (userId.equals(this.userId) && table.getState() == TableState.STARTING) { - TournamentManager.getInstance().createTournamentSession(tournament, userPlayerMap, table.getId()); - for (Entry entry: userPlayerMap.entrySet()) { - User user = UserManager.getInstance().getUser(entry.getKey()); - user.tournamentStarted(tournament.getId(), entry.getValue()); - } - } - } - catch (Exception ex) { - logger.fatal("Error starting tournament", ex); - TableManager.getInstance().removeTable(table.getId()); - TournamentManager.getInstance().kill(tournament.getId(), userId); - } - } + public synchronized void startTournament(UUID userId) { + try { + if (userId.equals(this.userId) && table.getState() == TableState.STARTING) { + TournamentManager.getInstance().createTournamentSession(tournament, userPlayerMap, table.getId()); + for (Entry entry: userPlayerMap.entrySet()) { + User user = UserManager.getInstance().getUser(entry.getKey()); + user.tournamentStarted(tournament.getId(), entry.getValue()); + } + } + } + catch (Exception ex) { + logger.fatal("Error starting tournament", ex); + TableManager.getInstance().removeTable(table.getId()); + TournamentManager.getInstance().kill(tournament.getId(), userId); + } + } - public void startDraft(Draft draft) { - table.initDraft(); - DraftManager.getInstance().createDraftSession(draft, userPlayerMap, table.getId()); - for (Entry entry: userPlayerMap.entrySet()) { - UserManager.getInstance().getUser(entry.getKey()).draftStarted(draft.getId(), entry.getValue()); - } - } + public void startDraft(Draft draft) { + table.initDraft(); + DraftManager.getInstance().createDraftSession(draft, userPlayerMap, table.getId()); + for (Entry entry: userPlayerMap.entrySet()) { + UserManager.getInstance().getUser(entry.getKey()).draftStarted(draft.getId(), entry.getValue()); + } + } - private void sideboard(UUID playerId, Deck deck) throws MageException { - for (Entry entry: userPlayerMap.entrySet()) { - if (entry.getValue().equals(playerId)) { - User user = UserManager.getInstance().getUser(entry.getKey()); + private void sideboard(UUID playerId, Deck deck) throws MageException { + for (Entry entry: userPlayerMap.entrySet()) { + if (entry.getValue().equals(playerId)) { + User user = UserManager.getInstance().getUser(entry.getKey()); int remaining = (int) futureTimeout.getDelay(TimeUnit.SECONDS); if (user != null) - user.sideboard(deck, table.getId(), remaining, options.isLimited()); - break; - } - } - } + user.sideboard(deck, table.getId(), remaining, options.isLimited()); + break; + } + } + } public int getRemainingTime() { return (int) futureTimeout.getDelay(TimeUnit.SECONDS); } - - public void construct() { - table.construct(); - } - + + public void construct() { + table.construct(); + } + public MatchOptions getOptions() { return options; } - public void endGame() { - UUID choosingPlayerId = match.getChooser(); - match.endGame(); - table.endGame(); + public void endGame() { + UUID choosingPlayerId = match.getChooser(); + match.endGame(); + table.endGame(); //if (!match.getGame().isSimulation()) //GameManager.getInstance().saveGame(match.getGame().getId()); - GameManager.getInstance().removeGame(match.getGame().getId()); - try { - if (!match.isMatchOver()) { - table.sideboard(); + GameManager.getInstance().removeGame(match.getGame().getId()); + try { + if (!match.isMatchOver()) { + table.sideboard(); setupTimeout(Match.SIDEBOARD_TIME); - match.sideboard(); + match.sideboard(); cancelTimeout(); - startGame(choosingPlayerId); - } - else { - GamesRoomManager.getInstance().removeTable(table.getId()); + startGame(choosingPlayerId); + } + else { + GamesRoomManager.getInstance().removeTable(table.getId()); match.getGames().clear(); match = null; table = null; - } - } catch (GameException ex) { - logger.fatal(null, ex); - } - } + } + } catch (GameException ex) { + logger.fatal(null, ex); + } + } - private synchronized void setupTimeout(int seconds) { - cancelTimeout(); - if (seconds > 0) { - futureTimeout = timeoutExecutor.schedule( - new Runnable() { - @Override - public void run() { - autoSideboard(); - } - }, - seconds, TimeUnit.SECONDS - ); - } - } - - private synchronized void cancelTimeout() { - if (futureTimeout != null) { - futureTimeout.cancel(false); - } - } + private synchronized void setupTimeout(int seconds) { + cancelTimeout(); + if (seconds > 0) { + futureTimeout = timeoutExecutor.schedule( + new Runnable() { + @Override + public void run() { + autoSideboard(); + } + }, + seconds, TimeUnit.SECONDS + ); + } + } + + private synchronized void cancelTimeout() { + if (futureTimeout != null) { + futureTimeout.cancel(false); + } + } private void autoSideboard() { for (MatchPlayer player: match.getPlayers()) { @@ -469,47 +469,47 @@ public class TableController { match.submitDeck(player.getPlayer().getId(), player.generateDeck()); } } - + public void endDraft(Draft draft) { - for (DraftPlayer player: draft.getPlayers()) { - tournament.getPlayer(player.getPlayer().getId()).setDeck(player.getDeck()); - } - tournament.nextStep(); - } + for (DraftPlayer player: draft.getPlayers()) { + tournament.getPlayer(player.getPlayer().getId()).setDeck(player.getDeck()); + } + tournament.nextStep(); + } - public void endTournament(Tournament tournament) { - //TODO: implement this - } + public void endTournament(Tournament tournament) { + //TODO: implement this + } - public void swapSeats(int seatNum1, int seatNum2) { - if (table.getState() == TableState.STARTING) { - if (seatNum1 >= 0 && seatNum2 >= 0 && seatNum1 < table.getSeats().length && seatNum2 < table.getSeats().length) { - Player swapPlayer = table.getSeats()[seatNum1].getPlayer(); - String swapType = table.getSeats()[seatNum1].getPlayerType(); - table.getSeats()[seatNum1].setPlayer(table.getSeats()[seatNum2].getPlayer()); - table.getSeats()[seatNum1].setPlayerType(table.getSeats()[seatNum2].getPlayerType()); - table.getSeats()[seatNum2].setPlayer(swapPlayer); - table.getSeats()[seatNum2].setPlayerType(swapType); - } - } - } + public void swapSeats(int seatNum1, int seatNum2) { + if (table.getState() == TableState.STARTING) { + if (seatNum1 >= 0 && seatNum2 >= 0 && seatNum1 < table.getSeats().length && seatNum2 < table.getSeats().length) { + Player swapPlayer = table.getSeats()[seatNum1].getPlayer(); + String swapType = table.getSeats()[seatNum1].getPlayerType(); + table.getSeats()[seatNum1].setPlayer(table.getSeats()[seatNum2].getPlayer()); + table.getSeats()[seatNum1].setPlayerType(table.getSeats()[seatNum2].getPlayerType()); + table.getSeats()[seatNum2].setPlayer(swapPlayer); + table.getSeats()[seatNum2].setPlayerType(swapType); + } + } + } - public boolean isOwner(UUID userId) { + public boolean isOwner(UUID userId) { if (userId == null) return false; - return userId.equals(this.userId); - } + return userId.equals(this.userId); + } - public Table getTable() { - return table; - } + public Table getTable() { + return table; + } - public UUID getChatId() { - return chatId; - } + public UUID getChatId() { + return chatId; + } - public Match getMatch() { - return match; - } + public Match getMatch() { + return match; + } } diff --git a/Mage.Server/src/main/java/mage/server/TableManager.java b/Mage.Server/src/main/java/mage/server/TableManager.java index 6c77fc46f8..a2a58ab8f2 100644 --- a/Mage.Server/src/main/java/mage/server/TableManager.java +++ b/Mage.Server/src/main/java/mage/server/TableManager.java @@ -50,186 +50,186 @@ import mage.server.game.GamesRoomManager; */ public class TableManager { - private final static TableManager INSTANCE = new TableManager(); - //private final static Logger logger = Logger.getLogger(TableManager.class); + private final static TableManager INSTANCE = new TableManager(); + //private final static Logger logger = Logger.getLogger(TableManager.class); - private ConcurrentHashMap controllers = new ConcurrentHashMap(); - private ConcurrentHashMap tables = new ConcurrentHashMap(); + private ConcurrentHashMap controllers = new ConcurrentHashMap(); + private ConcurrentHashMap tables = new ConcurrentHashMap(); - public static TableManager getInstance() { - return INSTANCE; - } + public static TableManager getInstance() { + return INSTANCE; + } - public Table createTable(UUID roomId, UUID userId, MatchOptions options) { - TableController tableController = new TableController(roomId, userId, options); - controllers.put(tableController.getTable().getId(), tableController); - tables.put(tableController.getTable().getId(), tableController.getTable()); - return tableController.getTable(); - } + public Table createTable(UUID roomId, UUID userId, MatchOptions options) { + TableController tableController = new TableController(roomId, userId, options); + controllers.put(tableController.getTable().getId(), tableController); + tables.put(tableController.getTable().getId(), tableController.getTable()); + return tableController.getTable(); + } - public Table createTable(UUID roomId, MatchOptions options) { - TableController tableController = new TableController(roomId, null, options); - controllers.put(tableController.getTable().getId(), tableController); - tables.put(tableController.getTable().getId(), tableController.getTable()); - return tableController.getTable(); - } + public Table createTable(UUID roomId, MatchOptions options) { + TableController tableController = new TableController(roomId, null, options); + controllers.put(tableController.getTable().getId(), tableController); + tables.put(tableController.getTable().getId(), tableController.getTable()); + return tableController.getTable(); + } - public Table createTournamentTable(UUID roomId, UUID userId, TournamentOptions options) { - TableController tableController = new TableController(roomId, userId, options); - controllers.put(tableController.getTable().getId(), tableController); - tables.put(tableController.getTable().getId(), tableController.getTable()); - return tableController.getTable(); - } + public Table createTournamentTable(UUID roomId, UUID userId, TournamentOptions options) { + TableController tableController = new TableController(roomId, userId, options); + controllers.put(tableController.getTable().getId(), tableController); + tables.put(tableController.getTable().getId(), tableController.getTable()); + return tableController.getTable(); + } - public Table getTable(UUID tableId) { - return tables.get(tableId); - } + public Table getTable(UUID tableId) { + return tables.get(tableId); + } - public Match getMatch(UUID tableId) { - if (controllers.containsKey(tableId)) - return controllers.get(tableId).getMatch(); - return null; - } + public Match getMatch(UUID tableId) { + if (controllers.containsKey(tableId)) + return controllers.get(tableId).getMatch(); + return null; + } - public Collection getTables() { - return tables.values(); - } + public Collection
getTables() { + return tables.values(); + } public TableController getController(UUID tableId) { return controllers.get(tableId); } - - public boolean joinTable(UUID userId, UUID tableId, String name, String playerType, int skill, DeckCardLists deckList) throws MageException { - if (controllers.containsKey(tableId)) - return controllers.get(tableId).joinTable(userId, name, playerType, skill, deckList); - return false; - } - public boolean joinTournament(UUID userId, UUID tableId, String name, String playerType, int skill) throws GameException { - if (controllers.containsKey(tableId)) - return controllers.get(tableId).joinTournament(userId, name, playerType, skill); - return false; - } + public boolean joinTable(UUID userId, UUID tableId, String name, String playerType, int skill, DeckCardLists deckList) throws MageException { + if (controllers.containsKey(tableId)) + return controllers.get(tableId).joinTable(userId, name, playerType, skill, deckList); + return false; + } - public boolean submitDeck(UUID userId, UUID tableId, DeckCardLists deckList) throws MageException { - if (controllers.containsKey(tableId)) - return controllers.get(tableId).submitDeck(userId, deckList); - return false; - } + public boolean joinTournament(UUID userId, UUID tableId, String name, String playerType, int skill) throws GameException { + if (controllers.containsKey(tableId)) + return controllers.get(tableId).joinTournament(userId, name, playerType, skill); + return false; + } - public void updateDeck(UUID userId, UUID tableId, DeckCardLists deckList) throws MageException { - if (controllers.containsKey(tableId)) - controllers.get(tableId).updateDeck(userId, deckList); - } + public boolean submitDeck(UUID userId, UUID tableId, DeckCardLists deckList) throws MageException { + if (controllers.containsKey(tableId)) + return controllers.get(tableId).submitDeck(userId, deckList); + return false; + } + + public void updateDeck(UUID userId, UUID tableId, DeckCardLists deckList) throws MageException { + if (controllers.containsKey(tableId)) + controllers.get(tableId).updateDeck(userId, deckList); + } public void removeSession(UUID userId) { - for (TableController controller: controllers.values()) { - controller.kill(userId); - } - } + for (TableController controller: controllers.values()) { + controller.kill(userId); + } + } - public boolean isTableOwner(UUID tableId, UUID userId) { - if (controllers.containsKey(tableId)) - return controllers.get(tableId).isOwner(userId); - return false; - } + public boolean isTableOwner(UUID tableId, UUID userId) { + if (controllers.containsKey(tableId)) + return controllers.get(tableId).isOwner(userId); + return false; + } - public boolean removeTable(UUID userId, UUID tableId) { - if (isTableOwner(tableId, userId) || UserManager.getInstance().isAdmin(userId)) { - removeTable(tableId); - return true; - } - return false; - } + public boolean removeTable(UUID userId, UUID tableId) { + if (isTableOwner(tableId, userId) || UserManager.getInstance().isAdmin(userId)) { + removeTable(tableId); + return true; + } + return false; + } - public void leaveTable(UUID userId, UUID tableId) { - if (controllers.containsKey(tableId)) - controllers.get(tableId).leaveTable(userId); - } + public void leaveTable(UUID userId, UUID tableId) { + if (controllers.containsKey(tableId)) + controllers.get(tableId).leaveTable(userId); + } - public UUID getChatId(UUID tableId) { - if (controllers.containsKey(tableId)) - return controllers.get(tableId).getChatId(); - return null; - } + public UUID getChatId(UUID tableId) { + if (controllers.containsKey(tableId)) + return controllers.get(tableId).getChatId(); + return null; + } - public void startMatch(UUID userId, UUID roomId, UUID tableId) { - if (controllers.containsKey(tableId)) - controllers.get(tableId).startMatch(userId); - } + public void startMatch(UUID userId, UUID roomId, UUID tableId) { + if (controllers.containsKey(tableId)) + controllers.get(tableId).startMatch(userId); + } - public void startMatch(UUID roomId, UUID tableId) { - if (controllers.containsKey(tableId)) - controllers.get(tableId).startMatch(); - } + public void startMatch(UUID roomId, UUID tableId) { + if (controllers.containsKey(tableId)) + controllers.get(tableId).startMatch(); + } - public void startChallenge(UUID userId, UUID roomId, UUID tableId, UUID challengeId) { - if (controllers.containsKey(tableId)) - controllers.get(tableId).startChallenge(userId, challengeId); - } + public void startChallenge(UUID userId, UUID roomId, UUID tableId, UUID challengeId) { + if (controllers.containsKey(tableId)) + controllers.get(tableId).startChallenge(userId, challengeId); + } - public void startTournament(UUID userId, UUID roomId, UUID tableId) { - if (controllers.containsKey(tableId)) - controllers.get(tableId).startTournament(userId); - } + public void startTournament(UUID userId, UUID roomId, UUID tableId) { + if (controllers.containsKey(tableId)) + controllers.get(tableId).startTournament(userId); + } - public void startDraft(UUID tableId, Draft draft) { - if (controllers.containsKey(tableId)) - controllers.get(tableId).startDraft(draft); - } + public void startDraft(UUID tableId, Draft draft) { + if (controllers.containsKey(tableId)) + controllers.get(tableId).startDraft(draft); + } - public boolean watchTable(UUID userId, UUID tableId) { - if (controllers.containsKey(tableId)) - return controllers.get(tableId).watchTable(userId); - return false; - } + public boolean watchTable(UUID userId, UUID tableId) { + if (controllers.containsKey(tableId)) + return controllers.get(tableId).watchTable(userId); + return false; + } - public boolean replayTable(UUID userId, UUID tableId) { - if (controllers.containsKey(tableId)) - return controllers.get(tableId).replayTable(userId); - return false; - } + public boolean replayTable(UUID userId, UUID tableId) { + if (controllers.containsKey(tableId)) + return controllers.get(tableId).replayTable(userId); + return false; + } - public void endGame(UUID tableId) { - if (controllers.containsKey(tableId)) - controllers.get(tableId).endGame(); - } + public void endGame(UUID tableId) { + if (controllers.containsKey(tableId)) + controllers.get(tableId).endGame(); + } - public void endDraft(UUID tableId, Draft draft) { - if (controllers.containsKey(tableId)) - controllers.get(tableId).endDraft(draft); - } + public void endDraft(UUID tableId, Draft draft) { + if (controllers.containsKey(tableId)) + controllers.get(tableId).endDraft(draft); + } - public void endTournament(UUID tableId, Tournament tournament) { - if (controllers.containsKey(tableId)) - controllers.get(tableId).endTournament(tournament); - } + public void endTournament(UUID tableId, Tournament tournament) { + if (controllers.containsKey(tableId)) + controllers.get(tableId).endTournament(tournament); + } - public void swapSeats(UUID tableId, UUID userId, int seatNum1, int seatNum2) { - if (controllers.containsKey(tableId) && isTableOwner(tableId, userId)) { - controllers.get(tableId).swapSeats(seatNum1, seatNum2); - } - } + public void swapSeats(UUID tableId, UUID userId, int seatNum1, int seatNum2) { + if (controllers.containsKey(tableId) && isTableOwner(tableId, userId)) { + controllers.get(tableId).swapSeats(seatNum1, seatNum2); + } + } - public void construct(UUID tableId) { - if (controllers.containsKey(tableId)) - controllers.get(tableId).construct(); - } + public void construct(UUID tableId) { + if (controllers.containsKey(tableId)) + controllers.get(tableId).construct(); + } - public void addPlayer(UUID userId, UUID tableId, Player player, String playerType, Deck deck) throws GameException { - if (controllers.containsKey(tableId)) - controllers.get(tableId).addPlayer(userId, player, playerType, deck); - } + public void addPlayer(UUID userId, UUID tableId, Player player, String playerType, Deck deck) throws GameException { + if (controllers.containsKey(tableId)) + controllers.get(tableId).addPlayer(userId, player, playerType, deck); + } - public void removeTable(UUID tableId) { - if (tables.containsKey(tableId)) { - Table table = tables.get(tableId); - controllers.remove(tableId); - tables.remove(tableId); - GamesRoomManager.getInstance().removeTable(tableId); - if (table.getMatch() != null && table.getMatch().getGame() != null) - table.getMatch().getGame().end(); - } - } + public void removeTable(UUID tableId) { + if (tables.containsKey(tableId)) { + Table table = tables.get(tableId); + controllers.remove(tableId); + tables.remove(tableId); + GamesRoomManager.getInstance().removeTable(tableId); + if (table.getMatch() != null && table.getMatch().getGame() != null) + table.getMatch().getGame().end(); + } + } } diff --git a/Mage.Server/src/main/java/mage/server/User.java b/Mage.Server/src/main/java/mage/server/User.java index f653f98305..0a529648eb 100644 --- a/Mage.Server/src/main/java/mage/server/User.java +++ b/Mage.Server/src/main/java/mage/server/User.java @@ -50,161 +50,161 @@ import java.util.UUID; */ public class User { - private final static Logger logger = Logger.getLogger(User.class); + private final static Logger logger = Logger.getLogger(User.class); public enum UserState { - Created, Connected, Disconnected, Reconnected; - } - - private UUID userId = UUID.randomUUID(); - private String userName; - private String sessionId = ""; - private String host; - private Date connectionTime = new Date(); - private Date lastActivity = new Date(); - private UserState userState; + Created, Connected, Disconnected, Reconnected; + } + + private UUID userId = UUID.randomUUID(); + private String userName; + private String sessionId = ""; + private String host; + private Date connectionTime = new Date(); + private Date lastActivity = new Date(); + private UserState userState; private Map tables = new HashMap(); - private Map gameSessions = new HashMap(); - private Map draftSessions = new HashMap(); - private Map tournamentSessions = new HashMap(); + private Map gameSessions = new HashMap(); + private Map draftSessions = new HashMap(); + private Map tournamentSessions = new HashMap(); private Map constructing = new HashMap(); private Map sideboarding = new HashMap(); - private UserData userData; - - public User(String userName, String host) { - this.userName = userName; - this.host = host; - this.userState = UserState.Created; - } - - public String getName() { - return userName; - } - - public UUID getId() { - return userId; - } - - public String getHost() { - return host; - } - - public String getSessionId() { - return sessionId; - } - - public void setSessionId(String sessionId) { - this.sessionId = sessionId; - if (sessionId.isEmpty()) { - userState = UserState.Disconnected; + private UserData userData; + + public User(String userName, String host) { + this.userName = userName; + this.host = host; + this.userState = UserState.Created; + } + + public String getName() { + return userName; + } + + public UUID getId() { + return userId; + } + + public String getHost() { + return host; + } + + public String getSessionId() { + return sessionId; + } + + public void setSessionId(String sessionId) { + this.sessionId = sessionId; + if (sessionId.isEmpty()) { + userState = UserState.Disconnected; logger.info("User " + userName + " disconnected"); } else if (userState == UserState.Created) { - userState = UserState.Connected; + userState = UserState.Connected; logger.info("User " + userName + " created"); } else { - userState = UserState.Reconnected; - reconnect(); + userState = UserState.Reconnected; + reconnect(); logger.info("User " + userName + " reconnected"); - } - } - - public boolean isConnected() { - return userState == UserState.Connected || userState == UserState.Reconnected; - } - - public Date getConnectionTime() { - return connectionTime; - } + } + } - public synchronized void fireCallback(final ClientCallback call) { - if (isConnected()) { - Session session = SessionManager.getInstance().getSession(sessionId); + public boolean isConnected() { + return userState == UserState.Connected || userState == UserState.Reconnected; + } + + public Date getConnectionTime() { + return connectionTime; + } + + public synchronized void fireCallback(final ClientCallback call) { + if (isConnected()) { + Session session = SessionManager.getInstance().getSession(sessionId); if (session != null) - session.fireCallback(call); - } - } + session.fireCallback(call); + } + } - public void joinedTable(final UUID roomId, final UUID tableId, boolean isTournament) { - fireCallback(new ClientCallback("joinedTable", tableId, new TableClientMessage(roomId, tableId, isTournament))); - } + public void joinedTable(final UUID roomId, final UUID tableId, boolean isTournament) { + fireCallback(new ClientCallback("joinedTable", tableId, new TableClientMessage(roomId, tableId, isTournament))); + } - public void gameStarted(final UUID gameId, final UUID playerId) { - fireCallback(new ClientCallback("startGame", gameId, new TableClientMessage(gameId, playerId))); - } + public void gameStarted(final UUID gameId, final UUID playerId) { + fireCallback(new ClientCallback("startGame", gameId, new TableClientMessage(gameId, playerId))); + } - public void draftStarted(final UUID draftId, final UUID playerId) { - fireCallback(new ClientCallback("startDraft", draftId, new TableClientMessage(draftId, playerId))); - } + public void draftStarted(final UUID draftId, final UUID playerId) { + fireCallback(new ClientCallback("startDraft", draftId, new TableClientMessage(draftId, playerId))); + } - public void tournamentStarted(final UUID tournamentId, final UUID playerId) { - fireCallback(new ClientCallback("startTournament", tournamentId, new TableClientMessage(tournamentId, playerId))); - } + public void tournamentStarted(final UUID tournamentId, final UUID playerId) { + fireCallback(new ClientCallback("startTournament", tournamentId, new TableClientMessage(tournamentId, playerId))); + } - public void sideboard(final Deck deck, final UUID tableId, final int time, boolean limited) { - fireCallback(new ClientCallback("sideboard", tableId, new TableClientMessage(deck, tableId, time, limited))); + public void sideboard(final Deck deck, final UUID tableId, final int time, boolean limited) { + fireCallback(new ClientCallback("sideboard", tableId, new TableClientMessage(deck, tableId, time, limited))); sideboarding.put(tableId, deck); - } + } - public void construct(final Deck deck, final UUID tableId, final int time) { - fireCallback(new ClientCallback("construct", tableId, new TableClientMessage(deck, tableId, time))); - } + public void construct(final Deck deck, final UUID tableId, final int time) { + fireCallback(new ClientCallback("construct", tableId, new TableClientMessage(deck, tableId, time))); + } - public void watchGame(final UUID gameId) { - fireCallback(new ClientCallback("watchGame", gameId)); - } + public void watchGame(final UUID gameId) { + fireCallback(new ClientCallback("watchGame", gameId)); + } - public void replayGame(final UUID gameId) { - fireCallback(new ClientCallback("replayGame", gameId)); - } + public void replayGame(final UUID gameId) { + fireCallback(new ClientCallback("replayGame", gameId)); + } - public void sendPlayerUUID(final UUID gameId, final UUID data) { - lastActivity = new Date(); - GameManager.getInstance().sendPlayerUUID(gameId, userId, data); - } + public void sendPlayerUUID(final UUID gameId, final UUID data) { + lastActivity = new Date(); + GameManager.getInstance().sendPlayerUUID(gameId, userId, data); + } - public void sendPlayerString(final UUID gameId, final String data) { - lastActivity = new Date(); - GameManager.getInstance().sendPlayerString(gameId, userId, data); - } + public void sendPlayerString(final UUID gameId, final String data) { + lastActivity = new Date(); + GameManager.getInstance().sendPlayerString(gameId, userId, data); + } - public void sendPlayerBoolean(final UUID gameId, final Boolean data) { - lastActivity = new Date(); - GameManager.getInstance().sendPlayerBoolean(gameId, userId, data); - } + public void sendPlayerBoolean(final UUID gameId, final Boolean data) { + lastActivity = new Date(); + GameManager.getInstance().sendPlayerBoolean(gameId, userId, data); + } + + public void sendPlayerInteger(final UUID gameId, final Integer data) { + lastActivity = new Date(); + GameManager.getInstance().sendPlayerInteger(gameId, userId, data); + } - public void sendPlayerInteger(final UUID gameId, final Integer data) { - lastActivity = new Date(); - GameManager.getInstance().sendPlayerInteger(gameId, userId, data); - } - public void updateLastActivity() { lastActivity = new Date(); } - public boolean isExpired(Date expired) { - return /*userState == UserState.Disconnected && */ lastActivity.before(expired); - } - - private void reconnect() { - for (Entry entry: tables.entrySet()) { + public boolean isExpired(Date expired) { + return /*userState == UserState.Disconnected && */ lastActivity.before(expired); + } + + private void reconnect() { + for (Entry entry: tables.entrySet()) { joinedTable(entry.getValue().getRoomId(), entry.getValue().getId(), entry.getValue().isTournament()); - } - for (Entry entry: tournamentSessions.entrySet()) { - tournamentStarted(entry.getValue().getTournamentId(), entry.getKey()); - entry.getValue().init(); - entry.getValue().update(); - } - for (Entry entry: gameSessions.entrySet()) { - gameStarted(entry.getValue().getGameId(), entry.getKey()); - entry.getValue().init(); - GameManager.getInstance().sendPlayerString(entry.getValue().getGameId(), userId, ""); - } - for (Entry entry: draftSessions.entrySet()) { - draftStarted(entry.getValue().getDraftId(), entry.getKey()); - entry.getValue().init(); - entry.getValue().update(); - } + } + for (Entry entry: tournamentSessions.entrySet()) { + tournamentStarted(entry.getValue().getTournamentId(), entry.getKey()); + entry.getValue().init(); + entry.getValue().update(); + } + for (Entry entry: gameSessions.entrySet()) { + gameStarted(entry.getValue().getGameId(), entry.getKey()); + entry.getValue().init(); + GameManager.getInstance().sendPlayerString(entry.getValue().getGameId(), userId, ""); + } + for (Entry entry: draftSessions.entrySet()) { + draftStarted(entry.getValue().getDraftId(), entry.getKey()); + entry.getValue().init(); + entry.getValue().update(); + } for (Entry entry: constructing.entrySet()) { entry.getValue().construct(0); } @@ -212,36 +212,36 @@ public class User { TableController controller = TableManager.getInstance().getController(entry.getKey()); sideboard(entry.getValue(), entry.getKey(), controller.getRemainingTime(), controller.getOptions().isLimited()); } - } + } + + public void addGame(UUID playerId, GameSession gameSession) { + gameSessions.put(playerId, gameSession); + } + + public void removeGame(UUID playerId) { + gameSessions.remove(playerId); + } + + public void addDraft(UUID playerId, DraftSession draftSession) { + draftSessions.put(playerId, draftSession); + } + + public void removeDraft(UUID playerId) { + draftSessions.remove(playerId); + } + + public void addTournament(UUID playerId, TournamentSession tournamentSession) { + tournamentSessions.put(playerId, tournamentSession); + } + + public void removeTournament(UUID playerId) { + tournamentSessions.remove(playerId); + } - public void addGame(UUID playerId, GameSession gameSession) { - gameSessions.put(playerId, gameSession); - } - - public void removeGame(UUID playerId) { - gameSessions.remove(playerId); - } - - public void addDraft(UUID playerId, DraftSession draftSession) { - draftSessions.put(playerId, draftSession); - } - - public void removeDraft(UUID playerId) { - draftSessions.remove(playerId); - } - - public void addTournament(UUID playerId, TournamentSession tournamentSession) { - tournamentSessions.put(playerId, tournamentSession); - } - - public void removeTournament(UUID playerId) { - tournamentSessions.remove(playerId); - } - public void addTable(UUID playerId, Table table) { tables.put(playerId, table); } - + public void removeTable(UUID playerId) { tables.remove(playerId); } @@ -249,39 +249,39 @@ public class User { public void addConstructing(UUID playerId, TournamentSession tournamentSession) { constructing.put(playerId, tournamentSession); } - + public void removeConstructing(UUID playerId) { constructing.remove(playerId); } - + public void removeSideboarding(UUID tableId) { sideboarding.remove(tableId); } public void kill() { - for (GameSession session: gameSessions.values()) { - session.kill(); - } - for (DraftSession session: draftSessions.values()) { - session.setKilled(); - } - for (TournamentSession session: tournamentSessions.values()) { - session.setKilled(); - } - for (Entry entry: tables.entrySet()) { - entry.getValue().leaveTable(entry.getKey()); + for (GameSession session: gameSessions.values()) { + session.kill(); + } + for (DraftSession session: draftSessions.values()) { + session.setKilled(); + } + for (TournamentSession session: tournamentSessions.values()) { + session.setKilled(); + } + for (Entry entry: tables.entrySet()) { + entry.getValue().leaveTable(entry.getKey()); if (TableManager.getInstance().isTableOwner(entry.getValue().getId(), userId)) { TableManager.getInstance().removeTable(userId, entry.getValue().getId()); } - } - } + } + } - public void setUserData(UserData userData) { - this.userData = userData; - } + public void setUserData(UserData userData) { + this.userData = userData; + } - public UserData getUserData() { - return this.userData; - } + public UserData getUserData() { + return this.userData; + } } diff --git a/Mage.Server/src/main/java/mage/server/UserManager.java b/Mage.Server/src/main/java/mage/server/UserManager.java index c5de8f16c7..d6fb6cf11a 100644 --- a/Mage.Server/src/main/java/mage/server/UserManager.java +++ b/Mage.Server/src/main/java/mage/server/UserManager.java @@ -47,59 +47,59 @@ import java.util.concurrent.TimeUnit; */ public class UserManager { - protected static ScheduledExecutorService expireExecutor = Executors.newSingleThreadScheduledExecutor(); + protected static ScheduledExecutorService expireExecutor = Executors.newSingleThreadScheduledExecutor(); - private final static UserManager INSTANCE = new UserManager(); - private final static Logger logger = Logger.getLogger(UserManager.class); + private final static UserManager INSTANCE = new UserManager(); + private final static Logger logger = Logger.getLogger(UserManager.class); - public static UserManager getInstance() { - return INSTANCE; - } + public static UserManager getInstance() { + return INSTANCE; + } - private UserManager() { - expireExecutor.scheduleAtFixedRate(new Runnable() { - @Override - public void run() { - checkExpired(); - } - }, 60, 60, TimeUnit.SECONDS); - } + private UserManager() { + expireExecutor.scheduleAtFixedRate(new Runnable() { + @Override + public void run() { + checkExpired(); + } + }, 60, 60, TimeUnit.SECONDS); + } - private ConcurrentHashMap users = new ConcurrentHashMap(); + private ConcurrentHashMap users = new ConcurrentHashMap(); - public User createUser(String userName, String host) { - if (findUser(userName) != null) - return null; //user already exists - User user = new User(userName, host); - users.put(user.getId(), user); - return user; - } - - public User getUser(UUID userId) { - return users.get(userId); - } - - public User findUser(String userName) { - for (User user: users.values()) { - if (user.getName().equals(userName)) - return user; - } - return null; - } - - public Collection getUsers() { - return users.values(); - } - - public boolean connectToSession(String sessionId, UUID userId) { - if (users.containsKey(userId)) { - users.get(userId).setSessionId(sessionId); - return true; - } - return false; - } - - public void disconnect(UUID userId) { + public User createUser(String userName, String host) { + if (findUser(userName) != null) + return null; //user already exists + User user = new User(userName, host); + users.put(user.getId(), user); + return user; + } + + public User getUser(UUID userId) { + return users.get(userId); + } + + public User findUser(String userName) { + for (User user: users.values()) { + if (user.getName().equals(userName)) + return user; + } + return null; + } + + public Collection getUsers() { + return users.values(); + } + + public boolean connectToSession(String sessionId, UUID userId) { + if (users.containsKey(userId)) { + users.get(userId).setSessionId(sessionId); + return true; + } + return false; + } + + public void disconnect(UUID userId) { if (userId != null) { ChatManager.getInstance().removeUser(userId); if (users.containsKey(userId)) { @@ -108,24 +108,24 @@ public class UserManager { ChatManager.getInstance().broadcast(userId, "has lost connection", MessageColor.BLACK); } } - } - - public boolean isAdmin(UUID userId) { - if (users.containsKey(userId)) { - return users.get(userId).getName().equals("Admin"); - } - return false; - } + } - public void removeUser(UUID userId) { - if (users.containsKey(userId)) { + public boolean isAdmin(UUID userId) { + if (users.containsKey(userId)) { + return users.get(userId).getName().equals("Admin"); + } + return false; + } + + public void removeUser(UUID userId) { + if (users.containsKey(userId)) { logger.info("user removed" + userId); - users.get(userId).setSessionId(""); - ChatManager.getInstance().broadcast(userId, "has disconnected", MessageColor.BLACK); - users.get(userId).kill(); - users.remove(userId); - } - } + users.get(userId).setSessionId(""); + ChatManager.getInstance().broadcast(userId, "has disconnected", MessageColor.BLACK); + users.get(userId).kill(); + users.remove(userId); + } + } public boolean extendUserSession(UUID userId) { if (users.containsKey(userId)) { @@ -134,17 +134,17 @@ public class UserManager { } return false; } - - private void checkExpired() { - Calendar expired = Calendar.getInstance(); - expired.add(Calendar.MINUTE, -3) ; - for (User user: users.values()) { - if (user.isExpired(expired.getTime())) { + + private void checkExpired() { + Calendar expired = Calendar.getInstance(); + expired.add(Calendar.MINUTE, -3) ; + for (User user: users.values()) { + if (user.isExpired(expired.getTime())) { logger.info(user.getName() + " session expired " + user.getId()); - user.kill(); - users.remove(user.getId()); - } - } - } - + user.kill(); + users.remove(user.getId()); + } + } + } + } 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 95908b881b..14311e7ba7 100644 --- a/Mage.Server/src/main/java/mage/server/challenge/ChallengeManager.java +++ b/Mage.Server/src/main/java/mage/server/challenge/ChallengeManager.java @@ -13,15 +13,15 @@ import java.util.UUID; */ public class ChallengeManager { - public static final ChallengeManager fInstance = new ChallengeManager(); + public static final ChallengeManager fInstance = new ChallengeManager(); - public static ChallengeManager getInstance() { - return fInstance; - } + public static ChallengeManager getInstance() { + return fInstance; + } - public void prepareChallenge(UUID playerId, Match match) { - Map commands = new HashMap(); - commands.put(Constants.Zone.OUTSIDE, "life:3"); - match.getGame().cheat(playerId, commands); - } + public void prepareChallenge(UUID playerId, Match match) { + Map commands = new HashMap(); + commands.put(Constants.Zone.OUTSIDE, "life:3"); + match.getGame().cheat(playerId, commands); + } } 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 6d65b7e287..d232f237bc 100644 --- a/Mage.Server/src/main/java/mage/server/draft/DraftController.java +++ b/Mage.Server/src/main/java/mage/server/draft/DraftController.java @@ -51,163 +51,163 @@ import org.apache.log4j.Logger; */ public class DraftController { - private final static Logger logger = Logger.getLogger(GameController.class); - public static final String INIT_FILE_PATH = "config" + File.separator + "init.txt"; + private final static Logger logger = Logger.getLogger(GameController.class); + public static final String INIT_FILE_PATH = "config" + File.separator + "init.txt"; - private ConcurrentHashMap draftSessions = new ConcurrentHashMap(); - private ConcurrentHashMap userPlayerMap; - private UUID draftSessionId; - private Draft draft; - private UUID tableId; + private ConcurrentHashMap draftSessions = new ConcurrentHashMap(); + private ConcurrentHashMap userPlayerMap; + private UUID draftSessionId; + private Draft draft; + private UUID tableId; - public DraftController(Draft draft, ConcurrentHashMap userPlayerMap, UUID tableId) { - draftSessionId = UUID.randomUUID(); - this.userPlayerMap = userPlayerMap; - this.draft = draft; - this.tableId = tableId; - init(); - } + public DraftController(Draft draft, ConcurrentHashMap userPlayerMap, UUID tableId) { + draftSessionId = UUID.randomUUID(); + this.userPlayerMap = userPlayerMap; + this.draft = draft; + this.tableId = tableId; + init(); + } - private void init() { - draft.addTableEventListener( - new Listener () { - @Override - public void event(TableEvent event) { - try { - switch (event.getEventType()) { - case UPDATE: - updateDraft(); - break; - case END: - endDraft(); - break; - } - } - catch (MageException ex) { - logger.fatal("Table event listener error", ex); - } - } - } - ); - draft.addPlayerQueryEventListener( - new Listener () { - @Override - public void event(PlayerQueryEvent event) { - try { - switch (event.getQueryType()) { - case PICK_CARD: - pickCard(event.getPlayerId(), event.getMax()); - break; - } - } - catch (MageException ex) { - logger.fatal("Table event listener error", ex); - } - } - } - ); - for (DraftPlayer player: draft.getPlayers()) { - if (!player.getPlayer().isHuman()) { - player.setJoined(); - logger.info("player " + player.getPlayer().getId() + " has joined draft " + draft.getId()); - } - } - checkStart(); - } + private void init() { + draft.addTableEventListener( + new Listener () { + @Override + public void event(TableEvent event) { + try { + switch (event.getEventType()) { + case UPDATE: + updateDraft(); + break; + case END: + endDraft(); + break; + } + } + catch (MageException ex) { + logger.fatal("Table event listener error", ex); + } + } + } + ); + draft.addPlayerQueryEventListener( + new Listener () { + @Override + public void event(PlayerQueryEvent event) { + try { + switch (event.getQueryType()) { + case PICK_CARD: + pickCard(event.getPlayerId(), event.getMax()); + break; + } + } + catch (MageException ex) { + logger.fatal("Table event listener error", ex); + } + } + } + ); + for (DraftPlayer player: draft.getPlayers()) { + if (!player.getPlayer().isHuman()) { + player.setJoined(); + logger.info("player " + player.getPlayer().getId() + " has joined draft " + draft.getId()); + } + } + checkStart(); + } - private UUID getPlayerId(UUID userId) { - return userPlayerMap.get(userId); - } + private UUID getPlayerId(UUID userId) { + return userPlayerMap.get(userId); + } - public void join(UUID userId) { - UUID playerId = userPlayerMap.get(userId); - DraftSession draftSession = new DraftSession(draft, userId, playerId); - draftSessions.put(playerId, draftSession); - UserManager.getInstance().getUser(userId).addDraft(playerId, draftSession); - logger.info("User " + UserManager.getInstance().getUser(userId).getName() + " has joined draft " + draft.getId()); - draft.getPlayer(playerId).setJoined(); - checkStart(); - } + public void join(UUID userId) { + UUID playerId = userPlayerMap.get(userId); + DraftSession draftSession = new DraftSession(draft, userId, playerId); + draftSessions.put(playerId, draftSession); + UserManager.getInstance().getUser(userId).addDraft(playerId, draftSession); + logger.info("User " + UserManager.getInstance().getUser(userId).getName() + " has joined draft " + draft.getId()); + draft.getPlayer(playerId).setJoined(); + checkStart(); + } - private synchronized void startDraft() { - for (final Entry entry: draftSessions.entrySet()) { - if (!entry.getValue().init()) { - logger.fatal("Unable to initialize client"); - //TODO: generate client error message - return; - } - } - draft.start(); - } + private synchronized void startDraft() { + for (final Entry entry: draftSessions.entrySet()) { + if (!entry.getValue().init()) { + logger.fatal("Unable to initialize client"); + //TODO: generate client error message + return; + } + } + draft.start(); + } - private void checkStart() { - if (allJoined()) { - ThreadExecutor.getInstance().getCallExecutor().execute( - new Runnable() { - @Override - public void run() { - startDraft(); - } - }); - } - } + private void checkStart() { + if (allJoined()) { + ThreadExecutor.getInstance().getCallExecutor().execute( + new Runnable() { + @Override + public void run() { + startDraft(); + } + }); + } + } - private boolean allJoined() { - if (!draft.allJoined()) - return false; - for (DraftPlayer player: draft.getPlayers()) { - if (player.getPlayer().isHuman() && draftSessions.get(player.getPlayer().getId()) == null) { - return false; - } - } - return true; - } + private boolean allJoined() { + if (!draft.allJoined()) + return false; + for (DraftPlayer player: draft.getPlayers()) { + if (player.getPlayer().isHuman() && draftSessions.get(player.getPlayer().getId()) == null) { + return false; + } + } + return true; + } - private void leave(UUID userId) { - draft.leave(getPlayerId(userId)); - } + private void leave(UUID userId) { + draft.leave(getPlayerId(userId)); + } - private void endDraft() throws MageException { - for (final DraftSession draftSession: draftSessions.values()) { - draftSession.draftOver(); - draftSession.removeDraft(); - } - TableManager.getInstance().endDraft(tableId, draft); - } + private void endDraft() throws MageException { + for (final DraftSession draftSession: draftSessions.values()) { + draftSession.draftOver(); + draftSession.removeDraft(); + } + TableManager.getInstance().endDraft(tableId, draft); + } - public void kill(UUID userId) { - if (userPlayerMap.containsKey(userId)) { - draftSessions.get(userPlayerMap.get(userId)).setKilled(); - draftSessions.remove(userPlayerMap.get(userId)); - leave(userId); - userPlayerMap.remove(userId); - } - } + public void kill(UUID userId) { + if (userPlayerMap.containsKey(userId)) { + draftSessions.get(userPlayerMap.get(userId)).setKilled(); + draftSessions.remove(userPlayerMap.get(userId)); + leave(userId); + userPlayerMap.remove(userId); + } + } - public void timeout(UUID userId) { - if (userPlayerMap.containsKey(userId)) { - draft.autoPick(userPlayerMap.get(userId)); - logger.info("Draft pick timeout - autopick for player: " + userPlayerMap.get(userId)); - } - } + public void timeout(UUID userId) { + if (userPlayerMap.containsKey(userId)) { + draft.autoPick(userPlayerMap.get(userId)); + logger.info("Draft pick timeout - autopick for player: " + userPlayerMap.get(userId)); + } + } - public UUID getSessionId() { - return this.draftSessionId; - } + public UUID getSessionId() { + return this.draftSessionId; + } - public DraftPickView sendCardPick(UUID userId, UUID cardId) { - return draftSessions.get(userPlayerMap.get(userId)).sendCardPick(cardId); - } + public DraftPickView sendCardPick(UUID userId, UUID cardId) { + return draftSessions.get(userPlayerMap.get(userId)).sendCardPick(cardId); + } - private synchronized void updateDraft() throws MageException { - for (final Entry entry: draftSessions.entrySet()) { - entry.getValue().update(); - } - } + private synchronized void updateDraft() throws MageException { + for (final Entry entry: draftSessions.entrySet()) { + entry.getValue().update(); + } + } - private synchronized void pickCard(UUID playerId, int timeout) throws MageException { - if (draftSessions.containsKey(playerId)) - draftSessions.get(playerId).pickCard(timeout); - } + private synchronized void pickCard(UUID playerId, int timeout) throws MageException { + if (draftSessions.containsKey(playerId)) + draftSessions.get(playerId).pickCard(timeout); + } } 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 1e72d3d04b..16f4822b9c 100644 --- a/Mage.Server/src/main/java/mage/server/draft/DraftManager.java +++ b/Mage.Server/src/main/java/mage/server/draft/DraftManager.java @@ -38,50 +38,50 @@ import mage.view.DraftPickView; * @author BetaSteward_at_googlemail.com */ public class DraftManager { - private final static DraftManager INSTANCE = new DraftManager(); + private final static DraftManager INSTANCE = new DraftManager(); - public static DraftManager getInstance() { - return INSTANCE; - } + public static DraftManager getInstance() { + return INSTANCE; + } - private DraftManager() {} + private DraftManager() {} - private ConcurrentHashMap draftControllers = new ConcurrentHashMap(); + private ConcurrentHashMap draftControllers = new ConcurrentHashMap(); - public UUID createDraftSession(Draft draft, ConcurrentHashMap userPlayerMap, UUID tableId) { - DraftController draftController = new DraftController(draft, userPlayerMap, tableId); - draftControllers.put(draft.getId(), draftController); - return draftController.getSessionId(); - } + public UUID createDraftSession(Draft draft, ConcurrentHashMap userPlayerMap, UUID tableId) { + DraftController draftController = new DraftController(draft, userPlayerMap, tableId); + draftControllers.put(draft.getId(), draftController); + return draftController.getSessionId(); + } - public void joinDraft(UUID draftId, UUID userId) { - draftControllers.get(draftId).join(userId); - } + public void joinDraft(UUID draftId, UUID userId) { + draftControllers.get(draftId).join(userId); + } - public void destroyChatSession(UUID gameId) { - draftControllers.remove(gameId); - } + public void destroyChatSession(UUID gameId) { + draftControllers.remove(gameId); + } - public DraftPickView sendCardPick(UUID draftId, UUID userId, UUID cardId) { - return draftControllers.get(draftId).sendCardPick(userId, cardId); - } + public DraftPickView sendCardPick(UUID draftId, UUID userId, UUID cardId) { + return draftControllers.get(draftId).sendCardPick(userId, cardId); + } - public void removeSession(UUID userId) { - for (DraftController controller: draftControllers.values()) { - controller.kill(userId); - } - } + public void removeSession(UUID userId) { + for (DraftController controller: draftControllers.values()) { + controller.kill(userId); + } + } - public void kill(UUID draftId, UUID userId) { - draftControllers.get(draftId).kill(userId); - } + public void kill(UUID draftId, UUID userId) { + draftControllers.get(draftId).kill(userId); + } - public void timeout(UUID gameId, UUID userId) { - draftControllers.get(gameId).timeout(userId); - } + public void timeout(UUID gameId, UUID userId) { + draftControllers.get(gameId).timeout(userId); + } - public void removeDraft(UUID draftId) { - draftControllers.remove(draftId); - } + public void removeDraft(UUID draftId) { + draftControllers.remove(draftId); + } } 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 fc947f6435..f539b4e017 100644 --- a/Mage.Server/src/main/java/mage/server/draft/DraftSession.java +++ b/Mage.Server/src/main/java/mage/server/draft/DraftSession.java @@ -49,126 +49,126 @@ import org.apache.log4j.Logger; */ public class DraftSession { - protected final static Logger logger = Logger.getLogger(DraftSession.class); + protected final static Logger logger = Logger.getLogger(DraftSession.class); - protected UUID userId; - protected UUID playerId; - protected Draft draft; - protected boolean killed = false; + protected UUID userId; + protected UUID playerId; + protected Draft draft; + protected boolean killed = false; - private ScheduledFuture futureTimeout; - protected static ScheduledExecutorService timeoutExecutor = ThreadExecutor.getInstance().getTimeoutExecutor(); + private ScheduledFuture futureTimeout; + protected static ScheduledExecutorService timeoutExecutor = ThreadExecutor.getInstance().getTimeoutExecutor(); - public DraftSession(Draft draft, UUID userId, UUID playerId) { - this.userId = userId; - this.draft = draft; - this.playerId = playerId; - } + public DraftSession(Draft draft, UUID userId, UUID playerId) { + this.userId = userId; + this.draft = draft; + this.playerId = playerId; + } - public boolean init() { - if (!killed) { - User user = UserManager.getInstance().getUser(userId); - if (user != null) { - if (futureTimeout != null && !futureTimeout.isDone()) { - int remaining = (int) futureTimeout.getDelay(TimeUnit.SECONDS); - user.fireCallback(new ClientCallback("draftInit", draft.getId(), new DraftClientMessage(getDraftPickView(remaining)))); - } - return true; - } - } - return false; - } + public boolean init() { + if (!killed) { + User user = UserManager.getInstance().getUser(userId); + if (user != null) { + if (futureTimeout != null && !futureTimeout.isDone()) { + int remaining = (int) futureTimeout.getDelay(TimeUnit.SECONDS); + user.fireCallback(new ClientCallback("draftInit", draft.getId(), new DraftClientMessage(getDraftPickView(remaining)))); + } + return true; + } + } + return false; + } - public void update() { - if (!killed) { - User user = UserManager.getInstance().getUser(userId); - if (user != null) { - user.fireCallback(new ClientCallback("draftUpdate", draft.getId(), getDraftView())); - } - } - } + public void update() { + if (!killed) { + User user = UserManager.getInstance().getUser(userId); + if (user != null) { + user.fireCallback(new ClientCallback("draftUpdate", draft.getId(), getDraftView())); + } + } + } - public void inform(final String message) { - if (!killed) { - User user = UserManager.getInstance().getUser(userId); - if (user != null) { - user.fireCallback(new ClientCallback("draftInform", draft.getId(), new DraftClientMessage(getDraftView(), message))); - } - } - } + public void inform(final String message) { + if (!killed) { + User user = UserManager.getInstance().getUser(userId); + if (user != null) { + user.fireCallback(new ClientCallback("draftInform", draft.getId(), new DraftClientMessage(getDraftView(), message))); + } + } + } - public void draftOver() { - if (!killed) { - User user = UserManager.getInstance().getUser(userId); - if (user != null) { - user.fireCallback(new ClientCallback("draftOver", draft.getId())); - } - } - } + public void draftOver() { + if (!killed) { + User user = UserManager.getInstance().getUser(userId); + if (user != null) { + user.fireCallback(new ClientCallback("draftOver", draft.getId())); + } + } + } - public void pickCard(int timeout) { - if (!killed) { - setupTimeout(timeout); - User user = UserManager.getInstance().getUser(userId); - if (user != null) { - user.fireCallback(new ClientCallback("draftPick", draft.getId(), new DraftClientMessage(getDraftPickView(timeout)))); - } - } - } + public void pickCard(int timeout) { + if (!killed) { + setupTimeout(timeout); + User user = UserManager.getInstance().getUser(userId); + if (user != null) { + user.fireCallback(new ClientCallback("draftPick", draft.getId(), new DraftClientMessage(getDraftPickView(timeout)))); + } + } + } - private synchronized void setupTimeout(int seconds) { - cancelTimeout(); - if (seconds > 0) { - futureTimeout = timeoutExecutor.schedule( - new Runnable() { - @Override - public void run() { - DraftManager.getInstance().timeout(draft.getId(), userId); - } - }, - seconds, TimeUnit.SECONDS - ); - } - } + private synchronized void setupTimeout(int seconds) { + cancelTimeout(); + if (seconds > 0) { + futureTimeout = timeoutExecutor.schedule( + new Runnable() { + @Override + public void run() { + DraftManager.getInstance().timeout(draft.getId(), userId); + } + }, + seconds, TimeUnit.SECONDS + ); + } + } - private synchronized void cancelTimeout() { - if (futureTimeout != null) { - futureTimeout.cancel(false); - } - } + private synchronized void cancelTimeout() { + if (futureTimeout != null) { + futureTimeout.cancel(false); + } + } - protected void handleRemoteException(RemoteException ex) { - logger.fatal("DraftSession error ", ex); - DraftManager.getInstance().kill(draft.getId(), userId); - } + protected void handleRemoteException(RemoteException ex) { + logger.fatal("DraftSession error ", ex); + DraftManager.getInstance().kill(draft.getId(), userId); + } - public void setKilled() { - killed = true; - } + public void setKilled() { + killed = true; + } - public DraftPickView sendCardPick(UUID cardId) { - cancelTimeout(); - if (draft.addPick(playerId, cardId)) - return getDraftPickView(0); - return null; - } + public DraftPickView sendCardPick(UUID cardId) { + cancelTimeout(); + if (draft.addPick(playerId, cardId)) + return getDraftPickView(0); + return null; + } - public void removeDraft() { - User user = UserManager.getInstance().getUser(userId); - if (user != null) - user.removeDraft(playerId); - } + public void removeDraft() { + User user = UserManager.getInstance().getUser(userId); + if (user != null) + user.removeDraft(playerId); + } - private DraftView getDraftView() { - return new DraftView(draft); - } + private DraftView getDraftView() { + return new DraftView(draft); + } - private DraftPickView getDraftPickView(int timeout) { - return new DraftPickView(draft.getPlayer(playerId), timeout); - } + private DraftPickView getDraftPickView(int timeout) { + return new DraftPickView(draft.getPlayer(playerId), timeout); + } - public UUID getDraftId() { - return draft.getId(); - } + public UUID getDraftId() { + return draft.getId(); + } } diff --git a/Mage.Server/src/main/java/mage/server/game/DeckValidatorFactory.java b/Mage.Server/src/main/java/mage/server/game/DeckValidatorFactory.java index 5b0926ef40..feeb67fa55 100644 --- a/Mage.Server/src/main/java/mage/server/game/DeckValidatorFactory.java +++ b/Mage.Server/src/main/java/mage/server/game/DeckValidatorFactory.java @@ -41,40 +41,40 @@ import org.apache.log4j.Logger; */ public class DeckValidatorFactory { - private final static DeckValidatorFactory INSTANCE = new DeckValidatorFactory(); - private final static Logger logger = Logger.getLogger(DeckValidatorFactory.class); + private final static DeckValidatorFactory INSTANCE = new DeckValidatorFactory(); + private final static Logger logger = Logger.getLogger(DeckValidatorFactory.class); - private Map deckTypes = new HashMap(); + private Map deckTypes = new HashMap(); - public static DeckValidatorFactory getInstance() { - return INSTANCE; - } + public static DeckValidatorFactory getInstance() { + return INSTANCE; + } - private DeckValidatorFactory() {} + private DeckValidatorFactory() {} - public DeckValidator createDeckValidator(String deckType) { + public DeckValidator createDeckValidator(String deckType) { - DeckValidator validator; - Constructor con; - try { - con = deckTypes.get(deckType).getConstructor(new Class[]{}); - validator = (DeckValidator)con.newInstance(new Object[] {}); - } catch (Exception ex) { - logger.fatal("DeckValidatorFactory error", ex); - return null; - } - logger.info("Deck validator created: " + validator.getName()); + DeckValidator validator; + Constructor con; + try { + con = deckTypes.get(deckType).getConstructor(new Class[]{}); + validator = (DeckValidator)con.newInstance(new Object[] {}); + } catch (Exception ex) { + logger.fatal("DeckValidatorFactory error", ex); + return null; + } + logger.info("Deck validator created: " + validator.getName()); - return validator; - } + return validator; + } - public Set getDeckTypes() { - return deckTypes.keySet(); - } + public Set getDeckTypes() { + return deckTypes.keySet(); + } - public void addDeckType(String name, Class deckType) { - if (deckType != null) - this.deckTypes.put(name, deckType); - } + public void addDeckType(String name, Class deckType) { + if (deckType != null) + this.deckTypes.put(name, deckType); + } } diff --git a/Mage.Server/src/main/java/mage/server/game/GameCallback.java b/Mage.Server/src/main/java/mage/server/game/GameCallback.java index f686545c34..4f2c092d3b 100644 --- a/Mage.Server/src/main/java/mage/server/game/GameCallback.java +++ b/Mage.Server/src/main/java/mage/server/game/GameCallback.java @@ -36,6 +36,6 @@ import mage.MageException; */ public interface GameCallback { - public void gameResult(String result) throws MageException; - + public void gameResult(String result) throws MageException; + } 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 9d09c2c640..6eeb189cb2 100644 --- a/Mage.Server/src/main/java/mage/server/game/GameController.java +++ b/Mage.Server/src/main/java/mage/server/game/GameController.java @@ -68,458 +68,458 @@ import java.util.zip.GZIPOutputStream; */ public class GameController implements GameCallback { - private static ExecutorService gameExecutor = ThreadExecutor.getInstance().getGameExecutor(); - private final static Logger logger = Logger.getLogger(GameController.class); + private static ExecutorService gameExecutor = ThreadExecutor.getInstance().getGameExecutor(); + private final static Logger logger = Logger.getLogger(GameController.class); - private ConcurrentHashMap gameSessions = new ConcurrentHashMap(); - private ConcurrentHashMap watchers = new ConcurrentHashMap(); - private ConcurrentHashMap userPlayerMap; - private UUID gameSessionId; - private Game game; - private UUID chatId; - private UUID tableId; - private UUID choosingPlayerId; - private Future gameFuture; + private ConcurrentHashMap gameSessions = new ConcurrentHashMap(); + private ConcurrentHashMap watchers = new ConcurrentHashMap(); + private ConcurrentHashMap userPlayerMap; + private UUID gameSessionId; + private Game game; + private UUID chatId; + private UUID tableId; + private UUID choosingPlayerId; + private Future gameFuture; private boolean useTimeout = true; - public GameController(Game game, ConcurrentHashMap userPlayerMap, UUID tableId, UUID choosingPlayerId) { - gameSessionId = UUID.randomUUID(); - this.userPlayerMap = userPlayerMap; - chatId = ChatManager.getInstance().createChatSession(); - this.game = game; - this.tableId = tableId; - this.choosingPlayerId = choosingPlayerId; + public GameController(Game game, ConcurrentHashMap userPlayerMap, UUID tableId, UUID choosingPlayerId) { + gameSessionId = UUID.randomUUID(); + this.userPlayerMap = userPlayerMap; + chatId = ChatManager.getInstance().createChatSession(); + this.game = game; + this.tableId = tableId; + this.choosingPlayerId = choosingPlayerId; for (Player player: game.getPlayers().values()) { if (!player.isHuman()) { useTimeout = false; break; } } - init(); - } + init(); + } - private void init() { - game.addTableEventListener( - new Listener () { - @Override - public void event(TableEvent event) { - try { - switch (event.getEventType()) { - case UPDATE: - updateGame(); - break; - case INFO: - ChatManager.getInstance().broadcast(chatId, "", event.getMessage(), MessageColor.BLACK); - logger.debug(game.getId() + " " + event.getMessage()); - break; - case REVEAL: - revealCards(event.getMessage(), event.getCards()); - break; - case ERROR: - error(event.getMessage(), event.getException()); - break; - } - } catch (MageException ex) { - logger.fatal("Table event listener error ", ex); - } - } - } - ); - game.addPlayerQueryEventListener( - new Listener () { - @Override - public void event(PlayerQueryEvent event) { -// logger.info(event.getPlayerId() + "--" + event.getQueryType() + "--" + event.getMessage()); - try { - switch (event.getQueryType()) { - case ASK: - ask(event.getPlayerId(), event.getMessage()); - break; - case PICK_TARGET: - target(event.getPlayerId(), event.getMessage(), event.getCards(), event.getPerms(), event.getTargets(), event.isRequired(), event.getOptions()); - break; - case PICK_ABILITY: - target(event.getPlayerId(), event.getMessage(), event.getAbilities(), event.isRequired(), event.getOptions()); - break; - case SELECT: - select(event.getPlayerId(), event.getMessage()); - break; - case PLAY_MANA: - playMana(event.getPlayerId(), event.getMessage()); - break; - case PLAY_X_MANA: - playXMana(event.getPlayerId(), event.getMessage()); - break; - case CHOOSE_ABILITY: - chooseAbility(event.getPlayerId(), event.getAbilities()); - break; - case CHOOSE_PILE: - choosePile(event.getPlayerId(), event.getMessage(), event.getPile1(), event.getPile2()); - break; - case CHOOSE_MODE: - chooseMode(event.getPlayerId(), event.getModes()); - break; - case CHOOSE: - choose(event.getPlayerId(), event.getMessage(), event.getChoices()); - break; - case AMOUNT: - amount(event.getPlayerId(), event.getMessage(), event.getMin(), event.getMax()); - break; - case LOOK: - lookAtCards(event.getPlayerId(), event.getMessage(), event.getCards()); - break; - } - } catch (MageException ex) { - logger.fatal("Player event listener error ", ex); - } - } - } - ); - for (Player player: game.getPlayers().values()) { - if (!player.isHuman()) { - ChatManager.getInstance().broadcast(chatId, "", player.getName() + " has joined the game", MessageColor.BLACK); - } - } - checkStart(); - } + private void init() { + game.addTableEventListener( + new Listener () { + @Override + public void event(TableEvent event) { + try { + switch (event.getEventType()) { + case UPDATE: + updateGame(); + break; + case INFO: + ChatManager.getInstance().broadcast(chatId, "", event.getMessage(), MessageColor.BLACK); + logger.debug(game.getId() + " " + event.getMessage()); + break; + case REVEAL: + revealCards(event.getMessage(), event.getCards()); + break; + case ERROR: + error(event.getMessage(), event.getException()); + break; + } + } catch (MageException ex) { + logger.fatal("Table event listener error ", ex); + } + } + } + ); + game.addPlayerQueryEventListener( + new Listener () { + @Override + public void event(PlayerQueryEvent event) { +// logger.info(event.getPlayerId() + "--" + event.getQueryType() + "--" + event.getMessage()); + try { + switch (event.getQueryType()) { + case ASK: + ask(event.getPlayerId(), event.getMessage()); + break; + case PICK_TARGET: + target(event.getPlayerId(), event.getMessage(), event.getCards(), event.getPerms(), event.getTargets(), event.isRequired(), event.getOptions()); + break; + case PICK_ABILITY: + target(event.getPlayerId(), event.getMessage(), event.getAbilities(), event.isRequired(), event.getOptions()); + break; + case SELECT: + select(event.getPlayerId(), event.getMessage()); + break; + case PLAY_MANA: + playMana(event.getPlayerId(), event.getMessage()); + break; + case PLAY_X_MANA: + playXMana(event.getPlayerId(), event.getMessage()); + break; + case CHOOSE_ABILITY: + chooseAbility(event.getPlayerId(), event.getAbilities()); + break; + case CHOOSE_PILE: + choosePile(event.getPlayerId(), event.getMessage(), event.getPile1(), event.getPile2()); + break; + case CHOOSE_MODE: + chooseMode(event.getPlayerId(), event.getModes()); + break; + case CHOOSE: + choose(event.getPlayerId(), event.getMessage(), event.getChoices()); + break; + case AMOUNT: + amount(event.getPlayerId(), event.getMessage(), event.getMin(), event.getMax()); + break; + case LOOK: + lookAtCards(event.getPlayerId(), event.getMessage(), event.getCards()); + break; + } + } catch (MageException ex) { + logger.fatal("Player event listener error ", ex); + } + } + } + ); + for (Player player: game.getPlayers().values()) { + if (!player.isHuman()) { + ChatManager.getInstance().broadcast(chatId, "", player.getName() + " has joined the game", MessageColor.BLACK); + } + } + checkStart(); + } - private UUID getPlayerId(UUID userId) { - return userPlayerMap.get(userId); - } + private UUID getPlayerId(UUID userId) { + return userPlayerMap.get(userId); + } - public void join(UUID userId) { - UUID playerId = userPlayerMap.get(userId); - GameSession gameSession = new GameSession(game, userId, playerId, useTimeout); - gameSessions.put(playerId, gameSession); - User user = UserManager.getInstance().getUser(userId); - gameSession.setUserData(user.getUserData()); - user.addGame(playerId, gameSession); - logger.info("player " + playerId + " has joined game " + game.getId()); - ChatManager.getInstance().broadcast(chatId, "", game.getPlayer(playerId).getName() + " has joined the game", MessageColor.BLACK); - checkStart(); - } + public void join(UUID userId) { + UUID playerId = userPlayerMap.get(userId); + GameSession gameSession = new GameSession(game, userId, playerId, useTimeout); + gameSessions.put(playerId, gameSession); + User user = UserManager.getInstance().getUser(userId); + gameSession.setUserData(user.getUserData()); + user.addGame(playerId, gameSession); + logger.info("player " + playerId + " has joined game " + game.getId()); + ChatManager.getInstance().broadcast(chatId, "", game.getPlayer(playerId).getName() + " has joined the game", MessageColor.BLACK); + checkStart(); + } - private synchronized void startGame() { - if (gameFuture == null) { - for (final Entry entry: gameSessions.entrySet()) { - if (!entry.getValue().init()) { - logger.fatal("Unable to initialize client"); - //TODO: generate client error message - return; - } - } - GameWorker worker = new GameWorker(game, choosingPlayerId, this); - gameFuture = gameExecutor.submit(worker); - } - } + private synchronized void startGame() { + if (gameFuture == null) { + for (final Entry entry: gameSessions.entrySet()) { + if (!entry.getValue().init()) { + logger.fatal("Unable to initialize client"); + //TODO: generate client error message + return; + } + } + GameWorker worker = new GameWorker(game, choosingPlayerId, this); + gameFuture = gameExecutor.submit(worker); + } + } - private void checkStart() { - if (allJoined()) { - ThreadExecutor.getInstance().getCallExecutor().execute( - new Runnable() { - @Override - public void run() { - startGame(); - } - }); - } - } + private void checkStart() { + if (allJoined()) { + ThreadExecutor.getInstance().getCallExecutor().execute( + new Runnable() { + @Override + public void run() { + startGame(); + } + }); + } + } - private boolean allJoined() { - for (Player player: game.getPlayers().values()) { - if (player.isHuman() && gameSessions.get(player.getId()) == null) { - return false; - } - } - return true; - } + private boolean allJoined() { + for (Player player: game.getPlayers().values()) { + if (player.isHuman() && gameSessions.get(player.getId()) == null) { + return false; + } + } + return true; + } - public void watch(UUID userId) { - GameWatcher gameWatcher = new GameWatcher(userId, game); - watchers.put(userId, gameWatcher); - gameWatcher.init(); - ChatManager.getInstance().broadcast(chatId, "", " has started watching", MessageColor.BLACK); - } - - public void stopWatching(UUID userId) { - watchers.remove(userId); - ChatManager.getInstance().broadcast(chatId, "", " has stopped watching", MessageColor.BLACK); - } - - public void concede(UUID userId) { - game.concede(getPlayerId(userId)); - } + public void watch(UUID userId) { + GameWatcher gameWatcher = new GameWatcher(userId, game); + watchers.put(userId, gameWatcher); + gameWatcher.init(); + ChatManager.getInstance().broadcast(chatId, "", " has started watching", MessageColor.BLACK); + } - private void leave(UUID userId) { - game.quit(getPlayerId(userId)); - } + public void stopWatching(UUID userId) { + watchers.remove(userId); + ChatManager.getInstance().broadcast(chatId, "", " has stopped watching", MessageColor.BLACK); + } - public void cheat(UUID userId, UUID playerId, DeckCardLists deckList) { - Deck deck; - try { - deck = Deck.load(deckList); - game.loadCards(deck.getCards(), playerId); - for (Card card: deck.getCards()) { - card.putOntoBattlefield(game, Zone.OUTSIDE, null, playerId); - } - } catch (GameException ex) { - logger.warn(ex.getMessage()); - } - addCardsForTesting(game); - updateGame(); - } + public void concede(UUID userId) { + game.concede(getPlayerId(userId)); + } + + private void leave(UUID userId) { + game.quit(getPlayerId(userId)); + } + + public void cheat(UUID userId, UUID playerId, DeckCardLists deckList) { + Deck deck; + try { + deck = Deck.load(deckList); + game.loadCards(deck.getCards(), playerId); + for (Card card: deck.getCards()) { + card.putOntoBattlefield(game, Zone.OUTSIDE, null, playerId); + } + } catch (GameException ex) { + logger.warn(ex.getMessage()); + } + addCardsForTesting(game); + updateGame(); + } public boolean cheat(UUID userId, UUID playerId, String cardName) { Card card = Sets.findCard(cardName, true); - if (card != null) { + if (card != null) { Set cards = new HashSet(); - cards.add(card); + cards.add(card); game.loadCards(cards, playerId); card.moveToZone(Zone.HAND, null, game, false); return true; } else { return false; } - } + } - public void kill(UUID userId) { - if (userPlayerMap.containsKey(userId)) { - gameSessions.get(userPlayerMap.get(userId)).setKilled(); - gameSessions.remove(userPlayerMap.get(userId)); - leave(userId); - userPlayerMap.remove(userId); - } - if (watchers.containsKey(userId)) { - watchers.get(userId).setKilled(); - watchers.remove(userId); - } - } + public void kill(UUID userId) { + if (userPlayerMap.containsKey(userId)) { + gameSessions.get(userPlayerMap.get(userId)).setKilled(); + gameSessions.remove(userPlayerMap.get(userId)); + leave(userId); + userPlayerMap.remove(userId); + } + if (watchers.containsKey(userId)) { + watchers.get(userId).setKilled(); + watchers.remove(userId); + } + } - public void timeout(UUID userId) { - if (userPlayerMap.containsKey(userId)) { - ChatManager.getInstance().broadcast(chatId, "", game.getPlayer(userPlayerMap.get(userId)).getName() + " has timed out. Auto concede.", MessageColor.BLACK); - concede(userId); - } - } + public void timeout(UUID userId) { + if (userPlayerMap.containsKey(userId)) { + ChatManager.getInstance().broadcast(chatId, "", game.getPlayer(userPlayerMap.get(userId)).getName() + " has timed out. Auto concede.", MessageColor.BLACK); + concede(userId); + } + } - public void endGame(final String message) throws MageException { - for (final GameSession gameSession: gameSessions.values()) { - gameSession.gameOver(message); - gameSession.removeGame(); - } - for (final GameWatcher gameWatcher: watchers.values()) { - gameWatcher.gameOver(message); - } - TableManager.getInstance().endGame(tableId); - } + public void endGame(final String message) throws MageException { + for (final GameSession gameSession: gameSessions.values()) { + gameSession.gameOver(message); + gameSession.removeGame(); + } + for (final GameWatcher gameWatcher: watchers.values()) { + gameWatcher.gameOver(message); + } + TableManager.getInstance().endGame(tableId); + } - public UUID getSessionId() { - return this.gameSessionId; - } + public UUID getSessionId() { + return this.gameSessionId; + } - public UUID getChatId() { - return chatId; - } + public UUID getChatId() { + return chatId; + } - public void sendPlayerUUID(UUID userId, final UUID data) { - sendMessage(userId, new Command() { - public void execute(UUID playerId) { - gameSessions.get(playerId).sendPlayerUUID(data); - } - }); + public void sendPlayerUUID(UUID userId, final UUID data) { + sendMessage(userId, new Command() { + public void execute(UUID playerId) { + gameSessions.get(playerId).sendPlayerUUID(data); + } + }); - } + } - public void sendPlayerString(UUID userId, final String data) { - sendMessage(userId, new Command() { - public void execute(UUID playerId) { - gameSessions.get(playerId).sendPlayerString(data); - } - }); - } + public void sendPlayerString(UUID userId, final String data) { + sendMessage(userId, new Command() { + public void execute(UUID playerId) { + gameSessions.get(playerId).sendPlayerString(data); + } + }); + } - public void sendPlayerBoolean(UUID userId, final Boolean data) { - sendMessage(userId, new Command() { - public void execute(UUID playerId) { - gameSessions.get(playerId).sendPlayerBoolean(data); - } - }); + public void sendPlayerBoolean(UUID userId, final Boolean data) { + sendMessage(userId, new Command() { + public void execute(UUID playerId) { + gameSessions.get(playerId).sendPlayerBoolean(data); + } + }); - } + } - public void sendPlayerInteger(UUID userId, final Integer data) { - sendMessage(userId, new Command() { - public void execute(UUID playerId) { - gameSessions.get(playerId).sendPlayerInteger(data); - } - }); + public void sendPlayerInteger(UUID userId, final Integer data) { + sendMessage(userId, new Command() { + public void execute(UUID playerId) { + gameSessions.get(playerId).sendPlayerInteger(data); + } + }); - } + } - private synchronized void updateGame() { - for (final GameSession gameSession: gameSessions.values()) { - gameSession.update(); - } - for (final GameWatcher gameWatcher: watchers.values()) { - gameWatcher.update(); - } - } + private synchronized void updateGame() { + for (final GameSession gameSession: gameSessions.values()) { + gameSession.update(); + } + for (final GameWatcher gameWatcher: watchers.values()) { + gameWatcher.update(); + } + } - private synchronized void ask(UUID playerId, final String question) throws MageException { - /*if (question.equals("Do you want to take a mulligan?")) { - System.out.println("reverted"); - for (UUID uuid : game.getOpponents(playerId)) { - gameSessions.get(uuid).ask(question); - informOthers(uuid); - } - return; - }*/ - perform(playerId, new Command() { - public void execute(UUID playerId) { - gameSessions.get(playerId).ask(question); - } - }); + private synchronized void ask(UUID playerId, final String question) throws MageException { + /*if (question.equals("Do you want to take a mulligan?")) { + System.out.println("reverted"); + for (UUID uuid : game.getOpponents(playerId)) { + gameSessions.get(uuid).ask(question); + informOthers(uuid); + } + return; + }*/ + perform(playerId, new Command() { + public void execute(UUID playerId) { + gameSessions.get(playerId).ask(question); + } + }); - } + } - private synchronized void chooseAbility(UUID playerId, final Collection choices) throws MageException { - perform(playerId, new Command() { - public void execute(UUID playerId) { - gameSessions.get(playerId).chooseAbility(new AbilityPickerView(choices)); - } - }); - } + private synchronized void chooseAbility(UUID playerId, final Collection choices) throws MageException { + perform(playerId, new Command() { + public void execute(UUID playerId) { + gameSessions.get(playerId).chooseAbility(new AbilityPickerView(choices)); + } + }); + } - private synchronized void choosePile(UUID playerId, final String message, final List pile1, final List pile2) throws MageException { - perform(playerId, new Command() { - public void execute(UUID playerId) { - gameSessions.get(playerId).choosePile(message, new CardsView(pile1), new CardsView(pile2)); - } - }); - } + private synchronized void choosePile(UUID playerId, final String message, final List pile1, final List pile2) throws MageException { + perform(playerId, new Command() { + public void execute(UUID playerId) { + gameSessions.get(playerId).choosePile(message, new CardsView(pile1), new CardsView(pile2)); + } + }); + } - private synchronized void chooseMode(UUID playerId, final Map modes) throws MageException { - perform(playerId, new Command() { - public void execute(UUID playerId) { - gameSessions.get(playerId).chooseAbility(new AbilityPickerView(modes)); - } - }); - } + private synchronized void chooseMode(UUID playerId, final Map modes) throws MageException { + perform(playerId, new Command() { + public void execute(UUID playerId) { + gameSessions.get(playerId).chooseAbility(new AbilityPickerView(modes)); + } + }); + } - private synchronized void choose(UUID playerId, final String message, final Set choices) throws MageException { - perform(playerId, new Command() { - public void execute(UUID playerId) { - gameSessions.get(playerId).choose(message, choices); - } - }); - } + private synchronized void choose(UUID playerId, final String message, final Set choices) throws MageException { + perform(playerId, new Command() { + public void execute(UUID playerId) { + gameSessions.get(playerId).choose(message, choices); + } + }); + } - private synchronized void target(UUID playerId, final String question, final Cards cards, final List perms, final Set targets, final boolean required, final Map options) throws MageException { - perform(playerId, new Command() { - public void execute(UUID playerId) { - if (cards != null) { - gameSessions.get(playerId).target(question, new CardsView(cards.getCards(game)), targets, required, options); - } else if (perms != null) { - CardsView permsView = new CardsView(); - for (Permanent perm: perms) { - permsView.put(perm.getId(), new PermanentView(perm, game.getCard(perm.getId()))); - } - gameSessions.get(playerId).target(question, permsView, targets, required, options); - } else - gameSessions.get(playerId).target(question, new CardsView(), targets, required, options); - } - }); + private synchronized void target(UUID playerId, final String question, final Cards cards, final List perms, final Set targets, final boolean required, final Map options) throws MageException { + perform(playerId, new Command() { + public void execute(UUID playerId) { + if (cards != null) { + gameSessions.get(playerId).target(question, new CardsView(cards.getCards(game)), targets, required, options); + } else if (perms != null) { + CardsView permsView = new CardsView(); + for (Permanent perm: perms) { + permsView.put(perm.getId(), new PermanentView(perm, game.getCard(perm.getId()))); + } + gameSessions.get(playerId).target(question, permsView, targets, required, options); + } else + gameSessions.get(playerId).target(question, new CardsView(), targets, required, options); + } + }); - } + } - private synchronized void target(UUID playerId, final String question, final Collection abilities, final boolean required, final Map options) throws MageException { - perform(playerId, new Command() { - public void execute(UUID playerId) { - gameSessions.get(playerId).target(question, new CardsView(abilities, game), null, required, options); - } - }); - } + private synchronized void target(UUID playerId, final String question, final Collection abilities, final boolean required, final Map options) throws MageException { + perform(playerId, new Command() { + public void execute(UUID playerId) { + gameSessions.get(playerId).target(question, new CardsView(abilities, game), null, required, options); + } + }); + } - private synchronized void select(final UUID playerId, final String message) throws MageException { - perform(playerId, new Command() { - public void execute(UUID playerId) { - gameSessions.get(playerId).select(message); - } - }); - } + private synchronized void select(final UUID playerId, final String message) throws MageException { + perform(playerId, new Command() { + public void execute(UUID playerId) { + gameSessions.get(playerId).select(message); + } + }); + } - private synchronized void playMana(UUID playerId, final String message) throws MageException { - perform(playerId, new Command() { - public void execute(UUID playerId) { - gameSessions.get(playerId).playMana(message); - } - }); - } + private synchronized void playMana(UUID playerId, final String message) throws MageException { + perform(playerId, new Command() { + public void execute(UUID playerId) { + gameSessions.get(playerId).playMana(message); + } + }); + } - private synchronized void playXMana(UUID playerId, final String message) throws MageException { - perform(playerId, new Command() { - public void execute(UUID playerId) { - gameSessions.get(playerId).playXMana(message); - } - }); - } + private synchronized void playXMana(UUID playerId, final String message) throws MageException { + perform(playerId, new Command() { + public void execute(UUID playerId) { + gameSessions.get(playerId).playXMana(message); + } + }); + } - private synchronized void amount(UUID playerId, final String message, final int min, final int max) throws MageException { - perform(playerId, new Command() { - public void execute(UUID playerId) { - gameSessions.get(playerId).getAmount(message, min, max); - } - }); - } + private synchronized void amount(UUID playerId, final String message, final int min, final int max) throws MageException { + perform(playerId, new Command() { + public void execute(UUID playerId) { + gameSessions.get(playerId).getAmount(message, min, max); + } + }); + } - private synchronized void revealCards(String name, Cards cards) throws MageException { - for (GameSession session: gameSessions.values()) { - session.revealCards(name, new CardsView(cards.getCards(game))); - } - } + private synchronized void revealCards(String name, Cards cards) throws MageException { + for (GameSession session: gameSessions.values()) { + session.revealCards(name, new CardsView(cards.getCards(game))); + } + } - private synchronized void lookAtCards(UUID playerId, final String name, final Cards cards) throws MageException { - perform(playerId, new Command() { - public void execute(UUID playerId) { - gameSessions.get(playerId).revealCards(name, new CardsView(cards.getCards(game))); - } - }, false); - } + private synchronized void lookAtCards(UUID playerId, final String name, final Cards cards) throws MageException { + perform(playerId, new Command() { + public void execute(UUID playerId) { + gameSessions.get(playerId).revealCards(name, new CardsView(cards.getCards(game))); + } + }, false); + } - private void informOthers(UUID playerId) throws MageException { + private void informOthers(UUID playerId) throws MageException { String message = ""; if (game.getStep() != null) message += game.getStep().getType().toString() + " - "; - message += "Waiting for " + game.getPlayer(playerId).getName(); - for (final Entry entry: gameSessions.entrySet()) { - if (!entry.getKey().equals(playerId)) { - entry.getValue().inform(message); - } - } - for (final GameWatcher watcher: watchers.values()) { - watcher.inform(message); - } - } + message += "Waiting for " + game.getPlayer(playerId).getName(); + for (final Entry entry: gameSessions.entrySet()) { + if (!entry.getKey().equals(playerId)) { + entry.getValue().inform(message); + } + } + for (final GameWatcher watcher: watchers.values()) { + watcher.inform(message); + } + } - private void informOthers(List players) throws MageException { - // first player is always original controller - final String message = game.getStep().toString() + " - Waiting for " + game.getPlayer(players.get(0)).getName(); - for (final Entry entry: gameSessions.entrySet()) { - boolean skip = false; - for (UUID uuid : players) { - if (entry.getKey().equals(uuid)) { - skip = true; - break; - } - } - if (!skip) entry.getValue().inform(message); - } - for (final GameWatcher watcher: watchers.values()) { - watcher.inform(message); - } - } + private void informOthers(List players) throws MageException { + // first player is always original controller + final String message = game.getStep().toString() + " - Waiting for " + game.getPlayer(players.get(0)).getName(); + for (final Entry entry: gameSessions.entrySet()) { + boolean skip = false; + for (UUID uuid : players) { + if (entry.getKey().equals(uuid)) { + skip = true; + break; + } + } + if (!skip) entry.getValue().inform(message); + } + for (final GameWatcher watcher: watchers.values()) { + watcher.inform(message); + } + } - private void error(String message, Exception ex) { + private void error(String message, Exception ex) { StringBuilder sb = new StringBuilder(); sb.append(message).append(ex.toString()); sb.append("\nServer version: ").append(Main.getVersion().toString()); @@ -527,100 +527,100 @@ public class GameController implements GameCallback { for (StackTraceElement e: ex.getStackTrace()) { sb.append(e.toString()).append("\n"); } - for (final Entry entry: gameSessions.entrySet()) { - entry.getValue().gameError(sb.toString()); - } - } + for (final Entry entry: gameSessions.entrySet()) { + entry.getValue().gameError(sb.toString()); + } + } - public GameView getGameView(UUID playerId) { - return gameSessions.get(playerId).getGameView(); - } + public GameView getGameView(UUID playerId) { + return gameSessions.get(playerId).getGameView(); + } - @Override - public void gameResult(String result) { - try { - endGame(result); - } catch (MageException ex) { - logger.fatal("Game Result error", ex); - } - } + @Override + public void gameResult(String result) { + try { + endGame(result); + } catch (MageException ex) { + logger.fatal("Game Result error", ex); + } + } - public void saveGame() { - try { - OutputStream file = new FileOutputStream("saved/" + game.getId().toString() + ".game"); - OutputStream buffer = new BufferedOutputStream(file); - ObjectOutput output = new ObjectOutputStream(new GZIPOutputStream(buffer)); - try { - output.writeObject(game); - output.writeObject(game.getGameStates()); - } - finally { - output.close(); - } - logger.info("Saved game:" + game.getId()); - } - catch(IOException ex) { - logger.fatal("Cannot save game.", ex); - } - } + public void saveGame() { + try { + OutputStream file = new FileOutputStream("saved/" + game.getId().toString() + ".game"); + OutputStream buffer = new BufferedOutputStream(file); + ObjectOutput output = new ObjectOutputStream(new GZIPOutputStream(buffer)); + try { + output.writeObject(game); + output.writeObject(game.getGameStates()); + } + finally { + output.close(); + } + logger.info("Saved game:" + game.getId()); + } + catch(IOException ex) { + logger.fatal("Cannot save game.", ex); + } + } - /** - * Adds cards in player's hands that are specified in config/init.txt. - */ - private void addCardsForTesting(Game game) { - SystemUtil.addCardsForTesting(game); - } + /** + * Adds cards in player's hands that are specified in config/init.txt. + */ + private void addCardsForTesting(Game game) { + SystemUtil.addCardsForTesting(game); + } - private void perform(UUID playerId, Command command) throws MageException { - perform(playerId, command, true); - } + private void perform(UUID playerId, Command command) throws MageException { + perform(playerId, command, true); + } - private void perform(UUID playerId, Command command, boolean informOthers) throws MageException { - if (game.getPlayer(playerId).isGameUnderControl()) { - if (gameSessions.containsKey(playerId)) - command.execute(playerId); - if (informOthers) informOthers(playerId); - } else { - List players = Splitter.split(game, playerId); - for (UUID uuid : players) { - if (gameSessions.containsKey(uuid)) - command.execute(uuid); - } - if (informOthers) informOthers(players); - } - } + private void perform(UUID playerId, Command command, boolean informOthers) throws MageException { + if (game.getPlayer(playerId).isGameUnderControl()) { + if (gameSessions.containsKey(playerId)) + command.execute(playerId); + if (informOthers) informOthers(playerId); + } else { + List players = Splitter.split(game, playerId); + for (UUID uuid : players) { + if (gameSessions.containsKey(uuid)) + command.execute(uuid); + } + if (informOthers) informOthers(players); + } + } - private void sendMessage(UUID userId, Command command) { - final UUID playerId = userPlayerMap.get(userId); - if (game.getPlayer(playerId).isGameUnderControl()) { - // if it's your priority (or game not started yet in which case it will be null) - // then execute only your action - if (game.getPriorityPlayerId() == null || game.getPriorityPlayerId().equals(playerId)) { - if (gameSessions.containsKey(playerId)) - command.execute(playerId); - } // otherwise execute the action under other player's control - else { - //System.out.println("asThough: " + playerId + " " + game.getPriorityPlayerId()); - Player player = game.getPlayer(playerId); + private void sendMessage(UUID userId, Command command) { + final UUID playerId = userPlayerMap.get(userId); + if (game.getPlayer(playerId).isGameUnderControl()) { + // if it's your priority (or game not started yet in which case it will be null) + // then execute only your action + if (game.getPriorityPlayerId() == null || game.getPriorityPlayerId().equals(playerId)) { + if (gameSessions.containsKey(playerId)) + command.execute(playerId); + } // otherwise execute the action under other player's control + else { + //System.out.println("asThough: " + playerId + " " + game.getPriorityPlayerId()); + Player player = game.getPlayer(playerId); boolean found = false; - for (UUID controlled : player.getPlayersUnderYourControl()) { - if (gameSessions.containsKey(controlled) && game.getPriorityPlayerId().equals(controlled)) { - command.execute(controlled); + for (UUID controlled : player.getPlayersUnderYourControl()) { + if (gameSessions.containsKey(controlled) && game.getPriorityPlayerId().equals(controlled)) { + command.execute(controlled); found = true; } - } + } if (!found) { // something wrong - it may cause game freezes logger.warn("WARNING! GameController.sendMessage - couldn't find session for action execution. Player: " + player.getName()); } - } - } else { - // ignore - no control over the turn - return; - } - } + } + } else { + // ignore - no control over the turn + return; + } + } - interface Command { - public void execute(UUID player); - } + interface Command { + public void execute(UUID player); + } } diff --git a/Mage.Server/src/main/java/mage/server/game/GameFactory.java b/Mage.Server/src/main/java/mage/server/game/GameFactory.java index b42d2016a8..b22bcd7aea 100644 --- a/Mage.Server/src/main/java/mage/server/game/GameFactory.java +++ b/Mage.Server/src/main/java/mage/server/game/GameFactory.java @@ -45,46 +45,46 @@ import org.apache.log4j.Logger; */ public class GameFactory { - private final static GameFactory INSTANCE = new GameFactory(); - private final static Logger logger = Logger.getLogger(GameFactory.class); + private final static GameFactory INSTANCE = new GameFactory(); + private final static Logger logger = Logger.getLogger(GameFactory.class); - private Map> games = new HashMap>(); - private Map gameTypes = new HashMap(); - private List gameTypeViews = new ArrayList(); + private Map> games = new HashMap>(); + private Map gameTypes = new HashMap(); + private List gameTypeViews = new ArrayList(); - public static GameFactory getInstance() { - return INSTANCE; - } + public static GameFactory getInstance() { + return INSTANCE; + } - private GameFactory() {} + private GameFactory() {} - public Match createMatch(String gameType, MatchOptions options) { + public Match createMatch(String gameType, MatchOptions options) { - Match match; - Constructor con; - try { - con = games.get(gameType).getConstructor(new Class[]{MatchOptions.class}); - match = con.newInstance(new Object[] {options}); - } catch (Exception ex) { - logger.fatal("Error creating match - " + gameType, ex); - return null; - } - logger.info("Game created: " + gameType); // + game.getId().toString()); + Match match; + Constructor con; + try { + con = games.get(gameType).getConstructor(new Class[]{MatchOptions.class}); + match = con.newInstance(new Object[] {options}); + } catch (Exception ex) { + logger.fatal("Error creating match - " + gameType, ex); + return null; + } + logger.info("Game created: " + gameType); // + game.getId().toString()); - return match; - } + return match; + } - public List getGameTypes() { - return gameTypeViews; - } + public List getGameTypes() { + return gameTypeViews; + } - public void addGameType(String name, MatchType matchType, Class game) { - if (game != null) { - this.games.put(name, game); - this.gameTypes.put(name, matchType); - this.gameTypeViews.add(new GameTypeView(matchType)); - } - } + public void addGameType(String name, MatchType matchType, Class game) { + if (game != null) { + this.games.put(name, game); + this.gameTypes.put(name, matchType); + this.gameTypeViews.add(new GameTypeView(matchType)); + } + } } 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 d674e68ba9..90b1f3e25f 100644 --- a/Mage.Server/src/main/java/mage/server/game/GameManager.java +++ b/Mage.Server/src/main/java/mage/server/game/GameManager.java @@ -39,112 +39,112 @@ import mage.view.GameView; * @author BetaSteward_at_googlemail.com */ public class GameManager { - private final static GameManager INSTANCE = new GameManager(); + private final static GameManager INSTANCE = new GameManager(); - public static GameManager getInstance() { - return INSTANCE; - } + public static GameManager getInstance() { + return INSTANCE; + } - private GameManager() {} + private GameManager() {} - private ConcurrentHashMap gameControllers = new ConcurrentHashMap(); + private ConcurrentHashMap gameControllers = new ConcurrentHashMap(); - public UUID createGameSession(Game game, ConcurrentHashMap userPlayerMap, UUID tableId, UUID choosingPlayerId) { - GameController gameController = new GameController(game, userPlayerMap, tableId, choosingPlayerId); - gameControllers.put(game.getId(), gameController); - return gameController.getSessionId(); - } + public UUID createGameSession(Game game, ConcurrentHashMap userPlayerMap, UUID tableId, UUID choosingPlayerId) { + GameController gameController = new GameController(game, userPlayerMap, tableId, choosingPlayerId); + gameControllers.put(game.getId(), gameController); + return gameController.getSessionId(); + } - public void joinGame(UUID gameId, UUID userId) { - if (gameControllers.containsKey(gameId)) - gameControllers.get(gameId).join(userId); - } + public void joinGame(UUID gameId, UUID userId) { + if (gameControllers.containsKey(gameId)) + gameControllers.get(gameId).join(userId); + } - public void destroyChatSession(UUID gameId) { - gameControllers.remove(gameId); - } + public void destroyChatSession(UUID gameId) { + gameControllers.remove(gameId); + } - public UUID getChatId(UUID gameId) { - if (gameControllers.containsKey(gameId)) - return gameControllers.get(gameId).getChatId(); - return null; - } + public UUID getChatId(UUID gameId) { + if (gameControllers.containsKey(gameId)) + return gameControllers.get(gameId).getChatId(); + return null; + } - public void sendPlayerUUID(UUID gameId, UUID userId, UUID data) { - if (gameControllers.containsKey(gameId)) - gameControllers.get(gameId).sendPlayerUUID(userId, data); - } + public void sendPlayerUUID(UUID gameId, UUID userId, UUID data) { + if (gameControllers.containsKey(gameId)) + gameControllers.get(gameId).sendPlayerUUID(userId, data); + } - public void sendPlayerString(UUID gameId, UUID userId, String data) { - if (gameControllers.containsKey(gameId)) - gameControllers.get(gameId).sendPlayerString(userId, data); - } + public void sendPlayerString(UUID gameId, UUID userId, String data) { + if (gameControllers.containsKey(gameId)) + gameControllers.get(gameId).sendPlayerString(userId, data); + } - public void sendPlayerBoolean(UUID gameId, UUID userId, Boolean data) { - if (gameControllers.containsKey(gameId)) - gameControllers.get(gameId).sendPlayerBoolean(userId, data); - } + public void sendPlayerBoolean(UUID gameId, UUID userId, Boolean data) { + if (gameControllers.containsKey(gameId)) + gameControllers.get(gameId).sendPlayerBoolean(userId, data); + } - public void sendPlayerInteger(UUID gameId, UUID userId, Integer data) { - if (gameControllers.containsKey(gameId)) - gameControllers.get(gameId).sendPlayerInteger(userId, data); - } + public void sendPlayerInteger(UUID gameId, UUID userId, Integer data) { + if (gameControllers.containsKey(gameId)) + gameControllers.get(gameId).sendPlayerInteger(userId, data); + } - public void concedeGame(UUID gameId, UUID userId) { - if (gameControllers.containsKey(gameId)) - gameControllers.get(gameId).concede(userId); - } + public void concedeGame(UUID gameId, UUID userId) { + if (gameControllers.containsKey(gameId)) + gameControllers.get(gameId).concede(userId); + } - public void watchGame(UUID gameId, UUID userId) { - if (gameControllers.containsKey(gameId)) - gameControllers.get(gameId).watch(userId); - } + public void watchGame(UUID gameId, UUID userId) { + if (gameControllers.containsKey(gameId)) + gameControllers.get(gameId).watch(userId); + } - public void stopWatching(UUID gameId, UUID userId) { - if (gameControllers.containsKey(gameId)) - gameControllers.get(gameId).stopWatching(userId); - } + public void stopWatching(UUID gameId, UUID userId) { + if (gameControllers.containsKey(gameId)) + gameControllers.get(gameId).stopWatching(userId); + } - public void removeSession(UUID userId) { - for (GameController controller: gameControllers.values()) { - controller.kill(userId); - } - } + public void removeSession(UUID userId) { + for (GameController controller: gameControllers.values()) { + controller.kill(userId); + } + } - public void kill(UUID gameId, UUID userId) { - if (gameControllers.containsKey(gameId)) - gameControllers.get(gameId).kill(userId); - } + public void kill(UUID gameId, UUID userId) { + if (gameControllers.containsKey(gameId)) + gameControllers.get(gameId).kill(userId); + } - public void cheat(UUID gameId, UUID userId, UUID playerId, DeckCardLists deckList) { - if (gameControllers.containsKey(gameId)) - gameControllers.get(gameId).cheat(userId, playerId, deckList); - } + public void cheat(UUID gameId, UUID userId, UUID playerId, DeckCardLists deckList) { + if (gameControllers.containsKey(gameId)) + gameControllers.get(gameId).cheat(userId, playerId, deckList); + } public boolean cheat(UUID gameId, UUID userId, UUID playerId, String cardName) { - if (gameControllers.containsKey(gameId)) - return gameControllers.get(gameId).cheat(userId, playerId, cardName); - return false; - } + if (gameControllers.containsKey(gameId)) + return gameControllers.get(gameId).cheat(userId, playerId, cardName); + return false; + } - public void timeout(UUID gameId, UUID userId) { - if (gameControllers.containsKey(gameId)) - gameControllers.get(gameId).timeout(userId); - } + public void timeout(UUID gameId, UUID userId) { + if (gameControllers.containsKey(gameId)) + gameControllers.get(gameId).timeout(userId); + } - public void removeGame(UUID gameId) { - gameControllers.remove(gameId); - } + public void removeGame(UUID gameId) { + gameControllers.remove(gameId); + } - public void saveGame(UUID gameId) { - if (gameControllers.containsKey(gameId)) - gameControllers.get(gameId).saveGame(); - } + public void saveGame(UUID gameId) { + if (gameControllers.containsKey(gameId)) + gameControllers.get(gameId).saveGame(); + } public GameView getGameView(UUID gameId, UUID userId, UUID playerId) { - if (gameControllers.containsKey(gameId)) - return gameControllers.get(gameId).getGameView(playerId); - return null; + if (gameControllers.containsKey(gameId)) + return gameControllers.get(gameId).getGameView(playerId); + return null; } } diff --git a/Mage.Server/src/main/java/mage/server/game/GameReplay.java b/Mage.Server/src/main/java/mage/server/game/GameReplay.java index 024b91b1df..56f32d2015 100644 --- a/Mage.Server/src/main/java/mage/server/game/GameReplay.java +++ b/Mage.Server/src/main/java/mage/server/game/GameReplay.java @@ -46,61 +46,61 @@ import org.apache.log4j.Logger; */ public class GameReplay { - private final static Logger logger = Logger.getLogger(GameReplay.class); + private final static Logger logger = Logger.getLogger(GameReplay.class); - private GameStates savedGame; - private Game game; - private int stateIndex; + private GameStates savedGame; + private Game game; + private int stateIndex; - public GameReplay(UUID gameId) { - this.game = loadGame(gameId); - this.savedGame = game.getGameStates(); - } + public GameReplay(UUID gameId) { + this.game = loadGame(gameId); + this.savedGame = game.getGameStates(); + } - public void start() { - this.stateIndex = 0; - } + public void start() { + this.stateIndex = 0; + } - public GameState next() { - if (this.stateIndex < savedGame.getSize()) { - return savedGame.get(stateIndex++); - } - return null; - } + public GameState next() { + if (this.stateIndex < savedGame.getSize()) { + return savedGame.get(stateIndex++); + } + return null; + } - public GameState previous() { - if (this.stateIndex > 0) { - return savedGame.get(--stateIndex); - } - return null; - } + public GameState previous() { + if (this.stateIndex > 0) { + return savedGame.get(--stateIndex); + } + return null; + } - public Game getGame() { - return this.game; - } + public Game getGame() { + return this.game; + } - private Game loadGame(UUID gameId) { - try{ - InputStream file = new FileInputStream("saved/" + gameId.toString() + ".game"); - InputStream buffer = new BufferedInputStream(file); - ObjectInput input = new CopierObjectInputStream(Main.classLoader, new GZIPInputStream(buffer)); - try { - Game loadGame = (Game)input.readObject(); - GameStates states = (GameStates)input.readObject(); - loadGame.loadGameStates(states); - return loadGame; - } - finally { - input.close(); - } - } - catch(ClassNotFoundException ex) { - logger.fatal("Cannot load game. Class not found.", ex); - } - catch(IOException ex) { - logger.fatal("Cannot load game:" + gameId, ex); - } - return null; - } + private Game loadGame(UUID gameId) { + try{ + InputStream file = new FileInputStream("saved/" + gameId.toString() + ".game"); + InputStream buffer = new BufferedInputStream(file); + ObjectInput input = new CopierObjectInputStream(Main.classLoader, new GZIPInputStream(buffer)); + try { + Game loadGame = (Game)input.readObject(); + GameStates states = (GameStates)input.readObject(); + loadGame.loadGameStates(states); + return loadGame; + } + finally { + input.close(); + } + } + catch(ClassNotFoundException ex) { + logger.fatal("Cannot load game. Class not found.", ex); + } + catch(IOException ex) { + logger.fatal("Cannot load game:" + gameId, ex); + } + return null; + } } diff --git a/Mage.Server/src/main/java/mage/server/game/GameSession.java b/Mage.Server/src/main/java/mage/server/game/GameSession.java index bb0621e9e4..69764eff5d 100644 --- a/Mage.Server/src/main/java/mage/server/game/GameSession.java +++ b/Mage.Server/src/main/java/mage/server/game/GameSession.java @@ -56,206 +56,206 @@ import mage.view.SimpleCardsView; */ public class GameSession extends GameWatcher { - private UUID playerId; + private UUID playerId; private boolean useTimeout; - private ScheduledFuture futureTimeout; - protected static ScheduledExecutorService timeoutExecutor = ThreadExecutor.getInstance().getTimeoutExecutor(); + private ScheduledFuture futureTimeout; + protected static ScheduledExecutorService timeoutExecutor = ThreadExecutor.getInstance().getTimeoutExecutor(); - private UserData userData; + private UserData userData; - public GameSession(Game game, UUID userId, UUID playerId, boolean useTimeout) { - super(userId, game); - this.playerId = playerId; + public GameSession(Game game, UUID userId, UUID playerId, boolean useTimeout) { + super(userId, game); + this.playerId = playerId; this.useTimeout = useTimeout; - } + } - public void ask(final String question) { - if (!killed) { - setupTimeout(); - User user = UserManager.getInstance().getUser(userId); - if (user != null) { - user.fireCallback(new ClientCallback("gameAsk", game.getId(), new GameClientMessage(getGameView(), question))); - } - } - } + public void ask(final String question) { + if (!killed) { + setupTimeout(); + User user = UserManager.getInstance().getUser(userId); + if (user != null) { + user.fireCallback(new ClientCallback("gameAsk", game.getId(), new GameClientMessage(getGameView(), question))); + } + } + } - public void target(final String question, final CardsView cardView, final Set targets, final boolean required, final Map options) { - if (!killed) { - setupTimeout(); - User user = UserManager.getInstance().getUser(userId); - if (user != null) { - user.fireCallback(new ClientCallback("gameTarget", game.getId(), new GameClientMessage(getGameView(), question, cardView, targets, required, options))); - } - } - } + public void target(final String question, final CardsView cardView, final Set targets, final boolean required, final Map options) { + if (!killed) { + setupTimeout(); + User user = UserManager.getInstance().getUser(userId); + if (user != null) { + user.fireCallback(new ClientCallback("gameTarget", game.getId(), new GameClientMessage(getGameView(), question, cardView, targets, required, options))); + } + } + } - public void select(final String message) { - if (!killed) { - setupTimeout(); - User user = UserManager.getInstance().getUser(userId); - if (user != null) { - user.fireCallback(new ClientCallback("gameSelect", game.getId(), new GameClientMessage(getGameView(), message))); - } - } - } + public void select(final String message) { + if (!killed) { + setupTimeout(); + User user = UserManager.getInstance().getUser(userId); + if (user != null) { + user.fireCallback(new ClientCallback("gameSelect", game.getId(), new GameClientMessage(getGameView(), message))); + } + } + } - public void chooseAbility(final AbilityPickerView abilities) { - if (!killed) { - setupTimeout(); - User user = UserManager.getInstance().getUser(userId); - if (user != null) { - user.fireCallback(new ClientCallback("gameChooseAbility", game.getId(), abilities)); - } - } - } + public void chooseAbility(final AbilityPickerView abilities) { + if (!killed) { + setupTimeout(); + User user = UserManager.getInstance().getUser(userId); + if (user != null) { + user.fireCallback(new ClientCallback("gameChooseAbility", game.getId(), abilities)); + } + } + } - public void choosePile(final String message, final CardsView pile1, final CardsView pile2) { - if (!killed) { - setupTimeout(); - User user = UserManager.getInstance().getUser(userId); - if (user != null) { + public void choosePile(final String message, final CardsView pile1, final CardsView pile2) { + if (!killed) { + setupTimeout(); + User user = UserManager.getInstance().getUser(userId); + if (user != null) { List piles = new ArrayList(); piles.add(pile1); piles.add(pile2); - user.fireCallback(new ClientCallback("gameChoosePile", game.getId(), new GameClientMessage(message, pile1, pile2))); - } - } - } + user.fireCallback(new ClientCallback("gameChoosePile", game.getId(), new GameClientMessage(message, pile1, pile2))); + } + } + } - public void choose(final String message, final Set choices) { - if (!killed) { - setupTimeout(); - User user = UserManager.getInstance().getUser(userId); - if (user != null) { - user.fireCallback(new ClientCallback("gameChoose", game.getId(), new GameClientMessage(choices.toArray(new String[0]), message))); - } - } - } + public void choose(final String message, final Set choices) { + if (!killed) { + setupTimeout(); + User user = UserManager.getInstance().getUser(userId); + if (user != null) { + user.fireCallback(new ClientCallback("gameChoose", game.getId(), new GameClientMessage(choices.toArray(new String[0]), message))); + } + } + } - public void playMana(final String message) { - if (!killed) { - setupTimeout(); - User user = UserManager.getInstance().getUser(userId); - if (user != null) { - user.fireCallback(new ClientCallback("gamePlayMana", game.getId(), new GameClientMessage(getGameView(), message))); - } - } - } + public void playMana(final String message) { + if (!killed) { + setupTimeout(); + User user = UserManager.getInstance().getUser(userId); + if (user != null) { + user.fireCallback(new ClientCallback("gamePlayMana", game.getId(), new GameClientMessage(getGameView(), message))); + } + } + } - public void playXMana(final String message) { - if (!killed) { - setupTimeout(); - User user = UserManager.getInstance().getUser(userId); - if (user != null) { - user.fireCallback(new ClientCallback("gamePlayXMana", game.getId(), new GameClientMessage(getGameView(), message))); - } - } - } + public void playXMana(final String message) { + if (!killed) { + setupTimeout(); + User user = UserManager.getInstance().getUser(userId); + if (user != null) { + user.fireCallback(new ClientCallback("gamePlayXMana", game.getId(), new GameClientMessage(getGameView(), message))); + } + } + } - public void getAmount(final String message, final int min, final int max) { - if (!killed) { - setupTimeout(); - User user = UserManager.getInstance().getUser(userId); - if (user != null) { - user.fireCallback(new ClientCallback("gameSelectAmount", game.getId(), new GameClientMessage(message, min, max))); - } - } - } + public void getAmount(final String message, final int min, final int max) { + if (!killed) { + setupTimeout(); + User user = UserManager.getInstance().getUser(userId); + if (user != null) { + user.fireCallback(new ClientCallback("gameSelectAmount", game.getId(), new GameClientMessage(message, min, max))); + } + } + } - public void revealCards(final String name, final CardsView cardView) { - if (!killed) { - User user = UserManager.getInstance().getUser(userId); - if (user != null) { - user.fireCallback(new ClientCallback("gameReveal", game.getId(), new GameClientMessage(cardView, name))); - } - } - } + public void revealCards(final String name, final CardsView cardView) { + if (!killed) { + User user = UserManager.getInstance().getUser(userId); + if (user != null) { + user.fireCallback(new ClientCallback("gameReveal", game.getId(), new GameClientMessage(cardView, name))); + } + } + } - private synchronized void setupTimeout() { + private synchronized void setupTimeout() { if (!useTimeout) return; - cancelTimeout(); - futureTimeout = timeoutExecutor.schedule( - new Runnable() { - @Override - public void run() { - GameManager.getInstance().timeout(game.getId(), userId); - } - }, - ConfigSettings.getInstance().getMaxSecondsIdle(), TimeUnit.SECONDS - ); - } + cancelTimeout(); + futureTimeout = timeoutExecutor.schedule( + new Runnable() { + @Override + public void run() { + GameManager.getInstance().timeout(game.getId(), userId); + } + }, + ConfigSettings.getInstance().getMaxSecondsIdle(), TimeUnit.SECONDS + ); + } - private synchronized void cancelTimeout() { - if (futureTimeout != null) { - futureTimeout.cancel(false); - } - } + private synchronized void cancelTimeout() { + if (futureTimeout != null) { + futureTimeout.cancel(false); + } + } - public void sendPlayerUUID(UUID data) { - cancelTimeout(); - game.getPlayer(playerId).setResponseUUID(data); - } + public void sendPlayerUUID(UUID data) { + cancelTimeout(); + game.getPlayer(playerId).setResponseUUID(data); + } - public void sendPlayerString(String data) { - cancelTimeout(); - game.getPlayer(playerId).setResponseString(data); - } + public void sendPlayerString(String data) { + cancelTimeout(); + game.getPlayer(playerId).setResponseString(data); + } - public void sendPlayerBoolean(Boolean data) { - cancelTimeout(); - game.getPlayer(playerId).setResponseBoolean(data); - } + public void sendPlayerBoolean(Boolean data) { + cancelTimeout(); + game.getPlayer(playerId).setResponseBoolean(data); + } - public void sendPlayerInteger(Integer data) { - cancelTimeout(); - game.getPlayer(playerId).setResponseInteger(data); - } - - @Override - public GameView getGameView() { - Player player = game.getPlayer(playerId); - player.setUserData(this.userData); - GameView gameView = new GameView(game.getState(), game); - gameView.setHand(new SimpleCardsView(player.getHand().getCards(game))); + public void sendPlayerInteger(Integer data) { + cancelTimeout(); + game.getPlayer(playerId).setResponseInteger(data); + } - if (player.getPlayersUnderYourControl().size() > 0) { - Map handCards = new HashMap(); - for (UUID playerId : player.getPlayersUnderYourControl()) { - Player opponent = game.getPlayer(playerId); - handCards.put(opponent.getName(), new SimpleCardsView(opponent.getHand().getCards(game))); - } - gameView.setOpponentHands(handCards); - } + @Override + public GameView getGameView() { + Player player = game.getPlayer(playerId); + player.setUserData(this.userData); + GameView gameView = new GameView(game.getState(), game); + gameView.setHand(new SimpleCardsView(player.getHand().getCards(game))); - //TODO: should player who controls another player's turn be able to look at all these cards? + if (player.getPlayersUnderYourControl().size() > 0) { + Map handCards = new HashMap(); + for (UUID playerId : player.getPlayersUnderYourControl()) { + Player opponent = game.getPlayer(playerId); + handCards.put(opponent.getName(), new SimpleCardsView(opponent.getHand().getCards(game))); + } + gameView.setOpponentHands(handCards); + } - List list = new ArrayList(); - for (Entry entry : game.getState().getLookedAt(playerId).entrySet()) { - list.add(new LookedAtView(entry.getKey(), entry.getValue(), game)); - } - gameView.setLookedAt(list); + //TODO: should player who controls another player's turn be able to look at all these cards? + + List list = new ArrayList(); + for (Entry entry : game.getState().getLookedAt(playerId).entrySet()) { + list.add(new LookedAtView(entry.getKey(), entry.getValue(), game)); + } + gameView.setLookedAt(list); game.getState().clearLookedAt(); - return gameView; - } + return gameView; + } - public void removeGame() { - User user = UserManager.getInstance().getUser(userId); - if (user != null) - user.removeGame(playerId); - } + public void removeGame() { + User user = UserManager.getInstance().getUser(userId); + if (user != null) + user.removeGame(playerId); + } - public UUID getGameId() { - return game.getId(); - } - - public void kill() { - game.quit(playerId); - } + public UUID getGameId() { + return game.getId(); + } - public void setUserData(UserData userData) { - this.userData = userData; - } + public void kill() { + game.quit(playerId); + } + + public void setUserData(UserData userData) { + this.userData = userData; + } } diff --git a/Mage.Server/src/main/java/mage/server/game/GameWatcher.java b/Mage.Server/src/main/java/mage/server/game/GameWatcher.java index dbdd48e19c..4fa3713b6c 100644 --- a/Mage.Server/src/main/java/mage/server/game/GameWatcher.java +++ b/Mage.Server/src/main/java/mage/server/game/GameWatcher.java @@ -44,75 +44,75 @@ import org.apache.log4j.Logger; */ public class GameWatcher { - protected final static Logger logger = Logger.getLogger(GameWatcher.class); + protected final static Logger logger = Logger.getLogger(GameWatcher.class); - protected UUID userId; - protected Game game; - protected boolean killed = false; + protected UUID userId; + protected Game game; + protected boolean killed = false; - public GameWatcher(UUID userId, Game game) { - this.userId = userId; - this.game = game; - } + public GameWatcher(UUID userId, Game game) { + this.userId = userId; + this.game = game; + } - public boolean init() { - if (!killed) { - User user = UserManager.getInstance().getUser(userId); - if (user != null) { - user.fireCallback(new ClientCallback("gameInit", game.getId(), getGameView())); - return true; - } - } - return false; - } + public boolean init() { + if (!killed) { + User user = UserManager.getInstance().getUser(userId); + if (user != null) { + user.fireCallback(new ClientCallback("gameInit", game.getId(), getGameView())); + return true; + } + } + return false; + } - public void update() { - if (!killed) { - User user = UserManager.getInstance().getUser(userId); - if (user != null) { - user.fireCallback(new ClientCallback("gameUpdate", game.getId(), getGameView())); - } - } - } + public void update() { + if (!killed) { + User user = UserManager.getInstance().getUser(userId); + if (user != null) { + user.fireCallback(new ClientCallback("gameUpdate", game.getId(), getGameView())); + } + } + } - public void inform(final String message) { - if (!killed) { - User user = UserManager.getInstance().getUser(userId); - if (user != null) { - user.fireCallback(new ClientCallback("gameInform", game.getId(), new GameClientMessage(getGameView(), message))); - } - } - } + public void inform(final String message) { + if (!killed) { + User user = UserManager.getInstance().getUser(userId); + if (user != null) { + user.fireCallback(new ClientCallback("gameInform", game.getId(), new GameClientMessage(getGameView(), message))); + } + } + } - public void gameOver(final String message) { - if (!killed) { - User user = UserManager.getInstance().getUser(userId); - if (user != null) { - user.fireCallback(new ClientCallback("gameOver", game.getId(), message)); - } - } - } + public void gameOver(final String message) { + if (!killed) { + User user = UserManager.getInstance().getUser(userId); + if (user != null) { + user.fireCallback(new ClientCallback("gameOver", game.getId(), message)); + } + } + } - public void gameError(final String message) { - if (!killed) { - User user = UserManager.getInstance().getUser(userId); - if (user != null) { - user.fireCallback(new ClientCallback("gameError", game.getId(), message)); - } - } - } - - protected void handleRemoteException(RemoteException ex) { - logger.fatal("GameWatcher error", ex); - GameManager.getInstance().kill(game.getId(), userId); - } - - public void setKilled() { - killed = true; - } + public void gameError(final String message) { + if (!killed) { + User user = UserManager.getInstance().getUser(userId); + if (user != null) { + user.fireCallback(new ClientCallback("gameError", game.getId(), message)); + } + } + } - public GameView getGameView() { - return new GameView(game.getState(), game); - } + protected void handleRemoteException(RemoteException ex) { + logger.fatal("GameWatcher error", ex); + GameManager.getInstance().kill(game.getId(), userId); + } + + public void setKilled() { + killed = true; + } + + public GameView getGameView() { + return new GameView(game.getState(), game); + } } diff --git a/Mage.Server/src/main/java/mage/server/game/GameWorker.java b/Mage.Server/src/main/java/mage/server/game/GameWorker.java index 83af7b4e14..ca0b7e72d0 100644 --- a/Mage.Server/src/main/java/mage/server/game/GameWorker.java +++ b/Mage.Server/src/main/java/mage/server/game/GameWorker.java @@ -40,28 +40,28 @@ import java.util.concurrent.Callable; */ public class GameWorker implements Callable { - private final static Logger logger = Logger.getLogger(GameWorker.class); + private final static Logger logger = Logger.getLogger(GameWorker.class); - private GameCallback result; - private Game game; - private UUID choosingPlayerId; + private GameCallback result; + private Game game; + private UUID choosingPlayerId; - public GameWorker(Game game, UUID choosingPlayerId, GameCallback result) { - this.game = game; - this.choosingPlayerId = choosingPlayerId; - this.result = result; - } + public GameWorker(Game game, UUID choosingPlayerId, GameCallback result) { + this.game = game; + this.choosingPlayerId = choosingPlayerId; + this.result = result; + } - @Override - public Object call() { - try { - game.start(choosingPlayerId); - game.fireUpdatePlayersEvent(); - result.gameResult(game.getWinner()); - } catch (Exception ex) { - logger.fatal("GameWorker error ", ex); - } - return null; - } + @Override + public Object call() { + try { + game.start(choosingPlayerId); + game.fireUpdatePlayersEvent(); + result.gameResult(game.getWinner()); + } catch (Exception ex) { + logger.fatal("GameWorker error ", ex); + } + return null; + } } diff --git a/Mage.Server/src/main/java/mage/server/game/GamesRoom.java b/Mage.Server/src/main/java/mage/server/game/GamesRoom.java index 744282958f..bf9c4811cf 100644 --- a/Mage.Server/src/main/java/mage/server/game/GamesRoom.java +++ b/Mage.Server/src/main/java/mage/server/game/GamesRoom.java @@ -45,17 +45,17 @@ import mage.view.TableView; */ public interface GamesRoom extends Room { - public List getTables(); + public List getTables(); public List getFinished(); public List getPlayers(); - public boolean joinTable(UUID userId, UUID tableId, String name, String playerType, int skill, DeckCardLists deckList) throws MageException; - public boolean joinTournamentTable(UUID userId, UUID tableId, String name, String playerType, int skill) throws GameException; - public TableView createTable(UUID userId, MatchOptions options); - public TableView createTournamentTable(UUID userId, TournamentOptions options); - public void removeTable(UUID userId, UUID tableId); - public void removeTable(UUID tableId); - public TableView getTable(UUID tableId); - public void leaveTable(UUID userId, UUID tableId); - public boolean watchTable(UUID userId, UUID tableId) throws MageException; + public boolean joinTable(UUID userId, UUID tableId, String name, String playerType, int skill, DeckCardLists deckList) throws MageException; + public boolean joinTournamentTable(UUID userId, UUID tableId, String name, String playerType, int skill) throws GameException; + public TableView createTable(UUID userId, MatchOptions options); + public TableView createTournamentTable(UUID userId, TournamentOptions options); + public void removeTable(UUID userId, UUID tableId); + public void removeTable(UUID tableId); + public TableView getTable(UUID tableId); + public void leaveTable(UUID userId, UUID tableId); + public boolean watchTable(UUID userId, UUID tableId) throws MageException; } 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 c43c483981..a626c73f7b 100644 --- a/Mage.Server/src/main/java/mage/server/game/GamesRoomImpl.java +++ b/Mage.Server/src/main/java/mage/server/game/GamesRoomImpl.java @@ -60,116 +60,116 @@ import org.apache.log4j.Logger; */ public class GamesRoomImpl extends RoomImpl implements GamesRoom, Serializable { - private final static Logger logger = Logger.getLogger(GamesRoomImpl.class); - - private static ScheduledExecutorService updateExecutor = Executors.newSingleThreadScheduledExecutor(); + private final static Logger logger = Logger.getLogger(GamesRoomImpl.class); + + private static ScheduledExecutorService updateExecutor = Executors.newSingleThreadScheduledExecutor(); private static List tableView = new ArrayList(); private static List matchView = new ArrayList(); private static List playersView = new ArrayList(); - - private ConcurrentHashMap tables = new ConcurrentHashMap(); - public GamesRoomImpl() { - updateExecutor.scheduleAtFixedRate(new Runnable() { - @Override - public void run() { - update(); - } - }, 2, 2, TimeUnit.SECONDS); - } + private ConcurrentHashMap tables = new ConcurrentHashMap(); + + public GamesRoomImpl() { + updateExecutor.scheduleAtFixedRate(new Runnable() { + @Override + public void run() { + update(); + } + }, 2, 2, TimeUnit.SECONDS); + } @Override - public List getTables() { - return tableView; - } + public List getTables() { + return tableView; + } - private void update() { - ArrayList tableList = new ArrayList(); - ArrayList matchList = new ArrayList(); + private void update() { + ArrayList tableList = new ArrayList(); + ArrayList matchList = new ArrayList(); List
t = new ArrayList
(tables.values()); Collections.sort(t, new TimestampSorter()); - for (Table table: t) { + for (Table table: t) { if (table.getState() != TableState.FINISHED) { tableList.add(new TableView(table)); } else if (matchList.size() < 50) { matchList.add(new MatchView(table.getMatch())); } - } - tableView = tableList; - matchView = matchList; + } + tableView = tableList; + matchView = matchList; List players = new ArrayList(); for (User user : UserManager.getInstance().getUsers()) { players.add(user.getName()); } playersView = players; - } - - @Override - public List getFinished() { - return matchView; } @Override - public boolean joinTable(UUID userId, UUID tableId, String name, String playerType, int skill, DeckCardLists deckList) throws MageException { - if (tables.containsKey(tableId)) { - return TableManager.getInstance().joinTable(userId, tableId, name, playerType, skill, deckList); - } else { - return false; - } - } + public List getFinished() { + return matchView; + } - @Override - public TableView createTable(UUID userId, MatchOptions options) { - Table table = TableManager.getInstance().createTable(this.getRoomId(), userId, options); - tables.put(table.getId(), table); - return new TableView(table); - } + @Override + public boolean joinTable(UUID userId, UUID tableId, String name, String playerType, int skill, DeckCardLists deckList) throws MageException { + if (tables.containsKey(tableId)) { + return TableManager.getInstance().joinTable(userId, tableId, name, playerType, skill, deckList); + } else { + return false; + } + } - @Override - public boolean joinTournamentTable(UUID userId, UUID tableId, String name, String playerType, int skill) throws GameException { - if (tables.containsKey(tableId)) { - return TableManager.getInstance().joinTournament(userId, tableId, name, playerType, skill); - } else { - return false; - } - } + @Override + public TableView createTable(UUID userId, MatchOptions options) { + Table table = TableManager.getInstance().createTable(this.getRoomId(), userId, options); + tables.put(table.getId(), table); + return new TableView(table); + } - @Override - public TableView createTournamentTable(UUID userId, TournamentOptions options) { - Table table = TableManager.getInstance().createTournamentTable(this.getRoomId(), userId, options); - tables.put(table.getId(), table); - return new TableView(table); - } + @Override + public boolean joinTournamentTable(UUID userId, UUID tableId, String name, String playerType, int skill) throws GameException { + if (tables.containsKey(tableId)) { + return TableManager.getInstance().joinTournament(userId, tableId, name, playerType, skill); + } else { + return false; + } + } - @Override - public TableView getTable(UUID tableId) { - if (tables.containsKey(tableId)) - return new TableView(tables.get(tableId)); - return null; - } + @Override + public TableView createTournamentTable(UUID userId, TournamentOptions options) { + Table table = TableManager.getInstance().createTournamentTable(this.getRoomId(), userId, options); + tables.put(table.getId(), table); + return new TableView(table); + } - @Override - public void removeTable(UUID userId, UUID tableId) { - tables.remove(tableId); - } + @Override + public TableView getTable(UUID tableId) { + if (tables.containsKey(tableId)) + return new TableView(tables.get(tableId)); + return null; + } - @Override - public void removeTable(UUID tableId) { - tables.remove(tableId); - if (logger.isDebugEnabled()) - logger.debug("Table removed: " + tableId); - } + @Override + public void removeTable(UUID userId, UUID tableId) { + tables.remove(tableId); + } - @Override - public void leaveTable(UUID userId, UUID tableId) { - TableManager.getInstance().leaveTable(userId, tableId); - } + @Override + public void removeTable(UUID tableId) { + tables.remove(tableId); + if (logger.isDebugEnabled()) + logger.debug("Table removed: " + tableId); + } - @Override - public boolean watchTable(UUID userId, UUID tableId) throws MageException { - return TableManager.getInstance().watchTable(userId, tableId); - } + @Override + public void leaveTable(UUID userId, UUID tableId) { + TableManager.getInstance().leaveTable(userId, tableId); + } + + @Override + public boolean watchTable(UUID userId, UUID tableId) throws MageException { + return TableManager.getInstance().watchTable(userId, tableId); + } @Override public List getPlayers() { @@ -179,8 +179,8 @@ public class GamesRoomImpl extends RoomImpl implements GamesRoom, Serializable { } class TimestampSorter implements Comparator
{ - @Override - public int compare(Table one, Table two) { - return one.getCreateTime().compareTo(two.getCreateTime()); - } + @Override + public int compare(Table one, Table two) { + return one.getCreateTime().compareTo(two.getCreateTime()); + } } 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 ce5976dd86..fcb18dea2a 100644 --- a/Mage.Server/src/main/java/mage/server/game/GamesRoomManager.java +++ b/Mage.Server/src/main/java/mage/server/game/GamesRoomManager.java @@ -37,40 +37,40 @@ import java.util.concurrent.ConcurrentHashMap; */ public class GamesRoomManager { - private final static GamesRoomManager INSTANCE = new GamesRoomManager(); -// private final static Logger logger = Logger.getLogger(GamesRoomManager.class); + private final static GamesRoomManager INSTANCE = new GamesRoomManager(); +// private final static Logger logger = Logger.getLogger(GamesRoomManager.class); - private ConcurrentHashMap rooms = new ConcurrentHashMap(); - private UUID mainRoomId; + private ConcurrentHashMap rooms = new ConcurrentHashMap(); + private UUID mainRoomId; - public static GamesRoomManager getInstance() { - return INSTANCE; - } + public static GamesRoomManager getInstance() { + return INSTANCE; + } - private GamesRoomManager() { - GamesRoom mainRoom = new GamesRoomImpl(); - mainRoomId = mainRoom.getRoomId(); - rooms.put(mainRoomId, mainRoom); - } + private GamesRoomManager() { + GamesRoom mainRoom = new GamesRoomImpl(); + mainRoomId = mainRoom.getRoomId(); + rooms.put(mainRoomId, mainRoom); + } - public UUID createRoom() { - GamesRoom room = new GamesRoomImpl(); - rooms.put(room.getRoomId(), room); - return room.getRoomId(); - } + public UUID createRoom() { + GamesRoom room = new GamesRoomImpl(); + rooms.put(room.getRoomId(), room); + return room.getRoomId(); + } - public UUID getMainRoomId() { - return mainRoomId; - } + public UUID getMainRoomId() { + return mainRoomId; + } - public GamesRoom getRoom(UUID roomId) { - return rooms.get(roomId); - } - - public void removeTable(UUID tableId) { - for (GamesRoom room: rooms.values()) { - room.removeTable(tableId); - } - } + public GamesRoom getRoom(UUID roomId) { + return rooms.get(roomId); + } + + public void removeTable(UUID tableId) { + for (GamesRoom room: rooms.values()) { + room.removeTable(tableId); + } + } } diff --git a/Mage.Server/src/main/java/mage/server/game/PlayerFactory.java b/Mage.Server/src/main/java/mage/server/game/PlayerFactory.java index 90f5a3d552..1c3aeb1021 100644 --- a/Mage.Server/src/main/java/mage/server/game/PlayerFactory.java +++ b/Mage.Server/src/main/java/mage/server/game/PlayerFactory.java @@ -42,21 +42,21 @@ import org.apache.log4j.Logger; */ public class PlayerFactory { - private final static PlayerFactory INSTANCE = new PlayerFactory(); - private final static Logger logger = Logger.getLogger(PlayerFactory.class); + private final static PlayerFactory INSTANCE = new PlayerFactory(); + private final static Logger logger = Logger.getLogger(PlayerFactory.class); - private Map playerTypes = new LinkedHashMap(); + private Map playerTypes = new LinkedHashMap(); - public static PlayerFactory getInstance() { - return INSTANCE; - } + public static PlayerFactory getInstance() { + return INSTANCE; + } - private PlayerFactory() {} + private PlayerFactory() {} - public Player createPlayer(String playerType, String name, RangeOfInfluence range, int skill) { - Player player; - Constructor con; - try { + public Player createPlayer(String playerType, String name, RangeOfInfluence range, int skill) { + Player player; + Constructor con; + try { Class playerTypeClass = playerTypes.get(playerType); if (playerTypeClass != null) { con = playerTypeClass.getConstructor(new Class[]{String.class, RangeOfInfluence.class, int.class}); @@ -67,19 +67,19 @@ public class PlayerFactory { else { logger.fatal("Unknown player type: " + playerType); } - } catch (Exception ex) { - logger.fatal("PlayerFactory error ", ex); - } - return null; - } + } catch (Exception ex) { + logger.fatal("PlayerFactory error ", ex); + } + return null; + } - public Set getPlayerTypes() { - return playerTypes.keySet(); - } + public Set getPlayerTypes() { + return playerTypes.keySet(); + } - public void addPlayerType(String name, Class playerType) { - if (playerType != null) - this.playerTypes.put(name, playerType); - } + public void addPlayerType(String name, Class playerType) { + if (playerType != null) + this.playerTypes.put(name, playerType); + } } 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 52de54ea7b..f37fa89bbf 100644 --- a/Mage.Server/src/main/java/mage/server/game/ReplayManager.java +++ b/Mage.Server/src/main/java/mage/server/game/ReplayManager.java @@ -37,41 +37,41 @@ import mage.server.UserManager; * @author BetaSteward_at_googlemail.com */ public class ReplayManager { - private final static ReplayManager INSTANCE = new ReplayManager(); + private final static ReplayManager INSTANCE = new ReplayManager(); - public static ReplayManager getInstance() { - return INSTANCE; - } + public static ReplayManager getInstance() { + return INSTANCE; + } - private ReplayManager() {} + private ReplayManager() {} - private ConcurrentHashMap replaySessions = new ConcurrentHashMap(); + private 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).replayGame(gameId); - } + public void replayGame(UUID gameId, UUID userId) { + ReplaySession replaySession = new ReplaySession(gameId, userId); + replaySessions.put(gameId.toString() + userId.toString(), replaySession); + UserManager.getInstance().getUser(userId).replayGame(gameId); + } - public void startReplay(UUID gameId, UUID userId) { - replaySessions.get(gameId.toString() + userId.toString()).replay(); - } + public void startReplay(UUID gameId, UUID userId) { + replaySessions.get(gameId.toString() + userId.toString()).replay(); + } - public void stopReplay(UUID gameId, UUID userId) { - replaySessions.get(gameId.toString() + userId.toString()).stop(); - } + public void stopReplay(UUID gameId, UUID userId) { + replaySessions.get(gameId.toString() + userId.toString()).stop(); + } - public void nextPlay(UUID gameId, UUID userId) { - replaySessions.get(gameId.toString() + userId.toString()).next(); - } + public void nextPlay(UUID gameId, UUID userId) { + replaySessions.get(gameId.toString() + userId.toString()).next(); + } - public void previousPlay(UUID gameId, UUID userId) { - replaySessions.get(gameId.toString() + userId.toString()).previous(); - } - - public void skipForward(UUID gameId, UUID userId, int moves) { - replaySessions.get(gameId.toString() + userId.toString()).next(moves); - } + public void previousPlay(UUID gameId, UUID userId) { + replaySessions.get(gameId.toString() + userId.toString()).previous(); + } + + public void skipForward(UUID gameId, UUID userId, int moves) { + replaySessions.get(gameId.toString() + userId.toString()).next(moves); + } } 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 30c3e7fb0e..ef0a42033a 100644 --- a/Mage.Server/src/main/java/mage/server/game/ReplaySession.java +++ b/Mage.Server/src/main/java/mage/server/game/ReplaySession.java @@ -43,60 +43,60 @@ import org.apache.log4j.Logger; */ public class ReplaySession implements GameCallback { - private final static Logger logger = Logger.getLogger(ReplaySession.class); - private GameReplay replay; - protected UUID userId; + private final static Logger logger = Logger.getLogger(ReplaySession.class); + private GameReplay replay; + protected UUID userId; - ReplaySession(UUID gameId, UUID userId) { - this.replay = new GameReplay(gameId); - this.userId = userId; - } + ReplaySession(UUID gameId, UUID userId) { + this.replay = new GameReplay(gameId); + this.userId = userId; + } - public void replay() { - replay.start(); - User user = UserManager.getInstance().getUser(userId); - if (user != null) { - user.fireCallback(new ClientCallback("replayInit", replay.getGame().getId(), new GameView(replay.next(), replay.getGame()))); - } - } + public void replay() { + replay.start(); + User user = UserManager.getInstance().getUser(userId); + if (user != null) { + user.fireCallback(new ClientCallback("replayInit", replay.getGame().getId(), new GameView(replay.next(), replay.getGame()))); + } + } - public void stop() { - gameResult("stopped replay"); - } + public void stop() { + gameResult("stopped replay"); + } - public synchronized void next() { - updateGame(replay.next(), replay.getGame()); - } + public synchronized void next() { + updateGame(replay.next(), replay.getGame()); + } - public synchronized void next(int moves) { + public synchronized void next(int moves) { for (int i = 0; i < moves; i++) { replay.next(); } - updateGame(replay.next(), replay.getGame()); - } + updateGame(replay.next(), replay.getGame()); + } public synchronized void previous() { - updateGame(replay.previous(), replay.getGame()); - } + updateGame(replay.previous(), replay.getGame()); + } - @Override - public void gameResult(final String result) { - User user = UserManager.getInstance().getUser(userId); - if (user != null) { - user.fireCallback(new ClientCallback("replayDone", replay.getGame().getId(), result)); - } - } + @Override + public void gameResult(final String result) { + User user = UserManager.getInstance().getUser(userId); + if (user != null) { + user.fireCallback(new ClientCallback("replayDone", replay.getGame().getId(), result)); + } + } - private void updateGame(final GameState state, Game game) { - if (state == null) { - gameResult("game ended"); - } - else { - User user = UserManager.getInstance().getUser(userId); - if (user != null) { - user.fireCallback(new ClientCallback("replayUpdate", replay.getGame().getId(), new GameView(state, game))); - } - } - } + private void updateGame(final GameState state, Game game) { + if (state == null) { + gameResult("game ended"); + } + else { + User user = UserManager.getInstance().getUser(userId); + if (user != null) { + user.fireCallback(new ClientCallback("replayUpdate", replay.getGame().getId(), new GameView(state, game))); + } + } + } } 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 728b55a958..17b92646d2 100644 --- a/Mage.Server/src/main/java/mage/server/tournament/TournamentController.java +++ b/Mage.Server/src/main/java/mage/server/tournament/TournamentController.java @@ -58,218 +58,218 @@ import org.apache.log4j.Logger; */ public class TournamentController { - private final static Logger logger = Logger.getLogger(TournamentController.class); + private final static Logger logger = Logger.getLogger(TournamentController.class); - private UUID chatId; - private UUID tableId; - private boolean started = false; - private Tournament tournament; - private ConcurrentHashMap userPlayerMap = new ConcurrentHashMap(); - private ConcurrentHashMap tournamentSessions = new ConcurrentHashMap(); + private UUID chatId; + private UUID tableId; + private boolean started = false; + private Tournament tournament; + private ConcurrentHashMap userPlayerMap = new ConcurrentHashMap(); + private ConcurrentHashMap tournamentSessions = new ConcurrentHashMap(); - public TournamentController(Tournament tournament, ConcurrentHashMap userPlayerMap, UUID tableId) { - this.userPlayerMap = userPlayerMap; - chatId = ChatManager.getInstance().createChatSession(); - this.tournament = tournament; - this.tableId = tableId; - init(); - } + public TournamentController(Tournament tournament, ConcurrentHashMap userPlayerMap, UUID tableId) { + this.userPlayerMap = userPlayerMap; + chatId = ChatManager.getInstance().createChatSession(); + this.tournament = tournament; + this.tableId = tableId; + init(); + } - private void init() { - tournament.addTableEventListener( - new Listener () { - @Override - public void event(TableEvent event) { - switch (event.getEventType()) { - case INFO: - ChatManager.getInstance().broadcast(chatId, "", event.getMessage(), MessageColor.BLACK); - logger.debug(tournament.getId() + " " + event.getMessage()); - break; - case START_DRAFT: - startDraft(event.getDraft()); - break; - case START_MATCH: - startMatch(event.getPair(), event.getMatchOptions()); - break; -// case SUBMIT_DECK: -// submitDeck(event.getPlayerId(), event.getDeck()); -// break; - case CONSTRUCT: - construct(); - break; - case END: - endTournament(); - break; - } - } - } - ); - tournament.addPlayerQueryEventListener( - new Listener () { - @Override - public void event(PlayerQueryEvent event) { - try { - switch (event.getQueryType()) { - case CONSTRUCT: - construct(event.getPlayerId(), event.getMax()); - break; - } - } catch (MageException ex) { - logger.fatal("Player event listener error", ex); - } - } - } - ); - for (TournamentPlayer player: tournament.getPlayers()) { - if (!player.getPlayer().isHuman()) { - player.setJoined(); - logger.info("player " + player.getPlayer().getId() + " has joined tournament " + tournament.getId()); - ChatManager.getInstance().broadcast(chatId, "", player.getPlayer().getName() + " has joined the tournament", MessageColor.BLACK); - } - } - checkStart(); - } + private void init() { + tournament.addTableEventListener( + new Listener () { + @Override + public void event(TableEvent event) { + switch (event.getEventType()) { + case INFO: + ChatManager.getInstance().broadcast(chatId, "", event.getMessage(), MessageColor.BLACK); + logger.debug(tournament.getId() + " " + event.getMessage()); + break; + case START_DRAFT: + startDraft(event.getDraft()); + break; + case START_MATCH: + startMatch(event.getPair(), event.getMatchOptions()); + break; +// case SUBMIT_DECK: +// submitDeck(event.getPlayerId(), event.getDeck()); +// break; + case CONSTRUCT: + construct(); + break; + case END: + endTournament(); + break; + } + } + } + ); + tournament.addPlayerQueryEventListener( + new Listener () { + @Override + public void event(PlayerQueryEvent event) { + try { + switch (event.getQueryType()) { + case CONSTRUCT: + construct(event.getPlayerId(), event.getMax()); + break; + } + } catch (MageException ex) { + logger.fatal("Player event listener error", ex); + } + } + } + ); + for (TournamentPlayer player: tournament.getPlayers()) { + if (!player.getPlayer().isHuman()) { + player.setJoined(); + logger.info("player " + player.getPlayer().getId() + " has joined tournament " + tournament.getId()); + ChatManager.getInstance().broadcast(chatId, "", player.getPlayer().getName() + " has joined the tournament", MessageColor.BLACK); + } + } + checkStart(); + } - public synchronized void join(UUID userId) { - UUID playerId = userPlayerMap.get(userId); - TournamentSession tournamentSession = new TournamentSession(tournament, userId, tableId, playerId); - tournamentSessions.put(playerId, tournamentSession); - UserManager.getInstance().getUser(userId).addTournament(playerId, tournamentSession); - TournamentPlayer player = tournament.getPlayer(playerId); - player.setJoined(); - logger.info("player " + playerId + " has joined tournament " + tournament.getId()); - ChatManager.getInstance().broadcast(chatId, "", player.getPlayer().getName() + " has joined the tournament", MessageColor.BLACK); - checkStart(); - } + public synchronized void join(UUID userId) { + UUID playerId = userPlayerMap.get(userId); + TournamentSession tournamentSession = new TournamentSession(tournament, userId, tableId, playerId); + tournamentSessions.put(playerId, tournamentSession); + UserManager.getInstance().getUser(userId).addTournament(playerId, tournamentSession); + TournamentPlayer player = tournament.getPlayer(playerId); + player.setJoined(); + logger.info("player " + playerId + " has joined tournament " + tournament.getId()); + ChatManager.getInstance().broadcast(chatId, "", player.getPlayer().getName() + " has joined the tournament", MessageColor.BLACK); + checkStart(); + } - private void checkStart() { - if (!started && allJoined()) { - ThreadExecutor.getInstance().getCallExecutor().execute( - new Runnable() { - @Override - public void run() { - startTournament(); - } - }); - } - } + private void checkStart() { + if (!started && allJoined()) { + ThreadExecutor.getInstance().getCallExecutor().execute( + new Runnable() { + @Override + public void run() { + startTournament(); + } + }); + } + } - private boolean allJoined() { - if (!tournament.allJoined()) - return false; - for (TournamentPlayer player: tournament.getPlayers()) { - if (player.getPlayer().isHuman() && tournamentSessions.get(player.getPlayer().getId()) == null) { - return false; - } - } - return true; - } + private boolean allJoined() { + if (!tournament.allJoined()) + return false; + for (TournamentPlayer player: tournament.getPlayers()) { + if (player.getPlayer().isHuman() && tournamentSessions.get(player.getPlayer().getId()) == null) { + return false; + } + } + return true; + } - private synchronized void startTournament() { - for (final Entry entry: tournamentSessions.entrySet()) { - if (!entry.getValue().init()) { - logger.fatal("Unable to initialize client"); - //TODO: generate client error message - return; - } - } - started = true; - tournament.nextStep(); - } + private synchronized void startTournament() { + for (final Entry entry: tournamentSessions.entrySet()) { + if (!entry.getValue().init()) { + logger.fatal("Unable to initialize client"); + //TODO: generate client error message + return; + } + } + started = true; + tournament.nextStep(); + } - private void endTournament() { - for (final TournamentSession tournamentSession: tournamentSessions.values()) { - tournamentSession.tournamentOver(); - tournamentSession.removeTournament(); - } - TableManager.getInstance().endTournament(tableId, tournament); - } + private void endTournament() { + for (final TournamentSession tournamentSession: tournamentSessions.values()) { + tournamentSession.tournamentOver(); + tournamentSession.removeTournament(); + } + TableManager.getInstance().endTournament(tableId, tournament); + } - private void startMatch(TournamentPairing pair, MatchOptions matchOptions) { - try { - TableManager tableManager = TableManager.getInstance(); - Table table = tableManager.createTable(GamesRoomManager.getInstance().getMainRoomId(), matchOptions); - TournamentPlayer player1 = pair.getPlayer1(); - TournamentPlayer player2 = pair.getPlayer2(); - tableManager.addPlayer(getPlayerSessionId(player1.getPlayer().getId()), table.getId(), player1.getPlayer(), player1.getPlayerType(), player1.getDeck()); - tableManager.addPlayer(getPlayerSessionId(player2.getPlayer().getId()), table.getId(), player2.getPlayer(), player2.getPlayerType(), player2.getDeck()); - tableManager.startMatch(null, table.getId()); - pair.setMatch(tableManager.getMatch(table.getId())); - } catch (GameException ex) { - logger.fatal("TournamentController startMatch error", ex); - } - } + private void startMatch(TournamentPairing pair, MatchOptions matchOptions) { + try { + TableManager tableManager = TableManager.getInstance(); + Table table = tableManager.createTable(GamesRoomManager.getInstance().getMainRoomId(), matchOptions); + TournamentPlayer player1 = pair.getPlayer1(); + TournamentPlayer player2 = pair.getPlayer2(); + tableManager.addPlayer(getPlayerSessionId(player1.getPlayer().getId()), table.getId(), player1.getPlayer(), player1.getPlayerType(), player1.getDeck()); + tableManager.addPlayer(getPlayerSessionId(player2.getPlayer().getId()), table.getId(), player2.getPlayer(), player2.getPlayerType(), player2.getDeck()); + tableManager.startMatch(null, table.getId()); + pair.setMatch(tableManager.getMatch(table.getId())); + } catch (GameException ex) { + logger.fatal("TournamentController startMatch error", ex); + } + } - private void startDraft(Draft draft) { - TableManager.getInstance().startDraft(tableId, draft); - } + private void startDraft(Draft draft) { + TableManager.getInstance().startDraft(tableId, draft); + } - private void construct() { - TableManager.getInstance().construct(tableId); - } + private void construct() { + TableManager.getInstance().construct(tableId); + } - private void construct(UUID playerId, int timeout) throws MageException { - if (tournamentSessions.containsKey(playerId)) { + private void construct(UUID playerId, int timeout) throws MageException { + if (tournamentSessions.containsKey(playerId)) { TournamentSession tournamentSession = tournamentSessions.get(playerId); - tournamentSession.construct(timeout); + tournamentSession.construct(timeout); UserManager.getInstance().getUser(getPlayerSessionId(playerId)).addConstructing(playerId, tournamentSession); } - } + } - public void submitDeck(UUID playerId, Deck deck) { - if (tournamentSessions.containsKey(playerId)) { - tournamentSessions.get(playerId).submitDeck(deck); + public void submitDeck(UUID playerId, Deck deck) { + if (tournamentSessions.containsKey(playerId)) { + tournamentSessions.get(playerId).submitDeck(deck); } - } + } - public void updateDeck(UUID playerId, Deck deck) { - if (tournamentSessions.containsKey(playerId)) { - tournamentSessions.get(playerId).updateDeck(deck); + public void updateDeck(UUID playerId, Deck deck) { + if (tournamentSessions.containsKey(playerId)) { + tournamentSessions.get(playerId).updateDeck(deck); } - } + } public void timeout(UUID userId) { - if (userPlayerMap.containsKey(userId)) { - TournamentPlayer player = tournament.getPlayer(userPlayerMap.get(userId)); - tournament.autoSubmit(userPlayerMap.get(userId), player.generateDeck()); - } - } + if (userPlayerMap.containsKey(userId)) { + TournamentPlayer player = tournament.getPlayer(userPlayerMap.get(userId)); + tournament.autoSubmit(userPlayerMap.get(userId), player.generateDeck()); + } + } -// public UUID getSessionId() { -// return this.sessionId; -// } +// public UUID getSessionId() { +// return this.sessionId; +// } - public UUID getChatId() { - return chatId; - } + public UUID getChatId() { + return chatId; + } - public void kill(UUID userId) { - if (userPlayerMap.containsKey(userId)) { - tournamentSessions.get(userPlayerMap.get(userId)).setKilled(); - tournamentSessions.remove(userPlayerMap.get(userId)); - leave(userId); - userPlayerMap.remove(userId); - } - } + public void kill(UUID userId) { + if (userPlayerMap.containsKey(userId)) { + tournamentSessions.get(userPlayerMap.get(userId)).setKilled(); + tournamentSessions.remove(userPlayerMap.get(userId)); + leave(userId); + userPlayerMap.remove(userId); + } + } - private void leave(UUID userId) { - tournament.leave(getPlayerId(userId)); - } + private void leave(UUID userId) { + tournament.leave(getPlayerId(userId)); + } - private UUID getPlayerId(UUID userId) { - return userPlayerMap.get(userId); - } + private UUID getPlayerId(UUID userId) { + return userPlayerMap.get(userId); + } - private UUID getPlayerSessionId(UUID playerId) { - for (Entry entry: userPlayerMap.entrySet()) { - if (entry.getValue().equals(playerId)) - return entry.getKey(); - } - return null; - } + private UUID getPlayerSessionId(UUID playerId) { + for (Entry entry: userPlayerMap.entrySet()) { + if (entry.getValue().equals(playerId)) + return entry.getKey(); + } + return null; + } - public TournamentView getTournamentView() { - return new TournamentView(tournament); - } + public TournamentView getTournamentView() { + return new TournamentView(tournament); + } } diff --git a/Mage.Server/src/main/java/mage/server/tournament/TournamentFactory.java b/Mage.Server/src/main/java/mage/server/tournament/TournamentFactory.java index b9910e06c2..26b919dda2 100644 --- a/Mage.Server/src/main/java/mage/server/tournament/TournamentFactory.java +++ b/Mage.Server/src/main/java/mage/server/tournament/TournamentFactory.java @@ -45,49 +45,49 @@ import org.apache.log4j.Logger; * @author BetaSteward_at_googlemail.com */ public class TournamentFactory { - private final static TournamentFactory INSTANCE = new TournamentFactory(); - private final static Logger logger = Logger.getLogger(TournamentFactory.class); + private final static TournamentFactory INSTANCE = new TournamentFactory(); + private final static Logger logger = Logger.getLogger(TournamentFactory.class); - private Map> tournaments = new HashMap>(); - private Map tournamentTypes = new HashMap(); - private List tournamentTypeViews = new ArrayList(); + private Map> tournaments = new HashMap>(); + private Map tournamentTypes = new HashMap(); + private List tournamentTypeViews = new ArrayList(); - public static TournamentFactory getInstance() { - return INSTANCE; - } + public static TournamentFactory getInstance() { + return INSTANCE; + } - private TournamentFactory() {} + private TournamentFactory() {} - public Tournament createTournament(String tournamentType, TournamentOptions options) { + public Tournament createTournament(String tournamentType, TournamentOptions options) { - Tournament tournament; - Constructor con; - try { - con = tournaments.get(tournamentType).getConstructor(new Class[]{TournamentOptions.class}); - tournament = con.newInstance(new Object[] {options}); - for (String setCode: options.getLimitedOptions().getSetCodes()) { - tournament.getSets().add(Sets.findSet(setCode)); - } - } catch (Exception ex) { - logger.fatal("TournamentFactory error ", ex); - return null; - } - logger.info("Tournament created: " + tournamentType); // + game.getId().toString()); + Tournament tournament; + Constructor con; + try { + con = tournaments.get(tournamentType).getConstructor(new Class[]{TournamentOptions.class}); + tournament = con.newInstance(new Object[] {options}); + for (String setCode: options.getLimitedOptions().getSetCodes()) { + tournament.getSets().add(Sets.findSet(setCode)); + } + } catch (Exception ex) { + logger.fatal("TournamentFactory error ", ex); + return null; + } + logger.info("Tournament created: " + tournamentType); // + game.getId().toString()); - return tournament; - } + return tournament; + } - public List getTournamentTypes() { - return tournamentTypeViews; - } + public List getTournamentTypes() { + return tournamentTypeViews; + } - public void addTournamentType(String name, TournamentType tournamentType, Class tournament) { - if (tournament != null) { - this.tournaments.put(name, tournament); - this.tournamentTypes.put(name, tournamentType); - this.tournamentTypeViews.add(new TournamentTypeView(tournamentType)); - } - } + public void addTournamentType(String name, TournamentType tournamentType, Class tournament) { + if (tournament != null) { + this.tournaments.put(name, tournament); + this.tournamentTypes.put(name, tournamentType); + this.tournamentTypeViews.add(new TournamentTypeView(tournamentType)); + } + } } \ No newline at end of file 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 a7adce93cf..0ea9d97884 100644 --- a/Mage.Server/src/main/java/mage/server/tournament/TournamentManager.java +++ b/Mage.Server/src/main/java/mage/server/tournament/TournamentManager.java @@ -40,45 +40,45 @@ import mage.view.TournamentView; */ public class TournamentManager { - private final static TournamentManager INSTANCE = new TournamentManager(); + private final static TournamentManager INSTANCE = new TournamentManager(); - private ConcurrentHashMap controllers = new ConcurrentHashMap(); + private ConcurrentHashMap controllers = new ConcurrentHashMap(); - public static TournamentManager getInstance() { - return INSTANCE; - } + public static TournamentManager getInstance() { + return INSTANCE; + } - public void createTournamentSession(Tournament tournament, ConcurrentHashMap userPlayerMap, UUID tableId) { - TournamentController tournamentController = new TournamentController(tournament, userPlayerMap, tableId); - controllers.put(tournament.getId(), tournamentController); - } + public void createTournamentSession(Tournament tournament, ConcurrentHashMap userPlayerMap, UUID tableId) { + TournamentController tournamentController = new TournamentController(tournament, userPlayerMap, tableId); + controllers.put(tournament.getId(), tournamentController); + } - public void joinTournament(UUID tournamentId, UUID userId) { - controllers.get(tournamentId).join(userId); - } + public void joinTournament(UUID tournamentId, UUID userId) { + controllers.get(tournamentId).join(userId); + } - public void kill(UUID tournamentId, UUID userId) { - controllers.get(tournamentId).kill(userId); - } + public void kill(UUID tournamentId, UUID userId) { + controllers.get(tournamentId).kill(userId); + } - public void timeout(UUID tournamentId, UUID userId) { - controllers.get(tournamentId).timeout(userId); - } + public void timeout(UUID tournamentId, UUID userId) { + controllers.get(tournamentId).timeout(userId); + } - public void submitDeck(UUID tournamentId, UUID playerId, Deck deck) { - controllers.get(tournamentId).submitDeck(playerId, deck); - } + public void submitDeck(UUID tournamentId, UUID playerId, Deck deck) { + controllers.get(tournamentId).submitDeck(playerId, deck); + } - public void updateDeck(UUID tournamentId, UUID playerId, Deck deck) { - controllers.get(tournamentId).updateDeck(playerId, deck); - } + public void updateDeck(UUID tournamentId, UUID playerId, Deck deck) { + controllers.get(tournamentId).updateDeck(playerId, deck); + } public TournamentView getTournamentView(UUID tournamentId) { - return controllers.get(tournamentId).getTournamentView(); - } + return controllers.get(tournamentId).getTournamentView(); + } - public UUID getChatId(UUID tournamentId) { - return controllers.get(tournamentId).getChatId(); - } + public UUID getChatId(UUID tournamentId) { + return controllers.get(tournamentId).getChatId(); + } } 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 36ae492299..6b171a8577 100644 --- a/Mage.Server/src/main/java/mage/server/tournament/TournamentSession.java +++ b/Mage.Server/src/main/java/mage/server/tournament/TournamentSession.java @@ -47,121 +47,121 @@ import org.apache.log4j.Logger; * @author BetaSteward_at_googlemail.com */ public class TournamentSession { - protected final static Logger logger = Logger.getLogger(TournamentSession.class); + protected final static Logger logger = Logger.getLogger(TournamentSession.class); - protected UUID userId; - protected UUID playerId; - protected UUID tableId; - protected Tournament tournament; - protected boolean killed = false; + protected UUID userId; + protected UUID playerId; + protected UUID tableId; + protected Tournament tournament; + protected boolean killed = false; - private ScheduledFuture futureTimeout; - protected static ScheduledExecutorService timeoutExecutor = ThreadExecutor.getInstance().getTimeoutExecutor(); + private ScheduledFuture futureTimeout; + protected static ScheduledExecutorService timeoutExecutor = ThreadExecutor.getInstance().getTimeoutExecutor(); - public TournamentSession(Tournament tournament, UUID userId, UUID tableId, UUID playerId) { - this.userId = userId; - this.tournament = tournament; - this.playerId = playerId; - this.tableId = tableId; - } + public TournamentSession(Tournament tournament, UUID userId, UUID tableId, UUID playerId) { + this.userId = userId; + this.tournament = tournament; + this.playerId = playerId; + this.tableId = tableId; + } - public boolean init() { - if (!killed) { - User user = UserManager.getInstance().getUser(userId); - if (user != null) { - user.fireCallback(new ClientCallback("tournamentInit", tournament.getId(), getTournamentView())); - return true; - } - } - return false; - } + public boolean init() { + if (!killed) { + User user = UserManager.getInstance().getUser(userId); + if (user != null) { + user.fireCallback(new ClientCallback("tournamentInit", tournament.getId(), getTournamentView())); + return true; + } + } + return false; + } - public void update() { - if (!killed) { - User user = UserManager.getInstance().getUser(userId); - if (user != null) { - user.fireCallback(new ClientCallback("tournamentUpdate", tournament.getId(), getTournamentView())); - } - } - } + public void update() { + if (!killed) { + User user = UserManager.getInstance().getUser(userId); + if (user != null) { + user.fireCallback(new ClientCallback("tournamentUpdate", tournament.getId(), getTournamentView())); + } + } + } - public void gameOver(final String message) { - if (!killed) { - User user = UserManager.getInstance().getUser(userId); - if (user != null) { - user.fireCallback(new ClientCallback("tournamentOver", tournament.getId(), message)); - } - } - } + public void gameOver(final String message) { + if (!killed) { + User user = UserManager.getInstance().getUser(userId); + if (user != null) { + user.fireCallback(new ClientCallback("tournamentOver", tournament.getId(), message)); + } + } + } - public void construct(int timeout) { - if (!killed) { - setupTimeout(timeout); - User user = UserManager.getInstance().getUser(userId); - if (user != null) { + public void construct(int timeout) { + if (!killed) { + setupTimeout(timeout); + User user = UserManager.getInstance().getUser(userId); + if (user != null) { int remaining = (int) futureTimeout.getDelay(TimeUnit.SECONDS); - user.construct(tournament.getPlayer(playerId).getDeck(), tableId, remaining); - } - } - } + user.construct(tournament.getPlayer(playerId).getDeck(), tableId, remaining); + } + } + } - public void submitDeck(Deck deck) { - cancelTimeout(); - tournament.submitDeck(playerId, deck); - } + public void submitDeck(Deck deck) { + cancelTimeout(); + tournament.submitDeck(playerId, deck); + } - public void updateDeck(Deck deck) { - tournament.updateDeck(playerId, deck); - } + public void updateDeck(Deck deck) { + tournament.updateDeck(playerId, deck); + } protected void handleRemoteException(RemoteException ex) { - logger.fatal("TournamentSession error ", ex); - TournamentManager.getInstance().kill(tournament.getId(), userId); - } + logger.fatal("TournamentSession error ", ex); + TournamentManager.getInstance().kill(tournament.getId(), userId); + } - public void setKilled() { - killed = true; - } + public void setKilled() { + killed = true; + } - private synchronized void setupTimeout(int seconds) { + private synchronized void setupTimeout(int seconds) { if (futureTimeout != null && !futureTimeout.isDone()) return; - cancelTimeout(); - if (seconds > 0) { - futureTimeout = timeoutExecutor.schedule( - new Runnable() { - @Override - public void run() { - TournamentManager.getInstance().timeout(tournament.getId(), userId); - } - }, - seconds, TimeUnit.SECONDS - ); - } - } + cancelTimeout(); + if (seconds > 0) { + futureTimeout = timeoutExecutor.schedule( + new Runnable() { + @Override + public void run() { + TournamentManager.getInstance().timeout(tournament.getId(), userId); + } + }, + seconds, TimeUnit.SECONDS + ); + } + } - private synchronized void cancelTimeout() { - if (futureTimeout != null) { - futureTimeout.cancel(false); - } - } + private synchronized void cancelTimeout() { + if (futureTimeout != null) { + futureTimeout.cancel(false); + } + } - public void removeTournament() { - User user = UserManager.getInstance().getUser(userId); - if (user != null) - user.removeTournament(playerId); - } - - private TournamentView getTournamentView() { - return new TournamentView(tournament); - } + public void removeTournament() { + User user = UserManager.getInstance().getUser(userId); + if (user != null) + user.removeTournament(playerId); + } - public UUID getTournamentId() { - return tournament.getId(); - } + private TournamentView getTournamentView() { + return new TournamentView(tournament); + } - void tournamentOver() { - //TODO: implement this - } + public UUID getTournamentId() { + return tournament.getId(); + } + + void tournamentOver() { + //TODO: implement this + } } diff --git a/Mage.Server/src/main/java/mage/server/util/Config.java b/Mage.Server/src/main/java/mage/server/util/Config.java index e79d5b605a..769932e686 100644 --- a/Mage.Server/src/main/java/mage/server/util/Config.java +++ b/Mage.Server/src/main/java/mage/server/util/Config.java @@ -38,24 +38,24 @@ import org.apache.log4j.Logger; */ public class Config { - private final static Logger logger = Logger.getLogger(Config.class); + private final static Logger logger = Logger.getLogger(Config.class); - static { - Properties p = new Properties(); - try { - p.load(Config.class.getResourceAsStream("resources/config.properties")); - } catch (IOException ex) { - logger.fatal("Config error", ex); - } - port = Integer.parseInt(p.getProperty("port")); - remoteServer = p.getProperty("remote-server"); - maxGameThreads = Integer.parseInt(p.getProperty("max-game-threads")); - maxSecondsIdle = Integer.parseInt(p.getProperty("max-seconds-idle")); - } + static { + Properties p = new Properties(); + try { + p.load(Config.class.getResourceAsStream("resources/config.properties")); + } catch (IOException ex) { + logger.fatal("Config error", ex); + } + port = Integer.parseInt(p.getProperty("port")); + remoteServer = p.getProperty("remote-server"); + maxGameThreads = Integer.parseInt(p.getProperty("max-game-threads")); + maxSecondsIdle = Integer.parseInt(p.getProperty("max-seconds-idle")); + } - public static final String remoteServer; - public static final int port; - public static final int maxGameThreads; - public static final int maxSecondsIdle; + public static final String remoteServer; + public static final int port; + public static final int maxGameThreads; + public static final int maxSecondsIdle; } 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 02685ec91f..0e2a5ebfd0 100644 --- a/Mage.Server/src/main/java/mage/server/util/ConfigSettings.java +++ b/Mage.Server/src/main/java/mage/server/util/ConfigSettings.java @@ -44,59 +44,59 @@ import org.apache.log4j.Logger; */ public class ConfigSettings { - private final static Logger logger = Logger.getLogger(ConfigSettings.class); - private final static ConfigSettings INSTANCE = new ConfigSettings(); - - private Config config; + private final static Logger logger = Logger.getLogger(ConfigSettings.class); + private final static ConfigSettings INSTANCE = new ConfigSettings(); - public static ConfigSettings getInstance() { - return INSTANCE; - } + private Config config; - private ConfigSettings() { - try { - JAXBContext jaxbContext = JAXBContext.newInstance("mage.server.util.config"); - Unmarshaller unmarshaller = jaxbContext.createUnmarshaller(); - config = (Config) unmarshaller.unmarshal(new File("config/config.xml")); - } catch (JAXBException ex) { - logger.fatal("ConfigSettings error", ex); - } - } + public static ConfigSettings getInstance() { + return INSTANCE; + } - public String getServerAddress() { - return config.getServer().getServerAddress(); - } + private ConfigSettings() { + try { + JAXBContext jaxbContext = JAXBContext.newInstance("mage.server.util.config"); + Unmarshaller unmarshaller = jaxbContext.createUnmarshaller(); + config = (Config) unmarshaller.unmarshal(new File("config/config.xml")); + } catch (JAXBException ex) { + logger.fatal("ConfigSettings error", ex); + } + } - public String getServerName() { - return config.getServer().getServerName(); - } + public String getServerAddress() { + return config.getServer().getServerAddress(); + } - public int getPort() { - return config.getServer().getPort().intValue(); - } + public String getServerName() { + return config.getServer().getServerName(); + } - public int getMaxGameThreads() { - return config.getServer().getMaxGameThreads().intValue(); - } + public int getPort() { + return config.getServer().getPort().intValue(); + } - public int getMaxSecondsIdle() { - return config.getServer().getMaxSecondsIdle().intValue(); - } + public int getMaxGameThreads() { + return config.getServer().getMaxGameThreads().intValue(); + } - public List getPlayerTypes() { - return config.getPlayerTypes().getPlayerType(); - } + public int getMaxSecondsIdle() { + return config.getServer().getMaxSecondsIdle().intValue(); + } - public List getGameTypes() { - return config.getGameTypes().getGameType(); - } + public List getPlayerTypes() { + return config.getPlayerTypes().getPlayerType(); + } - public List getTournamentTypes() { - return config.getTournamentTypes().getTournamentType(); - } + public List getGameTypes() { + return config.getGameTypes().getGameType(); + } - public List getDeckTypes() { - return config.getDeckTypes().getDeckType(); - } + public List getTournamentTypes() { + return config.getTournamentTypes().getTournamentType(); + } + + public List getDeckTypes() { + return config.getDeckTypes().getDeckType(); + } } diff --git a/Mage.Server/src/main/java/mage/server/util/PluginClassLoader.java b/Mage.Server/src/main/java/mage/server/util/PluginClassLoader.java index 75123cc606..6fa20e9a1f 100644 --- a/Mage.Server/src/main/java/mage/server/util/PluginClassLoader.java +++ b/Mage.Server/src/main/java/mage/server/util/PluginClassLoader.java @@ -40,37 +40,37 @@ import java.net.URLClassLoader; */ public class PluginClassLoader extends URLClassLoader { - public PluginClassLoader(){ - super(new URL[0], PluginClassLoader.class.getClassLoader()); - } + public PluginClassLoader(){ + super(new URL[0], PluginClassLoader.class.getClassLoader()); + } - @Override - public void addURL(URL url) { - super.addURL(url); - } + @Override + public void addURL(URL url) { + super.addURL(url); + } - @Override - public Class loadClass(String name) throws ClassNotFoundException { - // First check whether it's already been loaded, if so use it - Class loadedClass = findLoadedClass(name); + @Override + public Class loadClass(String name) throws ClassNotFoundException { + // First check whether it's already been loaded, if so use it + Class loadedClass = findLoadedClass(name); - // Not loaded, try to load it - if (loadedClass == null) { - try { - // Ignore parent delegation and just try to load locally - loadedClass = findClass(name); - } catch (ClassNotFoundException e) { - // Swallow exception - does not exist locally - } + // Not loaded, try to load it + if (loadedClass == null) { + try { + // Ignore parent delegation and just try to load locally + loadedClass = findClass(name); + } catch (ClassNotFoundException e) { + // Swallow exception - does not exist locally + } - // If not found locally, use normal parent delegation in URLClassloader - if (loadedClass == null) { - // throws ClassNotFoundException if not found in delegation hierarchy at all - loadedClass = super.loadClass(name); - } - } - // will never return null (ClassNotFoundException will be thrown) - return loadedClass; + // If not found locally, use normal parent delegation in URLClassloader + if (loadedClass == null) { + // throws ClassNotFoundException if not found in delegation hierarchy at all + loadedClass = super.loadClass(name); + } + } + // will never return null (ClassNotFoundException will be thrown) + return loadedClass; } 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 3831c5f25b..0d947069f2 100644 --- a/Mage.Server/src/main/java/mage/server/util/ServerMessagesUtil.java +++ b/Mage.Server/src/main/java/mage/server/util/ServerMessagesUtil.java @@ -54,7 +54,7 @@ public class ServerMessagesUtil { 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 static ScheduledExecutorService updateExecutor; private List messages = new ArrayList(); private ReadWriteLock lock = new ReentrantReadWriteLock(); @@ -72,12 +72,12 @@ public class ServerMessagesUtil { public ServerMessagesUtil() { updateExecutor = Executors.newSingleThreadScheduledExecutor(); - updateExecutor.scheduleAtFixedRate(new Runnable() { - @Override - public void run() { - reloadMessages(); - } - }, 5, 5 * 60, TimeUnit.SECONDS); + updateExecutor.scheduleAtFixedRate(new Runnable() { + @Override + public void run() { + reloadMessages(); + } + }, 5, 5 * 60, TimeUnit.SECONDS); } public static ServerMessagesUtil getInstance() { diff --git a/Mage.Server/src/main/java/mage/server/util/Splitter.java b/Mage.Server/src/main/java/mage/server/util/Splitter.java index d810626ed9..efa43682c0 100644 --- a/Mage.Server/src/main/java/mage/server/util/Splitter.java +++ b/Mage.Server/src/main/java/mage/server/util/Splitter.java @@ -12,13 +12,13 @@ import java.util.UUID; */ public class Splitter { - public static List split(Game game, UUID playerId) { - List players = new ArrayList(); - //players.add(playerId); // add original player - Player player = game.getPlayer(playerId); - if (player != null && player.getTurnControlledBy() != null) { - players.add(player.getTurnControlledBy()); - } - return players; - } + public static List split(Game game, UUID playerId) { + List players = new ArrayList(); + //players.add(playerId); // add original player + Player player = game.getPlayer(playerId); + if (player != null && player.getTurnControlledBy() != null) { + players.add(player.getTurnControlledBy()); + } + return players; + } } diff --git a/Mage.Server/src/main/java/mage/server/util/SystemUtil.java b/Mage.Server/src/main/java/mage/server/util/SystemUtil.java index 37f48e915e..121a23e29c 100644 --- a/Mage.Server/src/main/java/mage/server/util/SystemUtil.java +++ b/Mage.Server/src/main/java/mage/server/util/SystemUtil.java @@ -18,117 +18,117 @@ import java.util.regex.Pattern; */ public class SystemUtil { - private static final String INIT_FILE_PATH = "config" + File.separator + "init.txt"; - private static final org.apache.log4j.Logger logger = org.apache.log4j.Logger.getLogger(SystemUtil.class); + private static final String INIT_FILE_PATH = "config" + File.separator + "init.txt"; + private static final org.apache.log4j.Logger logger = org.apache.log4j.Logger.getLogger(SystemUtil.class); - /** - * Replaces cards in player's hands by specified in config/init.txt.
- *
- * Implementation note:
- * 1. Read init.txt line by line
- * 2. Parse line using the following format: line ::= :::
- * 3. If zone equals to 'hand', add card to player's library
- * 3a. Then swap added card with any card in player's hand
- * 3b. Parse next line (go to 2.), If EOF go to 4.
- * 4. Log message to all players that cards were added (to prevent unfair play).
- * 5. Exit
- */ - public static void addCardsForTesting(Game game) { - try { - File f = new File(INIT_FILE_PATH); - Pattern pattern = Pattern.compile("([a-zA-Z]*):([\\w]*):([a-zA-Z ,\\-.!'\\d]*):([\\d]*)"); - if (!f.exists()) { - logger.warn("Couldn't find init file: " + INIT_FILE_PATH); - return; - } + /** + * Replaces cards in player's hands by specified in config/init.txt.
+ *
+ * Implementation note:
+ * 1. Read init.txt line by line
+ * 2. Parse line using the following format: line ::= :::
+ * 3. If zone equals to 'hand', add card to player's library
+ * 3a. Then swap added card with any card in player's hand
+ * 3b. Parse next line (go to 2.), If EOF go to 4.
+ * 4. Log message to all players that cards were added (to prevent unfair play).
+ * 5. Exit
+ */ + public static void addCardsForTesting(Game game) { + try { + File f = new File(INIT_FILE_PATH); + Pattern pattern = Pattern.compile("([a-zA-Z]*):([\\w]*):([a-zA-Z ,\\-.!'\\d]*):([\\d]*)"); + if (!f.exists()) { + logger.warn("Couldn't find init file: " + INIT_FILE_PATH); + return; + } - logger.info("Parsing init.txt... "); + logger.info("Parsing init.txt... "); - Scanner scanner = new Scanner(f); - try { - while (scanner.hasNextLine()) { - String line = scanner.nextLine().trim(); - if (line.trim().length() == 0 || line.startsWith("#")) continue; - Matcher m = pattern.matcher(line); - if (m.matches()) { + Scanner scanner = new Scanner(f); + try { + while (scanner.hasNextLine()) { + String line = scanner.nextLine().trim(); + if (line.trim().length() == 0 || line.startsWith("#")) continue; + Matcher m = pattern.matcher(line); + if (m.matches()) { - String zone = m.group(1); - String nickname = m.group(2); + String zone = m.group(1); + String nickname = m.group(2); - Player player = findPlayer(game, nickname); - if (player != null) { - Constants.Zone gameZone; - if ("hand".equalsIgnoreCase(zone)) { - gameZone = Constants.Zone.HAND; - } else if ("battlefield".equalsIgnoreCase(zone)) { - gameZone = Constants.Zone.BATTLEFIELD; - } else if ("graveyard".equalsIgnoreCase(zone)) { - gameZone = Constants.Zone.GRAVEYARD; - } else if ("library".equalsIgnoreCase(zone)) { - gameZone = Constants.Zone.LIBRARY; - } else { - continue; // go parse next line - } + Player player = findPlayer(game, nickname); + if (player != null) { + Constants.Zone gameZone; + if ("hand".equalsIgnoreCase(zone)) { + gameZone = Constants.Zone.HAND; + } else if ("battlefield".equalsIgnoreCase(zone)) { + gameZone = Constants.Zone.BATTLEFIELD; + } else if ("graveyard".equalsIgnoreCase(zone)) { + gameZone = Constants.Zone.GRAVEYARD; + } else if ("library".equalsIgnoreCase(zone)) { + gameZone = Constants.Zone.LIBRARY; + } else { + continue; // go parse next line + } - String cardName = m.group(3); - Integer amount = Integer.parseInt(m.group(4)); - for (int i = 0; i < amount; i++) { - Card card = Sets.findCard(cardName, true); - if (card != null) { - Set cards = new HashSet(); - cards.add(card); - game.loadCards(cards, player.getId()); - swapWithAnyCard(game, player, card, gameZone); - } else { - logger.fatal("Couldn't find a card: " + cardName); - } - } - } else { - logger.warn("Was skipped: " + line); - } - } else { - logger.warn("Init string wasn't parsed: " + line); - } - } - } - finally { - scanner.close(); - } - } catch (Exception e) { - logger.fatal("", e); - } - } + String cardName = m.group(3); + Integer amount = Integer.parseInt(m.group(4)); + for (int i = 0; i < amount; i++) { + Card card = Sets.findCard(cardName, true); + if (card != null) { + Set cards = new HashSet(); + cards.add(card); + game.loadCards(cards, player.getId()); + swapWithAnyCard(game, player, card, gameZone); + } else { + logger.fatal("Couldn't find a card: " + cardName); + } + } + } else { + logger.warn("Was skipped: " + line); + } + } else { + logger.warn("Init string wasn't parsed: " + line); + } + } + } + finally { + scanner.close(); + } + } catch (Exception e) { + logger.fatal("", e); + } + } - /** - * Swap cards between specified card from library and any hand card. - * - * @param game - * @param card Card to put to player's hand - */ - private static void swapWithAnyCard(Game game, Player player, Card card, Constants.Zone zone) { - if (zone.equals(Constants.Zone.BATTLEFIELD)) { - card.putOntoBattlefield(game, Constants.Zone.OUTSIDE, null, player.getId()); - } else if (zone.equals(Constants.Zone.LIBRARY)) { + /** + * Swap cards between specified card from library and any hand card. + * + * @param game + * @param card Card to put to player's hand + */ + private static void swapWithAnyCard(Game game, Player player, Card card, Constants.Zone zone) { + if (zone.equals(Constants.Zone.BATTLEFIELD)) { + card.putOntoBattlefield(game, Constants.Zone.OUTSIDE, null, player.getId()); + } else if (zone.equals(Constants.Zone.LIBRARY)) { game.setZone(card.getId(), Constants.Zone.LIBRARY); player.getLibrary().putOnTop(card, game); } else { - card.moveToZone(zone, null, game, false); - } - logger.info("Added card to player's " + zone.toString() + ": " + card.getName() +", player = " + player.getName()); - } + card.moveToZone(zone, null, game, false); + } + logger.info("Added card to player's " + zone.toString() + ": " + card.getName() +", player = " + player.getName()); + } - /** - * Find player by name. - * - * @param game - * @param name - * @return - */ - private static Player findPlayer(Game game, String name) { - for (Player player: game.getPlayers().values()) { - if (player.getName().equals(name)) - return player; - } - return null; - } + /** + * Find player by name. + * + * @param game + * @param name + * @return + */ + private static Player findPlayer(Game game, String name) { + for (Player player: game.getPlayers().values()) { + if (player.getName().equals(name)) + return player; + } + return null; + } } 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 f2844fd5bb..c96ef8406a 100644 --- a/Mage.Server/src/main/java/mage/server/util/ThreadExecutor.java +++ b/Mage.Server/src/main/java/mage/server/util/ThreadExecutor.java @@ -36,37 +36,37 @@ import java.util.concurrent.*; */ public class ThreadExecutor { - private static final ExecutorService callExecutor = Executors.newCachedThreadPool(); - private static final ExecutorService gameExecutor = Executors.newFixedThreadPool(ConfigSettings.getInstance().getMaxGameThreads()); - private static final ScheduledExecutorService timeoutExecutor = Executors.newScheduledThreadPool(5); + private static final ExecutorService callExecutor = Executors.newCachedThreadPool(); + private static final ExecutorService gameExecutor = Executors.newFixedThreadPool(ConfigSettings.getInstance().getMaxGameThreads()); + private static final ScheduledExecutorService timeoutExecutor = Executors.newScheduledThreadPool(5); - static { - ((ThreadPoolExecutor)callExecutor).setKeepAliveTime(60, TimeUnit.SECONDS); - ((ThreadPoolExecutor)callExecutor).allowCoreThreadTimeOut(true); - ((ThreadPoolExecutor)gameExecutor).setKeepAliveTime(60, TimeUnit.SECONDS); - ((ThreadPoolExecutor)gameExecutor).allowCoreThreadTimeOut(true); - ((ThreadPoolExecutor)timeoutExecutor).setKeepAliveTime(60, TimeUnit.SECONDS); - ((ThreadPoolExecutor)timeoutExecutor).allowCoreThreadTimeOut(true); - } + static { + ((ThreadPoolExecutor)callExecutor).setKeepAliveTime(60, TimeUnit.SECONDS); + ((ThreadPoolExecutor)callExecutor).allowCoreThreadTimeOut(true); + ((ThreadPoolExecutor)gameExecutor).setKeepAliveTime(60, TimeUnit.SECONDS); + ((ThreadPoolExecutor)gameExecutor).allowCoreThreadTimeOut(true); + ((ThreadPoolExecutor)timeoutExecutor).setKeepAliveTime(60, TimeUnit.SECONDS); + ((ThreadPoolExecutor)timeoutExecutor).allowCoreThreadTimeOut(true); + } - private final static ThreadExecutor INSTANCE = new ThreadExecutor(); + private final static ThreadExecutor INSTANCE = new ThreadExecutor(); - public static ThreadExecutor getInstance() { - return INSTANCE; - } + public static ThreadExecutor getInstance() { + return INSTANCE; + } - private ThreadExecutor() {} + private ThreadExecutor() {} - public ExecutorService getCallExecutor() { - return callExecutor; - } + public ExecutorService getCallExecutor() { + return callExecutor; + } - public ExecutorService getGameExecutor() { - return gameExecutor; - } + public ExecutorService getGameExecutor() { + return gameExecutor; + } - public ScheduledExecutorService getTimeoutExecutor() { - return timeoutExecutor; - } + public ScheduledExecutorService getTimeoutExecutor() { + return timeoutExecutor; + } } diff --git a/Mage.Server/src/main/java/mage/server/util/resources/config.xml b/Mage.Server/src/main/java/mage/server/util/resources/config.xml index dcd99a6d22..f4e9ca7c47 100644 --- a/Mage.Server/src/main/java/mage/server/util/resources/config.xml +++ b/Mage.Server/src/main/java/mage/server/util/resources/config.xml @@ -1,15 +1,15 @@ - - - - - - - - - - - + + + + + + + + + + + diff --git a/Mage.Sets/pom.xml b/Mage.Sets/pom.xml index 559272c974..21b9940e0e 100644 --- a/Mage.Sets/pom.xml +++ b/Mage.Sets/pom.xml @@ -1,21 +1,21 @@ - + 4.0.0 - + org.mage mage-root 0.8.6 - + org.mage mage-sets jar Mage Sets http://maven.apache.org - + ${project.groupId} @@ -29,7 +29,7 @@ jar - + src @@ -50,10 +50,10 @@
- + mage-sets - + - + diff --git a/Mage.Sets/src/mage/cards/decks/importer/DecDeckImporter.java b/Mage.Sets/src/mage/cards/decks/importer/DecDeckImporter.java index 5f25624e79..8c3a34359a 100644 --- a/Mage.Sets/src/mage/cards/decks/importer/DecDeckImporter.java +++ b/Mage.Sets/src/mage/cards/decks/importer/DecDeckImporter.java @@ -38,35 +38,35 @@ import mage.sets.Sets; */ public class DecDeckImporter extends DeckImporterImpl { - @Override - protected void readLine(String line, DeckCardLists deckList) { - if (line.length() == 0 || line.startsWith("//")) return; - boolean sideboard = false; - if (line.startsWith("SB:")) { - line = line.substring(3).trim(); - sideboard = true; - } - int delim = line.indexOf(' '); - String lineNum = line.substring(0, delim).trim(); - String lineName = line.substring(delim).trim(); - try { - int num = Integer.parseInt(lineNum); - Card card = Sets.findCard(lineName); - if (card == null) - sbMessage.append("Could not find card: '").append(lineName).append("' at line ").append(lineCount).append("\n"); - else { - String cardName = card.getClass().getCanonicalName(); - for (int i = 0; i < num; i++) { - if (!sideboard) - deckList.getCards().add(cardName); - else - deckList.getSideboard().add(cardName); - } - } - } - catch (NumberFormatException nfe) { - sbMessage.append("Invalid number: ").append(lineNum).append(" at line ").append(lineCount).append("\n"); - } - } + @Override + protected void readLine(String line, DeckCardLists deckList) { + if (line.length() == 0 || line.startsWith("//")) return; + boolean sideboard = false; + if (line.startsWith("SB:")) { + line = line.substring(3).trim(); + sideboard = true; + } + int delim = line.indexOf(' '); + String lineNum = line.substring(0, delim).trim(); + String lineName = line.substring(delim).trim(); + try { + int num = Integer.parseInt(lineNum); + Card card = Sets.findCard(lineName); + if (card == null) + sbMessage.append("Could not find card: '").append(lineName).append("' at line ").append(lineCount).append("\n"); + else { + String cardName = card.getClass().getCanonicalName(); + for (int i = 0; i < num; i++) { + if (!sideboard) + deckList.getCards().add(cardName); + else + deckList.getSideboard().add(cardName); + } + } + } + catch (NumberFormatException nfe) { + sbMessage.append("Invalid number: ").append(lineNum).append(" at line ").append(lineCount).append("\n"); + } + } } diff --git a/Mage.Sets/src/mage/cards/decks/importer/DeckImporter.java b/Mage.Sets/src/mage/cards/decks/importer/DeckImporter.java index 121b98c856..bd68a2771b 100644 --- a/Mage.Sets/src/mage/cards/decks/importer/DeckImporter.java +++ b/Mage.Sets/src/mage/cards/decks/importer/DeckImporter.java @@ -36,7 +36,7 @@ import mage.cards.decks.DeckCardLists; */ public interface DeckImporter { - public DeckCardLists importDeck(String file); - public String getErrors(); + public DeckCardLists importDeck(String file); + public String getErrors(); } diff --git a/Mage.Sets/src/mage/cards/decks/importer/DeckImporterImpl.java b/Mage.Sets/src/mage/cards/decks/importer/DeckImporterImpl.java index 463b763cda..0cc0926cfd 100644 --- a/Mage.Sets/src/mage/cards/decks/importer/DeckImporterImpl.java +++ b/Mage.Sets/src/mage/cards/decks/importer/DeckImporterImpl.java @@ -39,44 +39,44 @@ import org.apache.log4j.Logger; */ public abstract class DeckImporterImpl implements DeckImporter { - private final static Logger logger = Logger.getLogger(DeckImporterImpl.class); - protected StringBuilder sbMessage = new StringBuilder(); - protected int lineCount; + private final static Logger logger = Logger.getLogger(DeckImporterImpl.class); + protected StringBuilder sbMessage = new StringBuilder(); + protected int lineCount; - @Override - public DeckCardLists importDeck(String file) { - File f = new File(file); - DeckCardLists deckList = new DeckCardLists(); - lineCount = 0; - sbMessage.setLength(0); - try { - Scanner scanner = new Scanner(f); - try { - while (scanner.hasNextLine()) { - String line = scanner.nextLine().trim(); - lineCount++; - readLine(line, deckList); - } - if (sbMessage.length() > 0) { + @Override + public DeckCardLists importDeck(String file) { + File f = new File(file); + DeckCardLists deckList = new DeckCardLists(); + lineCount = 0; + sbMessage.setLength(0); + try { + Scanner scanner = new Scanner(f); + try { + while (scanner.hasNextLine()) { + String line = scanner.nextLine().trim(); + lineCount++; + readLine(line, deckList); + } + if (sbMessage.length() > 0) { logger.fatal(sbMessage); - } - } - catch (Exception ex) { - logger.fatal(null, ex); - } - finally { - scanner.close(); - } - } catch (Exception ex) { - logger.fatal(null, ex); - } - return deckList; - } + } + } + catch (Exception ex) { + logger.fatal(null, ex); + } + finally { + scanner.close(); + } + } catch (Exception ex) { + logger.fatal(null, ex); + } + return deckList; + } @Override public String getErrors(){ return sbMessage.toString(); } - protected abstract void readLine(String line, DeckCardLists deckList); + protected abstract void readLine(String line, DeckCardLists deckList); } diff --git a/Mage.Sets/src/mage/cards/decks/importer/MWSDeckImporter.java b/Mage.Sets/src/mage/cards/decks/importer/MWSDeckImporter.java index 1ca9eb99b9..fd8f368612 100644 --- a/Mage.Sets/src/mage/cards/decks/importer/MWSDeckImporter.java +++ b/Mage.Sets/src/mage/cards/decks/importer/MWSDeckImporter.java @@ -39,51 +39,51 @@ import mage.sets.Sets; */ public class MWSDeckImporter extends DeckImporterImpl { - @Override - protected void readLine(String line, DeckCardLists deckList) { - if (line.length() == 0 || line.startsWith("//")) return; - boolean sideboard = false; - if (line.startsWith("SB:")) { - line = line.substring(3).trim(); - sideboard = true; - } - int delim = line.indexOf(' '); - String lineNum = line.substring(0, delim).trim(); - String setCode = ""; - if (line.indexOf('[') != -1 ) { - int setStart = line.indexOf('[') + 1; - int setEnd = line.indexOf(']'); - setCode = line.substring(setStart, setEnd).trim(); - delim = setEnd; - } - String lineName = line.substring(delim + 1).trim(); - try { - int num = Integer.parseInt(lineNum); - ExpansionSet set = null; - if (setCode.length() > 0) - set = Sets.findSet(setCode); - Card card; - if (set != null) { - card = set.findCard(lineName); - } - else { - card = Sets.findCard(lineName); - } - if (card == null) - sbMessage.append("Could not find card: '").append(lineName).append("' at line ").append(lineCount).append("\n"); - else { - String cardName = card.getClass().getCanonicalName(); - for (int i = 0; i < num; i++) { - if (!sideboard) - deckList.getCards().add(cardName); - else - deckList.getSideboard().add(cardName); - } - } - } - catch (NumberFormatException nfe) { - sbMessage.append("Invalid number: ").append(lineNum).append(" at line ").append(lineCount).append("\n"); - } - } + @Override + protected void readLine(String line, DeckCardLists deckList) { + if (line.length() == 0 || line.startsWith("//")) return; + boolean sideboard = false; + if (line.startsWith("SB:")) { + line = line.substring(3).trim(); + sideboard = true; + } + int delim = line.indexOf(' '); + String lineNum = line.substring(0, delim).trim(); + String setCode = ""; + if (line.indexOf('[') != -1 ) { + int setStart = line.indexOf('[') + 1; + int setEnd = line.indexOf(']'); + setCode = line.substring(setStart, setEnd).trim(); + delim = setEnd; + } + String lineName = line.substring(delim + 1).trim(); + try { + int num = Integer.parseInt(lineNum); + ExpansionSet set = null; + if (setCode.length() > 0) + set = Sets.findSet(setCode); + Card card; + if (set != null) { + card = set.findCard(lineName); + } + else { + card = Sets.findCard(lineName); + } + if (card == null) + sbMessage.append("Could not find card: '").append(lineName).append("' at line ").append(lineCount).append("\n"); + else { + String cardName = card.getClass().getCanonicalName(); + for (int i = 0; i < num; i++) { + if (!sideboard) + deckList.getCards().add(cardName); + else + deckList.getSideboard().add(cardName); + } + } + } + catch (NumberFormatException nfe) { + sbMessage.append("Invalid number: ").append(lineNum).append(" at line ").append(lineCount).append("\n"); + } + } } diff --git a/Mage.Sets/src/mage/cards/decks/importer/TxtDeckImporter.java b/Mage.Sets/src/mage/cards/decks/importer/TxtDeckImporter.java index 7076d5b940..2ee8999262 100644 --- a/Mage.Sets/src/mage/cards/decks/importer/TxtDeckImporter.java +++ b/Mage.Sets/src/mage/cards/decks/importer/TxtDeckImporter.java @@ -38,36 +38,36 @@ import mage.sets.Sets; */ public class TxtDeckImporter extends DeckImporterImpl { - private boolean sideboard = false; + private boolean sideboard = false; - @Override - protected void readLine(String line, DeckCardLists deckList) { - if (line.length() == 0 || line.startsWith("//")) return; - if (line.startsWith("Sideboard")) { - sideboard = true; - return; - } - int delim = line.indexOf(' '); - String lineNum = line.substring(0, delim).trim(); - String lineName = line.substring(delim).trim(); - try { - int num = Integer.parseInt(lineNum); - Card card = Sets.findCard(lineName); - if (card == null) - sbMessage.append("Could not find card: '").append(lineName).append("' at line ").append(lineCount).append("\n"); - else { - String cardName = card.getClass().getCanonicalName(); - for (int i = 0; i < num; i++) { - if (!sideboard) - deckList.getCards().add(cardName); - else - deckList.getSideboard().add(cardName); - } - } - } - catch (NumberFormatException nfe) { - sbMessage.append("Invalid number: ").append(lineNum).append(" at line ").append(lineCount).append("\n"); - } - } + @Override + protected void readLine(String line, DeckCardLists deckList) { + if (line.length() == 0 || line.startsWith("//")) return; + if (line.startsWith("Sideboard")) { + sideboard = true; + return; + } + int delim = line.indexOf(' '); + String lineNum = line.substring(0, delim).trim(); + String lineName = line.substring(delim).trim(); + try { + int num = Integer.parseInt(lineNum); + Card card = Sets.findCard(lineName); + if (card == null) + sbMessage.append("Could not find card: '").append(lineName).append("' at line ").append(lineCount).append("\n"); + else { + String cardName = card.getClass().getCanonicalName(); + for (int i = 0; i < num; i++) { + if (!sideboard) + deckList.getCards().add(cardName); + else + deckList.getSideboard().add(cardName); + } + } + } + catch (NumberFormatException nfe) { + sbMessage.append("Invalid number: ").append(lineNum).append(" at line ").append(lineCount).append("\n"); + } + } } diff --git a/Mage.Sets/src/mage/sets/AlaraReborn.java b/Mage.Sets/src/mage/sets/AlaraReborn.java index 89333b26a0..44feccaa97 100644 --- a/Mage.Sets/src/mage/sets/AlaraReborn.java +++ b/Mage.Sets/src/mage/sets/AlaraReborn.java @@ -38,22 +38,22 @@ import mage.cards.ExpansionSet; */ public class AlaraReborn extends ExpansionSet { - private static final AlaraReborn fINSTANCE = new AlaraReborn(); + private static final AlaraReborn fINSTANCE = new AlaraReborn(); - public static AlaraReborn getInstance() { - return fINSTANCE; - } + public static AlaraReborn getInstance() { + return fINSTANCE; + } - private AlaraReborn() { - super("Alara Reborn", "ARB", "seticon_mtgarb", "mage.sets.alarareborn", new GregorianCalendar(2009, 3, 25).getTime(), SetType.EXPANSION); - this.blockName = "Shards of Alara"; - this.parentSet = ShardsOfAlara.getInstance(); - this.hasBoosters = true; - this.numBoosterLands = 0; - this.numBoosterCommon = 11; - this.numBoosterUncommon = 3; - this.numBoosterRare = 1; - this.ratioBoosterMythic = 8; - } + private AlaraReborn() { + super("Alara Reborn", "ARB", "seticon_mtgarb", "mage.sets.alarareborn", new GregorianCalendar(2009, 3, 25).getTime(), SetType.EXPANSION); + this.blockName = "Shards of Alara"; + this.parentSet = ShardsOfAlara.getInstance(); + this.hasBoosters = true; + this.numBoosterLands = 0; + this.numBoosterCommon = 11; + this.numBoosterUncommon = 3; + this.numBoosterRare = 1; + this.ratioBoosterMythic = 8; + } } diff --git a/Mage.Sets/src/mage/sets/Apocalypse.java b/Mage.Sets/src/mage/sets/Apocalypse.java index 688ab801d5..2049d8720b 100644 --- a/Mage.Sets/src/mage/sets/Apocalypse.java +++ b/Mage.Sets/src/mage/sets/Apocalypse.java @@ -8,9 +8,9 @@ import java.util.GregorianCalendar; public class Apocalypse extends ExpansionSet { private static final Apocalypse fINSTANCE = new Apocalypse(); - public static Apocalypse getInstance() { - return fINSTANCE; - } + public static Apocalypse getInstance() { + return fINSTANCE; + } private Apocalypse() { super("Apocalypse", "APC", "", "mage.sets.apocalypse", new GregorianCalendar(2001, 5, 1).getTime(), Constants.SetType.EXPANSION); diff --git a/Mage.Sets/src/mage/sets/ChampionsOfKamigawa.java b/Mage.Sets/src/mage/sets/ChampionsOfKamigawa.java index e30d503b38..e049b5be44 100644 --- a/Mage.Sets/src/mage/sets/ChampionsOfKamigawa.java +++ b/Mage.Sets/src/mage/sets/ChampionsOfKamigawa.java @@ -8,19 +8,19 @@ import java.util.GregorianCalendar; public class ChampionsOfKamigawa extends ExpansionSet { private static final ChampionsOfKamigawa fINSTANCE = new ChampionsOfKamigawa(); - public static ChampionsOfKamigawa getInstance() { - return fINSTANCE; - } + public static ChampionsOfKamigawa getInstance() { + return fINSTANCE; + } private ChampionsOfKamigawa() { super("Champions of Kamigawa", "CHK", "", "mage.sets.championsofkamigawa", new GregorianCalendar(2004, 9, 1).getTime(), Constants.SetType.EXPANSION); this.blockName = "Kamigawa"; - this.hasBoosters = true; - this.numBoosterLands = 1; - this.numBoosterCommon = 10; - this.numBoosterUncommon = 3; - this.numBoosterRare = 1; - this.ratioBoosterMythic = 8; + this.hasBoosters = true; + this.numBoosterLands = 1; + this.numBoosterCommon = 10; + this.numBoosterUncommon = 3; + this.numBoosterRare = 1; + this.ratioBoosterMythic = 8; } } diff --git a/Mage.Sets/src/mage/sets/Conflux.java b/Mage.Sets/src/mage/sets/Conflux.java index ad877daf97..8ccbacdafc 100644 --- a/Mage.Sets/src/mage/sets/Conflux.java +++ b/Mage.Sets/src/mage/sets/Conflux.java @@ -38,22 +38,22 @@ import mage.cards.ExpansionSet; */ public class Conflux extends ExpansionSet { - private static final Conflux fINSTANCE = new Conflux(); + private static final Conflux fINSTANCE = new Conflux(); - public static Conflux getInstance() { - return fINSTANCE; - } + public static Conflux getInstance() { + return fINSTANCE; + } - private Conflux() { - super("Conflux", "CON", "seticon_conflux", "mage.sets.conflux", new GregorianCalendar(2009, 0, 31).getTime(), SetType.EXPANSION); - this.blockName = "Shards of Alara"; - this.parentSet = ShardsOfAlara.getInstance(); - this.hasBoosters = true; - this.numBoosterLands = 0; - this.numBoosterCommon = 11; - this.numBoosterUncommon = 3; - this.numBoosterRare = 1; - this.ratioBoosterMythic = 8; - } + private Conflux() { + super("Conflux", "CON", "seticon_conflux", "mage.sets.conflux", new GregorianCalendar(2009, 0, 31).getTime(), SetType.EXPANSION); + this.blockName = "Shards of Alara"; + this.parentSet = ShardsOfAlara.getInstance(); + this.hasBoosters = true; + this.numBoosterLands = 0; + this.numBoosterCommon = 11; + this.numBoosterUncommon = 3; + this.numBoosterRare = 1; + this.ratioBoosterMythic = 8; + } } diff --git a/Mage.Sets/src/mage/sets/DarkAscension.java b/Mage.Sets/src/mage/sets/DarkAscension.java index ca735d8d33..384bc80f12 100644 --- a/Mage.Sets/src/mage/sets/DarkAscension.java +++ b/Mage.Sets/src/mage/sets/DarkAscension.java @@ -47,10 +47,10 @@ public class DarkAscension extends ExpansionSet { super("Dark Ascension", "DKA", "seticon_mtgdka", "mage.sets.darkascension", new GregorianCalendar(2012, 1, 3).getTime(), SetType.EXPANSION); this.blockName = "Innistrad"; this.hasBoosters = true; - this.numBoosterLands = 1; - this.numBoosterCommon = 10; - this.numBoosterUncommon = 3; - this.numBoosterRare = 1; - this.ratioBoosterMythic = 8; + this.numBoosterLands = 1; + this.numBoosterCommon = 10; + this.numBoosterUncommon = 3; + this.numBoosterRare = 1; + this.ratioBoosterMythic = 8; } } \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/Darksteel.java b/Mage.Sets/src/mage/sets/Darksteel.java index 66a3fb9f9a..b0a9f6765a 100644 --- a/Mage.Sets/src/mage/sets/Darksteel.java +++ b/Mage.Sets/src/mage/sets/Darksteel.java @@ -9,9 +9,9 @@ public class Darksteel extends ExpansionSet { private static final Darksteel fINSTANCE = new Darksteel(); - public static Darksteel getInstance() { - return fINSTANCE; - } + public static Darksteel getInstance() { + return fINSTANCE; + } public Darksteel() { super("Darksteel", "DST", "", "mage.sets.darksteel", new GregorianCalendar(2004, 1, 6).getTime(), Constants.SetType.EXPANSION); diff --git a/Mage.Sets/src/mage/sets/Dissension.java b/Mage.Sets/src/mage/sets/Dissension.java index d5f27baf49..e7e080fc03 100644 --- a/Mage.Sets/src/mage/sets/Dissension.java +++ b/Mage.Sets/src/mage/sets/Dissension.java @@ -42,9 +42,9 @@ public class Dissension extends ExpansionSet { private static final Dissension fINSTANCE = new Dissension(); - public static Dissension getInstance() { - return fINSTANCE; - } + public static Dissension getInstance() { + return fINSTANCE; + } private Dissension() { super("Dissension", "DIS", "", "mage.sets.dissension", new GregorianCalendar(2006, 4, 5).getTime(), Constants.SetType.EXPANSION); diff --git a/Mage.Sets/src/mage/sets/EighthEdition.java b/Mage.Sets/src/mage/sets/EighthEdition.java index 823fe5c99b..df2c53e69d 100644 --- a/Mage.Sets/src/mage/sets/EighthEdition.java +++ b/Mage.Sets/src/mage/sets/EighthEdition.java @@ -6,20 +6,20 @@ import mage.cards.ExpansionSet; public class EighthEdition extends ExpansionSet { - private static final EighthEdition fINSTANCE = new EighthEdition(); + private static final EighthEdition fINSTANCE = new EighthEdition(); - public static EighthEdition getInstance() { - return fINSTANCE; - } + public static EighthEdition getInstance() { + return fINSTANCE; + } - private EighthEdition() { - super("Eighth Edition", "8ED", "", "mage.sets.eighthedition", new GregorianCalendar(2003, 7, 28).getTime(), SetType.CORE); - this.hasBoosters = true; - this.numBoosterLands = 1; - this.numBoosterCommon = 10; - this.numBoosterUncommon = 3; - this.numBoosterRare = 1; - this.ratioBoosterMythic = 0; - } + private EighthEdition() { + super("Eighth Edition", "8ED", "", "mage.sets.eighthedition", new GregorianCalendar(2003, 7, 28).getTime(), SetType.CORE); + this.hasBoosters = true; + this.numBoosterLands = 1; + this.numBoosterCommon = 10; + this.numBoosterUncommon = 3; + this.numBoosterRare = 1; + this.ratioBoosterMythic = 0; + } } diff --git a/Mage.Sets/src/mage/sets/ElspethvsTezzeret.java b/Mage.Sets/src/mage/sets/ElspethvsTezzeret.java index 7789c588b7..c246cf1bc6 100644 --- a/Mage.Sets/src/mage/sets/ElspethvsTezzeret.java +++ b/Mage.Sets/src/mage/sets/ElspethvsTezzeret.java @@ -8,9 +8,9 @@ import java.util.GregorianCalendar; public class ElspethvsTezzeret extends ExpansionSet { private static final ElspethvsTezzeret fINSTANCE = new ElspethvsTezzeret(); - public static ElspethvsTezzeret getInstance() { - return fINSTANCE; - } + public static ElspethvsTezzeret getInstance() { + return fINSTANCE; + } private ElspethvsTezzeret() { super("Duel Decks: Elspeth vs. Tezzeret", "DDF", "", "mage.sets.elspethvstezzeret", new GregorianCalendar(2010, 8, 3).getTime(), Constants.SetType.REPRINT); diff --git a/Mage.Sets/src/mage/sets/Eventide.java b/Mage.Sets/src/mage/sets/Eventide.java index 3341497fa1..643c3c1445 100644 --- a/Mage.Sets/src/mage/sets/Eventide.java +++ b/Mage.Sets/src/mage/sets/Eventide.java @@ -8,9 +8,9 @@ import java.util.GregorianCalendar; public class Eventide extends ExpansionSet { private static final Eventide fINSTANCE = new Eventide(); - public static Eventide getInstance() { - return fINSTANCE; - } + public static Eventide getInstance() { + return fINSTANCE; + } private Eventide() { super("Eventide", "EVE", "", "mage.sets.eventide", new GregorianCalendar(2008, 6, 25).getTime(), Constants.SetType.EXPANSION); diff --git a/Mage.Sets/src/mage/sets/FifthEdition.java b/Mage.Sets/src/mage/sets/FifthEdition.java index 79efc4982c..3a1a801dc0 100644 --- a/Mage.Sets/src/mage/sets/FifthEdition.java +++ b/Mage.Sets/src/mage/sets/FifthEdition.java @@ -6,20 +6,20 @@ import mage.cards.ExpansionSet; public class FifthEdition extends ExpansionSet { - private static final FifthEdition fINSTANCE = new FifthEdition(); + private static final FifthEdition fINSTANCE = new FifthEdition(); - public static FifthEdition getInstance() { - return fINSTANCE; - } + public static FifthEdition getInstance() { + return fINSTANCE; + } - private FifthEdition() { - super("Fifth Edition", "5ED", "", "mage.sets.fifthedition", new GregorianCalendar(1997, 3, 1).getTime(), SetType.CORE); - this.hasBoosters = true; - this.numBoosterLands = 1; - this.numBoosterCommon = 10; - this.numBoosterUncommon = 3; - this.numBoosterRare = 1; - this.ratioBoosterMythic = 0; - } + private FifthEdition() { + super("Fifth Edition", "5ED", "", "mage.sets.fifthedition", new GregorianCalendar(1997, 3, 1).getTime(), SetType.CORE); + this.hasBoosters = true; + this.numBoosterLands = 1; + this.numBoosterCommon = 10; + this.numBoosterUncommon = 3; + this.numBoosterRare = 1; + this.ratioBoosterMythic = 0; + } } \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/Guildpact.java b/Mage.Sets/src/mage/sets/Guildpact.java index 653c4d3dc9..d414c324ac 100644 --- a/Mage.Sets/src/mage/sets/Guildpact.java +++ b/Mage.Sets/src/mage/sets/Guildpact.java @@ -42,9 +42,9 @@ import java.util.GregorianCalendar; public class Guildpact extends ExpansionSet { private static final Guildpact fINSTANCE = new Guildpact(); - public static Guildpact getInstance() { - return fINSTANCE; - } + public static Guildpact getInstance() { + return fINSTANCE; + } private Guildpact() { super("Guildpact", "GPT", "", "mage.sets.guildpact", new GregorianCalendar(2006, 1, 3).getTime(), Constants.SetType.EXPANSION); diff --git a/Mage.Sets/src/mage/sets/Guru.java b/Mage.Sets/src/mage/sets/Guru.java index 43fb8a1532..16e3a000bb 100644 --- a/Mage.Sets/src/mage/sets/Guru.java +++ b/Mage.Sets/src/mage/sets/Guru.java @@ -8,9 +8,9 @@ import java.util.GregorianCalendar; public class Guru extends ExpansionSet { private static final Guru fINSTANCE = new Guru(); - public static Guru getInstance() { - return fINSTANCE; - } + public static Guru getInstance() { + return fINSTANCE; + } private Guru() { //TODO find correct release date, wiki don't known anything about this expansion diff --git a/Mage.Sets/src/mage/sets/Invasion.java b/Mage.Sets/src/mage/sets/Invasion.java index 6dca1bbfd6..58e82db6cb 100644 --- a/Mage.Sets/src/mage/sets/Invasion.java +++ b/Mage.Sets/src/mage/sets/Invasion.java @@ -38,18 +38,18 @@ import mage.cards.ExpansionSet; public class Invasion extends ExpansionSet { private static final Invasion fINSTANCE = new Invasion(); - public static Invasion getInstance() { - return fINSTANCE; - } + public static Invasion getInstance() { + return fINSTANCE; + } private Invasion() { super("Invasion", "INV", "", "mage.sets.invasion", new GregorianCalendar(2000, 9, 2).getTime(), SetType.EXPANSION); this.blockName = "Invasion"; - this.hasBoosters = true; - this.numBoosterLands = 1; - this.numBoosterCommon = 10; - this.numBoosterUncommon = 3; - this.numBoosterRare = 1; - this.ratioBoosterMythic = 8; + this.hasBoosters = true; + this.numBoosterLands = 1; + this.numBoosterCommon = 10; + this.numBoosterUncommon = 3; + this.numBoosterRare = 1; + this.ratioBoosterMythic = 8; } } \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/Magic2010.java b/Mage.Sets/src/mage/sets/Magic2010.java index e0190e9a0e..26c9de26d1 100644 --- a/Mage.Sets/src/mage/sets/Magic2010.java +++ b/Mage.Sets/src/mage/sets/Magic2010.java @@ -38,20 +38,20 @@ import mage.cards.ExpansionSet; */ public class Magic2010 extends ExpansionSet { - private static final Magic2010 fINSTANCE = new Magic2010(); + private static final Magic2010 fINSTANCE = new Magic2010(); - public static Magic2010 getInstance() { - return fINSTANCE; - } + public static Magic2010 getInstance() { + return fINSTANCE; + } - private Magic2010() { - super("Magic 2010", "M10", "seticon_M10", "mage.sets.magic2010", new GregorianCalendar(2009, 6, 17).getTime(), SetType.CORE); - this.hasBoosters = true; - this.numBoosterLands = 1; - this.numBoosterCommon = 10; - this.numBoosterUncommon = 3; - this.numBoosterRare = 1; - this.ratioBoosterMythic = 8; - } + private Magic2010() { + super("Magic 2010", "M10", "seticon_M10", "mage.sets.magic2010", new GregorianCalendar(2009, 6, 17).getTime(), SetType.CORE); + this.hasBoosters = true; + this.numBoosterLands = 1; + this.numBoosterCommon = 10; + this.numBoosterUncommon = 3; + this.numBoosterRare = 1; + this.ratioBoosterMythic = 8; + } } diff --git a/Mage.Sets/src/mage/sets/Magic2011.java b/Mage.Sets/src/mage/sets/Magic2011.java index 2968b1cad4..4379b9bb86 100644 --- a/Mage.Sets/src/mage/sets/Magic2011.java +++ b/Mage.Sets/src/mage/sets/Magic2011.java @@ -38,20 +38,20 @@ import mage.cards.ExpansionSet; */ public class Magic2011 extends ExpansionSet { - private static final Magic2011 fINSTANCE = new Magic2011(); + private static final Magic2011 fINSTANCE = new Magic2011(); - public static Magic2011 getInstance() { - return fINSTANCE; - } + public static Magic2011 getInstance() { + return fINSTANCE; + } - private Magic2011() { - super("Magic 2011", "M11", "seticon_M11", "mage.sets.magic2011", new GregorianCalendar(2010, 6, 16).getTime(), SetType.CORE); - this.hasBoosters = true; - this.numBoosterLands = 1; - this.numBoosterCommon = 10; - this.numBoosterUncommon = 3; - this.numBoosterRare = 1; - this.ratioBoosterMythic = 8; - } + private Magic2011() { + super("Magic 2011", "M11", "seticon_M11", "mage.sets.magic2011", new GregorianCalendar(2010, 6, 16).getTime(), SetType.CORE); + this.hasBoosters = true; + this.numBoosterLands = 1; + this.numBoosterCommon = 10; + this.numBoosterUncommon = 3; + this.numBoosterRare = 1; + this.ratioBoosterMythic = 8; + } } diff --git a/Mage.Sets/src/mage/sets/Mirrodin.java b/Mage.Sets/src/mage/sets/Mirrodin.java index d7f9a8c4da..2bca8c6228 100644 --- a/Mage.Sets/src/mage/sets/Mirrodin.java +++ b/Mage.Sets/src/mage/sets/Mirrodin.java @@ -8,18 +8,18 @@ import java.util.GregorianCalendar; public class Mirrodin extends ExpansionSet { private static final Mirrodin fINSTANCE = new Mirrodin(); - public static Mirrodin getInstance() { - return fINSTANCE; - } + public static Mirrodin getInstance() { + return fINSTANCE; + } private Mirrodin() { super("Mirrodin", "MRD", "", "mage.sets.mirrodin", new GregorianCalendar(2003, 9, 2).getTime(), Constants.SetType.EXPANSION); this.blockName = "Mirrodin"; - this.hasBoosters = true; - this.numBoosterLands = 1; - this.numBoosterCommon = 10; - this.numBoosterUncommon = 3; - this.numBoosterRare = 1; - this.ratioBoosterMythic = 0; + this.hasBoosters = true; + this.numBoosterLands = 1; + this.numBoosterCommon = 10; + this.numBoosterUncommon = 3; + this.numBoosterRare = 1; + this.ratioBoosterMythic = 0; } } diff --git a/Mage.Sets/src/mage/sets/MirrodinBesieged.java b/Mage.Sets/src/mage/sets/MirrodinBesieged.java index 51cfe558a6..26eeff4087 100644 --- a/Mage.Sets/src/mage/sets/MirrodinBesieged.java +++ b/Mage.Sets/src/mage/sets/MirrodinBesieged.java @@ -39,21 +39,21 @@ import java.util.GregorianCalendar; */ public class MirrodinBesieged extends ExpansionSet { - private static final MirrodinBesieged fINSTANCE = new MirrodinBesieged(); + private static final MirrodinBesieged fINSTANCE = new MirrodinBesieged(); - public static MirrodinBesieged getInstance() { - return fINSTANCE; - } + public static MirrodinBesieged getInstance() { + return fINSTANCE; + } - private MirrodinBesieged() { - super("Mirrodin Besieged", "MBS", "seticon_mtgmbs", "mage.sets.mirrodinbesieged", new GregorianCalendar(2011, 1, 4).getTime(), SetType.EXPANSION); - this.blockName = "Mirrodin Besieged"; - this.hasBoosters = true; - this.numBoosterLands = 1; - this.numBoosterCommon = 10; - this.numBoosterUncommon = 3; - this.numBoosterRare = 1; - this.ratioBoosterMythic = 8; - } + private MirrodinBesieged() { + super("Mirrodin Besieged", "MBS", "seticon_mtgmbs", "mage.sets.mirrodinbesieged", new GregorianCalendar(2011, 1, 4).getTime(), SetType.EXPANSION); + this.blockName = "Mirrodin Besieged"; + this.hasBoosters = true; + this.numBoosterLands = 1; + this.numBoosterCommon = 10; + this.numBoosterUncommon = 3; + this.numBoosterRare = 1; + this.ratioBoosterMythic = 8; + } } diff --git a/Mage.Sets/src/mage/sets/NewPhyrexia.java b/Mage.Sets/src/mage/sets/NewPhyrexia.java index 252b6a63c4..7d5311c014 100644 --- a/Mage.Sets/src/mage/sets/NewPhyrexia.java +++ b/Mage.Sets/src/mage/sets/NewPhyrexia.java @@ -8,18 +8,18 @@ import java.util.GregorianCalendar; public class NewPhyrexia extends ExpansionSet { private static final NewPhyrexia fINSTANCE = new NewPhyrexia(); - public static NewPhyrexia getInstance() { - return fINSTANCE; - } + public static NewPhyrexia getInstance() { + return fINSTANCE; + } - private NewPhyrexia() { + private NewPhyrexia() { super("New Phyrexia", "NPH", "", "mage.sets.newphyrexia", new GregorianCalendar(2011, 4, 4).getTime(), Constants.SetType.EXPANSION); this.blockName = "Mirrodin Besieged"; - this.hasBoosters = true; - this.numBoosterLands = 1; - this.numBoosterCommon = 10; - this.numBoosterUncommon = 3; - this.numBoosterRare = 1; - this.ratioBoosterMythic = 8; + this.hasBoosters = true; + this.numBoosterLands = 1; + this.numBoosterCommon = 10; + this.numBoosterUncommon = 3; + this.numBoosterRare = 1; + this.ratioBoosterMythic = 8; } } diff --git a/Mage.Sets/src/mage/sets/NinthEdition.java b/Mage.Sets/src/mage/sets/NinthEdition.java index 51b3ca2d2b..a4726314e6 100644 --- a/Mage.Sets/src/mage/sets/NinthEdition.java +++ b/Mage.Sets/src/mage/sets/NinthEdition.java @@ -6,20 +6,20 @@ import mage.cards.ExpansionSet; public class NinthEdition extends ExpansionSet { - private static final NinthEdition fINSTANCE = new NinthEdition(); + private static final NinthEdition fINSTANCE = new NinthEdition(); - public static NinthEdition getInstance() { - return fINSTANCE; - } + public static NinthEdition getInstance() { + return fINSTANCE; + } - private NinthEdition() { - super("Ninth Edition", "9ED", "", "mage.sets.ninthedition", new GregorianCalendar(2005, 7, 29).getTime(), SetType.CORE); - this.hasBoosters = true; - this.numBoosterLands = 1; - this.numBoosterCommon = 10; - this.numBoosterUncommon = 3; - this.numBoosterRare = 1; - this.ratioBoosterMythic = 0; - } + private NinthEdition() { + super("Ninth Edition", "9ED", "", "mage.sets.ninthedition", new GregorianCalendar(2005, 7, 29).getTime(), SetType.CORE); + this.hasBoosters = true; + this.numBoosterLands = 1; + this.numBoosterCommon = 10; + this.numBoosterUncommon = 3; + this.numBoosterRare = 1; + this.ratioBoosterMythic = 0; + } } \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/Onslaught.java b/Mage.Sets/src/mage/sets/Onslaught.java index 6426a65eaa..3cff944bfc 100644 --- a/Mage.Sets/src/mage/sets/Onslaught.java +++ b/Mage.Sets/src/mage/sets/Onslaught.java @@ -8,18 +8,18 @@ import java.util.GregorianCalendar; public class Onslaught extends ExpansionSet { private static final Onslaught fINSTANCE = new Onslaught(); - public static Onslaught getInstance() { - return fINSTANCE; - } + public static Onslaught getInstance() { + return fINSTANCE; + } private Onslaught() { super("Onslaught", "ONS", "", "mage.sets.onslaught", new GregorianCalendar(2002, 10, 7).getTime(), Constants.SetType.EXPANSION); this.blockName = "Onslaught"; - this.hasBoosters = true; - this.numBoosterLands = 1; - this.numBoosterCommon = 10; - this.numBoosterUncommon = 3; - this.numBoosterRare = 1; - this.ratioBoosterMythic = 0; + this.hasBoosters = true; + this.numBoosterLands = 1; + this.numBoosterCommon = 10; + this.numBoosterUncommon = 3; + this.numBoosterRare = 1; + this.ratioBoosterMythic = 0; } } \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/Planechase.java b/Mage.Sets/src/mage/sets/Planechase.java index 26e4386c85..0330e7bacc 100644 --- a/Mage.Sets/src/mage/sets/Planechase.java +++ b/Mage.Sets/src/mage/sets/Planechase.java @@ -38,14 +38,14 @@ import mage.cards.ExpansionSet; */ public class Planechase extends ExpansionSet { - private static final Planechase fINSTANCE = new Planechase(); + private static final Planechase fINSTANCE = new Planechase(); - public static Planechase getInstance() { - return fINSTANCE; - } + public static Planechase getInstance() { + return fINSTANCE; + } - private Planechase() { - super("Planechase", "HOP", "", "mage.sets.planechase", new GregorianCalendar(2009, 8, 4).getTime(), SetType.REPRINT); - } + private Planechase() { + super("Planechase", "HOP", "", "mage.sets.planechase", new GregorianCalendar(2009, 8, 4).getTime(), SetType.REPRINT); + } } diff --git a/Mage.Sets/src/mage/sets/RavnicaCityOfGuilds.java b/Mage.Sets/src/mage/sets/RavnicaCityOfGuilds.java index 743aa088bc..6e5b0ef4e7 100644 --- a/Mage.Sets/src/mage/sets/RavnicaCityOfGuilds.java +++ b/Mage.Sets/src/mage/sets/RavnicaCityOfGuilds.java @@ -49,9 +49,9 @@ public class RavnicaCityOfGuilds extends ExpansionSet { this.blockName = "Ravnika"; this.hasBoosters = true; this.numBoosterLands = 1; - this.numBoosterCommon = 10; - this.numBoosterUncommon = 3; - this.numBoosterRare = 1; - this.ratioBoosterMythic = 0; + this.numBoosterCommon = 10; + this.numBoosterUncommon = 3; + this.numBoosterRare = 1; + this.ratioBoosterMythic = 0; } } diff --git a/Mage.Sets/src/mage/sets/RiseOfTheEldrazi.java b/Mage.Sets/src/mage/sets/RiseOfTheEldrazi.java index 9fc84233e5..8075b47faa 100644 --- a/Mage.Sets/src/mage/sets/RiseOfTheEldrazi.java +++ b/Mage.Sets/src/mage/sets/RiseOfTheEldrazi.java @@ -38,22 +38,22 @@ import mage.cards.ExpansionSet; */ public class RiseOfTheEldrazi extends ExpansionSet { - private static final RiseOfTheEldrazi fINSTANCE = new RiseOfTheEldrazi(); + private static final RiseOfTheEldrazi fINSTANCE = new RiseOfTheEldrazi(); - public static RiseOfTheEldrazi getInstance() { - return fINSTANCE; - } + public static RiseOfTheEldrazi getInstance() { + return fINSTANCE; + } - private RiseOfTheEldrazi() { - super("Rise of the Eldrazi", "ROE", "seticon_ROE", "mage.sets.riseoftheeldrazi", new GregorianCalendar(2010, 3, 17).getTime(), SetType.EXPANSION); - this.blockName = "Zendikar"; - this.parentSet = Zendikar.getInstance(); - this.hasBoosters = true; - this.numBoosterLands = 1; - this.numBoosterCommon = 10; - this.numBoosterUncommon = 3; - this.numBoosterRare = 1; - this.ratioBoosterMythic = 8; - } + private RiseOfTheEldrazi() { + super("Rise of the Eldrazi", "ROE", "seticon_ROE", "mage.sets.riseoftheeldrazi", new GregorianCalendar(2010, 3, 17).getTime(), SetType.EXPANSION); + this.blockName = "Zendikar"; + this.parentSet = Zendikar.getInstance(); + this.hasBoosters = true; + this.numBoosterLands = 1; + this.numBoosterCommon = 10; + this.numBoosterUncommon = 3; + this.numBoosterRare = 1; + this.ratioBoosterMythic = 8; + } } diff --git a/Mage.Sets/src/mage/sets/ScarsOfMirrodin.java b/Mage.Sets/src/mage/sets/ScarsOfMirrodin.java index 899e8dcf0c..8e614f45fa 100644 --- a/Mage.Sets/src/mage/sets/ScarsOfMirrodin.java +++ b/Mage.Sets/src/mage/sets/ScarsOfMirrodin.java @@ -39,21 +39,21 @@ import java.util.GregorianCalendar; */ public class ScarsOfMirrodin extends ExpansionSet { - private static final ScarsOfMirrodin fINSTANCE = new ScarsOfMirrodin(); + private static final ScarsOfMirrodin fINSTANCE = new ScarsOfMirrodin(); - public static ScarsOfMirrodin getInstance() { - return fINSTANCE; - } + public static ScarsOfMirrodin getInstance() { + return fINSTANCE; + } - private ScarsOfMirrodin() { - super("Scars of Mirrodin", "SOM", "seticon_mtgsom", "mage.sets.scarsofmirrodin", new GregorianCalendar(2010, 10, 1).getTime(), SetType.EXPANSION); - this.blockName = "Mirrodin Besieged"; - this.hasBoosters = true; - this.numBoosterLands = 1; - this.numBoosterCommon = 10; - this.numBoosterUncommon = 3; - this.numBoosterRare = 1; - this.ratioBoosterMythic = 8; - } + private ScarsOfMirrodin() { + super("Scars of Mirrodin", "SOM", "seticon_mtgsom", "mage.sets.scarsofmirrodin", new GregorianCalendar(2010, 10, 1).getTime(), SetType.EXPANSION); + this.blockName = "Mirrodin Besieged"; + this.hasBoosters = true; + this.numBoosterLands = 1; + this.numBoosterCommon = 10; + this.numBoosterUncommon = 3; + this.numBoosterRare = 1; + this.ratioBoosterMythic = 8; + } } diff --git a/Mage.Sets/src/mage/sets/Sets.java b/Mage.Sets/src/mage/sets/Sets.java index 40f6be3311..85ee9ac327 100644 --- a/Mage.Sets/src/mage/sets/Sets.java +++ b/Mage.Sets/src/mage/sets/Sets.java @@ -49,25 +49,25 @@ import java.util.*; */ public class Sets extends HashMap { - private final static Logger logger = Logger.getLogger(Sets.class); - private static final Sets fINSTANCE = new Sets(); - private static Set names; - private static Set nonLandNames; - private static Set creatureTypes; - private static List cards; + private final static Logger logger = Logger.getLogger(Sets.class); + private static final Sets fINSTANCE = new Sets(); + private static Set names; + private static Set nonLandNames; + private static Set creatureTypes; + private static List cards; private static Map cardMap; protected static Random rnd = new Random(); - public static Sets getInstance() { - return fINSTANCE; - } + public static Sets getInstance() { + return fINSTANCE; + } - private Sets() { - names = new TreeSet(); - nonLandNames = new TreeSet(); - cards = new ArrayList(); + private Sets() { + names = new TreeSet(); + nonLandNames = new TreeSet(); + cards = new ArrayList(); cardMap = new HashMap(); - creatureTypes = new TreeSet(); + creatureTypes = new TreeSet(); this.addSet(AlaraReborn.getInstance()); this.addSet(Apocalypse.getInstance()); this.addSet(AvacynRestored.getInstance()); @@ -116,11 +116,11 @@ public class Sets extends HashMap { this.addSet(Weatherlight.getInstance()); this.addSet(Worldwake.getInstance()); this.addSet(Zendikar.getInstance()); - } + } - private void addSet(ExpansionSet set) { - this.put(set.getCode(), set); - } + private void addSet(ExpansionSet set) { + this.put(set.getCode(), set); + } private static void loadCards() { if (cards.isEmpty()) { @@ -148,33 +148,33 @@ public class Sets extends HashMap { } } - public static Set getCardNames() { + public static Set getCardNames() { if (names.isEmpty()) { loadCards(); } - return names; - } + return names; + } - public static Set getNonLandCardNames() { + public static Set getNonLandCardNames() { if (nonLandNames.isEmpty()) { loadCards(); } - return nonLandNames; - } + return nonLandNames; + } - public static Set getCreatureTypes() { + public static Set getCreatureTypes() { if (creatureTypes.isEmpty()) { loadCards(); } - return creatureTypes; - } + return creatureTypes; + } - public static Card getRandomCard() { + public static Card getRandomCard() { if (cards.isEmpty()) { loadCards(); } - return cards.get(rnd.nextInt(cards.size())); - } + return cards.get(rnd.nextInt(cards.size())); + } /** * Generates card pool of cardsCount cards that have manacost of allowed colors. @@ -187,25 +187,25 @@ public class Sets extends HashMap { List cardPool = new ArrayList(); int count = 0; - int tries = 0; - while (count < cardsCount) { - Card card = getRandomCard(); - if (!card.getCardType().contains(CardType.LAND)) { - if (cardFitsChosenColors(card, allowedColors)) { - cardPool.add(card); - count++; - } - } - tries++; - if (tries > 4096) { // to avoid infinite loop - throw new IllegalStateException("Not enough cards for chosen colors to generate deck: " + allowedColors); - } - } + int tries = 0; + while (count < cardsCount) { + Card card = getRandomCard(); + if (!card.getCardType().contains(CardType.LAND)) { + if (cardFitsChosenColors(card, allowedColors)) { + cardPool.add(card); + count++; + } + } + tries++; + if (tries > 4096) { // to avoid infinite loop + throw new IllegalStateException("Not enough cards for chosen colors to generate deck: " + allowedColors); + } + } return cardPool; } - /** + /** * Check that card can be played using chosen (allowed) colors. * * @param card @@ -213,64 +213,64 @@ public class Sets extends HashMap { * @return */ private static boolean cardFitsChosenColors(Card card, List allowedColors) { - if (card.getCardType().contains(CardType.LAND)) { - if (!card.getSupertype().contains("Basic")) { - int score = 0; - for (Mana mana : card.getMana()) { - for (ColoredManaSymbol color : allowedColors) { - score += mana.getColor(color); - } - } - if (score > 1) { - return true; - } - } - } - else { - for (String symbol : card.getManaCost().getSymbols()) { - boolean found = false; - symbol = symbol.replace("{", "").replace("}", ""); - if (isColoredMana(symbol)) { - for (ColoredManaSymbol allowed : allowedColors) { - if (allowed.toString().equals(symbol)) { - found = true; - break; - } - } - if (!found) { - return false; - } - } - } - return true; - } - return false; + if (card.getCardType().contains(CardType.LAND)) { + if (!card.getSupertype().contains("Basic")) { + int score = 0; + for (Mana mana : card.getMana()) { + for (ColoredManaSymbol color : allowedColors) { + score += mana.getColor(color); + } + } + if (score > 1) { + return true; + } + } + } + else { + for (String symbol : card.getManaCost().getSymbols()) { + boolean found = false; + symbol = symbol.replace("{", "").replace("}", ""); + if (isColoredMana(symbol)) { + for (ColoredManaSymbol allowed : allowedColors) { + if (allowed.toString().equals(symbol)) { + found = true; + break; + } + } + if (!found) { + return false; + } + } + } + return true; + } + return false; } protected static boolean isColoredMana(String symbol) { return symbol.equals("W") || symbol.equals("G") || symbol.equals("U") || symbol.equals("B") || symbol.equals("R"); } - public static Deck generateDeck() { - List allowedColors = new ArrayList(); - int numColors = rnd.nextInt(2) + 1; + public static Deck generateDeck() { + List allowedColors = new ArrayList(); + int numColors = rnd.nextInt(2) + 1; int cardPoolSize = 60; if (numColors > 2) { cardPoolSize += 20; } - Deck deck = new Deck(); + Deck deck = new Deck(); - return deck; - } + return deck; + } - public static Card findCard(String name) { - for (ExpansionSet set: fINSTANCE.values()) { - Card card = set.findCard(name); - if (card != null) - return card; - } - return null; - } + public static Card findCard(String name) { + for (ExpansionSet set: fINSTANCE.values()) { + Card card = set.findCard(name); + if (card != null) + return card; + } + return null; + } public static Card findCard(String name, boolean random) { if (!random) { @@ -289,15 +289,15 @@ public class Sets extends HashMap { return CardImpl.createCard(cardClassName); } } - return null; - } - + return null; + } + public static Card findCard(String expansionsetCode, int cardNum) { if (cardMap.containsKey(expansionsetCode + Integer.toString(cardNum))) { return cardMap.get(expansionsetCode + Integer.toString(cardNum)); } - if (fINSTANCE.containsKey(expansionsetCode)) { - ExpansionSet set = fINSTANCE.get(expansionsetCode); + if (fINSTANCE.containsKey(expansionsetCode)) { + ExpansionSet set = fINSTANCE.get(expansionsetCode); Card card = set.findCard(cardNum); if (card != null) { cardMap.put(expansionsetCode + Integer.toString(cardNum), card); @@ -305,67 +305,67 @@ public class Sets extends HashMap { } } logger.warn("Could not find card: set=" + expansionsetCode + "cardNum=" + Integer.toString(cardNum)); - return null; - + return null; + } - public static Card createCard(Class clazz) { - try { - Constructor con = clazz.getConstructor(new Class[]{UUID.class}); - return (Card) con.newInstance(new Object[] {null}); - } catch (Exception ex) { - logger.fatal("Error creating card:" + clazz.getName(), ex); - return null; - } - } + public static Card createCard(Class clazz) { + try { + Constructor con = clazz.getConstructor(new Class[]{UUID.class}); + return (Card) con.newInstance(new Object[] {null}); + } catch (Exception ex) { + logger.fatal("Error creating card:" + clazz.getName(), ex); + return null; + } + } - public static ExpansionSet findSet(String code) { - if (fINSTANCE.containsKey(code)) - return fINSTANCE.get(code); - return null; - } + public static ExpansionSet findSet(String code) { + if (fINSTANCE.containsKey(code)) + return fINSTANCE.get(code); + return null; + } - public static void saveDeck(String file, DeckCardLists deck) throws FileNotFoundException { - PrintWriter out = new PrintWriter(file); - Map deckCards = new HashMap(); - Map sideboard = new HashMap(); - try { - if (deck.getName() != null && deck.getName().length() > 0) - out.println("NAME:" + deck.getName()); - if (deck.getAuthor() != null && deck.getAuthor().length() > 0) - out.println("AUTHOR:" + deck.getAuthor()); - for (String cardClass: deck.getCards()) { - if (deckCards.containsKey(cardClass)) { - deckCards.put(cardClass, deckCards.get(cardClass) + 1); - } - else { - deckCards.put(cardClass, 1); - } - } - for (String cardClass: deck.getSideboard()) { - if (sideboard.containsKey(cardClass)) { - sideboard.put(cardClass, sideboard.get(cardClass) + 1); - } - else { - sideboard.put(cardClass, 1); - } - } - for (Map.Entry entry: deckCards.entrySet()) { - Card card = CardImpl.createCard(entry.getKey()); - if (card != null) { - out.printf("%d [%s:%d] %s%n", entry.getValue(), card.getExpansionSetCode(), card.getCardNumber(), card.getName()); - } - } - for (Map.Entry entry: sideboard.entrySet()) { - Card card = CardImpl.createCard(entry.getKey()); - if (card != null) { - out.printf("SB: %d [%s:%d] %s%n", entry.getValue(), card.getExpansionSetCode(), card.getCardNumber(), card.getName()); - } - } - } - finally { - out.close(); - } - } + public static void saveDeck(String file, DeckCardLists deck) throws FileNotFoundException { + PrintWriter out = new PrintWriter(file); + Map deckCards = new HashMap(); + Map sideboard = new HashMap(); + try { + if (deck.getName() != null && deck.getName().length() > 0) + out.println("NAME:" + deck.getName()); + if (deck.getAuthor() != null && deck.getAuthor().length() > 0) + out.println("AUTHOR:" + deck.getAuthor()); + for (String cardClass: deck.getCards()) { + if (deckCards.containsKey(cardClass)) { + deckCards.put(cardClass, deckCards.get(cardClass) + 1); + } + else { + deckCards.put(cardClass, 1); + } + } + for (String cardClass: deck.getSideboard()) { + if (sideboard.containsKey(cardClass)) { + sideboard.put(cardClass, sideboard.get(cardClass) + 1); + } + else { + sideboard.put(cardClass, 1); + } + } + for (Map.Entry entry: deckCards.entrySet()) { + Card card = CardImpl.createCard(entry.getKey()); + if (card != null) { + out.printf("%d [%s:%d] %s%n", entry.getValue(), card.getExpansionSetCode(), card.getCardNumber(), card.getName()); + } + } + for (Map.Entry entry: sideboard.entrySet()) { + Card card = CardImpl.createCard(entry.getKey()); + if (card != null) { + out.printf("SB: %d [%s:%d] %s%n", entry.getValue(), card.getExpansionSetCode(), card.getCardNumber(), card.getName()); + } + } + } + finally { + out.close(); + } + } } diff --git a/Mage.Sets/src/mage/sets/ShardsOfAlara.java b/Mage.Sets/src/mage/sets/ShardsOfAlara.java index b3ac621fd0..8b20f5745e 100644 --- a/Mage.Sets/src/mage/sets/ShardsOfAlara.java +++ b/Mage.Sets/src/mage/sets/ShardsOfAlara.java @@ -38,21 +38,21 @@ import mage.cards.ExpansionSet; */ public class ShardsOfAlara extends ExpansionSet { - private static final ShardsOfAlara fINSTANCE = new ShardsOfAlara(); + private static final ShardsOfAlara fINSTANCE = new ShardsOfAlara(); - public static ShardsOfAlara getInstance() { - return fINSTANCE; - } + public static ShardsOfAlara getInstance() { + return fINSTANCE; + } - private ShardsOfAlara() { - super("Shards of Alara", "ALA", "seticon_mtgala", "mage.sets.shardsofalara", new GregorianCalendar(2008, 8, 27).getTime(), SetType.EXPANSION); - this.blockName = "Shards of Alara"; - this.hasBoosters = true; - this.numBoosterLands = 1; - this.numBoosterCommon = 10; - this.numBoosterUncommon = 3; - this.numBoosterRare = 1; - this.ratioBoosterMythic = 8; - } + private ShardsOfAlara() { + super("Shards of Alara", "ALA", "seticon_mtgala", "mage.sets.shardsofalara", new GregorianCalendar(2008, 8, 27).getTime(), SetType.EXPANSION); + this.blockName = "Shards of Alara"; + this.hasBoosters = true; + this.numBoosterLands = 1; + this.numBoosterCommon = 10; + this.numBoosterUncommon = 3; + this.numBoosterRare = 1; + this.ratioBoosterMythic = 8; + } } diff --git a/Mage.Sets/src/mage/sets/Tempest.java b/Mage.Sets/src/mage/sets/Tempest.java index 1434d07c68..eaed4d8d37 100644 --- a/Mage.Sets/src/mage/sets/Tempest.java +++ b/Mage.Sets/src/mage/sets/Tempest.java @@ -8,17 +8,17 @@ import java.util.GregorianCalendar; public class Tempest extends ExpansionSet { private static final Tempest fINSTANCE = new Tempest(); - public static Tempest getInstance() { - return fINSTANCE; - } + public static Tempest getInstance() { + return fINSTANCE; + } private Tempest() { super("Tempest", "TMP", "", "mage.sets.tempest", new GregorianCalendar(1997, 9, 1).getTime(), Constants.SetType.EXPANSION); this.hasBoosters = true; - this.numBoosterLands = 1; - this.numBoosterCommon = 10; - this.numBoosterUncommon = 3; - this.numBoosterRare = 1; - this.ratioBoosterMythic = 0; + this.numBoosterLands = 1; + this.numBoosterCommon = 10; + this.numBoosterUncommon = 3; + this.numBoosterRare = 1; + this.ratioBoosterMythic = 0; } } diff --git a/Mage.Sets/src/mage/sets/Tenth.java b/Mage.Sets/src/mage/sets/Tenth.java index 7b080cb6ba..2f301ad3ae 100644 --- a/Mage.Sets/src/mage/sets/Tenth.java +++ b/Mage.Sets/src/mage/sets/Tenth.java @@ -38,20 +38,20 @@ import mage.cards.ExpansionSet; */ public class Tenth extends ExpansionSet { - private static final Tenth fINSTANCE = new Tenth(); + private static final Tenth fINSTANCE = new Tenth(); - public static Tenth getInstance() { - return fINSTANCE; - } + public static Tenth getInstance() { + return fINSTANCE; + } - private Tenth() { - super("Tenth Edition", "10E", "exp_symbol_mtg10e", "mage.sets.tenth", new GregorianCalendar(2007, 6, 14).getTime(), SetType.CORE); - this.hasBoosters = true; - this.numBoosterLands = 1; - this.numBoosterCommon = 10; - this.numBoosterUncommon = 3; - this.numBoosterRare = 1; - this.ratioBoosterMythic = 0; - } + private Tenth() { + super("Tenth Edition", "10E", "exp_symbol_mtg10e", "mage.sets.tenth", new GregorianCalendar(2007, 6, 14).getTime(), SetType.CORE); + this.hasBoosters = true; + this.numBoosterLands = 1; + this.numBoosterCommon = 10; + this.numBoosterUncommon = 3; + this.numBoosterRare = 1; + this.ratioBoosterMythic = 0; + } } diff --git a/Mage.Sets/src/mage/sets/TimeSpiral.java b/Mage.Sets/src/mage/sets/TimeSpiral.java index 7c9822c329..5ee7eb4c9e 100644 --- a/Mage.Sets/src/mage/sets/TimeSpiral.java +++ b/Mage.Sets/src/mage/sets/TimeSpiral.java @@ -7,20 +7,20 @@ import java.util.GregorianCalendar; public class TimeSpiral extends ExpansionSet { - private static final TimeSpiral fINSTANCE = new TimeSpiral(); + private static final TimeSpiral fINSTANCE = new TimeSpiral(); - public static TimeSpiral getInstance() { - return fINSTANCE; - } + public static TimeSpiral getInstance() { + return fINSTANCE; + } - private TimeSpiral() { - super("Time Spiral", "TSP", "", "mage.sets.timespiral", new GregorianCalendar(2006, 9, 9).getTime(), Constants.SetType.EXPANSION); - this.blockName = "Time Spiral"; - this.hasBoosters = true; - this.numBoosterLands = 1; - this.numBoosterCommon = 11; - this.numBoosterUncommon = 3; - this.numBoosterRare = 1; - this.ratioBoosterMythic = 0; - } + private TimeSpiral() { + super("Time Spiral", "TSP", "", "mage.sets.timespiral", new GregorianCalendar(2006, 9, 9).getTime(), Constants.SetType.EXPANSION); + this.blockName = "Time Spiral"; + this.hasBoosters = true; + this.numBoosterLands = 1; + this.numBoosterCommon = 11; + this.numBoosterUncommon = 3; + this.numBoosterRare = 1; + this.ratioBoosterMythic = 0; + } } diff --git a/Mage.Sets/src/mage/sets/UrzasLegacy.java b/Mage.Sets/src/mage/sets/UrzasLegacy.java index e7c5d54c44..1ad7f2c336 100644 --- a/Mage.Sets/src/mage/sets/UrzasLegacy.java +++ b/Mage.Sets/src/mage/sets/UrzasLegacy.java @@ -39,20 +39,20 @@ import java.util.GregorianCalendar; */ public class UrzasLegacy extends ExpansionSet { - private static final UrzasLegacy fINSTANCE = new UrzasLegacy(); + private static final UrzasLegacy fINSTANCE = new UrzasLegacy(); - public static UrzasLegacy getInstance() { - return fINSTANCE; - } + public static UrzasLegacy getInstance() { + return fINSTANCE; + } - private UrzasLegacy() { - super("Urza's Legacy", "ULG", "exp_symbol_mtgulg", "mage.sets.urzaslegacy", new GregorianCalendar(1999, 2, 6).getTime(), SetType.EXPANSION); - this.hasBoosters = true; - this.numBoosterLands = 1; - this.numBoosterCommon = 10; - this.numBoosterUncommon = 3; - this.numBoosterRare = 1; - this.ratioBoosterMythic = 0; - } + private UrzasLegacy() { + super("Urza's Legacy", "ULG", "exp_symbol_mtgulg", "mage.sets.urzaslegacy", new GregorianCalendar(1999, 2, 6).getTime(), SetType.EXPANSION); + this.hasBoosters = true; + this.numBoosterLands = 1; + this.numBoosterCommon = 10; + this.numBoosterUncommon = 3; + this.numBoosterRare = 1; + this.ratioBoosterMythic = 0; + } } diff --git a/Mage.Sets/src/mage/sets/UrzasSaga.java b/Mage.Sets/src/mage/sets/UrzasSaga.java index c425ec790d..b55a15a1ee 100644 --- a/Mage.Sets/src/mage/sets/UrzasSaga.java +++ b/Mage.Sets/src/mage/sets/UrzasSaga.java @@ -38,20 +38,20 @@ import mage.cards.ExpansionSet; */ public class UrzasSaga extends ExpansionSet { - private static final UrzasSaga fINSTANCE = new UrzasSaga(); + private static final UrzasSaga fINSTANCE = new UrzasSaga(); - public static UrzasSaga getInstance() { - return fINSTANCE; - } + public static UrzasSaga getInstance() { + return fINSTANCE; + } - private UrzasSaga() { - super("Urza's Saga", "USG", "exp_symbol_mtgusg", "mage.sets.urzassaga", new GregorianCalendar(1998, 10, 1).getTime(), SetType.EXPANSION); - this.hasBoosters = true; - this.numBoosterLands = 1; - this.numBoosterCommon = 10; - this.numBoosterUncommon = 3; - this.numBoosterRare = 1; - this.ratioBoosterMythic = 0; - } + private UrzasSaga() { + super("Urza's Saga", "USG", "exp_symbol_mtgusg", "mage.sets.urzassaga", new GregorianCalendar(1998, 10, 1).getTime(), SetType.EXPANSION); + this.hasBoosters = true; + this.numBoosterLands = 1; + this.numBoosterCommon = 10; + this.numBoosterUncommon = 3; + this.numBoosterRare = 1; + this.ratioBoosterMythic = 0; + } } diff --git a/Mage.Sets/src/mage/sets/Weatherlight.java b/Mage.Sets/src/mage/sets/Weatherlight.java index b360b26093..b4180223ca 100644 --- a/Mage.Sets/src/mage/sets/Weatherlight.java +++ b/Mage.Sets/src/mage/sets/Weatherlight.java @@ -39,20 +39,20 @@ import java.util.GregorianCalendar; */ public class Weatherlight extends ExpansionSet { - private static final Weatherlight fINSTANCE = new Weatherlight(); + private static final Weatherlight fINSTANCE = new Weatherlight(); - public static Weatherlight getInstance() { - return fINSTANCE; - } + public static Weatherlight getInstance() { + return fINSTANCE; + } - private Weatherlight() { - super("Weatherlight", "WTH", "exp_symbol_mtgwth", "mage.sets.weatherlight", new GregorianCalendar(1997, 5, 31).getTime(), SetType.EXPANSION); - this.hasBoosters = true; - this.numBoosterLands = 1; - this.numBoosterCommon = 10; - this.numBoosterUncommon = 3; - this.numBoosterRare = 1; - this.ratioBoosterMythic = 0; - } + private Weatherlight() { + super("Weatherlight", "WTH", "exp_symbol_mtgwth", "mage.sets.weatherlight", new GregorianCalendar(1997, 5, 31).getTime(), SetType.EXPANSION); + this.hasBoosters = true; + this.numBoosterLands = 1; + this.numBoosterCommon = 10; + this.numBoosterUncommon = 3; + this.numBoosterRare = 1; + this.ratioBoosterMythic = 0; + } } diff --git a/Mage.Sets/src/mage/sets/Worldwake.java b/Mage.Sets/src/mage/sets/Worldwake.java index a30be7fdc0..58dbcd7096 100644 --- a/Mage.Sets/src/mage/sets/Worldwake.java +++ b/Mage.Sets/src/mage/sets/Worldwake.java @@ -38,22 +38,22 @@ import mage.cards.ExpansionSet; */ public class Worldwake extends ExpansionSet { - private static final Worldwake fINSTANCE = new Worldwake(); + private static final Worldwake fINSTANCE = new Worldwake(); - public static Worldwake getInstance() { - return fINSTANCE; - } + public static Worldwake getInstance() { + return fINSTANCE; + } - private Worldwake() { - super("Worldwake", "WWK", "seticon_WWK", "mage.sets.worldwake", new GregorianCalendar(2010, 0, 30).getTime(), SetType.EXPANSION); - this.blockName = "Zendikar"; - this.parentSet = Zendikar.getInstance(); - this.hasBoosters = true; - this.numBoosterLands = 0; - this.numBoosterCommon = 11; - this.numBoosterUncommon = 3; - this.numBoosterRare = 1; - this.ratioBoosterMythic = 8; - } + private Worldwake() { + super("Worldwake", "WWK", "seticon_WWK", "mage.sets.worldwake", new GregorianCalendar(2010, 0, 30).getTime(), SetType.EXPANSION); + this.blockName = "Zendikar"; + this.parentSet = Zendikar.getInstance(); + this.hasBoosters = true; + this.numBoosterLands = 0; + this.numBoosterCommon = 11; + this.numBoosterUncommon = 3; + this.numBoosterRare = 1; + this.ratioBoosterMythic = 8; + } } diff --git a/Mage.Sets/src/mage/sets/Zendikar.java b/Mage.Sets/src/mage/sets/Zendikar.java index 63ac0f8250..50c802e388 100644 --- a/Mage.Sets/src/mage/sets/Zendikar.java +++ b/Mage.Sets/src/mage/sets/Zendikar.java @@ -38,21 +38,21 @@ import mage.cards.ExpansionSet; */ public class Zendikar extends ExpansionSet { - private static final Zendikar fINSTANCE = new Zendikar(); + private static final Zendikar fINSTANCE = new Zendikar(); - public static Zendikar getInstance() { - return fINSTANCE; - } + public static Zendikar getInstance() { + return fINSTANCE; + } - private Zendikar() { - super("Zendikar", "ZEN", "seticon_ZEN", "mage.sets.zendikar", new GregorianCalendar(2009, 8, 26).getTime(), SetType.EXPANSION); - this.blockName = "Zendikar"; - this.hasBoosters = true; - this.numBoosterLands = 1; - this.numBoosterCommon = 10; - this.numBoosterUncommon = 3; - this.numBoosterRare = 1; - this.ratioBoosterMythic = 8; - } + private Zendikar() { + super("Zendikar", "ZEN", "seticon_ZEN", "mage.sets.zendikar", new GregorianCalendar(2009, 8, 26).getTime(), SetType.EXPANSION); + this.blockName = "Zendikar"; + this.hasBoosters = true; + this.numBoosterLands = 1; + this.numBoosterCommon = 10; + this.numBoosterUncommon = 3; + this.numBoosterRare = 1; + this.ratioBoosterMythic = 8; + } } diff --git a/Mage.Sets/src/mage/sets/alarareborn/BehemothSledge.java b/Mage.Sets/src/mage/sets/alarareborn/BehemothSledge.java index c7a7d4c43c..0f98e921f5 100644 --- a/Mage.Sets/src/mage/sets/alarareborn/BehemothSledge.java +++ b/Mage.Sets/src/mage/sets/alarareborn/BehemothSledge.java @@ -51,25 +51,25 @@ import mage.cards.CardImpl; */ public class BehemothSledge extends CardImpl { - public BehemothSledge(UUID ownerId) { - super(ownerId, 65, "Behemoth Sledge", Rarity.UNCOMMON, new CardType[]{CardType.ARTIFACT}, "{1}{G}{W}"); - this.expansionSetCode = "ARB"; - this.subtype.add("Equipment"); - this.color.setGreen(true); - this.color.setWhite(true); - this.addAbility(new EquipAbility(Outcome.AddAbility, new GenericManaCost(3))); - this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityAttachedEffect(LifelinkAbility.getInstance(), Constants.AttachmentType.EQUIPMENT))); - this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityAttachedEffect(TrampleAbility.getInstance(), Constants.AttachmentType.EQUIPMENT))); - this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostEquippedEffect(2, 2))); - } + public BehemothSledge(UUID ownerId) { + super(ownerId, 65, "Behemoth Sledge", Rarity.UNCOMMON, new CardType[]{CardType.ARTIFACT}, "{1}{G}{W}"); + this.expansionSetCode = "ARB"; + this.subtype.add("Equipment"); + this.color.setGreen(true); + this.color.setWhite(true); + this.addAbility(new EquipAbility(Outcome.AddAbility, new GenericManaCost(3))); + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityAttachedEffect(LifelinkAbility.getInstance(), Constants.AttachmentType.EQUIPMENT))); + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityAttachedEffect(TrampleAbility.getInstance(), Constants.AttachmentType.EQUIPMENT))); + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostEquippedEffect(2, 2))); + } - protected BehemothSledge(BehemothSledge me) { - super(me); - } + protected BehemothSledge(BehemothSledge me) { + super(me); + } - @Override - public BehemothSledge copy() { - return new BehemothSledge(this); - } + @Override + public BehemothSledge copy() { + return new BehemothSledge(this); + } } diff --git a/Mage.Sets/src/mage/sets/alarareborn/BituminousBlast.java b/Mage.Sets/src/mage/sets/alarareborn/BituminousBlast.java index d3aa6fea1b..8e85f9c362 100644 --- a/Mage.Sets/src/mage/sets/alarareborn/BituminousBlast.java +++ b/Mage.Sets/src/mage/sets/alarareborn/BituminousBlast.java @@ -42,23 +42,23 @@ import mage.target.common.TargetCreaturePermanent; */ public class BituminousBlast extends CardImpl { - public BituminousBlast(UUID ownerId) { - super(ownerId, 34, "Bituminous Blast", Rarity.UNCOMMON, new CardType[]{CardType.INSTANT}, "{3}{B}{R}"); - this.expansionSetCode = "ARB"; - this.color.setBlack(true); - this.color.setRed(true); - this.getSpellAbility().addTarget(new TargetCreaturePermanent()); - this.getSpellAbility().addEffect(new DamageTargetEffect(4)); - this.addAbility(new CascadeAbility()); - } + public BituminousBlast(UUID ownerId) { + super(ownerId, 34, "Bituminous Blast", Rarity.UNCOMMON, new CardType[]{CardType.INSTANT}, "{3}{B}{R}"); + this.expansionSetCode = "ARB"; + this.color.setBlack(true); + this.color.setRed(true); + this.getSpellAbility().addTarget(new TargetCreaturePermanent()); + this.getSpellAbility().addEffect(new DamageTargetEffect(4)); + this.addAbility(new CascadeAbility()); + } - public BituminousBlast(final BituminousBlast card) { - super(card); - } + public BituminousBlast(final BituminousBlast card) { + super(card); + } - @Override - public BituminousBlast copy() { - return new BituminousBlast(this); - } + @Override + public BituminousBlast copy() { + return new BituminousBlast(this); + } } diff --git a/Mage.Sets/src/mage/sets/alarareborn/BloodbraidElf.java b/Mage.Sets/src/mage/sets/alarareborn/BloodbraidElf.java index b59b1a9f97..3be581e8d9 100644 --- a/Mage.Sets/src/mage/sets/alarareborn/BloodbraidElf.java +++ b/Mage.Sets/src/mage/sets/alarareborn/BloodbraidElf.java @@ -43,26 +43,26 @@ import mage.cards.CardImpl; */ public class BloodbraidElf extends CardImpl { - public BloodbraidElf(UUID ownerId) { - super(ownerId, 50, "Bloodbraid Elf", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{2}{R}{G}"); - this.expansionSetCode = "ARB"; - this.color.setRed(true); - this.color.setGreen(true); - this.subtype.add("Elf"); - this.subtype.add("Berserker"); - this.power = new MageInt(3); - this.toughness = new MageInt(2); - this.addAbility(HasteAbility.getInstance()); - this.addAbility(new CascadeAbility()); - } + public BloodbraidElf(UUID ownerId) { + super(ownerId, 50, "Bloodbraid Elf", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{2}{R}{G}"); + this.expansionSetCode = "ARB"; + this.color.setRed(true); + this.color.setGreen(true); + this.subtype.add("Elf"); + this.subtype.add("Berserker"); + this.power = new MageInt(3); + this.toughness = new MageInt(2); + this.addAbility(HasteAbility.getInstance()); + this.addAbility(new CascadeAbility()); + } - public BloodbraidElf(final BloodbraidElf card) { - super(card); - } + public BloodbraidElf(final BloodbraidElf card) { + super(card); + } - @Override - public BloodbraidElf copy() { - return new BloodbraidElf(this); - } + @Override + public BloodbraidElf copy() { + return new BloodbraidElf(this); + } } diff --git a/Mage.Sets/src/mage/sets/alarareborn/Brainbite.java b/Mage.Sets/src/mage/sets/alarareborn/Brainbite.java index 6d1dcfd385..53ff26404e 100644 --- a/Mage.Sets/src/mage/sets/alarareborn/Brainbite.java +++ b/Mage.Sets/src/mage/sets/alarareborn/Brainbite.java @@ -75,38 +75,38 @@ public class Brainbite extends CardImpl { class BrainbiteEffect extends OneShotEffect { - public BrainbiteEffect() { - super(Constants.Outcome.Discard); - staticText = "Target opponent reveals his or her hand. You choose a card from it. That player discards that card"; - } + public BrainbiteEffect() { + super(Constants.Outcome.Discard); + staticText = "Target opponent reveals his or her hand. You choose a card from it. That player discards that card"; + } - public BrainbiteEffect(final BrainbiteEffect effect) { - super(effect); - } + public BrainbiteEffect(final BrainbiteEffect effect) { + super(effect); + } - @Override - public boolean apply(Game game, Ability source) { - Player player = game.getPlayer(source.getFirstTarget()); - if (player != null) { - player.revealCards("Brainbite", player.getHand(), game); - Player you = game.getPlayer(source.getControllerId()); - if (you != null) { - TargetCard target = new TargetCard(Constants.Zone.PICK, new FilterCard()); + @Override + public boolean apply(Game game, Ability source) { + Player player = game.getPlayer(source.getFirstTarget()); + if (player != null) { + player.revealCards("Brainbite", player.getHand(), game); + Player you = game.getPlayer(source.getControllerId()); + if (you != null) { + TargetCard target = new TargetCard(Constants.Zone.PICK, new FilterCard()); target.setRequired(true); - if (you.choose(Constants.Outcome.Benefit, player.getHand(), target, game)) { - Card card = player.getHand().get(target.getFirstTarget(), game); - if (card != null) { - return player.discard(card, source, game); - } - } - } - } - return false; - } + if (you.choose(Constants.Outcome.Benefit, player.getHand(), target, game)) { + Card card = player.getHand().get(target.getFirstTarget(), game); + if (card != null) { + return player.discard(card, source, game); + } + } + } + } + return false; + } - @Override - public BrainbiteEffect copy() { - return new BrainbiteEffect(this); - } + @Override + public BrainbiteEffect copy() { + return new BrainbiteEffect(this); + } } diff --git a/Mage.Sets/src/mage/sets/alarareborn/CapturedSunlight.java b/Mage.Sets/src/mage/sets/alarareborn/CapturedSunlight.java index 705e5eae19..0000b37a6f 100644 --- a/Mage.Sets/src/mage/sets/alarareborn/CapturedSunlight.java +++ b/Mage.Sets/src/mage/sets/alarareborn/CapturedSunlight.java @@ -44,8 +44,8 @@ public class CapturedSunlight extends CardImpl { public CapturedSunlight (UUID ownerId) { super(ownerId, 66, "Captured Sunlight", Rarity.COMMON, new CardType[]{CardType.SORCERY}, "{2}{G}{W}"); this.expansionSetCode = "ARB"; - this.color.setGreen(true); - this.color.setWhite(true); + this.color.setGreen(true); + this.color.setWhite(true); this.getSpellAbility().addEffect(new GainLifeEffect(4)); this.addAbility(new CascadeAbility()); } diff --git a/Mage.Sets/src/mage/sets/alarareborn/DenyReality.java b/Mage.Sets/src/mage/sets/alarareborn/DenyReality.java index e8ecf551c8..223f335d36 100644 --- a/Mage.Sets/src/mage/sets/alarareborn/DenyReality.java +++ b/Mage.Sets/src/mage/sets/alarareborn/DenyReality.java @@ -48,7 +48,7 @@ public class DenyReality extends CardImpl { this.color.setBlue(true); this.color.setBlack(true); this.getSpellAbility().addTarget(new TargetPermanent()); - this.getSpellAbility().addEffect(new ReturnToHandTargetEffect()); + this.getSpellAbility().addEffect(new ReturnToHandTargetEffect()); this.addAbility(new CascadeAbility()); } diff --git a/Mage.Sets/src/mage/sets/alarareborn/FieldmistBorderpost.java b/Mage.Sets/src/mage/sets/alarareborn/FieldmistBorderpost.java index 285c2c44a5..54f2681107 100644 --- a/Mage.Sets/src/mage/sets/alarareborn/FieldmistBorderpost.java +++ b/Mage.Sets/src/mage/sets/alarareborn/FieldmistBorderpost.java @@ -64,8 +64,8 @@ public class FieldmistBorderpost extends CardImpl { public FieldmistBorderpost (UUID ownerId) { super(ownerId, 5, "Fieldmist Borderpost", Rarity.COMMON, new CardType[]{CardType.ARTIFACT}, "{1}{W}{U}"); this.expansionSetCode = "ARB"; - this.color.setWhite(true); - this.color.setBlue(true); + this.color.setWhite(true); + this.color.setBlue(true); Cost cost = new CompositeCost(new GenericManaCost(1), new ReturnToHandTargetCost(new TargetControlledPermanent(filter)), COST_DESCRIPTION); this.getSpellAbility().addAlternativeCost(new AlternativeCostImpl(ALTERNATIVE_COST_DESCRIPTION, cost)); this.addAbility(new EntersBattlefieldTappedAbility()); diff --git a/Mage.Sets/src/mage/sets/alarareborn/FiligreeAngel.java b/Mage.Sets/src/mage/sets/alarareborn/FiligreeAngel.java index fdf79da8af..000b1c9776 100644 --- a/Mage.Sets/src/mage/sets/alarareborn/FiligreeAngel.java +++ b/Mage.Sets/src/mage/sets/alarareborn/FiligreeAngel.java @@ -92,11 +92,11 @@ class FiligreeAngelEffect extends OneShotEffect { @Override public boolean apply(Game game, Ability source) { Player player = game.getPlayer(source.getControllerId()); - if (player != null) { + if (player != null) { int life = game.getBattlefield().count(filter, source.getControllerId(), game) * 3; - player.gainLife(life, game); - } - return true; + player.gainLife(life, game); + } + return true; } @Override diff --git a/Mage.Sets/src/mage/sets/alarareborn/FinestHour.java b/Mage.Sets/src/mage/sets/alarareborn/FinestHour.java index ab07e8c7a4..4234d7f4c4 100644 --- a/Mage.Sets/src/mage/sets/alarareborn/FinestHour.java +++ b/Mage.Sets/src/mage/sets/alarareborn/FinestHour.java @@ -52,94 +52,94 @@ import mage.target.common.TargetCreaturePermanent; */ public class FinestHour extends CardImpl { - public FinestHour(UUID ownerId) { - super(ownerId, 126, "Finest Hour", Rarity.RARE, new CardType[]{CardType.ENCHANTMENT}, "{2}{G}{W}{U}"); - this.expansionSetCode = "ARB"; - this.color.setWhite(true); - this.color.setGreen(true); - this.color.setBlue(true); - this.addAbility(new ExaltedAbility()); - this.addAbility(new FinestHourAbility()); - } + public FinestHour(UUID ownerId) { + super(ownerId, 126, "Finest Hour", Rarity.RARE, new CardType[]{CardType.ENCHANTMENT}, "{2}{G}{W}{U}"); + this.expansionSetCode = "ARB"; + this.color.setWhite(true); + this.color.setGreen(true); + this.color.setBlue(true); + this.addAbility(new ExaltedAbility()); + this.addAbility(new FinestHourAbility()); + } - public FinestHour(final FinestHour card) { - super(card); - } + public FinestHour(final FinestHour card) { + super(card); + } - @Override - public FinestHour copy() { - return new FinestHour(this); - } + @Override + public FinestHour copy() { + return new FinestHour(this); + } } class FinestHourAbility extends TriggeredAbilityImpl { - public FinestHourAbility() { - super(Zone.BATTLEFIELD, new FinestHourEffect()); - } + public FinestHourAbility() { + super(Zone.BATTLEFIELD, new FinestHourEffect()); + } - public FinestHourAbility(final FinestHourAbility ability) { - super(ability); - } + public FinestHourAbility(final FinestHourAbility ability) { + super(ability); + } - @Override - public FinestHourAbility copy() { - return new FinestHourAbility(this); - } + @Override + public FinestHourAbility copy() { + return new FinestHourAbility(this); + } - @Override - public boolean checkTrigger(GameEvent event, Game game) { - if (checkInterveningIfClause(game) && game.getActivePlayerId().equals(this.controllerId)) { - if (event.getType() == EventType.DECLARED_ATTACKERS) { - if (game.getCombat().attacksAlone()) { - this.addTarget(new TargetCreaturePermanent()); - getTargets().get(0).add(game.getCombat().getAttackers().get(0), game); - return true; - } - } - } - return false; - } + @Override + public boolean checkTrigger(GameEvent event, Game game) { + if (checkInterveningIfClause(game) && game.getActivePlayerId().equals(this.controllerId)) { + if (event.getType() == EventType.DECLARED_ATTACKERS) { + if (game.getCombat().attacksAlone()) { + this.addTarget(new TargetCreaturePermanent()); + getTargets().get(0).add(game.getCombat().getAttackers().get(0), game); + return true; + } + } + } + return false; + } - @Override - public boolean checkInterveningIfClause(Game game) { - return game.getTurn().getPhase(TurnPhase.COMBAT).getCount() == 0; - } + @Override + public boolean checkInterveningIfClause(Game game) { + return game.getTurn().getPhase(TurnPhase.COMBAT).getCount() == 0; + } - @Override - public String getRule() { - return "Whenever a creature you control attacks alone, if it's the first combat phase of the turn, untap that creature. After this phase, there is an additional combat phase."; - } + @Override + public String getRule() { + return "Whenever a creature you control attacks alone, if it's the first combat phase of the turn, untap that creature. After this phase, there is an additional combat phase."; + } } class FinestHourEffect extends OneShotEffect { - public FinestHourEffect() { - super(Outcome.Benefit); - } + public FinestHourEffect() { + super(Outcome.Benefit); + } - public FinestHourEffect(final FinestHourEffect effect) { - super(effect); - } + public FinestHourEffect(final FinestHourEffect effect) { + super(effect); + } - @Override - public FinestHourEffect copy() { - return new FinestHourEffect(this); - } + @Override + public FinestHourEffect copy() { + return new FinestHourEffect(this); + } - @Override - public boolean apply(Game game, Ability source) { - Permanent permanent = game.getPermanent(source.getFirstTarget()); - if (permanent != null) { - permanent.untap(game); - game.getState().getTurnMods().add(new TurnMod(source.getControllerId(), TurnPhase.COMBAT, null, false)); - } - else { - return false; - } - return true; - } + @Override + public boolean apply(Game game, Ability source) { + Permanent permanent = game.getPermanent(source.getFirstTarget()); + if (permanent != null) { + permanent.untap(game); + game.getState().getTurnMods().add(new TurnMod(source.getControllerId(), TurnPhase.COMBAT, null, false)); + } + else { + return false; + } + return true; + } } \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/alarareborn/FirewildBorderpost.java b/Mage.Sets/src/mage/sets/alarareborn/FirewildBorderpost.java index 384bc4169e..b54542044e 100644 --- a/Mage.Sets/src/mage/sets/alarareborn/FirewildBorderpost.java +++ b/Mage.Sets/src/mage/sets/alarareborn/FirewildBorderpost.java @@ -64,8 +64,8 @@ public class FirewildBorderpost extends CardImpl { public FirewildBorderpost (UUID ownerId) { super(ownerId, 54, "Firewild Borderpost", Rarity.COMMON, new CardType[]{CardType.ARTIFACT}, "{1}{R}{G}"); this.expansionSetCode = "ARB"; - this.color.setRed(true); - this.color.setGreen(true); + this.color.setRed(true); + this.color.setGreen(true); Cost cost = new CompositeCost(new GenericManaCost(1), new ReturnToHandTargetCost(new TargetControlledPermanent(filter)), COST_DESCRIPTION); this.getSpellAbility().addAlternativeCost(new AlternativeCostImpl(ALTERNATIVE_COST_DESCRIPTION, cost)); this.addAbility(new EntersBattlefieldTappedAbility()); diff --git a/Mage.Sets/src/mage/sets/alarareborn/GlassdustHulk.java b/Mage.Sets/src/mage/sets/alarareborn/GlassdustHulk.java index 6b47a0b9d7..2d986155c3 100644 --- a/Mage.Sets/src/mage/sets/alarareborn/GlassdustHulk.java +++ b/Mage.Sets/src/mage/sets/alarareborn/GlassdustHulk.java @@ -94,16 +94,16 @@ class GlassdustHulkTriggeredAbility extends TriggeredAbilityImpl { this.expansionSetCode = "ARB"; this.subtype.add("Viashino"); this.subtype.add("Soldier"); - this.color.setRed(true); - this.color.setGreen(true); - this.color.setWhite(true); + this.color.setRed(true); + this.color.setGreen(true); + this.color.setWhite(true); this.power = new MageInt(3); this.toughness = new MageInt(3); this.addAbility(new GloryscaleViashinoAbility()); @@ -88,12 +88,12 @@ class GloryscaleViashinoAbility extends TriggeredAbilityImpl { public IdentityCrisis (UUID ownerId) { super(ownerId, 81, "Identity Crisis", Rarity.RARE, new CardType[]{CardType.SORCERY}, "{2}{W}{W}{B}{B}"); this.expansionSetCode = "ARB"; - this.color.setWhite(true); - this.color.setBlack(true); + this.color.setWhite(true); + this.color.setBlack(true); this.getSpellAbility().addEffect(new IdentityCrisisEffect()); this.getSpellAbility().addTarget(new TargetPlayer()); } diff --git a/Mage.Sets/src/mage/sets/alarareborn/LichLordOfUnx.java b/Mage.Sets/src/mage/sets/alarareborn/LichLordOfUnx.java index 526d9032a5..0121629fa2 100644 --- a/Mage.Sets/src/mage/sets/alarareborn/LichLordOfUnx.java +++ b/Mage.Sets/src/mage/sets/alarareborn/LichLordOfUnx.java @@ -66,11 +66,11 @@ public class LichLordOfUnx extends CardImpl { this.subtype.add("Zombie"); this.subtype.add("Wizard"); - this.color.setBlue(true); - this.color.setBlack(true); + this.color.setBlue(true); + this.color.setBlack(true); this.power = new MageInt(2); this.toughness = new MageInt(2); - + Ability ability = new SimpleActivatedAbility(Constants.Zone.BATTLEFIELD, new CreateTokenEffect(new ZombieWizardToken()), new ManaCostsImpl("{U}{B}")); ability.addCost(new TapSourceCost()); this.addAbility(ability); @@ -100,6 +100,6 @@ class ZombieWizardToken extends Token { subtype.add("Zombie"); subtype.add("Wizard"); power = new MageInt(1); - toughness = new MageInt(1); + toughness = new MageInt(1); } } diff --git a/Mage.Sets/src/mage/sets/alarareborn/LorescaleCoatl.java b/Mage.Sets/src/mage/sets/alarareborn/LorescaleCoatl.java index ad4aad64aa..c04a11555f 100644 --- a/Mage.Sets/src/mage/sets/alarareborn/LorescaleCoatl.java +++ b/Mage.Sets/src/mage/sets/alarareborn/LorescaleCoatl.java @@ -47,12 +47,12 @@ public class LorescaleCoatl extends CardImpl { super(ownerId, 101, "Lorescale Coatl", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{1}{G}{U}"); this.expansionSetCode = "ARB"; this.subtype.add("Snake"); - - this.color.setGreen(true); - this.color.setBlue(true); + + this.color.setGreen(true); + this.color.setBlue(true); this.power = new MageInt(2); this.toughness = new MageInt(2); - + this.addAbility(new DrawCardTriggeredAbility(new AddCountersSourceEffect(CounterType.P1P1.createInstance()), true)); } diff --git a/Mage.Sets/src/mage/sets/alarareborn/MadrushCyclops.java b/Mage.Sets/src/mage/sets/alarareborn/MadrushCyclops.java index c527672415..2205556ee7 100644 --- a/Mage.Sets/src/mage/sets/alarareborn/MadrushCyclops.java +++ b/Mage.Sets/src/mage/sets/alarareborn/MadrushCyclops.java @@ -51,9 +51,9 @@ public class MadrushCyclops extends CardImpl { this.expansionSetCode = "ARB"; this.subtype.add("Cyclops"); this.subtype.add("Warrior"); - this.color.setBlack(true); - this.color.setRed(true); - this.color.setGreen(true); + this.color.setBlack(true); + this.color.setRed(true); + this.color.setGreen(true); this.power = new MageInt(3); this.toughness = new MageInt(4); this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityControlledEffect(HasteAbility.getInstance(), Duration.WhileOnBattlefield, new FilterControlledCreaturePermanent()))); diff --git a/Mage.Sets/src/mage/sets/alarareborn/MaelstromPulse.java b/Mage.Sets/src/mage/sets/alarareborn/MaelstromPulse.java index 5547b70bb7..d67e741956 100644 --- a/Mage.Sets/src/mage/sets/alarareborn/MaelstromPulse.java +++ b/Mage.Sets/src/mage/sets/alarareborn/MaelstromPulse.java @@ -41,22 +41,22 @@ import mage.target.common.TargetNonlandPermanent; */ public class MaelstromPulse extends CardImpl { - public MaelstromPulse(UUID ownerId) { - super(ownerId, 92, "Maelstrom Pulse", Rarity.RARE, new CardType[]{CardType.SORCERY}, "{1}{B}{G}"); - this.expansionSetCode = "ARB"; - this.color.setBlack(true); - this.color.setGreen(true); - this.getSpellAbility().addTarget(new TargetNonlandPermanent()); - this.getSpellAbility().addEffect(new DestroyAllNamedPermanentsEffect()); - } + public MaelstromPulse(UUID ownerId) { + super(ownerId, 92, "Maelstrom Pulse", Rarity.RARE, new CardType[]{CardType.SORCERY}, "{1}{B}{G}"); + this.expansionSetCode = "ARB"; + this.color.setBlack(true); + this.color.setGreen(true); + this.getSpellAbility().addTarget(new TargetNonlandPermanent()); + this.getSpellAbility().addEffect(new DestroyAllNamedPermanentsEffect()); + } - public MaelstromPulse(final MaelstromPulse card) { - super(card); - } + public MaelstromPulse(final MaelstromPulse card) { + super(card); + } - @Override - public MaelstromPulse copy() { - return new MaelstromPulse(this); - } + @Override + public MaelstromPulse copy() { + return new MaelstromPulse(this); + } } diff --git a/Mage.Sets/src/mage/sets/alarareborn/MagefireWings.java b/Mage.Sets/src/mage/sets/alarareborn/MagefireWings.java index 1f4b407d0a..1ff82eb4e5 100644 --- a/Mage.Sets/src/mage/sets/alarareborn/MagefireWings.java +++ b/Mage.Sets/src/mage/sets/alarareborn/MagefireWings.java @@ -56,14 +56,14 @@ public class MagefireWings extends CardImpl { super(ownerId, 88, "Magefire Wings", Rarity.COMMON, new CardType[]{CardType.ENCHANTMENT}, "{U}{R}"); this.expansionSetCode = "ARB"; this.subtype.add("Aura"); - this.color.setBlue(true); - this.color.setRed(true); + this.color.setBlue(true); + this.color.setRed(true); TargetPermanent auraTarget = new TargetCreaturePermanent(); - this.getSpellAbility().addTarget(auraTarget); - this.getSpellAbility().addEffect(new AttachEffect(Constants.Outcome.BoostCreature)); - Ability ability = new EnchantAbility(auraTarget.getTargetName()); - this.addAbility(ability); + this.getSpellAbility().addTarget(auraTarget); + this.getSpellAbility().addEffect(new AttachEffect(Constants.Outcome.BoostCreature)); + Ability ability = new EnchantAbility(auraTarget.getTargetName()); + this.addAbility(ability); this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostEnchantedEffect(2, 0, Duration.WhileOnBattlefield))); this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityAttachedEffect(FlyingAbility.getInstance(), Constants.AttachmentType.AURA))); diff --git a/Mage.Sets/src/mage/sets/alarareborn/MarisisTwinclaws.java b/Mage.Sets/src/mage/sets/alarareborn/MarisisTwinclaws.java index d381eac38a..82d4a7013d 100644 --- a/Mage.Sets/src/mage/sets/alarareborn/MarisisTwinclaws.java +++ b/Mage.Sets/src/mage/sets/alarareborn/MarisisTwinclaws.java @@ -46,9 +46,9 @@ public class MarisisTwinclaws extends CardImpl { this.expansionSetCode = "ARB"; this.subtype.add("Cat"); this.subtype.add("Warrior"); - this.color.setWhite(true); - this.color.setRed(true); - this.color.setGreen(true); + this.color.setWhite(true); + this.color.setRed(true); + this.color.setGreen(true); this.power = new MageInt(2); this.toughness = new MageInt(4); this.addAbility(DoubleStrikeAbility.getInstance()); diff --git a/Mage.Sets/src/mage/sets/alarareborn/MistveinBorderpost.java b/Mage.Sets/src/mage/sets/alarareborn/MistveinBorderpost.java index e3b85ad080..c61d66fa0e 100644 --- a/Mage.Sets/src/mage/sets/alarareborn/MistveinBorderpost.java +++ b/Mage.Sets/src/mage/sets/alarareborn/MistveinBorderpost.java @@ -64,8 +64,8 @@ public class MistveinBorderpost extends CardImpl { public MistveinBorderpost (UUID ownerId) { super(ownerId, 27, "Mistvein Borderpost", Rarity.COMMON, new CardType[]{CardType.ARTIFACT}, "{1}{U}{B}"); this.expansionSetCode = "ARB"; - this.color.setBlue(true); - this.color.setBlack(true); + this.color.setBlue(true); + this.color.setBlack(true); Cost cost = new CompositeCost(new GenericManaCost(1), new ReturnToHandTargetCost(new TargetControlledPermanent(filter)), COST_DESCRIPTION); this.getSpellAbility().addAlternativeCost(new AlternativeCostImpl(ALTERNATIVE_COST_DESCRIPTION, cost)); this.addAbility(new EntersBattlefieldTappedAbility()); diff --git a/Mage.Sets/src/mage/sets/alarareborn/NemesisOfReason.java b/Mage.Sets/src/mage/sets/alarareborn/NemesisOfReason.java index ec6d002669..ab2212a1ae 100644 --- a/Mage.Sets/src/mage/sets/alarareborn/NemesisOfReason.java +++ b/Mage.Sets/src/mage/sets/alarareborn/NemesisOfReason.java @@ -53,8 +53,8 @@ public class NemesisOfReason extends CardImpl { this.expansionSetCode = "ARB"; this.subtype.add("Leviathan"); this.subtype.add("Horror"); - this.color.setBlue(true); - this.color.setBlack(true); + this.color.setBlue(true); + this.color.setBlack(true); this.power = new MageInt(3); this.toughness = new MageInt(7); this.addAbility(new NemesisOfReasonTriggeredAbility()); @@ -90,9 +90,9 @@ class NemesisOfReasonTriggeredAbility extends TriggeredAbilityImpl { super(ownerId, 102, "Nulltread Gargantuan", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{1}{G}{U}"); this.expansionSetCode = "ARB"; this.subtype.add("Beast"); - this.color.setGreen(true); - this.color.setBlue(true); + this.color.setGreen(true); + this.color.setBlue(true); this.power = new MageInt(5); this.toughness = new MageInt(6); Ability ability = new EntersBattlefieldTriggeredAbility(new PutOnLibraryTargetEffect(true), false); - Target target = new TargetControlledCreaturePermanent(); - target.setRequired(true); - target.setNotTarget(true); + Target target = new TargetControlledCreaturePermanent(); + target.setRequired(true); + target.setNotTarget(true); ability.addTarget(target); this.addAbility(ability); } diff --git a/Mage.Sets/src/mage/sets/alarareborn/PutridLeech.java b/Mage.Sets/src/mage/sets/alarareborn/PutridLeech.java index 775f7c289e..0151a09c08 100644 --- a/Mage.Sets/src/mage/sets/alarareborn/PutridLeech.java +++ b/Mage.Sets/src/mage/sets/alarareborn/PutridLeech.java @@ -46,25 +46,25 @@ import mage.cards.CardImpl; */ public class PutridLeech extends CardImpl { - public PutridLeech(UUID ownerId) { - super(ownerId, 95, "Putrid Leech", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{B}{G}"); - this.expansionSetCode = "ARB"; - this.color.setBlack(true); - this.color.setGreen(true); - this.subtype.add("Zombie"); - this.subtype.add("Leech"); - this.power = new MageInt(2); - this.toughness = new MageInt(2); - this.addAbility(new ActivateOncePerTurnActivatedAbility(Zone.BATTLEFIELD, new BoostSourceEffect(2, 2, Duration.EndOfTurn), new PayLifeCost(2))); - } + public PutridLeech(UUID ownerId) { + super(ownerId, 95, "Putrid Leech", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{B}{G}"); + this.expansionSetCode = "ARB"; + this.color.setBlack(true); + this.color.setGreen(true); + this.subtype.add("Zombie"); + this.subtype.add("Leech"); + this.power = new MageInt(2); + this.toughness = new MageInt(2); + this.addAbility(new ActivateOncePerTurnActivatedAbility(Zone.BATTLEFIELD, new BoostSourceEffect(2, 2, Duration.EndOfTurn), new PayLifeCost(2))); + } - public PutridLeech(final PutridLeech card) { - super(card); - } + public PutridLeech(final PutridLeech card) { + super(card); + } - @Override - public PutridLeech copy() { - return new PutridLeech(this); - } + @Override + public PutridLeech copy() { + return new PutridLeech(this); + } } diff --git a/Mage.Sets/src/mage/sets/alarareborn/SewnEyeDrake.java b/Mage.Sets/src/mage/sets/alarareborn/SewnEyeDrake.java index b4302305fd..5c0853042a 100644 --- a/Mage.Sets/src/mage/sets/alarareborn/SewnEyeDrake.java +++ b/Mage.Sets/src/mage/sets/alarareborn/SewnEyeDrake.java @@ -47,7 +47,7 @@ public class SewnEyeDrake extends CardImpl { this.expansionSetCode = "ARB"; this.subtype.add("Zombie"); this.subtype.add("Drake"); - this.color.setBlack(true); + this.color.setBlack(true); this.color.setBlue(true); this.color.setRed(true); this.power = new MageInt(3); diff --git a/Mage.Sets/src/mage/sets/alarareborn/SigiledBehemoth.java b/Mage.Sets/src/mage/sets/alarareborn/SigiledBehemoth.java index a02bc837fb..2ae62ab49c 100644 --- a/Mage.Sets/src/mage/sets/alarareborn/SigiledBehemoth.java +++ b/Mage.Sets/src/mage/sets/alarareborn/SigiledBehemoth.java @@ -45,8 +45,8 @@ public class SigiledBehemoth extends CardImpl { super(ownerId, 79, "Sigiled Behemoth", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{4}{G}{W}"); this.expansionSetCode = "ARB"; this.subtype.add("Beast"); - this.color.setGreen(true); - this.color.setWhite(true); + this.color.setGreen(true); + this.color.setWhite(true); this.power = new MageInt(5); this.toughness = new MageInt(4); this.addAbility(new ExaltedAbility()); diff --git a/Mage.Sets/src/mage/sets/alarareborn/SpellbreakerBehemoth.java b/Mage.Sets/src/mage/sets/alarareborn/SpellbreakerBehemoth.java index f89932ad71..26f11df5da 100644 --- a/Mage.Sets/src/mage/sets/alarareborn/SpellbreakerBehemoth.java +++ b/Mage.Sets/src/mage/sets/alarareborn/SpellbreakerBehemoth.java @@ -47,33 +47,33 @@ import mage.filter.FilterSpell; */ public class SpellbreakerBehemoth extends CardImpl { - private static FilterSpell filter = new FilterSpell("Creature spells you control with power 5 or greater"); + private static FilterSpell filter = new FilterSpell("Creature spells you control with power 5 or greater"); - static { - filter.getCardType().add(CardType.CREATURE); - filter.setPower(5); - } + static { + filter.getCardType().add(CardType.CREATURE); + filter.setPower(5); + } - public SpellbreakerBehemoth(UUID ownerId) { - super(ownerId, 60, "Spellbreaker Behemoth", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{1}{R}{G}{G}"); - this.expansionSetCode = "ARB"; - this.color.setRed(true); - this.color.setGreen(true); - this.subtype.add("Beast"); - this.power = new MageInt(5); - this.toughness = new MageInt(5); + public SpellbreakerBehemoth(UUID ownerId) { + super(ownerId, 60, "Spellbreaker Behemoth", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{1}{R}{G}{G}"); + this.expansionSetCode = "ARB"; + this.color.setRed(true); + this.color.setGreen(true); + this.subtype.add("Beast"); + this.power = new MageInt(5); + this.toughness = new MageInt(5); - this.addAbility(new SimpleStaticAbility(Zone.STACK, new CantCounterSourceEffect())); - this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new CantCounterControlledEffect(filter, Duration.WhileOnBattlefield))); - } + this.addAbility(new SimpleStaticAbility(Zone.STACK, new CantCounterSourceEffect())); + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new CantCounterControlledEffect(filter, Duration.WhileOnBattlefield))); + } - public SpellbreakerBehemoth(final SpellbreakerBehemoth card) { - super(card); - } + public SpellbreakerBehemoth(final SpellbreakerBehemoth card) { + super(card); + } + + @Override + public SpellbreakerBehemoth copy() { + return new SpellbreakerBehemoth(this); + } - @Override - public SpellbreakerBehemoth copy() { - return new SpellbreakerBehemoth(this); - } - } diff --git a/Mage.Sets/src/mage/sets/alarareborn/SphinxOfTheSteelWind.java b/Mage.Sets/src/mage/sets/alarareborn/SphinxOfTheSteelWind.java index 514a78fa09..538606f427 100644 --- a/Mage.Sets/src/mage/sets/alarareborn/SphinxOfTheSteelWind.java +++ b/Mage.Sets/src/mage/sets/alarareborn/SphinxOfTheSteelWind.java @@ -45,8 +45,8 @@ public class SphinxOfTheSteelWind extends CardImpl { private static FilterCard filter = new FilterCard("red and from green"); static { - filter.setUseColor(true); - filter.getColor().setRed(true); + filter.setUseColor(true); + filter.getColor().setRed(true); filter.getColor().setGreen(true); filter.setScopeColor(Filter.ComparisonScope.Any); } @@ -55,9 +55,9 @@ public class SphinxOfTheSteelWind extends CardImpl { super(ownerId, 110, "Sphinx of the Steel Wind", Rarity.MYTHIC, new CardType[]{CardType.ARTIFACT, CardType.CREATURE}, "{5}{W}{U}{B}"); this.expansionSetCode = "ARB"; this.subtype.add("Sphinx"); - this.color.setWhite(true); - this.color.setBlue(true); - this.color.setBlack(true); + this.color.setWhite(true); + this.color.setBlue(true); + this.color.setBlack(true); this.power = new MageInt(6); this.toughness = new MageInt(6); this.addAbility(FlyingAbility.getInstance()); diff --git a/Mage.Sets/src/mage/sets/alarareborn/StunSniper.java b/Mage.Sets/src/mage/sets/alarareborn/StunSniper.java index 296920e7a9..62e200c806 100644 --- a/Mage.Sets/src/mage/sets/alarareborn/StunSniper.java +++ b/Mage.Sets/src/mage/sets/alarareborn/StunSniper.java @@ -53,8 +53,8 @@ public class StunSniper extends CardImpl { this.expansionSetCode = "ARB"; this.subtype.add("Human"); this.subtype.add("Archer"); - this.color.setRed(true); - this.color.setWhite(true); + this.color.setRed(true); + this.color.setWhite(true); this.power = new MageInt(1); this.toughness = new MageInt(1); Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DamageTargetEffect(1), new GenericManaCost(1)); diff --git a/Mage.Sets/src/mage/sets/alarareborn/Terminate.java b/Mage.Sets/src/mage/sets/alarareborn/Terminate.java index 720a788883..f11d38266b 100644 --- a/Mage.Sets/src/mage/sets/alarareborn/Terminate.java +++ b/Mage.Sets/src/mage/sets/alarareborn/Terminate.java @@ -41,22 +41,22 @@ import mage.target.common.TargetCreaturePermanent; */ public class Terminate extends CardImpl { - public Terminate(UUID ownerId) { - super(ownerId, 46, "Terminate", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{B}{R}"); - this.expansionSetCode = "ARB"; - this.color.setBlack(true); - this.color.setRed(true); - this.getSpellAbility().addTarget(new TargetCreaturePermanent()); - this.getSpellAbility().addEffect(new DestroyTargetEffect(true)); - } + public Terminate(UUID ownerId) { + super(ownerId, 46, "Terminate", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{B}{R}"); + this.expansionSetCode = "ARB"; + this.color.setBlack(true); + this.color.setRed(true); + this.getSpellAbility().addTarget(new TargetCreaturePermanent()); + this.getSpellAbility().addEffect(new DestroyTargetEffect(true)); + } - public Terminate(final Terminate card) { - super(card); - } + public Terminate(final Terminate card) { + super(card); + } - @Override - public Terminate copy() { - return new Terminate(this); - } + @Override + public Terminate copy() { + return new Terminate(this); + } } diff --git a/Mage.Sets/src/mage/sets/alarareborn/VeinfireBorderpost.java b/Mage.Sets/src/mage/sets/alarareborn/VeinfireBorderpost.java index c1a03004df..f5c6737bb0 100644 --- a/Mage.Sets/src/mage/sets/alarareborn/VeinfireBorderpost.java +++ b/Mage.Sets/src/mage/sets/alarareborn/VeinfireBorderpost.java @@ -64,8 +64,8 @@ public class VeinfireBorderpost extends CardImpl { public VeinfireBorderpost (UUID ownerId) { super(ownerId, 48, "Veinfire Borderpost", Rarity.COMMON, new CardType[]{CardType.ARTIFACT}, "{1}{B}{R}"); this.expansionSetCode = "ARB"; - this.color.setBlack(true); - this.color.setRed(true); + this.color.setBlack(true); + this.color.setRed(true); Cost cost = new CompositeCost(new GenericManaCost(1), new ReturnToHandTargetCost(new TargetControlledPermanent(filter)), COST_DESCRIPTION); this.getSpellAbility().addAlternativeCost(new AlternativeCostImpl(ALTERNATIVE_COST_DESCRIPTION, cost)); this.addAbility(new EntersBattlefieldTappedAbility()); diff --git a/Mage.Sets/src/mage/sets/alarareborn/VengefulRebirth.java b/Mage.Sets/src/mage/sets/alarareborn/VengefulRebirth.java index ba4e6c9e08..634d6f4e78 100644 --- a/Mage.Sets/src/mage/sets/alarareborn/VengefulRebirth.java +++ b/Mage.Sets/src/mage/sets/alarareborn/VengefulRebirth.java @@ -50,66 +50,66 @@ import mage.target.common.TargetCreatureOrPlayer; */ public class VengefulRebirth extends CardImpl { - public VengefulRebirth(UUID ownerId) { - super(ownerId, 62, "Vengeful Rebirth", Rarity.UNCOMMON, new CardType[]{CardType.SORCERY}, "{4}{R}{G}"); - this.expansionSetCode = "ARB"; - this.color.setRed(true); - this.color.setGreen(true); - this.getSpellAbility().addTarget(new TargetCardInYourGraveyard()); - this.getSpellAbility().addTarget(new TargetCreatureOrPlayer()); - this.getSpellAbility().addEffect(new VengefulRebirthEffect()); - this.getSpellAbility().addEffect(ExileSpellEffect.getInstance()); - } + public VengefulRebirth(UUID ownerId) { + super(ownerId, 62, "Vengeful Rebirth", Rarity.UNCOMMON, new CardType[]{CardType.SORCERY}, "{4}{R}{G}"); + this.expansionSetCode = "ARB"; + this.color.setRed(true); + this.color.setGreen(true); + this.getSpellAbility().addTarget(new TargetCardInYourGraveyard()); + this.getSpellAbility().addTarget(new TargetCreatureOrPlayer()); + this.getSpellAbility().addEffect(new VengefulRebirthEffect()); + this.getSpellAbility().addEffect(ExileSpellEffect.getInstance()); + } - public VengefulRebirth(final VengefulRebirth card) { - super(card); - } + public VengefulRebirth(final VengefulRebirth card) { + super(card); + } - @Override - public VengefulRebirth copy() { - return new VengefulRebirth(this); - } + @Override + public VengefulRebirth copy() { + return new VengefulRebirth(this); + } } class VengefulRebirthEffect extends OneShotEffect { - public VengefulRebirthEffect() { - super(Outcome.DrawCard); - staticText = "Return target card from your graveyard to your hand. If you return a nonland card to your hand this way, {this} deals damage equal to that card's converted mana cost to target creature or player"; - } + public VengefulRebirthEffect() { + super(Outcome.DrawCard); + staticText = "Return target card from your graveyard to your hand. If you return a nonland card to your hand this way, {this} deals damage equal to that card's converted mana cost to target creature or player"; + } - public VengefulRebirthEffect(final VengefulRebirthEffect effect) { - super(effect); - } + public VengefulRebirthEffect(final VengefulRebirthEffect effect) { + super(effect); + } - @Override - public VengefulRebirthEffect copy() { - return new VengefulRebirthEffect(this); - } + @Override + public VengefulRebirthEffect copy() { + return new VengefulRebirthEffect(this); + } - @Override - public boolean apply(Game game, Ability source) { - Player player = game.getPlayer(source.getControllerId()); - Card card = (Card)game.getObject(source.getFirstTarget()); - if (player.removeFromGraveyard(card, game)) { - card.moveToZone(Zone.HAND, source.getId(), game, false); - int damage = card.getManaCost().convertedManaCost(); - if (!card.getCardType().contains(CardType.LAND)) { - Permanent permanent = game.getPermanent(source.getTargets().get(1).getTargets().get(0)); - if (permanent != null) { - permanent.damage(damage, source.getSourceId(), game, true, false); - return true; - } - Player targetPlayer = game.getPlayer(source.getTargets().get(1).getTargets().get(0)); - if (targetPlayer != null) { - targetPlayer.damage(damage, source.getSourceId(), game, false, true); - return true; - } - return false; - } - } - return true; - } + @Override + public boolean apply(Game game, Ability source) { + Player player = game.getPlayer(source.getControllerId()); + Card card = (Card)game.getObject(source.getFirstTarget()); + if (player.removeFromGraveyard(card, game)) { + card.moveToZone(Zone.HAND, source.getId(), game, false); + int damage = card.getManaCost().convertedManaCost(); + if (!card.getCardType().contains(CardType.LAND)) { + Permanent permanent = game.getPermanent(source.getTargets().get(1).getTargets().get(0)); + if (permanent != null) { + permanent.damage(damage, source.getSourceId(), game, true, false); + return true; + } + Player targetPlayer = game.getPlayer(source.getTargets().get(1).getTargets().get(0)); + if (targetPlayer != null) { + targetPlayer.damage(damage, source.getSourceId(), game, false, true); + return true; + } + return false; + } + } + return true; + } } diff --git a/Mage.Sets/src/mage/sets/alarareborn/VithianRenegades.java b/Mage.Sets/src/mage/sets/alarareborn/VithianRenegades.java index c5f274954f..9b896faf77 100644 --- a/Mage.Sets/src/mage/sets/alarareborn/VithianRenegades.java +++ b/Mage.Sets/src/mage/sets/alarareborn/VithianRenegades.java @@ -57,8 +57,8 @@ public class VithianRenegades extends CardImpl { this.expansionSetCode = "ARB"; this.subtype.add("Human"); this.subtype.add("Shaman"); - this.color.setRed(true); - this.color.setGreen(true); + this.color.setRed(true); + this.color.setGreen(true); this.power = new MageInt(3); this.toughness = new MageInt(2); Ability ability = new EntersBattlefieldTriggeredAbility(new DestroyTargetEffect()); diff --git a/Mage.Sets/src/mage/sets/alarareborn/WildfieldBorderpost.java b/Mage.Sets/src/mage/sets/alarareborn/WildfieldBorderpost.java index 3bf54f62a2..1e346044c3 100644 --- a/Mage.Sets/src/mage/sets/alarareborn/WildfieldBorderpost.java +++ b/Mage.Sets/src/mage/sets/alarareborn/WildfieldBorderpost.java @@ -64,8 +64,8 @@ public class WildfieldBorderpost extends CardImpl { public WildfieldBorderpost (UUID ownerId) { super(ownerId, 80, "Wildfield Borderpost", Rarity.COMMON, new CardType[]{CardType.ARTIFACT}, "{1}{G}{W}"); this.expansionSetCode = "ARB"; - this.color.setGreen(true); - this.color.setWhite(true); + this.color.setGreen(true); + this.color.setWhite(true); Cost cost = new CompositeCost(new GenericManaCost(1), new ReturnToHandTargetCost(new TargetControlledPermanent(filter)), COST_DESCRIPTION); this.getSpellAbility().addAlternativeCost(new AlternativeCostImpl(ALTERNATIVE_COST_DESCRIPTION, cost)); this.addAbility(new EntersBattlefieldTappedAbility()); diff --git a/Mage.Sets/src/mage/sets/alarareborn/WingedCoatl.java b/Mage.Sets/src/mage/sets/alarareborn/WingedCoatl.java index 333304739c..244a2cffd8 100644 --- a/Mage.Sets/src/mage/sets/alarareborn/WingedCoatl.java +++ b/Mage.Sets/src/mage/sets/alarareborn/WingedCoatl.java @@ -47,8 +47,8 @@ public class WingedCoatl extends CardImpl { super(ownerId, 105, "Winged Coatl", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{1}{G}{U}"); this.expansionSetCode = "ARB"; this.subtype.add("Snake"); - this.color.setGreen(true); - this.color.setBlue(true); + this.color.setGreen(true); + this.color.setBlue(true); this.power = new MageInt(1); this.toughness = new MageInt(1); this.addAbility(FlashAbility.getInstance()); diff --git a/Mage.Sets/src/mage/sets/apocalypse/DeathGrasp.java b/Mage.Sets/src/mage/sets/apocalypse/DeathGrasp.java index 46a80f369d..aef53d1e1e 100644 --- a/Mage.Sets/src/mage/sets/apocalypse/DeathGrasp.java +++ b/Mage.Sets/src/mage/sets/apocalypse/DeathGrasp.java @@ -46,8 +46,8 @@ public class DeathGrasp extends CardImpl { public DeathGrasp (UUID ownerId) { super(ownerId, 95, "Death Grasp", Rarity.RARE, new CardType[]{CardType.SORCERY}, "{X}{W}{B}"); this.expansionSetCode = "APC"; - this.color.setWhite(true); - this.color.setBlack(true); + this.color.setWhite(true); + this.color.setBlack(true); this.getSpellAbility().addEffect(new DamageTargetEffect(new ManacostVariableValue())); this.getSpellAbility().addEffect(new GainLifeEffect(new ManacostVariableValue())); this.getSpellAbility().addTarget(new TargetCreatureOrPlayer()); diff --git a/Mage.Sets/src/mage/sets/apocalypse/ManaclesOfDecay.java b/Mage.Sets/src/mage/sets/apocalypse/ManaclesOfDecay.java index 8c4214da8e..47b12357ee 100644 --- a/Mage.Sets/src/mage/sets/apocalypse/ManaclesOfDecay.java +++ b/Mage.Sets/src/mage/sets/apocalypse/ManaclesOfDecay.java @@ -57,11 +57,11 @@ public class ManaclesOfDecay extends CardImpl { this.subtype.add("Aura"); this.color.setWhite(true); TargetPermanent auraTarget = new TargetCreaturePermanent(); - this.getSpellAbility().addTarget(auraTarget); - this.getSpellAbility().addEffect(new AttachEffect(Constants.Outcome.BoostCreature)); - Ability ability = new EnchantAbility(auraTarget.getTargetName()); - this.addAbility(ability); - this.addAbility(new SimpleStaticAbility(Constants.Zone.BATTLEFIELD, new ManaclesOfDecayFirstEffect())); + this.getSpellAbility().addTarget(auraTarget); + this.getSpellAbility().addEffect(new AttachEffect(Constants.Outcome.BoostCreature)); + Ability ability = new EnchantAbility(auraTarget.getTargetName()); + this.addAbility(ability); + this.addAbility(new SimpleStaticAbility(Constants.Zone.BATTLEFIELD, new ManaclesOfDecayFirstEffect())); this.addAbility(new SimpleActivatedAbility(Constants.Zone.BATTLEFIELD, new BoostEnchantedEffect(-1, -1, Constants.Duration.EndOfTurn), new ColoredManaCost(Constants.ColoredManaSymbol.B))); this.addAbility(new SimpleActivatedAbility(Constants.Zone.BATTLEFIELD, new ManaclesOfDecaySecondEffect(), new ColoredManaCost(Constants.ColoredManaSymbol.R))); @@ -79,53 +79,53 @@ public class ManaclesOfDecay extends CardImpl { class ManaclesOfDecayFirstEffect extends RestrictionEffect { - public ManaclesOfDecayFirstEffect() { - super(Constants.Duration.WhileOnBattlefield); - staticText = "Enchanted creature can't attack"; - } + public ManaclesOfDecayFirstEffect() { + super(Constants.Duration.WhileOnBattlefield); + staticText = "Enchanted creature can't attack"; + } - public ManaclesOfDecayFirstEffect(final ManaclesOfDecayFirstEffect effect) { - super(effect); - } + public ManaclesOfDecayFirstEffect(final ManaclesOfDecayFirstEffect effect) { + super(effect); + } - @Override - public boolean applies(Permanent permanent, Ability source, Game game) { - if (permanent.getAttachments().contains((source.getSourceId()))) { - return true; - } - return false; - } + @Override + public boolean applies(Permanent permanent, Ability source, Game game) { + if (permanent.getAttachments().contains((source.getSourceId()))) { + return true; + } + return false; + } - @Override - public boolean canAttack(Game game) { - return false; - } + @Override + public boolean canAttack(Game game) { + return false; + } - @Override - public ManaclesOfDecayFirstEffect copy() { - return new ManaclesOfDecayFirstEffect(this); - } + @Override + public ManaclesOfDecayFirstEffect copy() { + return new ManaclesOfDecayFirstEffect(this); + } } class ManaclesOfDecaySecondEffect extends RestrictionEffect { - public ManaclesOfDecaySecondEffect() { - super(Constants.Duration.EndOfTurn); - staticText = "Enchanted creature can't block until end of turn"; - } + public ManaclesOfDecaySecondEffect() { + super(Constants.Duration.EndOfTurn); + staticText = "Enchanted creature can't block until end of turn"; + } - public ManaclesOfDecaySecondEffect(final ManaclesOfDecaySecondEffect effect) { - super(effect); - } + public ManaclesOfDecaySecondEffect(final ManaclesOfDecaySecondEffect effect) { + super(effect); + } - @Override - public boolean applies(Permanent permanent, Ability source, Game game) { - if (permanent.getAttachments().contains((source.getSourceId()))) { - return true; - } - return false; - } + @Override + public boolean applies(Permanent permanent, Ability source, Game game) { + if (permanent.getAttachments().contains((source.getSourceId()))) { + return true; + } + return false; + } @Override public boolean canBlock(Permanent attacker, Permanent blocker, Ability source, Game game) { @@ -133,8 +133,8 @@ class ManaclesOfDecaySecondEffect extends RestrictionEffect { public Vindicate (UUID ownerId) { super(ownerId, 126, "Vindicate", Rarity.RARE, new CardType[]{CardType.SORCERY}, "{1}{W}{B}"); this.expansionSetCode = "APC"; - this.color.setWhite(true); - this.color.setBlack(true); + this.color.setWhite(true); + this.color.setBlack(true); this.getSpellAbility().addEffect(new DestroyTargetEffect()); this.getSpellAbility().addTarget(new TargetPermanent()); } diff --git a/Mage.Sets/src/mage/sets/avacynrestored/AngelOfGlorysRise.java b/Mage.Sets/src/mage/sets/avacynrestored/AngelOfGlorysRise.java index 2f20a6c5d7..023424f856 100644 --- a/Mage.Sets/src/mage/sets/avacynrestored/AngelOfGlorysRise.java +++ b/Mage.Sets/src/mage/sets/avacynrestored/AngelOfGlorysRise.java @@ -61,7 +61,7 @@ public class AngelOfGlorysRise extends CardImpl { this.toughness = new MageInt(6); this.addAbility(FlyingAbility.getInstance()); - + // When Angel of Glory's Rise enters the battlefield, exile all Zombies, then return all Human creature cards from your graveyard to the battlefield. EntersBattlefieldTriggeredAbility ability = new EntersBattlefieldTriggeredAbility(new AngelOfGlorysRiseEffect()); this.addAbility(ability); @@ -78,10 +78,10 @@ public class AngelOfGlorysRise extends CardImpl { } class AngelOfGlorysRiseEffect extends OneShotEffect { - + private static final FilterCreatureCard filterHuman = new FilterCreatureCard(); private static final FilterCreaturePermanent filterZombie = new FilterCreaturePermanent(); - + static { filterZombie.getSubtype().add("Zombie"); filterZombie.setScopeSubtype(Filter.ComparisonScope.Any); diff --git a/Mage.Sets/src/mage/sets/avacynrestored/AngelOfJubilation.java b/Mage.Sets/src/mage/sets/avacynrestored/AngelOfJubilation.java index b612d2dd96..7f146a28a5 100644 --- a/Mage.Sets/src/mage/sets/avacynrestored/AngelOfJubilation.java +++ b/Mage.Sets/src/mage/sets/avacynrestored/AngelOfJubilation.java @@ -50,7 +50,7 @@ import java.util.UUID; public class AngelOfJubilation extends CardImpl { private final static FilterCreaturePermanent filterNonBlack = new FilterCreaturePermanent("nonblack creatures"); - + static { filterNonBlack.setUseColor(true); filterNonBlack.setColor(ObjectColor.BLACK); diff --git a/Mage.Sets/src/mage/sets/avacynrestored/CavernOfSouls.java b/Mage.Sets/src/mage/sets/avacynrestored/CavernOfSouls.java index 7c2dc089d5..65e55c73ef 100644 --- a/Mage.Sets/src/mage/sets/avacynrestored/CavernOfSouls.java +++ b/Mage.Sets/src/mage/sets/avacynrestored/CavernOfSouls.java @@ -64,7 +64,7 @@ import java.util.UUID; public class CavernOfSouls extends CardImpl { private static final String ruleText = "As Cavern of Souls enters the battlefield, choose a creature type"; - + public CavernOfSouls(UUID ownerId) { super(ownerId, 226, "Cavern of Souls", Rarity.RARE, new CardType[]{CardType.LAND}, ""); this.expansionSetCode = "AVR"; diff --git a/Mage.Sets/src/mage/sets/avacynrestored/DemonlordOfAshmouth.java b/Mage.Sets/src/mage/sets/avacynrestored/DemonlordOfAshmouth.java index 9e46372ab5..5125765bd4 100644 --- a/Mage.Sets/src/mage/sets/avacynrestored/DemonlordOfAshmouth.java +++ b/Mage.Sets/src/mage/sets/avacynrestored/DemonlordOfAshmouth.java @@ -47,7 +47,7 @@ import java.util.UUID; public class DemonlordOfAshmouth extends CardImpl { private static FilterControlledCreaturePermanent filter = new FilterControlledCreaturePermanent(" another creature"); - + static { filter.setAnother(true); } diff --git a/Mage.Sets/src/mage/sets/avacynrestored/DivineDeflection.java b/Mage.Sets/src/mage/sets/avacynrestored/DivineDeflection.java index 5f59f3857a..53e4654604 100644 --- a/Mage.Sets/src/mage/sets/avacynrestored/DivineDeflection.java +++ b/Mage.Sets/src/mage/sets/avacynrestored/DivineDeflection.java @@ -73,7 +73,7 @@ public class DivineDeflection extends CardImpl { class DivineDeflectionPreventDamageTargetEffect extends PreventionEffectImpl { private int amount = -1; - + public DivineDeflectionPreventDamageTargetEffect(Constants.Duration duration) { super(duration); staticText = "Prevent the next X damage that would be dealt to you and/or permanents you control this turn. If damage is prevented this way, {this} deals that much damage to target creature or player"; diff --git a/Mage.Sets/src/mage/sets/avacynrestored/DruidsFamiliar.java b/Mage.Sets/src/mage/sets/avacynrestored/DruidsFamiliar.java index 1bd6b52390..97ed18e1aa 100644 --- a/Mage.Sets/src/mage/sets/avacynrestored/DruidsFamiliar.java +++ b/Mage.Sets/src/mage/sets/avacynrestored/DruidsFamiliar.java @@ -46,7 +46,7 @@ import java.util.UUID; public class DruidsFamiliar extends CardImpl { private static final String ruleText = "As long as {this} is paired with another creature, each of those creatures gets +2/+2"; - + public DruidsFamiliar(UUID ownerId) { super(ownerId, 175, "Druid's Familiar", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{3}{G}"); this.expansionSetCode = "AVR"; diff --git a/Mage.Sets/src/mage/sets/avacynrestored/Fettergeist.java b/Mage.Sets/src/mage/sets/avacynrestored/Fettergeist.java index d0dbce4320..7bf8a0c3d3 100644 --- a/Mage.Sets/src/mage/sets/avacynrestored/Fettergeist.java +++ b/Mage.Sets/src/mage/sets/avacynrestored/Fettergeist.java @@ -61,7 +61,7 @@ public class Fettergeist extends CardImpl { this.toughness = new MageInt(4); this.addAbility(FlyingAbility.getInstance()); - + // At the beginning of your upkeep, sacrifice Fettergeist unless you pay {1} for each other creature you control. this.addAbility(new BeginningOfUpkeepTriggeredAbility(new FettergeistUnlessPaysEffect(), Constants.TargetController.YOU, false)); diff --git a/Mage.Sets/src/mage/sets/avacynrestored/GhostlyFlicker.java b/Mage.Sets/src/mage/sets/avacynrestored/GhostlyFlicker.java index 500af6ecbd..da1229eb1f 100644 --- a/Mage.Sets/src/mage/sets/avacynrestored/GhostlyFlicker.java +++ b/Mage.Sets/src/mage/sets/avacynrestored/GhostlyFlicker.java @@ -48,14 +48,14 @@ import java.util.UUID; public class GhostlyFlicker extends CardImpl { private static final FilterControlledPermanent filter = new FilterControlledPermanent("artifacts, creatures, and/or lands you control"); - + static { filter.getCardType().add(CardType.CREATURE); filter.getCardType().add(CardType.LAND); filter.getCardType().add(CardType.ARTIFACT); filter.setScopeCardType(Filter.ComparisonScope.Any); } - + public GhostlyFlicker(UUID ownerId) { super(ownerId, 57, "Ghostly Flicker", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{2}{U}"); this.expansionSetCode = "AVR"; diff --git a/Mage.Sets/src/mage/sets/avacynrestored/HolyJusticiar.java b/Mage.Sets/src/mage/sets/avacynrestored/HolyJusticiar.java index 2091617ef0..88692b20b3 100644 --- a/Mage.Sets/src/mage/sets/avacynrestored/HolyJusticiar.java +++ b/Mage.Sets/src/mage/sets/avacynrestored/HolyJusticiar.java @@ -64,7 +64,7 @@ public class HolyJusticiar extends CardImpl { ability.addCost(new TapSourceCost()); ability.addTarget(new TargetCreaturePermanent()); this.addAbility(ability); - + } public HolyJusticiar(final HolyJusticiar card) { @@ -78,16 +78,16 @@ public class HolyJusticiar extends CardImpl { } class HolyJusticiarEffect extends OneShotEffect { - + public HolyJusticiarEffect() { super(Outcome.Detriment); staticText = "Tap target creature. If that creature is a Zombie, exile it"; } - + public HolyJusticiarEffect(final HolyJusticiarEffect effect) { super(effect); } - + @Override public boolean apply(Game game, Ability source) { Permanent creature = game.getPermanent(source.getFirstTarget()); @@ -102,7 +102,7 @@ class HolyJusticiarEffect extends OneShotEffect { } return false; } - + @Override public HolyJusticiarEffect copy() { return new HolyJusticiarEffect(this); diff --git a/Mage.Sets/src/mage/sets/avacynrestored/KessigMalcontents.java b/Mage.Sets/src/mage/sets/avacynrestored/KessigMalcontents.java index 0c131a2a31..eea55571e7 100644 --- a/Mage.Sets/src/mage/sets/avacynrestored/KessigMalcontents.java +++ b/Mage.Sets/src/mage/sets/avacynrestored/KessigMalcontents.java @@ -46,11 +46,11 @@ import java.util.UUID; public class KessigMalcontents extends CardImpl { private static final FilterControlledPermanent filter = new FilterControlledPermanent("Humans you control"); - + static { filter.getSubtype().add("Human"); } - + public KessigMalcontents(UUID ownerId) { super(ownerId, 142, "Kessig Malcontents", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{2}{R}"); this.expansionSetCode = "AVR"; diff --git a/Mage.Sets/src/mage/sets/avacynrestored/LoneRevenant.java b/Mage.Sets/src/mage/sets/avacynrestored/LoneRevenant.java index 98395a0ee7..efee10c4d5 100644 --- a/Mage.Sets/src/mage/sets/avacynrestored/LoneRevenant.java +++ b/Mage.Sets/src/mage/sets/avacynrestored/LoneRevenant.java @@ -56,7 +56,7 @@ import mage.game.events.GameEvent; * @author jeffwadsworth */ public class LoneRevenant extends CardImpl { - + public LoneRevenant(UUID ownerId) { super(ownerId, 64, "Lone Revenant", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{3}{U}{U}"); this.expansionSetCode = "AVR"; @@ -67,7 +67,7 @@ public class LoneRevenant extends CardImpl { this.toughness = new MageInt(4); this.addAbility(HexproofAbility.getInstance()); - + // Whenever Lone Revenant deals combat damage to a player, if you control no other creatures, look at the top four cards of your library. Put one of them into your hand and the rest on the bottom of your library in any order. this.addAbility(new LoneRevenantTriggeredAbility()); } @@ -83,13 +83,13 @@ public class LoneRevenant extends CardImpl { } class LoneRevenantTriggeredAbility extends TriggeredAbilityImpl { - + private static final FilterControlledCreaturePermanent filter = new FilterControlledCreaturePermanent(); - + public LoneRevenantTriggeredAbility() { super(Zone.BATTLEFIELD, new LoneRevenantEffect()); } - + public LoneRevenantTriggeredAbility(final LoneRevenantTriggeredAbility ability) { super(ability); } @@ -105,7 +105,7 @@ class LoneRevenantTriggeredAbility extends TriggeredAbilityImpl { - + public LoneRevenantEffect() { super(Constants.Outcome.DrawCard); this.staticText = "Whenever Lone Revenant deals combat damage to a player, if you control no other creatures, look at the top four 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/sets/avacynrestored/MidvastProtector.java b/Mage.Sets/src/mage/sets/avacynrestored/MidvastProtector.java index bee7fbcfb8..ce2ef5e229 100644 --- a/Mage.Sets/src/mage/sets/avacynrestored/MidvastProtector.java +++ b/Mage.Sets/src/mage/sets/avacynrestored/MidvastProtector.java @@ -55,10 +55,10 @@ public class MidvastProtector extends CardImpl { this.toughness = new MageInt(3); // When Midvast Protector enters the battlefield, target creature you control gains protection from the color of your choice until end of turn. - EntersBattlefieldTriggeredAbility ability = new EntersBattlefieldTriggeredAbility(new GainProtectionFromColorTargetEffect(Constants.Duration.EndOfTurn), false); - ability.addTarget(new TargetControlledCreaturePermanent()); - ability.addChoice(new ChoiceColor()); - this.addAbility(ability); + EntersBattlefieldTriggeredAbility ability = new EntersBattlefieldTriggeredAbility(new GainProtectionFromColorTargetEffect(Constants.Duration.EndOfTurn), false); + ability.addTarget(new TargetControlledCreaturePermanent()); + ability.addChoice(new ChoiceColor()); + this.addAbility(ability); } public MidvastProtector(final MidvastProtector card) { diff --git a/Mage.Sets/src/mage/sets/avacynrestored/MisthollowGriffin.java b/Mage.Sets/src/mage/sets/avacynrestored/MisthollowGriffin.java index 9028e1f4b9..12ce1396c2 100644 --- a/Mage.Sets/src/mage/sets/avacynrestored/MisthollowGriffin.java +++ b/Mage.Sets/src/mage/sets/avacynrestored/MisthollowGriffin.java @@ -56,7 +56,7 @@ public class MisthollowGriffin extends CardImpl { this.toughness = new MageInt(3); this.addAbility(FlyingAbility.getInstance()); - + // You may cast Misthollow Griffin from exile. this.addAbility(new SimpleStaticAbility(Constants.Zone.EXILED, new MisthollowGriffinPlayEffect())); } @@ -72,28 +72,28 @@ public class MisthollowGriffin extends CardImpl { } class MisthollowGriffinPlayEffect extends AsThoughEffectImpl { - - public MisthollowGriffinPlayEffect() { - super(Constants.AsThoughEffectType.CAST, Constants.Duration.EndOfGame, Constants.Outcome.Benefit); - staticText = "You may cast Misthollow Griffin from exile"; - } - public MisthollowGriffinPlayEffect(final MisthollowGriffinPlayEffect effect) { - super(effect); - } + public MisthollowGriffinPlayEffect() { + super(Constants.AsThoughEffectType.CAST, Constants.Duration.EndOfGame, Constants.Outcome.Benefit); + staticText = "You may cast Misthollow Griffin from exile"; + } - @Override - public boolean apply(Game game, Ability source) { - return true; - } + public MisthollowGriffinPlayEffect(final MisthollowGriffinPlayEffect effect) { + super(effect); + } - @Override - public MisthollowGriffinPlayEffect copy() { - return new MisthollowGriffinPlayEffect(this); - } + @Override + public boolean apply(Game game, Ability source) { + return true; + } - @Override - public boolean applies(UUID sourceId, Ability source, Game game) { + @Override + public MisthollowGriffinPlayEffect copy() { + return new MisthollowGriffinPlayEffect(this); + } + + @Override + public boolean applies(UUID sourceId, Ability source, Game game) { if (sourceId.equals(source.getSourceId())) { Card card = game.getCard(source.getSourceId()); if (card != null && card.getOwnerId().equals(source.getControllerId()) && game.getState().getZone(source.getSourceId()) == Constants.Zone.EXILED) { @@ -101,5 +101,5 @@ class MisthollowGriffinPlayEffect extends AsThoughEffectImpl { this.toughness = new MageInt(1); this.addAbility(FlyingAbility.getInstance()); - + // {3}{W}: Prevent all combat damage that would be dealt to and dealt by Moonlight Geist this turn. Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new PreventCombatDamageSourceEffect(Duration.EndOfTurn), new ManaCostsImpl("{3}{W}")); ability.addEffect(new PreventCombatDamageFromSourceEffect(Duration.EndOfTurn)); diff --git a/Mage.Sets/src/mage/sets/avacynrestored/Outwit.java b/Mage.Sets/src/mage/sets/avacynrestored/Outwit.java index 3921e62a6a..cdeaf2a9c2 100644 --- a/Mage.Sets/src/mage/sets/avacynrestored/Outwit.java +++ b/Mage.Sets/src/mage/sets/avacynrestored/Outwit.java @@ -52,7 +52,7 @@ import mage.target.Target; * @author jeffwadsworth */ public class Outwit extends CardImpl { - + private static FilterSpell filter = new FilterSpell("spell that targets a player"); public Outwit(UUID ownerId) { @@ -63,7 +63,7 @@ public class Outwit extends CardImpl { // Counter target spell that targets a player. this.getSpellAbility().addEffect(new CounterTargetEffect()); - this.getSpellAbility().addTarget(new CustomTargetSpell(filter)); + this.getSpellAbility().addTarget(new CustomTargetSpell(filter)); } public Outwit(final Outwit card) { @@ -80,88 +80,88 @@ public class Outwit extends CardImpl { protected FilterSpell filter; - public CustomTargetSpell() { + public CustomTargetSpell() { this(1, 1, new FilterSpell()); - } + } - public CustomTargetSpell(FilterSpell filter) { + public CustomTargetSpell(FilterSpell filter) { this(1, 1, filter); - } + } - public CustomTargetSpell(int numTargets, FilterSpell filter) { + public CustomTargetSpell(int numTargets, FilterSpell filter) { this(numTargets, numTargets, filter); - } + } - public CustomTargetSpell(int minNumTargets, int maxNumTargets, FilterSpell filter) { + public CustomTargetSpell(int minNumTargets, int maxNumTargets, FilterSpell filter) { this.minNumberOfTargets = minNumTargets; this.maxNumberOfTargets = maxNumTargets; this.zone = Constants.Zone.STACK; this.filter = filter; this.targetName = filter.getMessage(); - } + } - public CustomTargetSpell(final CustomTargetSpell target) { + public CustomTargetSpell(final CustomTargetSpell target) { super(target); this.filter = target.filter.copy(); - } + } - @Override - public boolean canChoose(UUID sourceId, UUID sourceControllerId, Game game) { + @Override + public boolean canChoose(UUID sourceId, UUID sourceControllerId, Game game) { return canChoose(sourceControllerId, game); - } + } - @Override - public Set possibleTargets(UUID sourceId, UUID sourceControllerId, Game game) { + @Override + public Set possibleTargets(UUID sourceId, UUID sourceControllerId, Game game) { return possibleTargets(sourceControllerId, game); - } + } - @Override - public boolean canTarget(UUID id, Ability source, Game game) { + @Override + public boolean canTarget(UUID id, Ability source, Game game) { if (super.canTarget(id, source, game)) { if (targetsPlayer(id, game)) { return true; - } + } } return false; - } + } - @Override - public boolean canChoose(UUID sourceControllerId, Game game) { + @Override + public boolean canChoose(UUID sourceControllerId, Game game) { int count = 0; for (StackObject stackObject : game.getStack()) { - if (stackObject instanceof Spell && filter.match((Spell) stackObject, game)) { + if (stackObject instanceof Spell && filter.match((Spell) stackObject, game)) { if (targetsPlayer(stackObject.getId(), game)) { count++; - if (count >= this.minNumberOfTargets) + if (count >= this.minNumberOfTargets) return true; } - } + } } return false; - } + } - @Override - public Set possibleTargets(UUID sourceControllerId, Game game) { + @Override + public Set possibleTargets(UUID sourceControllerId, Game game) { Set possibleTargets = new HashSet(); for (StackObject stackObject : game.getStack()) { if (stackObject instanceof Spell && filter.match((Spell) stackObject, game)) { if (targetsPlayer(stackObject.getId(), game)) { possibleTargets.add(stackObject.getId()); } - } + } } return possibleTargets; - } + } - @Override - public Filter getFilter() { + @Override + public Filter getFilter() { return filter; - } + } - private boolean targetsPlayer(UUID id, Game game) { + private boolean targetsPlayer(UUID id, Game game) { StackObject spell = game.getStack().getStackObject(id); if (spell != null) { - Ability ability = spell.getStackAbility(); + Ability ability = spell.getStackAbility(); if (ability != null && !ability.getTargets().isEmpty()) { for (Target target : ability.getTargets()) { for (UUID playerId : target.getTargets()) { @@ -174,11 +174,11 @@ public class Outwit extends CardImpl { } } return false; - } + } - @Override - public CustomTargetSpell copy() { + @Override + public CustomTargetSpell copy() { return new CustomTargetSpell(this); - } + } } } \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/avacynrestored/PredatorsGambit.java b/Mage.Sets/src/mage/sets/avacynrestored/PredatorsGambit.java index 39d8bf97ad..ff8d75ca3b 100644 --- a/Mage.Sets/src/mage/sets/avacynrestored/PredatorsGambit.java +++ b/Mage.Sets/src/mage/sets/avacynrestored/PredatorsGambit.java @@ -52,7 +52,7 @@ import java.util.UUID; public class PredatorsGambit extends CardImpl { private static final String rule = "Enchanted creature has intimidate as long as its controller controls no other creatures"; - + public PredatorsGambit(UUID ownerId) { super(ownerId, 117, "Predator's Gambit", Rarity.COMMON, new CardType[]{CardType.ENCHANTMENT}, "{B}"); this.expansionSetCode = "AVR"; diff --git a/Mage.Sets/src/mage/sets/avacynrestored/RidersOfGavony.java b/Mage.Sets/src/mage/sets/avacynrestored/RidersOfGavony.java index 2fd1cfc731..1d2e634aa0 100644 --- a/Mage.Sets/src/mage/sets/avacynrestored/RidersOfGavony.java +++ b/Mage.Sets/src/mage/sets/avacynrestored/RidersOfGavony.java @@ -126,7 +126,7 @@ class RidersOfGavonyGainAbilityControlledEffect extends ContinuousEffectImpl { TargetPermanent auraTarget = new TargetCreaturePermanent(); this.getSpellAbility().addTarget(auraTarget); this.getSpellAbility().addEffect(new AttachEffect(Constants.Outcome.Detriment)); - + // Enchanted creature doesn't untap during its controller's untap step. Ability ability = new EnchantAbility(auraTarget.getTargetName()); this.addAbility(ability); diff --git a/Mage.Sets/src/mage/sets/avacynrestored/StolenGoods.java b/Mage.Sets/src/mage/sets/avacynrestored/StolenGoods.java index 02dfb2010b..203466892e 100644 --- a/Mage.Sets/src/mage/sets/avacynrestored/StolenGoods.java +++ b/Mage.Sets/src/mage/sets/avacynrestored/StolenGoods.java @@ -112,7 +112,7 @@ class StolenGoodsEffect extends OneShotEffect { class StolenGoodsCastFromExileEffect extends AsThoughEffectImpl { private UUID cardId; - + public StolenGoodsCastFromExileEffect(UUID cardId) { super(Constants.AsThoughEffectType.CAST, Constants.Duration.EndOfTurn, Constants.Outcome.Benefit); staticText = "You may cast card from exile"; diff --git a/Mage.Sets/src/mage/sets/avacynrestored/TriumphOfCruelty.java b/Mage.Sets/src/mage/sets/avacynrestored/TriumphOfCruelty.java index 0bf96eda57..9e8d798db5 100644 --- a/Mage.Sets/src/mage/sets/avacynrestored/TriumphOfCruelty.java +++ b/Mage.Sets/src/mage/sets/avacynrestored/TriumphOfCruelty.java @@ -48,7 +48,7 @@ import java.util.UUID; public class TriumphOfCruelty extends CardImpl { private static final String ruleText = "target opponent discards a card if you control the creature with the greatest power or tied for the greatest power"; - + public TriumphOfCruelty(UUID ownerId) { super(ownerId, 122, "Triumph of Cruelty", Rarity.UNCOMMON, new CardType[]{CardType.ENCHANTMENT}, "{2}{B}"); this.expansionSetCode = "AVR"; diff --git a/Mage.Sets/src/mage/sets/avacynrestored/TrustedForcemage.java b/Mage.Sets/src/mage/sets/avacynrestored/TrustedForcemage.java index e560bf88af..2686698b7b 100644 --- a/Mage.Sets/src/mage/sets/avacynrestored/TrustedForcemage.java +++ b/Mage.Sets/src/mage/sets/avacynrestored/TrustedForcemage.java @@ -44,7 +44,7 @@ import java.util.UUID; public class TrustedForcemage extends CardImpl { private static final String ruleText = "As long as {this} is paired with another creature, each of those creatures gets +1/+1"; - + public TrustedForcemage(UUID ownerId) { super(ownerId, 199, "Trusted Forcemage", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{2}{G}"); this.expansionSetCode = "AVR"; diff --git a/Mage.Sets/src/mage/sets/betrayersofkamigawa/AkkiBlizzardHerder.java b/Mage.Sets/src/mage/sets/betrayersofkamigawa/AkkiBlizzardHerder.java index 1a377a71bb..146488e203 100644 --- a/Mage.Sets/src/mage/sets/betrayersofkamigawa/AkkiBlizzardHerder.java +++ b/Mage.Sets/src/mage/sets/betrayersofkamigawa/AkkiBlizzardHerder.java @@ -47,7 +47,7 @@ public class AkkiBlizzardHerder extends CardImpl { static { filter.getCardType().add(CardType.LAND); } - + public AkkiBlizzardHerder(UUID ownerId) { super(ownerId, 91, "Akki Blizzard-Herder", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{1}{R}"); this.expansionSetCode = "BOK"; diff --git a/Mage.Sets/src/mage/sets/betrayersofkamigawa/BakuAltar.java b/Mage.Sets/src/mage/sets/betrayersofkamigawa/BakuAltar.java index 8b37134ac4..777557e2a6 100644 --- a/Mage.Sets/src/mage/sets/betrayersofkamigawa/BakuAltar.java +++ b/Mage.Sets/src/mage/sets/betrayersofkamigawa/BakuAltar.java @@ -52,7 +52,7 @@ import mage.game.permanent.token.SpiritToken; public class BakuAltar extends CardImpl { private final static FilterSpiritOrArcaneCard filter = new FilterSpiritOrArcaneCard(); - + public BakuAltar(UUID ownerId) { super(ownerId, 152, "Baku Altar", Rarity.RARE, new CardType[]{CardType.ARTIFACT}, "{2}"); this.expansionSetCode = "BOK"; diff --git a/Mage.Sets/src/mage/sets/betrayersofkamigawa/KamiOfTatteredShoji.java b/Mage.Sets/src/mage/sets/betrayersofkamigawa/KamiOfTatteredShoji.java index 090bcd859e..bbda343317 100644 --- a/Mage.Sets/src/mage/sets/betrayersofkamigawa/KamiOfTatteredShoji.java +++ b/Mage.Sets/src/mage/sets/betrayersofkamigawa/KamiOfTatteredShoji.java @@ -46,7 +46,7 @@ import mage.filter.common.FilterSpiritOrArcaneCard; public class KamiOfTatteredShoji extends CardImpl { private final static FilterSpiritOrArcaneCard filter = new FilterSpiritOrArcaneCard(); - + public KamiOfTatteredShoji(UUID ownerId) { super(ownerId, 11, "Kami of Tattered Shoji", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{4}{W}"); this.expansionSetCode = "BOK"; diff --git a/Mage.Sets/src/mage/sets/betrayersofkamigawa/KamiOfTheHonoredDead.java b/Mage.Sets/src/mage/sets/betrayersofkamigawa/KamiOfTheHonoredDead.java index f6b866b577..4a9acd5152 100644 --- a/Mage.Sets/src/mage/sets/betrayersofkamigawa/KamiOfTheHonoredDead.java +++ b/Mage.Sets/src/mage/sets/betrayersofkamigawa/KamiOfTheHonoredDead.java @@ -79,32 +79,32 @@ public class KamiOfTheHonoredDead extends CardImpl { class KamiOfTheHonoredDeadTriggeredAbility extends TriggeredAbilityImpl { - public KamiOfTheHonoredDeadTriggeredAbility() { - super(Constants.Zone.BATTLEFIELD, new KamiOfTheHonoredDeadGainLifeEffect()); - } + public KamiOfTheHonoredDeadTriggeredAbility() { + super(Constants.Zone.BATTLEFIELD, new KamiOfTheHonoredDeadGainLifeEffect()); + } - public KamiOfTheHonoredDeadTriggeredAbility(final KamiOfTheHonoredDeadTriggeredAbility effect) { - super(effect); - } + public KamiOfTheHonoredDeadTriggeredAbility(final KamiOfTheHonoredDeadTriggeredAbility effect) { + super(effect); + } - @Override - public KamiOfTheHonoredDeadTriggeredAbility copy() { - return new KamiOfTheHonoredDeadTriggeredAbility(this); - } + @Override + public KamiOfTheHonoredDeadTriggeredAbility copy() { + return new KamiOfTheHonoredDeadTriggeredAbility(this); + } - @Override - public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == GameEvent.EventType.DAMAGED_CREATURE && event.getTargetId().equals(this.sourceId)) { + @Override + public boolean checkTrigger(GameEvent event, Game game) { + if (event.getType() == GameEvent.EventType.DAMAGED_CREATURE && event.getTargetId().equals(this.sourceId)) { this.getEffects().get(0).setValue("damageAmount", event.getAmount()); return true; - } - return false; - } + } + return false; + } - @Override - public String getRule() { - return "Whenever {this} is dealt damage, " + super.getRule(); - } + @Override + public String getRule() { + return "Whenever {this} is dealt damage, " + super.getRule(); + } } @@ -115,23 +115,23 @@ class KamiOfTheHonoredDeadGainLifeEffect extends OneShotEffect { private final static FilterSpiritOrArcaneCard filter = new FilterSpiritOrArcaneCard(); - + public OyobiWhoSplitTheHeavens(UUID ownerId) { super(ownerId, 18, "Oyobi, Who Split the Heavens", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{6}{W}"); this.expansionSetCode = "BOK"; diff --git a/Mage.Sets/src/mage/sets/betrayersofkamigawa/ScaledHulk.java b/Mage.Sets/src/mage/sets/betrayersofkamigawa/ScaledHulk.java index 95e3cd58f4..ecf89dc224 100644 --- a/Mage.Sets/src/mage/sets/betrayersofkamigawa/ScaledHulk.java +++ b/Mage.Sets/src/mage/sets/betrayersofkamigawa/ScaledHulk.java @@ -45,7 +45,7 @@ import mage.filter.common.FilterSpiritOrArcaneCard; public class ScaledHulk extends CardImpl { private final static FilterSpiritOrArcaneCard filter = new FilterSpiritOrArcaneCard(); - + public ScaledHulk(UUID ownerId) { super(ownerId, 143, "Scaled Hulk", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{5}{G}"); this.expansionSetCode = "BOK"; diff --git a/Mage.Sets/src/mage/sets/championsofkamigawa/AkkiCoalflinger.java b/Mage.Sets/src/mage/sets/championsofkamigawa/AkkiCoalflinger.java index 3887354c1a..0627346c87 100644 --- a/Mage.Sets/src/mage/sets/championsofkamigawa/AkkiCoalflinger.java +++ b/Mage.Sets/src/mage/sets/championsofkamigawa/AkkiCoalflinger.java @@ -55,7 +55,7 @@ public class AkkiCoalflinger extends CardImpl { this.expansionSetCode = "CHK"; this.subtype.add("Goblin"); this.subtype.add("Shaman"); - this.color.setRed(true); + this.color.setRed(true); this.power = new MageInt(2); this.toughness = new MageInt(2); this.addAbility(FirstStrikeAbility.getInstance()); diff --git a/Mage.Sets/src/mage/sets/championsofkamigawa/AkkiUnderminer.java b/Mage.Sets/src/mage/sets/championsofkamigawa/AkkiUnderminer.java index 6bfe3a4df9..e17603147d 100644 --- a/Mage.Sets/src/mage/sets/championsofkamigawa/AkkiUnderminer.java +++ b/Mage.Sets/src/mage/sets/championsofkamigawa/AkkiUnderminer.java @@ -56,7 +56,7 @@ public class AkkiUnderminer extends CardImpl { this.subtype.add("Goblin"); this.subtype.add("Rogue"); this.subtype.add("Shaman"); - this.color.setRed(true); + this.color.setRed(true); this.power = new MageInt(1); this.toughness = new MageInt(1); this.addAbility(new AkkiUnderminerAbility()); @@ -96,7 +96,7 @@ class AkkiUnderminerAbility extends TriggeredAbilityImpl for (Effect effect : this.getEffects()) { effect.setTargetPointer(new FixedTarget(event.getPlayerId())); } - return true; + return true; } } return false; diff --git a/Mage.Sets/src/mage/sets/championsofkamigawa/AzusaLostButSeeking.java b/Mage.Sets/src/mage/sets/championsofkamigawa/AzusaLostButSeeking.java index b680fc7297..d772a27d10 100644 --- a/Mage.Sets/src/mage/sets/championsofkamigawa/AzusaLostButSeeking.java +++ b/Mage.Sets/src/mage/sets/championsofkamigawa/AzusaLostButSeeking.java @@ -50,7 +50,7 @@ public class AzusaLostButSeeking extends CardImpl { this.supertype.add("Legendary"); this.subtype.add("Human"); this.subtype.add("Monk"); - this.color.setGreen(true); + this.color.setGreen(true); this.power = new MageInt(1); this.toughness = new MageInt(2); this.addAbility(new SimpleStaticAbility(Constants.Zone.BATTLEFIELD, new PlayAdditionalLandsControllerEffect(2, Constants.Duration.WhileOnBattlefield))); diff --git a/Mage.Sets/src/mage/sets/championsofkamigawa/BattleMadRonin.java b/Mage.Sets/src/mage/sets/championsofkamigawa/BattleMadRonin.java index 0f88df6a47..47599b28e5 100644 --- a/Mage.Sets/src/mage/sets/championsofkamigawa/BattleMadRonin.java +++ b/Mage.Sets/src/mage/sets/championsofkamigawa/BattleMadRonin.java @@ -47,7 +47,7 @@ public class BattleMadRonin extends CardImpl { this.expansionSetCode = "CHK"; this.subtype.add("Human"); this.subtype.add("Samurai"); - this.color.setRed(true); + this.color.setRed(true); this.power = new MageInt(1); this.toughness = new MageInt(1); this.addAbility(new BushidoAbility(2)); diff --git a/Mage.Sets/src/mage/sets/championsofkamigawa/Befoul.java b/Mage.Sets/src/mage/sets/championsofkamigawa/Befoul.java index a1aa9b21b8..7d4d99523a 100644 --- a/Mage.Sets/src/mage/sets/championsofkamigawa/Befoul.java +++ b/Mage.Sets/src/mage/sets/championsofkamigawa/Befoul.java @@ -46,7 +46,7 @@ import mage.target.TargetPermanent; public class Befoul extends CardImpl { public static final FilterPermanent filter = new FilterPermanent("land or nonblack creature"); - + static { filter.getCardType().add(CardType.LAND); filter.getCardType().add(CardType.CREATURE); diff --git a/Mage.Sets/src/mage/sets/championsofkamigawa/BloodthirstyOgre.java b/Mage.Sets/src/mage/sets/championsofkamigawa/BloodthirstyOgre.java index 39adb244d0..cfaf5d97d8 100644 --- a/Mage.Sets/src/mage/sets/championsofkamigawa/BloodthirstyOgre.java +++ b/Mage.Sets/src/mage/sets/championsofkamigawa/BloodthirstyOgre.java @@ -54,13 +54,13 @@ import mage.target.common.TargetCreaturePermanent; * @author LevelX */ public class BloodthirstyOgre extends CardImpl { - + private static final FilterControlledPermanent filter = new FilterControlledPermanent("Demon"); static { filter.getSubtype().add("Demon"); filter.setScopeSubtype(Filter.ComparisonScope.Any); } - + public BloodthirstyOgre(UUID ownerId) { super(ownerId, 104, "Bloodthirsty Ogre", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{2}{B}"); this.expansionSetCode = "CHK"; @@ -91,5 +91,5 @@ public class BloodthirstyOgre extends CardImpl { public BloodthirstyOgre copy() { return new BloodthirstyOgre(this); } - + } \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/championsofkamigawa/BrutalDeceiver.java b/Mage.Sets/src/mage/sets/championsofkamigawa/BrutalDeceiver.java index e5df9e91fc..815b2c459e 100644 --- a/Mage.Sets/src/mage/sets/championsofkamigawa/BrutalDeceiver.java +++ b/Mage.Sets/src/mage/sets/championsofkamigawa/BrutalDeceiver.java @@ -66,10 +66,10 @@ public class BrutalDeceiver extends CardImpl { this.color.setRed(true); this.power = new MageInt(2); this.toughness = new MageInt(2); - + // {1}: Look at the top card of your library. this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new LookLibraryControllerEffect(), new GenericManaCost(1))); - + // {2}: Reveal the top card of your library. If it's a land card, {this} gets +1/+0 and gains first strike until end of turn. Ability ability = new BrutalDeceiverAbility(Zone.BATTLEFIELD, new BoostSourceEffect(1,0,Duration.EndOfTurn), new ManaCostsImpl("{2}")); ability.addEffect(new GainAbilitySourceEffect(FirstStrikeAbility.getInstance(),Duration.EndOfTurn)); @@ -79,7 +79,7 @@ public class BrutalDeceiver extends CardImpl { public BrutalDeceiver(final BrutalDeceiver card) { super(card); } - + @Override public BrutalDeceiver copy() { return new BrutalDeceiver(this); @@ -87,22 +87,22 @@ public class BrutalDeceiver extends CardImpl { } class BrutalDeceiverAbility extends ActivateOncePerTurnActivatedAbility { - + public BrutalDeceiverAbility(Zone zone, Effect effect, Cost cost) { - super(zone, effect, cost); - } + super(zone, effect, cost); + } public BrutalDeceiverAbility(BrutalDeceiverAbility ability) { - super(ability); - } - + super(ability); + } + @Override public BrutalDeceiverAbility copy() { return new BrutalDeceiverAbility(this); } - + @Override - public boolean checkIfClause(Game game) { + public boolean checkIfClause(Game game) { Player player = game.getPlayer(this.getControllerId()); if (player != null) { Cards cards = new CardsImpl(); @@ -113,11 +113,11 @@ class BrutalDeceiverAbility extends ActivateOncePerTurnActivatedAbility { return true; } } - return false; + return false; } - + @Override - public String getRule() { - return "{2}: Reveal the top card of your library. If it's a land card, {this} gets +1/+0 and gains first strike until end of turn. Activate this ability only once each turn."; - } + public String getRule() { + return "{2}: Reveal the top card of your library. If it's a land card, {this} gets +1/+0 and gains first strike until end of turn. Activate this ability only once each turn."; + } } diff --git a/Mage.Sets/src/mage/sets/championsofkamigawa/CageOfHands.java b/Mage.Sets/src/mage/sets/championsofkamigawa/CageOfHands.java index 87eb7debcd..1f501a0ad7 100644 --- a/Mage.Sets/src/mage/sets/championsofkamigawa/CageOfHands.java +++ b/Mage.Sets/src/mage/sets/championsofkamigawa/CageOfHands.java @@ -57,12 +57,12 @@ public class CageOfHands extends CardImpl { super(ownerId, 3, "Cage of Hands", Rarity.COMMON, new CardType[]{CardType.ENCHANTMENT}, "{2}{W}"); this.expansionSetCode = "CHK"; this.subtype.add("Aura"); - this.color.setWhite(true); + this.color.setWhite(true); TargetPermanent auraTarget = new TargetCreaturePermanent(); - this.getSpellAbility().addTarget(auraTarget); - this.getSpellAbility().addEffect(new AttachEffect(Constants.Outcome.Neutral)); - Ability ability = new EnchantAbility(auraTarget.getTargetName()); - this.addAbility(ability); + this.getSpellAbility().addTarget(auraTarget); + this.getSpellAbility().addEffect(new AttachEffect(Constants.Outcome.Neutral)); + Ability ability = new EnchantAbility(auraTarget.getTargetName()); + this.addAbility(ability); this.addAbility(new SimpleStaticAbility(Constants.Zone.BATTLEFIELD, new CageOfHandsEffect())); this.addAbility(new SimpleActivatedAbility(Constants.Zone.BATTLEFIELD, new ReturnToHandSourceEffect(), new ManaCostsImpl("{1}{W}"))); } @@ -79,36 +79,36 @@ public class CageOfHands extends CardImpl { class CageOfHandsEffect extends RestrictionEffect { - public CageOfHandsEffect() { - super(Constants.Duration.WhileOnBattlefield); - staticText = "Enchanted creature can't attack or block"; - } + public CageOfHandsEffect() { + super(Constants.Duration.WhileOnBattlefield); + staticText = "Enchanted creature can't attack or block"; + } - public CageOfHandsEffect(final CageOfHandsEffect effect) { - super(effect); - } + public CageOfHandsEffect(final CageOfHandsEffect effect) { + super(effect); + } - @Override - public boolean applies(Permanent permanent, Ability source, Game game) { - if (permanent.getAttachments().contains((source.getSourceId()))) { - return true; - } - return false; - } + @Override + public boolean applies(Permanent permanent, Ability source, Game game) { + if (permanent.getAttachments().contains((source.getSourceId()))) { + return true; + } + return false; + } - @Override - public boolean canAttack(Game game) { - return false; - } + @Override + public boolean canAttack(Game game) { + return false; + } - @Override - public boolean canBlock(Permanent attacker, Permanent blocker, Ability source, Game game) { - return false; - } + @Override + public boolean canBlock(Permanent attacker, Permanent blocker, Ability source, Game game) { + return false; + } - @Override - public CageOfHandsEffect copy() { - return new CageOfHandsEffect(this); - } + @Override + public CageOfHandsEffect copy() { + return new CageOfHandsEffect(this); + } } diff --git a/Mage.Sets/src/mage/sets/championsofkamigawa/CallousDeceiver.java b/Mage.Sets/src/mage/sets/championsofkamigawa/CallousDeceiver.java index d58ac98740..b0dc4ba816 100644 --- a/Mage.Sets/src/mage/sets/championsofkamigawa/CallousDeceiver.java +++ b/Mage.Sets/src/mage/sets/championsofkamigawa/CallousDeceiver.java @@ -68,7 +68,7 @@ public class CallousDeceiver extends CardImpl { this.toughness = new MageInt(3); // {1}: Look at the top card of your library. this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new LookLibraryControllerEffect(), new GenericManaCost(1))); - + // {2}: Reveal the top card of your library. If it's a land card, {this} gets +1/+0 and gains flying until end of turn. Ability ability = new CallousDeceiverAbility(Zone.BATTLEFIELD, new BoostSourceEffect(1,0,Duration.EndOfTurn), new ManaCostsImpl("{2}")); ability.addEffect(new GainAbilitySourceEffect(FlyingAbility.getInstance(),Duration.EndOfTurn)); @@ -78,7 +78,7 @@ public class CallousDeceiver extends CardImpl { public CallousDeceiver(final CallousDeceiver card) { super(card); } - + @Override public CallousDeceiver copy() { return new CallousDeceiver(this); @@ -87,22 +87,22 @@ public class CallousDeceiver extends CardImpl { } class CallousDeceiverAbility extends ActivateOncePerTurnActivatedAbility { - + public CallousDeceiverAbility(Zone zone, Effect effect, Cost cost) { - super(zone, effect, cost); - } + super(zone, effect, cost); + } public CallousDeceiverAbility(CallousDeceiverAbility ability) { - super(ability); - } - + super(ability); + } + @Override public CallousDeceiverAbility copy() { return new CallousDeceiverAbility(this); } - + @Override - public boolean checkIfClause(Game game) { + public boolean checkIfClause(Game game) { Player player = game.getPlayer(this.getControllerId()); if (player != null) { Cards cards = new CardsImpl(); @@ -113,11 +113,11 @@ class CallousDeceiverAbility extends ActivateOncePerTurnActivatedAbility { return true; } } - return false; + return false; } - + @Override - public String getRule() { - return "{2}: Reveal the top card of your library. If it's a land card, {this} gets +1/+0 and gains flying until end of turn. Activate this ability only once each turn."; - } + public String getRule() { + return "{2}: Reveal the top card of your library. If it's a land card, {this} gets +1/+0 and gains flying until end of turn. Activate this ability only once each turn."; + } } \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/championsofkamigawa/CommuneWithNature.java b/Mage.Sets/src/mage/sets/championsofkamigawa/CommuneWithNature.java index 756075d088..e12e433a1d 100644 --- a/Mage.Sets/src/mage/sets/championsofkamigawa/CommuneWithNature.java +++ b/Mage.Sets/src/mage/sets/championsofkamigawa/CommuneWithNature.java @@ -51,8 +51,8 @@ public class CommuneWithNature extends CardImpl { public CommuneWithNature (UUID ownerId) { super(ownerId, 204, "Commune with Nature", Rarity.COMMON, new CardType[]{CardType.SORCERY}, "{G}"); this.expansionSetCode = "CHK"; - this.color.setGreen(true); - + this.color.setGreen(true); + // Look at the top five cards of your library. You may reveal a creature card from among them and put it into your hand. Put the rest on the bottom of your library in any order. this.getSpellAbility().addEffect(new LookLibraryAndPickControllerEffect(new StaticValue(5), false, new StaticValue(1), filter, false)); } diff --git a/Mage.Sets/src/mage/sets/championsofkamigawa/CounselOfTheSoratami.java b/Mage.Sets/src/mage/sets/championsofkamigawa/CounselOfTheSoratami.java index 8edc802ca0..81929c1e89 100644 --- a/Mage.Sets/src/mage/sets/championsofkamigawa/CounselOfTheSoratami.java +++ b/Mage.Sets/src/mage/sets/championsofkamigawa/CounselOfTheSoratami.java @@ -43,7 +43,7 @@ public class CounselOfTheSoratami extends CardImpl { public CounselOfTheSoratami (UUID ownerId) { super(ownerId, 55, "Counsel of the Soratami", Rarity.COMMON, new CardType[]{CardType.SORCERY}, "{2}{U}"); this.expansionSetCode = "CHK"; - this.color.setBlue(true); + this.color.setBlue(true); this.getSpellAbility().addEffect(new DrawCardControllerEffect(2)); } diff --git a/Mage.Sets/src/mage/sets/championsofkamigawa/CranialExtraction.java b/Mage.Sets/src/mage/sets/championsofkamigawa/CranialExtraction.java index e579a8e8e2..1a46b1a913 100644 --- a/Mage.Sets/src/mage/sets/championsofkamigawa/CranialExtraction.java +++ b/Mage.Sets/src/mage/sets/championsofkamigawa/CranialExtraction.java @@ -50,80 +50,80 @@ import mage.target.TargetPlayer; */ public class CranialExtraction extends CardImpl { - public CranialExtraction(UUID ownerId) { - super(ownerId, 105, "Cranial Extraction", Rarity.RARE, new CardType[]{CardType.SORCERY}, "{3}{B}"); - this.expansionSetCode = "CHK"; + public CranialExtraction(UUID ownerId) { + super(ownerId, 105, "Cranial Extraction", Rarity.RARE, new CardType[]{CardType.SORCERY}, "{3}{B}"); + this.expansionSetCode = "CHK"; this.subtype.add("Arcane"); - this.color.setBlack(true); + this.color.setBlack(true); /* Name a nonland card. Search target player's graveyard, hand, and library for * all cards with that name and exile them. Then that player shuffles his or her library. */ - this.getSpellAbility().addTarget(new TargetPlayer()); - this.getSpellAbility().addEffect(new CranialExtractionEffect()); - } + this.getSpellAbility().addTarget(new TargetPlayer()); + this.getSpellAbility().addEffect(new CranialExtractionEffect()); + } - public CranialExtraction(final CranialExtraction card) { - super(card); - } + public CranialExtraction(final CranialExtraction card) { + super(card); + } - @Override - public CranialExtraction copy() { - return new CranialExtraction(this); - } + @Override + public CranialExtraction copy() { + return new CranialExtraction(this); + } } class CranialExtractionEffect extends OneShotEffect { - - public CranialExtractionEffect() { - super(Outcome.Exile); - staticText = "Name a nonland card. Search target player's graveyard, hand, and library for all cards with that name and exile them. Then that player shuffles his or her library"; - } - - public CranialExtractionEffect(final CranialExtractionEffect effect) { - super(effect); - } - @Override - public boolean apply(Game game, Ability source) { - Player player = game.getPlayer(targetPointer.getFirst(game, source)); - Player controller = game.getPlayer(source.getControllerId()); - if (player != null && controller != null) { - Choice cardChoice = new ChoiceImpl(); - cardChoice.setChoices(Sets.getNonLandCardNames()); - cardChoice.clearChoice(); + public CranialExtractionEffect() { + super(Outcome.Exile); + staticText = "Name a nonland card. Search target player's graveyard, hand, and library for all cards with that name and exile them. Then that player shuffles his or her library"; + } + + public CranialExtractionEffect(final CranialExtractionEffect effect) { + super(effect); + } + + @Override + public boolean apply(Game game, Ability source) { + Player player = game.getPlayer(targetPointer.getFirst(game, source)); + Player controller = game.getPlayer(source.getControllerId()); + if (player != null && controller != null) { + Choice cardChoice = new ChoiceImpl(); + cardChoice.setChoices(Sets.getNonLandCardNames()); + cardChoice.clearChoice(); while (!controller.choose(Outcome.Exile, cardChoice, game)) { game.debugMessage("player canceled choosing name. retrying."); } - String cardName = cardChoice.getChoice(); + String cardName = cardChoice.getChoice(); game.informPlayers("CranialExtraction, named card: [" + cardName + "]"); - for (Card card: player.getGraveyard().getCards(game)) { - if (card.getName().equals(cardName)) { - card.moveToExile(null, "", source.getId(), game); - } - } - for (Card card: player.getHand().getCards(game)) { - if (card.getName().equals(cardName)) { - card.moveToExile(null, "", source.getId(), game); - } - } - for (Card card: player.getLibrary().getCards(game)) { - if (card.getName().equals(cardName)) { - card.moveToExile(null, "", source.getId(), game); - } - } - controller.lookAtCards("CranialExtraction Hand", player.getHand(), game); - controller.lookAtCards("CranialExtraction Library", new CardsImpl(Zone.PICK, player.getLibrary().getCards(game)), game); - player.shuffleLibrary(game); - } - return true; - } + for (Card card: player.getGraveyard().getCards(game)) { + if (card.getName().equals(cardName)) { + card.moveToExile(null, "", source.getId(), game); + } + } + for (Card card: player.getHand().getCards(game)) { + if (card.getName().equals(cardName)) { + card.moveToExile(null, "", source.getId(), game); + } + } + for (Card card: player.getLibrary().getCards(game)) { + if (card.getName().equals(cardName)) { + card.moveToExile(null, "", source.getId(), game); + } + } + controller.lookAtCards("CranialExtraction Hand", player.getHand(), game); + controller.lookAtCards("CranialExtraction Library", new CardsImpl(Zone.PICK, player.getLibrary().getCards(game)), game); + player.shuffleLibrary(game); + } + return true; + } + + @Override + public CranialExtractionEffect copy() { + return new CranialExtractionEffect(this); + } - @Override - public CranialExtractionEffect copy() { - return new CranialExtractionEffect(this); - } - } \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/championsofkamigawa/CrushingPain.java b/Mage.Sets/src/mage/sets/championsofkamigawa/CrushingPain.java index ac988e3ea7..4cb59ee211 100644 --- a/Mage.Sets/src/mage/sets/championsofkamigawa/CrushingPain.java +++ b/Mage.Sets/src/mage/sets/championsofkamigawa/CrushingPain.java @@ -53,7 +53,7 @@ public class CrushingPain extends CardImpl { super(ownerId, 162, "Crushing Pain", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{1}{R}"); this.expansionSetCode = "CHK"; this.color.setRed(true); - + // Crushing Pain deals 6 damage to target creature that was dealt damage this turn. this.getSpellAbility().addEffect(new DamageTargetEffect(6)); this.getSpellAbility().addTarget(new TargetCreaturePermanent(filter)); diff --git a/Mage.Sets/src/mage/sets/championsofkamigawa/CursedRonin.java b/Mage.Sets/src/mage/sets/championsofkamigawa/CursedRonin.java index e422f3bf83..7ca1a63a3e 100644 --- a/Mage.Sets/src/mage/sets/championsofkamigawa/CursedRonin.java +++ b/Mage.Sets/src/mage/sets/championsofkamigawa/CursedRonin.java @@ -51,7 +51,7 @@ public class CursedRonin extends CardImpl { this.expansionSetCode = "CHK"; this.subtype.add("Human"); this.subtype.add("Samurai"); - this.color.setBlack(true); + this.color.setBlack(true); this.power = new MageInt(1); this.toughness = new MageInt(1); this.addAbility(new BushidoAbility(1)); diff --git a/Mage.Sets/src/mage/sets/championsofkamigawa/DanceOfShadows.java b/Mage.Sets/src/mage/sets/championsofkamigawa/DanceOfShadows.java index 3fda688f84..0b78964bc1 100644 --- a/Mage.Sets/src/mage/sets/championsofkamigawa/DanceOfShadows.java +++ b/Mage.Sets/src/mage/sets/championsofkamigawa/DanceOfShadows.java @@ -48,7 +48,7 @@ public class DanceOfShadows extends CardImpl { super(ownerId, 108, "Dance of Shadows", Rarity.UNCOMMON, new CardType[]{CardType.SORCERY}, "{3}{B}{B}"); this.expansionSetCode = "CHK"; this.subtype.add("Arcane"); - this.color.setBlack(true); + this.color.setBlack(true); this.getSpellAbility().addEffect(new BoostControlledEffect(1, 0, Constants.Duration.EndOfTurn)); this.getSpellAbility().addEffect(new GainAbilityControlledEffect(FearAbility.getInstance(), Constants.Duration.EndOfTurn)); } diff --git a/Mage.Sets/src/mage/sets/championsofkamigawa/DeathcurseOgre.java b/Mage.Sets/src/mage/sets/championsofkamigawa/DeathcurseOgre.java index 1d475fdbad..7a1ca438b8 100644 --- a/Mage.Sets/src/mage/sets/championsofkamigawa/DeathcurseOgre.java +++ b/Mage.Sets/src/mage/sets/championsofkamigawa/DeathcurseOgre.java @@ -48,7 +48,7 @@ public class DeathcurseOgre extends CardImpl { this.expansionSetCode = "CHK"; this.subtype.add("Ogre"); this.subtype.add("Warrior"); - this.color.setBlack(true); + this.color.setBlack(true); this.power = new MageInt(3); this.toughness = new MageInt(3); this.addAbility(new DiesTriggeredAbility(new LoseLifePlayersEffect(3))); diff --git a/Mage.Sets/src/mage/sets/championsofkamigawa/DevotedRetainer.java b/Mage.Sets/src/mage/sets/championsofkamigawa/DevotedRetainer.java index 67162bab34..b77a9fdbc6 100644 --- a/Mage.Sets/src/mage/sets/championsofkamigawa/DevotedRetainer.java +++ b/Mage.Sets/src/mage/sets/championsofkamigawa/DevotedRetainer.java @@ -46,7 +46,7 @@ public class DevotedRetainer extends CardImpl { this.expansionSetCode = "CHK"; this.subtype.add("Human"); this.subtype.add("Samurai"); - this.color.setWhite(true); + this.color.setWhite(true); this.power = new MageInt(1); this.toughness = new MageInt(1); this.addAbility(new BushidoAbility(1)); diff --git a/Mage.Sets/src/mage/sets/championsofkamigawa/DrippingTongueZubera.java b/Mage.Sets/src/mage/sets/championsofkamigawa/DrippingTongueZubera.java index cdbf1fc9ce..2501621155 100644 --- a/Mage.Sets/src/mage/sets/championsofkamigawa/DrippingTongueZubera.java +++ b/Mage.Sets/src/mage/sets/championsofkamigawa/DrippingTongueZubera.java @@ -49,7 +49,7 @@ public class DrippingTongueZubera extends CardImpl { this.expansionSetCode = "CHK"; this.subtype.add("Zubera"); this.subtype.add("Spirit"); - this.color.setGreen(true); + this.color.setGreen(true); this.power = new MageInt(1); this.toughness = new MageInt(2); this.addAbility(new DiesTriggeredAbility(new CreateTokenEffect(new SpiritToken(), new ZuberasDiedDynamicValue()), false)); diff --git a/Mage.Sets/src/mage/sets/championsofkamigawa/EightAndAHalfTale.java b/Mage.Sets/src/mage/sets/championsofkamigawa/EightAndAHalfTale.java index d8ba337399..10047d3074 100644 --- a/Mage.Sets/src/mage/sets/championsofkamigawa/EightAndAHalfTale.java +++ b/Mage.Sets/src/mage/sets/championsofkamigawa/EightAndAHalfTale.java @@ -78,7 +78,7 @@ public class EightAndAHalfTale extends CardImpl { ObjectColor.WHITE, Constants.Duration.EndOfTurn),new ManaCostsImpl("{1}")); ability2.addTarget(new TargetSpellOrPermanent()); this.addAbility(ability2); - + } public EightAndAHalfTale(final EightAndAHalfTale card) { diff --git a/Mage.Sets/src/mage/sets/championsofkamigawa/EmberFistZubera.java b/Mage.Sets/src/mage/sets/championsofkamigawa/EmberFistZubera.java index d7c5767c98..d5564dce91 100644 --- a/Mage.Sets/src/mage/sets/championsofkamigawa/EmberFistZubera.java +++ b/Mage.Sets/src/mage/sets/championsofkamigawa/EmberFistZubera.java @@ -50,7 +50,7 @@ public class EmberFistZubera extends CardImpl { this.expansionSetCode = "CHK"; this.subtype.add("Zubera"); this.subtype.add("Spirit"); - this.color.setRed(true); + this.color.setRed(true); this.power = new MageInt(1); this.toughness = new MageInt(2); Ability ability = new DiesTriggeredAbility(new DamageTargetEffect(new ZuberasDiedDynamicValue())); diff --git a/Mage.Sets/src/mage/sets/championsofkamigawa/EtherealHaze.java b/Mage.Sets/src/mage/sets/championsofkamigawa/EtherealHaze.java index 50a6b6a6d8..962b24defe 100644 --- a/Mage.Sets/src/mage/sets/championsofkamigawa/EtherealHaze.java +++ b/Mage.Sets/src/mage/sets/championsofkamigawa/EtherealHaze.java @@ -45,11 +45,11 @@ public class EtherealHaze extends CardImpl { public EtherealHaze (UUID ownerId) { super(ownerId, 9, "Ethereal Haze", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{W}"); this.expansionSetCode = "CHK"; - this.color.setWhite(true); - + this.color.setWhite(true); + // Prevent all damage that would be dealt by creatures this turn. this.getSpellAbility().addEffect(new PreventAllDamageEffect(new FilterCreaturePermanent("creatures"), Duration.EndOfTurn, false)); - + } public EtherealHaze (final EtherealHaze card) { diff --git a/Mage.Sets/src/mage/sets/championsofkamigawa/EyeOfNowhere.java b/Mage.Sets/src/mage/sets/championsofkamigawa/EyeOfNowhere.java index db997c2687..a71fb4cc96 100644 --- a/Mage.Sets/src/mage/sets/championsofkamigawa/EyeOfNowhere.java +++ b/Mage.Sets/src/mage/sets/championsofkamigawa/EyeOfNowhere.java @@ -45,10 +45,10 @@ public class EyeOfNowhere extends CardImpl { super(ownerId, 59, "Eye of Nowhere", Rarity.COMMON, new CardType[]{CardType.SORCERY}, "{U}{U}"); this.expansionSetCode = "CHK"; this.subtype.add("Arcane"); - this.color.setBlue(true); + this.color.setBlue(true); this.getSpellAbility().addEffect(new ReturnToHandTargetEffect()); this.getSpellAbility().addTarget(new TargetPermanent()); - + } public EyeOfNowhere (final EyeOfNowhere card) { diff --git a/Mage.Sets/src/mage/sets/championsofkamigawa/FeastOfWorms.java b/Mage.Sets/src/mage/sets/championsofkamigawa/FeastOfWorms.java index aea46d2d08..d58bf454dd 100644 --- a/Mage.Sets/src/mage/sets/championsofkamigawa/FeastOfWorms.java +++ b/Mage.Sets/src/mage/sets/championsofkamigawa/FeastOfWorms.java @@ -60,8 +60,8 @@ public class FeastOfWorms extends CardImpl { super(ownerId, 216, "Feast of Worms", Rarity.UNCOMMON, new CardType[]{CardType.SORCERY}, "{3}{G}{G}"); this.expansionSetCode = "CHK"; this.subtype.add("Arcane"); - this.color.setGreen(true); - + this.color.setGreen(true); + // Destroy target land. If that land was legendary, its controller sacrifices another land. this.getSpellAbility().addEffect(new DestroyTargetEffect()); this.getSpellAbility().addTarget(new TargetLandPermanent()); diff --git a/Mage.Sets/src/mage/sets/championsofkamigawa/FeralDeceiver.java b/Mage.Sets/src/mage/sets/championsofkamigawa/FeralDeceiver.java index b97a2f70b2..dbd9cac581 100644 --- a/Mage.Sets/src/mage/sets/championsofkamigawa/FeralDeceiver.java +++ b/Mage.Sets/src/mage/sets/championsofkamigawa/FeralDeceiver.java @@ -66,10 +66,10 @@ public class FeralDeceiver extends CardImpl { this.color.setGreen(true); this.power = new MageInt(3); this.toughness = new MageInt(2); - + // {1}: Look at the top card of your library. this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new LookLibraryControllerEffect(), new GenericManaCost(1))); - + // {2}: Reveal the top card of your library. If it's a land card, {this} gets +2/+2 and gains trample until end of turn. Ability ability = new FeralDeceiverAbility(Zone.BATTLEFIELD, new BoostSourceEffect(2,2,Duration.EndOfTurn), new ManaCostsImpl("{2}")); ability.addEffect(new GainAbilitySourceEffect(TrampleAbility.getInstance(),Duration.EndOfTurn)); @@ -79,7 +79,7 @@ public class FeralDeceiver extends CardImpl { public FeralDeceiver(final FeralDeceiver card) { super(card); } - + @Override public FeralDeceiver copy() { return new FeralDeceiver(this); @@ -87,22 +87,22 @@ public class FeralDeceiver extends CardImpl { } class FeralDeceiverAbility extends ActivateOncePerTurnActivatedAbility { - + public FeralDeceiverAbility(Zone zone, Effect effect, Cost cost) { - super(zone, effect, cost); - } + super(zone, effect, cost); + } public FeralDeceiverAbility(FeralDeceiverAbility ability) { - super(ability); - } - + super(ability); + } + @Override public FeralDeceiverAbility copy() { return new FeralDeceiverAbility(this); } - + @Override - public boolean checkIfClause(Game game) { + public boolean checkIfClause(Game game) { Player player = game.getPlayer(this.getControllerId()); if (player != null) { Cards cards = new CardsImpl(); @@ -113,11 +113,11 @@ class FeralDeceiverAbility extends ActivateOncePerTurnActivatedAbility { return true; } } - return false; + return false; } - + @Override - public String getRule() { - return "{2}: Reveal the top card of your library. If it's a land card, {this} gets +2/+2 and gains trample until end of turn. Activate this ability only once each turn."; - } + public String getRule() { + return "{2}: Reveal the top card of your library. If it's a land card, {this} gets +2/+2 and gains trample until end of turn. Activate this ability only once each turn."; + } } \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/championsofkamigawa/FieldOfReality.java b/Mage.Sets/src/mage/sets/championsofkamigawa/FieldOfReality.java index d0a61d2957..396c409580 100644 --- a/Mage.Sets/src/mage/sets/championsofkamigawa/FieldOfReality.java +++ b/Mage.Sets/src/mage/sets/championsofkamigawa/FieldOfReality.java @@ -62,7 +62,7 @@ public class FieldOfReality extends CardImpl { this.expansionSetCode = "CHK"; this.subtype.add("Aura"); this.color.setBlue(true); - + // Enchanted creature can't be blocked by Spirits. TargetPermanent auraTarget = new TargetCreaturePermanent(); this.getSpellAbility().addTarget(auraTarget); diff --git a/Mage.Sets/src/mage/sets/championsofkamigawa/Forest1.java b/Mage.Sets/src/mage/sets/championsofkamigawa/Forest1.java index 26697fa86d..bf81312628 100644 --- a/Mage.Sets/src/mage/sets/championsofkamigawa/Forest1.java +++ b/Mage.Sets/src/mage/sets/championsofkamigawa/Forest1.java @@ -36,16 +36,16 @@ import java.util.UUID; public class Forest1 extends mage.cards.basiclands.Forest { public Forest1(UUID ownerId) { - super(ownerId, 303); - this.expansionSetCode = "CHK"; - } + super(ownerId, 303); + this.expansionSetCode = "CHK"; + } - public Forest1(final Forest1 card) { - super(card); - } + public Forest1(final Forest1 card) { + super(card); + } - @Override - public Forest1 copy() { - return new Forest1(this); - } + @Override + public Forest1 copy() { + return new Forest1(this); + } } diff --git a/Mage.Sets/src/mage/sets/championsofkamigawa/Forest2.java b/Mage.Sets/src/mage/sets/championsofkamigawa/Forest2.java index 15afffd5de..dc7875e687 100644 --- a/Mage.Sets/src/mage/sets/championsofkamigawa/Forest2.java +++ b/Mage.Sets/src/mage/sets/championsofkamigawa/Forest2.java @@ -36,16 +36,16 @@ import java.util.UUID; public class Forest2 extends mage.cards.basiclands.Forest { public Forest2(UUID ownerId) { - super(ownerId, 304); - this.expansionSetCode = "CHK"; - } + super(ownerId, 304); + this.expansionSetCode = "CHK"; + } - public Forest2(final Forest2 card) { - super(card); - } + public Forest2(final Forest2 card) { + super(card); + } - @Override - public Forest2 copy() { - return new Forest2(this); - } + @Override + public Forest2 copy() { + return new Forest2(this); + } } diff --git a/Mage.Sets/src/mage/sets/championsofkamigawa/Forest3.java b/Mage.Sets/src/mage/sets/championsofkamigawa/Forest3.java index 041cd6c1cf..ca6a30a0e3 100644 --- a/Mage.Sets/src/mage/sets/championsofkamigawa/Forest3.java +++ b/Mage.Sets/src/mage/sets/championsofkamigawa/Forest3.java @@ -36,16 +36,16 @@ import java.util.UUID; public class Forest3 extends mage.cards.basiclands.Forest { public Forest3(UUID ownerId) { - super(ownerId, 305); - this.expansionSetCode = "CHK"; - } + super(ownerId, 305); + this.expansionSetCode = "CHK"; + } - public Forest3(final Forest3 card) { - super(card); - } + public Forest3(final Forest3 card) { + super(card); + } - @Override - public Forest3 copy() { - return new Forest3(this); - } + @Override + public Forest3 copy() { + return new Forest3(this); + } } diff --git a/Mage.Sets/src/mage/sets/championsofkamigawa/Forest4.java b/Mage.Sets/src/mage/sets/championsofkamigawa/Forest4.java index d60cfa67a9..9219a9b331 100644 --- a/Mage.Sets/src/mage/sets/championsofkamigawa/Forest4.java +++ b/Mage.Sets/src/mage/sets/championsofkamigawa/Forest4.java @@ -36,16 +36,16 @@ import java.util.UUID; public class Forest4 extends mage.cards.basiclands.Forest { public Forest4(UUID ownerId) { - super(ownerId, 306); - this.expansionSetCode = "CHK"; - } + super(ownerId, 306); + this.expansionSetCode = "CHK"; + } - public Forest4(final Forest4 card) { - super(card); - } + public Forest4(final Forest4 card) { + super(card); + } - @Override - public Forest4 copy() { - return new Forest4(this); - } + @Override + public Forest4 copy() { + return new Forest4(this); + } } diff --git a/Mage.Sets/src/mage/sets/championsofkamigawa/Frostwielder.java b/Mage.Sets/src/mage/sets/championsofkamigawa/Frostwielder.java index 4b7311ccaa..76d9309961 100644 --- a/Mage.Sets/src/mage/sets/championsofkamigawa/Frostwielder.java +++ b/Mage.Sets/src/mage/sets/championsofkamigawa/Frostwielder.java @@ -73,14 +73,14 @@ public class Frostwielder extends CardImpl { this.color.setRed(true); this.power = new MageInt(1); this.toughness = new MageInt(2); - + // {T}: Frostwielder deals 1 damage to target creature or player. Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DamageTargetEffect(1), new TapSourceCost()); ability.addTarget(new TargetCreatureOrPlayer()); // If a creature dealt damage by Frostwielder this turn would die, exile it instead. this.addAbility(ability); this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new FrostwielderEffect())); - + this.addWatcher(new DamagedByWatcher()); } @@ -98,43 +98,43 @@ public class Frostwielder extends CardImpl { class FrostwielderEffect extends ReplacementEffectImpl { - public FrostwielderEffect() { - super(Duration.EndOfTurn, Outcome.Exile); - staticText = "If a creature dealt damage by {this} this turn would die, exile it instead"; - } + public FrostwielderEffect() { + super(Duration.EndOfTurn, Outcome.Exile); + staticText = "If a creature dealt damage by {this} this turn would die, exile it instead"; + } - public FrostwielderEffect(final FrostwielderEffect effect) { - super(effect); - } + public FrostwielderEffect(final FrostwielderEffect effect) { + super(effect); + } - @Override - public FrostwielderEffect copy() { - return new FrostwielderEffect(this); - } + @Override + public FrostwielderEffect copy() { + return new FrostwielderEffect(this); + } - @Override - public boolean apply(Game game, Ability source) { - return true; - } + @Override + public boolean apply(Game game, Ability source) { + return true; + } - @Override - public boolean replaceEvent(GameEvent event, Ability source, Game game) { + @Override + public boolean replaceEvent(GameEvent event, Ability source, Game game) { Permanent permanent = ((ZoneChangeEvent)event).getTarget(); if (permanent != null) { return permanent.moveToExile(null, "", source.getId(), game); } - return false; - } + return false; + } - @Override - public boolean applies(GameEvent event, Ability source, Game game) { - if (event.getType() == EventType.ZONE_CHANGE && ((ZoneChangeEvent)event).isDiesEvent()) { + @Override + public boolean applies(GameEvent event, Ability source, Game game) { + if (event.getType() == EventType.ZONE_CHANGE && ((ZoneChangeEvent)event).isDiesEvent()) { DamagedByWatcher watcher = (DamagedByWatcher) game.getState().getWatchers().get("DamagedByWatcher", source.getSourceId()); if (watcher != null) return watcher.damagedCreatures.contains(event.getTargetId()); } - return false; - } + return false; + } } \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/championsofkamigawa/GeneralsKabuto.java b/Mage.Sets/src/mage/sets/championsofkamigawa/GeneralsKabuto.java index 1cdd9cd4a0..a1423548fc 100644 --- a/Mage.Sets/src/mage/sets/championsofkamigawa/GeneralsKabuto.java +++ b/Mage.Sets/src/mage/sets/championsofkamigawa/GeneralsKabuto.java @@ -62,13 +62,13 @@ public class GeneralsKabuto extends CardImpl { super(ownerId, 251, "General's Kabuto", Rarity.RARE, new CardType[]{CardType.ARTIFACT}, "{2}"); this.expansionSetCode = "CHK"; this.subtype.add("Equipment"); - + // Equipped creature has shroud. (It can't be the target of spells or abilities.) this.addAbility(new SimpleStaticAbility(Constants.Zone.BATTLEFIELD, new GainAbilityAttachedEffect(ShroudAbility.getInstance(), Constants.AttachmentType.EQUIPMENT))); // Prevent all combat damage that would be dealt to equipped creature this.addAbility(new SimpleStaticAbility(Constants.Zone.BATTLEFIELD, new GeneralsKabutoEffect())); - + // Equip {2} this.addAbility(new EquipAbility(Outcome.PreventDamage, new GenericManaCost(2))); } @@ -85,49 +85,49 @@ public class GeneralsKabuto extends CardImpl { class GeneralsKabutoEffect extends PreventionEffectImpl { - public GeneralsKabutoEffect() { - super(Duration.WhileOnBattlefield); - staticText = "Prevent all combat damage that would be dealt to equipped creature"; - } + public GeneralsKabutoEffect() { + super(Duration.WhileOnBattlefield); + staticText = "Prevent all combat damage that would be dealt to equipped creature"; + } - public GeneralsKabutoEffect(final GeneralsKabutoEffect effect) { - super(effect); - } + public GeneralsKabutoEffect(final GeneralsKabutoEffect effect) { + super(effect); + } - @Override - public GeneralsKabutoEffect copy() { - return new GeneralsKabutoEffect(this); - } + @Override + public GeneralsKabutoEffect copy() { + return new GeneralsKabutoEffect(this); + } - @Override - public boolean apply(Game game, Ability source) { - return true; - } + @Override + public boolean apply(Game game, Ability source) { + return true; + } - @Override - public boolean replaceEvent(GameEvent event, Ability source, Game game) { - GameEvent preventEvent = new GameEvent( + @Override + public boolean replaceEvent(GameEvent event, Ability source, Game game) { + GameEvent preventEvent = new GameEvent( GameEvent.EventType.PREVENT_DAMAGE, source.getFirstTarget(), source.getId(), source.getControllerId(), event.getAmount(), false); - if (!game.replaceEvent(preventEvent)) { - int damage = event.getAmount(); - event.setAmount(0); - game.fireEvent(GameEvent.getEvent( + if (!game.replaceEvent(preventEvent)) { + int damage = event.getAmount(); + event.setAmount(0); + game.fireEvent(GameEvent.getEvent( GameEvent.EventType.PREVENTED_DAMAGE, source.getFirstTarget(), source.getId(), source.getControllerId(), damage)); - } - return false; - } + } + return false; + } - @Override - public boolean applies(GameEvent event, Ability source, Game game) { + @Override + public boolean applies(GameEvent event, Ability source, Game game) { if (super.applies(event, source, game) && event instanceof DamageEvent) { DamageEvent damageEvent = (DamageEvent) event; if (damageEvent.isCombatDamage()) { @@ -140,7 +140,7 @@ class GeneralsKabutoEffect extends PreventionEffectImpl { } } return false; - } + } } diff --git a/Mage.Sets/src/mage/sets/championsofkamigawa/GhostlyPrison.java b/Mage.Sets/src/mage/sets/championsofkamigawa/GhostlyPrison.java index 95621819bd..be8ceee596 100644 --- a/Mage.Sets/src/mage/sets/championsofkamigawa/GhostlyPrison.java +++ b/Mage.Sets/src/mage/sets/championsofkamigawa/GhostlyPrison.java @@ -51,7 +51,7 @@ public class GhostlyPrison extends CardImpl { public GhostlyPrison (UUID ownerId) { super(ownerId, 10, "Ghostly Prison", Rarity.UNCOMMON, new CardType[]{CardType.ENCHANTMENT}, "{2}{W}"); this.expansionSetCode = "CHK"; - this.color.setWhite(true); + this.color.setWhite(true); this.addAbility(new SimpleStaticAbility(Constants.Zone.BATTLEFIELD, new GhostlyPrisonReplacementEffect())); } @@ -68,52 +68,52 @@ public class GhostlyPrison extends CardImpl { class GhostlyPrisonReplacementEffect extends ReplacementEffectImpl { - private static final String effectText = "Creatures can't attack you unless their controller pays {2} for each creature he or she controls that's attacking you"; + private static final String effectText = "Creatures can't attack you unless their controller pays {2} for each creature he or she controls that's attacking you"; - GhostlyPrisonReplacementEffect ( ) { - super(Constants.Duration.WhileOnBattlefield, Constants.Outcome.Neutral); - staticText = effectText; - } + GhostlyPrisonReplacementEffect ( ) { + super(Constants.Duration.WhileOnBattlefield, Constants.Outcome.Neutral); + staticText = effectText; + } - GhostlyPrisonReplacementEffect ( GhostlyPrisonReplacementEffect effect ) { - super(effect); - } + GhostlyPrisonReplacementEffect ( GhostlyPrisonReplacementEffect effect ) { + super(effect); + } - @Override - public boolean apply(Game game, Ability source) { - throw new UnsupportedOperationException("Not supported."); - } + @Override + public boolean apply(Game game, Ability source) { + throw new UnsupportedOperationException("Not supported."); + } - @Override - public boolean replaceEvent(GameEvent event, Ability source, Game game) { - if ( event.getType() == GameEvent.EventType.DECLARE_ATTACKER) { - Player player = game.getPlayer(event.getPlayerId()); - if ( player != null && event.getTargetId().equals(source.getControllerId())) { - ManaCostsImpl propagandaTax = new ManaCostsImpl("{2}"); - if ( propagandaTax.canPay(source.getSourceId(), event.getPlayerId(), game) && - player.chooseUse(Constants.Outcome.Benefit, "Pay {2} to declare attacker?", game) ) { - if (propagandaTax.payOrRollback(source, game, this.getId(), event.getPlayerId())) { - return false; - } - } + @Override + public boolean replaceEvent(GameEvent event, Ability source, Game game) { + if ( event.getType() == GameEvent.EventType.DECLARE_ATTACKER) { + Player player = game.getPlayer(event.getPlayerId()); + if ( player != null && event.getTargetId().equals(source.getControllerId())) { + ManaCostsImpl propagandaTax = new ManaCostsImpl("{2}"); + if ( propagandaTax.canPay(source.getSourceId(), event.getPlayerId(), game) && + player.chooseUse(Constants.Outcome.Benefit, "Pay {2} to declare attacker?", game) ) { + if (propagandaTax.payOrRollback(source, game, this.getId(), event.getPlayerId())) { + return false; + } + } return true; - } - } - return false; - } + } + } + return false; + } - @Override - public boolean applies(GameEvent event, Ability source, Game game) { - if ( event.getType() == GameEvent.EventType.DECLARE_ATTACKER && event.getTargetId().equals(source.getControllerId()) ) { - return true; - } - return false; - } + @Override + public boolean applies(GameEvent event, Ability source, Game game) { + if ( event.getType() == GameEvent.EventType.DECLARE_ATTACKER && event.getTargetId().equals(source.getControllerId()) ) { + return true; + } + return false; + } - @Override - public GhostlyPrisonReplacementEffect copy() { - return new GhostlyPrisonReplacementEffect(this); - } + @Override + public GhostlyPrisonReplacementEffect copy() { + return new GhostlyPrisonReplacementEffect(this); + } } diff --git a/Mage.Sets/src/mage/sets/championsofkamigawa/GuardianOfSolitude.java b/Mage.Sets/src/mage/sets/championsofkamigawa/GuardianOfSolitude.java index 9031bef4ad..1c0addd763 100644 --- a/Mage.Sets/src/mage/sets/championsofkamigawa/GuardianOfSolitude.java +++ b/Mage.Sets/src/mage/sets/championsofkamigawa/GuardianOfSolitude.java @@ -48,7 +48,7 @@ import mage.target.common.TargetCreaturePermanent; public class GuardianOfSolitude extends CardImpl { private final static FilterSpiritOrArcaneCard filter = new FilterSpiritOrArcaneCard(); - + public GuardianOfSolitude(UUID ownerId) { super(ownerId, 64, "Guardian of Solitude", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{1}{U}"); this.expansionSetCode = "CHK"; diff --git a/Mage.Sets/src/mage/sets/championsofkamigawa/HairStrungKoto.java b/Mage.Sets/src/mage/sets/championsofkamigawa/HairStrungKoto.java index 0b83661bbc..06300fcc8e 100644 --- a/Mage.Sets/src/mage/sets/championsofkamigawa/HairStrungKoto.java +++ b/Mage.Sets/src/mage/sets/championsofkamigawa/HairStrungKoto.java @@ -54,11 +54,11 @@ public class HairStrungKoto extends CardImpl { filter.setTapped(false); filter.setUseTapped(true); } - + public HairStrungKoto (UUID ownerId) { super(ownerId, 252, "Hair-Strung Koto", Rarity.RARE, new CardType[]{CardType.ARTIFACT}, "{6}"); this.expansionSetCode = "CHK"; - + /* Tap an untapped creature you control: Target player puts the top * card of his or her library into his or her graveyard. */ diff --git a/Mage.Sets/src/mage/sets/championsofkamigawa/HanabiBlast.java b/Mage.Sets/src/mage/sets/championsofkamigawa/HanabiBlast.java index 21842d5f2c..95747a3579 100644 --- a/Mage.Sets/src/mage/sets/championsofkamigawa/HanabiBlast.java +++ b/Mage.Sets/src/mage/sets/championsofkamigawa/HanabiBlast.java @@ -51,7 +51,7 @@ public class HanabiBlast extends CardImpl { public HanabiBlast (UUID ownerId) { super(ownerId, 170, "Hanabi Blast", Rarity.UNCOMMON, new CardType[]{CardType.INSTANT}, "{1}{R}{R}"); this.expansionSetCode = "CHK"; - this.color.setRed(true); + this.color.setRed(true); this.getSpellAbility().addEffect(new DamageTargetEffect(2)); this.getSpellAbility().addTarget(new TargetCreatureOrPlayer()); this.getSpellAbility().addEffect(ReturnToHandSpellEffect.getInstance()); @@ -71,31 +71,31 @@ public class HanabiBlast extends CardImpl { class HanabiBlastDiscardEffect extends OneShotEffect { - private static final String effectText = "discard a card at random"; + private static final String effectText = "discard a card at random"; - HanabiBlastDiscardEffect () { - super(Constants.Outcome.Discard); - staticText = effectText; - } + HanabiBlastDiscardEffect () { + super(Constants.Outcome.Discard); + staticText = effectText; + } - HanabiBlastDiscardEffect(HanabiBlastDiscardEffect effect) { - super(effect); - } + HanabiBlastDiscardEffect(HanabiBlastDiscardEffect effect) { + super(effect); + } - @Override - public boolean apply(Game game, Ability source) { - Player player = game.getPlayer(source.getControllerId()); + @Override + public boolean apply(Game game, Ability source) { + Player player = game.getPlayer(source.getControllerId()); if (player != null) { player.discard(player.getHand().getRandom(game), source, game); return true; } - return false; - } + return false; + } - @Override - public HanabiBlastDiscardEffect copy() { - return new HanabiBlastDiscardEffect(this); - } + @Override + public HanabiBlastDiscardEffect copy() { + return new HanabiBlastDiscardEffect(this); + } } diff --git a/Mage.Sets/src/mage/sets/championsofkamigawa/Hankyu.java b/Mage.Sets/src/mage/sets/championsofkamigawa/Hankyu.java index f69545dd73..044dafc784 100644 --- a/Mage.Sets/src/mage/sets/championsofkamigawa/Hankyu.java +++ b/Mage.Sets/src/mage/sets/championsofkamigawa/Hankyu.java @@ -65,7 +65,7 @@ public class Hankyu extends CardImpl { SimpleActivatedAbility ability1 = new SimpleActivatedAbility(Zone.BATTLEFIELD, new HankyuAddCounterEffect(this.getId()), new TapSourceCost()); ability1.setSourceId(this.getId()); // to know where to put the counters on this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityAttachedEffect(ability1, AttachmentType.EQUIPMENT))); - + /* "{T}, Remove all aim counters from Hankyu: This creature deals * damage to target creature or player equal to the number of * aim counters removed this way." */ @@ -73,7 +73,7 @@ public class Hankyu extends CardImpl { ability2.addCost(new HankyuCountersSourceCost(this.getId())); ability2.addTarget(new TargetCreatureOrPlayer()); this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityAttachedEffect(ability2, AttachmentType.EQUIPMENT))); - + // Equip {4} ({4}: Attach to target creature you control. Equip only as a sorcery.) this.addAbility(new EquipAbility(Outcome.BoostCreature, new GenericManaCost(4))); } @@ -91,31 +91,31 @@ public class Hankyu extends CardImpl { class HankyuAddCounterEffect extends OneShotEffect { private UUID effectGivingEquipmentId; - - public HankyuAddCounterEffect(UUID effectGivingEquipmentId) { - super(Outcome.Benefit); - this.effectGivingEquipmentId = effectGivingEquipmentId; - staticText = "Put an aim counter on Hankyu"; - } - public HankyuAddCounterEffect(final HankyuAddCounterEffect effect) { - super(effect); + public HankyuAddCounterEffect(UUID effectGivingEquipmentId) { + super(Outcome.Benefit); + this.effectGivingEquipmentId = effectGivingEquipmentId; + staticText = "Put an aim counter on Hankyu"; + } + + public HankyuAddCounterEffect(final HankyuAddCounterEffect effect) { + super(effect); this.effectGivingEquipmentId = effect.effectGivingEquipmentId; - } + } - @Override - public boolean apply(Game game, Ability source) { - Permanent equipment = game.getPermanent(this.effectGivingEquipmentId); - if (equipment != null) { - equipment.addCounters(new AimCounter(), game); - } - return true; - } + @Override + public boolean apply(Game game, Ability source) { + Permanent equipment = game.getPermanent(this.effectGivingEquipmentId); + if (equipment != null) { + equipment.addCounters(new AimCounter(), game); + } + return true; + } - @Override - public HankyuAddCounterEffect copy() { - return new HankyuAddCounterEffect(this); - } + @Override + public HankyuAddCounterEffect copy() { + return new HankyuAddCounterEffect(this); + } } @@ -165,28 +165,28 @@ class HankyuCountersSourceCost extends CostImpl { private int removedCounters; private UUID effectGivingEquipmentId; - + public HankyuCountersSourceCost(UUID effectGivingEquipmentId) { super(); this.removedCounters = 0; this.effectGivingEquipmentId = effectGivingEquipmentId; - this.text = "Remove all aim counters from Hankyu"; - } + this.text = "Remove all aim counters from Hankyu"; + } - public HankyuCountersSourceCost(HankyuCountersSourceCost cost) { - super(cost); + public HankyuCountersSourceCost(HankyuCountersSourceCost cost) { + super(cost); this.effectGivingEquipmentId = cost.effectGivingEquipmentId; this.removedCounters = cost.removedCounters; - } + } - @Override - public boolean canPay(UUID sourceId, UUID controllerId, Game game) { - return true; - } + @Override + public boolean canPay(UUID sourceId, UUID controllerId, Game game) { + return true; + } - @Override - public boolean pay(Ability ability, Game game, UUID sourceId, UUID controllerId, boolean noMana) { - Permanent equipment = game.getPermanent(this.effectGivingEquipmentId); + @Override + public boolean pay(Ability ability, Game game, UUID sourceId, UUID controllerId, boolean noMana) { + Permanent equipment = game.getPermanent(this.effectGivingEquipmentId); if (equipment != null ) { this.removedCounters = equipment.getCounters().getCount(CounterType.AIM); if (this.removedCounters > 0) { @@ -194,14 +194,14 @@ class HankyuCountersSourceCost extends CostImpl { } } this.paid = true; - return true; - } + return true; + } + + @Override + public HankyuCountersSourceCost copy() { + return new HankyuCountersSourceCost(this); + } - @Override - public HankyuCountersSourceCost copy() { - return new HankyuCountersSourceCost(this); - } - public int getRemovedCounters() { return this.removedCounters; } diff --git a/Mage.Sets/src/mage/sets/championsofkamigawa/HarshDeceiver.java b/Mage.Sets/src/mage/sets/championsofkamigawa/HarshDeceiver.java index a39ecb9db1..60e73a2b44 100644 --- a/Mage.Sets/src/mage/sets/championsofkamigawa/HarshDeceiver.java +++ b/Mage.Sets/src/mage/sets/championsofkamigawa/HarshDeceiver.java @@ -65,10 +65,10 @@ public class HarshDeceiver extends CardImpl { this.color.setWhite(true); this.power = new MageInt(1); this.toughness = new MageInt(4); - + // {1}: Look at the top card of your library. this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new LookLibraryControllerEffect(), new GenericManaCost(1))); - + // {2}: Reveal the top card of your library. If it's a land card, untap {this} and it gets +1/+1 until end of turn. Ability ability = new FeralDeceiverAbility(Zone.BATTLEFIELD, new UntapSourceEffect(), new ManaCostsImpl("{2}")); ability.addEffect(new BoostSourceEffect(1,1,Duration.EndOfTurn)); @@ -78,7 +78,7 @@ public class HarshDeceiver extends CardImpl { public HarshDeceiver(final HarshDeceiver card) { super(card); } - + @Override public HarshDeceiver copy() { return new HarshDeceiver(this); @@ -86,22 +86,22 @@ public class HarshDeceiver extends CardImpl { } class HarshDeceiverAbility extends ActivateOncePerTurnActivatedAbility { - + public HarshDeceiverAbility(Zone zone, Effect effect, Cost cost) { - super(zone, effect, cost); - } + super(zone, effect, cost); + } public HarshDeceiverAbility(HarshDeceiverAbility ability) { - super(ability); - } - + super(ability); + } + @Override public HarshDeceiverAbility copy() { return new HarshDeceiverAbility(this); } - + @Override - public boolean checkIfClause(Game game) { + public boolean checkIfClause(Game game) { Player player = game.getPlayer(this.getControllerId()); if (player != null) { Cards cards = new CardsImpl(); @@ -112,11 +112,11 @@ class HarshDeceiverAbility extends ActivateOncePerTurnActivatedAbility { return true; } } - return false; + return false; } - + @Override - public String getRule() { - return "{2}: Reveal the top card of your library. If it's a land card, untap {this} and it gets +1/+1 until end of turn. Activate this ability only once each turn."; - } + public String getRule() { + return "{2}: Reveal the top card of your library. If it's a land card, untap {this} and it gets +1/+1 until end of turn. Activate this ability only once each turn."; + } } \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/championsofkamigawa/HeWhoHungers.java b/Mage.Sets/src/mage/sets/championsofkamigawa/HeWhoHungers.java index 38d201096a..32bf640094 100644 --- a/Mage.Sets/src/mage/sets/championsofkamigawa/HeWhoHungers.java +++ b/Mage.Sets/src/mage/sets/championsofkamigawa/HeWhoHungers.java @@ -63,7 +63,7 @@ public class HeWhoHungers extends CardImpl { filter.getSubtype().add("Spirit"); filter.setScopeSubtype(Filter.ComparisonScope.Any); } - + public HeWhoHungers(UUID ownerId) { super(ownerId, 114, "He Who Hungers", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{4}{B}"); this.expansionSetCode = "CHK"; @@ -72,17 +72,17 @@ public class HeWhoHungers extends CardImpl { this.color.setBlack(true); this.power = new MageInt(3); this.toughness = new MageInt(2); - + //Flying this.addAbility(FlyingAbility.getInstance()); - + /* {1}, Sacrifice a Spirit: Target opponent reveals his or her hand. You choose a card from it. * That player discards that card. Activate this ability only any time you could cast a sorcery. */ Ability ability = new ActivateAsSorceryActivatedAbility(Zone.BATTLEFIELD, new DiscardCardYouChooseTargetOpponentEffect(), new ManaCostsImpl("{1}")); ability.addTarget(new TargetOpponent(true)); ability.addCost(new SacrificeTargetCost(new TargetControlledPermanent(filter))); this.addAbility(ability); - + //Soulshift 4 (When this creature dies, you may return target Spirit card with converted mana cost 4 or less from your graveyard to your hand.) this.addAbility(new SoulshiftAbility(4)); } diff --git a/Mage.Sets/src/mage/sets/championsofkamigawa/HeartbeatOfSpring.java b/Mage.Sets/src/mage/sets/championsofkamigawa/HeartbeatOfSpring.java index 90e6a55e36..2725dbab7d 100644 --- a/Mage.Sets/src/mage/sets/championsofkamigawa/HeartbeatOfSpring.java +++ b/Mage.Sets/src/mage/sets/championsofkamigawa/HeartbeatOfSpring.java @@ -57,7 +57,7 @@ public class HeartbeatOfSpring extends CardImpl { public HeartbeatOfSpring (UUID ownerId) { super(ownerId, 212, "Heartbeat of Spring", Rarity.RARE, new CardType[]{CardType.ENCHANTMENT}, "{2}{G}"); this.expansionSetCode = "CHK"; - this.color.setGreen(true); + this.color.setGreen(true); // Whenever a player taps a land for mana, that player adds one mana to his or her mana pool of any type that land produced. this.addAbility(new HeartbeatOfSpringAbility()); } @@ -75,40 +75,40 @@ public class HeartbeatOfSpring extends CardImpl { class HeartbeatOfSpringAbility extends TriggeredManaAbility { - private static final String staticText = "Whenever a player taps a land for mana, that player adds one mana to his or her mana pool of any type that land produced."; + private static final String staticText = "Whenever a player taps a land for mana, that player adds one mana to his or her mana pool of any type that land produced."; - public HeartbeatOfSpringAbility() { - super(Zone.BATTLEFIELD, new HeartbeatOfSpringEffect()); - } + public HeartbeatOfSpringAbility() { + super(Zone.BATTLEFIELD, new HeartbeatOfSpringEffect()); + } - public HeartbeatOfSpringAbility(HeartbeatOfSpringAbility ability) { - super(ability); - } + public HeartbeatOfSpringAbility(HeartbeatOfSpringAbility ability) { + super(ability); + } - @Override - public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == GameEvent.EventType.TAPPED_FOR_MANA ) { - Permanent permanent = game.getPermanent(event.getSourceId()); - if (permanent == null) { - permanent = (Permanent) game.getLastKnownInformation(event.getSourceId(), Zone.BATTLEFIELD); - } - if (permanent != null && permanent.getCardType().contains(CardType.LAND)) { + @Override + public boolean checkTrigger(GameEvent event, Game game) { + if (event.getType() == GameEvent.EventType.TAPPED_FOR_MANA ) { + Permanent permanent = game.getPermanent(event.getSourceId()); + if (permanent == null) { + permanent = (Permanent) game.getLastKnownInformation(event.getSourceId(), Zone.BATTLEFIELD); + } + if (permanent != null && permanent.getCardType().contains(CardType.LAND)) { getEffects().get(0).setTargetPointer(new FixedTarget(permanent.getId())); return true; - } - } - return false; - } + } + } + return false; + } - @Override - public HeartbeatOfSpringAbility copy() { - return new HeartbeatOfSpringAbility(this); - } + @Override + public HeartbeatOfSpringAbility copy() { + return new HeartbeatOfSpringAbility(this); + } - @Override - public String getRule() { - return staticText; - } + @Override + public String getRule() { + return staticText; + } } class HeartbeatOfSpringEffect extends ManaEffect { @@ -117,11 +117,11 @@ class HeartbeatOfSpringEffect extends ManaEffect { super(); staticText = "that player adds one mana to his or her mana pool of any type that land produced"; } - + public HeartbeatOfSpringEffect(final HeartbeatOfSpringEffect effect) { super(effect); } - + @Override public boolean apply(Game game, Ability source) { Permanent land = game.getPermanent(this.targetPointer.getFirst(game, source)); @@ -182,5 +182,5 @@ class HeartbeatOfSpringEffect extends ManaEffect { public HeartbeatOfSpringEffect copy() { return new HeartbeatOfSpringEffect(this); } - + } \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/championsofkamigawa/HikariTwilightGuardian.java b/Mage.Sets/src/mage/sets/championsofkamigawa/HikariTwilightGuardian.java index 5f2d0b94ab..8cdb2ae09f 100644 --- a/Mage.Sets/src/mage/sets/championsofkamigawa/HikariTwilightGuardian.java +++ b/Mage.Sets/src/mage/sets/championsofkamigawa/HikariTwilightGuardian.java @@ -51,13 +51,13 @@ import mage.game.permanent.Permanent; public class HikariTwilightGuardian extends CardImpl { private final static FilterSpiritOrArcaneCard filter = new FilterSpiritOrArcaneCard(); - + public HikariTwilightGuardian (UUID ownerId) { super(ownerId, 12, "Hikari, Twilight Guardian", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{3}{W}{W}"); this.expansionSetCode = "CHK"; this.supertype.add("Legendary"); this.subtype.add("Spirit"); - this.color.setWhite(true); + this.color.setWhite(true); this.power = new MageInt(4); this.toughness = new MageInt(4); this.addAbility(FlyingAbility.getInstance()); @@ -77,37 +77,37 @@ public class HikariTwilightGuardian extends CardImpl { class HikariTwilightGuardianEffect extends OneShotEffect { - private static final String effectText = "Exile {this}. Return it to the battlefield under your control at the beginning of the next end step"; + private static final String effectText = "Exile {this}. Return it to the battlefield under your control at the beginning of the next end step"; - HikariTwilightGuardianEffect ( ) { - super(Constants.Outcome.Benefit); - staticText = effectText; - } + HikariTwilightGuardianEffect ( ) { + super(Constants.Outcome.Benefit); + staticText = effectText; + } - HikariTwilightGuardianEffect(HikariTwilightGuardianEffect effect) { - super(effect); - } + HikariTwilightGuardianEffect(HikariTwilightGuardianEffect effect) { + super(effect); + } - @Override - public boolean apply(Game game, Ability source) { - Permanent permanent = game.getPermanent(source.getSourceId()); - if (permanent != null) { - if (permanent.moveToExile(source.getSourceId(), "Hikari, Twilight Guardian", source.getId(), game)) { - //create delayed triggered ability - AtEndOfTurnDelayedTriggeredAbility delayedAbility = new AtEndOfTurnDelayedTriggeredAbility( - new ReturnFromExileEffect(source.getSourceId(), Constants.Zone.BATTLEFIELD)); - delayedAbility.setSourceId(source.getSourceId()); - delayedAbility.setControllerId(source.getControllerId()); - game.addDelayedTriggeredAbility(delayedAbility); - return true; - } - } - return false; - } + @Override + public boolean apply(Game game, Ability source) { + Permanent permanent = game.getPermanent(source.getSourceId()); + if (permanent != null) { + if (permanent.moveToExile(source.getSourceId(), "Hikari, Twilight Guardian", source.getId(), game)) { + //create delayed triggered ability + AtEndOfTurnDelayedTriggeredAbility delayedAbility = new AtEndOfTurnDelayedTriggeredAbility( + new ReturnFromExileEffect(source.getSourceId(), Constants.Zone.BATTLEFIELD)); + delayedAbility.setSourceId(source.getSourceId()); + delayedAbility.setControllerId(source.getControllerId()); + game.addDelayedTriggeredAbility(delayedAbility); + return true; + } + } + return false; + } - @Override - public HikariTwilightGuardianEffect copy() { - return new HikariTwilightGuardianEffect(this); - } + @Override + public HikariTwilightGuardianEffect copy() { + return new HikariTwilightGuardianEffect(this); + } } diff --git a/Mage.Sets/src/mage/sets/championsofkamigawa/HisokaMinamoSensei.java b/Mage.Sets/src/mage/sets/championsofkamigawa/HisokaMinamoSensei.java index 9b359a8c76..aa8def2f4c 100644 --- a/Mage.Sets/src/mage/sets/championsofkamigawa/HisokaMinamoSensei.java +++ b/Mage.Sets/src/mage/sets/championsofkamigawa/HisokaMinamoSensei.java @@ -63,7 +63,7 @@ public class HisokaMinamoSensei extends CardImpl { this.color.setBlue(true); this.power = new MageInt(1); this.toughness = new MageInt(3); - + // {2}{U}, Discard a card: Counter target spell if it has the same converted mana cost as the discarded card. Ability ability = new SimpleActivatedAbility(Constants.Zone.BATTLEFIELD, new HisokaMinamoSenseiCounterEffect(), new ManaCostsImpl("{2}{U}")); ability.addTarget(new TargetSpell()); @@ -86,42 +86,42 @@ public class HisokaMinamoSensei extends CardImpl { class HisokaMinamoSenseiDiscardTargetCost extends CostImpl { protected int convertedManaCosts = 0; - - public HisokaMinamoSenseiDiscardTargetCost(TargetCardInHand target) { - this.addTarget(target); - this.text = "Discard " + target.getTargetName(); - } - public HisokaMinamoSenseiDiscardTargetCost(HisokaMinamoSenseiDiscardTargetCost cost) { - super(cost); - } + public HisokaMinamoSenseiDiscardTargetCost(TargetCardInHand target) { + this.addTarget(target); + this.text = "Discard " + target.getTargetName(); + } - @Override - public boolean pay(Ability ability, Game game, UUID sourceId, UUID controllerId, boolean noMana) { - if (targets.choose(Outcome.Discard, controllerId, sourceId, game)) { - Player player = game.getPlayer(controllerId); - for (UUID targetId: targets.get(0).getTargets()) { - Card card = player.getHand().get(targetId, game); - if (card == null) - return false; - convertedManaCosts = card.getManaCost().convertedManaCost(); + public HisokaMinamoSenseiDiscardTargetCost(HisokaMinamoSenseiDiscardTargetCost cost) { + super(cost); + } + + @Override + public boolean pay(Ability ability, Game game, UUID sourceId, UUID controllerId, boolean noMana) { + if (targets.choose(Outcome.Discard, controllerId, sourceId, game)) { + Player player = game.getPlayer(controllerId); + for (UUID targetId: targets.get(0).getTargets()) { + Card card = player.getHand().get(targetId, game); + if (card == null) + return false; + convertedManaCosts = card.getManaCost().convertedManaCost(); paid |= player.discard(card, null, game); - - } - } - return paid; - } - @Override - public boolean canPay(UUID sourceId, UUID controllerId, Game game) { - return targets.canChoose(controllerId, game); - } + } + } + return paid; + } + + @Override + public boolean canPay(UUID sourceId, UUID controllerId, Game game) { + return targets.canChoose(controllerId, game); + } + + @Override + public HisokaMinamoSenseiDiscardTargetCost copy() { + return new HisokaMinamoSenseiDiscardTargetCost(this); + } - @Override - public HisokaMinamoSenseiDiscardTargetCost copy() { - return new HisokaMinamoSenseiDiscardTargetCost(this); - } - public int getConvertedCosts() { return convertedManaCosts; } diff --git a/Mage.Sets/src/mage/sets/championsofkamigawa/HondenOfCleansingFire.java b/Mage.Sets/src/mage/sets/championsofkamigawa/HondenOfCleansingFire.java index 1bd1cfa704..4f9bad4e8e 100644 --- a/Mage.Sets/src/mage/sets/championsofkamigawa/HondenOfCleansingFire.java +++ b/Mage.Sets/src/mage/sets/championsofkamigawa/HondenOfCleansingFire.java @@ -58,7 +58,7 @@ public class HondenOfCleansingFire extends CardImpl { this.supertype.add("Legendary"); this.subtype.add("Shrine"); this.color.setWhite(true); - + // At the beginning of your upkeep, you gain 2 life for each Shrine you control. this.addAbility(new BeginningOfUpkeepTriggeredAbility(new GainLifeEffect(new PermanentsOnBattlefieldCount(filter, 2)), Constants.TargetController.YOU, false)); } diff --git a/Mage.Sets/src/mage/sets/championsofkamigawa/HondenOfInfiniteRage.java b/Mage.Sets/src/mage/sets/championsofkamigawa/HondenOfInfiniteRage.java index a8021235ac..e0dc86d120 100644 --- a/Mage.Sets/src/mage/sets/championsofkamigawa/HondenOfInfiniteRage.java +++ b/Mage.Sets/src/mage/sets/championsofkamigawa/HondenOfInfiniteRage.java @@ -60,7 +60,7 @@ public class HondenOfInfiniteRage extends CardImpl { this.supertype.add("Legendary"); this.subtype.add("Shrine"); this.color.setRed(true); - + // At the beginning of your upkeep, Honden of Infinite Rage deals damage to target creature or player equal to the number of Shrines you control. Ability ability = new BeginningOfUpkeepTriggeredAbility(new DamageTargetEffect(new PermanentsOnBattlefieldCount(filter)), Constants.TargetController.YOU, false); ability.addTarget(new TargetCreatureOrPlayer()); diff --git a/Mage.Sets/src/mage/sets/championsofkamigawa/HondenOfNightsReach.java b/Mage.Sets/src/mage/sets/championsofkamigawa/HondenOfNightsReach.java index 2cb62296ac..3807168487 100644 --- a/Mage.Sets/src/mage/sets/championsofkamigawa/HondenOfNightsReach.java +++ b/Mage.Sets/src/mage/sets/championsofkamigawa/HondenOfNightsReach.java @@ -59,7 +59,7 @@ public class HondenOfNightsReach extends CardImpl { this.supertype.add("Legendary"); this.subtype.add("Shrine"); this.color.setBlack(true); - + // At the beginning of your upkeep, target opponent discards a card for each Shrine you control. Ability ability = new BeginningOfUpkeepTriggeredAbility(new DiscardTargetEffect(new PermanentsOnBattlefieldCount(filter)), Constants.TargetController.YOU, false); ability.addTarget(new TargetOpponent()); diff --git a/Mage.Sets/src/mage/sets/championsofkamigawa/HondenOfSeeingWinds.java b/Mage.Sets/src/mage/sets/championsofkamigawa/HondenOfSeeingWinds.java index 814fb4387f..c4bc7fcc26 100644 --- a/Mage.Sets/src/mage/sets/championsofkamigawa/HondenOfSeeingWinds.java +++ b/Mage.Sets/src/mage/sets/championsofkamigawa/HondenOfSeeingWinds.java @@ -58,7 +58,7 @@ public class HondenOfSeeingWinds extends CardImpl { this.supertype.add("Legendary"); this.subtype.add("Shrine"); this.color.setBlue(true); - + // At the beginning of your upkeep, draw a card for each Shrine you control. this.addAbility(new BeginningOfUpkeepTriggeredAbility(new DrawCardControllerEffect(new PermanentsOnBattlefieldCount(filter)), Constants.TargetController.YOU, false)); } diff --git a/Mage.Sets/src/mage/sets/championsofkamigawa/HorizonSeed.java b/Mage.Sets/src/mage/sets/championsofkamigawa/HorizonSeed.java index 6084e2291b..97a343ad8f 100644 --- a/Mage.Sets/src/mage/sets/championsofkamigawa/HorizonSeed.java +++ b/Mage.Sets/src/mage/sets/championsofkamigawa/HorizonSeed.java @@ -46,7 +46,7 @@ import mage.target.common.TargetCreaturePermanent; public class HorizonSeed extends CardImpl { private final static FilterSpiritOrArcaneCard filter = new FilterSpiritOrArcaneCard(); - + public HorizonSeed(UUID ownerId) { super(ownerId, 15, "Horizon Seed", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{4}{W}"); this.expansionSetCode = "CHK"; diff --git a/Mage.Sets/src/mage/sets/championsofkamigawa/HorobiDeathsWail.java b/Mage.Sets/src/mage/sets/championsofkamigawa/HorobiDeathsWail.java index fe0c8bec22..b303a97574 100644 --- a/Mage.Sets/src/mage/sets/championsofkamigawa/HorobiDeathsWail.java +++ b/Mage.Sets/src/mage/sets/championsofkamigawa/HorobiDeathsWail.java @@ -50,13 +50,13 @@ import mage.target.targetpointer.FixedTarget; * @author LevelX */ public class HorobiDeathsWail extends CardImpl { - + private static final FilterControlledPermanent filter = new FilterControlledPermanent("Demon"); static { filter.getSubtype().add("Demon"); filter.setScopeSubtype(Filter.ComparisonScope.Any); } - + public HorobiDeathsWail(UUID ownerId) { super(ownerId, 117, "Horobi Death's Wail", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{2}{B}{B}"); this.expansionSetCode = "CHK"; @@ -81,7 +81,7 @@ public class HorobiDeathsWail extends CardImpl { public HorobiDeathsWail copy() { return new HorobiDeathsWail(this); } - + } class HorobiDeathsWailAbility extends TriggeredAbilityImpl { diff --git a/Mage.Sets/src/mage/sets/championsofkamigawa/HumbleBudoka.java b/Mage.Sets/src/mage/sets/championsofkamigawa/HumbleBudoka.java index 8cb6602255..05d9db777e 100644 --- a/Mage.Sets/src/mage/sets/championsofkamigawa/HumbleBudoka.java +++ b/Mage.Sets/src/mage/sets/championsofkamigawa/HumbleBudoka.java @@ -46,7 +46,7 @@ public class HumbleBudoka extends CardImpl { this.expansionSetCode = "CHK"; this.subtype.add("Human"); this.subtype.add("Monk"); - this.color.setGreen(true); + this.color.setGreen(true); this.power = new MageInt(2); this.toughness = new MageInt(2); this.addAbility(ShroudAbility.getInstance()); diff --git a/Mage.Sets/src/mage/sets/championsofkamigawa/HundredTalonKami.java b/Mage.Sets/src/mage/sets/championsofkamigawa/HundredTalonKami.java index 158bfa867c..c42b6f5138 100644 --- a/Mage.Sets/src/mage/sets/championsofkamigawa/HundredTalonKami.java +++ b/Mage.Sets/src/mage/sets/championsofkamigawa/HundredTalonKami.java @@ -46,7 +46,7 @@ public class HundredTalonKami extends CardImpl { super(ownerId, 16, "Hundred-Talon Kami", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{4}{W}"); this.expansionSetCode = "CHK"; this.subtype.add("Spirit"); - this.color.setWhite(true); + this.color.setWhite(true); this.power = new MageInt(2); this.toughness = new MageInt(3); this.addAbility(FlyingAbility.getInstance()); diff --git a/Mage.Sets/src/mage/sets/championsofkamigawa/InameDeathAspect.java b/Mage.Sets/src/mage/sets/championsofkamigawa/InameDeathAspect.java index 2a7faa42d3..1ba17094e4 100644 --- a/Mage.Sets/src/mage/sets/championsofkamigawa/InameDeathAspect.java +++ b/Mage.Sets/src/mage/sets/championsofkamigawa/InameDeathAspect.java @@ -81,18 +81,18 @@ class InameDeathAspectEffect extends SearchEffect { } public InameDeathAspectEffect() { - super(new TargetCardInLibrary(0, Integer.MAX_VALUE, filter), Constants.Outcome.Neutral); - staticText = "search your library for any number of Spirit cards and put them into your graveyard. If you do, shuffle your library"; + super(new TargetCardInLibrary(0, Integer.MAX_VALUE, filter), Constants.Outcome.Neutral); + staticText = "search your library for any number of Spirit cards and put them into your graveyard. If you do, shuffle your library"; } - public InameDeathAspectEffect(final InameDeathAspectEffect effect) { - super(effect); - } + public InameDeathAspectEffect(final InameDeathAspectEffect effect) { + super(effect); + } - @Override - public InameDeathAspectEffect copy() { - return new InameDeathAspectEffect(this); - } + @Override + public InameDeathAspectEffect copy() { + return new InameDeathAspectEffect(this); + } @Override public boolean apply(Game game, Ability source) { diff --git a/Mage.Sets/src/mage/sets/championsofkamigawa/IndomitableWill.java b/Mage.Sets/src/mage/sets/championsofkamigawa/IndomitableWill.java index 0924f224ad..a616bf5551 100644 --- a/Mage.Sets/src/mage/sets/championsofkamigawa/IndomitableWill.java +++ b/Mage.Sets/src/mage/sets/championsofkamigawa/IndomitableWill.java @@ -53,15 +53,15 @@ public class IndomitableWill extends CardImpl { super(ownerId, 17, "Indomitable Will", Rarity.COMMON, new CardType[]{CardType.ENCHANTMENT}, "{1}{W}"); this.expansionSetCode = "CHK"; this.subtype.add("Aura"); - this.color.setWhite(true); + this.color.setWhite(true); this.addAbility(FlashAbility.getInstance()); TargetPermanent auraTarget = new TargetCreaturePermanent(); - this.getSpellAbility().addTarget(auraTarget); - this.getSpellAbility().addEffect(new AttachEffect(Constants.Outcome.BoostCreature)); - Ability ability = new EnchantAbility(auraTarget.getTargetName()); - this.addAbility(ability); - this.addAbility(new SimpleStaticAbility(Constants.Zone.BATTLEFIELD, new BoostEnchantedEffect(1, 2, Constants.Duration.WhileOnBattlefield))); + this.getSpellAbility().addTarget(auraTarget); + this.getSpellAbility().addEffect(new AttachEffect(Constants.Outcome.BoostCreature)); + Ability ability = new EnchantAbility(auraTarget.getTargetName()); + this.addAbility(ability); + this.addAbility(new SimpleStaticAbility(Constants.Zone.BATTLEFIELD, new BoostEnchantedEffect(1, 2, Constants.Duration.WhileOnBattlefield))); } public IndomitableWill (final IndomitableWill card) { diff --git a/Mage.Sets/src/mage/sets/championsofkamigawa/InnocenceKami.java b/Mage.Sets/src/mage/sets/championsofkamigawa/InnocenceKami.java index 376721abe0..57b11936f8 100644 --- a/Mage.Sets/src/mage/sets/championsofkamigawa/InnocenceKami.java +++ b/Mage.Sets/src/mage/sets/championsofkamigawa/InnocenceKami.java @@ -51,7 +51,7 @@ import mage.target.common.TargetCreaturePermanent; public class InnocenceKami extends CardImpl { private final static FilterSpiritOrArcaneCard filter = new FilterSpiritOrArcaneCard(); - + public InnocenceKami(UUID ownerId) { super(ownerId, 18, "Innocence Kami", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{3}{W}{W}"); this.expansionSetCode = "CHK"; diff --git a/Mage.Sets/src/mage/sets/championsofkamigawa/IsamaruHoundofKonda.java b/Mage.Sets/src/mage/sets/championsofkamigawa/IsamaruHoundofKonda.java index 6cad79eaff..4588d7d0a5 100644 --- a/Mage.Sets/src/mage/sets/championsofkamigawa/IsamaruHoundofKonda.java +++ b/Mage.Sets/src/mage/sets/championsofkamigawa/IsamaruHoundofKonda.java @@ -45,7 +45,7 @@ public class IsamaruHoundofKonda extends CardImpl { this.expansionSetCode = "CHK"; this.supertype.add("Legendary"); this.subtype.add("Hound"); - this.color.setWhite(true); + this.color.setWhite(true); this.power = new MageInt(2); this.toughness = new MageInt(2); } diff --git a/Mage.Sets/src/mage/sets/championsofkamigawa/Island1.java b/Mage.Sets/src/mage/sets/championsofkamigawa/Island1.java index 7672735194..191c753188 100644 --- a/Mage.Sets/src/mage/sets/championsofkamigawa/Island1.java +++ b/Mage.Sets/src/mage/sets/championsofkamigawa/Island1.java @@ -36,18 +36,18 @@ import java.util.UUID; */ public class Island1 extends mage.cards.basiclands.Island { - public Island1(UUID ownerId) { - super(ownerId, 291); - this.expansionSetCode = "CHK"; - } + public Island1(UUID ownerId) { + super(ownerId, 291); + this.expansionSetCode = "CHK"; + } - public Island1(final Island1 card) { - super(card); - } + public Island1(final Island1 card) { + super(card); + } - @Override - public Island1 copy() { - return new Island1(this); - } + @Override + public Island1 copy() { + return new Island1(this); + } } diff --git a/Mage.Sets/src/mage/sets/championsofkamigawa/Island2.java b/Mage.Sets/src/mage/sets/championsofkamigawa/Island2.java index c8416485c7..eb6699f25d 100644 --- a/Mage.Sets/src/mage/sets/championsofkamigawa/Island2.java +++ b/Mage.Sets/src/mage/sets/championsofkamigawa/Island2.java @@ -36,18 +36,18 @@ import java.util.UUID; */ public class Island2 extends mage.cards.basiclands.Island { - public Island2(UUID ownerId) { - super(ownerId, 292); - this.expansionSetCode = "CHK"; - } + public Island2(UUID ownerId) { + super(ownerId, 292); + this.expansionSetCode = "CHK"; + } - public Island2(final Island2 card) { - super(card); - } + public Island2(final Island2 card) { + super(card); + } - @Override - public Island2 copy() { - return new Island2(this); - } + @Override + public Island2 copy() { + return new Island2(this); + } } diff --git a/Mage.Sets/src/mage/sets/championsofkamigawa/Island3.java b/Mage.Sets/src/mage/sets/championsofkamigawa/Island3.java index b9d93e8371..ced0ea69a6 100644 --- a/Mage.Sets/src/mage/sets/championsofkamigawa/Island3.java +++ b/Mage.Sets/src/mage/sets/championsofkamigawa/Island3.java @@ -36,18 +36,18 @@ import java.util.UUID; */ public class Island3 extends mage.cards.basiclands.Island { - public Island3(UUID ownerId) { - super(ownerId, 293); - this.expansionSetCode = "CHK"; - } + public Island3(UUID ownerId) { + super(ownerId, 293); + this.expansionSetCode = "CHK"; + } - public Island3(final Island3 card) { - super(card); - } + public Island3(final Island3 card) { + super(card); + } - @Override - public Island3 copy() { - return new Island3(this); - } + @Override + public Island3 copy() { + return new Island3(this); + } } diff --git a/Mage.Sets/src/mage/sets/championsofkamigawa/Island4.java b/Mage.Sets/src/mage/sets/championsofkamigawa/Island4.java index 32e53a6a8e..fab6c554ed 100644 --- a/Mage.Sets/src/mage/sets/championsofkamigawa/Island4.java +++ b/Mage.Sets/src/mage/sets/championsofkamigawa/Island4.java @@ -36,18 +36,18 @@ import java.util.UUID; */ public class Island4 extends mage.cards.basiclands.Island { - public Island4(UUID ownerId) { - super(ownerId, 294); - this.expansionSetCode = "CHK"; - } + public Island4(UUID ownerId) { + super(ownerId, 294); + this.expansionSetCode = "CHK"; + } - public Island4(final Island4 card) { - super(card); - } + public Island4(final Island4 card) { + super(card); + } - @Override - public Island4 copy() { - return new Island4(this); - } + @Override + public Island4 copy() { + return new Island4(this); + } } diff --git a/Mage.Sets/src/mage/sets/championsofkamigawa/JadeIdol.java b/Mage.Sets/src/mage/sets/championsofkamigawa/JadeIdol.java index 26e592f7f8..fb5ff10880 100644 --- a/Mage.Sets/src/mage/sets/championsofkamigawa/JadeIdol.java +++ b/Mage.Sets/src/mage/sets/championsofkamigawa/JadeIdol.java @@ -46,7 +46,7 @@ import mage.game.permanent.token.Token; public class JadeIdol extends CardImpl { private final static FilterSpiritOrArcaneCard filter = new FilterSpiritOrArcaneCard(); - + public JadeIdol(UUID ownerId) { super(ownerId, 256, "Jade Idol", Rarity.UNCOMMON, new CardType[]{CardType.ARTIFACT}, "{4}"); this.expansionSetCode = "CHK"; diff --git a/Mage.Sets/src/mage/sets/championsofkamigawa/JoyousRespite.java b/Mage.Sets/src/mage/sets/championsofkamigawa/JoyousRespite.java index 1f045f6d16..b9f721bf6f 100644 --- a/Mage.Sets/src/mage/sets/championsofkamigawa/JoyousRespite.java +++ b/Mage.Sets/src/mage/sets/championsofkamigawa/JoyousRespite.java @@ -52,7 +52,7 @@ public class JoyousRespite extends CardImpl { super(ownerId, 216, "Joyous Respite", Rarity.COMMON, new CardType[]{CardType.SORCERY}, "{3}{G}"); this.expansionSetCode = "CHK"; this.subtype.add("Arcane"); - this.color.setGreen(true); + this.color.setGreen(true); this.getSpellAbility().addEffect(new GainLifeEffect(new PermanentsOnBattlefieldCount(filter))); } diff --git a/Mage.Sets/src/mage/sets/championsofkamigawa/JuganTheRisingStar.java b/Mage.Sets/src/mage/sets/championsofkamigawa/JuganTheRisingStar.java index dedc354a26..bed48c95ae 100644 --- a/Mage.Sets/src/mage/sets/championsofkamigawa/JuganTheRisingStar.java +++ b/Mage.Sets/src/mage/sets/championsofkamigawa/JuganTheRisingStar.java @@ -80,22 +80,22 @@ public class JuganTheRisingStar extends CardImpl { class JuganTheRisingStarMultiEffect extends OneShotEffect { - public JuganTheRisingStarMultiEffect() { - super(Outcome.BoostCreature); + public JuganTheRisingStarMultiEffect() { + super(Outcome.BoostCreature); this.staticText = "distribute five +1/+1 counters among any number of target creatures"; - } + } - public JuganTheRisingStarMultiEffect(final JuganTheRisingStarMultiEffect effect) { - super(effect); - } + public JuganTheRisingStarMultiEffect(final JuganTheRisingStarMultiEffect effect) { + super(effect); + } - @Override - public JuganTheRisingStarMultiEffect copy() { - return new JuganTheRisingStarMultiEffect(this); - } + @Override + public JuganTheRisingStarMultiEffect copy() { + return new JuganTheRisingStarMultiEffect(this); + } - @Override - public boolean apply(Game game, Ability source) { + @Override + public boolean apply(Game game, Ability source) { if (source.getTargets().size() > 0) { Target multiTarget = source.getTargets().get(0); for (UUID target: multiTarget.getTargets()) { @@ -105,7 +105,7 @@ class JuganTheRisingStarMultiEffect extends OneShotEffect { this.expansionSetCode = "CHK"; this.subtype.add("Human"); this.subtype.add("Monk"); - this.color.setGreen(true); + this.color.setGreen(true); this.power = new MageInt(1); this.toughness = new MageInt(1); this.addAbility(new ForestwalkAbility()); diff --git a/Mage.Sets/src/mage/sets/championsofkamigawa/KamiOfAncientLaw.java b/Mage.Sets/src/mage/sets/championsofkamigawa/KamiOfAncientLaw.java index ec58885b0d..7941cee457 100644 --- a/Mage.Sets/src/mage/sets/championsofkamigawa/KamiOfAncientLaw.java +++ b/Mage.Sets/src/mage/sets/championsofkamigawa/KamiOfAncientLaw.java @@ -59,7 +59,7 @@ public class KamiOfAncientLaw extends CardImpl { super(ownerId, 21, "Kami of Ancient Law", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{1}{W}"); this.expansionSetCode = "CHK"; this.subtype.add("Spirit"); - this.color.setWhite(true); + this.color.setWhite(true); this.power = new MageInt(2); this.toughness = new MageInt(2); Ability ability = new SimpleActivatedAbility(Constants.Zone.BATTLEFIELD, new DestroyTargetEffect(), new SacrificeSourceCost()); diff --git a/Mage.Sets/src/mage/sets/championsofkamigawa/KamiOfFiresRoar.java b/Mage.Sets/src/mage/sets/championsofkamigawa/KamiOfFiresRoar.java index f557350980..2ba2870a81 100644 --- a/Mage.Sets/src/mage/sets/championsofkamigawa/KamiOfFiresRoar.java +++ b/Mage.Sets/src/mage/sets/championsofkamigawa/KamiOfFiresRoar.java @@ -48,7 +48,7 @@ import mage.target.common.TargetCreaturePermanent; public class KamiOfFiresRoar extends CardImpl { private final static FilterSpiritOrArcaneCard filter = new FilterSpiritOrArcaneCard(); - + public KamiOfFiresRoar(UUID ownerId) { super(ownerId, 174, "Kami of Fire's Roar", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{3}{R}"); this.expansionSetCode = "CHK"; diff --git a/Mage.Sets/src/mage/sets/championsofkamigawa/KamiOfOldStone.java b/Mage.Sets/src/mage/sets/championsofkamigawa/KamiOfOldStone.java index 56fa540c14..596b79300d 100644 --- a/Mage.Sets/src/mage/sets/championsofkamigawa/KamiOfOldStone.java +++ b/Mage.Sets/src/mage/sets/championsofkamigawa/KamiOfOldStone.java @@ -44,7 +44,7 @@ public class KamiOfOldStone extends CardImpl { super(ownerId, 22, "Kami of Old Stone", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{3}{W}"); this.expansionSetCode = "CHK"; this.subtype.add("Spirit"); - this.color.setWhite(true); + this.color.setWhite(true); this.power = new MageInt(1); this.toughness = new MageInt(7); } diff --git a/Mage.Sets/src/mage/sets/championsofkamigawa/KamiOfTheHunt.java b/Mage.Sets/src/mage/sets/championsofkamigawa/KamiOfTheHunt.java index 3f67b75a4b..894eb37cc1 100644 --- a/Mage.Sets/src/mage/sets/championsofkamigawa/KamiOfTheHunt.java +++ b/Mage.Sets/src/mage/sets/championsofkamigawa/KamiOfTheHunt.java @@ -45,7 +45,7 @@ import mage.filter.common.FilterSpiritOrArcaneCard; public class KamiOfTheHunt extends CardImpl { private final static FilterSpiritOrArcaneCard filter = new FilterSpiritOrArcaneCard(); - + public KamiOfTheHunt(UUID ownerId) { super(ownerId, 219, "Kami of the Hunt", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{2}{G}"); this.expansionSetCode = "CHK"; diff --git a/Mage.Sets/src/mage/sets/championsofkamigawa/KamiOfTheWaningMoon.java b/Mage.Sets/src/mage/sets/championsofkamigawa/KamiOfTheWaningMoon.java index 49382f69f6..6c996eed8f 100644 --- a/Mage.Sets/src/mage/sets/championsofkamigawa/KamiOfTheWaningMoon.java +++ b/Mage.Sets/src/mage/sets/championsofkamigawa/KamiOfTheWaningMoon.java @@ -49,7 +49,7 @@ import mage.target.common.TargetCreaturePermanent; public class KamiOfTheWaningMoon extends CardImpl { private final static FilterSpiritOrArcaneCard filter = new FilterSpiritOrArcaneCard(); - + public KamiOfTheWaningMoon(UUID ownerId) { super(ownerId, 120, "Kami of the Waning Moon", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{2}{B}"); this.expansionSetCode = "CHK"; diff --git a/Mage.Sets/src/mage/sets/championsofkamigawa/KikuNightsFlower.java b/Mage.Sets/src/mage/sets/championsofkamigawa/KikuNightsFlower.java index d05420052d..821501ca7f 100644 --- a/Mage.Sets/src/mage/sets/championsofkamigawa/KikuNightsFlower.java +++ b/Mage.Sets/src/mage/sets/championsofkamigawa/KikuNightsFlower.java @@ -49,17 +49,17 @@ import mage.target.common.TargetCreaturePermanent; * @author LevelX */ public class KikuNightsFlower extends CardImpl { - + public KikuNightsFlower (UUID ownerId) { super(ownerId, 121, "Kiku, Night's Flower", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{B}{B}"); this.expansionSetCode = "CHK"; this.supertype.add("Legendary"); this.subtype.add("Human"); this.subtype.add("Assassin"); - this.color.setBlack(true); + this.color.setBlack(true); this.power = new MageInt(1); this.toughness = new MageInt(1); - + // {2}{B}{B}, {T}: Target creature deals damage to itself equal to its power. Ability ability; ability = new SimpleActivatedAbility( @@ -89,23 +89,23 @@ class KikuNightsFlowerEffect extends OneShotEffect { this.staticText = "Target creature deals damage to itself equal to its power"; } - public KikuNightsFlowerEffect(final KikuNightsFlowerEffect effect) { - super(effect); - } + public KikuNightsFlowerEffect(final KikuNightsFlowerEffect effect) { + super(effect); + } - @Override - public KikuNightsFlowerEffect copy() { - return new KikuNightsFlowerEffect(this); - } + @Override + public KikuNightsFlowerEffect copy() { + return new KikuNightsFlowerEffect(this); + } - @Override - public boolean apply(Game game, Ability source) { - Permanent permanent = game.getPermanent(targetPointer.getFirst(game, source)); - if (permanent != null) { - permanent.damage(permanent.getPower().getValue(), permanent.getId(), game, true, false); - return true; - } - return false; - } + @Override + public boolean apply(Game game, Ability source) { + Permanent permanent = game.getPermanent(targetPointer.getFirst(game, source)); + if (permanent != null) { + permanent.damage(permanent.getPower().getValue(), permanent.getId(), game, true, false); + return true; + } + return false; + } } diff --git a/Mage.Sets/src/mage/sets/championsofkamigawa/KitsuneBlademaster.java b/Mage.Sets/src/mage/sets/championsofkamigawa/KitsuneBlademaster.java index 2129b9da35..998cd52c6c 100644 --- a/Mage.Sets/src/mage/sets/championsofkamigawa/KitsuneBlademaster.java +++ b/Mage.Sets/src/mage/sets/championsofkamigawa/KitsuneBlademaster.java @@ -47,7 +47,7 @@ public class KitsuneBlademaster extends CardImpl { this.expansionSetCode = "CHK"; this.subtype.add("Fox"); this.subtype.add("Samurai"); - this.color.setWhite(true); + this.color.setWhite(true); this.power = new MageInt(2); this.toughness = new MageInt(2); this.addAbility(FirstStrikeAbility.getInstance()); diff --git a/Mage.Sets/src/mage/sets/championsofkamigawa/KitsuneDiviner.java b/Mage.Sets/src/mage/sets/championsofkamigawa/KitsuneDiviner.java index b80c98fce4..41d911da17 100644 --- a/Mage.Sets/src/mage/sets/championsofkamigawa/KitsuneDiviner.java +++ b/Mage.Sets/src/mage/sets/championsofkamigawa/KitsuneDiviner.java @@ -61,7 +61,7 @@ public class KitsuneDiviner extends CardImpl { this.expansionSetCode = "CHK"; this.subtype.add("Fox"); this.subtype.add("Cleric"); - this.color.setWhite(true); + this.color.setWhite(true); this.power = new MageInt(0); this.toughness = new MageInt(1); Ability ability = new SimpleActivatedAbility(Constants.Zone.BATTLEFIELD, new TapTargetEffect(), new TapSourceCost()); diff --git a/Mage.Sets/src/mage/sets/championsofkamigawa/KitsuneHealer.java b/Mage.Sets/src/mage/sets/championsofkamigawa/KitsuneHealer.java index ee4fa316e7..6050fb5dcc 100644 --- a/Mage.Sets/src/mage/sets/championsofkamigawa/KitsuneHealer.java +++ b/Mage.Sets/src/mage/sets/championsofkamigawa/KitsuneHealer.java @@ -88,34 +88,34 @@ public class KitsuneHealer extends CardImpl { class KitsuneHealerEffect extends PreventionEffectImpl { - public KitsuneHealerEffect() { - super(Constants.Duration.EndOfTurn); - staticText = "Prevent all damage that would be dealt to target legendary creature this turn"; - } + public KitsuneHealerEffect() { + super(Constants.Duration.EndOfTurn); + staticText = "Prevent all damage that would be dealt to target legendary creature this turn"; + } - public KitsuneHealerEffect(final KitsuneHealerEffect effect) { - super(effect); - } + public KitsuneHealerEffect(final KitsuneHealerEffect effect) { + super(effect); + } - @Override - public KitsuneHealerEffect copy() { - return new KitsuneHealerEffect(); - } + @Override + public KitsuneHealerEffect copy() { + return new KitsuneHealerEffect(); + } - @Override - public boolean apply(Game game, Ability source) { - return true; - } + @Override + public boolean apply(Game game, Ability source) { + return true; + } - @Override - public boolean replaceEvent(GameEvent event, Ability source, Game game) { - GameEvent preventEvent = new GameEvent(GameEvent.EventType.PREVENT_DAMAGE, source.getFirstTarget(), source.getId(), source.getControllerId(), event.getAmount(), false); - if (!game.replaceEvent(preventEvent)) { - int damage = event.getAmount(); - event.setAmount(0); - game.fireEvent(GameEvent.getEvent(GameEvent.EventType.PREVENTED_DAMAGE, source.getFirstTarget(), source.getId(), source.getControllerId(), damage)); - } - return false; - } + @Override + public boolean replaceEvent(GameEvent event, Ability source, Game game) { + GameEvent preventEvent = new GameEvent(GameEvent.EventType.PREVENT_DAMAGE, source.getFirstTarget(), source.getId(), source.getControllerId(), event.getAmount(), false); + if (!game.replaceEvent(preventEvent)) { + int damage = event.getAmount(); + event.setAmount(0); + game.fireEvent(GameEvent.getEvent(GameEvent.EventType.PREVENTED_DAMAGE, source.getFirstTarget(), source.getId(), source.getControllerId(), damage)); + } + return false; + } } diff --git a/Mage.Sets/src/mage/sets/championsofkamigawa/KodamaOfTheNorthTree.java b/Mage.Sets/src/mage/sets/championsofkamigawa/KodamaOfTheNorthTree.java index 732872749d..0a495a89fd 100644 --- a/Mage.Sets/src/mage/sets/championsofkamigawa/KodamaOfTheNorthTree.java +++ b/Mage.Sets/src/mage/sets/championsofkamigawa/KodamaOfTheNorthTree.java @@ -47,7 +47,7 @@ public class KodamaOfTheNorthTree extends CardImpl { this.expansionSetCode = "CHK"; this.supertype.add("Legendary"); this.subtype.add("Spirit"); - this.color.setGreen(true); + this.color.setGreen(true); this.power = new MageInt(6); this.toughness = new MageInt(4); this.addAbility(TrampleAbility.getInstance()); diff --git a/Mage.Sets/src/mage/sets/championsofkamigawa/KodamaOfTheSouthTree.java b/Mage.Sets/src/mage/sets/championsofkamigawa/KodamaOfTheSouthTree.java index 910dfa9168..62ca700ef7 100644 --- a/Mage.Sets/src/mage/sets/championsofkamigawa/KodamaOfTheSouthTree.java +++ b/Mage.Sets/src/mage/sets/championsofkamigawa/KodamaOfTheSouthTree.java @@ -49,7 +49,7 @@ import mage.filter.common.FilterSpiritOrArcaneCard; public class KodamaOfTheSouthTree extends CardImpl { private final static FilterSpiritOrArcaneCard filter = new FilterSpiritOrArcaneCard(); - + public KodamaOfTheSouthTree(UUID ownerId) { super(ownerId, 223, "Kodama of the South Tree", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{2}{G}{G}"); this.expansionSetCode = "CHK"; diff --git a/Mage.Sets/src/mage/sets/championsofkamigawa/KondasBanner.java b/Mage.Sets/src/mage/sets/championsofkamigawa/KondasBanner.java index c42806d12d..da3aaff0fc 100644 --- a/Mage.Sets/src/mage/sets/championsofkamigawa/KondasBanner.java +++ b/Mage.Sets/src/mage/sets/championsofkamigawa/KondasBanner.java @@ -61,28 +61,28 @@ public class KondasBanner extends CardImpl { legendaryFilter.getSupertype().add("Legendary"); legendaryFilter.setScopeSupertype(Filter.ComparisonScope.Any); } - + public KondasBanner(UUID ownerId) { super(ownerId, 259, "Konda's Banner", Rarity.RARE, new CardType[]{CardType.ARTIFACT}, "{2}"); this.expansionSetCode = "CHK"; this.supertype.add("Legendary"); this.subtype.add("Equipment"); - + // Creatures that share a color with equipped creature get +1/+1. this.addAbility(new SimpleStaticAbility(Constants.Zone.BATTLEFIELD, new KondasBannerColorBoostEffect())); // Creatures that share a creature type with equipped creature get +1/+1. this.addAbility(new SimpleStaticAbility(Constants.Zone.BATTLEFIELD, new KondasBannerTypeBoostEffect())); - + // Konda's Banner can be attached only to a legendary creature. // Equip {2} this.addAbility(new EquipAbility( Constants.Outcome.AddAbility, new GenericManaCost(2), new TargetControlledCreaturePermanent(1,1, legendaryFilter, false))); - + } - + public KondasBanner(final KondasBanner card) { super(card); } @@ -95,22 +95,22 @@ public class KondasBanner extends CardImpl { class KondasBannerTypeBoostEffect extends BoostAllEffect { - private static final String effectText = "Creatures that share a creature type with equipped creature get +1/+1"; - - KondasBannerTypeBoostEffect() { - super(1,1, Constants.Duration.WhileOnBattlefield, new FilterCreaturePermanent(), false); - staticText = effectText; - } + private static final String effectText = "Creatures that share a creature type with equipped creature get +1/+1"; - KondasBannerTypeBoostEffect(KondasBannerTypeBoostEffect effect) { - super(effect); - } + KondasBannerTypeBoostEffect() { + super(1,1, Constants.Duration.WhileOnBattlefield, new FilterCreaturePermanent(), false); + staticText = effectText; + } - @Override + KondasBannerTypeBoostEffect(KondasBannerTypeBoostEffect effect) { + super(effect); + } + + @Override public boolean apply(Game game, Ability source) { // Check if the equipment is attached Permanent equipment = game.getPermanent(source.getSourceId()); - if (equipment != null && equipment.getAttachedTo() != null) + if (equipment != null && equipment.getAttachedTo() != null) { Permanent equipedCreature = game.getPermanent(equipment.getAttachedTo()); if (equipedCreature != null) { @@ -129,51 +129,51 @@ class KondasBannerTypeBoostEffect extends BoostAllEffect { return false; } - @Override - public KondasBannerTypeBoostEffect copy() { - return new KondasBannerTypeBoostEffect(this); - } + @Override + public KondasBannerTypeBoostEffect copy() { + return new KondasBannerTypeBoostEffect(this); + } } class KondasBannerColorBoostEffect extends BoostAllEffect { - private static final String effectText = "Creatures that share a color with equipped creature get +1/+1."; - - KondasBannerColorBoostEffect() { - super(1,1, Constants.Duration.WhileOnBattlefield, new FilterCreaturePermanent(), false); - staticText = effectText; - } + private static final String effectText = "Creatures that share a color with equipped creature get +1/+1."; - KondasBannerColorBoostEffect(KondasBannerColorBoostEffect effect) { - super(effect); - } + KondasBannerColorBoostEffect() { + super(1,1, Constants.Duration.WhileOnBattlefield, new FilterCreaturePermanent(), false); + staticText = effectText; + } - @Override + KondasBannerColorBoostEffect(KondasBannerColorBoostEffect effect) { + super(effect); + } + + @Override public boolean apply(Game game, Ability source) { // Check if the equipment is attached Permanent equipment = game.getPermanent(source.getSourceId()); - if (equipment != null && equipment.getAttachedTo() != null) + if (equipment != null && equipment.getAttachedTo() != null) { Permanent equipedCreature = game.getPermanent(equipment.getAttachedTo()); for (Permanent perm: game.getBattlefield().getActivePermanents(filter, source.getControllerId(), source.getSourceId(), game)) { if (equipedCreature.getColor().shares(perm.getColor())) { - if (!this.affectedObjectsSet || objects.contains(perm.getId())) { - perm.addPower(power.calculate(game, source)); - perm.addToughness(toughness.calculate(game, source)); + if (!this.affectedObjectsSet || objects.contains(perm.getId())) { + perm.addPower(power.calculate(game, source)); + perm.addToughness(toughness.calculate(game, source)); } - + } - } - return true; + } + return true; } return false; } - @Override - public KondasBannerColorBoostEffect copy() { - return new KondasBannerColorBoostEffect(this); - } + @Override + public KondasBannerColorBoostEffect copy() { + return new KondasBannerColorBoostEffect(this); + } } \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/championsofkamigawa/KondasHatamoto.java b/Mage.Sets/src/mage/sets/championsofkamigawa/KondasHatamoto.java index 062871d989..a70459e998 100644 --- a/Mage.Sets/src/mage/sets/championsofkamigawa/KondasHatamoto.java +++ b/Mage.Sets/src/mage/sets/championsofkamigawa/KondasHatamoto.java @@ -49,7 +49,7 @@ import mage.filter.common.FilterControlledPermanent; * @author LevelX */ public class KondasHatamoto extends CardImpl{ - + private static final FilterControlledPermanent filter = new FilterControlledPermanent("Legendary Samurai"); private static final String rule1 = "As long as you control a legendary Samurai, {this} gets +1/+2"; private static final String rule2 = "As long as you control a legendary Samurai, {this} has vigilance"; @@ -60,7 +60,7 @@ public class KondasHatamoto extends CardImpl{ filter.getSubtype().add("Samurai"); filter.setScopeSubtype(Filter.ComparisonScope.Any); } - + public KondasHatamoto (UUID ownerId) { super(ownerId, 31, "Konda's Hatamoto", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{1}{W}"); this.expansionSetCode = "CHK"; @@ -69,14 +69,14 @@ public class KondasHatamoto extends CardImpl{ this.color.setWhite(true); this.power = new MageInt(1); this.toughness = new MageInt(2); - + this.addAbility(new BushidoAbility(1)); - + ConditionalContinousEffect effect1 = new ConditionalContinousEffect(new BoostSourceEffect(1, 2, Duration.WhileOnBattlefield), new ControlsPermanentCondition(filter), rule1); this.addAbility(new SimpleStaticAbility(Constants.Zone.BATTLEFIELD, effect1)); ConditionalContinousEffect effect2 = new ConditionalContinousEffect(new GainAbilitySourceEffect(VigilanceAbility.getInstance()), new ControlsPermanentCondition(filter), rule2); this.addAbility(new SimpleStaticAbility(Constants.Zone.BATTLEFIELD, effect2)); - + } public KondasHatamoto (final KondasHatamoto card) { diff --git a/Mage.Sets/src/mage/sets/championsofkamigawa/KumanoMasterYamabushi.java b/Mage.Sets/src/mage/sets/championsofkamigawa/KumanoMasterYamabushi.java index ff7df7259d..55d628735c 100644 --- a/Mage.Sets/src/mage/sets/championsofkamigawa/KumanoMasterYamabushi.java +++ b/Mage.Sets/src/mage/sets/championsofkamigawa/KumanoMasterYamabushi.java @@ -78,7 +78,7 @@ public class KumanoMasterYamabushi extends CardImpl { this.color.setRed(true); this.power = new MageInt(4); this.toughness = new MageInt(4); - + // {{1}{R}: Kumano, Master Yamabushi deals 1 damage to target creature or player. Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DamageTargetEffect(1), new ManaCostsImpl("{1}{R}") ); ability.addTarget(new TargetCreatureOrPlayer()); @@ -100,43 +100,43 @@ public class KumanoMasterYamabushi extends CardImpl { } class KumanaoMasterYamabushiEffect extends ReplacementEffectImpl { - public KumanaoMasterYamabushiEffect() { - super(Duration.EndOfTurn, Outcome.Exile); - staticText = "If a creature dealt damage by {this} this turn would die, exile it instead"; - } + public KumanaoMasterYamabushiEffect() { + super(Duration.EndOfTurn, Outcome.Exile); + staticText = "If a creature dealt damage by {this} this turn would die, exile it instead"; + } - public KumanaoMasterYamabushiEffect(final KumanaoMasterYamabushiEffect effect) { - super(effect); - } + public KumanaoMasterYamabushiEffect(final KumanaoMasterYamabushiEffect effect) { + super(effect); + } - @Override - public KumanaoMasterYamabushiEffect copy() { - return new KumanaoMasterYamabushiEffect(this); - } + @Override + public KumanaoMasterYamabushiEffect copy() { + return new KumanaoMasterYamabushiEffect(this); + } - @Override - public boolean apply(Game game, Ability source) { - return true; - } + @Override + public boolean apply(Game game, Ability source) { + return true; + } - @Override - public boolean replaceEvent(GameEvent event, Ability source, Game game) { + @Override + public boolean replaceEvent(GameEvent event, Ability source, Game game) { Permanent permanent = ((ZoneChangeEvent)event).getTarget(); if (permanent != null) { return permanent.moveToExile(null, "", source.getId(), game); } - return false; - } + return false; + } - @Override - public boolean applies(GameEvent event, Ability source, Game game) { - if (event.getType() == EventType.ZONE_CHANGE && ((ZoneChangeEvent)event).isDiesEvent()) { + @Override + public boolean applies(GameEvent event, Ability source, Game game) { + if (event.getType() == EventType.ZONE_CHANGE && ((ZoneChangeEvent)event).isDiesEvent()) { DamagedByWatcher watcher = (DamagedByWatcher) game.getState().getWatchers().get("DamagedByWatcher", source.getSourceId()); if (watcher != null) return watcher.damagedCreatures.contains(event.getTargetId()); } - return false; - } + return false; + } } \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/championsofkamigawa/KumanosPupil.java b/Mage.Sets/src/mage/sets/championsofkamigawa/KumanosPupil.java index 971970d90f..d0522e2501 100644 --- a/Mage.Sets/src/mage/sets/championsofkamigawa/KumanosPupil.java +++ b/Mage.Sets/src/mage/sets/championsofkamigawa/KumanosPupil.java @@ -69,10 +69,10 @@ public class KumanosPupil extends CardImpl { this.color.setRed(true); this.power = new MageInt(3); this.toughness = new MageInt(3); - + // If a creature dealt damage by Kumano's Pupils this turn would die, exile it instead. this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new KumanosPupilEffect())); - + this.addWatcher(new DamagedByWatcher()); } @@ -90,43 +90,43 @@ public class KumanosPupil extends CardImpl { class KumanosPupilEffect extends ReplacementEffectImpl { - public KumanosPupilEffect() { - super(Duration.EndOfTurn, Outcome.Exile); - staticText = "If a creature dealt damage by {this} this turn would die, exile it instead"; - } + public KumanosPupilEffect() { + super(Duration.EndOfTurn, Outcome.Exile); + staticText = "If a creature dealt damage by {this} this turn would die, exile it instead"; + } - public KumanosPupilEffect(final KumanosPupilEffect effect) { - super(effect); - } + public KumanosPupilEffect(final KumanosPupilEffect effect) { + super(effect); + } - @Override - public KumanosPupilEffect copy() { - return new KumanosPupilEffect(this); - } + @Override + public KumanosPupilEffect copy() { + return new KumanosPupilEffect(this); + } - @Override - public boolean apply(Game game, Ability source) { - return true; - } + @Override + public boolean apply(Game game, Ability source) { + return true; + } - @Override - public boolean replaceEvent(GameEvent event, Ability source, Game game) { + @Override + public boolean replaceEvent(GameEvent event, Ability source, Game game) { Permanent permanent = ((ZoneChangeEvent)event).getTarget(); if (permanent != null) { return permanent.moveToExile(null, "", source.getId(), game); } - return false; - } + return false; + } - @Override - public boolean applies(GameEvent event, Ability source, Game game) { - if (event.getType() == EventType.ZONE_CHANGE && ((ZoneChangeEvent)event).isDiesEvent()) { + @Override + public boolean applies(GameEvent event, Ability source, Game game) { + if (event.getType() == EventType.ZONE_CHANGE && ((ZoneChangeEvent)event).isDiesEvent()) { DamagedByWatcher watcher = (DamagedByWatcher) game.getState().getWatchers().get("DamagedByWatcher", source.getSourceId()); if (watcher != null) return watcher.damagedCreatures.contains(event.getTargetId()); } - return false; - } + return false; + } } \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/championsofkamigawa/LanternKami.java b/Mage.Sets/src/mage/sets/championsofkamigawa/LanternKami.java index cb94c81a12..5de6c72844 100644 --- a/Mage.Sets/src/mage/sets/championsofkamigawa/LanternKami.java +++ b/Mage.Sets/src/mage/sets/championsofkamigawa/LanternKami.java @@ -45,7 +45,7 @@ public class LanternKami extends CardImpl { super(ownerId, 32, "Lantern Kami", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{W}"); this.expansionSetCode = "CHK"; this.subtype.add("Spirit"); - this.color.setWhite(true); + this.color.setWhite(true); this.power = new MageInt(1); this.toughness = new MageInt(1); this.addAbility(FlyingAbility.getInstance()); diff --git a/Mage.Sets/src/mage/sets/championsofkamigawa/LavaSpike.java b/Mage.Sets/src/mage/sets/championsofkamigawa/LavaSpike.java index b0d0a25198..418f44d88c 100644 --- a/Mage.Sets/src/mage/sets/championsofkamigawa/LavaSpike.java +++ b/Mage.Sets/src/mage/sets/championsofkamigawa/LavaSpike.java @@ -45,10 +45,10 @@ public class LavaSpike extends CardImpl { super(ownerId, 178, "Lava Spike", Rarity.COMMON, new CardType[]{CardType.SORCERY}, "{R}"); this.expansionSetCode = "CHK"; this.subtype.add("Arcane"); - this.color.setRed(true); + this.color.setRed(true); this.getSpellAbility().addTarget(new TargetPlayer()); - this.getSpellAbility().addEffect(new DamageTargetEffect(3)); - + this.getSpellAbility().addEffect(new DamageTargetEffect(3)); + } public LavaSpike (final LavaSpike card) { diff --git a/Mage.Sets/src/mage/sets/championsofkamigawa/LongForgottenGohei.java b/Mage.Sets/src/mage/sets/championsofkamigawa/LongForgottenGohei.java index a9e7e254cf..d7f1dc395b 100644 --- a/Mage.Sets/src/mage/sets/championsofkamigawa/LongForgottenGohei.java +++ b/Mage.Sets/src/mage/sets/championsofkamigawa/LongForgottenGohei.java @@ -53,12 +53,12 @@ import mage.util.CardUtil; */ public class LongForgottenGohei extends CardImpl { - + private final static FilterCreaturePermanent spiritFilter = new FilterCreaturePermanent("Spirits"); static { spiritFilter.getSubtype().add("Spirit"); } - + public LongForgottenGohei(UUID ownerId) { super(ownerId, 261, "Long-Forgotten Gohei", Rarity.RARE, new CardType[]{CardType.ARTIFACT}, "{3}"); this.expansionSetCode = "CHK"; @@ -79,38 +79,38 @@ public class LongForgottenGohei extends CardImpl { class LongForgottenGoheiCostReductionEffect extends CostModificationEffectImpl { - LongForgottenGoheiCostReductionEffect ( ) { - super(Duration.WhileOnBattlefield, Outcome.Benefit); - staticText = "Arcane spells you cast cost {1} less to cast."; - } + LongForgottenGoheiCostReductionEffect ( ) { + super(Duration.WhileOnBattlefield, Outcome.Benefit); + staticText = "Arcane spells you cast cost {1} less to cast."; + } - LongForgottenGoheiCostReductionEffect(LongForgottenGoheiCostReductionEffect effect) { - super(effect); - } + LongForgottenGoheiCostReductionEffect(LongForgottenGoheiCostReductionEffect effect) { + super(effect); + } - @Override - public boolean apply(Game game, Ability source, Ability abilityToModify) { - SpellAbility spellAbility = (SpellAbility) abilityToModify; - CardUtil.adjustCost(spellAbility, 1); - return true; - } - - @Override - public boolean applies(Ability abilityToModify, Ability source, Game game) { - if ( abilityToModify instanceof SpellAbility ) { - Card sourceCard = game.getCard(((SpellAbility)abilityToModify).getSourceId()); - if ( sourceCard != null && + @Override + public boolean apply(Game game, Ability source, Ability abilityToModify) { + SpellAbility spellAbility = (SpellAbility) abilityToModify; + CardUtil.adjustCost(spellAbility, 1); + return true; + } + + @Override + public boolean applies(Ability abilityToModify, Ability source, Game game) { + if ( abilityToModify instanceof SpellAbility ) { + Card sourceCard = game.getCard(((SpellAbility)abilityToModify).getSourceId()); + if ( sourceCard != null && sourceCard.getSubtype().contains("Arcane") && sourceCard.getOwnerId().equals(source.getControllerId()) ) { return true; - } - } - return false; - } + } + } + return false; + } - @Override - public LongForgottenGoheiCostReductionEffect copy() { - return new LongForgottenGoheiCostReductionEffect(this); - } + @Override + public LongForgottenGoheiCostReductionEffect copy() { + return new LongForgottenGoheiCostReductionEffect(this); + } } \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/championsofkamigawa/Lure.java b/Mage.Sets/src/mage/sets/championsofkamigawa/Lure.java index b872494d32..3fa0328ac7 100644 --- a/Mage.Sets/src/mage/sets/championsofkamigawa/Lure.java +++ b/Mage.Sets/src/mage/sets/championsofkamigawa/Lure.java @@ -55,12 +55,12 @@ public class Lure extends CardImpl { super(ownerId, 226, "Lure", Rarity.UNCOMMON, new CardType[]{CardType.ENCHANTMENT}, "{1}{G}{G}"); this.expansionSetCode = "CHK"; this.subtype.add("Aura"); - this.color.setGreen(true); + this.color.setGreen(true); TargetPermanent auraTarget = new TargetCreaturePermanent(); - this.getSpellAbility().addTarget(auraTarget); - this.getSpellAbility().addEffect(new AttachEffect(Outcome.AddAbility)); - Ability ability = new EnchantAbility(auraTarget.getTargetName()); - this.addAbility(ability); + this.getSpellAbility().addTarget(auraTarget); + this.getSpellAbility().addEffect(new AttachEffect(Outcome.AddAbility)); + Ability ability = new EnchantAbility(auraTarget.getTargetName()); + this.addAbility(ability); this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityAttachedEffect(new SimpleStaticAbility(Zone.BATTLEFIELD, new MustBlockSourceEffect()), AttachmentType.AURA))); } diff --git a/Mage.Sets/src/mage/sets/championsofkamigawa/MarrowGnawer.java b/Mage.Sets/src/mage/sets/championsofkamigawa/MarrowGnawer.java index 3cc133fba7..2f059f9ae5 100644 --- a/Mage.Sets/src/mage/sets/championsofkamigawa/MarrowGnawer.java +++ b/Mage.Sets/src/mage/sets/championsofkamigawa/MarrowGnawer.java @@ -65,16 +65,16 @@ public class MarrowGnawer extends CardImpl { filterSacrifice.getSubtype().add("Rat"); filter3.getSubtype().add("Rat"); } - + public MarrowGnawer (UUID ownerId) { super(ownerId, 124, "Marrow-Gnawer", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{3}{B}{B}"); this.expansionSetCode = "CHK"; this.subtype.add("Rat"); this.subtype.add("Rogue"); - this.color.setBlack(true); + this.color.setBlack(true); this.power = new MageInt(2); this.toughness = new MageInt(3); - + // Rat creatures have fear. (They can't be blocked except by artifact creatures and/or black creatures.) this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityAllEffect(FearAbility.getInstance(), Constants.Duration.WhileOnBattlefield, filterFear))); @@ -98,13 +98,13 @@ public class MarrowGnawer extends CardImpl { class RatToken extends Token { - public RatToken() { - super("Rat", "1/1 black Rat creature token"); - cardType.add(CardType.CREATURE); - color = ObjectColor.BLACK; - subtype.add("Rat"); - power = new MageInt(1); - toughness = new MageInt(1); - } + public RatToken() { + super("Rat", "1/1 black Rat creature token"); + cardType.add(CardType.CREATURE); + color = ObjectColor.BLACK; + subtype.add("Rat"); + power = new MageInt(1); + toughness = new MageInt(1); + } } \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/championsofkamigawa/MatsuTribeDecoy.java b/Mage.Sets/src/mage/sets/championsofkamigawa/MatsuTribeDecoy.java index b5069d6b7c..14f0629837 100644 --- a/Mage.Sets/src/mage/sets/championsofkamigawa/MatsuTribeDecoy.java +++ b/Mage.Sets/src/mage/sets/championsofkamigawa/MatsuTribeDecoy.java @@ -60,8 +60,8 @@ public class MatsuTribeDecoy extends CardImpl { // {2}{G}: Target creature blocks Matsu-Tribe Decoy this turn if able. Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new MustBlockSourceTargetEffect(), new ManaCostsImpl("{2}{G}")); - ability.addTarget(new TargetCreaturePermanent()); - this.addAbility(ability); + ability.addTarget(new TargetCreaturePermanent()); + this.addAbility(ability); // Whenever Kashi-Tribe Reaver deals combat damage to a creature, tap that creature and it doesn't untap during its controller's next untap step. Ability ability2; ability2 = new DealsCombatDamageToACreatureTriggeredAbility(new TapTargetEffect("that creature"), false, true); diff --git a/Mage.Sets/src/mage/sets/championsofkamigawa/Mindblaze.java b/Mage.Sets/src/mage/sets/championsofkamigawa/Mindblaze.java index bacff50a96..44e39117c8 100644 --- a/Mage.Sets/src/mage/sets/championsofkamigawa/Mindblaze.java +++ b/Mage.Sets/src/mage/sets/championsofkamigawa/Mindblaze.java @@ -57,7 +57,7 @@ public class Mindblaze extends CardImpl { public Mindblaze (UUID ownerId) { super(ownerId, 180, "Mindblaze", Rarity.RARE, new CardType[]{CardType.SORCERY}, "{5}{R}"); this.expansionSetCode = "CHK"; - this.color.setRed(true); + this.color.setRed(true); // Name a nonland card and choose a number greater than 0. Target player reveals his or her library. // If that library contains exactly the chosen number of the named card, @@ -94,7 +94,7 @@ class MindblazeEffect extends OneShotEffect { Player playerControls = game.getPlayer(source.getControllerId()); if (player != null && playerControls != null) { Choice cardChoice = new ChoiceImpl(); - cardChoice.setChoices(Sets.getNonLandCardNames()); + cardChoice.setChoices(Sets.getNonLandCardNames()); cardChoice.clearChoice(); Choice numberChoice = new ChoiceImpl(); numberChoice.setMessage("Choose a number greater than 0"); diff --git a/Mage.Sets/src/mage/sets/championsofkamigawa/MossKami.java b/Mage.Sets/src/mage/sets/championsofkamigawa/MossKami.java index 39971ae057..6194b3aea0 100644 --- a/Mage.Sets/src/mage/sets/championsofkamigawa/MossKami.java +++ b/Mage.Sets/src/mage/sets/championsofkamigawa/MossKami.java @@ -45,7 +45,7 @@ public class MossKami extends CardImpl { super(ownerId, 228, "Moss Kami", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{5}{G}"); this.expansionSetCode = "CHK"; this.subtype.add("Spirit"); - this.color.setGreen(true); + this.color.setGreen(true); this.power = new MageInt(5); this.toughness = new MageInt(5); this.addAbility(TrampleAbility.getInstance()); diff --git a/Mage.Sets/src/mage/sets/championsofkamigawa/MothriderSamurai.java b/Mage.Sets/src/mage/sets/championsofkamigawa/MothriderSamurai.java index 9f93302ae7..d73cd54c13 100644 --- a/Mage.Sets/src/mage/sets/championsofkamigawa/MothriderSamurai.java +++ b/Mage.Sets/src/mage/sets/championsofkamigawa/MothriderSamurai.java @@ -47,7 +47,7 @@ public class MothriderSamurai extends CardImpl { this.expansionSetCode = "CHK"; this.subtype.add("Human"); this.subtype.add("Samurai"); - this.color.setWhite(true); + this.color.setWhite(true); this.power = new MageInt(2); this.toughness = new MageInt(2); this.addAbility(FlyingAbility.getInstance()); diff --git a/Mage.Sets/src/mage/sets/championsofkamigawa/Mountain1.java b/Mage.Sets/src/mage/sets/championsofkamigawa/Mountain1.java index cfc7c13dad..7a3def97c6 100644 --- a/Mage.Sets/src/mage/sets/championsofkamigawa/Mountain1.java +++ b/Mage.Sets/src/mage/sets/championsofkamigawa/Mountain1.java @@ -36,19 +36,19 @@ import java.util.UUID; */ public class Mountain1 extends mage.cards.basiclands.Mountain { - public Mountain1(UUID ownerId) { - super(ownerId, 299); - this.expansionSetCode = "CHK"; - } + public Mountain1(UUID ownerId) { + super(ownerId, 299); + this.expansionSetCode = "CHK"; + } - public Mountain1(final Mountain1 card) { - super(card); - } + public Mountain1(final Mountain1 card) { + super(card); + } - @Override - public Mountain1 copy() { - return new Mountain1(this); - } + @Override + public Mountain1 copy() { + return new Mountain1(this); + } } diff --git a/Mage.Sets/src/mage/sets/championsofkamigawa/Mountain2.java b/Mage.Sets/src/mage/sets/championsofkamigawa/Mountain2.java index 386884cd3f..a18e3294e2 100644 --- a/Mage.Sets/src/mage/sets/championsofkamigawa/Mountain2.java +++ b/Mage.Sets/src/mage/sets/championsofkamigawa/Mountain2.java @@ -36,18 +36,18 @@ import java.util.UUID; */ public class Mountain2 extends mage.cards.basiclands.Mountain { - public Mountain2(UUID ownerId) { - super(ownerId, 300); - this.expansionSetCode = "CHK"; - } + public Mountain2(UUID ownerId) { + super(ownerId, 300); + this.expansionSetCode = "CHK"; + } - public Mountain2(final Mountain2 card) { - super(card); - } + public Mountain2(final Mountain2 card) { + super(card); + } - @Override - public Mountain2 copy() { - return new Mountain2(this); - } + @Override + public Mountain2 copy() { + return new Mountain2(this); + } } diff --git a/Mage.Sets/src/mage/sets/championsofkamigawa/Mountain3.java b/Mage.Sets/src/mage/sets/championsofkamigawa/Mountain3.java index 3974ec1de6..d50ca894d7 100644 --- a/Mage.Sets/src/mage/sets/championsofkamigawa/Mountain3.java +++ b/Mage.Sets/src/mage/sets/championsofkamigawa/Mountain3.java @@ -36,18 +36,18 @@ import java.util.UUID; */ public class Mountain3 extends mage.cards.basiclands.Mountain { - public Mountain3(UUID ownerId) { - super(ownerId, 301); - this.expansionSetCode = "CHK"; - } + public Mountain3(UUID ownerId) { + super(ownerId, 301); + this.expansionSetCode = "CHK"; + } - public Mountain3(final Mountain3 card) { - super(card); - } + public Mountain3(final Mountain3 card) { + super(card); + } - @Override - public Mountain3 copy() { - return new Mountain3(this); - } + @Override + public Mountain3 copy() { + return new Mountain3(this); + } } diff --git a/Mage.Sets/src/mage/sets/championsofkamigawa/Mountain4.java b/Mage.Sets/src/mage/sets/championsofkamigawa/Mountain4.java index 8aa355fbdd..8444bae14f 100644 --- a/Mage.Sets/src/mage/sets/championsofkamigawa/Mountain4.java +++ b/Mage.Sets/src/mage/sets/championsofkamigawa/Mountain4.java @@ -36,18 +36,18 @@ import java.util.UUID; */ public class Mountain4 extends mage.cards.basiclands.Mountain { - public Mountain4(UUID ownerId) { - super(ownerId, 302); - this.expansionSetCode = "CHK"; - } + public Mountain4(UUID ownerId) { + super(ownerId, 302); + this.expansionSetCode = "CHK"; + } - public Mountain4(final Mountain4 card) { - super(card); - } + public Mountain4(final Mountain4 card) { + super(card); + } - @Override - public Mountain4 copy() { - return new Mountain4(this); - } + @Override + public Mountain4 copy() { + return new Mountain4(this); + } } diff --git a/Mage.Sets/src/mage/sets/championsofkamigawa/NezumiBoneReader.java b/Mage.Sets/src/mage/sets/championsofkamigawa/NezumiBoneReader.java index dd53aebf1e..b23d73ae72 100644 --- a/Mage.Sets/src/mage/sets/championsofkamigawa/NezumiBoneReader.java +++ b/Mage.Sets/src/mage/sets/championsofkamigawa/NezumiBoneReader.java @@ -53,7 +53,7 @@ public class NezumiBoneReader extends CardImpl { this.expansionSetCode = "CHK"; this.subtype.add("Rat"); this.subtype.add("Shaman"); - this.color.setBlack(true); + this.color.setBlack(true); this.power = new MageInt(1); this.toughness = new MageInt(1); // {B}, Sacrifice a creature: Target player discards a card. Activate this ability only any time you could cast a sorcery. diff --git a/Mage.Sets/src/mage/sets/championsofkamigawa/NezumiRonin.java b/Mage.Sets/src/mage/sets/championsofkamigawa/NezumiRonin.java index 52d3946d7a..edbc328853 100644 --- a/Mage.Sets/src/mage/sets/championsofkamigawa/NezumiRonin.java +++ b/Mage.Sets/src/mage/sets/championsofkamigawa/NezumiRonin.java @@ -46,7 +46,7 @@ public class NezumiRonin extends CardImpl { this.expansionSetCode = "CHK"; this.subtype.add("Rat"); this.subtype.add("Samurai"); - this.color.setBlack(true); + this.color.setBlack(true); this.power = new MageInt(3); this.toughness = new MageInt(1); this.addAbility(new BushidoAbility(1)); diff --git a/Mage.Sets/src/mage/sets/championsofkamigawa/NightOfSoulsBetrayal.java b/Mage.Sets/src/mage/sets/championsofkamigawa/NightOfSoulsBetrayal.java index e25525628d..9c0261bc2b 100644 --- a/Mage.Sets/src/mage/sets/championsofkamigawa/NightOfSoulsBetrayal.java +++ b/Mage.Sets/src/mage/sets/championsofkamigawa/NightOfSoulsBetrayal.java @@ -49,7 +49,7 @@ public class NightOfSoulsBetrayal extends CardImpl { super(ownerId, 133, "Night of Souls' Betrayal", Rarity.RARE, new CardType[]{CardType.ENCHANTMENT}, "{2}{B}{B}"); this.expansionSetCode = "CHK"; this.supertype.add("Legendary"); - this.color.setBlack(true); + this.color.setBlack(true); this.addAbility(new SimpleStaticAbility(Constants.Zone.BATTLEFIELD, new BoostAllEffect(-1, -1, Constants.Duration.WhileOnBattlefield, filter, false))); } diff --git a/Mage.Sets/src/mage/sets/championsofkamigawa/NineRingedBo.java b/Mage.Sets/src/mage/sets/championsofkamigawa/NineRingedBo.java index c154ac3a36..d2d2853053 100644 --- a/Mage.Sets/src/mage/sets/championsofkamigawa/NineRingedBo.java +++ b/Mage.Sets/src/mage/sets/championsofkamigawa/NineRingedBo.java @@ -62,7 +62,7 @@ public class NineRingedBo extends CardImpl { filter.getSubtype().add("Spirit"); filter.setScopeSubtype(ComparisonScope.Any); } - + public NineRingedBo(UUID ownerId) { super(ownerId, 263, "Nine-Ringed Bo", Rarity.UNCOMMON, new CardType[]{CardType.ARTIFACT}, "{3}"); this.expansionSetCode = "CHK"; @@ -73,7 +73,7 @@ public class NineRingedBo extends CardImpl { // If that creature would die this turn, exile it instead. this.addAbility(ability); this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new NineRingedBoEffect())); - + this.addWatcher(new DamagedByWatcher()); } @@ -81,7 +81,7 @@ public class NineRingedBo extends CardImpl { public NineRingedBo(final NineRingedBo card) { super(card); } - + @Override public NineRingedBo copy() { return new NineRingedBo(this); @@ -90,44 +90,44 @@ public class NineRingedBo extends CardImpl { class NineRingedBoEffect extends ReplacementEffectImpl { - public NineRingedBoEffect() { - super(Duration.EndOfTurn, Outcome.Exile); - staticText = "If that creature would die this turn, exile it instead"; - } + public NineRingedBoEffect() { + super(Duration.EndOfTurn, Outcome.Exile); + staticText = "If that creature would die this turn, exile it instead"; + } - public NineRingedBoEffect(final NineRingedBoEffect effect) { - super(effect); - } + public NineRingedBoEffect(final NineRingedBoEffect effect) { + super(effect); + } - @Override - public NineRingedBoEffect copy() { - return new NineRingedBoEffect(this); - } + @Override + public NineRingedBoEffect copy() { + return new NineRingedBoEffect(this); + } - @Override - public boolean apply(Game game, Ability source) { - return true; - } + @Override + public boolean apply(Game game, Ability source) { + return true; + } - @Override - public boolean replaceEvent(GameEvent event, Ability source, Game game) { + @Override + public boolean replaceEvent(GameEvent event, Ability source, Game game) { Permanent permanent = ((ZoneChangeEvent)event).getTarget(); if (permanent != null) { return permanent.moveToExile(null, "", source.getId(), game); } - return false; - } + return false; + } - @Override - public boolean applies(GameEvent event, Ability source, Game game) { - if (event.getType() == EventType.ZONE_CHANGE && ((ZoneChangeEvent)event).isDiesEvent()) { + @Override + public boolean applies(GameEvent event, Ability source, Game game) { + if (event.getType() == EventType.ZONE_CHANGE && ((ZoneChangeEvent)event).isDiesEvent()) { DamagedByWatcher watcher = (DamagedByWatcher) game.getState().getWatchers().get("DamagedByWatcher", source.getSourceId()); if (watcher != null) return watcher.damagedCreatures.contains(event.getTargetId()); } - return false; - } + return false; + } } diff --git a/Mage.Sets/src/mage/sets/championsofkamigawa/NoDachi.java b/Mage.Sets/src/mage/sets/championsofkamigawa/NoDachi.java index fb23e9f10a..8b053c7459 100644 --- a/Mage.Sets/src/mage/sets/championsofkamigawa/NoDachi.java +++ b/Mage.Sets/src/mage/sets/championsofkamigawa/NoDachi.java @@ -51,8 +51,8 @@ public class NoDachi extends CardImpl { this.expansionSetCode = "CHK"; this.subtype.add("Equipment"); this.addAbility(new EquipAbility(Constants.Outcome.AddAbility, new GenericManaCost(3))); - this.addAbility(new SimpleStaticAbility(Constants.Zone.BATTLEFIELD, new GainAbilityAttachedEffect(FirstStrikeAbility.getInstance(), Constants.AttachmentType.EQUIPMENT))); - this.addAbility(new SimpleStaticAbility(Constants.Zone.BATTLEFIELD, new BoostEquippedEffect(2, 0))); + this.addAbility(new SimpleStaticAbility(Constants.Zone.BATTLEFIELD, new GainAbilityAttachedEffect(FirstStrikeAbility.getInstance(), Constants.AttachmentType.EQUIPMENT))); + this.addAbility(new SimpleStaticAbility(Constants.Zone.BATTLEFIELD, new BoostEquippedEffect(2, 0))); } public NoDachi (final NoDachi card) { diff --git a/Mage.Sets/src/mage/sets/championsofkamigawa/NumaiOutcast.java b/Mage.Sets/src/mage/sets/championsofkamigawa/NumaiOutcast.java index 8137d4d249..4d45bc4fda 100644 --- a/Mage.Sets/src/mage/sets/championsofkamigawa/NumaiOutcast.java +++ b/Mage.Sets/src/mage/sets/championsofkamigawa/NumaiOutcast.java @@ -53,7 +53,7 @@ public class NumaiOutcast extends CardImpl { this.expansionSetCode = "CHK"; this.subtype.add("Human"); this.subtype.add("Samurai"); - this.color.setBlack(true); + this.color.setBlack(true); this.power = new MageInt(1); this.toughness = new MageInt(1); this.addAbility(new BushidoAbility(2)); diff --git a/Mage.Sets/src/mage/sets/championsofkamigawa/OniPossession.java b/Mage.Sets/src/mage/sets/championsofkamigawa/OniPossession.java index 0e59ecf022..5a7c67bea8 100644 --- a/Mage.Sets/src/mage/sets/championsofkamigawa/OniPossession.java +++ b/Mage.Sets/src/mage/sets/championsofkamigawa/OniPossession.java @@ -61,7 +61,7 @@ public class OniPossession extends CardImpl { setSubtypes.add("Demon"); setSubtypes.add("Spirit"); } - + public OniPossession(UUID ownerId) { super(ownerId, 135, "Oni Possession", Rarity.UNCOMMON, new CardType[]{CardType.ENCHANTMENT}, "{2}{B}"); this.expansionSetCode = "CHK"; @@ -70,10 +70,10 @@ public class OniPossession extends CardImpl { this.color.setBlack(true); // Enchant creature TargetPermanent auraTarget = new TargetCreaturePermanent(); - this.getSpellAbility().addTarget(auraTarget); - this.getSpellAbility().addEffect(new AttachEffect(Constants.Outcome.BoostCreature)); - Ability ability = new EnchantAbility(auraTarget.getTargetName()); - this.addAbility(ability); + this.getSpellAbility().addTarget(auraTarget); + this.getSpellAbility().addEffect(new AttachEffect(Constants.Outcome.BoostCreature)); + Ability ability = new EnchantAbility(auraTarget.getTargetName()); + this.addAbility(ability); // At the beginning of your upkeep, sacrifice a creature. Ability ability2 = new BeginningOfUpkeepTriggeredAbility(new SacrificeTargetEffect("sacrifice a creature"), Constants.TargetController.YOU, false); ability2.addTarget(new TargetControlledCreaturePermanent(1,1, new FilterControlledCreaturePermanent(),false, true)); diff --git a/Mage.Sets/src/mage/sets/championsofkamigawa/OrbweaverKumo.java b/Mage.Sets/src/mage/sets/championsofkamigawa/OrbweaverKumo.java index 1107b5e4dd..9a61467c4a 100644 --- a/Mage.Sets/src/mage/sets/championsofkamigawa/OrbweaverKumo.java +++ b/Mage.Sets/src/mage/sets/championsofkamigawa/OrbweaverKumo.java @@ -47,7 +47,7 @@ import mage.filter.common.FilterSpiritOrArcaneCard; public class OrbweaverKumo extends CardImpl { private final static FilterSpiritOrArcaneCard filter = new FilterSpiritOrArcaneCard(); - + public OrbweaverKumo(UUID ownerId) { super(ownerId, 231, "Orbweaver Kumo", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{4}{G}{G}"); this.expansionSetCode = "CHK"; diff --git a/Mage.Sets/src/mage/sets/championsofkamigawa/OrderOfTheSacredBell.java b/Mage.Sets/src/mage/sets/championsofkamigawa/OrderOfTheSacredBell.java index a424dc673e..6f39bbce94 100644 --- a/Mage.Sets/src/mage/sets/championsofkamigawa/OrderOfTheSacredBell.java +++ b/Mage.Sets/src/mage/sets/championsofkamigawa/OrderOfTheSacredBell.java @@ -45,7 +45,7 @@ public class OrderOfTheSacredBell extends CardImpl { this.expansionSetCode = "CHK"; this.subtype.add("Human"); this.subtype.add("Monk"); - this.color.setGreen(true); + this.color.setGreen(true); this.power = new MageInt(4); this.toughness = new MageInt(3); } diff --git a/Mage.Sets/src/mage/sets/championsofkamigawa/OreGorger.java b/Mage.Sets/src/mage/sets/championsofkamigawa/OreGorger.java index d56b8b7b77..8108ad5d0f 100644 --- a/Mage.Sets/src/mage/sets/championsofkamigawa/OreGorger.java +++ b/Mage.Sets/src/mage/sets/championsofkamigawa/OreGorger.java @@ -46,7 +46,7 @@ import mage.target.common.TargetNonBasicLandPermanent; public class OreGorger extends CardImpl { private final static FilterSpiritOrArcaneCard filter = new FilterSpiritOrArcaneCard(); - + public OreGorger(UUID ownerId) { super(ownerId, 182, "Ore Gorger", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{3}{R}{R}"); this.expansionSetCode = "CHK"; diff --git a/Mage.Sets/src/mage/sets/championsofkamigawa/OrochiEggwatcher.java b/Mage.Sets/src/mage/sets/championsofkamigawa/OrochiEggwatcher.java index 610ca88fd4..1ed4bcabb1 100644 --- a/Mage.Sets/src/mage/sets/championsofkamigawa/OrochiEggwatcher.java +++ b/Mage.Sets/src/mage/sets/championsofkamigawa/OrochiEggwatcher.java @@ -73,7 +73,7 @@ public class OrochiEggwatcher extends CardImpl { this.power = new MageInt(1); this.toughness = new MageInt(1); this.flipCard = true; - + // {2}{G}, {T}: Put a 1/1 green Snake creature token onto the battlefield. If you control ten or more creatures, flip Orochi Eggwatcher. Ability ability; ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new CreateTokenEffect(new SnakeToken()),new ManaCostsImpl("{2}{G}")); diff --git a/Mage.Sets/src/mage/sets/championsofkamigawa/OrochiLeafcaller.java b/Mage.Sets/src/mage/sets/championsofkamigawa/OrochiLeafcaller.java index e012322984..39b3932654 100644 --- a/Mage.Sets/src/mage/sets/championsofkamigawa/OrochiLeafcaller.java +++ b/Mage.Sets/src/mage/sets/championsofkamigawa/OrochiLeafcaller.java @@ -49,7 +49,7 @@ public class OrochiLeafcaller extends CardImpl { this.expansionSetCode = "CHK"; this.subtype.add("Snake"); this.subtype.add("Shaman"); - this.color.setGreen(true); + this.color.setGreen(true); this.power = new MageInt(1); this.toughness = new MageInt(1); this.addAbility(new AnyColorManaAbility(new ColoredManaCost(Constants.ColoredManaSymbol.G))); diff --git a/Mage.Sets/src/mage/sets/championsofkamigawa/OtherworldlyJourney.java b/Mage.Sets/src/mage/sets/championsofkamigawa/OtherworldlyJourney.java index 74a4f9415f..dfc96c34c0 100644 --- a/Mage.Sets/src/mage/sets/championsofkamigawa/OtherworldlyJourney.java +++ b/Mage.Sets/src/mage/sets/championsofkamigawa/OtherworldlyJourney.java @@ -72,44 +72,44 @@ public class OtherworldlyJourney extends CardImpl { class OtherworldlyJourneyEffect extends OneShotEffect { - private static final String effectText = "Exile target creature. At the beginning of the next end step, return that card to the battlefield under its owner's control with a +1/+1 counter on it"; + private static final String effectText = "Exile target creature. At the beginning of the next end step, return that card to the battlefield under its owner's control with a +1/+1 counter on it"; - OtherworldlyJourneyEffect ( ) { - super(Constants.Outcome.Benefit); - staticText = effectText; - } + OtherworldlyJourneyEffect ( ) { + super(Constants.Outcome.Benefit); + staticText = effectText; + } - OtherworldlyJourneyEffect(OtherworldlyJourneyEffect effect) { - super(effect); - } + OtherworldlyJourneyEffect(OtherworldlyJourneyEffect effect) { + super(effect); + } - @Override - public boolean apply(Game game, Ability source) { - Permanent permanent = game.getPermanent(source.getFirstTarget()); - if (permanent != null) { - if (permanent.moveToExile(source.getSourceId(), "Otherworldly Journey", source.getId(), game)) { - ExileZone exile = game.getExile().getExileZone(source.getSourceId()); - // only if permanent is in exile (tokens would be stop to exist) - if (exile != null && !exile.isEmpty()) { - //create delayed triggered ability - AtEndOfTurnDelayedTriggeredAbility delayedAbility = new AtEndOfTurnDelayedTriggeredAbility( - new ReturnFromExileEffect(source.getSourceId(), Constants.Zone.BATTLEFIELD, "return that card to the battlefield under its owner's control with a +1/+1 counter on it")); - delayedAbility.setSourceId(source.getSourceId()); - delayedAbility.setControllerId(source.getControllerId()); - AddCountersTargetEffect effect = new AddCountersTargetEffect(CounterType.P1P1.createInstance()); - effect.setTargetPointer(new FixedTarget(source.getFirstTarget())); - delayedAbility.addEffect(effect); - game.addDelayedTriggeredAbility(delayedAbility); - } - return true; - } - } - return false; - } + @Override + public boolean apply(Game game, Ability source) { + Permanent permanent = game.getPermanent(source.getFirstTarget()); + if (permanent != null) { + if (permanent.moveToExile(source.getSourceId(), "Otherworldly Journey", source.getId(), game)) { + ExileZone exile = game.getExile().getExileZone(source.getSourceId()); + // only if permanent is in exile (tokens would be stop to exist) + if (exile != null && !exile.isEmpty()) { + //create delayed triggered ability + AtEndOfTurnDelayedTriggeredAbility delayedAbility = new AtEndOfTurnDelayedTriggeredAbility( + new ReturnFromExileEffect(source.getSourceId(), Constants.Zone.BATTLEFIELD, "return that card to the battlefield under its owner's control with a +1/+1 counter on it")); + delayedAbility.setSourceId(source.getSourceId()); + delayedAbility.setControllerId(source.getControllerId()); + AddCountersTargetEffect effect = new AddCountersTargetEffect(CounterType.P1P1.createInstance()); + effect.setTargetPointer(new FixedTarget(source.getFirstTarget())); + delayedAbility.addEffect(effect); + game.addDelayedTriggeredAbility(delayedAbility); + } + return true; + } + } + return false; + } - @Override - public OtherworldlyJourneyEffect copy() { - return new OtherworldlyJourneyEffect(this); - } + @Override + public OtherworldlyJourneyEffect copy() { + return new OtherworldlyJourneyEffect(this); + } } diff --git a/Mage.Sets/src/mage/sets/championsofkamigawa/PainwrackerOni.java b/Mage.Sets/src/mage/sets/championsofkamigawa/PainwrackerOni.java index dc4352e9a4..99c24f90f0 100644 --- a/Mage.Sets/src/mage/sets/championsofkamigawa/PainwrackerOni.java +++ b/Mage.Sets/src/mage/sets/championsofkamigawa/PainwrackerOni.java @@ -56,10 +56,10 @@ public class PainwrackerOni extends CardImpl { this.expansionSetCode = "CHK"; this.subtype.add("Demon"); this.subtype.add("Spirit"); - this.color.setBlack(true); + this.color.setBlack(true); this.power = new MageInt(5); this.toughness = new MageInt(4); - + // Fear (This creature can't be blocked except by artifact creatures and/or black creatures.) this.addAbility(FearAbility.getInstance()); // At the beginning of your upkeep, sacrifice a creature if you don't control an Ogre. diff --git a/Mage.Sets/src/mage/sets/championsofkamigawa/PeerThroughDepths.java b/Mage.Sets/src/mage/sets/championsofkamigawa/PeerThroughDepths.java index 420b224add..1deff87a01 100644 --- a/Mage.Sets/src/mage/sets/championsofkamigawa/PeerThroughDepths.java +++ b/Mage.Sets/src/mage/sets/championsofkamigawa/PeerThroughDepths.java @@ -55,8 +55,8 @@ public class PeerThroughDepths extends CardImpl { super(ownerId, 78, "Peer Through Depths", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{1}{U}"); this.expansionSetCode = "CHK"; this.subtype.add("Arcane"); - this.color.setBlue(true); - + this.color.setBlue(true); + // Look at the top five cards of your library. You may reveal an instant or sorcery card from among them and put it into your hand. // Put the rest on the bottom of your library in any order. this.getSpellAbility().addEffect(new LookLibraryAndPickControllerEffect(new StaticValue(5), false, new StaticValue(1), filter, false)); diff --git a/Mage.Sets/src/mage/sets/championsofkamigawa/Plains1.java b/Mage.Sets/src/mage/sets/championsofkamigawa/Plains1.java index edca97225d..6dde863a84 100644 --- a/Mage.Sets/src/mage/sets/championsofkamigawa/Plains1.java +++ b/Mage.Sets/src/mage/sets/championsofkamigawa/Plains1.java @@ -36,18 +36,18 @@ import java.util.UUID; */ public class Plains1 extends mage.cards.basiclands.Plains { - public Plains1(UUID ownerId) { - super(ownerId, 287); - this.expansionSetCode = "CHK"; - } + public Plains1(UUID ownerId) { + super(ownerId, 287); + this.expansionSetCode = "CHK"; + } - public Plains1(final Plains1 card) { - super(card); - } + public Plains1(final Plains1 card) { + super(card); + } - @Override - public Plains1 copy() { - return new Plains1(this); - } + @Override + public Plains1 copy() { + return new Plains1(this); + } } diff --git a/Mage.Sets/src/mage/sets/championsofkamigawa/Plains2.java b/Mage.Sets/src/mage/sets/championsofkamigawa/Plains2.java index b4fafcda05..d73e6763e3 100644 --- a/Mage.Sets/src/mage/sets/championsofkamigawa/Plains2.java +++ b/Mage.Sets/src/mage/sets/championsofkamigawa/Plains2.java @@ -36,18 +36,18 @@ import java.util.UUID; */ public class Plains2 extends mage.cards.basiclands.Plains { - public Plains2(UUID ownerId) { - super(ownerId, 288); - this.expansionSetCode = "CHK"; - } + public Plains2(UUID ownerId) { + super(ownerId, 288); + this.expansionSetCode = "CHK"; + } - public Plains2(final Plains2 card) { - super(card); - } + public Plains2(final Plains2 card) { + super(card); + } - @Override - public Plains2 copy() { - return new Plains2(this); - } + @Override + public Plains2 copy() { + return new Plains2(this); + } } diff --git a/Mage.Sets/src/mage/sets/championsofkamigawa/Plains3.java b/Mage.Sets/src/mage/sets/championsofkamigawa/Plains3.java index d91495083c..a3dc104a53 100644 --- a/Mage.Sets/src/mage/sets/championsofkamigawa/Plains3.java +++ b/Mage.Sets/src/mage/sets/championsofkamigawa/Plains3.java @@ -36,18 +36,18 @@ import java.util.UUID; */ public class Plains3 extends mage.cards.basiclands.Plains { - public Plains3(UUID ownerId) { - super(ownerId, 289); - this.expansionSetCode = "CHK"; - } + public Plains3(UUID ownerId) { + super(ownerId, 289); + this.expansionSetCode = "CHK"; + } - public Plains3(final Plains3 card) { - super(card); - } + public Plains3(final Plains3 card) { + super(card); + } - @Override - public Plains3 copy() { - return new Plains3(this); - } + @Override + public Plains3 copy() { + return new Plains3(this); + } } diff --git a/Mage.Sets/src/mage/sets/championsofkamigawa/Plains4.java b/Mage.Sets/src/mage/sets/championsofkamigawa/Plains4.java index 870234fc92..0894aeeac1 100644 --- a/Mage.Sets/src/mage/sets/championsofkamigawa/Plains4.java +++ b/Mage.Sets/src/mage/sets/championsofkamigawa/Plains4.java @@ -36,18 +36,18 @@ import java.util.UUID; */ public class Plains4 extends mage.cards.basiclands.Plains { - public Plains4(UUID ownerId) { - super(ownerId, 290); - this.expansionSetCode = "CHK"; - } + public Plains4(UUID ownerId) { + super(ownerId, 290); + this.expansionSetCode = "CHK"; + } - public Plains4(final Plains4 card) { - super(card); - } + public Plains4(final Plains4 card) { + super(card); + } - @Override - public Plains4 copy() { - return new Plains4(this); - } + @Override + public Plains4 copy() { + return new Plains4(this); + } } diff --git a/Mage.Sets/src/mage/sets/championsofkamigawa/RagDealer.java b/Mage.Sets/src/mage/sets/championsofkamigawa/RagDealer.java index 15b751ace2..5476901d53 100644 --- a/Mage.Sets/src/mage/sets/championsofkamigawa/RagDealer.java +++ b/Mage.Sets/src/mage/sets/championsofkamigawa/RagDealer.java @@ -64,8 +64,8 @@ public class RagDealer extends CardImpl { this.expansionSetCode = "CHK"; this.subtype.add("Human"); this.subtype.add("Rogue"); - this.color.setBlack(true); - + this.color.setBlack(true); + this.power = new MageInt(1); this.toughness = new MageInt(1); // {2}{B}, {T}: Exile up to three target cards from a single graveyard. diff --git a/Mage.Sets/src/mage/sets/championsofkamigawa/ReachThroughMists.java b/Mage.Sets/src/mage/sets/championsofkamigawa/ReachThroughMists.java index 1d48c6a3a6..4a6a7eda7f 100644 --- a/Mage.Sets/src/mage/sets/championsofkamigawa/ReachThroughMists.java +++ b/Mage.Sets/src/mage/sets/championsofkamigawa/ReachThroughMists.java @@ -45,7 +45,7 @@ public class ReachThroughMists extends CardImpl { super(ownerId, 81, "Reach Through Mists", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{U}"); this.expansionSetCode = "CHK"; this.subtype.add("Arcane"); - this.color.setBlue(true); + this.color.setBlue(true); this.getSpellAbility().addEffect(new DrawCardControllerEffect(1)); } diff --git a/Mage.Sets/src/mage/sets/championsofkamigawa/Reciprocate.java b/Mage.Sets/src/mage/sets/championsofkamigawa/Reciprocate.java index 8ac0cac613..6935518fd2 100644 --- a/Mage.Sets/src/mage/sets/championsofkamigawa/Reciprocate.java +++ b/Mage.Sets/src/mage/sets/championsofkamigawa/Reciprocate.java @@ -122,7 +122,7 @@ class ReciprocateTarget> extends TargetPerm } return false; } - + @Override public ReciprocateTarget copy() { return new ReciprocateTarget(this); diff --git a/Mage.Sets/src/mage/sets/championsofkamigawa/RiverKaijin.java b/Mage.Sets/src/mage/sets/championsofkamigawa/RiverKaijin.java index 5da16b4b9c..b19c7954fe 100644 --- a/Mage.Sets/src/mage/sets/championsofkamigawa/RiverKaijin.java +++ b/Mage.Sets/src/mage/sets/championsofkamigawa/RiverKaijin.java @@ -44,7 +44,7 @@ public class RiverKaijin extends CardImpl { super(ownerId, 83, "River Kaijin", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{2}{U}"); this.expansionSetCode = "CHK"; this.subtype.add("Spirit"); - this.color.setBlue(true); + this.color.setBlue(true); this.power = new MageInt(1); this.toughness = new MageInt(4); } diff --git a/Mage.Sets/src/mage/sets/championsofkamigawa/RoninHoundmaster.java b/Mage.Sets/src/mage/sets/championsofkamigawa/RoninHoundmaster.java index 26d5784076..a75a2c8804 100644 --- a/Mage.Sets/src/mage/sets/championsofkamigawa/RoninHoundmaster.java +++ b/Mage.Sets/src/mage/sets/championsofkamigawa/RoninHoundmaster.java @@ -47,7 +47,7 @@ public class RoninHoundmaster extends CardImpl { this.expansionSetCode = "CHK"; this.subtype.add("Human"); this.subtype.add("Samurai"); - this.color.setRed(true); + this.color.setRed(true); this.power = new MageInt(2); this.toughness = new MageInt(2); this.addAbility(HasteAbility.getInstance()); diff --git a/Mage.Sets/src/mage/sets/championsofkamigawa/SamuraiEnforcers.java b/Mage.Sets/src/mage/sets/championsofkamigawa/SamuraiEnforcers.java index 94c3f88b66..93895c6e7f 100644 --- a/Mage.Sets/src/mage/sets/championsofkamigawa/SamuraiEnforcers.java +++ b/Mage.Sets/src/mage/sets/championsofkamigawa/SamuraiEnforcers.java @@ -46,7 +46,7 @@ public class SamuraiEnforcers extends CardImpl { this.expansionSetCode = "CHK"; this.subtype.add("Human"); this.subtype.add("Samurai"); - this.color.setWhite(true); + this.color.setWhite(true); this.power = new MageInt(4); this.toughness = new MageInt(4); this.addAbility(new BushidoAbility(2)); diff --git a/Mage.Sets/src/mage/sets/championsofkamigawa/SamuraiOfThePaleCurtain.java b/Mage.Sets/src/mage/sets/championsofkamigawa/SamuraiOfThePaleCurtain.java index 277319a91d..74814bc73a 100644 --- a/Mage.Sets/src/mage/sets/championsofkamigawa/SamuraiOfThePaleCurtain.java +++ b/Mage.Sets/src/mage/sets/championsofkamigawa/SamuraiOfThePaleCurtain.java @@ -57,14 +57,14 @@ public class SamuraiOfThePaleCurtain extends CardImpl { this.expansionSetCode = "CHK"; this.subtype.add("Fox"); this.subtype.add("Samurai"); - this.color.setWhite(true); + this.color.setWhite(true); this.power = new MageInt(2); this.toughness = new MageInt(2); // Bushido 1 (When this blocks or becomes blocked, it gets +1/+1 until end of turn.) this.addAbility(new BushidoAbility(1)); // If a permanent would be put into a graveyard, exile it instead. this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new SamuraiOfThePaleCurtainEffect())); - + } public SamuraiOfThePaleCurtain (final SamuraiOfThePaleCurtain card) { @@ -81,43 +81,43 @@ public class SamuraiOfThePaleCurtain extends CardImpl { class SamuraiOfThePaleCurtainEffect extends ReplacementEffectImpl { - public SamuraiOfThePaleCurtainEffect() { - super(Duration.EndOfTurn, Outcome.Exile); - staticText = "If a permanent would be put into a graveyard, exile it instead"; - } + public SamuraiOfThePaleCurtainEffect() { + super(Duration.EndOfTurn, Outcome.Exile); + staticText = "If a permanent would be put into a graveyard, exile it instead"; + } - public SamuraiOfThePaleCurtainEffect(final SamuraiOfThePaleCurtainEffect effect) { - super(effect); - } + public SamuraiOfThePaleCurtainEffect(final SamuraiOfThePaleCurtainEffect effect) { + super(effect); + } - @Override - public SamuraiOfThePaleCurtainEffect copy() { - return new SamuraiOfThePaleCurtainEffect(this); - } + @Override + public SamuraiOfThePaleCurtainEffect copy() { + return new SamuraiOfThePaleCurtainEffect(this); + } - @Override - public boolean apply(Game game, Ability source) { - return true; - } + @Override + public boolean apply(Game game, Ability source) { + return true; + } - @Override - public boolean replaceEvent(GameEvent event, Ability source, Game game) { + @Override + public boolean replaceEvent(GameEvent event, Ability source, Game game) { Permanent permanent = ((ZoneChangeEvent)event).getTarget(); if (permanent != null) { return permanent.moveToExile(null, "", source.getId(), game); } - return false; - } + return false; + } - @Override - public boolean applies(GameEvent event, Ability source, Game game) { - if (event.getType() == EventType.ZONE_CHANGE ) { - ZoneChangeEvent zEvent = (ZoneChangeEvent)event; - if (zEvent.getToZone() == Zone.GRAVEYARD) { - return true; - } - } - return false; - } + @Override + public boolean applies(GameEvent event, Ability source, Game game) { + if (event.getType() == EventType.ZONE_CHANGE ) { + ZoneChangeEvent zEvent = (ZoneChangeEvent)event; + if (zEvent.getToZone() == Zone.GRAVEYARD) { + return true; + } + } + return false; + } } diff --git a/Mage.Sets/src/mage/sets/championsofkamigawa/SeizanPerverterOfTruth.java b/Mage.Sets/src/mage/sets/championsofkamigawa/SeizanPerverterOfTruth.java index 04f604dfd0..6676fd26fc 100644 --- a/Mage.Sets/src/mage/sets/championsofkamigawa/SeizanPerverterOfTruth.java +++ b/Mage.Sets/src/mage/sets/championsofkamigawa/SeizanPerverterOfTruth.java @@ -52,7 +52,7 @@ public class SeizanPerverterOfTruth extends CardImpl { this.supertype.add("Legendary"); this.subtype.add("Demon"); this.subtype.add("Spirit"); - this.color.setBlack(true); + this.color.setBlack(true); this.power = new MageInt(6); this.toughness = new MageInt(5); Ability ability = new BeginningOfUpkeepTriggeredAbility(new DrawCardTargetEffect(2), Constants.TargetController.ANY, false); diff --git a/Mage.Sets/src/mage/sets/championsofkamigawa/SenseiGoldenTail.java b/Mage.Sets/src/mage/sets/championsofkamigawa/SenseiGoldenTail.java index fa66b48a82..20b08e1586 100644 --- a/Mage.Sets/src/mage/sets/championsofkamigawa/SenseiGoldenTail.java +++ b/Mage.Sets/src/mage/sets/championsofkamigawa/SenseiGoldenTail.java @@ -58,7 +58,7 @@ public class SenseiGoldenTail extends CardImpl { this.expansionSetCode = "CHK"; this.subtype.add("Fox"); this.subtype.add("Samurai"); - this.color.setWhite(true); + this.color.setWhite(true); this.power = new MageInt(2); this.toughness = new MageInt(1); // Bushido 1 (When this blocks or becomes blocked, it gets +1/+1 until end of turn.) diff --git a/Mage.Sets/src/mage/sets/championsofkamigawa/SerpentSkin.java b/Mage.Sets/src/mage/sets/championsofkamigawa/SerpentSkin.java index 0e54158f4a..564dd74d38 100644 --- a/Mage.Sets/src/mage/sets/championsofkamigawa/SerpentSkin.java +++ b/Mage.Sets/src/mage/sets/championsofkamigawa/SerpentSkin.java @@ -57,15 +57,15 @@ public class SerpentSkin extends CardImpl { super(ownerId, 240, "Serpent Skin", Rarity.COMMON, new CardType[]{CardType.ENCHANTMENT}, "{2}{G}"); this.expansionSetCode = "CHK"; this.subtype.add("Aura"); - this.color.setGreen(true); + this.color.setGreen(true); this.addAbility(FlashAbility.getInstance()); TargetPermanent auraTarget = new TargetCreaturePermanent(); - this.getSpellAbility().addTarget(auraTarget); - this.getSpellAbility().addEffect(new AttachEffect(Constants.Outcome.BoostCreature)); - Ability ability = new EnchantAbility(auraTarget.getTargetName()); - this.addAbility(ability); - this.addAbility(new SimpleStaticAbility(Constants.Zone.BATTLEFIELD, new BoostEnchantedEffect(1, 1, Constants.Duration.WhileOnBattlefield))); + this.getSpellAbility().addTarget(auraTarget); + this.getSpellAbility().addEffect(new AttachEffect(Constants.Outcome.BoostCreature)); + Ability ability = new EnchantAbility(auraTarget.getTargetName()); + this.addAbility(ability); + this.addAbility(new SimpleStaticAbility(Constants.Zone.BATTLEFIELD, new BoostEnchantedEffect(1, 1, Constants.Duration.WhileOnBattlefield))); this.addAbility(new SimpleStaticAbility(Constants.Zone.BATTLEFIELD, new GainAbilityAttachedEffect(new SimpleActivatedAbility(Constants.Zone.BATTLEFIELD, new RegenerateSourceEffect(), new ColoredManaCost(Constants.ColoredManaSymbol.G)), Constants.AttachmentType.AURA))); } diff --git a/Mage.Sets/src/mage/sets/championsofkamigawa/SeshiroTheAnointed.java b/Mage.Sets/src/mage/sets/championsofkamigawa/SeshiroTheAnointed.java index 506f4483dc..d20dc5264d 100644 --- a/Mage.Sets/src/mage/sets/championsofkamigawa/SeshiroTheAnointed.java +++ b/Mage.Sets/src/mage/sets/championsofkamigawa/SeshiroTheAnointed.java @@ -101,7 +101,7 @@ class SeshiroTheAnointedAbility extends TriggeredAbilityImpl { - + private final static FilterControlledCreaturePermanent filter = new FilterControlledCreaturePermanent("Snake"); static { filter.getSubtype().add("Snake"); filter.setTargetController(TargetController.YOU); } - + public ShisatoWhisperingHunter(UUID ownerId) { super(ownerId, 242, "Shisato, Whispering Hunter", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{3}{G}"); this.expansionSetCode = "CHK"; diff --git a/Mage.Sets/src/mage/sets/championsofkamigawa/SilentChantZubera.java b/Mage.Sets/src/mage/sets/championsofkamigawa/SilentChantZubera.java index fe8ac06c84..5333765145 100644 --- a/Mage.Sets/src/mage/sets/championsofkamigawa/SilentChantZubera.java +++ b/Mage.Sets/src/mage/sets/championsofkamigawa/SilentChantZubera.java @@ -51,7 +51,7 @@ public class SilentChantZubera extends CardImpl { this.expansionSetCode = "CHK"; this.subtype.add("Zubera"); this.subtype.add("Spirit"); - this.color.setWhite(true); + this.color.setWhite(true); this.power = new MageInt(1); this.toughness = new MageInt(2); Ability ability = new DiesTriggeredAbility(new GainLifeEffect(new SilentChantZuberaDynamicValue())); diff --git a/Mage.Sets/src/mage/sets/championsofkamigawa/SireOfTheStorm.java b/Mage.Sets/src/mage/sets/championsofkamigawa/SireOfTheStorm.java index c501f4be22..3f49368a03 100644 --- a/Mage.Sets/src/mage/sets/championsofkamigawa/SireOfTheStorm.java +++ b/Mage.Sets/src/mage/sets/championsofkamigawa/SireOfTheStorm.java @@ -45,7 +45,7 @@ import mage.filter.common.FilterSpiritOrArcaneCard; public class SireOfTheStorm extends CardImpl { private final static FilterSpiritOrArcaneCard filter = new FilterSpiritOrArcaneCard(); - + public SireOfTheStorm(UUID ownerId) { super(ownerId, 85, "Sire of the Storm", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{4}{U}{U}"); this.expansionSetCode = "CHK"; diff --git a/Mage.Sets/src/mage/sets/championsofkamigawa/Soilshaper.java b/Mage.Sets/src/mage/sets/championsofkamigawa/Soilshaper.java index c00a578208..1e057a0144 100644 --- a/Mage.Sets/src/mage/sets/championsofkamigawa/Soilshaper.java +++ b/Mage.Sets/src/mage/sets/championsofkamigawa/Soilshaper.java @@ -48,7 +48,7 @@ import mage.target.common.TargetLandPermanent; public class Soilshaper extends CardImpl { private final static FilterSpiritOrArcaneCard filter = new FilterSpiritOrArcaneCard(); - + public Soilshaper(UUID ownerId) { super(ownerId, 243, "Soilshaper", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{1}{G}"); this.expansionSetCode = "CHK"; @@ -74,11 +74,11 @@ public class Soilshaper extends CardImpl { class SoilshaperToken extends Token { - public SoilshaperToken() { - super("", "3/3 creature"); - this.cardType.add(CardType.CREATURE); + public SoilshaperToken() { + super("", "3/3 creature"); + this.cardType.add(CardType.CREATURE); - this.power = new MageInt(3); - this.toughness = new MageInt(3); - } + this.power = new MageInt(3); + this.toughness = new MageInt(3); + } } diff --git a/Mage.Sets/src/mage/sets/championsofkamigawa/SokenzanBruiser.java b/Mage.Sets/src/mage/sets/championsofkamigawa/SokenzanBruiser.java index e813664731..4526682676 100644 --- a/Mage.Sets/src/mage/sets/championsofkamigawa/SokenzanBruiser.java +++ b/Mage.Sets/src/mage/sets/championsofkamigawa/SokenzanBruiser.java @@ -46,7 +46,7 @@ public class SokenzanBruiser extends CardImpl { this.expansionSetCode = "CHK"; this.subtype.add("Ogre"); this.subtype.add("Warrior"); - this.color.setRed(true); + this.color.setRed(true); this.power = new MageInt(3); this.toughness = new MageInt(3); this.addAbility(new MountainwalkAbility()); diff --git a/Mage.Sets/src/mage/sets/championsofkamigawa/SosukeSonOfSeshiro.java b/Mage.Sets/src/mage/sets/championsofkamigawa/SosukeSonOfSeshiro.java index 4f03e3fdf5..e7d7dcc035 100644 --- a/Mage.Sets/src/mage/sets/championsofkamigawa/SosukeSonOfSeshiro.java +++ b/Mage.Sets/src/mage/sets/championsofkamigawa/SosukeSonOfSeshiro.java @@ -61,7 +61,7 @@ public class SosukeSonOfSeshiro extends CardImpl { filter.getSubtype().add("Snake"); filter.setScopeSubtype(Filter.ComparisonScope.Any); } - + public SosukeSonOfSeshiro(UUID ownerId) { super(ownerId, 244, "Sosuke, Son of Seshiro", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{2}{G}{G}"); this.expansionSetCode = "CHK"; @@ -127,7 +127,7 @@ class SosukeSonOfSeshiroTriggeredAbility extends TriggeredAbilityImpl { - + SosukeSonOfSeshiroEffect() { super(Outcome.DestroyPermanent); staticText = "destroy that creature at end of combat"; diff --git a/Mage.Sets/src/mage/sets/championsofkamigawa/SoulOfMagma.java b/Mage.Sets/src/mage/sets/championsofkamigawa/SoulOfMagma.java index 825a5e4c3e..a4a47b5187 100644 --- a/Mage.Sets/src/mage/sets/championsofkamigawa/SoulOfMagma.java +++ b/Mage.Sets/src/mage/sets/championsofkamigawa/SoulOfMagma.java @@ -46,7 +46,7 @@ import mage.target.common.TargetCreaturePermanent; public class SoulOfMagma extends CardImpl { private final static FilterSpiritOrArcaneCard filter = new FilterSpiritOrArcaneCard(); - + public SoulOfMagma(UUID ownerId) { super(ownerId, 189, "Soul of Magma", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{3}{R}{R}"); this.expansionSetCode = "CHK"; diff --git a/Mage.Sets/src/mage/sets/championsofkamigawa/StrengthOfCedars.java b/Mage.Sets/src/mage/sets/championsofkamigawa/StrengthOfCedars.java index 845a57d7f9..c57e28d830 100644 --- a/Mage.Sets/src/mage/sets/championsofkamigawa/StrengthOfCedars.java +++ b/Mage.Sets/src/mage/sets/championsofkamigawa/StrengthOfCedars.java @@ -56,7 +56,7 @@ public class StrengthOfCedars extends CardImpl { super(ownerId, 245, "Strength of Cedars", Rarity.UNCOMMON, new CardType[]{CardType.INSTANT}, "{4}{G}"); this.expansionSetCode = "CHK"; this.subtype.add("Arcane"); - this.color.setGreen(true); + this.color.setGreen(true); this.getSpellAbility().addEffect(new BoostTargetEffect(new PermanentsOnBattlefieldCount(filter), new PermanentsOnBattlefieldCount(filter), Constants.Duration.EndOfTurn, true)); this.getSpellAbility().addTarget(new TargetCreaturePermanent()); diff --git a/Mage.Sets/src/mage/sets/championsofkamigawa/SwallowingPlague.java b/Mage.Sets/src/mage/sets/championsofkamigawa/SwallowingPlague.java index 51e4bc829d..d8601460ca 100644 --- a/Mage.Sets/src/mage/sets/championsofkamigawa/SwallowingPlague.java +++ b/Mage.Sets/src/mage/sets/championsofkamigawa/SwallowingPlague.java @@ -47,8 +47,8 @@ public class SwallowingPlague extends CardImpl { super(ownerId, 146, "Swallowing Plague", Rarity.UNCOMMON, new CardType[]{CardType.SORCERY}, "{X}{B}{B}"); this.expansionSetCode = "CHK"; this.subtype.add("Arcane"); - this.color.setBlack(true); - this.getSpellAbility().addEffect(new DamageTargetEffect(new ManacostVariableValue())); + this.color.setBlack(true); + this.getSpellAbility().addEffect(new DamageTargetEffect(new ManacostVariableValue())); this.getSpellAbility().addEffect(new GainLifeEffect(new ManacostVariableValue())); this.getSpellAbility().addTarget(new TargetCreaturePermanent()); } diff --git a/Mage.Sets/src/mage/sets/championsofkamigawa/Swamp1.java b/Mage.Sets/src/mage/sets/championsofkamigawa/Swamp1.java index 526d7a2ca8..f19a40e79e 100644 --- a/Mage.Sets/src/mage/sets/championsofkamigawa/Swamp1.java +++ b/Mage.Sets/src/mage/sets/championsofkamigawa/Swamp1.java @@ -36,18 +36,18 @@ import java.util.UUID; */ public class Swamp1 extends mage.cards.basiclands.Swamp { - public Swamp1(UUID ownerId) { - super(ownerId, 295); - this.expansionSetCode = "CHK"; - } + public Swamp1(UUID ownerId) { + super(ownerId, 295); + this.expansionSetCode = "CHK"; + } - public Swamp1(final Swamp1 card) { - super(card); - } + public Swamp1(final Swamp1 card) { + super(card); + } - @Override - public Swamp1 copy() { - return new Swamp1(this); - } + @Override + public Swamp1 copy() { + return new Swamp1(this); + } } \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/championsofkamigawa/Swamp2.java b/Mage.Sets/src/mage/sets/championsofkamigawa/Swamp2.java index 6d3f016020..f65442be29 100644 --- a/Mage.Sets/src/mage/sets/championsofkamigawa/Swamp2.java +++ b/Mage.Sets/src/mage/sets/championsofkamigawa/Swamp2.java @@ -36,18 +36,18 @@ import java.util.UUID; */ public class Swamp2 extends mage.cards.basiclands.Swamp { - public Swamp2(UUID ownerId) { - super(ownerId, 296); - this.expansionSetCode = "CHK"; - } + public Swamp2(UUID ownerId) { + super(ownerId, 296); + this.expansionSetCode = "CHK"; + } - public Swamp2(final Swamp2 card) { - super(card); - } + public Swamp2(final Swamp2 card) { + super(card); + } - @Override - public Swamp2 copy() { - return new Swamp2(this); - } + @Override + public Swamp2 copy() { + return new Swamp2(this); + } } \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/championsofkamigawa/Swamp3.java b/Mage.Sets/src/mage/sets/championsofkamigawa/Swamp3.java index b11250773f..ef45c3e136 100644 --- a/Mage.Sets/src/mage/sets/championsofkamigawa/Swamp3.java +++ b/Mage.Sets/src/mage/sets/championsofkamigawa/Swamp3.java @@ -36,18 +36,18 @@ import java.util.UUID; */ public class Swamp3 extends mage.cards.basiclands.Swamp { - public Swamp3(UUID ownerId) { - super(ownerId, 297); - this.expansionSetCode = "CHK"; - } + public Swamp3(UUID ownerId) { + super(ownerId, 297); + this.expansionSetCode = "CHK"; + } - public Swamp3(final Swamp3 card) { - super(card); - } + public Swamp3(final Swamp3 card) { + super(card); + } - @Override - public Swamp3 copy() { - return new Swamp3(this); - } + @Override + public Swamp3 copy() { + return new Swamp3(this); + } } \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/championsofkamigawa/Swamp4.java b/Mage.Sets/src/mage/sets/championsofkamigawa/Swamp4.java index bdb408dba5..427debefef 100644 --- a/Mage.Sets/src/mage/sets/championsofkamigawa/Swamp4.java +++ b/Mage.Sets/src/mage/sets/championsofkamigawa/Swamp4.java @@ -36,18 +36,18 @@ import java.util.UUID; */ public class Swamp4 extends mage.cards.basiclands.Swamp { - public Swamp4(UUID ownerId) { - super(ownerId, 298); - this.expansionSetCode = "CHK"; - } + public Swamp4(UUID ownerId) { + super(ownerId, 298); + this.expansionSetCode = "CHK"; + } - public Swamp4(final Swamp4 card) { - super(card); - } + public Swamp4(final Swamp4 card) { + super(card); + } - @Override - public Swamp4 copy() { - return new Swamp4(this); - } + @Override + public Swamp4 copy() { + return new Swamp4(this); + } } \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/championsofkamigawa/TakenoSamuraiGeneral.java b/Mage.Sets/src/mage/sets/championsofkamigawa/TakenoSamuraiGeneral.java index ea4e855845..7c19560990 100644 --- a/Mage.Sets/src/mage/sets/championsofkamigawa/TakenoSamuraiGeneral.java +++ b/Mage.Sets/src/mage/sets/championsofkamigawa/TakenoSamuraiGeneral.java @@ -74,58 +74,58 @@ public class TakenoSamuraiGeneral extends CardImpl { } class TakenoSamuraiGeneralEffect extends ContinuousEffectImpl { - private static FilterControlledCreaturePermanent filter = new FilterControlledCreaturePermanent(); + private static FilterControlledCreaturePermanent filter = new FilterControlledCreaturePermanent(); static { filter.getSubtype().add("Samurai"); filter.setScopeSubtype(Filter.ComparisonScope.Any); } - public TakenoSamuraiGeneralEffect() { - super(Constants.Duration.WhileOnBattlefield, Constants.Layer.PTChangingEffects_7, Constants.SubLayer.ModifyPT_7c, Constants.Outcome.BoostCreature); - staticText = "Each other Samurai creature you control gets +1/+1 for each point of bushido it has"; - } + public TakenoSamuraiGeneralEffect() { + super(Constants.Duration.WhileOnBattlefield, Constants.Layer.PTChangingEffects_7, Constants.SubLayer.ModifyPT_7c, Constants.Outcome.BoostCreature); + staticText = "Each other Samurai creature you control gets +1/+1 for each point of bushido it has"; + } - public TakenoSamuraiGeneralEffect(final TakenoSamuraiGeneralEffect effect) { - super(effect); - } + public TakenoSamuraiGeneralEffect(final TakenoSamuraiGeneralEffect effect) { + super(effect); + } - @Override - public TakenoSamuraiGeneralEffect copy() { - return new TakenoSamuraiGeneralEffect(this); - } + @Override + public TakenoSamuraiGeneralEffect copy() { + return new TakenoSamuraiGeneralEffect(this); + } - @Override - public void init(Ability source, Game game) { - super.init(source, game); - if (this.affectedObjectsSet) { - for (Permanent perm: game.getBattlefield().getAllActivePermanents(filter, source.getControllerId(), game)) { - if (!perm.getId().equals(source.getSourceId())) { + @Override + public void init(Ability source, Game game) { + super.init(source, game); + if (this.affectedObjectsSet) { + for (Permanent perm: game.getBattlefield().getAllActivePermanents(filter, source.getControllerId(), game)) { + if (!perm.getId().equals(source.getSourceId())) { for (Ability ability : perm.getAbilities()) { if (ability instanceof BushidoAbility) { objects.add(perm.getId()); } } - } - } - } - } + } + } + } + } - @Override - public boolean apply(Game game, Ability source) { - for (Permanent perm: game.getBattlefield().getAllActivePermanents(filter, source.getControllerId(), game)) { - if (!this.affectedObjectsSet || objects.contains(perm.getId())) { - if (!perm.getId().equals(source.getSourceId())) { + @Override + public boolean apply(Game game, Ability source) { + for (Permanent perm: game.getBattlefield().getAllActivePermanents(filter, source.getControllerId(), game)) { + if (!this.affectedObjectsSet || objects.contains(perm.getId())) { + if (!perm.getId().equals(source.getSourceId())) { for (Ability ability : perm.getAbilities()) { if (ability instanceof BushidoAbility) { perm.addPower(((BushidoAbility) ability).getValue()); perm.addToughness(((BushidoAbility) ability).getValue()); } } - } - } - } - return true; - } + } + } + } + return true; + } } diff --git a/Mage.Sets/src/mage/sets/championsofkamigawa/TellerOfTales.java b/Mage.Sets/src/mage/sets/championsofkamigawa/TellerOfTales.java index 2667296550..fe2e550a71 100644 --- a/Mage.Sets/src/mage/sets/championsofkamigawa/TellerOfTales.java +++ b/Mage.Sets/src/mage/sets/championsofkamigawa/TellerOfTales.java @@ -49,9 +49,9 @@ import mage.target.common.TargetCreaturePermanent; public class TellerOfTales extends CardImpl { private final static FilterSpiritOrArcaneCard filter = new FilterSpiritOrArcaneCard(); - + // Outcome.Benefit, "tap or untap target creature" - + public TellerOfTales(UUID ownerId) { super(ownerId, 95, "Teller of Tales", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{3}{U}{U}"); this.expansionSetCode = "CHK"; diff --git a/Mage.Sets/src/mage/sets/championsofkamigawa/TenzaGodosMaul.java b/Mage.Sets/src/mage/sets/championsofkamigawa/TenzaGodosMaul.java index 5865d1c451..54fb7c589c 100644 --- a/Mage.Sets/src/mage/sets/championsofkamigawa/TenzaGodosMaul.java +++ b/Mage.Sets/src/mage/sets/championsofkamigawa/TenzaGodosMaul.java @@ -57,7 +57,7 @@ public class TenzaGodosMaul extends CardImpl { private static final String rule1 = "As long as it's legendary, it gets an additional +2/+2"; private static final String rule2 = "As long as it's red, it has trample."; - + private final static FilterCreaturePermanent legendaryFilter = new FilterCreaturePermanent("legendary"); private final static FilterCreaturePermanent redFilter = new FilterCreaturePermanent("red"); @@ -74,9 +74,9 @@ public class TenzaGodosMaul extends CardImpl { this.expansionSetCode = "CHK"; this.supertype.add("Legendary"); this.subtype.add("Equipment"); - + // Equipped creature gets +1/+1. - this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostEquippedEffect(1, 1))); + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostEquippedEffect(1, 1))); // As long as it's legendary, it gets an additional +2/+2. this.addAbility(new SimpleStaticAbility(Constants.Zone.BATTLEFIELD, new ConditionalContinousEffect( new BoostEquippedEffect(2, 2), @@ -87,9 +87,9 @@ public class TenzaGodosMaul extends CardImpl { new EquippedMatchesFilterCondition(redFilter), rule2))); // Equip {1} ({1}: Attach to target creature you control. Equip only as a sorcery.) this.addAbility(new EquipAbility(Constants.Outcome.AddAbility, new GenericManaCost(1), new TargetControlledCreaturePermanent())); - + } - + public TenzaGodosMaul(final TenzaGodosMaul card) { super(card); } diff --git a/Mage.Sets/src/mage/sets/championsofkamigawa/TerashisCry.java b/Mage.Sets/src/mage/sets/championsofkamigawa/TerashisCry.java index eefc4f884b..ea44c0317a 100644 --- a/Mage.Sets/src/mage/sets/championsofkamigawa/TerashisCry.java +++ b/Mage.Sets/src/mage/sets/championsofkamigawa/TerashisCry.java @@ -52,7 +52,7 @@ public class TerashisCry extends CardImpl { // Tap up to three target creatures. Target target = new TargetCreaturePermanent(0,3); - target.setTargetName("up to three"); + target.setTargetName("up to three"); this.getSpellAbility().addEffect(new TapTargetEffect()); this.getSpellAbility().addTarget(target); } diff --git a/Mage.Sets/src/mage/sets/championsofkamigawa/ThiefOfHope.java b/Mage.Sets/src/mage/sets/championsofkamigawa/ThiefOfHope.java index eb3842873d..cec7c91aa6 100644 --- a/Mage.Sets/src/mage/sets/championsofkamigawa/ThiefOfHope.java +++ b/Mage.Sets/src/mage/sets/championsofkamigawa/ThiefOfHope.java @@ -48,7 +48,7 @@ import mage.target.common.TargetOpponent; public class ThiefOfHope extends CardImpl { private final static FilterSpiritOrArcaneCard filter = new FilterSpiritOrArcaneCard(); - + public ThiefOfHope(UUID ownerId) { super(ownerId, 147, "Thief of Hope", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{2}{B}"); this.expansionSetCode = "CHK"; diff --git a/Mage.Sets/src/mage/sets/championsofkamigawa/UncontrollableAnger.java b/Mage.Sets/src/mage/sets/championsofkamigawa/UncontrollableAnger.java index 8e3cb489a8..6eb807930e 100644 --- a/Mage.Sets/src/mage/sets/championsofkamigawa/UncontrollableAnger.java +++ b/Mage.Sets/src/mage/sets/championsofkamigawa/UncontrollableAnger.java @@ -55,15 +55,15 @@ public class UncontrollableAnger extends CardImpl { super(ownerId, 195, "Uncontrollable Anger", Rarity.COMMON, new CardType[]{CardType.ENCHANTMENT}, "{2}{R}{R}"); this.expansionSetCode = "CHK"; this.subtype.add("Aura"); - this.color.setRed(true); + this.color.setRed(true); TargetPermanent auraTarget = new TargetCreaturePermanent(); - this.getSpellAbility().addTarget(auraTarget); - this.getSpellAbility().addEffect(new AttachEffect(Constants.Outcome.BoostCreature)); - Ability ability = new EnchantAbility(auraTarget.getTargetName()); - this.addAbility(ability); + this.getSpellAbility().addTarget(auraTarget); + this.getSpellAbility().addEffect(new AttachEffect(Constants.Outcome.BoostCreature)); + Ability ability = new EnchantAbility(auraTarget.getTargetName()); + this.addAbility(ability); this.addAbility(FlashAbility.getInstance()); this.addAbility(new SimpleStaticAbility(Constants.Zone.BATTLEFIELD, new BoostEnchantedEffect(2, 2, Constants.Duration.WhileOnBattlefield))); - this.addAbility(new SimpleStaticAbility(Constants.Zone.BATTLEFIELD, new GainAbilityAttachedEffect(new AttacksEachTurnStaticAbility(), Constants.AttachmentType.AURA))); + this.addAbility(new SimpleStaticAbility(Constants.Zone.BATTLEFIELD, new GainAbilityAttachedEffect(new AttacksEachTurnStaticAbility(), Constants.AttachmentType.AURA))); } public UncontrollableAnger (final UncontrollableAnger card) { diff --git a/Mage.Sets/src/mage/sets/championsofkamigawa/UnnaturalSpeed.java b/Mage.Sets/src/mage/sets/championsofkamigawa/UnnaturalSpeed.java index a44182313d..12f1bf503e 100644 --- a/Mage.Sets/src/mage/sets/championsofkamigawa/UnnaturalSpeed.java +++ b/Mage.Sets/src/mage/sets/championsofkamigawa/UnnaturalSpeed.java @@ -48,7 +48,7 @@ public class UnnaturalSpeed extends CardImpl { super(ownerId, 197, "Unnatural Speed", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{R}"); this.expansionSetCode = "CHK"; this.subtype.add("Arcane"); - this.color.setRed(true); + this.color.setRed(true); this.getSpellAbility().addEffect(new GainAbilityTargetEffect(HasteAbility.getInstance(), Constants.Duration.EndOfTurn)); this.getSpellAbility().addTarget(new TargetCreaturePermanent()); } diff --git a/Mage.Sets/src/mage/sets/championsofkamigawa/Vigilance.java b/Mage.Sets/src/mage/sets/championsofkamigawa/Vigilance.java index 38aebc052d..6e22ff17c3 100644 --- a/Mage.Sets/src/mage/sets/championsofkamigawa/Vigilance.java +++ b/Mage.Sets/src/mage/sets/championsofkamigawa/Vigilance.java @@ -51,11 +51,11 @@ public class Vigilance extends CardImpl { super(ownerId, 49, "Vigilance", Rarity.COMMON, new CardType[]{CardType.ENCHANTMENT}, "{W}"); this.expansionSetCode = "CHK"; this.subtype.add("Aura"); - this.color.setWhite(true); + this.color.setWhite(true); TargetPermanent auraTarget = new TargetCreaturePermanent(); this.getSpellAbility().addTarget(auraTarget); this.getSpellAbility().addEffect(new AttachEffect(Constants.Outcome.AddAbility)); - this.addAbility(new SimpleStaticAbility(Constants.Zone.BATTLEFIELD, new GainAbilityAttachedEffect(VigilanceAbility.getInstance(), Constants.AttachmentType.AURA))); + this.addAbility(new SimpleStaticAbility(Constants.Zone.BATTLEFIELD, new GainAbilityAttachedEffect(VigilanceAbility.getInstance(), Constants.AttachmentType.AURA))); } public Vigilance (final Vigilance card) { diff --git a/Mage.Sets/src/mage/sets/championsofkamigawa/VillainousOgre.java b/Mage.Sets/src/mage/sets/championsofkamigawa/VillainousOgre.java index 073b6d558c..3398931020 100644 --- a/Mage.Sets/src/mage/sets/championsofkamigawa/VillainousOgre.java +++ b/Mage.Sets/src/mage/sets/championsofkamigawa/VillainousOgre.java @@ -47,14 +47,14 @@ import mage.filter.common.FilterControlledPermanent; * @author LevelX */ public class VillainousOgre extends CardImpl { - + private static final String rule = "As long as you control a Demon, {this} has {B}: Regenerate Villainous Ogre"; private static final FilterControlledPermanent filter = new FilterControlledPermanent("Demon"); static { filter.getSubtype().add("Demon"); filter.setScopeSubtype(Filter.ComparisonScope.Any); } - + public VillainousOgre(UUID ownerId) { super(ownerId, 148, "Villainous Ogre", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{2}{B}"); this.expansionSetCode = "CHK"; @@ -66,7 +66,7 @@ public class VillainousOgre extends CardImpl { this.toughness = new MageInt(2); this.addAbility(CantBlockAbility.getInstance()); - + // As long as you control a Demon, Villainous Ogre has "{B}: Regenerate Villainous Ogre. this.addAbility( new ConditionalActivatedAbility( Constants.Zone.BATTLEFIELD, @@ -84,5 +84,5 @@ public class VillainousOgre extends CardImpl { public VillainousOgre copy() { return new VillainousOgre(this); } - + } diff --git a/Mage.Sets/src/mage/sets/championsofkamigawa/WakingNightmare.java b/Mage.Sets/src/mage/sets/championsofkamigawa/WakingNightmare.java index 97e7f29576..e59a13e8e7 100644 --- a/Mage.Sets/src/mage/sets/championsofkamigawa/WakingNightmare.java +++ b/Mage.Sets/src/mage/sets/championsofkamigawa/WakingNightmare.java @@ -45,7 +45,7 @@ public class WakingNightmare extends CardImpl { super(ownerId, 149, "Waking Nightmare", Rarity.COMMON, new CardType[]{CardType.SORCERY}, "{2}{B}"); this.expansionSetCode = "CHK"; this.subtype.add("Arcane"); - this.color.setBlack(true); + this.color.setBlack(true); this.getSpellAbility().addEffect(new DiscardTargetEffect(2)); this.getSpellAbility().addTarget(new TargetPlayer()); } diff --git a/Mage.Sets/src/mage/sets/championsofkamigawa/WanderingOnes.java b/Mage.Sets/src/mage/sets/championsofkamigawa/WanderingOnes.java index e17cb2adf6..2def10412c 100644 --- a/Mage.Sets/src/mage/sets/championsofkamigawa/WanderingOnes.java +++ b/Mage.Sets/src/mage/sets/championsofkamigawa/WanderingOnes.java @@ -44,7 +44,7 @@ public class WanderingOnes extends CardImpl { super(ownerId, 100, "Wandering Ones", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{U}"); this.expansionSetCode = "CHK"; this.subtype.add("Spirit"); - this.color.setBlue(true); + this.color.setBlue(true); this.power = new MageInt(1); this.toughness = new MageInt(1); } diff --git a/Mage.Sets/src/mage/sets/championsofkamigawa/WickedAkuba.java b/Mage.Sets/src/mage/sets/championsofkamigawa/WickedAkuba.java index 00eef62397..a8dbe119bf 100644 --- a/Mage.Sets/src/mage/sets/championsofkamigawa/WickedAkuba.java +++ b/Mage.Sets/src/mage/sets/championsofkamigawa/WickedAkuba.java @@ -50,7 +50,7 @@ import mage.watchers.common.PlayerDamagedBySourceWatcher; * @author LevelX */ public class WickedAkuba extends CardImpl { - + public WickedAkuba(UUID ownerId) { super(ownerId, 150, "Wicked Akuba", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{B}{B}"); this.expansionSetCode = "CHK"; @@ -74,23 +74,23 @@ public class WickedAkuba extends CardImpl { public WickedAkuba copy() { return new WickedAkuba(this); } - + } class WickedAkubaTarget extends TargetPlayer { - public WickedAkubaTarget() { - super(); - this.targetName = "player dealt damage by Wicked Akuba this turn"; - } + public WickedAkubaTarget() { + super(); + this.targetName = "player dealt damage by Wicked Akuba this turn"; + } - public WickedAkubaTarget(final WickedAkubaTarget target) { - super(target); - } - - @Override - public boolean canChoose(UUID sourceId, UUID sourceControllerId, Game game) { - filter.getPlayerId().clear(); + public WickedAkubaTarget(final WickedAkubaTarget target) { + super(target); + } + + @Override + public boolean canChoose(UUID sourceId, UUID sourceControllerId, Game game) { + filter.getPlayerId().clear(); UUID source = null; MageObject targetSource = game.getObject(sourceId); if (targetSource instanceof StackAbility) { @@ -110,12 +110,12 @@ class WickedAkubaTarget extends TargetPlayer { } if (filter.getPlayerId().isEmpty()) // neccessary because empty playerId filter allows all players return false; - return super.canChoose(sourceId, sourceControllerId, game); - } - - @Override - public boolean canTarget(UUID id, Ability source, Game game) { - filter.getPlayerId().clear(); + return super.canChoose(sourceId, sourceControllerId, game); + } + + @Override + public boolean canTarget(UUID id, Ability source, Game game) { + filter.getPlayerId().clear(); for (UUID playerId: game.getPlayer(source.getControllerId()).getInRange()){ PlayerDamagedBySourceWatcher watcher = (PlayerDamagedBySourceWatcher) game.getState().getWatchers().get("PlayerDamagedBySource", playerId); @@ -124,12 +124,12 @@ class WickedAkubaTarget extends TargetPlayer { } if (filter.getPlayerId().isEmpty()) // neccessary because empty playerId filter allows all players return false; - return super.canTarget(id, source, game); - } + return super.canTarget(id, source, game); + } - @Override - public WickedAkubaTarget copy() { - return new WickedAkubaTarget(this); - } + @Override + public WickedAkubaTarget copy() { + return new WickedAkubaTarget(this); + } } \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/championsofkamigawa/YamabushisFlame.java b/Mage.Sets/src/mage/sets/championsofkamigawa/YamabushisFlame.java index 26937aeba7..e7dafd4d69 100644 --- a/Mage.Sets/src/mage/sets/championsofkamigawa/YamabushisFlame.java +++ b/Mage.Sets/src/mage/sets/championsofkamigawa/YamabushisFlame.java @@ -52,7 +52,7 @@ import mage.watchers.common.DamagedByWatcher; */ public class YamabushisFlame extends CardImpl { - public YamabushisFlame(UUID ownerId) { + public YamabushisFlame(UUID ownerId) { super(ownerId, 198, "Yamabushi's Flame", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{2}{R}"); this.expansionSetCode = "CHK"; this.color.setRed(true); @@ -68,12 +68,12 @@ public class YamabushisFlame extends CardImpl { public YamabushisFlame(final YamabushisFlame card) { super(card); - } + } - @Override - public YamabushisFlame copy() { - return new YamabushisFlame(this); - } + @Override + public YamabushisFlame copy() { + return new YamabushisFlame(this); + } } class YamabushisFlameEffect extends ReplacementEffectImpl { diff --git a/Mage.Sets/src/mage/sets/championsofkamigawa/YoseiTheMorningStar.java b/Mage.Sets/src/mage/sets/championsofkamigawa/YoseiTheMorningStar.java index 2c2e8bdb7d..296e2891a8 100644 --- a/Mage.Sets/src/mage/sets/championsofkamigawa/YoseiTheMorningStar.java +++ b/Mage.Sets/src/mage/sets/championsofkamigawa/YoseiTheMorningStar.java @@ -85,13 +85,13 @@ public class YoseiTheMorningStar extends CardImpl { class YoseiTheMorningStarTarget extends TargetPermanent { - public YoseiTheMorningStarTarget() { - super(0, 5, new FilterPermanent("up to five target permanents that player controls that will be tapped"), false); - } + public YoseiTheMorningStarTarget() { + super(0, 5, new FilterPermanent("up to five target permanents that player controls that will be tapped"), false); + } - public YoseiTheMorningStarTarget(final YoseiTheMorningStarTarget target) { - super(target); - } + public YoseiTheMorningStarTarget(final YoseiTheMorningStarTarget target) { + super(target); + } @Override public boolean canTarget(UUID controllerId, UUID id, Ability source, Game game) { @@ -101,50 +101,50 @@ public class YoseiTheMorningStar extends CardImpl { filter.getControllerId().add(player.getId()); return super.canTarget(controllerId, id, source, game); } - return false; - } - - @Override - public YoseiTheMorningStarTarget copy() { - return new YoseiTheMorningStarTarget(this); - } + return false; + } + + @Override + public YoseiTheMorningStarTarget copy() { + return new YoseiTheMorningStarTarget(this); + } } class YoseiTheMorningStarTapEffect extends OneShotEffect { - public YoseiTheMorningStarTapEffect() { - super(Outcome.Tap); + public YoseiTheMorningStarTapEffect() { + super(Outcome.Tap); staticText = "Tap up to five target permanents that player controls"; - } + } - public YoseiTheMorningStarTapEffect(final YoseiTheMorningStarTapEffect effect) { - super(effect); - } + public YoseiTheMorningStarTapEffect(final YoseiTheMorningStarTapEffect effect) { + super(effect); + } - @Override - public YoseiTheMorningStarTapEffect copy() { - return new YoseiTheMorningStarTapEffect(this); - } + @Override + public YoseiTheMorningStarTapEffect copy() { + return new YoseiTheMorningStarTapEffect(this); + } - @Override - public boolean apply(Game game, Ability source) { + @Override + public boolean apply(Game game, Ability source) { Targets targets = source.getTargets(); Target target1 = targets.get(1); for (UUID target: target1.getTargets()) { - Permanent permanent = game.getPermanent(target); - if (permanent != null) { - permanent.tap(game); - } else { - return false; - } - } - return true; - } + Permanent permanent = game.getPermanent(target); + if (permanent != null) { + permanent.tap(game); + } else { + return false; + } + } + return true; + } - @Override - public String getText(Mode mode) { + @Override + public String getText(Mode mode) { return staticText; - } + } } diff --git a/Mage.Sets/src/mage/sets/championsofkamigawa/ZoZuThePunisher.java b/Mage.Sets/src/mage/sets/championsofkamigawa/ZoZuThePunisher.java index 1cec36977d..bbfd32ad3b 100644 --- a/Mage.Sets/src/mage/sets/championsofkamigawa/ZoZuThePunisher.java +++ b/Mage.Sets/src/mage/sets/championsofkamigawa/ZoZuThePunisher.java @@ -83,11 +83,11 @@ public class ZoZuThePunisher extends CardImpl { } class ZoZuThePunisherAbility extends TriggeredAbilityImpl { - + public ZoZuThePunisherAbility() { super(Constants.Zone.BATTLEFIELD, new DamageTargetEffect(2)); } - + ZoZuThePunisherAbility(final ZoZuThePunisherAbility ability) { super(ability); } @@ -96,11 +96,11 @@ class ZoZuThePunisherAbility extends TriggeredAbilityImpl { public AbsorbVis (UUID ownerId) { super(ownerId, 40, "Absorb Vis", Rarity.COMMON, new CardType[]{CardType.SORCERY}, "{6}{B}"); this.expansionSetCode = "CON"; - this.color.setBlack(true); + this.color.setBlack(true); this.getSpellAbility().addEffect(new LoseLifeTargetEffect(4)); this.getSpellAbility().addEffect(new GainLifeEffect(4)); this.getSpellAbility().addTarget(new TargetPlayer()); diff --git a/Mage.Sets/src/mage/sets/conflux/AerieMystics.java b/Mage.Sets/src/mage/sets/conflux/AerieMystics.java index 2e7e6db726..5f4d560f3f 100644 --- a/Mage.Sets/src/mage/sets/conflux/AerieMystics.java +++ b/Mage.Sets/src/mage/sets/conflux/AerieMystics.java @@ -56,7 +56,7 @@ public class AerieMystics extends CardImpl { this.subtype.add("Bird"); this.subtype.add("Wizard"); this.power = new MageInt(3); - this.toughness = new MageInt(4); + this.toughness = new MageInt(4); this.addAbility(FlyingAbility.getInstance()); this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new GainAbilityControlledEffect(ShroudAbility.getInstance(), Duration.EndOfTurn, filter), new ManaCostsImpl("{1}{G}{U}"))); } diff --git a/Mage.Sets/src/mage/sets/conflux/AshasFavor.java b/Mage.Sets/src/mage/sets/conflux/AshasFavor.java index 3414f5d8e5..8ca1055820 100644 --- a/Mage.Sets/src/mage/sets/conflux/AshasFavor.java +++ b/Mage.Sets/src/mage/sets/conflux/AshasFavor.java @@ -55,13 +55,13 @@ public class AshasFavor extends CardImpl { super(ownerId, 2, "Asha's Favor", Rarity.COMMON, new CardType[]{CardType.ENCHANTMENT}, "{2}{W}"); this.expansionSetCode = "CON"; this.subtype.add("Aura"); - this.color.setWhite(true); + this.color.setWhite(true); TargetPermanent auraTarget = new TargetCreaturePermanent(); - this.getSpellAbility().addTarget(auraTarget); - this.getSpellAbility().addEffect(new AttachEffect(Constants.Outcome.BoostCreature)); - Ability ability = new EnchantAbility(auraTarget.getTargetName()); - this.addAbility(ability); + this.getSpellAbility().addTarget(auraTarget); + this.getSpellAbility().addEffect(new AttachEffect(Constants.Outcome.BoostCreature)); + Ability ability = new EnchantAbility(auraTarget.getTargetName()); + this.addAbility(ability); this.addAbility(new SimpleStaticAbility(Constants.Zone.BATTLEFIELD, new GainAbilityAttachedEffect(FlyingAbility.getInstance(), Constants.AttachmentType.AURA))); this.addAbility(new SimpleStaticAbility(Constants.Zone.BATTLEFIELD, new GainAbilityAttachedEffect(FirstStrikeAbility.getInstance(), Constants.AttachmentType.AURA))); diff --git a/Mage.Sets/src/mage/sets/conflux/AvenSquire.java b/Mage.Sets/src/mage/sets/conflux/AvenSquire.java index 4f1c2be333..77a07f06d5 100644 --- a/Mage.Sets/src/mage/sets/conflux/AvenSquire.java +++ b/Mage.Sets/src/mage/sets/conflux/AvenSquire.java @@ -49,7 +49,7 @@ public class AvenSquire extends CardImpl { this.subtype.add("Bird"); this.subtype.add("Soldier"); this.power = new MageInt(1); - this.toughness = new MageInt(1); + this.toughness = new MageInt(1); this.addAbility(FlyingAbility.getInstance()); this.addAbility(new ExaltedAbility()); } diff --git a/Mage.Sets/src/mage/sets/conflux/BeaconBehemoth.java b/Mage.Sets/src/mage/sets/conflux/BeaconBehemoth.java index 9457fdf694..7223674217 100644 --- a/Mage.Sets/src/mage/sets/conflux/BeaconBehemoth.java +++ b/Mage.Sets/src/mage/sets/conflux/BeaconBehemoth.java @@ -49,13 +49,13 @@ import mage.target.common.TargetCreaturePermanent; * @author Loki */ public class BeaconBehemoth extends CardImpl { - + private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("creature with power 5 or greater"); - static { - filter.setPower(4); + static { + filter.setPower(4); filter.setPowerComparison(ComparisonType.GreaterThan); - } + } public BeaconBehemoth (UUID ownerId) { super(ownerId, 78, "Beacon Behemoth", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{3}{G}{G}"); @@ -78,5 +78,5 @@ public class BeaconBehemoth extends CardImpl { public BeaconBehemoth copy() { return new BeaconBehemoth(this); } - + } diff --git a/Mage.Sets/src/mage/sets/conflux/BloodhallOoze.java b/Mage.Sets/src/mage/sets/conflux/BloodhallOoze.java index 2be7aac2b8..cd5f5f017a 100644 --- a/Mage.Sets/src/mage/sets/conflux/BloodhallOoze.java +++ b/Mage.Sets/src/mage/sets/conflux/BloodhallOoze.java @@ -56,7 +56,7 @@ public class BloodhallOoze extends CardImpl { this.color.setRed(true); this.subtype.add("Ooze"); this.power = new MageInt(1); - this.toughness = new MageInt(1); + this.toughness = new MageInt(1); this.addAbility(new BloodhallOozeTriggeredAbility1()); this.addAbility(new BloodhallOozeTriggeredAbility2()); } diff --git a/Mage.Sets/src/mage/sets/conflux/CanyonMinotaur.java b/Mage.Sets/src/mage/sets/conflux/CanyonMinotaur.java index 06772e7a22..29b912a36e 100644 --- a/Mage.Sets/src/mage/sets/conflux/CanyonMinotaur.java +++ b/Mage.Sets/src/mage/sets/conflux/CanyonMinotaur.java @@ -41,23 +41,23 @@ import mage.cards.CardImpl; */ public class CanyonMinotaur extends CardImpl { - public CanyonMinotaur(UUID ownerId) { - super(ownerId, 60, "Canyon Minotaur", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{3}{R}"); - this.expansionSetCode = "CON"; - this.color.setRed(true); - this.subtype.add("Minotaur"); - this.subtype.add("Warrior"); - this.power = new MageInt(3); - this.toughness = new MageInt(3); - } + public CanyonMinotaur(UUID ownerId) { + super(ownerId, 60, "Canyon Minotaur", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{3}{R}"); + this.expansionSetCode = "CON"; + this.color.setRed(true); + this.subtype.add("Minotaur"); + this.subtype.add("Warrior"); + this.power = new MageInt(3); + this.toughness = new MageInt(3); + } - public CanyonMinotaur(final CanyonMinotaur card) { - super(card); - } + public CanyonMinotaur(final CanyonMinotaur card) { + super(card); + } - @Override - public CanyonMinotaur copy() { - return new CanyonMinotaur(this); - } + @Override + public CanyonMinotaur copy() { + return new CanyonMinotaur(this); + } } diff --git a/Mage.Sets/src/mage/sets/conflux/CelestialPurge.java b/Mage.Sets/src/mage/sets/conflux/CelestialPurge.java index ecca9bb1f6..cfd7ed0512 100644 --- a/Mage.Sets/src/mage/sets/conflux/CelestialPurge.java +++ b/Mage.Sets/src/mage/sets/conflux/CelestialPurge.java @@ -44,30 +44,30 @@ import mage.target.TargetPermanent; */ public class CelestialPurge extends CardImpl { - private static final FilterPermanent filter = new FilterPermanent("black or red permanent"); + private static final FilterPermanent filter = new FilterPermanent("black or red permanent"); - static { - filter.setUseColor(true); - filter.setScopeColor(ComparisonScope.Any); - filter.getColor().setBlack(true); - filter.getColor().setRed(true); - } + static { + filter.setUseColor(true); + filter.setScopeColor(ComparisonScope.Any); + filter.getColor().setBlack(true); + filter.getColor().setRed(true); + } - public CelestialPurge(UUID ownerId) { - super(ownerId, 5, "Celestial Purge", Rarity.UNCOMMON, new CardType[]{CardType.INSTANT}, "{1}{W}"); - this.expansionSetCode = "CON"; - this.color.setWhite(true); - this.getSpellAbility().addTarget(new TargetPermanent(filter)); - this.getSpellAbility().addEffect(new ExileTargetEffect()); - } + public CelestialPurge(UUID ownerId) { + super(ownerId, 5, "Celestial Purge", Rarity.UNCOMMON, new CardType[]{CardType.INSTANT}, "{1}{W}"); + this.expansionSetCode = "CON"; + this.color.setWhite(true); + this.getSpellAbility().addTarget(new TargetPermanent(filter)); + this.getSpellAbility().addEffect(new ExileTargetEffect()); + } - public CelestialPurge(final CelestialPurge card) { - super(card); - } + public CelestialPurge(final CelestialPurge card) { + super(card); + } - @Override - public CelestialPurge copy() { - return new CelestialPurge(this); - } + @Override + public CelestialPurge copy() { + return new CelestialPurge(this); + } } diff --git a/Mage.Sets/src/mage/sets/conflux/DarklitGargoyle.java b/Mage.Sets/src/mage/sets/conflux/DarklitGargoyle.java index 80d8df6607..bf8158e440 100644 --- a/Mage.Sets/src/mage/sets/conflux/DarklitGargoyle.java +++ b/Mage.Sets/src/mage/sets/conflux/DarklitGargoyle.java @@ -51,8 +51,8 @@ public class DarklitGargoyle extends CardImpl { this.expansionSetCode = "CON"; this.color.setWhite(true); this.subtype.add("Gargoyle"); - this.power = new MageInt(1); - this.toughness = new MageInt(2); + this.power = new MageInt(1); + this.toughness = new MageInt(2); this.addAbility(FlyingAbility.getInstance()); this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new BoostSourceEffect(2, -1, Duration.EndOfTurn), new ManaCostsImpl(("{B}")))); } diff --git a/Mage.Sets/src/mage/sets/conflux/Dreadwing.java b/Mage.Sets/src/mage/sets/conflux/Dreadwing.java index b067d9082e..a8453a769f 100644 --- a/Mage.Sets/src/mage/sets/conflux/Dreadwing.java +++ b/Mage.Sets/src/mage/sets/conflux/Dreadwing.java @@ -53,7 +53,7 @@ public class Dreadwing extends CardImpl { this.subtype.add("Zombie"); this.color.setBlack(true); this.power = new MageInt(1); - this.toughness = new MageInt(1); + this.toughness = new MageInt(1); SimpleActivatedAbility ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new BoostSourceEffect(3, 0, Duration.EndOfTurn), new ManaCostsImpl(("{1}{U}{B}"))); ability.getEffects().add(new GainAbilitySourceEffect(FlyingAbility.getInstance(), Duration.EndOfTurn)); this.addAbility(ability); diff --git a/Mage.Sets/src/mage/sets/conflux/EsperCormorants.java b/Mage.Sets/src/mage/sets/conflux/EsperCormorants.java index c22541bd86..1230118008 100644 --- a/Mage.Sets/src/mage/sets/conflux/EsperCormorants.java +++ b/Mage.Sets/src/mage/sets/conflux/EsperCormorants.java @@ -48,7 +48,7 @@ public class EsperCormorants extends CardImpl { this.color.setWhite(true); this.color.setBlue(true); this.power = new MageInt(3); - this.toughness = new MageInt(3); + this.toughness = new MageInt(3); this.addAbility(FlyingAbility.getInstance()); } diff --git a/Mage.Sets/src/mage/sets/conflux/Esperzoa.java b/Mage.Sets/src/mage/sets/conflux/Esperzoa.java index c7d002b591..365f6e87e5 100644 --- a/Mage.Sets/src/mage/sets/conflux/Esperzoa.java +++ b/Mage.Sets/src/mage/sets/conflux/Esperzoa.java @@ -59,7 +59,7 @@ public class Esperzoa extends CardImpl { super(ownerId, 25, "Esperzoa", Rarity.UNCOMMON, new CardType[]{CardType.ARTIFACT, CardType.CREATURE}, "{2}{U}"); this.expansionSetCode = "CON"; this.subtype.add("Jellyfish"); - this.color.setBlue(true); + this.color.setBlue(true); this.power = new MageInt(4); this.toughness = new MageInt(3); this.addAbility(FlyingAbility.getInstance()); diff --git a/Mage.Sets/src/mage/sets/conflux/FaerieMechanist.java b/Mage.Sets/src/mage/sets/conflux/FaerieMechanist.java index d75e01b8c9..4a5d737864 100644 --- a/Mage.Sets/src/mage/sets/conflux/FaerieMechanist.java +++ b/Mage.Sets/src/mage/sets/conflux/FaerieMechanist.java @@ -49,15 +49,15 @@ public class FaerieMechanist extends CardImpl { static { filter.getCardType().add(CardType.ARTIFACT); } - + public FaerieMechanist(UUID ownerId) { super(ownerId, 27, "Faerie Mechanist", Rarity.COMMON, new CardType[]{CardType.ARTIFACT, CardType.CREATURE}, "{3}{U}"); this.expansionSetCode = "CON"; this.color.setBlue(true); this.subtype.add("Faerie"); this.subtype.add("Artificer"); - this.power = new MageInt(2); - this.toughness = new MageInt(2); + this.power = new MageInt(2); + this.toughness = new MageInt(2); // Flying this.addAbility(FlyingAbility.getInstance()); // When Faerie Mechanist enters the battlefield, look at the top three cards of your library. diff --git a/Mage.Sets/src/mage/sets/conflux/FontOfMythos.java b/Mage.Sets/src/mage/sets/conflux/FontOfMythos.java index df50eaf34c..5d75360098 100644 --- a/Mage.Sets/src/mage/sets/conflux/FontOfMythos.java +++ b/Mage.Sets/src/mage/sets/conflux/FontOfMythos.java @@ -47,52 +47,52 @@ import mage.target.TargetPlayer; */ public class FontOfMythos extends CardImpl { - public FontOfMythos(UUID ownerId) { - super(ownerId, 136, "Font of Mythos", Rarity.RARE, new CardType[]{CardType.ARTIFACT}, "{4}"); - this.expansionSetCode = "CON"; - this.addAbility(new FontOfMythosAbility()); - } + public FontOfMythos(UUID ownerId) { + super(ownerId, 136, "Font of Mythos", Rarity.RARE, new CardType[]{CardType.ARTIFACT}, "{4}"); + this.expansionSetCode = "CON"; + this.addAbility(new FontOfMythosAbility()); + } - public FontOfMythos(final FontOfMythos card) { - super(card); - } + public FontOfMythos(final FontOfMythos card) { + super(card); + } - @Override - public FontOfMythos copy() { - return new FontOfMythos(this); - } + @Override + public FontOfMythos copy() { + return new FontOfMythos(this); + } } class FontOfMythosAbility extends TriggeredAbilityImpl { - public FontOfMythosAbility() { - super(Zone.BATTLEFIELD, new DrawCardTargetEffect(2)); - } + public FontOfMythosAbility() { + super(Zone.BATTLEFIELD, new DrawCardTargetEffect(2)); + } - public FontOfMythosAbility(final FontOfMythosAbility ability) { - super(ability); - } + public FontOfMythosAbility(final FontOfMythosAbility ability) { + super(ability); + } - @Override - public FontOfMythosAbility copy() { - return new FontOfMythosAbility(this); - } + @Override + public FontOfMythosAbility copy() { + return new FontOfMythosAbility(this); + } - @Override - public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == EventType.DRAW_STEP_PRE) { + @Override + public boolean checkTrigger(GameEvent event, Game game) { + if (event.getType() == EventType.DRAW_STEP_PRE) { this.getTargets().clear(); - this.addTarget(new TargetPlayer()); - getTargets().get(0).add(event.getPlayerId(),game); - return true; - } - return false; - } + this.addTarget(new TargetPlayer()); + getTargets().get(0).add(event.getPlayerId(),game); + return true; + } + return false; + } - @Override - public String getRule() { - return "At the beginning of each player's draw step, that player draws two additional cards."; - } + @Override + public String getRule() { + return "At the beginning of each player's draw step, that player draws two additional cards."; + } } \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/conflux/FrontlineSage.java b/Mage.Sets/src/mage/sets/conflux/FrontlineSage.java index 9a4e530327..5cfb36cb23 100644 --- a/Mage.Sets/src/mage/sets/conflux/FrontlineSage.java +++ b/Mage.Sets/src/mage/sets/conflux/FrontlineSage.java @@ -53,7 +53,7 @@ public class FrontlineSage extends CardImpl { this.expansionSetCode = "CON"; this.subtype.add("Human"); this.subtype.add("Wizard"); - this.color.setBlue(true); + this.color.setBlue(true); this.power = new MageInt(0); this.toughness = new MageInt(1); this.addAbility(new ExaltedAbility()); diff --git a/Mage.Sets/src/mage/sets/conflux/FusionElemental.java b/Mage.Sets/src/mage/sets/conflux/FusionElemental.java index 4fa882fff2..9cc6151d5f 100644 --- a/Mage.Sets/src/mage/sets/conflux/FusionElemental.java +++ b/Mage.Sets/src/mage/sets/conflux/FusionElemental.java @@ -50,7 +50,7 @@ public class FusionElemental extends CardImpl { this.color.setRed(true); this.color.setWhite(true); this.power = new MageInt(8); - this.toughness = new MageInt(8); + this.toughness = new MageInt(8); } public FusionElemental(final FusionElemental card) { diff --git a/Mage.Sets/src/mage/sets/conflux/GiltspireAvenger.java b/Mage.Sets/src/mage/sets/conflux/GiltspireAvenger.java index e58dc70c94..e547f4ec92 100644 --- a/Mage.Sets/src/mage/sets/conflux/GiltspireAvenger.java +++ b/Mage.Sets/src/mage/sets/conflux/GiltspireAvenger.java @@ -64,7 +64,7 @@ public class GiltspireAvenger extends CardImpl { this.color.setGreen(true); this.color.setWhite(true); this.color.setBlue(true); - + this.power = new MageInt(2); this.toughness = new MageInt(2); @@ -75,8 +75,8 @@ public class GiltspireAvenger extends CardImpl { Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DestroyTargetEffect(), new TapSourceCost()); ability.addTarget(new GiltspireAvengerTarget()); this.addAbility(ability); - - + + } public GiltspireAvenger(final GiltspireAvenger card) { @@ -141,7 +141,7 @@ class GiltspireAvengerTarget> extends Targe } return false; } - + @Override public GiltspireAvengerTarget copy() { return new GiltspireAvengerTarget(this); diff --git a/Mage.Sets/src/mage/sets/conflux/GoblinOutlander.java b/Mage.Sets/src/mage/sets/conflux/GoblinOutlander.java index 77535de226..fe74e52122 100644 --- a/Mage.Sets/src/mage/sets/conflux/GoblinOutlander.java +++ b/Mage.Sets/src/mage/sets/conflux/GoblinOutlander.java @@ -45,9 +45,9 @@ public class GoblinOutlander extends CardImpl { private static final FilterCard filter = new FilterCard("white"); static { - filter.setUseColor(true); - filter.getColor().setWhite(true); - filter.setScopeColor(ComparisonScope.Any); + filter.setUseColor(true); + filter.getColor().setWhite(true); + filter.setScopeColor(ComparisonScope.Any); } public GoblinOutlander(UUID ownerId) { @@ -58,7 +58,7 @@ public class GoblinOutlander extends CardImpl { this.subtype.add("Goblin"); this.subtype.add("Scout"); this.power = new MageInt(2); - this.toughness = new MageInt(2); + this.toughness = new MageInt(2); this.addAbility(new ProtectionAbility(filter)); } diff --git a/Mage.Sets/src/mage/sets/conflux/GoblinRazerunners.java b/Mage.Sets/src/mage/sets/conflux/GoblinRazerunners.java index c19caa8168..20a5f38cfa 100644 --- a/Mage.Sets/src/mage/sets/conflux/GoblinRazerunners.java +++ b/Mage.Sets/src/mage/sets/conflux/GoblinRazerunners.java @@ -66,7 +66,7 @@ public class GoblinRazerunners extends CardImpl { this.expansionSetCode = "CON"; this.subtype.add("Goblin"); this.subtype.add("Warrior"); - this.color.setRed(true); + this.color.setRed(true); this.power = new MageInt(3); this.toughness = new MageInt(4); Ability ability = new SimpleActivatedAbility(Constants.Zone.BATTLEFIELD, new AddCountersSourceEffect(CounterType.P1P1.createInstance()), new ManaCostsImpl("{1}{R}")); diff --git a/Mage.Sets/src/mage/sets/conflux/HellsparkElemental.java b/Mage.Sets/src/mage/sets/conflux/HellsparkElemental.java index 4792e50260..a174ef4fe8 100644 --- a/Mage.Sets/src/mage/sets/conflux/HellsparkElemental.java +++ b/Mage.Sets/src/mage/sets/conflux/HellsparkElemental.java @@ -47,27 +47,27 @@ import mage.game.events.GameEvent.EventType; */ public class HellsparkElemental extends CardImpl { - public HellsparkElemental(UUID ownerId) { - super(ownerId, 65, "Hellspark Elemental", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{1}{R}"); - this.expansionSetCode = "CON"; - this.subtype.add("Elemental"); - this.color.setRed(true); - this.power = new MageInt(3); - this.toughness = new MageInt(1); + public HellsparkElemental(UUID ownerId) { + super(ownerId, 65, "Hellspark Elemental", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{1}{R}"); + this.expansionSetCode = "CON"; + this.subtype.add("Elemental"); + this.color.setRed(true); + this.power = new MageInt(3); + this.toughness = new MageInt(1); - this.addAbility(HasteAbility.getInstance()); - this.addAbility(new OnEventTriggeredAbility(EventType.END_TURN_STEP_PRE, "beginning of the end step", true, new SacrificeSourceEffect())); - this.addAbility(new UnearthAbility(new ManaCostsImpl("{1}{R}"))); + this.addAbility(HasteAbility.getInstance()); + this.addAbility(new OnEventTriggeredAbility(EventType.END_TURN_STEP_PRE, "beginning of the end step", true, new SacrificeSourceEffect())); + this.addAbility(new UnearthAbility(new ManaCostsImpl("{1}{R}"))); - } + } - public HellsparkElemental(final HellsparkElemental card) { - super(card); - } + public HellsparkElemental(final HellsparkElemental card) { + super(card); + } - @Override - public HellsparkElemental copy() { - return new HellsparkElemental(this); - } + @Override + public HellsparkElemental copy() { + return new HellsparkElemental(this); + } } diff --git a/Mage.Sets/src/mage/sets/conflux/InfectiousHorror.java b/Mage.Sets/src/mage/sets/conflux/InfectiousHorror.java index 0a608a953c..874ebec06f 100644 --- a/Mage.Sets/src/mage/sets/conflux/InfectiousHorror.java +++ b/Mage.Sets/src/mage/sets/conflux/InfectiousHorror.java @@ -52,7 +52,7 @@ public class InfectiousHorror extends CardImpl { this.expansionSetCode = "CON"; this.subtype.add("Zombie"); this.subtype.add("Horror"); - this.color.setBlack(true); + this.color.setBlack(true); this.power = new MageInt(2); this.toughness = new MageInt(2); this.addAbility(new AttacksTriggeredAbility(new InfectiousHorrorEffect(), false)); diff --git a/Mage.Sets/src/mage/sets/conflux/MartialCoup.java b/Mage.Sets/src/mage/sets/conflux/MartialCoup.java index 6195078a84..ecbcfd7b49 100644 --- a/Mage.Sets/src/mage/sets/conflux/MartialCoup.java +++ b/Mage.Sets/src/mage/sets/conflux/MartialCoup.java @@ -47,51 +47,51 @@ import mage.game.permanent.token.SoldierToken; */ public class MartialCoup extends CardImpl { - public MartialCoup(UUID ownerId) { - super(ownerId, 11, "Martial Coup", Rarity.RARE, new CardType[]{CardType.SORCERY}, "{X}{W}{W}"); - this.expansionSetCode = "CON"; - this.color.setWhite(true); - this.getSpellAbility().addEffect(new MartialCoupEffect()); - } + public MartialCoup(UUID ownerId) { + super(ownerId, 11, "Martial Coup", Rarity.RARE, new CardType[]{CardType.SORCERY}, "{X}{W}{W}"); + this.expansionSetCode = "CON"; + this.color.setWhite(true); + this.getSpellAbility().addEffect(new MartialCoupEffect()); + } - public MartialCoup(final MartialCoup card) { - super(card); - } + public MartialCoup(final MartialCoup card) { + super(card); + } - @Override - public MartialCoup copy() { - return new MartialCoup(this); - } + @Override + public MartialCoup copy() { + return new MartialCoup(this); + } } class MartialCoupEffect extends OneShotEffect { - private static SoldierToken token = new SoldierToken(); + private static SoldierToken token = new SoldierToken(); - public MartialCoupEffect() { - super(Outcome.PutCreatureInPlay); - staticText = "Put X 1/1 white Soldier creature tokens onto the battlefield. If X is 5 or more, destroy all other creatures"; - } + public MartialCoupEffect() { + super(Outcome.PutCreatureInPlay); + staticText = "Put X 1/1 white Soldier creature tokens onto the battlefield. If X is 5 or more, destroy all other creatures"; + } - public MartialCoupEffect(final MartialCoupEffect effect) { - super(effect); - } + public MartialCoupEffect(final MartialCoupEffect effect) { + super(effect); + } - @Override - public MartialCoupEffect copy() { - return new MartialCoupEffect(this); - } + @Override + public MartialCoupEffect copy() { + return new MartialCoupEffect(this); + } - @Override - public boolean apply(Game game, Ability source) { - int amount = source.getManaCostsToPay().getX(); - if (amount > 4) { - for (Permanent permanent: game.getBattlefield().getActivePermanents(new FilterCreaturePermanent(), source.getControllerId(), game)) { - permanent.destroy(source.getSourceId(), game, false); - } - } - token.putOntoBattlefield(amount, game, source.getId(), source.getControllerId()); - return true; - } + @Override + public boolean apply(Game game, Ability source) { + int amount = source.getManaCostsToPay().getX(); + if (amount > 4) { + for (Permanent permanent: game.getBattlefield().getActivePermanents(new FilterCreaturePermanent(), source.getControllerId(), game)) { + permanent.destroy(source.getSourceId(), game, false); + } + } + token.putOntoBattlefield(amount, game, source.getId(), source.getControllerId()); + return true; + } } diff --git a/Mage.Sets/src/mage/sets/conflux/NacatlOutlander.java b/Mage.Sets/src/mage/sets/conflux/NacatlOutlander.java index 0183161b66..1bc54d3d9e 100644 --- a/Mage.Sets/src/mage/sets/conflux/NacatlOutlander.java +++ b/Mage.Sets/src/mage/sets/conflux/NacatlOutlander.java @@ -45,9 +45,9 @@ public class NacatlOutlander extends CardImpl { private static final FilterCard filter = new FilterCard("blue"); static { - filter.setUseColor(true); - filter.getColor().setBlue(true); - filter.setScopeColor(ComparisonScope.Any); + filter.setUseColor(true); + filter.getColor().setBlue(true); + filter.setScopeColor(ComparisonScope.Any); } public NacatlOutlander(UUID ownerId) { @@ -58,7 +58,7 @@ public class NacatlOutlander extends CardImpl { this.subtype.add("Cat"); this.subtype.add("Scout"); this.power = new MageInt(2); - this.toughness = new MageInt(2); + this.toughness = new MageInt(2); this.addAbility(new ProtectionAbility(filter)); } diff --git a/Mage.Sets/src/mage/sets/conflux/NobleHierarch.java b/Mage.Sets/src/mage/sets/conflux/NobleHierarch.java index 046d031959..f89feba549 100644 --- a/Mage.Sets/src/mage/sets/conflux/NobleHierarch.java +++ b/Mage.Sets/src/mage/sets/conflux/NobleHierarch.java @@ -45,26 +45,26 @@ import mage.cards.CardImpl; */ public class NobleHierarch extends CardImpl { - public NobleHierarch(UUID ownerId) { - super(ownerId, 87, "Noble Hierarch", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{G}"); - this.expansionSetCode = "CON"; - this.color.setGreen(true); - this.subtype.add("Human"); - this.subtype.add("Druid"); - this.power = new MageInt(0); - this.toughness = new MageInt(1); - this.addAbility(new ExaltedAbility()); - this.addAbility(new GreenManaAbility()); - this.addAbility(new WhiteManaAbility()); - this.addAbility(new BlueManaAbility()); - } + public NobleHierarch(UUID ownerId) { + super(ownerId, 87, "Noble Hierarch", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{G}"); + this.expansionSetCode = "CON"; + this.color.setGreen(true); + this.subtype.add("Human"); + this.subtype.add("Druid"); + this.power = new MageInt(0); + this.toughness = new MageInt(1); + this.addAbility(new ExaltedAbility()); + this.addAbility(new GreenManaAbility()); + this.addAbility(new WhiteManaAbility()); + this.addAbility(new BlueManaAbility()); + } - public NobleHierarch(final NobleHierarch card) { - super(card); - } + public NobleHierarch(final NobleHierarch card) { + super(card); + } - @Override - public NobleHierarch copy() { - return new NobleHierarch(this); - } + @Override + public NobleHierarch copy() { + return new NobleHierarch(this); + } } diff --git a/Mage.Sets/src/mage/sets/conflux/PathToExile.java b/Mage.Sets/src/mage/sets/conflux/PathToExile.java index ef347af3a4..6d8872f5ec 100644 --- a/Mage.Sets/src/mage/sets/conflux/PathToExile.java +++ b/Mage.Sets/src/mage/sets/conflux/PathToExile.java @@ -51,49 +51,49 @@ import mage.target.common.TargetCreaturePermanent; */ public class PathToExile extends CardImpl { - public PathToExile(UUID ownerId) { - super(ownerId, 15, "Path to Exile", Rarity.UNCOMMON, new CardType[]{CardType.INSTANT}, "{W}"); - this.expansionSetCode = "CON"; - this.color.setWhite(true); - this.getSpellAbility().addTarget(new TargetCreaturePermanent()); - this.getSpellAbility().addEffect(new PathToExileEffect()); - } + public PathToExile(UUID ownerId) { + super(ownerId, 15, "Path to Exile", Rarity.UNCOMMON, new CardType[]{CardType.INSTANT}, "{W}"); + this.expansionSetCode = "CON"; + this.color.setWhite(true); + this.getSpellAbility().addTarget(new TargetCreaturePermanent()); + this.getSpellAbility().addEffect(new PathToExileEffect()); + } - public PathToExile(final PathToExile card) { - super(card); - } + public PathToExile(final PathToExile card) { + super(card); + } - @Override - public PathToExile copy() { - return new PathToExile(this); - } + @Override + public PathToExile copy() { + return new PathToExile(this); + } } class PathToExileEffect extends OneShotEffect { - public PathToExileEffect() { - super(Outcome.Exile); - staticText = "Exile target creature. Its controller may search his or her library for a basic land card, put that card onto the battlefield tapped, then shuffle his or her library"; - } + public PathToExileEffect() { + super(Outcome.Exile); + staticText = "Exile target creature. Its controller may search his or her library for a basic land card, put that card onto the battlefield tapped, then shuffle his or her library"; + } - public PathToExileEffect(final PathToExileEffect effect) { - super(effect); - } + public PathToExileEffect(final PathToExileEffect effect) { + super(effect); + } - @Override - public PathToExileEffect copy() { - return new PathToExileEffect(this); - } + @Override + public PathToExileEffect copy() { + return new PathToExileEffect(this); + } - @Override - public boolean apply(Game game, Ability source) { - Permanent permanent = game.getPermanent(source.getFirstTarget()); - if (permanent != null) { - Player player = game.getPlayer(permanent.getControllerId()); - if (permanent.moveToZone(Zone.EXILED, source.getId(), game, false)) { - if (player.chooseUse(Outcome.PutCardInPlay, "Use Path to Exile effect?", game)) { - TargetCardInLibrary target = new TargetCardInLibrary(new FilterBasicLandCard()); - if (player.searchLibrary(target, game)) { + @Override + public boolean apply(Game game, Ability source) { + Permanent permanent = game.getPermanent(source.getFirstTarget()); + if (permanent != null) { + Player player = game.getPlayer(permanent.getControllerId()); + if (permanent.moveToZone(Zone.EXILED, source.getId(), game, false)) { + if (player.chooseUse(Outcome.PutCardInPlay, "Use Path to Exile effect?", game)) { + TargetCardInLibrary target = new TargetCardInLibrary(new FilterBasicLandCard()); + if (player.searchLibrary(target, game)) { Card card = player.getLibrary().getCard(target.getFirstTarget(), game); if (card != null) { if (card.putOntoBattlefield(game, Zone.LIBRARY, source.getId(), permanent.getControllerId())) { @@ -103,12 +103,12 @@ class PathToExileEffect extends OneShotEffect { } } } - player.shuffleLibrary(game); - } - return true; - } - } - return false; - } + player.shuffleLibrary(game); + } + return true; + } + } + return false; + } } \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/conflux/PestilentKathari.java b/Mage.Sets/src/mage/sets/conflux/PestilentKathari.java index 3e1b4e173d..8b820270d9 100644 --- a/Mage.Sets/src/mage/sets/conflux/PestilentKathari.java +++ b/Mage.Sets/src/mage/sets/conflux/PestilentKathari.java @@ -55,7 +55,7 @@ public class PestilentKathari extends CardImpl { this.subtype.add("Warrior"); this.color.setBlack(true); this.power = new MageInt(1); - this.toughness = new MageInt(1); + this.toughness = new MageInt(1); this.addAbility(FlyingAbility.getInstance()); this.addAbility(DeathtouchAbility.getInstance()); this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new GainAbilitySourceEffect(FirstStrikeAbility.getInstance(), Duration.EndOfTurn), new ManaCostsImpl("{2}{R}"))); diff --git a/Mage.Sets/src/mage/sets/conflux/QuenchableFire.java b/Mage.Sets/src/mage/sets/conflux/QuenchableFire.java index 631c2aa1ff..dcfda303e4 100644 --- a/Mage.Sets/src/mage/sets/conflux/QuenchableFire.java +++ b/Mage.Sets/src/mage/sets/conflux/QuenchableFire.java @@ -53,113 +53,113 @@ import mage.target.TargetPlayer; */ public class QuenchableFire extends CardImpl { - public QuenchableFire(UUID ownerId) { - super(ownerId, 70, "Quenchable Fire", Rarity.COMMON, new CardType[]{CardType.SORCERY}, "{3}{R}"); - this.expansionSetCode = "CON"; - this.color.setRed(true); - this.getSpellAbility().addTarget(new TargetPlayer()); - this.getSpellAbility().addEffect(new DamageTargetEffect(3)); - this.getSpellAbility().addEffect(new QuenchableFireEffect()); - } + public QuenchableFire(UUID ownerId) { + super(ownerId, 70, "Quenchable Fire", Rarity.COMMON, new CardType[]{CardType.SORCERY}, "{3}{R}"); + this.expansionSetCode = "CON"; + this.color.setRed(true); + this.getSpellAbility().addTarget(new TargetPlayer()); + this.getSpellAbility().addEffect(new DamageTargetEffect(3)); + this.getSpellAbility().addEffect(new QuenchableFireEffect()); + } - public QuenchableFire(final QuenchableFire card) { - super(card); - } + public QuenchableFire(final QuenchableFire card) { + super(card); + } - @Override - public QuenchableFire copy() { - return new QuenchableFire(this); - } + @Override + public QuenchableFire copy() { + return new QuenchableFire(this); + } } class QuenchableFireEffect extends OneShotEffect { - public QuenchableFireEffect() { - super(Outcome.Damage); - staticText = "{this} deals an additional 3 damage to that player at the beginning of your next upkeep step unless he or she pays {U} before that step"; - } - - public QuenchableFireEffect(final QuenchableFireEffect effect) { - super(effect); - } + public QuenchableFireEffect() { + super(Outcome.Damage); + staticText = "{this} deals an additional 3 damage to that player at the beginning of your next upkeep step unless he or she pays {U} before that step"; + } - @Override - public QuenchableFireEffect copy() { - return new QuenchableFireEffect(this); - } + public QuenchableFireEffect(final QuenchableFireEffect effect) { + super(effect); + } - @Override - public boolean apply(Game game, Ability source) { - //create delayed triggered ability - QuenchableFireDelayedTriggeredAbility delayedAbility = new QuenchableFireDelayedTriggeredAbility(); - delayedAbility.setSourceId(source.getSourceId()); - delayedAbility.setControllerId(source.getControllerId()); - delayedAbility.getTargets().addAll(source.getTargets()); - game.addDelayedTriggeredAbility(delayedAbility); - //create special action - QuenchableFireSpecialAction newAction = new QuenchableFireSpecialAction(delayedAbility.getId()); - delayedAbility.setSpecialActionId(newAction.getId()); - newAction.setSourceId(source.getSourceId()); - newAction.setControllerId(source.getFirstTarget()); - newAction.getTargets().addAll(source.getTargets()); - game.getState().getSpecialActions().add(newAction); - return true; - } + @Override + public QuenchableFireEffect copy() { + return new QuenchableFireEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + //create delayed triggered ability + QuenchableFireDelayedTriggeredAbility delayedAbility = new QuenchableFireDelayedTriggeredAbility(); + delayedAbility.setSourceId(source.getSourceId()); + delayedAbility.setControllerId(source.getControllerId()); + delayedAbility.getTargets().addAll(source.getTargets()); + game.addDelayedTriggeredAbility(delayedAbility); + //create special action + QuenchableFireSpecialAction newAction = new QuenchableFireSpecialAction(delayedAbility.getId()); + delayedAbility.setSpecialActionId(newAction.getId()); + newAction.setSourceId(source.getSourceId()); + newAction.setControllerId(source.getFirstTarget()); + newAction.getTargets().addAll(source.getTargets()); + game.getState().getSpecialActions().add(newAction); + return true; + } } class QuenchableFireDelayedTriggeredAbility extends DelayedTriggeredAbility { - private UUID specialActionId; + private UUID specialActionId; - public QuenchableFireDelayedTriggeredAbility() { - super(new DamageTargetEffect(3)); - } + public QuenchableFireDelayedTriggeredAbility() { + super(new DamageTargetEffect(3)); + } - public void setSpecialActionId(UUID specialActionId) { - this.specialActionId = specialActionId; - } + public void setSpecialActionId(UUID specialActionId) { + this.specialActionId = specialActionId; + } - public QuenchableFireDelayedTriggeredAbility(final QuenchableFireDelayedTriggeredAbility ability) { - super(ability); - } + public QuenchableFireDelayedTriggeredAbility(final QuenchableFireDelayedTriggeredAbility ability) { + super(ability); + } - @Override - public QuenchableFireDelayedTriggeredAbility copy() { - return new QuenchableFireDelayedTriggeredAbility(this); - } + @Override + public QuenchableFireDelayedTriggeredAbility copy() { + return new QuenchableFireDelayedTriggeredAbility(this); + } - @Override - public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == EventType.UPKEEP_STEP_PRE && event.getPlayerId().equals(this.controllerId)) { - for (SpecialAction action: game.getState().getSpecialActions()) { - if (action.getId().equals(specialActionId)) { - game.getState().getSpecialActions().remove(action); - break; - } - } - return true; - } - return false; - } + @Override + public boolean checkTrigger(GameEvent event, Game game) { + if (event.getType() == EventType.UPKEEP_STEP_PRE && event.getPlayerId().equals(this.controllerId)) { + for (SpecialAction action: game.getState().getSpecialActions()) { + if (action.getId().equals(specialActionId)) { + game.getState().getSpecialActions().remove(action); + break; + } + } + return true; + } + return false; + } } class QuenchableFireSpecialAction extends SpecialAction { - public QuenchableFireSpecialAction(UUID effectId) { - this.addCost(new ManaCostsImpl("{U}")); - this.addEffect(new RemoveDelayedTriggeredAbilityEffect(effectId)); - this.addEffect(new RemoveSpecialActionEffect(this.getId())); - } + public QuenchableFireSpecialAction(UUID effectId) { + this.addCost(new ManaCostsImpl("{U}")); + this.addEffect(new RemoveDelayedTriggeredAbilityEffect(effectId)); + this.addEffect(new RemoveSpecialActionEffect(this.getId())); + } - public QuenchableFireSpecialAction(final QuenchableFireSpecialAction ability) { - super(ability); - } + public QuenchableFireSpecialAction(final QuenchableFireSpecialAction ability) { + super(ability); + } - @Override - public QuenchableFireSpecialAction copy() { - return new QuenchableFireSpecialAction(this); - } + @Override + public QuenchableFireSpecialAction copy() { + return new QuenchableFireSpecialAction(this); + } } \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/conflux/ReliquaryTower.java b/Mage.Sets/src/mage/sets/conflux/ReliquaryTower.java index 26a56191d7..0f5ad07912 100644 --- a/Mage.Sets/src/mage/sets/conflux/ReliquaryTower.java +++ b/Mage.Sets/src/mage/sets/conflux/ReliquaryTower.java @@ -53,7 +53,7 @@ public class ReliquaryTower extends CardImpl { this.addAbility(new SimpleStaticAbility(Constants.Zone.BATTLEFIELD, effect)); // {tap}: Add {1} to your mana pool. - this.addAbility(new ColorlessManaAbility()); + this.addAbility(new ColorlessManaAbility()); } public ReliquaryTower(final ReliquaryTower card) { diff --git a/Mage.Sets/src/mage/sets/conflux/RottingRats.java b/Mage.Sets/src/mage/sets/conflux/RottingRats.java index 11e3c6ed85..b245748192 100644 --- a/Mage.Sets/src/mage/sets/conflux/RottingRats.java +++ b/Mage.Sets/src/mage/sets/conflux/RottingRats.java @@ -50,7 +50,7 @@ public class RottingRats extends CardImpl { this.expansionSetCode = "CON"; this.subtype.add("Zombie"); this.subtype.add("Rat"); - this.color.setBlack(true); + this.color.setBlack(true); this.power = new MageInt(1); this.toughness = new MageInt(1); this.addAbility(new EntersBattlefieldTriggeredAbility(new DiscardEachPlayerEffect())); diff --git a/Mage.Sets/src/mage/sets/conflux/ScepterOfDominance.java b/Mage.Sets/src/mage/sets/conflux/ScepterOfDominance.java index 4570a9c306..ee72b0162b 100644 --- a/Mage.Sets/src/mage/sets/conflux/ScepterOfDominance.java +++ b/Mage.Sets/src/mage/sets/conflux/ScepterOfDominance.java @@ -49,7 +49,7 @@ public class ScepterOfDominance extends CardImpl { super(ownerId, 17, "Scepter of Dominance", Rarity.RARE, new CardType[]{CardType.ARTIFACT}, "{1}{W}{W}"); this.expansionSetCode = "CON"; this.color.setWhite(true); - + SimpleActivatedAbility ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new TapTargetEffect(), new ManaCostsImpl("{W}")); ability.addCost(new TapSourceCost()); ability.addTarget(new TargetPermanent()); diff --git a/Mage.Sets/src/mage/sets/conflux/SoulsMajesty.java b/Mage.Sets/src/mage/sets/conflux/SoulsMajesty.java index ae37cb2d31..44e88c028e 100644 --- a/Mage.Sets/src/mage/sets/conflux/SoulsMajesty.java +++ b/Mage.Sets/src/mage/sets/conflux/SoulsMajesty.java @@ -78,11 +78,11 @@ public class SoulsMajesty extends CardImpl { public boolean apply(Game game, Ability source) { Permanent target = game.getPermanent(source.getFirstTarget()); Player player = game.getPlayer(source.getControllerId()); - if (player != null && target != null) { - player.drawCards(target.getPower().getValue(), game); - return true; - } - return false; + if (player != null && target != null) { + player.drawCards(target.getPower().getValue(), game); + return true; + } + return false; } @Override diff --git a/Mage.Sets/src/mage/sets/conflux/Thornling.java b/Mage.Sets/src/mage/sets/conflux/Thornling.java index 70fac7cc56..97349e0143 100644 --- a/Mage.Sets/src/mage/sets/conflux/Thornling.java +++ b/Mage.Sets/src/mage/sets/conflux/Thornling.java @@ -50,28 +50,28 @@ import mage.cards.CardImpl; */ public class Thornling extends CardImpl { - public Thornling(UUID ownerId) { - super(ownerId, 95, "Thornling", Rarity.MYTHIC, new CardType[]{CardType.CREATURE}, "{3}{G}{G}"); - this.expansionSetCode = "CON"; - this.color.setGreen(true); - this.subtype.add("Elemental"); - this.subtype.add("Shapeshifter"); - this.power = new MageInt(4); - this.toughness = new MageInt(4); - this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new GainAbilitySourceEffect(HasteAbility.getInstance(), Duration.EndOfTurn), new ManaCostsImpl("{G}"))); - this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new GainAbilitySourceEffect(TrampleAbility.getInstance(), Duration.EndOfTurn), new ManaCostsImpl("{G}"))); - this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new GainAbilitySourceEffect(IndestructibleAbility.getInstance(), Duration.EndOfTurn), new ManaCostsImpl("{G}"))); - this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new BoostSourceEffect(1, -1, Duration.EndOfTurn), new ManaCostsImpl("{1}"))); - this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new BoostSourceEffect(-1, 1, Duration.EndOfTurn), new ManaCostsImpl("{1}"))); - } + public Thornling(UUID ownerId) { + super(ownerId, 95, "Thornling", Rarity.MYTHIC, new CardType[]{CardType.CREATURE}, "{3}{G}{G}"); + this.expansionSetCode = "CON"; + this.color.setGreen(true); + this.subtype.add("Elemental"); + this.subtype.add("Shapeshifter"); + this.power = new MageInt(4); + this.toughness = new MageInt(4); + this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new GainAbilitySourceEffect(HasteAbility.getInstance(), Duration.EndOfTurn), new ManaCostsImpl("{G}"))); + this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new GainAbilitySourceEffect(TrampleAbility.getInstance(), Duration.EndOfTurn), new ManaCostsImpl("{G}"))); + this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new GainAbilitySourceEffect(IndestructibleAbility.getInstance(), Duration.EndOfTurn), new ManaCostsImpl("{G}"))); + this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new BoostSourceEffect(1, -1, Duration.EndOfTurn), new ManaCostsImpl("{1}"))); + this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new BoostSourceEffect(-1, 1, Duration.EndOfTurn), new ManaCostsImpl("{1}"))); + } - public Thornling(final Thornling card) { - super(card); - } + public Thornling(final Thornling card) { + super(card); + } - @Override - public Thornling copy() { - return new Thornling(this); - } + @Override + public Thornling copy() { + return new Thornling(this); + } } diff --git a/Mage.Sets/src/mage/sets/conflux/TraumaticVisions.java b/Mage.Sets/src/mage/sets/conflux/TraumaticVisions.java index 7109301ba3..44b4b7f5f2 100644 --- a/Mage.Sets/src/mage/sets/conflux/TraumaticVisions.java +++ b/Mage.Sets/src/mage/sets/conflux/TraumaticVisions.java @@ -50,7 +50,7 @@ public class TraumaticVisions extends CardImpl { // Counter target spell. this.getSpellAbility().addTarget(new TargetSpell()); - this.getSpellAbility().addEffect(new CounterTargetEffect()); + this.getSpellAbility().addEffect(new CounterTargetEffect()); this.addAbility(new BasicLandcyclingAbility(new ManaCostsImpl("{1}{U}"))); } diff --git a/Mage.Sets/src/mage/sets/conflux/Unsummon.java b/Mage.Sets/src/mage/sets/conflux/Unsummon.java index a5f9662e0d..0c248e4e21 100644 --- a/Mage.Sets/src/mage/sets/conflux/Unsummon.java +++ b/Mage.Sets/src/mage/sets/conflux/Unsummon.java @@ -36,19 +36,19 @@ import java.util.UUID; */ public class Unsummon extends mage.sets.tenth.Unsummon { - public Unsummon(UUID ownerId) { - super(ownerId); - this.cardNumber = 37; - this.expansionSetCode = "CON"; - } + public Unsummon(UUID ownerId) { + super(ownerId); + this.cardNumber = 37; + this.expansionSetCode = "CON"; + } - public Unsummon(final Unsummon card) { - super(card); - } + public Unsummon(final Unsummon card) { + super(card); + } - @Override - public Unsummon copy() { - return new Unsummon(this); - } + @Override + public Unsummon copy() { + return new Unsummon(this); + } } \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/conflux/ValeronOutlander.java b/Mage.Sets/src/mage/sets/conflux/ValeronOutlander.java index e09de63d5e..9d1bfd9866 100644 --- a/Mage.Sets/src/mage/sets/conflux/ValeronOutlander.java +++ b/Mage.Sets/src/mage/sets/conflux/ValeronOutlander.java @@ -45,9 +45,9 @@ public class ValeronOutlander extends CardImpl { private static final FilterCard filter = new FilterCard("black"); static { - filter.setUseColor(true); - filter.getColor().setBlack(true); - filter.setScopeColor(ComparisonScope.Any); + filter.setUseColor(true); + filter.getColor().setBlack(true); + filter.setScopeColor(ComparisonScope.Any); } public ValeronOutlander(UUID ownerId) { @@ -58,7 +58,7 @@ public class ValeronOutlander extends CardImpl { this.subtype.add("Human"); this.subtype.add("Scout"); this.power = new MageInt(2); - this.toughness = new MageInt(2); + this.toughness = new MageInt(2); this.addAbility(new ProtectionAbility(filter)); } diff --git a/Mage.Sets/src/mage/sets/conflux/ValiantGuard.java b/Mage.Sets/src/mage/sets/conflux/ValiantGuard.java index 87bbd75ce7..8cacc8bba6 100644 --- a/Mage.Sets/src/mage/sets/conflux/ValiantGuard.java +++ b/Mage.Sets/src/mage/sets/conflux/ValiantGuard.java @@ -47,7 +47,7 @@ public class ValiantGuard extends CardImpl { this.subtype.add("Human"); this.subtype.add("Soldier"); this.power = new MageInt(0); - this.toughness = new MageInt(3); + this.toughness = new MageInt(3); } public ValiantGuard(final ValiantGuard card) { diff --git a/Mage.Sets/src/mage/sets/conflux/VectisAgents.java b/Mage.Sets/src/mage/sets/conflux/VectisAgents.java index 66754387a2..2c71d2dd5a 100644 --- a/Mage.Sets/src/mage/sets/conflux/VectisAgents.java +++ b/Mage.Sets/src/mage/sets/conflux/VectisAgents.java @@ -56,7 +56,7 @@ public class VectisAgents extends CardImpl { this.subtype.add("Human"); this.subtype.add("Rogue"); this.power = new MageInt(4); - this.toughness = new MageInt(3); + this.toughness = new MageInt(3); Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new BoostSourceEffect(-2, -0, Duration.EndOfTurn), new ManaCostsImpl("{U}{B}")); ability.addEffect(new GainAbilitySourceEffect(UnblockableAbility.getInstance(), Duration.EndOfTurn)); this.addAbility(ability); diff --git a/Mage.Sets/src/mage/sets/conflux/VedalkenOutlander.java b/Mage.Sets/src/mage/sets/conflux/VedalkenOutlander.java index d06db6b1de..a5e7b23d9b 100644 --- a/Mage.Sets/src/mage/sets/conflux/VedalkenOutlander.java +++ b/Mage.Sets/src/mage/sets/conflux/VedalkenOutlander.java @@ -45,9 +45,9 @@ public class VedalkenOutlander extends CardImpl { private static final FilterCard filter = new FilterCard("red"); static { - filter.setUseColor(true); - filter.getColor().setRed(true); - filter.setScopeColor(ComparisonScope.Any); + filter.setUseColor(true); + filter.getColor().setRed(true); + filter.setScopeColor(ComparisonScope.Any); } public VedalkenOutlander(UUID ownerId) { @@ -58,7 +58,7 @@ public class VedalkenOutlander extends CardImpl { this.subtype.add("Vedalken"); this.subtype.add("Scout"); this.power = new MageInt(2); - this.toughness = new MageInt(2); + this.toughness = new MageInt(2); this.addAbility(new ProtectionAbility(filter)); } diff --git a/Mage.Sets/src/mage/sets/conflux/WallOfReverence.java b/Mage.Sets/src/mage/sets/conflux/WallOfReverence.java index d7acbf49d8..ebe559f7fd 100644 --- a/Mage.Sets/src/mage/sets/conflux/WallOfReverence.java +++ b/Mage.Sets/src/mage/sets/conflux/WallOfReverence.java @@ -56,7 +56,7 @@ public class WallOfReverence extends CardImpl { this.expansionSetCode = "CON"; this.subtype.add("Spirit"); this.subtype.add("Wall"); - this.color.setWhite(true); + this.color.setWhite(true); this.power = new MageInt(1); this.toughness = new MageInt(6); this.addAbility(DefenderAbility.getInstance()); diff --git a/Mage.Sets/src/mage/sets/conflux/ZombieOutlander.java b/Mage.Sets/src/mage/sets/conflux/ZombieOutlander.java index 076009bec8..6aeb8214ac 100644 --- a/Mage.Sets/src/mage/sets/conflux/ZombieOutlander.java +++ b/Mage.Sets/src/mage/sets/conflux/ZombieOutlander.java @@ -45,9 +45,9 @@ public class ZombieOutlander extends CardImpl { private static final FilterCard filter = new FilterCard("green"); static { - filter.setUseColor(true); - filter.getColor().setGreen(true); - filter.setScopeColor(ComparisonScope.Any); + filter.setUseColor(true); + filter.getColor().setGreen(true); + filter.setScopeColor(ComparisonScope.Any); } public ZombieOutlander(UUID ownerId) { @@ -58,7 +58,7 @@ public class ZombieOutlander extends CardImpl { this.subtype.add("Zombie"); this.subtype.add("Scout"); this.power = new MageInt(2); - this.toughness = new MageInt(2); + this.toughness = new MageInt(2); this.addAbility(new ProtectionAbility(filter)); } diff --git a/Mage.Sets/src/mage/sets/darkascension/AfflictedDeserter.java b/Mage.Sets/src/mage/sets/darkascension/AfflictedDeserter.java index cde072d26e..5f1d0b37c2 100644 --- a/Mage.Sets/src/mage/sets/darkascension/AfflictedDeserter.java +++ b/Mage.Sets/src/mage/sets/darkascension/AfflictedDeserter.java @@ -92,71 +92,71 @@ public class AfflictedDeserter extends CardImpl { class WerewolfRansackerAbility extends TriggeredAbilityImpl { - private static final FilterPermanent filter = new FilterPermanent("artifact"); + private static final FilterPermanent filter = new FilterPermanent("artifact"); - static { - filter.getCardType().add(CardType.ARTIFACT); - filter.setScopeCardType(Filter.ComparisonScope.Any); - } + static { + filter.getCardType().add(CardType.ARTIFACT); + filter.setScopeCardType(Filter.ComparisonScope.Any); + } public WerewolfRansackerAbility() { - super(Constants.Zone.BATTLEFIELD, new WerewolfRansackerEffect(), true); - Target target = new TargetPermanent(filter); - target.setRequired(true); - this.addTarget(target); - } + super(Constants.Zone.BATTLEFIELD, new WerewolfRansackerEffect(), true); + Target target = new TargetPermanent(filter); + target.setRequired(true); + this.addTarget(target); + } - public WerewolfRansackerAbility(final WerewolfRansackerAbility ability) { - super(ability); - } + public WerewolfRansackerAbility(final WerewolfRansackerAbility ability) { + super(ability); + } - @Override - public WerewolfRansackerAbility copy() { - return new WerewolfRansackerAbility(this); - } + @Override + public WerewolfRansackerAbility copy() { + return new WerewolfRansackerAbility(this); + } - @Override - public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == GameEvent.EventType.TRANSFORMED) { + @Override + public boolean checkTrigger(GameEvent event, Game game) { + if (event.getType() == GameEvent.EventType.TRANSFORMED) { if (event.getTargetId().equals(sourceId)) { Permanent permanent = game.getPermanent(sourceId); if (permanent != null && permanent.isTransformed()) return true; } - } - return false; - } + } + return false; + } - @Override - public String getRule() { - return "Whenever this creature transforms into Werewolf Ransacker, you may destroy target artifact. If that artifact is put into a graveyard this way, Werewolf Ransacker deals 3 damage to that artifact's controller."; - } + @Override + public String getRule() { + return "Whenever this creature transforms into Werewolf Ransacker, you may destroy target artifact. If that artifact is put into a graveyard this way, Werewolf Ransacker deals 3 damage to that artifact's controller."; + } } class WerewolfRansackerEffect extends OneShotEffect { - public WerewolfRansackerEffect() { - super(Constants.Outcome.DestroyPermanent); - } + public WerewolfRansackerEffect() { + super(Constants.Outcome.DestroyPermanent); + } - public WerewolfRansackerEffect(final WerewolfRansackerEffect effect) { - super(effect); - } + public WerewolfRansackerEffect(final WerewolfRansackerEffect effect) { + super(effect); + } - @Override - public WerewolfRansackerEffect copy() { - return new WerewolfRansackerEffect(this); - } + @Override + public WerewolfRansackerEffect copy() { + return new WerewolfRansackerEffect(this); + } - @Override - public boolean apply(Game game, Ability source) { + @Override + public boolean apply(Game game, Ability source) { int affectedTargets = 0; - if (targetPointer.getTargets(game, source).size() > 0) { - for (UUID permanentId : targetPointer.getTargets(game, source)) { - Permanent permanent = game.getPermanent(permanentId); - if (permanent != null) { - if (permanent.destroy(source.getId(), game, false)) { + if (targetPointer.getTargets(game, source).size() > 0) { + for (UUID permanentId : targetPointer.getTargets(game, source)) { + Permanent permanent = game.getPermanent(permanentId); + if (permanent != null) { + if (permanent.destroy(source.getId(), game, false)) { affectedTargets++; if (game.getState().getZone(permanent.getId()) == Zone.GRAVEYARD) { Player player = game.getPlayer(permanent.getControllerId()); @@ -164,10 +164,10 @@ class WerewolfRansackerEffect extends OneShotEffect { player.damage(3, source.getSourceId(), game, false, true); } } - } - } - } - return affectedTargets > 0; - } + } + } + } + return affectedTargets > 0; + } } diff --git a/Mage.Sets/src/mage/sets/darkascension/AlphaBrawl.java b/Mage.Sets/src/mage/sets/darkascension/AlphaBrawl.java index 3844ee84bf..f94a357be2 100644 --- a/Mage.Sets/src/mage/sets/darkascension/AlphaBrawl.java +++ b/Mage.Sets/src/mage/sets/darkascension/AlphaBrawl.java @@ -47,11 +47,11 @@ import java.util.UUID; */ public class AlphaBrawl extends CardImpl { - private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("creature an opponent controls"); + private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("creature an opponent controls"); - static { - filter.setTargetController(Constants.TargetController.OPPONENT); - } + static { + filter.setTargetController(Constants.TargetController.OPPONENT); + } public AlphaBrawl(UUID ownerId) { super(ownerId, 82, "Alpha Brawl", Rarity.RARE, new CardType[]{CardType.SORCERY}, "{6}{R}{R}"); @@ -62,7 +62,7 @@ public class AlphaBrawl extends CardImpl { // Target creature an opponent controls deals damage equal to its power to each other creature that player controls, then each of those creatures deals damage equal to its power to that creature. this.getSpellAbility().addEffect(new AlphaBrawlEffect()); this.getSpellAbility().addTarget(new TargetCreaturePermanent(filter)); - + } public AlphaBrawl(final AlphaBrawl card) { @@ -77,19 +77,19 @@ public class AlphaBrawl extends CardImpl { class AlphaBrawlEffect extends OneShotEffect { - private static final FilterCreaturePermanent filter = new FilterCreaturePermanent(); + private static final FilterCreaturePermanent filter = new FilterCreaturePermanent(); public AlphaBrawlEffect() { - super(Constants.Outcome.Damage); - staticText = "Target creature an opponent controls deals damage equal to its power to each other creature that player controls, then each of those creatures deals damage equal to its power to that creature"; - } + super(Constants.Outcome.Damage); + staticText = "Target creature an opponent controls deals damage equal to its power to each other creature that player controls, then each of those creatures deals damage equal to its power to that creature"; + } - public AlphaBrawlEffect(final AlphaBrawlEffect effect) { - super(effect); - } + public AlphaBrawlEffect(final AlphaBrawlEffect effect) { + super(effect); + } - @Override - public boolean apply(Game game, Ability source) { + @Override + public boolean apply(Game game, Ability source) { Permanent creature = game.getPermanent(source.getFirstTarget()); if (creature != null) { Player player = game.getPlayer(creature.getControllerId()); @@ -104,12 +104,12 @@ class AlphaBrawlEffect extends OneShotEffect { return true; } } - return false; - } + return false; + } - @Override - public AlphaBrawlEffect copy() { - return new AlphaBrawlEffect(this); - } + @Override + public AlphaBrawlEffect copy() { + return new AlphaBrawlEffect(this); + } } \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/darkascension/AltarOfTheLost.java b/Mage.Sets/src/mage/sets/darkascension/AltarOfTheLost.java index 2011030aea..3981238852 100644 --- a/Mage.Sets/src/mage/sets/darkascension/AltarOfTheLost.java +++ b/Mage.Sets/src/mage/sets/darkascension/AltarOfTheLost.java @@ -56,7 +56,7 @@ public class AltarOfTheLost extends CardImpl { // Altar of the Lost enters the battlefield tapped. this.addAbility(new EntersBattlefieldTappedAbility()); - + // {tap}: Add two mana in any combination of colors to your mana pool. Spend this mana only to cast spells with flashback from a graveyard. this.addAbility(new ConditionalAnyColorManaAbility(2, new AltarOfTheLostManaBuilder())); @@ -103,23 +103,23 @@ class AltarOfTheLostManaBuilder extends ConditionalManaBuilder { class AltarOfTheLostConditionalMana extends ConditionalMana { - public AltarOfTheLostConditionalMana(Mana mana) { - super(mana); - staticText = "Spend this mana only to cast spells with flashback from a graveyard"; - addCondition(new AltarOfTheLostManaCondition()); - } + public AltarOfTheLostConditionalMana(Mana mana) { + super(mana); + staticText = "Spend this mana only to cast spells with flashback from a graveyard"; + addCondition(new AltarOfTheLostManaCondition()); + } } class AltarOfTheLostManaCondition implements Condition { - @Override - public boolean apply(Game game, Ability source) { - MageObject object = game.getObject(source.getSourceId()); - if (object != null && game.getState().getZone(object.getId()) == Zone.GRAVEYARD) { + @Override + public boolean apply(Game game, Ability source) { + MageObject object = game.getObject(source.getSourceId()); + if (object != null && game.getState().getZone(object.getId()) == Zone.GRAVEYARD) { for (Ability ability: object.getAbilities()) { if (ability instanceof FlashbackAbility) return true; } - } - return false; - } + } + return false; + } } diff --git a/Mage.Sets/src/mage/sets/darkascension/ArchangelsLight.java b/Mage.Sets/src/mage/sets/darkascension/ArchangelsLight.java index 6fd8db924b..5da1fbc72f 100644 --- a/Mage.Sets/src/mage/sets/darkascension/ArchangelsLight.java +++ b/Mage.Sets/src/mage/sets/darkascension/ArchangelsLight.java @@ -53,7 +53,7 @@ public class ArchangelsLight extends CardImpl { // You gain 2 life for each card in your graveyard, then shuffle your graveyard into your library. this.getSpellAbility().addEffect(new ArchangelsLightEffect()); - + } public ArchangelsLight(final ArchangelsLight card) { @@ -68,32 +68,32 @@ public class ArchangelsLight extends CardImpl { class ArchangelsLightEffect extends OneShotEffect { - public ArchangelsLightEffect() { - super(Constants.Outcome.GainLife); - staticText = "You gain 2 life for each card in your graveyard, then shuffle your graveyard into your library"; - } + public ArchangelsLightEffect() { + super(Constants.Outcome.GainLife); + staticText = "You gain 2 life for each card in your graveyard, then shuffle your graveyard into your library"; + } - public ArchangelsLightEffect(final ArchangelsLightEffect effect) { - super(effect); - } + public ArchangelsLightEffect(final ArchangelsLightEffect effect) { + super(effect); + } - @Override - public boolean apply(Game game, Ability source) { - Player player = game.getPlayer(source.getControllerId()); + @Override + public boolean apply(Game game, Ability source) { + Player player = game.getPlayer(source.getControllerId()); DynamicValue value = new CardsInControllerGraveyardCount(); - if (player != null) { - player.gainLife(value.calculate(game, source) * 2, game); - player.getLibrary().addAll(player.getGraveyard().getCards(game), game); - player.getGraveyard().clear(); - player.shuffleLibrary(game); - return true; - } - return false; - } + if (player != null) { + player.gainLife(value.calculate(game, source) * 2, game); + player.getLibrary().addAll(player.getGraveyard().getCards(game), game); + player.getGraveyard().clear(); + player.shuffleLibrary(game); + return true; + } + return false; + } - @Override - public ArchangelsLightEffect copy() { - return new ArchangelsLightEffect(this); - } + @Override + public ArchangelsLightEffect copy() { + return new ArchangelsLightEffect(this); + } } \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/darkascension/ArchdemonOfGreed.java b/Mage.Sets/src/mage/sets/darkascension/ArchdemonOfGreed.java index 190258835d..5bb0c10f06 100644 --- a/Mage.Sets/src/mage/sets/darkascension/ArchdemonOfGreed.java +++ b/Mage.Sets/src/mage/sets/darkascension/ArchdemonOfGreed.java @@ -50,19 +50,19 @@ import mage.target.common.TargetControlledPermanent; * @author anonymous */ public class ArchdemonOfGreed extends CardImpl { - + private static final FilterControlledCreaturePermanent filter = new FilterControlledCreaturePermanent("Human"); static { filter.getSubtype().add("Human"); filter.setTargetController(Constants.TargetController.YOU); } - + public ArchdemonOfGreed(UUID ownerId) { super(ownerId, 71, "Archdemon of Greed", Rarity.RARE, new CardType[]{CardType.CREATURE}, ""); this.expansionSetCode = "DKA"; this.subtype.add("Demon"); - + this.nightCard = true; this.canTransform = true; @@ -83,7 +83,7 @@ public class ArchdemonOfGreed extends CardImpl { public ArchdemonOfGreed copy() { return new ArchdemonOfGreed(this); } - + class ArchdemonOfGreedEffect extends OneShotEffect { public ArchdemonOfGreedEffect() { @@ -103,7 +103,7 @@ public class ArchdemonOfGreed extends CardImpl { @Override public boolean apply(Game game, Ability source) { Permanent permanent = game.getPermanent(source.getSourceId()); - + if (permanent != null) { // create cost for sacrificing a human Player player = game.getPlayer(source.getControllerId()); diff --git a/Mage.Sets/src/mage/sets/darkascension/BlackCat.java b/Mage.Sets/src/mage/sets/darkascension/BlackCat.java index fccfa8e257..6d28c2d98d 100644 --- a/Mage.Sets/src/mage/sets/darkascension/BlackCat.java +++ b/Mage.Sets/src/mage/sets/darkascension/BlackCat.java @@ -55,9 +55,9 @@ public class BlackCat extends CardImpl { this.power = new MageInt(1); this.toughness = new MageInt(1); - // When Black Cat dies, target opponent discards a card at random. - Ability ability = new DiesTriggeredAbility(new DiscardTargetEffect(1, true),false); - ability.addTarget(new TargetOpponent()); + // When Black Cat dies, target opponent discards a card at random. + Ability ability = new DiesTriggeredAbility(new DiscardTargetEffect(1, true),false); + ability.addTarget(new TargetOpponent()); this.addAbility(ability); } diff --git a/Mage.Sets/src/mage/sets/darkascension/ChaliceOfDeath.java b/Mage.Sets/src/mage/sets/darkascension/ChaliceOfDeath.java index f9a5dc1951..27b191a1f4 100644 --- a/Mage.Sets/src/mage/sets/darkascension/ChaliceOfDeath.java +++ b/Mage.Sets/src/mage/sets/darkascension/ChaliceOfDeath.java @@ -47,7 +47,7 @@ public class ChaliceOfDeath extends CardImpl { public ChaliceOfDeath(UUID ownerId) { super(ownerId, 146, "Chalice of Death", Rarity.UNCOMMON, new CardType[]{CardType.ARTIFACT}, ""); this.expansionSetCode = "DKA"; - + // this card is the second face of double-faced card this.nightCard = true; this.canTransform = true; diff --git a/Mage.Sets/src/mage/sets/darkascension/ChaliceOfLife.java b/Mage.Sets/src/mage/sets/darkascension/ChaliceOfLife.java index dd6846afda..8e292acb2e 100644 --- a/Mage.Sets/src/mage/sets/darkascension/ChaliceOfLife.java +++ b/Mage.Sets/src/mage/sets/darkascension/ChaliceOfLife.java @@ -50,11 +50,11 @@ public class ChaliceOfLife extends CardImpl { public ChaliceOfLife(UUID ownerId) { super(ownerId, 146, "Chalice of Life", Rarity.UNCOMMON, new CardType[]{CardType.ARTIFACT}, "{3}"); this.expansionSetCode = "DKA"; - + this.canTransform = true; this.secondSideCard = new ChaliceOfDeath(ownerId); this.addAbility(new TransformAbility()); - + // {tap}: You gain 1 life. Then if you have at least 10 life more than your starting life total, transform Chalice of Life. this.addAbility(new SimpleActivatedAbility(Constants.Zone.BATTLEFIELD, new ChaliceOfLifeEffect(), new TapSourceCost())); @@ -86,7 +86,7 @@ class ChaliceOfLifeEffect extends OneShotEffect { Player player = game.getPlayer(source.getControllerId()); //gain 1 life player.gainLife(1, game); - + // if you have at least 10 life more than your starting life total, transform Chalice of Life. if (player.getLife() >= game.getLife() + 10) { permanent.transform(game); diff --git a/Mage.Sets/src/mage/sets/darkascension/ClingingMists.java b/Mage.Sets/src/mage/sets/darkascension/ClingingMists.java index 11a42f3cbc..ec361d8f1a 100644 --- a/Mage.Sets/src/mage/sets/darkascension/ClingingMists.java +++ b/Mage.Sets/src/mage/sets/darkascension/ClingingMists.java @@ -60,12 +60,12 @@ public class ClingingMists extends CardImpl { this.color.setGreen(true); // Prevent all combat damage that would be dealt this turn. - this.getSpellAbility().addEffect(new PreventAllDamageEffect(filter, Constants.Duration.EndOfTurn, true)); - + this.getSpellAbility().addEffect(new PreventAllDamageEffect(filter, Constants.Duration.EndOfTurn, true)); + // 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.")); - + } public ClingingMists(final ClingingMists card) { @@ -83,68 +83,68 @@ class ClingingMistsEffect extends OneShotEffect { private static final FilterAttackingCreature filter = new FilterAttackingCreature("attacking creatures"); public ClingingMistsEffect() { - super(Constants.Outcome.Tap); - staticText = "tap all attacking creatures. Those creatures don't untap during their controller's next untap step"; - } + super(Constants.Outcome.Tap); + staticText = "tap all attacking creatures. Those creatures don't untap during their controller's next untap step"; + } - public ClingingMistsEffect(final ClingingMistsEffect effect) { - super(effect); - } + public ClingingMistsEffect(final ClingingMistsEffect effect) { + super(effect); + } - @Override - public boolean apply(Game game, Ability source) { + @Override + public boolean apply(Game game, Ability source) { for (Permanent creature: game.getBattlefield().getActivePermanents(filter, source.getControllerId(), source.getSourceId(), game)) { creature.tap(game); game.addEffect(new ClingingMistsEffect2(creature.getId()), source); } - return true; - } + return true; + } - @Override - public ClingingMistsEffect copy() { - return new ClingingMistsEffect(this); - } + @Override + public ClingingMistsEffect copy() { + return new ClingingMistsEffect(this); + } } class ClingingMistsEffect2 extends ReplacementEffectImpl { - protected UUID creatureId; + protected UUID creatureId; - public ClingingMistsEffect2(UUID creatureId) { - super(Constants.Duration.OneUse, Constants.Outcome.Detriment); - this.creatureId = creatureId; - } + public ClingingMistsEffect2(UUID creatureId) { + super(Constants.Duration.OneUse, Constants.Outcome.Detriment); + this.creatureId = creatureId; + } - public ClingingMistsEffect2(final ClingingMistsEffect2 effect) { - super(effect); - creatureId = effect.creatureId; - } + public ClingingMistsEffect2(final ClingingMistsEffect2 effect) { + super(effect); + creatureId = effect.creatureId; + } - @Override - public ClingingMistsEffect2 copy() { - return new ClingingMistsEffect2(this); - } + @Override + public ClingingMistsEffect2 copy() { + return new ClingingMistsEffect2(this); + } - @Override - public boolean apply(Game game, Ability source) { - return false; - } + @Override + public boolean apply(Game game, Ability source) { + return false; + } - @Override - public boolean replaceEvent(GameEvent event, Ability source, Game game) { - used = true; - return true; - } + @Override + public boolean replaceEvent(GameEvent event, Ability source, Game game) { + used = true; + return true; + } - @Override - public boolean applies(GameEvent event, Ability source, Game game) { - if (game.getTurn().getStepType() == Constants.PhaseStep.UNTAP && - event.getType() == GameEvent.EventType.UNTAP && - event.getTargetId().equals(creatureId)) { - return true; - } - return false; - } + @Override + public boolean applies(GameEvent event, Ability source, Game game) { + if (game.getTurn().getStepType() == Constants.PhaseStep.UNTAP && + event.getType() == GameEvent.EventType.UNTAP && + event.getTargetId().equals(creatureId)) { + return true; + } + return false; + } } diff --git a/Mage.Sets/src/mage/sets/darkascension/CurseOfBloodletting.java b/Mage.Sets/src/mage/sets/darkascension/CurseOfBloodletting.java index f129e7c013..1a82c160b4 100644 --- a/Mage.Sets/src/mage/sets/darkascension/CurseOfBloodletting.java +++ b/Mage.Sets/src/mage/sets/darkascension/CurseOfBloodletting.java @@ -63,7 +63,7 @@ public class CurseOfBloodletting extends CardImpl { this.getSpellAbility().addTarget(auraTarget); this.getSpellAbility().addEffect(new AttachEffect(Constants.Outcome.Damage)); this.addAbility(new EnchantAbility(auraTarget.getTargetName())); - + // If a source would deal damage to enchanted player, it deals double that damage to that player instead. this.addAbility(new SimpleStaticAbility(Constants.Zone.BATTLEFIELD, new CurseOfBloodlettingEffect())); } @@ -80,26 +80,26 @@ public class CurseOfBloodletting extends CardImpl { class CurseOfBloodlettingEffect extends ReplacementEffectImpl { - public CurseOfBloodlettingEffect() { - super(Constants.Duration.WhileOnBattlefield, Constants.Outcome.Damage); - staticText = "If a source would deal damage to enchanted player, it deals double that damage to that player instead"; - } + public CurseOfBloodlettingEffect() { + super(Constants.Duration.WhileOnBattlefield, Constants.Outcome.Damage); + staticText = "If a source would deal damage to enchanted player, it deals double that damage to that player instead"; + } - public CurseOfBloodlettingEffect(final CurseOfBloodlettingEffect effect) { - super(effect); - } + public CurseOfBloodlettingEffect(final CurseOfBloodlettingEffect effect) { + super(effect); + } - @Override - public CurseOfBloodlettingEffect copy() { - return new CurseOfBloodlettingEffect(this); - } + @Override + public CurseOfBloodlettingEffect copy() { + return new CurseOfBloodlettingEffect(this); + } - @Override - public boolean applies(GameEvent event, Ability source, Game game) { - switch (event.getType()) { - case DAMAGE_PLAYER: - StackObject spell = game.getStack().getStackObject(event.getSourceId()); - if (spell != null) { + @Override + public boolean applies(GameEvent event, Ability source, Game game) { + switch (event.getType()) { + case DAMAGE_PLAYER: + StackObject spell = game.getStack().getStackObject(event.getSourceId()); + if (spell != null) { Permanent enchantment = game.getPermanent(source.getSourceId()); if (enchantment != null && enchantment.getAttachedTo() != null) { Player player = game.getPlayer(enchantment.getAttachedTo()); @@ -107,19 +107,19 @@ class CurseOfBloodlettingEffect extends ReplacementEffectImpl { this.getSpellAbility().addTarget(auraTarget); this.getSpellAbility().addEffect(new AttachEffect(Constants.Outcome.Damage)); this.addAbility(new EnchantAbility(auraTarget.getTargetName())); - + // Whenever enchanted player casts an instant or sorcery spell, each other player may copy that spell and may choose new targets for the copy he or she controls. this.addAbility(new CurseOfEchoesCopyTriggeredAbility()); } @@ -83,33 +83,33 @@ public class CurseOfEchoes extends CardImpl { } class CurseOfEchoesCopyTriggeredAbility extends TriggeredAbilityImpl { - - private static final FilterSpell filter = new FilterSpell(); - - static { - filter.getCardType().add(CardType.INSTANT); - filter.getCardType().add(CardType.SORCERY); - filter.setScopeCardType(Filter.ComparisonScope.Any); - } - - public CurseOfEchoesCopyTriggeredAbility() { - super(Constants.Zone.BATTLEFIELD, new CurseOfEchoesEffect(), false); - this.addTarget(new TargetSpell(filter)); - } - public CurseOfEchoesCopyTriggeredAbility(final CurseOfEchoesCopyTriggeredAbility ability) { - super(ability); - } + private static final FilterSpell filter = new FilterSpell(); - @Override - public CurseOfEchoesCopyTriggeredAbility copy() { - return new CurseOfEchoesCopyTriggeredAbility(this); - } + static { + filter.getCardType().add(CardType.INSTANT); + filter.getCardType().add(CardType.SORCERY); + filter.setScopeCardType(Filter.ComparisonScope.Any); + } - @Override - public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == GameEvent.EventType.SPELL_CAST) { - Spell spell = game.getStack().getSpell(event.getTargetId()); + public CurseOfEchoesCopyTriggeredAbility() { + super(Constants.Zone.BATTLEFIELD, new CurseOfEchoesEffect(), false); + this.addTarget(new TargetSpell(filter)); + } + + public CurseOfEchoesCopyTriggeredAbility(final CurseOfEchoesCopyTriggeredAbility ability) { + super(ability); + } + + @Override + public CurseOfEchoesCopyTriggeredAbility copy() { + return new CurseOfEchoesCopyTriggeredAbility(this); + } + + @Override + public boolean checkTrigger(GameEvent event, Game game) { + if (event.getType() == GameEvent.EventType.SPELL_CAST) { + Spell spell = game.getStack().getSpell(event.getTargetId()); if (spell != null && spell.getCardType().contains(CardType.INSTANT) || spell.getCardType().contains(CardType.SORCERY)) { Permanent enchantment = game.getPermanent(sourceId); if (enchantment != null && enchantment.getAttachedTo() != null) { @@ -120,30 +120,30 @@ class CurseOfEchoesCopyTriggeredAbility extends TriggeredAbilityImpl { - public CurseOfEchoesEffect() { - super(Constants.Outcome.Copy); - } - - public CurseOfEchoesEffect(final CurseOfEchoesEffect effect) { - super(effect); - } + public CurseOfEchoesEffect() { + super(Constants.Outcome.Copy); + } - @Override - public boolean apply(Game game, Ability source) { - Spell spell = game.getStack().getSpell(targetPointer.getFirst(game, source)); - if (spell != null) { + public CurseOfEchoesEffect(final CurseOfEchoesEffect effect) { + super(effect); + } + + @Override + public boolean apply(Game game, Ability source) { + Spell spell = game.getStack().getSpell(targetPointer.getFirst(game, source)); + if (spell != null) { String chooseMessage = "Copy target spell? You may choose new targets for the copy."; for (UUID playerId: game.getPlayerList()) { if (!playerId.equals(spell.getControllerId())) { @@ -157,15 +157,15 @@ class CurseOfEchoesEffect extends OneShotEffect { } } } - return true; - } - return false; - } + return true; + } + return false; + } - @Override - public CurseOfEchoesEffect copy() { - return new CurseOfEchoesEffect(this); - } + @Override + public CurseOfEchoesEffect copy() { + return new CurseOfEchoesEffect(this); + } @Override public String getText(Mode mode) { diff --git a/Mage.Sets/src/mage/sets/darkascension/CurseOfExhaustion.java b/Mage.Sets/src/mage/sets/darkascension/CurseOfExhaustion.java index 10a2ee22bb..effcaeced1 100644 --- a/Mage.Sets/src/mage/sets/darkascension/CurseOfExhaustion.java +++ b/Mage.Sets/src/mage/sets/darkascension/CurseOfExhaustion.java @@ -58,8 +58,8 @@ public class CurseOfExhaustion extends CardImpl { this.subtype.add("Curse"); this.color.setWhite(true); - this.addWatcher(new CurseOfExhaustionWatcher()); - + this.addWatcher(new CurseOfExhaustionWatcher()); + // Enchant player TargetPlayer auraTarget = new TargetPlayer(); this.getSpellAbility().addTarget(auraTarget); @@ -82,24 +82,24 @@ public class CurseOfExhaustion extends CardImpl { class CurseOfExhaustionWatcher extends WatcherImpl { - public CurseOfExhaustionWatcher() { - super("SpellCast", Constants.WatcherScope.PLAYER); - } + public CurseOfExhaustionWatcher() { + super("SpellCast", Constants.WatcherScope.PLAYER); + } - public CurseOfExhaustionWatcher(final CurseOfExhaustionWatcher watcher) { - super(watcher); - } + public CurseOfExhaustionWatcher(final CurseOfExhaustionWatcher watcher) { + super(watcher); + } - @Override - public CurseOfExhaustionWatcher copy() { - return new CurseOfExhaustionWatcher(this); - } + @Override + public CurseOfExhaustionWatcher copy() { + return new CurseOfExhaustionWatcher(this); + } - @Override - public void watch(GameEvent event, Game game) { + @Override + public void watch(GameEvent event, Game game) { if (condition == true) //no need to check - condition has already occured return; - if (event.getType() == GameEvent.EventType.SPELL_CAST ) { + if (event.getType() == GameEvent.EventType.SPELL_CAST ) { Permanent enchantment = game.getPermanent(this.sourceId); if (enchantment != null && enchantment.getAttachedTo() != null) { Player player = game.getPlayer(enchantment.getAttachedTo()); @@ -108,39 +108,39 @@ class CurseOfExhaustionWatcher extends WatcherImpl { } } } - } + } } class CurseOfExhaustionEffect extends ReplacementEffectImpl { - public CurseOfExhaustionEffect() { - super(Constants.Duration.WhileOnBattlefield, Constants.Outcome.Benefit); - staticText = "Enchanted player can't cast more than one spell each turn."; - } + public CurseOfExhaustionEffect() { + super(Constants.Duration.WhileOnBattlefield, Constants.Outcome.Benefit); + staticText = "Enchanted player can't cast more than one spell each turn."; + } - public CurseOfExhaustionEffect(final CurseOfExhaustionEffect effect) { - super(effect); - } + public CurseOfExhaustionEffect(final CurseOfExhaustionEffect effect) { + super(effect); + } - @Override - public CurseOfExhaustionEffect copy() { - return new CurseOfExhaustionEffect(this); - } + @Override + public CurseOfExhaustionEffect copy() { + return new CurseOfExhaustionEffect(this); + } - @Override - public boolean apply(Game game, Ability source) { - return true; - } + @Override + public boolean apply(Game game, Ability source) { + return true; + } - @Override - public boolean replaceEvent(GameEvent event, Ability source, Game game) { - return true; - } + @Override + public boolean replaceEvent(GameEvent event, Ability source, Game game) { + return true; + } - @Override - public boolean applies(GameEvent event, Ability source, Game game) { - if (event.getType() == GameEvent.EventType.CAST_SPELL) { + @Override + public boolean applies(GameEvent event, Ability source, Game game) { + if (event.getType() == GameEvent.EventType.CAST_SPELL) { Permanent enchantment = game.getPermanent(source.getSourceId()); if (enchantment != null && enchantment.getAttachedTo() != null) { Player player = game.getPlayer(enchantment.getAttachedTo()); @@ -150,8 +150,8 @@ class CurseOfExhaustionEffect extends ReplacementEffectImpl { // At the beginning of enchanted player's upkeep, Curse of Thirst deals damage to that player equal to the number of Curses attached to him or her. this.addAbility(new CurseOfThirstAbility()); - + } public CurseOfThirst(final CurseOfThirst card) { @@ -82,38 +82,38 @@ public class CurseOfThirst extends CardImpl { class CurseOfThirstAbility extends TriggeredAbilityImpl { - public CurseOfThirstAbility() { - super(Constants.Zone.BATTLEFIELD, new DamageTargetEffect(new CursesAttachedCount())); - } + public CurseOfThirstAbility() { + super(Constants.Zone.BATTLEFIELD, new DamageTargetEffect(new CursesAttachedCount())); + } - public CurseOfThirstAbility(final CurseOfThirstAbility ability) { - super(ability); - } + public CurseOfThirstAbility(final CurseOfThirstAbility ability) { + super(ability); + } - @Override - public CurseOfThirstAbility copy() { - return new CurseOfThirstAbility(this); - } + @Override + public CurseOfThirstAbility copy() { + return new CurseOfThirstAbility(this); + } - @Override - public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == GameEvent.EventType.UPKEEP_STEP_PRE) { + @Override + public boolean checkTrigger(GameEvent event, Game game) { + if (event.getType() == GameEvent.EventType.UPKEEP_STEP_PRE) { Permanent enchantment = game.getPermanent(this.sourceId); if (enchantment != null && enchantment.getAttachedTo() != null) { Player player = game.getPlayer(enchantment.getAttachedTo()); if (player != null && game.getActivePlayerId().equals(player.getId())) { this.getEffects().get(0).setTargetPointer(new FixedTarget(player.getId())); - return true; + return true; } } - } - return false; - } + } + return false; + } - @Override - public String getRule() { - return "At the beginning of enchanted player's upkeep, Curse of Thirst deals damage to that player equal to the number of Curses attached to him or her."; - } + @Override + public String getRule() { + return "At the beginning of enchanted player's upkeep, Curse of Thirst deals damage to that player equal to the number of Curses attached to him or her."; + } } diff --git a/Mage.Sets/src/mage/sets/darkascension/DeadlyAllure.java b/Mage.Sets/src/mage/sets/darkascension/DeadlyAllure.java index 0e2bfdd85d..fb9e5a73da 100644 --- a/Mage.Sets/src/mage/sets/darkascension/DeadlyAllure.java +++ b/Mage.Sets/src/mage/sets/darkascension/DeadlyAllure.java @@ -56,10 +56,10 @@ public class DeadlyAllure extends CardImpl { this.getSpellAbility().addEffect(new GainAbilityTargetEffect(new SimpleStaticAbility(Constants.Zone.BATTLEFIELD, new MustBlockSourceEffect()), Constants.Duration.EndOfTurn)); this.getSpellAbility().addEffect(new GainAbilityTargetEffect(DeathtouchAbility.getInstance(), Constants.Duration.EndOfTurn)); this.getSpellAbility().addTarget(new TargetCreaturePermanent()); - + // Flashback {G} this.addAbility(new FlashbackAbility(new ManaCostsImpl("{G}"), Constants.TimingRule.SORCERY)); - + } public DeadlyAllure(final DeadlyAllure card) { diff --git a/Mage.Sets/src/mage/sets/darkascension/DiregrafCaptain.java b/Mage.Sets/src/mage/sets/darkascension/DiregrafCaptain.java index d6bba5a478..1c28ff3ba8 100644 --- a/Mage.Sets/src/mage/sets/darkascension/DiregrafCaptain.java +++ b/Mage.Sets/src/mage/sets/darkascension/DiregrafCaptain.java @@ -52,7 +52,7 @@ import java.util.UUID; * @author Loki */ public class DiregrafCaptain extends CardImpl { - + private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("Zombie"); static { @@ -89,19 +89,19 @@ public class DiregrafCaptain extends CardImpl { } class DiregrafCaptainTriggeredAbility extends TriggeredAbilityImpl { - + private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("Zombie"); static { filter.getSubtype().add("Zombie"); filter.setScopeSubtype(Filter.ComparisonScope.Any); } - + public DiregrafCaptainTriggeredAbility() { super(Constants.Zone.BATTLEFIELD, new LoseLifeTargetEffect(1), false); this.addTarget(new TargetOpponent()); } - + public DiregrafCaptainTriggeredAbility(final DiregrafCaptainTriggeredAbility ability) { super(ability); } diff --git a/Mage.Sets/src/mage/sets/darkascension/DungeonGeists.java b/Mage.Sets/src/mage/sets/darkascension/DungeonGeists.java index 193f038b51..42036e1a80 100644 --- a/Mage.Sets/src/mage/sets/darkascension/DungeonGeists.java +++ b/Mage.Sets/src/mage/sets/darkascension/DungeonGeists.java @@ -55,11 +55,11 @@ import java.util.UUID; */ public class DungeonGeists extends CardImpl { - private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("creature an opponent controls"); + private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("creature an opponent controls"); - static { - filter.setTargetController(Constants.TargetController.OPPONENT); - } + static { + filter.setTargetController(Constants.TargetController.OPPONENT); + } public DungeonGeists(UUID ownerId) { super(ownerId, 36, "Dungeon Geists", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{2}{U}{U}"); @@ -94,32 +94,32 @@ public class DungeonGeists extends CardImpl { class DungeonGeistsEffect extends ReplacementEffectImpl { - public DungeonGeistsEffect() { - super(Constants.Duration.OneUse, Constants.Outcome.Detriment); + public DungeonGeistsEffect() { + super(Constants.Duration.OneUse, Constants.Outcome.Detriment); this.staticText = "That creature doesn't untap during its controller's untap step for as long as you control Dungeon Geists"; - } + } - public DungeonGeistsEffect(final DungeonGeistsEffect effect) { - super(effect); - } + public DungeonGeistsEffect(final DungeonGeistsEffect effect) { + super(effect); + } - @Override - public DungeonGeistsEffect copy() { - return new DungeonGeistsEffect(this); - } + @Override + public DungeonGeistsEffect copy() { + return new DungeonGeistsEffect(this); + } - @Override - public boolean apply(Game game, Ability source) { - return false; - } + @Override + public boolean apply(Game game, Ability source) { + return false; + } - @Override - public boolean replaceEvent(GameEvent event, Ability source, Game game) { - return true; - } + @Override + public boolean replaceEvent(GameEvent event, Ability source, Game game) { + return true; + } - @Override - public boolean applies(GameEvent event, Ability source, Game game) { + @Override + public boolean applies(GameEvent event, Ability source, Game game) { if (event.getType() == GameEvent.EventType.LOST_CONTROL) { if (event.getPlayerId().equals(source.getControllerId()) && event.getTargetId().equals(source.getSourceId())) { this.used = true; @@ -142,43 +142,43 @@ class DungeonGeistsEffect extends ReplacementEffectImpl { } return false; - } + } } class DungeonGeistsWatcher extends WatcherImpl { - DungeonGeistsWatcher () { - super("ControlLost", WatcherScope.CARD); - } + DungeonGeistsWatcher () { + super("ControlLost", WatcherScope.CARD); + } - DungeonGeistsWatcher(DungeonGeistsWatcher watcher) { - super(watcher); - } + DungeonGeistsWatcher(DungeonGeistsWatcher watcher) { + super(watcher); + } - @Override - public void watch(GameEvent event, Game game) { - if (event.getType() == GameEvent.EventType.LOST_CONTROL && event.getPlayerId().equals(controllerId) && event.getTargetId().equals(sourceId)) { + @Override + public void watch(GameEvent event, Game game) { + if (event.getType() == GameEvent.EventType.LOST_CONTROL && event.getPlayerId().equals(controllerId) && event.getTargetId().equals(sourceId)) { condition = true; game.replaceEvent(event); return; - } - if (event.getType() == GameEvent.EventType.ZONE_CHANGE && event.getTargetId().equals(sourceId)) { - ZoneChangeEvent zEvent = (ZoneChangeEvent)event; - if (zEvent.getFromZone() == Zone.BATTLEFIELD) { + } + if (event.getType() == GameEvent.EventType.ZONE_CHANGE && event.getTargetId().equals(sourceId)) { + ZoneChangeEvent zEvent = (ZoneChangeEvent)event; + if (zEvent.getFromZone() == Zone.BATTLEFIELD) { condition = true; game.replaceEvent(event); return; } - } - } + } + } @Override - public void reset() { + public void reset() { //don't reset condition each turn - only when this leaves the battlefield - } - - @Override - public DungeonGeistsWatcher copy() { - return new DungeonGeistsWatcher(this); - } + } + + @Override + public DungeonGeistsWatcher copy() { + return new DungeonGeistsWatcher(this); + } } diff --git a/Mage.Sets/src/mage/sets/darkascension/ElbrusTheBindingBlade.java b/Mage.Sets/src/mage/sets/darkascension/ElbrusTheBindingBlade.java index 2f5b0e7ccf..759a12e14a 100644 --- a/Mage.Sets/src/mage/sets/darkascension/ElbrusTheBindingBlade.java +++ b/Mage.Sets/src/mage/sets/darkascension/ElbrusTheBindingBlade.java @@ -54,7 +54,7 @@ public class ElbrusTheBindingBlade extends CardImpl { this.expansionSetCode = "DKA"; this.supertype.add("Legendary"); this.subtype.add("Equipment"); - + this.canTransform = true; this.secondSideCard = new WithengarUnbound(ownerId); this.addAbility(new TransformAbility()); diff --git a/Mage.Sets/src/mage/sets/darkascension/FaithsShield.java b/Mage.Sets/src/mage/sets/darkascension/FaithsShield.java index 949f4b7b1a..314a5f0a20 100644 --- a/Mage.Sets/src/mage/sets/darkascension/FaithsShield.java +++ b/Mage.Sets/src/mage/sets/darkascension/FaithsShield.java @@ -60,7 +60,7 @@ public class FaithsShield extends CardImpl { this.color.setWhite(true); // Target permanent you control gains protection from the color of your choice until end of turn. - + // Fateful hour - If you have 5 or less life, instead you and each permanent you control gain protection from the color of your choice until end of turn. this.getSpellAbility().addEffect(new FaithsShieldEffect()); this.getSpellAbility().addTarget(new TargetControlledPermanent()); @@ -83,20 +83,20 @@ class FaithsShieldEffect extends OneShotEffect { super(Outcome.Protect); staticText = "Target permanent you control gains protection from the color of your choice until end of turn\nFateful hour - If you have 5 or less life, instead you and each permanent you control gain protection from the color of your choice until end of turn"; } - + public FaithsShieldEffect(final FaithsShieldEffect effect) { super(effect); } - + @Override public boolean apply(Game game, Ability source) { if (FatefulHourCondition.getInstance().apply(game, source)) { ChoiceColor choice = (ChoiceColor) source.getChoices().get(0); FilterCard filter = new FilterCard(); - filter.setUseColor(true); - filter.setColor(choice.getColor()); - filter.setMessage(choice.getChoice()); - filter.setScopeColor(Filter.ComparisonScope.Any); + filter.setUseColor(true); + filter.setColor(choice.getColor()); + filter.setMessage(choice.getChoice()); + filter.setScopeColor(Filter.ComparisonScope.Any); Ability ability = new ProtectionAbility(filter) ; game.addEffect(new GainAbilityControlledEffect(ability, Duration.EndOfTurn), source); @@ -112,5 +112,5 @@ class FaithsShieldEffect extends OneShotEffect { public FaithsShieldEffect copy() { return new FaithsShieldEffect(this); } - + } diff --git a/Mage.Sets/src/mage/sets/darkascension/FeedThePack.java b/Mage.Sets/src/mage/sets/darkascension/FeedThePack.java index 2fcf2d00f4..32cbcf23b8 100644 --- a/Mage.Sets/src/mage/sets/darkascension/FeedThePack.java +++ b/Mage.Sets/src/mage/sets/darkascension/FeedThePack.java @@ -74,13 +74,13 @@ public class FeedThePack extends CardImpl { class FeedThePackEffect extends OneShotEffect { private static final FilterNonTokenPermanent filter = new FilterNonTokenPermanent("nontoken creature"); - + static { filter.getCardType().add(CardType.CREATURE); filter.setScopeCardType(Filter.ComparisonScope.Any); filter.setTargetController(Constants.TargetController.YOU); } - + public FeedThePackEffect() { super(Constants.Outcome.Sacrifice); this.staticText = "sacrifice a nontoken creature. If you do, put X 2/2 green Wolf creature tokens onto the battlefield, where X is the sacrificed creature's toughness"; diff --git a/Mage.Sets/src/mage/sets/darkascension/FiendOfTheShadows.java b/Mage.Sets/src/mage/sets/darkascension/FiendOfTheShadows.java index c366fd4164..787a824584 100644 --- a/Mage.Sets/src/mage/sets/darkascension/FiendOfTheShadows.java +++ b/Mage.Sets/src/mage/sets/darkascension/FiendOfTheShadows.java @@ -64,7 +64,7 @@ public class FiendOfTheShadows extends CardImpl { filter.getSubtype().add("Human"); filter.setScopeSubtype(Filter.ComparisonScope.Any); } - + public FiendOfTheShadows(UUID ownerId) { super(ownerId, 62, "Fiend of the Shadows", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{3}{B}{B}"); this.expansionSetCode = "DKA"; @@ -78,8 +78,8 @@ public class FiendOfTheShadows extends CardImpl { this.addAbility(FlyingAbility.getInstance()); // Whenever Fiend of the Shadows deals combat damage to a player, that player exiles a card from his or her hand. You may play that card for as long as it remains exiled. this.addAbility(new DealsCombatDamageToAPlayerTriggeredAbility(new ExileFromZoneTargetEffect(Constants.Zone.HAND, exileId, "Fiend of the Shadows", new FilterCard()), false, true)); - this.addAbility(new SimpleStaticAbility(Constants.Zone.ALL, new FiendOfTheShadowsEffect(exileId))); - + this.addAbility(new SimpleStaticAbility(Constants.Zone.ALL, new FiendOfTheShadowsEffect(exileId))); + // Sacrifice a Human: Regenerate Fiend of the Shadows. this.addAbility(new SimpleActivatedAbility(Constants.Zone.BATTLEFIELD, new RegenerateSourceEffect(), new SacrificeTargetCost(new TargetControlledCreaturePermanent(1, 1, filter, false)))); } @@ -97,39 +97,39 @@ public class FiendOfTheShadows extends CardImpl { class FiendOfTheShadowsEffect extends AsThoughEffectImpl { private UUID exileId; - - public FiendOfTheShadowsEffect(UUID exileId) { - super(Constants.AsThoughEffectType.CAST, Constants.Duration.EndOfGame, Constants.Outcome.Benefit); + + public FiendOfTheShadowsEffect(UUID exileId) { + super(Constants.AsThoughEffectType.CAST, Constants.Duration.EndOfGame, Constants.Outcome.Benefit); this.exileId = exileId; - staticText = "You may play that card for as long as it remains exiled"; - } + staticText = "You may play that card for as long as it remains exiled"; + } - public FiendOfTheShadowsEffect(final FiendOfTheShadowsEffect effect) { - super(effect); + public FiendOfTheShadowsEffect(final FiendOfTheShadowsEffect effect) { + super(effect); this.exileId = effect.exileId; - } + } - @Override - public boolean apply(Game game, Ability source) { - return true; - } + @Override + public boolean apply(Game game, Ability source) { + return true; + } - @Override - public FiendOfTheShadowsEffect copy() { - return new FiendOfTheShadowsEffect(this); - } + @Override + public FiendOfTheShadowsEffect copy() { + return new FiendOfTheShadowsEffect(this); + } - @Override - public boolean applies(UUID sourceId, Ability source, Game game) { - Card card = game.getCard(sourceId); - if (card != null) { + @Override + public boolean applies(UUID sourceId, Ability source, Game game) { + Card card = game.getCard(sourceId); + if (card != null) { ExileZone zone = game.getExile().getExileZone(exileId); if (zone != null && zone.contains(card.getId())) { card.setControllerId(source.getControllerId()); return true; } - } - return false; - } + } + return false; + } } \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/darkascension/FlayerOfTheHatebound.java b/Mage.Sets/src/mage/sets/darkascension/FlayerOfTheHatebound.java index e8b9a5e8a4..1d06513ade 100644 --- a/Mage.Sets/src/mage/sets/darkascension/FlayerOfTheHatebound.java +++ b/Mage.Sets/src/mage/sets/darkascension/FlayerOfTheHatebound.java @@ -62,7 +62,7 @@ public class FlayerOfTheHatebound extends CardImpl { this.toughness = new MageInt(2); this.addAbility(new UndyingAbility()); - + // Whenever Flayer of the Hatebound or another creature enters the battlefield from your graveyard, that creature deals damage equal to its power to target creature or player. Ability ability = new FlayerTriggeredAbility(); ability.addTarget(new TargetCreatureOrPlayer(true)); @@ -97,8 +97,8 @@ class FlayerTriggeredAbility extends TriggeredAbilityImpl { this.canTransform = true; // Enchant creature - TargetPermanent auraTarget = new TargetCreaturePermanent(); - this.getSpellAbility().addTarget(auraTarget); - + TargetPermanent auraTarget = new TargetCreaturePermanent(); + this.getSpellAbility().addTarget(auraTarget); + // You control enchanted creature. - this.addAbility(new SimpleStaticAbility(Constants.Zone.BATTLEFIELD, new ControlEnchantedEffect())); + this.addAbility(new SimpleStaticAbility(Constants.Zone.BATTLEFIELD, new ControlEnchantedEffect())); } public GhastlyHaunting(final GhastlyHaunting card) { diff --git a/Mage.Sets/src/mage/sets/darkascension/GrafdiggersCage.java b/Mage.Sets/src/mage/sets/darkascension/GrafdiggersCage.java index 3111ba5e86..893f5933a6 100644 --- a/Mage.Sets/src/mage/sets/darkascension/GrafdiggersCage.java +++ b/Mage.Sets/src/mage/sets/darkascension/GrafdiggersCage.java @@ -53,7 +53,7 @@ public class GrafdiggersCage extends CardImpl { // Creature cards can't enter the battlefield from graveyards or libraries. this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GrafdiggersCageEffect())); - + // Players can't cast cards in graveyards or libraries. this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GrafdiggersCageEffect2())); } @@ -70,32 +70,32 @@ public class GrafdiggersCage extends CardImpl { class GrafdiggersCageEffect extends ReplacementEffectImpl { - public GrafdiggersCageEffect() { - super(Constants.Duration.WhileOnBattlefield, Constants.Outcome.Benefit); - staticText = "Creature cards can't enter the battlefield from graveyards or libraries"; - } + public GrafdiggersCageEffect() { + super(Constants.Duration.WhileOnBattlefield, Constants.Outcome.Benefit); + staticText = "Creature cards can't enter the battlefield from graveyards or libraries"; + } - public GrafdiggersCageEffect(final GrafdiggersCageEffect effect) { - super(effect); - } + public GrafdiggersCageEffect(final GrafdiggersCageEffect effect) { + super(effect); + } - @Override - public GrafdiggersCageEffect copy() { - return new GrafdiggersCageEffect(this); - } + @Override + public GrafdiggersCageEffect copy() { + return new GrafdiggersCageEffect(this); + } - @Override - public boolean apply(Game game, Ability source) { - return true; - } + @Override + public boolean apply(Game game, Ability source) { + return true; + } - @Override - public boolean replaceEvent(GameEvent event, Ability source, Game game) { - return true; - } + @Override + public boolean replaceEvent(GameEvent event, Ability source, Game game) { + return true; + } - @Override - public boolean applies(GameEvent event, Ability source, Game game) { + @Override + public boolean applies(GameEvent event, Ability source, Game game) { if (event instanceof ZoneChangeEvent) { ZoneChangeEvent zEvent = (ZoneChangeEvent)event; if (zEvent.getToZone() == Zone.BATTLEFIELD && (zEvent.getFromZone() == Zone.GRAVEYARD || zEvent.getFromZone() == Zone.LIBRARY)) { @@ -105,40 +105,40 @@ class GrafdiggersCageEffect extends ReplacementEffectImpl } } } - return false; - } + return false; + } } class GrafdiggersCageEffect2 extends ReplacementEffectImpl { - public GrafdiggersCageEffect2() { - super(Constants.Duration.WhileOnBattlefield, Constants.Outcome.Benefit); - staticText = "Players can't cast cards in graveyards or libraries"; - } + public GrafdiggersCageEffect2() { + super(Constants.Duration.WhileOnBattlefield, Constants.Outcome.Benefit); + staticText = "Players can't cast cards in graveyards or libraries"; + } - public GrafdiggersCageEffect2(final GrafdiggersCageEffect2 effect) { - super(effect); - } + public GrafdiggersCageEffect2(final GrafdiggersCageEffect2 effect) { + super(effect); + } - @Override - public GrafdiggersCageEffect2 copy() { - return new GrafdiggersCageEffect2(this); - } + @Override + public GrafdiggersCageEffect2 copy() { + return new GrafdiggersCageEffect2(this); + } - @Override - public boolean apply(Game game, Ability source) { - return true; - } + @Override + public boolean apply(Game game, Ability source) { + return true; + } - @Override - public boolean replaceEvent(GameEvent event, Ability source, Game game) { - return true; - } + @Override + public boolean replaceEvent(GameEvent event, Ability source, Game game) { + return true; + } - @Override - public boolean applies(GameEvent event, Ability source, Game game) { - if (event.getType() == GameEvent.EventType.CAST_SPELL) { + @Override + public boolean applies(GameEvent event, Ability source, Game game) { + if (event.getType() == GameEvent.EventType.CAST_SPELL) { Card card = game.getCard(event.getSourceId()); if (card != null) { Zone zone = game.getState().getZone(card.getId()); @@ -146,8 +146,8 @@ class GrafdiggersCageEffect2 extends ReplacementEffectImpl { // Gravecrawler can't block. this.addAbility(CantBlockAbility.getInstance()); - + // You may cast Gravecrawler from your graveyard as long as you control a Zombie. this.addAbility(new SimpleStaticAbility(Zone.ALL, new GravecrawlerPlayEffect())); - + } public Gravecrawler(final Gravecrawler card) { @@ -79,34 +79,34 @@ public class Gravecrawler extends CardImpl { class GravecrawlerPlayEffect extends AsThoughEffectImpl { - private final static FilterCreaturePermanent filter = new FilterCreaturePermanent("zombie"); + private final static FilterCreaturePermanent filter = new FilterCreaturePermanent("zombie"); - static { - filter.getSubtype().add("Zombie"); - filter.setScopeSubtype(Filter.ComparisonScope.Any); - } - - public GravecrawlerPlayEffect() { - super(Constants.AsThoughEffectType.CAST, Constants.Duration.EndOfGame, Constants.Outcome.Benefit); - staticText = "You may cast Gravecrawler from your graveyard as long as you control a Zombie"; - } + static { + filter.getSubtype().add("Zombie"); + filter.setScopeSubtype(Filter.ComparisonScope.Any); + } - public GravecrawlerPlayEffect(final GravecrawlerPlayEffect effect) { - super(effect); - } + public GravecrawlerPlayEffect() { + super(Constants.AsThoughEffectType.CAST, Constants.Duration.EndOfGame, Constants.Outcome.Benefit); + staticText = "You may cast Gravecrawler from your graveyard as long as you control a Zombie"; + } - @Override - public boolean apply(Game game, Ability source) { - return true; - } + public GravecrawlerPlayEffect(final GravecrawlerPlayEffect effect) { + super(effect); + } - @Override - public GravecrawlerPlayEffect copy() { - return new GravecrawlerPlayEffect(this); - } + @Override + public boolean apply(Game game, Ability source) { + return true; + } - @Override - public boolean applies(UUID sourceId, Ability source, Game game) { + @Override + public GravecrawlerPlayEffect copy() { + return new GravecrawlerPlayEffect(this); + } + + @Override + public boolean applies(UUID sourceId, Ability source, Game game) { if (sourceId.equals(source.getSourceId())) { Card card = game.getCard(source.getSourceId()); if (card != null && game.getState().getZone(source.getSourceId()) == Constants.Zone.GRAVEYARD) { @@ -115,6 +115,6 @@ class GravecrawlerPlayEffect extends AsThoughEffectImpl } } return false; - } + } } \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/darkascension/HavengulLich.java b/Mage.Sets/src/mage/sets/darkascension/HavengulLich.java index c37545a704..4f1cd009b7 100644 --- a/Mage.Sets/src/mage/sets/darkascension/HavengulLich.java +++ b/Mage.Sets/src/mage/sets/darkascension/HavengulLich.java @@ -76,7 +76,7 @@ public class HavengulLich extends CardImpl { ability.addEffect(new HavengulLichPlayedEffect()); ability.addTarget(new TargetCardInGraveyard(filter)); this.addAbility(ability); - + } public HavengulLich(final HavengulLich card) { @@ -92,34 +92,34 @@ public class HavengulLich extends CardImpl { //allow card in graveyard to be played class HavengulLichPlayEffect extends AsThoughEffectImpl { - public HavengulLichPlayEffect() { - super(Constants.AsThoughEffectType.CAST, Constants.Duration.EndOfTurn, Constants.Outcome.Benefit); - staticText = "You may cast target creature card in a graveyard this turn"; - } + public HavengulLichPlayEffect() { + super(Constants.AsThoughEffectType.CAST, Constants.Duration.EndOfTurn, Constants.Outcome.Benefit); + staticText = "You may cast target creature card in a graveyard this turn"; + } - public HavengulLichPlayEffect(final HavengulLichPlayEffect effect) { - super(effect); - } + public HavengulLichPlayEffect(final HavengulLichPlayEffect effect) { + super(effect); + } - @Override - public boolean apply(Game game, Ability source) { - return true; - } + @Override + public boolean apply(Game game, Ability source) { + return true; + } - @Override - public HavengulLichPlayEffect copy() { - return new HavengulLichPlayEffect(this); - } + @Override + public HavengulLichPlayEffect copy() { + return new HavengulLichPlayEffect(this); + } - @Override - public boolean applies(UUID sourceId, Ability source, Game game) { + @Override + public boolean applies(UUID sourceId, Ability source, Game game) { Card card = game.getCard(sourceId); if (card != null && game.getState().getZone(card.getId()) == Constants.Zone.GRAVEYARD) { if (targetPointer.getFirst(game, source).equals(card.getId())) return true; } return false; - } + } } @@ -129,54 +129,54 @@ class HavengulLichPlayedEffect extends OneShotEffect { public HavengulLichPlayedEffect() { super(Outcome.PutCreatureInPlay); } - + public HavengulLichPlayedEffect(final HavengulLichPlayedEffect effect) { super(effect); } - + @Override public boolean apply(Game game, Ability source) { DelayedTriggeredAbility ability = new HavengulLichDelayedTriggeredAbility(targetPointer.getFirst(game, source)); ability.setSourceId(source.getSourceId()); ability.setControllerId(source.getControllerId()); game.addDelayedTriggeredAbility(ability); - return true; + return true; } @Override public HavengulLichPlayedEffect copy() { return new HavengulLichPlayedEffect(this); } - + } // when card is played create continuous effect class HavengulLichDelayedTriggeredAbility extends DelayedTriggeredAbility { private UUID cardId; - - public HavengulLichDelayedTriggeredAbility (UUID cardId) { - super(new HavengulLichEffect(cardId), Duration.EndOfTurn); + + public HavengulLichDelayedTriggeredAbility (UUID cardId) { + super(new HavengulLichEffect(cardId), Duration.EndOfTurn); this.cardId = cardId; - } + } - public HavengulLichDelayedTriggeredAbility(HavengulLichDelayedTriggeredAbility ability) { - super(ability); + public HavengulLichDelayedTriggeredAbility(HavengulLichDelayedTriggeredAbility ability) { + super(ability); this.cardId = ability.cardId; - } + } - @Override - public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == GameEvent.EventType.SPELL_CAST && event.getSourceId().equals(cardId)) { + @Override + public boolean checkTrigger(GameEvent event, Game game) { + if (event.getType() == GameEvent.EventType.SPELL_CAST && event.getSourceId().equals(cardId)) { return true; - } - return false; - } - - @Override - public HavengulLichDelayedTriggeredAbility copy() { - return new HavengulLichDelayedTriggeredAbility(this); - } + } + return false; + } + + @Override + public HavengulLichDelayedTriggeredAbility copy() { + return new HavengulLichDelayedTriggeredAbility(this); + } } // copy activated abilities of card @@ -185,29 +185,29 @@ class HavengulLichEffect extends ContinuousEffectImpl { private UUID cardId; public HavengulLichEffect(UUID cardId) { - super(Duration.EndOfTurn, Constants.Layer.AbilityAddingRemovingEffects_6, Constants.SubLayer.NA, Constants.Outcome.AddAbility); + super(Duration.EndOfTurn, Constants.Layer.AbilityAddingRemovingEffects_6, Constants.SubLayer.NA, Constants.Outcome.AddAbility); this.cardId = cardId; - } + } - public HavengulLichEffect(final HavengulLichEffect effect) { - super(effect); + public HavengulLichEffect(final HavengulLichEffect effect) { + super(effect); this.cardId = effect.cardId; - } + } - @Override - public HavengulLichEffect copy() { - return new HavengulLichEffect(this); - } + @Override + public HavengulLichEffect copy() { + return new HavengulLichEffect(this); + } - @Override - public boolean apply(Game game, Ability source) { + @Override + public boolean apply(Game game, Ability source) { Permanent permanent = game.getPermanent(source.getSourceId()); Card card = game.getCard(cardId); if (permanent != null && card != null) { for (ActivatedAbility ability: card.getAbilities().getActivatedAbilities(Zone.BATTLEFIELD)) { permanent.addAbility(ability, game); } - } - return false; - } + } + return false; + } } diff --git a/Mage.Sets/src/mage/sets/darkascension/HinterlandScourge.java b/Mage.Sets/src/mage/sets/darkascension/HinterlandScourge.java index 39847d0ef4..d16bad364e 100644 --- a/Mage.Sets/src/mage/sets/darkascension/HinterlandScourge.java +++ b/Mage.Sets/src/mage/sets/darkascension/HinterlandScourge.java @@ -61,8 +61,8 @@ public class HinterlandScourge extends CardImpl { this.toughness = new MageInt(2); // Hinterland Scourge must be blocked if able. - this.addAbility(new SimpleStaticAbility(Constants.Zone.BATTLEFIELD, new MustBlockSourceEffect())); - + this.addAbility(new SimpleStaticAbility(Constants.Zone.BATTLEFIELD, new MustBlockSourceEffect())); + // 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), Constants.TargetController.ANY, false); this.addAbility(new ConditionalTriggeredAbility(ability, TwoOrMoreSpellsWereCastLastTurnCondition.getInstance(), TransformAbility.TWO_OR_MORE_SPELLS_TRANSFORM_RULE)); diff --git a/Mage.Sets/src/mage/sets/darkascension/HollowhengeSpirit.java b/Mage.Sets/src/mage/sets/darkascension/HollowhengeSpirit.java index 69f8e811e9..6fb5cdee41 100644 --- a/Mage.Sets/src/mage/sets/darkascension/HollowhengeSpirit.java +++ b/Mage.Sets/src/mage/sets/darkascension/HollowhengeSpirit.java @@ -63,7 +63,7 @@ public class HollowhengeSpirit extends CardImpl { target.setRequired(true); ability.addTarget(target); this.addAbility(ability); - + } public HollowhengeSpirit(final HollowhengeSpirit card) { diff --git a/Mage.Sets/src/mage/sets/darkascension/HuntmasterOfTheFells.java b/Mage.Sets/src/mage/sets/darkascension/HuntmasterOfTheFells.java index 6aae73ad18..c6a45259e7 100644 --- a/Mage.Sets/src/mage/sets/darkascension/HuntmasterOfTheFells.java +++ b/Mage.Sets/src/mage/sets/darkascension/HuntmasterOfTheFells.java @@ -82,10 +82,10 @@ public class HuntmasterOfTheFells extends CardImpl { // Whenever this creature enters the battlefield or transforms into Huntmaster of the Fells, put a 2/2 green Wolf creature token onto the battlefield and you gain 2 life. this.addAbility(new HuntmasterOfTheFellsAbility()); - + // Whenever this creature transforms into Ravager of the Fells, it deals 2 damage to target opponent and 2 damage to up to one target creature that player controls. this.addAbility(new RavagerOfTheFellsAbility()); - + // 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), Constants.TargetController.ANY, false); @@ -105,96 +105,96 @@ public class HuntmasterOfTheFells extends CardImpl { class HuntmasterOfTheFellsAbility extends TriggeredAbilityImpl { public HuntmasterOfTheFellsAbility() { - super(Constants.Zone.BATTLEFIELD, new CreateTokenEffect(new WolfToken()), true); + super(Constants.Zone.BATTLEFIELD, new CreateTokenEffect(new WolfToken()), true); this.addEffect(new GainLifeEffect(2)); - } + } - public HuntmasterOfTheFellsAbility(final HuntmasterOfTheFellsAbility ability) { - super(ability); - } + public HuntmasterOfTheFellsAbility(final HuntmasterOfTheFellsAbility ability) { + super(ability); + } - @Override - public HuntmasterOfTheFellsAbility copy() { - return new HuntmasterOfTheFellsAbility(this); - } + @Override + public HuntmasterOfTheFellsAbility copy() { + return new HuntmasterOfTheFellsAbility(this); + } - @Override - public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == GameEvent.EventType.TRANSFORMED && event.getTargetId().equals(this.getSourceId())) { + @Override + public boolean checkTrigger(GameEvent event, Game game) { + if (event.getType() == GameEvent.EventType.TRANSFORMED && event.getTargetId().equals(this.getSourceId())) { Permanent permanent = game.getPermanent(sourceId); if (permanent != null && !permanent.isTransformed()) return true; - } - if (event.getType() == GameEvent.EventType.ZONE_CHANGE && event.getTargetId().equals(this.getSourceId())) { - ZoneChangeEvent zEvent = (ZoneChangeEvent)event; - if (zEvent.getToZone() == Zone.BATTLEFIELD) { - return true; - } - } - return false; - } + } + if (event.getType() == GameEvent.EventType.ZONE_CHANGE && event.getTargetId().equals(this.getSourceId())) { + ZoneChangeEvent zEvent = (ZoneChangeEvent)event; + if (zEvent.getToZone() == Zone.BATTLEFIELD) { + return true; + } + } + return false; + } - @Override - public String getRule() { - return "Whenever this creature enters the battlefield or transforms into Huntmaster of the Fells, put a 2/2 green Wolf creature token onto the battlefield and you gain 2 life."; - } + @Override + public String getRule() { + return "Whenever this creature enters the battlefield or transforms into Huntmaster of the Fells, put a 2/2 green Wolf creature token onto the battlefield and you gain 2 life."; + } } class RavagerOfTheFellsAbility extends TriggeredAbilityImpl { public RavagerOfTheFellsAbility() { - super(Constants.Zone.BATTLEFIELD, new RavagerOfTheFellsEffect(), true); - Target target1 = new TargetOpponent(); - target1.setRequired(true); - this.addTarget(target1); - this.addTarget(new RavagerOfTheFellsTarget()); - } + super(Constants.Zone.BATTLEFIELD, new RavagerOfTheFellsEffect(), true); + Target target1 = new TargetOpponent(); + target1.setRequired(true); + this.addTarget(target1); + this.addTarget(new RavagerOfTheFellsTarget()); + } - public RavagerOfTheFellsAbility(final RavagerOfTheFellsAbility ability) { - super(ability); - } + public RavagerOfTheFellsAbility(final RavagerOfTheFellsAbility ability) { + super(ability); + } - @Override - public RavagerOfTheFellsAbility copy() { - return new RavagerOfTheFellsAbility(this); - } + @Override + public RavagerOfTheFellsAbility copy() { + return new RavagerOfTheFellsAbility(this); + } - @Override - public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == GameEvent.EventType.TRANSFORMED && event.getTargetId().equals(sourceId)) { + @Override + public boolean checkTrigger(GameEvent event, Game game) { + if (event.getType() == GameEvent.EventType.TRANSFORMED && event.getTargetId().equals(sourceId)) { Permanent permanent = game.getPermanent(sourceId); if (permanent != null && permanent.isTransformed()) return true; - } - return false; - } + } + return false; + } - @Override - public String getRule() { - return "Whenever this creature transforms into Ravager of the Fells, it deals 2 damage to target opponent and 2 damage to up to one target creature that player controls."; - } + @Override + public String getRule() { + return "Whenever this creature transforms into Ravager of the Fells, it deals 2 damage to target opponent and 2 damage to up to one target creature that player controls."; + } } class RavagerOfTheFellsEffect extends OneShotEffect { - public RavagerOfTheFellsEffect() { - super(Constants.Outcome.Damage); - staticText = "{this} deals 2 damage to target opponent and 2 damage to up to one target creature that player controls"; - } + public RavagerOfTheFellsEffect() { + super(Constants.Outcome.Damage); + staticText = "{this} deals 2 damage to target opponent and 2 damage to up to one target creature that player controls"; + } - public RavagerOfTheFellsEffect(final RavagerOfTheFellsEffect effect) { - super(effect); - } + public RavagerOfTheFellsEffect(final RavagerOfTheFellsEffect effect) { + super(effect); + } - @Override - public RavagerOfTheFellsEffect copy() { - return new RavagerOfTheFellsEffect(this); - } + @Override + public RavagerOfTheFellsEffect copy() { + return new RavagerOfTheFellsEffect(this); + } - @Override - public boolean apply(Game game, Ability source) { + @Override + public boolean apply(Game game, Ability source) { Player player = game.getPlayer(source.getTargets().get(0).getFirstTarget()); if (player != null) { player.damage(2, source.getSourceId(), game, false, true); @@ -204,7 +204,7 @@ class RavagerOfTheFellsEffect extends OneShotEffect { creature.damage(2, source.getSourceId(), game, true, false); } return true; - } + } } diff --git a/Mage.Sets/src/mage/sets/darkascension/Immerwolf.java b/Mage.Sets/src/mage/sets/darkascension/Immerwolf.java index f44d988ecb..7389c825ae 100644 --- a/Mage.Sets/src/mage/sets/darkascension/Immerwolf.java +++ b/Mage.Sets/src/mage/sets/darkascension/Immerwolf.java @@ -51,13 +51,13 @@ import java.util.UUID; */ public class Immerwolf extends CardImpl { - private final static FilterCreaturePermanent filter = new FilterCreaturePermanent("Wolf and Werewolf creatures"); + private final static FilterCreaturePermanent filter = new FilterCreaturePermanent("Wolf and Werewolf creatures"); - static { - filter.getSubtype().add("Wolf"); - filter.getSubtype().add("Werewolf"); - filter.setScopeSubtype(Filter.ComparisonScope.Any); - } + static { + filter.getSubtype().add("Wolf"); + filter.getSubtype().add("Werewolf"); + filter.setScopeSubtype(Filter.ComparisonScope.Any); + } public Immerwolf(UUID ownerId) { super(ownerId, 141, "Immerwolf", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{1}{R}{G}"); @@ -70,13 +70,13 @@ public class Immerwolf extends CardImpl { this.toughness = new MageInt(2); this.addAbility(IntimidateAbility.getInstance()); - + // Other Wolf and Werewolf creatures you control get +1/+1. - this.addAbility(new SimpleStaticAbility(Constants.Zone.BATTLEFIELD, new BoostControlledEffect(1, 1, Constants.Duration.WhileOnBattlefield, filter, true))); - + this.addAbility(new SimpleStaticAbility(Constants.Zone.BATTLEFIELD, new BoostControlledEffect(1, 1, Constants.Duration.WhileOnBattlefield, filter, true))); + // Non-Human Werewolves you control can't transform. this.addAbility(new SimpleStaticAbility(Constants.Zone.BATTLEFIELD, new ImmerwolfEffect())); - + } public Immerwolf(final Immerwolf card) { @@ -91,17 +91,17 @@ public class Immerwolf extends CardImpl { class ImmerwolfEffect extends ReplacementEffectImpl { - private final static FilterCreaturePermanent filterWerewolf = new FilterCreaturePermanent("Werewolf creature"); - private final static FilterCreaturePermanent filterNonhuman = new FilterCreaturePermanent("Non-human creature"); + private final static FilterCreaturePermanent filterWerewolf = new FilterCreaturePermanent("Werewolf creature"); + private final static FilterCreaturePermanent filterNonhuman = new FilterCreaturePermanent("Non-human creature"); - static { - filterWerewolf.getSubtype().add("Werewolf"); - filterWerewolf.setScopeSubtype(Filter.ComparisonScope.Any); + static { + filterWerewolf.getSubtype().add("Werewolf"); + filterWerewolf.setScopeSubtype(Filter.ComparisonScope.Any); filterNonhuman.getSubtype().add("Human"); filterNonhuman.setScopeSubtype(Filter.ComparisonScope.Any); filterNonhuman.setNotFilter(true); - } - + } + public ImmerwolfEffect() { super(Constants.Duration.WhileOnBattlefield, Constants.Outcome.Detriment); staticText = "Non-Human Werewolves you control can't transform"; diff --git a/Mage.Sets/src/mage/sets/darkascension/IncreasingAmbition.java b/Mage.Sets/src/mage/sets/darkascension/IncreasingAmbition.java index 2321ae4578..7ebc5e6a1c 100644 --- a/Mage.Sets/src/mage/sets/darkascension/IncreasingAmbition.java +++ b/Mage.Sets/src/mage/sets/darkascension/IncreasingAmbition.java @@ -59,7 +59,7 @@ public class IncreasingAmbition extends CardImpl { // Search your library for a card and put that card into your hand. If Increasing Ambition was cast from a graveyard, instead search your library for two cards and put those cards into your hand. Then shuffle your library. this.getSpellAbility().addEffect(new IncreasingAmbitionEffect()); - + // Flashback {7}{B} this.addAbility(new FlashbackAbility(new ManaCostsImpl("{7}{B}"), Constants.TimingRule.SORCERY)); } @@ -77,18 +77,18 @@ public class IncreasingAmbition extends CardImpl { class IncreasingAmbitionEffect extends SearchEffect { public IncreasingAmbitionEffect() { - super(new TargetCardInLibrary(), Constants.Outcome.DrawCard); - staticText = "Search your library for a card and put that card into your hand. If Increasing Ambition was cast from a graveyard, instead search your library for two cards and put those cards into your hand. Then shuffle your library"; + super(new TargetCardInLibrary(), Constants.Outcome.DrawCard); + staticText = "Search your library for a card and put that card into your hand. If Increasing Ambition was cast from a graveyard, instead search your library for two cards and put those cards into your hand. Then shuffle your library"; } - public IncreasingAmbitionEffect(final IncreasingAmbitionEffect effect) { - super(effect); - } + public IncreasingAmbitionEffect(final IncreasingAmbitionEffect effect) { + super(effect); + } - @Override - public IncreasingAmbitionEffect copy() { - return new IncreasingAmbitionEffect(this); - } + @Override + public IncreasingAmbitionEffect copy() { + return new IncreasingAmbitionEffect(this); + } @Override public boolean apply(Game game, Ability source) { diff --git a/Mage.Sets/src/mage/sets/darkascension/IncreasingConfusion.java b/Mage.Sets/src/mage/sets/darkascension/IncreasingConfusion.java index cb5c467da2..98a455d79a 100644 --- a/Mage.Sets/src/mage/sets/darkascension/IncreasingConfusion.java +++ b/Mage.Sets/src/mage/sets/darkascension/IncreasingConfusion.java @@ -73,7 +73,7 @@ public class IncreasingConfusion extends CardImpl { } class IncreasingConfusionEffect extends OneShotEffect { - + public IncreasingConfusionEffect() { super(Constants.Outcome.Detriment); staticText = "Target player puts the top X cards of his or her library into his or her graveyard. If Increasing Confusion was cast from a graveyard, that player puts twice that many cards into his or her graveyard instead"; diff --git a/Mage.Sets/src/mage/sets/darkascension/IncreasingDevotion.java b/Mage.Sets/src/mage/sets/darkascension/IncreasingDevotion.java index ebaaf4d509..fb4668f82b 100644 --- a/Mage.Sets/src/mage/sets/darkascension/IncreasingDevotion.java +++ b/Mage.Sets/src/mage/sets/darkascension/IncreasingDevotion.java @@ -53,7 +53,7 @@ public class IncreasingDevotion extends CardImpl { // Put five 1/1 white Human creature tokens onto the battlefield. If Increasing Devotion was cast from a graveyard, put ten of those tokens onto the battlefield instead. this.getSpellAbility().addEffect(new IncreasingDevotionEffect()); - + // Flashback {7}{W}{W} this.addAbility(new FlashbackAbility(new ManaCostsImpl("{7}{W}{W}"), Constants.TimingRule.SORCERY)); } @@ -69,9 +69,9 @@ public class IncreasingDevotion extends CardImpl { } class IncreasingDevotionEffect extends OneShotEffect { - + private static HumanToken token = new HumanToken(); - + public IncreasingDevotionEffect() { super(Constants.Outcome.PutCreatureInPlay); staticText = "Put five 1/1 white Human creature tokens onto the battlefield. If Increasing Devotion was cast from a graveyard, put ten of those tokens onto the battlefield instead"; diff --git a/Mage.Sets/src/mage/sets/darkascension/IncreasingSavagery.java b/Mage.Sets/src/mage/sets/darkascension/IncreasingSavagery.java index c3886a10f8..6b47b46036 100644 --- a/Mage.Sets/src/mage/sets/darkascension/IncreasingSavagery.java +++ b/Mage.Sets/src/mage/sets/darkascension/IncreasingSavagery.java @@ -57,7 +57,7 @@ public class IncreasingSavagery extends CardImpl { // Put five +1/+1 counters on target creature. If Increasing Savagery was cast from a graveyard, put ten +1/+1 counters on that creature instead. this.getSpellAbility().addEffect(new IncreasingSavageryEffect()); this.getSpellAbility().addTarget(new TargetCreaturePermanent()); - + // Flashback {5}{G}{G} this.addAbility(new FlashbackAbility(new ManaCostsImpl("{5}{G}{G}"), Constants.TimingRule.SORCERY)); } @@ -73,7 +73,7 @@ public class IncreasingSavagery extends CardImpl { } class IncreasingSavageryEffect extends OneShotEffect { - + public IncreasingSavageryEffect() { super(Constants.Outcome.BoostCreature); staticText = "Put five +1/+1 counters on target creature. If Increasing Savagery was cast from a graveyard, put ten +1/+1 counters on that creature instead"; diff --git a/Mage.Sets/src/mage/sets/darkascension/IncreasingVengeance.java b/Mage.Sets/src/mage/sets/darkascension/IncreasingVengeance.java index f0762faaaf..49b93250db 100644 --- a/Mage.Sets/src/mage/sets/darkascension/IncreasingVengeance.java +++ b/Mage.Sets/src/mage/sets/darkascension/IncreasingVengeance.java @@ -82,7 +82,7 @@ public class IncreasingVengeance extends CardImpl { } class IncreasingVengeanceEffect extends OneShotEffect { - + public IncreasingVengeanceEffect() { super(Constants.Outcome.BoostCreature); staticText = "Copy target instant or sorcery spell you control. If Increasing Vengeance was cast from a graveyard, copy that spell twice instead. You may choose new targets for the copies"; @@ -94,13 +94,13 @@ class IncreasingVengeanceEffect extends OneShotEffect @Override public boolean apply(Game game, Ability source) { - Spell spell = game.getStack().getSpell(targetPointer.getFirst(game, source)); - if (spell != null) { - Spell copy = spell.copySpell(); - copy.setControllerId(source.getControllerId()); - copy.setCopiedSpell(true); - game.getStack().push(copy); - copy.chooseNewTargets(game, source.getControllerId()); + Spell spell = game.getStack().getSpell(targetPointer.getFirst(game, source)); + if (spell != null) { + Spell copy = spell.copySpell(); + copy.setControllerId(source.getControllerId()); + copy.setCopiedSpell(true); + game.getStack().push(copy); + copy.chooseNewTargets(game, source.getControllerId()); Spell sourceSpell = (Spell) game.getStack().getStackObject(source.getSourceId()); if (sourceSpell != null) { if (sourceSpell.getFromZone() == Constants.Zone.GRAVEYARD) { @@ -112,8 +112,8 @@ class IncreasingVengeanceEffect extends OneShotEffect } } return true; - } - return false; + } + return false; } @Override diff --git a/Mage.Sets/src/mage/sets/darkascension/LambholtElder.java b/Mage.Sets/src/mage/sets/darkascension/LambholtElder.java index 8c87ad3efe..58654834a5 100644 --- a/Mage.Sets/src/mage/sets/darkascension/LambholtElder.java +++ b/Mage.Sets/src/mage/sets/darkascension/LambholtElder.java @@ -56,7 +56,7 @@ public class LambholtElder extends CardImpl { this.color.setGreen(true); this.power = new MageInt(1); this.toughness = new MageInt(2); - + this.canTransform = true; this.secondSideCard = new SilverpeltWerewolf(ownerId); diff --git a/Mage.Sets/src/mage/sets/darkascension/LostInTheWoods.java b/Mage.Sets/src/mage/sets/darkascension/LostInTheWoods.java index 86d809cdb3..d5f076aea9 100644 --- a/Mage.Sets/src/mage/sets/darkascension/LostInTheWoods.java +++ b/Mage.Sets/src/mage/sets/darkascension/LostInTheWoods.java @@ -77,11 +77,11 @@ class LostInTheWoodsEffect extends OneShotEffect { public LostInTheWoodsEffect() { super(Outcome.PreventDamage); } - + public LostInTheWoodsEffect(final LostInTheWoodsEffect effect) { super(effect); } - + @Override public boolean apply(Game game, Ability source) { Player player = game.getPlayer(source.getControllerId()); diff --git a/Mage.Sets/src/mage/sets/darkascension/LoyalCathar.java b/Mage.Sets/src/mage/sets/darkascension/LoyalCathar.java index 8aa2144263..d5814bcc7e 100644 --- a/Mage.Sets/src/mage/sets/darkascension/LoyalCathar.java +++ b/Mage.Sets/src/mage/sets/darkascension/LoyalCathar.java @@ -63,7 +63,7 @@ public class LoyalCathar extends CardImpl { this.toughness = new MageInt(2); this.addAbility(VigilanceAbility.getInstance()); - + // When Loyal Cathar dies, return it to the battlefield transformed under your control at the beginning of the next end step. this.addAbility(new TransformAbility()); this.addAbility(new DiesTriggeredAbility(new LoyalCatharEffect())); @@ -81,56 +81,56 @@ public class LoyalCathar extends CardImpl { class LoyalCatharEffect extends OneShotEffect { - private static final String effectText = "return it to the battlefield transformed under your control at the beginning of the next end step"; + private static final String effectText = "return it to the battlefield transformed under your control at the beginning of the next end step"; - LoyalCatharEffect ( ) { - super(Constants.Outcome.Benefit); - staticText = effectText; - } + LoyalCatharEffect ( ) { + super(Constants.Outcome.Benefit); + staticText = effectText; + } - LoyalCatharEffect(LoyalCatharEffect effect) { - super(effect); - } + LoyalCatharEffect(LoyalCatharEffect effect) { + super(effect); + } - @Override - public boolean apply(Game game, Ability source) { + @Override + public boolean apply(Game game, Ability source) { //create delayed triggered ability AtEndOfTurnDelayedTriggeredAbility delayedAbility = new AtEndOfTurnDelayedTriggeredAbility(new ReturnLoyalCatharEffect(source.getSourceId())); delayedAbility.setSourceId(source.getSourceId()); delayedAbility.setControllerId(source.getControllerId()); game.addDelayedTriggeredAbility(delayedAbility); return true; - } + } - @Override - public LoyalCatharEffect copy() { - return new LoyalCatharEffect(this); - } + @Override + public LoyalCatharEffect copy() { + return new LoyalCatharEffect(this); + } } class ReturnLoyalCatharEffect extends OneShotEffect { - private UUID cardId; + private UUID cardId; - public ReturnLoyalCatharEffect(UUID cardId) { - super(Constants.Outcome.PutCardInPlay); - this.cardId = cardId; + public ReturnLoyalCatharEffect(UUID cardId) { + super(Constants.Outcome.PutCardInPlay); + this.cardId = cardId; this.staticText = "return it to the battlefield transformed under your control"; - } + } - public ReturnLoyalCatharEffect(final ReturnLoyalCatharEffect effect) { - super(effect); - this.cardId = effect.cardId; - } + public ReturnLoyalCatharEffect(final ReturnLoyalCatharEffect effect) { + super(effect); + this.cardId = effect.cardId; + } - @Override - public ReturnLoyalCatharEffect copy() { - return new ReturnLoyalCatharEffect(this); - } + @Override + public ReturnLoyalCatharEffect copy() { + return new ReturnLoyalCatharEffect(this); + } - @Override - public boolean apply(Game game, Ability source) { + @Override + public boolean apply(Game game, Ability source) { Card card = game.getCard(cardId); if (card != null) { card.putOntoBattlefield(game, Constants.Zone.GRAVEYARD, source.getSourceId(), source.getControllerId()); @@ -141,6 +141,6 @@ class ReturnLoyalCatharEffect extends OneShotEffect { } } return false; - } + } } diff --git a/Mage.Sets/src/mage/sets/darkascension/MysticRetrieval.java b/Mage.Sets/src/mage/sets/darkascension/MysticRetrieval.java index 8c8bc51728..ec33f76c2f 100644 --- a/Mage.Sets/src/mage/sets/darkascension/MysticRetrieval.java +++ b/Mage.Sets/src/mage/sets/darkascension/MysticRetrieval.java @@ -46,7 +46,7 @@ import mage.target.common.TargetCardInYourGraveyard; */ public class MysticRetrieval extends CardImpl { private static final FilterCard filter = new FilterCard("instant or sorcery card from your graveyard"); - + static { filter.getCardType().add(CardType.INSTANT); filter.getCardType().add(CardType.SORCERY); diff --git a/Mage.Sets/src/mage/sets/darkascension/PredatorOoze.java b/Mage.Sets/src/mage/sets/darkascension/PredatorOoze.java index f96cbb6574..b513014e7b 100644 --- a/Mage.Sets/src/mage/sets/darkascension/PredatorOoze.java +++ b/Mage.Sets/src/mage/sets/darkascension/PredatorOoze.java @@ -55,10 +55,10 @@ public class PredatorOoze extends CardImpl { // Predator Ooze is indestructible. this.addAbility(IndestructibleAbility.getInstance()); - + // Whenever Predator Ooze attacks, put a +1/+1 counter on it. this.addAbility(new AttacksTriggeredAbility(new AddCountersSourceEffect(CounterType.P1P1.createInstance()), false)); - + // Whenever a creature dealt damage by Predator Ooze this turn dies, put a +1/+1 counter on Predator Ooze. this.addAbility(new DiesAndDealtDamageThisTurnTriggeredAbility(new AddCountersSourceEffect(CounterType.P1P1.createInstance()))); } diff --git a/Mage.Sets/src/mage/sets/darkascension/PyreheartWolf.java b/Mage.Sets/src/mage/sets/darkascension/PyreheartWolf.java index 6a56ff2ae9..017f24cc7a 100644 --- a/Mage.Sets/src/mage/sets/darkascension/PyreheartWolf.java +++ b/Mage.Sets/src/mage/sets/darkascension/PyreheartWolf.java @@ -92,7 +92,7 @@ class PyreheartWolfEffect extends OneShotEffect { @Override public boolean apply(Game game, Ability source) { - + FilterCreaturePermanent filter = new FilterCreaturePermanent(); for (Permanent perm: game.getBattlefield().getAllActivePermanents(filter, source.getControllerId(), game)) { CantBeBlockedByOneEffect effect = new CantBeBlockedByOneEffect(2, Duration.EndOfTurn); diff --git a/Mage.Sets/src/mage/sets/darkascension/RavagerOfTheFells.java b/Mage.Sets/src/mage/sets/darkascension/RavagerOfTheFells.java index 05ac541ef8..31b2da7332 100644 --- a/Mage.Sets/src/mage/sets/darkascension/RavagerOfTheFells.java +++ b/Mage.Sets/src/mage/sets/darkascension/RavagerOfTheFells.java @@ -55,14 +55,14 @@ public class RavagerOfTheFells extends CardImpl { // this card is the second face of double-faced card this.nightCard = true; this.canTransform = true; - + this.power = new MageInt(4); this.toughness = new MageInt(4); this.addAbility(TrampleAbility.getInstance()); // Whenever this creature transforms into Ravager of the Fells, it deals 2 damage to target opponent and 2 damage to up to one target creature that player controls. - + // 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), Constants.TargetController.ANY, false); this.addAbility(new ConditionalTriggeredAbility(ability, TwoOrMoreSpellsWereCastLastTurnCondition.getInstance(), TransformAbility.TWO_OR_MORE_SPELLS_TRANSFORM_RULE)); diff --git a/Mage.Sets/src/mage/sets/darkascension/RavenousDemon.java b/Mage.Sets/src/mage/sets/darkascension/RavenousDemon.java index aab189052c..6f5da931ae 100644 --- a/Mage.Sets/src/mage/sets/darkascension/RavenousDemon.java +++ b/Mage.Sets/src/mage/sets/darkascension/RavenousDemon.java @@ -47,17 +47,17 @@ import mage.target.common.TargetControlledPermanent; */ public class RavenousDemon extends CardImpl { private final static FilterControlledPermanent filter = new FilterControlledPermanent("Human"); - + static { filter.getSubtype().add("Human"); filter.setScopeSubtype(Filter.ComparisonScope.Any); } - + public RavenousDemon(UUID ownerId) { super(ownerId, 71, "Ravenous Demon", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{3}{B}{B}"); this.expansionSetCode = "DKA"; this.subtype.add("Demon"); - + this.canTransform = true; this.secondSideCard = new ArchdemonOfGreed(ownerId); diff --git a/Mage.Sets/src/mage/sets/darkascension/RequiemAngel.java b/Mage.Sets/src/mage/sets/darkascension/RequiemAngel.java index 43a6d8c7d3..dc32eae6cc 100644 --- a/Mage.Sets/src/mage/sets/darkascension/RequiemAngel.java +++ b/Mage.Sets/src/mage/sets/darkascension/RequiemAngel.java @@ -60,7 +60,7 @@ public class RequiemAngel extends CardImpl { this.toughness = new MageInt(5); this.addAbility(FlyingAbility.getInstance()); - + // Whenever another non-Spirit creature you control dies, put a 1/1 white Spirit creature token with flying onto the battlefield. this.addAbility(new DiesAnotherCreatureYouControlTriggeredAbility(new CreateTokenEffect(new SpiritWhiteToken(), 1), false, filter)); } diff --git a/Mage.Sets/src/mage/sets/darkascension/Seance.java b/Mage.Sets/src/mage/sets/darkascension/Seance.java index 70a6c61b7b..688f15f3d1 100644 --- a/Mage.Sets/src/mage/sets/darkascension/Seance.java +++ b/Mage.Sets/src/mage/sets/darkascension/Seance.java @@ -76,22 +76,22 @@ public class Seance extends CardImpl { class SeanceEffect extends OneShotEffect { - public SeanceEffect() { - super(Constants.Outcome.PutCreatureInPlay); - this.staticText = "put a token onto the battlefield that's a copy of that card except it's a Spirit in addition to its other types. Exile it at the beginning of the next end step"; - } + public SeanceEffect() { + super(Constants.Outcome.PutCreatureInPlay); + this.staticText = "put a token onto the battlefield that's a copy of that card except it's a Spirit in addition to its other types. Exile it at the beginning of the next end step"; + } - public SeanceEffect(final SeanceEffect effect) { - super(effect); - } + public SeanceEffect(final SeanceEffect effect) { + super(effect); + } - @Override - public SeanceEffect copy() { - return new SeanceEffect(this); - } + @Override + public SeanceEffect copy() { + return new SeanceEffect(this); + } - @Override - public boolean apply(Game game, Ability source) { + @Override + public boolean apply(Game game, Ability source) { Card card = game.getCard(source.getFirstTarget()); if (card != null) { card.moveToExile(null, "", source.getSourceId(), game); @@ -112,7 +112,7 @@ class SeanceEffect extends OneShotEffect { return true; } - return false; - } + return false; + } } diff --git a/Mage.Sets/src/mage/sets/darkascension/SecretsOfTheDead.java b/Mage.Sets/src/mage/sets/darkascension/SecretsOfTheDead.java index 3dcfdb058d..1f66c3333f 100644 --- a/Mage.Sets/src/mage/sets/darkascension/SecretsOfTheDead.java +++ b/Mage.Sets/src/mage/sets/darkascension/SecretsOfTheDead.java @@ -47,7 +47,7 @@ public class SecretsOfTheDead extends CardImpl { static { filter.setFromZone(Constants.Zone.GRAVEYARD); } - + public SecretsOfTheDead(UUID ownerId) { super(ownerId, 48, "Secrets of the Dead", Rarity.UNCOMMON, new CardType[]{CardType.ENCHANTMENT}, "{2}{U}"); this.expansionSetCode = "DKA"; diff --git a/Mage.Sets/src/mage/sets/darkascension/SorinLordOfInnistrad.java b/Mage.Sets/src/mage/sets/darkascension/SorinLordOfInnistrad.java index e3f901b71a..096a9390d0 100644 --- a/Mage.Sets/src/mage/sets/darkascension/SorinLordOfInnistrad.java +++ b/Mage.Sets/src/mage/sets/darkascension/SorinLordOfInnistrad.java @@ -63,14 +63,14 @@ import java.util.UUID; */ public class SorinLordOfInnistrad extends CardImpl { - private static final FilterPermanent filter = new FilterPermanent("creature or planeswalker"); + private static final FilterPermanent filter = new FilterPermanent("creature or planeswalker"); - static { - filter.getCardType().add(CardType.CREATURE); - filter.getCardType().add(CardType.PLANESWALKER); + static { + filter.getCardType().add(CardType.CREATURE); + filter.getCardType().add(CardType.PLANESWALKER); filter.setScopeCardType(Filter.ComparisonScope.Any); - } - + } + public SorinLordOfInnistrad(UUID ownerId) { super(ownerId, 142, "Sorin, Lord of Innistrad", Rarity.MYTHIC, new CardType[]{CardType.PLANESWALKER}, "{2}{W}{B}"); this.expansionSetCode = "DKA"; @@ -83,10 +83,10 @@ public class SorinLordOfInnistrad extends CardImpl { // +1: Put a 1/1 black Vampire creature token with lifelink onto the battlefield. this.addAbility(new LoyaltyAbility(new CreateTokenEffect(new VampireToken()), 1)); - + // -2: You get an emblem with "Creatures you control get +1/+0." - this.addAbility(new LoyaltyAbility(new GetEmblemEffect(new SorinEmblem()), -2)); - + this.addAbility(new LoyaltyAbility(new GetEmblemEffect(new SorinEmblem()), -2)); + // -6: Destroy up to three target creatures and/or other planeswalkers. Return each card put into a graveyard this way to the battlefield under your control. LoyaltyAbility ability = new LoyaltyAbility(new SorinLordOfInnistradEffect(), -6); ability.addTarget(new TargetPermanent(0, 3, filter, false)); @@ -117,11 +117,11 @@ class VampireToken extends Token { class SorinEmblem extends Emblem { - public SorinEmblem() { + public SorinEmblem() { BoostControlledEffect effect = new BoostControlledEffect(1, 0, Duration.EndOfGame); - Ability ability = new SimpleStaticAbility(Zone.COMMAND, effect); - this.getAbilities().add(ability); - } + Ability ability = new SimpleStaticAbility(Zone.COMMAND, effect); + this.getAbilities().add(ability); + } } class SorinLordOfInnistradEffect extends OneShotEffect { @@ -159,7 +159,7 @@ class SorinLordOfInnistradEffect extends OneShotEffect { this.toughness = new MageInt(3); this.addAbility(FlyingAbility.getInstance()); - + // When Soul Seizer deals combat damage to a player, you may transform it. If you do, attach it to target creature that player controls. this.addAbility(new TransformAbility()); this.addAbility(new SoulSeizerTriggeredAbility()); @@ -126,15 +126,15 @@ class SoulSeizerEffect extends OneShotEffect { public SoulSeizerEffect() { super(Outcome.GainControl); } - + public SoulSeizerEffect(final SoulSeizerEffect effect) { super(effect); } - + @Override public boolean apply(Game game, Ability source) { - Permanent permanent = game.getPermanent(source.getSourceId()); - if (permanent != null && permanent.canTransform()) { + Permanent permanent = game.getPermanent(source.getSourceId()); + if (permanent != null && permanent.canTransform()) { if (permanent.transform(game)) { Permanent attachTo = game.getPermanent(targetPointer.getFirst(game, source)); if (attachTo != null) { @@ -149,5 +149,5 @@ class SoulSeizerEffect extends OneShotEffect { public SoulSeizerEffect copy() { return new SoulSeizerEffect(this); } - + } \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/darkascension/SuddenDisappearance.java b/Mage.Sets/src/mage/sets/darkascension/SuddenDisappearance.java index aa2f560100..f0e2f6221a 100644 --- a/Mage.Sets/src/mage/sets/darkascension/SuddenDisappearance.java +++ b/Mage.Sets/src/mage/sets/darkascension/SuddenDisappearance.java @@ -59,7 +59,7 @@ public class SuddenDisappearance extends CardImpl { // Exile all nonland permanents target player controls. Return the exiled cards to the battlefield under their owner's control at the beginning of the next end step. this.getSpellAbility().addEffect(new SuddenDisappearanceEffect()); this.getSpellAbility().addTarget(new TargetPlayer()); - + } public SuddenDisappearance(final SuddenDisappearance card) { @@ -75,15 +75,15 @@ public class SuddenDisappearance extends CardImpl { class SuddenDisappearanceEffect extends OneShotEffect { private static FilterNonlandPermanent filter = new FilterNonlandPermanent(); - + public SuddenDisappearanceEffect() { super(Outcome.Exile); } - + public SuddenDisappearanceEffect(final SuddenDisappearanceEffect effect) { super(effect); } - + @Override public boolean apply(Game game, Ability source) { List perms = game.getBattlefield().getAllActivePermanents(filter, source.getFirstTarget(), game); @@ -104,5 +104,5 @@ class SuddenDisappearanceEffect extends OneShotEffect public SuddenDisappearanceEffect copy() { return new SuddenDisappearanceEffect(this); } - + } \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/darkascension/ThaliaGuardianOfThraben.java b/Mage.Sets/src/mage/sets/darkascension/ThaliaGuardianOfThraben.java index 374d23ed96..ce465dd388 100644 --- a/Mage.Sets/src/mage/sets/darkascension/ThaliaGuardianOfThraben.java +++ b/Mage.Sets/src/mage/sets/darkascension/ThaliaGuardianOfThraben.java @@ -60,10 +60,10 @@ public class ThaliaGuardianOfThraben extends CardImpl { this.toughness = new MageInt(1); this.addAbility(FirstStrikeAbility.getInstance()); - + // Noncreature spells cost {1} more to cast. this.addAbility(new SimpleStaticAbility(Constants.Zone.BATTLEFIELD, new ThaliaGuardianOfThrabenCostReductionEffect())); - + } public ThaliaGuardianOfThraben(final ThaliaGuardianOfThraben card) { @@ -78,36 +78,36 @@ public class ThaliaGuardianOfThraben extends CardImpl { class ThaliaGuardianOfThrabenCostReductionEffect extends CostModificationEffectImpl { - ThaliaGuardianOfThrabenCostReductionEffect ( ) { - super(Constants.Duration.WhileOnBattlefield, Constants.Outcome.Benefit); - staticText = "Noncreature spells cost {1} more to cast"; - } + ThaliaGuardianOfThrabenCostReductionEffect ( ) { + super(Constants.Duration.WhileOnBattlefield, Constants.Outcome.Benefit); + staticText = "Noncreature spells cost {1} more to cast"; + } - ThaliaGuardianOfThrabenCostReductionEffect(ThaliaGuardianOfThrabenCostReductionEffect effect) { - super(effect); - } + ThaliaGuardianOfThrabenCostReductionEffect(ThaliaGuardianOfThrabenCostReductionEffect effect) { + super(effect); + } - @Override - public boolean apply(Game game, Ability source, Ability abilityToModify) { - SpellAbility spellAbility = (SpellAbility) abilityToModify; - spellAbility.getManaCostsToPay().add(new GenericManaCost(1)); - return true; - } - - @Override - public boolean applies(Ability abilityToModify, Ability source, Game game) { - if (abilityToModify instanceof SpellAbility) { - Card card = game.getCard(abilityToModify.getSourceId()); - if (card != null && !card.getCardType().contains(CardType.CREATURE)) { - return true; - } - } - return false; - } + @Override + public boolean apply(Game game, Ability source, Ability abilityToModify) { + SpellAbility spellAbility = (SpellAbility) abilityToModify; + spellAbility.getManaCostsToPay().add(new GenericManaCost(1)); + return true; + } - @Override - public ThaliaGuardianOfThrabenCostReductionEffect copy() { - return new ThaliaGuardianOfThrabenCostReductionEffect(this); - } + @Override + public boolean applies(Ability abilityToModify, Ability source, Game game) { + if (abilityToModify instanceof SpellAbility) { + Card card = game.getCard(abilityToModify.getSourceId()); + if (card != null && !card.getCardType().contains(CardType.CREATURE)) { + return true; + } + } + return false; + } + + @Override + public ThaliaGuardianOfThrabenCostReductionEffect copy() { + return new ThaliaGuardianOfThrabenCostReductionEffect(this); + } } diff --git a/Mage.Sets/src/mage/sets/darkascension/TowerGeist.java b/Mage.Sets/src/mage/sets/darkascension/TowerGeist.java index 88745824b5..d506122697 100644 --- a/Mage.Sets/src/mage/sets/darkascension/TowerGeist.java +++ b/Mage.Sets/src/mage/sets/darkascension/TowerGeist.java @@ -47,29 +47,29 @@ import mage.filter.FilterCard; */ public class TowerGeist extends CardImpl { - public TowerGeist(UUID ownerId) { - super(ownerId, 53, "Tower Geist", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{3}{U}"); - this.expansionSetCode = "DKA"; - this.subtype.add("Spirit"); + public TowerGeist(UUID ownerId) { + super(ownerId, 53, "Tower Geist", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{3}{U}"); + this.expansionSetCode = "DKA"; + this.subtype.add("Spirit"); - this.color.setBlue(true); - this.power = new MageInt(2); - this.toughness = new MageInt(2); + this.color.setBlue(true); + this.power = new MageInt(2); + this.toughness = new MageInt(2); - // Flying - this.addAbility(FlyingAbility.getInstance()); - - // When Tower Geist enters the battlefield, look at the top two cards of your library. Put one of them into your hand and the other into your graveyard. - this.addAbility(new EntersBattlefieldTriggeredAbility( - new LookLibraryAndPickControllerEffect(new StaticValue(2), false, new StaticValue(1), new FilterCard(), Zone.GRAVEYARD, false, false))); - } + // Flying + this.addAbility(FlyingAbility.getInstance()); - public TowerGeist(final TowerGeist card) { - super(card); - } + // When Tower Geist enters the battlefield, look at the top two cards of your library. Put one of them into your hand and the other into your graveyard. + this.addAbility(new EntersBattlefieldTriggeredAbility( + new LookLibraryAndPickControllerEffect(new StaticValue(2), false, new StaticValue(1), new FilterCard(), Zone.GRAVEYARD, false, false))); + } - @Override - public TowerGeist copy() { - return new TowerGeist(this); - } + public TowerGeist(final TowerGeist card) { + super(card); + } + + @Override + public TowerGeist copy() { + return new TowerGeist(this); + } } diff --git a/Mage.Sets/src/mage/sets/darkascension/WardenOfTheWall.java b/Mage.Sets/src/mage/sets/darkascension/WardenOfTheWall.java index ff7005d3dd..f7f586d2ab 100644 --- a/Mage.Sets/src/mage/sets/darkascension/WardenOfTheWall.java +++ b/Mage.Sets/src/mage/sets/darkascension/WardenOfTheWall.java @@ -54,10 +54,10 @@ public class WardenOfTheWall extends CardImpl { // Warden of the Wall enters the battlefield tapped. this.addAbility(new EntersBattlefieldTappedAbility()); - + // {tap}: Add {1} to your mana pool. 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(Constants.Zone.BATTLEFIELD, new ConditionalContinousEffect(new BecomesCreatureSourceEffect(new GargoyleToken(), "", Constants.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"))); } @@ -74,14 +74,14 @@ public class WardenOfTheWall extends CardImpl { class GargoyleToken extends Token { - public GargoyleToken() { - super("", "2/3 Gargoyle artifact creature with flying"); - cardType.add(CardType.CREATURE); + public GargoyleToken() { + super("", "2/3 Gargoyle artifact creature with flying"); + cardType.add(CardType.CREATURE); cardType.add(CardType.ARTIFACT); - subtype.add("Gargoyle"); - power = new MageInt(2); - toughness = new MageInt(3); - addAbility(FlyingAbility.getInstance()); - } + subtype.add("Gargoyle"); + power = new MageInt(2); + toughness = new MageInt(3); + addAbility(FlyingAbility.getInstance()); + } } diff --git a/Mage.Sets/src/mage/sets/darkascension/WerewolfRansacker.java b/Mage.Sets/src/mage/sets/darkascension/WerewolfRansacker.java index 3e04acfd9d..500d86e935 100644 --- a/Mage.Sets/src/mage/sets/darkascension/WerewolfRansacker.java +++ b/Mage.Sets/src/mage/sets/darkascension/WerewolfRansacker.java @@ -50,7 +50,7 @@ public class WerewolfRansacker extends CardImpl { super(ownerId, 81, "Werewolf Ransacker", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, ""); this.expansionSetCode = "DKA"; this.subtype.add("Werewolf"); - + // this card is the second face of double-faced card this.nightCard = true; this.canTransform = true; @@ -59,7 +59,7 @@ public class WerewolfRansacker extends CardImpl { this.toughness = new MageInt(4); // Whenever this creature transforms into Werewolf Ransacker, you may destroy target artifact. If that artifact is put into a graveyard this way, Werewolf Ransacker deals 3 damage to that artifact's controller. - + // 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), Constants.TargetController.ANY, false); this.addAbility(new ConditionalTriggeredAbility(ability, TwoOrMoreSpellsWereCastLastTurnCondition.getInstance(), TransformAbility.TWO_OR_MORE_SPELLS_TRANSFORM_RULE)); diff --git a/Mage.Sets/src/mage/sets/darkascension/WithengarUnbound.java b/Mage.Sets/src/mage/sets/darkascension/WithengarUnbound.java index 14c99053a7..389d2f8d27 100644 --- a/Mage.Sets/src/mage/sets/darkascension/WithengarUnbound.java +++ b/Mage.Sets/src/mage/sets/darkascension/WithengarUnbound.java @@ -66,7 +66,7 @@ public class WithengarUnbound extends CardImpl { this.addAbility(TrampleAbility.getInstance()); // Whenever a player loses the game, put thirteen +1/+1 counters on Withengar Unbound. this.addAbility(new WithengarUnboundTriggeredAbility()); - + } public WithengarUnbound(final WithengarUnbound card) { diff --git a/Mage.Sets/src/mage/sets/darkascension/ZombieApocalypse.java b/Mage.Sets/src/mage/sets/darkascension/ZombieApocalypse.java index cca573d9a4..db3acadfb3 100644 --- a/Mage.Sets/src/mage/sets/darkascension/ZombieApocalypse.java +++ b/Mage.Sets/src/mage/sets/darkascension/ZombieApocalypse.java @@ -69,10 +69,10 @@ public class ZombieApocalypse extends CardImpl { } class ZombieApocalypseEffect extends OneShotEffect { - + private static final FilterCreatureCard filterZombie = new FilterCreatureCard(); private static final FilterCreaturePermanent filterHuman = new FilterCreaturePermanent(); - + static { filterZombie.getSubtype().add("Zombie"); filterZombie.setScopeSubtype(Filter.ComparisonScope.Any); diff --git a/Mage.Sets/src/mage/sets/darksteel/AngelsFeather.java b/Mage.Sets/src/mage/sets/darksteel/AngelsFeather.java index 0a1d159034..0f052b2b3e 100644 --- a/Mage.Sets/src/mage/sets/darksteel/AngelsFeather.java +++ b/Mage.Sets/src/mage/sets/darksteel/AngelsFeather.java @@ -38,19 +38,19 @@ import java.util.UUID; public class AngelsFeather extends mage.sets.tenth.AngelsFeather { - public AngelsFeather(UUID ownerId) { - super(ownerId); + public AngelsFeather(UUID ownerId) { + super(ownerId); this.cardNumber = 92; - this.expansionSetCode = "DST"; - } + this.expansionSetCode = "DST"; + } - public AngelsFeather(final AngelsFeather card) { - super(card); - } + public AngelsFeather(final AngelsFeather card) { + super(card); + } - @Override - public AngelsFeather copy() { - return new AngelsFeather(this); - } + @Override + public AngelsFeather copy() { + return new AngelsFeather(this); + } } diff --git a/Mage.Sets/src/mage/sets/darksteel/EssenceDrain.java b/Mage.Sets/src/mage/sets/darksteel/EssenceDrain.java index 9daacc0100..b4a4df3495 100644 --- a/Mage.Sets/src/mage/sets/darksteel/EssenceDrain.java +++ b/Mage.Sets/src/mage/sets/darksteel/EssenceDrain.java @@ -45,7 +45,7 @@ public class EssenceDrain extends CardImpl { public EssenceDrain (UUID ownerId) { super(ownerId, 43, "Essence Drain", Rarity.COMMON, new CardType[]{CardType.SORCERY}, "{4}{B}"); this.expansionSetCode = "DST"; - this.color.setBlack(true); + this.color.setBlack(true); this.getSpellAbility().addEffect(new DamageTargetEffect(3)); this.getSpellAbility().addTarget(new TargetCreatureOrPlayer()); this.getSpellAbility().addEffect(new GainLifeEffect(3)); diff --git a/Mage.Sets/src/mage/sets/darksteel/LastWord.java b/Mage.Sets/src/mage/sets/darksteel/LastWord.java index e87b952e30..a4b4b02c7d 100644 --- a/Mage.Sets/src/mage/sets/darksteel/LastWord.java +++ b/Mage.Sets/src/mage/sets/darksteel/LastWord.java @@ -45,7 +45,7 @@ public class LastWord extends CardImpl { public LastWord (UUID ownerId) { super(ownerId, 23, "Last Word", Rarity.RARE, new CardType[]{CardType.INSTANT}, "{2}{U}{U}"); this.expansionSetCode = "DST"; - this.color.setBlue(true); + this.color.setBlue(true); this.addAbility(new CantCounterAbility()); this.getSpellAbility().addEffect(new CounterTargetEffect()); this.getSpellAbility().addTarget(new TargetSpell()); diff --git a/Mage.Sets/src/mage/sets/darksteel/MyrMatrix.java b/Mage.Sets/src/mage/sets/darksteel/MyrMatrix.java index 055f184320..2027412da2 100644 --- a/Mage.Sets/src/mage/sets/darksteel/MyrMatrix.java +++ b/Mage.Sets/src/mage/sets/darksteel/MyrMatrix.java @@ -63,7 +63,7 @@ public class MyrMatrix extends CardImpl { this.addAbility(IndestructibleAbility.getInstance()); this.addAbility(new SimpleStaticAbility(Constants.Zone.BATTLEFIELD, new BoostAllEffect(1, 1, Constants.Duration.WhileOnBattlefield, filter, false))); this.addAbility(new SimpleActivatedAbility(Constants.Zone.BATTLEFIELD, new CreateTokenEffect(new MyrToken()), new GenericManaCost(5))); - + } public MyrMatrix (final MyrMatrix card) { diff --git a/Mage.Sets/src/mage/sets/darksteel/Nourish.java b/Mage.Sets/src/mage/sets/darksteel/Nourish.java index 794db58523..f7786465e9 100644 --- a/Mage.Sets/src/mage/sets/darksteel/Nourish.java +++ b/Mage.Sets/src/mage/sets/darksteel/Nourish.java @@ -43,7 +43,7 @@ public class Nourish extends CardImpl { public Nourish (UUID ownerId) { super(ownerId, 78, "Nourish", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{G}{G}"); this.expansionSetCode = "DST"; - this.color.setGreen(true); + this.color.setGreen(true); this.getSpellAbility().addEffect(new GainLifeEffect(6)); } diff --git a/Mage.Sets/src/mage/sets/darksteel/Soulscour.java b/Mage.Sets/src/mage/sets/darksteel/Soulscour.java index 7b09cb8da9..184b161553 100644 --- a/Mage.Sets/src/mage/sets/darksteel/Soulscour.java +++ b/Mage.Sets/src/mage/sets/darksteel/Soulscour.java @@ -50,7 +50,7 @@ public class Soulscour extends CardImpl { public Soulscour (UUID ownerId) { super(ownerId, 14, "Soulscour", Rarity.RARE, new CardType[]{CardType.SORCERY}, "{7}{W}{W}{W}"); this.expansionSetCode = "DST"; - this.color.setWhite(true); + this.color.setWhite(true); this.getSpellAbility().addEffect(new SoulscourEffect()); } diff --git a/Mage.Sets/src/mage/sets/dissension/FlaringFlameKin.java b/Mage.Sets/src/mage/sets/dissension/FlaringFlameKin.java index 810631acee..87f1b7e17c 100644 --- a/Mage.Sets/src/mage/sets/dissension/FlaringFlameKin.java +++ b/Mage.Sets/src/mage/sets/dissension/FlaringFlameKin.java @@ -66,7 +66,7 @@ public class FlaringFlameKin extends CardImpl { SimpleActivatedAbility grantedAbility = new SimpleActivatedAbility(Zone.BATTLEFIELD, new BoostSourceEffect(1, 0, Duration.EndOfTurn), new ManaCostsImpl("{R}")); - + ConditionalContinousEffect effect1 = new ConditionalContinousEffect(new BoostSourceEffect(2, 2, Duration.WhileOnBattlefield), EnchantedCondition.getInstance(), rule1); this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, effect1)); ConditionalContinousEffect effect2 = new ConditionalContinousEffect(new GainAbilitySourceEffect(TrampleAbility.getInstance()), EnchantedCondition.getInstance(), rule2); diff --git a/Mage.Sets/src/mage/sets/dissension/RakdosPitDragon.java b/Mage.Sets/src/mage/sets/dissension/RakdosPitDragon.java index 5eed6d542b..5d47091efa 100644 --- a/Mage.Sets/src/mage/sets/dissension/RakdosPitDragon.java +++ b/Mage.Sets/src/mage/sets/dissension/RakdosPitDragon.java @@ -56,7 +56,7 @@ public class RakdosPitDragon extends CardImpl { super(ownerId, 69, "Rakdos Pit Dragon", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{2}{R}{R}"); this.expansionSetCode = "DIS"; this.subtype.add("Dragon"); - this.color.setRed(true); + this.color.setRed(true); this.power = new MageInt(3); this.toughness = new MageInt(3); this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new GainAbilitySourceEffect(FlyingAbility.getInstance(), Duration.EndOfTurn), new ManaCostsImpl("{R}{R}"))); diff --git a/Mage.Sets/src/mage/sets/dissension/RiotSpikes.java b/Mage.Sets/src/mage/sets/dissension/RiotSpikes.java index f5c9f6b6cb..72b7096d38 100644 --- a/Mage.Sets/src/mage/sets/dissension/RiotSpikes.java +++ b/Mage.Sets/src/mage/sets/dissension/RiotSpikes.java @@ -54,11 +54,11 @@ public class RiotSpikes extends CardImpl { this.color.setRed(true); this.color.setBlack(true); TargetPermanent auraTarget = new TargetCreaturePermanent(); - this.getSpellAbility().addTarget(auraTarget); - this.getSpellAbility().addEffect(new AttachEffect(Constants.Outcome.BoostCreature)); - Ability ability = new EnchantAbility(auraTarget.getTargetName()); - this.addAbility(ability); - this.addAbility(new SimpleStaticAbility(Constants.Zone.BATTLEFIELD, new BoostEnchantedEffect(2, -1, Constants.Duration.WhileOnBattlefield))); + this.getSpellAbility().addTarget(auraTarget); + this.getSpellAbility().addEffect(new AttachEffect(Constants.Outcome.BoostCreature)); + Ability ability = new EnchantAbility(auraTarget.getTargetName()); + this.addAbility(ability); + this.addAbility(new SimpleStaticAbility(Constants.Zone.BATTLEFIELD, new BoostEnchantedEffect(2, -1, Constants.Duration.WhileOnBattlefield))); } public RiotSpikes(final RiotSpikes card) { diff --git a/Mage.Sets/src/mage/sets/elspethvstezzeret/BurrentonBombardier.java b/Mage.Sets/src/mage/sets/elspethvstezzeret/BurrentonBombardier.java index 109fd19f66..fec0693742 100644 --- a/Mage.Sets/src/mage/sets/elspethvstezzeret/BurrentonBombardier.java +++ b/Mage.Sets/src/mage/sets/elspethvstezzeret/BurrentonBombardier.java @@ -48,7 +48,7 @@ public class BurrentonBombardier extends CardImpl { this.expansionSetCode = "DDF"; this.subtype.add("Kithkin"); this.subtype.add("Soldier"); - this.color.setWhite(true); + this.color.setWhite(true); this.power = new MageInt(2); this.toughness = new MageInt(2); this.addAbility(FlyingAbility.getInstance()); diff --git a/Mage.Sets/src/mage/sets/elspethvstezzeret/EverflowingChalice.java b/Mage.Sets/src/mage/sets/elspethvstezzeret/EverflowingChalice.java index 3b4338c46c..2ee49b7c44 100644 --- a/Mage.Sets/src/mage/sets/elspethvstezzeret/EverflowingChalice.java +++ b/Mage.Sets/src/mage/sets/elspethvstezzeret/EverflowingChalice.java @@ -38,7 +38,7 @@ public class EverflowingChalice extends mage.sets.worldwake.EverflowingChalice { public EverflowingChalice (UUID ownerId) { super(ownerId); - this.cardNumber = 60; + this.cardNumber = 60; this.expansionSetCode = "DDF"; } diff --git a/Mage.Sets/src/mage/sets/elspethvstezzeret/GoldmeadowHarrier.java b/Mage.Sets/src/mage/sets/elspethvstezzeret/GoldmeadowHarrier.java index b3fbb9ccc8..3a73c04019 100644 --- a/Mage.Sets/src/mage/sets/elspethvstezzeret/GoldmeadowHarrier.java +++ b/Mage.Sets/src/mage/sets/elspethvstezzeret/GoldmeadowHarrier.java @@ -53,7 +53,7 @@ public class GoldmeadowHarrier extends CardImpl { this.expansionSetCode = "DDF"; this.subtype.add("Kithkin"); this.subtype.add("Soldier"); - this.color.setWhite(true); + this.color.setWhite(true); this.power = new MageInt(1); this.toughness = new MageInt(1); Ability ability = new SimpleActivatedAbility(Constants.Zone.BATTLEFIELD, new TapTargetEffect(), new ManaCostsImpl("{W}")); diff --git a/Mage.Sets/src/mage/sets/elspethvstezzeret/MosquitoGuard.java b/Mage.Sets/src/mage/sets/elspethvstezzeret/MosquitoGuard.java index fd5e1b8626..e046680197 100644 --- a/Mage.Sets/src/mage/sets/elspethvstezzeret/MosquitoGuard.java +++ b/Mage.Sets/src/mage/sets/elspethvstezzeret/MosquitoGuard.java @@ -48,7 +48,7 @@ public class MosquitoGuard extends CardImpl { this.expansionSetCode = "DDF"; this.subtype.add("Kithkin"); this.subtype.add("Soldier"); - this.color.setWhite(true); + this.color.setWhite(true); this.power = new MageInt(1); this.toughness = new MageInt(1); this.addAbility(FirstStrikeAbility.getInstance()); diff --git a/Mage.Sets/src/mage/sets/elspethvstezzeret/TempleAcolyte.java b/Mage.Sets/src/mage/sets/elspethvstezzeret/TempleAcolyte.java index 082b478cf6..e646fabd2c 100644 --- a/Mage.Sets/src/mage/sets/elspethvstezzeret/TempleAcolyte.java +++ b/Mage.Sets/src/mage/sets/elspethvstezzeret/TempleAcolyte.java @@ -47,7 +47,7 @@ public class TempleAcolyte extends CardImpl { this.expansionSetCode = "DDF"; this.subtype.add("Human"); this.subtype.add("Cleric"); - this.color.setWhite(true); + this.color.setWhite(true); this.power = new MageInt(1); this.toughness = new MageInt(3); this.addAbility(new EntersBattlefieldTriggeredAbility(new GainLifeEffect(3))); diff --git a/Mage.Sets/src/mage/sets/elspethvstezzeret/TrinketMage.java b/Mage.Sets/src/mage/sets/elspethvstezzeret/TrinketMage.java index 287944909f..38c2de6515 100644 --- a/Mage.Sets/src/mage/sets/elspethvstezzeret/TrinketMage.java +++ b/Mage.Sets/src/mage/sets/elspethvstezzeret/TrinketMage.java @@ -40,9 +40,9 @@ public class TrinketMage extends mage.sets.scarsofmirrodin.TrinketMage { public TrinketMage (UUID ownerId) { super(ownerId); this.expansionSetCode = "DDF"; - this.cardNumber = 49; + this.cardNumber = 49; this.rarity = Rarity.COMMON; - } + } public TrinketMage (final TrinketMage card) { super(card); diff --git a/Mage.Sets/src/mage/sets/eventide/AshlingTheExtinguisher.java b/Mage.Sets/src/mage/sets/eventide/AshlingTheExtinguisher.java index 576da1526b..1f71411203 100644 --- a/Mage.Sets/src/mage/sets/eventide/AshlingTheExtinguisher.java +++ b/Mage.Sets/src/mage/sets/eventide/AshlingTheExtinguisher.java @@ -56,7 +56,7 @@ public class AshlingTheExtinguisher extends CardImpl { this.supertype.add("Legendary"); this.subtype.add("Elemental"); this.subtype.add("Shaman"); - this.color.setBlack(true); + this.color.setBlack(true); this.power = new MageInt(4); this.toughness = new MageInt(4); this.addAbility(new AshlingTheExtinguisherTriggeredAbility()); diff --git a/Mage.Sets/src/mage/sets/eventide/CinderPyromancer.java b/Mage.Sets/src/mage/sets/eventide/CinderPyromancer.java index ae56f871c6..43a06a1407 100644 --- a/Mage.Sets/src/mage/sets/eventide/CinderPyromancer.java +++ b/Mage.Sets/src/mage/sets/eventide/CinderPyromancer.java @@ -60,7 +60,7 @@ public class CinderPyromancer extends CardImpl { this.expansionSetCode = "EVE"; this.subtype.add("Elemental"); this.subtype.add("Shaman"); - this.color.setRed(true); + this.color.setRed(true); this.power = new MageInt(0); this.toughness = new MageInt(1); Ability ability = new SimpleActivatedAbility(Constants.Zone.BATTLEFIELD, new DamageTargetEffect(1), new TapSourceCost()); diff --git a/Mage.Sets/src/mage/sets/eventide/RecumbentBliss.java b/Mage.Sets/src/mage/sets/eventide/RecumbentBliss.java index dcaa351063..1499cb2eec 100644 --- a/Mage.Sets/src/mage/sets/eventide/RecumbentBliss.java +++ b/Mage.Sets/src/mage/sets/eventide/RecumbentBliss.java @@ -56,12 +56,12 @@ public class RecumbentBliss extends CardImpl { this.expansionSetCode = "EVE"; this.subtype.add("Aura"); this.color.setWhite(true); - TargetPermanent auraTarget = new TargetCreaturePermanent(); - this.getSpellAbility().addTarget(auraTarget); - this.getSpellAbility().addEffect(new AttachEffect(Constants.Outcome.Detriment)); - Ability ability = new EnchantAbility(auraTarget.getTargetName()); - this.addAbility(ability); - this.addAbility(new SimpleStaticAbility(Constants.Zone.BATTLEFIELD, new RecumbentBlissEffect())); + TargetPermanent auraTarget = new TargetCreaturePermanent(); + this.getSpellAbility().addTarget(auraTarget); + this.getSpellAbility().addEffect(new AttachEffect(Constants.Outcome.Detriment)); + Ability ability = new EnchantAbility(auraTarget.getTargetName()); + this.addAbility(ability); + this.addAbility(new SimpleStaticAbility(Constants.Zone.BATTLEFIELD, new RecumbentBlissEffect())); this.addAbility(new BeginningOfUpkeepTriggeredAbility(new GainLifeEffect(1), Constants.TargetController.YOU, true)); } @@ -77,37 +77,37 @@ public class RecumbentBliss extends CardImpl { class RecumbentBlissEffect extends RestrictionEffect { - public RecumbentBlissEffect() { - super(Constants.Duration.WhileOnBattlefield); - staticText = "Enchanted creature can't attack or block"; - } + public RecumbentBlissEffect() { + super(Constants.Duration.WhileOnBattlefield); + staticText = "Enchanted creature can't attack or block"; + } - public RecumbentBlissEffect(final RecumbentBlissEffect effect) { - super(effect); - } + public RecumbentBlissEffect(final RecumbentBlissEffect effect) { + super(effect); + } - @Override - public boolean applies(Permanent permanent, Ability source, Game game) { - if (permanent.getAttachments().contains((source.getSourceId()))) { - return true; - } - return false; - } + @Override + public boolean applies(Permanent permanent, Ability source, Game game) { + if (permanent.getAttachments().contains((source.getSourceId()))) { + return true; + } + return false; + } - @Override - public boolean canAttack(Game game) { - return false; - } + @Override + public boolean canAttack(Game game) { + return false; + } - @Override - public boolean canBlock(Permanent attacker, Permanent blocker, Ability source, Game game) { - return false; - } + @Override + public boolean canBlock(Permanent attacker, Permanent blocker, Ability source, Game game) { + return false; + } - @Override - public RecumbentBlissEffect copy() { - return new RecumbentBlissEffect(this); - } + @Override + public RecumbentBlissEffect copy() { + return new RecumbentBlissEffect(this); + } } diff --git a/Mage.Sets/src/mage/sets/eventide/SmolderingButcher.java b/Mage.Sets/src/mage/sets/eventide/SmolderingButcher.java index 9253d36c28..6fe0074aee 100644 --- a/Mage.Sets/src/mage/sets/eventide/SmolderingButcher.java +++ b/Mage.Sets/src/mage/sets/eventide/SmolderingButcher.java @@ -46,7 +46,7 @@ public class SmolderingButcher extends CardImpl { this.expansionSetCode = "EVE"; this.subtype.add("Elemental"); this.subtype.add("Warrior"); - this.color.setBlack(true); + this.color.setBlack(true); this.power = new MageInt(4); this.toughness = new MageInt(2); this.addAbility(WitherAbility.getInstance()); diff --git a/Mage.Sets/src/mage/sets/eventide/SoulSnuffers.java b/Mage.Sets/src/mage/sets/eventide/SoulSnuffers.java index 7529792ddc..d3b10ff3b3 100644 --- a/Mage.Sets/src/mage/sets/eventide/SoulSnuffers.java +++ b/Mage.Sets/src/mage/sets/eventide/SoulSnuffers.java @@ -49,7 +49,7 @@ public class SoulSnuffers extends CardImpl { this.expansionSetCode = "EVE"; this.subtype.add("Elemental"); this.subtype.add("Shaman"); - this.color.setBlack(true); + this.color.setBlack(true); this.power = new MageInt(3); this.toughness = new MageInt(3); this.addAbility(new EntersBattlefieldTriggeredAbility(new AddCountersAllEffect(CounterType.M1M1.createInstance(), new FilterCreaturePermanent()))); diff --git a/Mage.Sets/src/mage/sets/eventide/WistfulSelkie.java b/Mage.Sets/src/mage/sets/eventide/WistfulSelkie.java index 48af1db09a..6b824bbb0f 100644 --- a/Mage.Sets/src/mage/sets/eventide/WistfulSelkie.java +++ b/Mage.Sets/src/mage/sets/eventide/WistfulSelkie.java @@ -47,8 +47,8 @@ public class WistfulSelkie extends CardImpl { this.expansionSetCode = "EVE"; this.subtype.add("Merfolk"); this.subtype.add("Wizard"); - this.color.setGreen(true); - this.color.setBlue(true); + this.color.setGreen(true); + this.color.setBlue(true); this.power = new MageInt(2); this.toughness = new MageInt(2); this.addAbility(new EntersBattlefieldTriggeredAbility(new DrawCardControllerEffect(1))); diff --git a/Mage.Sets/src/mage/sets/fifthedition/ColossusOfSardia.java b/Mage.Sets/src/mage/sets/fifthedition/ColossusOfSardia.java index e1d62e9a99..17108cbf7b 100644 --- a/Mage.Sets/src/mage/sets/fifthedition/ColossusOfSardia.java +++ b/Mage.Sets/src/mage/sets/fifthedition/ColossusOfSardia.java @@ -59,10 +59,10 @@ public class ColossusOfSardia extends CardImpl { // Trample this.addAbility(TrampleAbility.getInstance()); - + // Colossus of Sardia doesn't untap during your untap step. this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new SkipUntapSourceEffect())); - + // {9}: Untap Colossus of Sardia. Activate this ability only during your upkeep. Ability ability = new SimpleActivatedAbility(Constants.Zone.BATTLEFIELD, new UntapSourceEffect(), new ManaCostsImpl("{9}")); ability.addCost(new OnlyDuringUpkeepCost()); diff --git a/Mage.Sets/src/mage/sets/fifthedition/Millstone.java b/Mage.Sets/src/mage/sets/fifthedition/Millstone.java index 17e80381b6..5c8862c8b1 100644 --- a/Mage.Sets/src/mage/sets/fifthedition/Millstone.java +++ b/Mage.Sets/src/mage/sets/fifthedition/Millstone.java @@ -71,20 +71,20 @@ public class Millstone extends CardImpl { } class MillstoneEffect extends OneShotEffect { - + int count = 0; - + public MillstoneEffect(final MillstoneEffect effect) { super(effect); this.count = effect.count; } - + public MillstoneEffect(final int count) { super(Constants.Outcome.Detriment); this.count = count; this.staticText = "Target player puts the top " + count + " cards of his or her library into his or her graveyard"; } - + @Override public boolean apply(Game game, Ability source) { Player targetPlayer = game.getPlayer(source.getFirstTarget()); @@ -101,7 +101,7 @@ class MillstoneEffect extends OneShotEffect { } return false; } - + @Override public MillstoneEffect copy() { return new MillstoneEffect(this); diff --git a/Mage.Sets/src/mage/sets/futuresight/WitchsMist.java b/Mage.Sets/src/mage/sets/futuresight/WitchsMist.java index 0121f91cf6..cdeba01977 100644 --- a/Mage.Sets/src/mage/sets/futuresight/WitchsMist.java +++ b/Mage.Sets/src/mage/sets/futuresight/WitchsMist.java @@ -51,7 +51,7 @@ public class WitchsMist extends CardImpl { filter.setUseDamageDealt(true); filter.setDamageDealt(true); } - + public WitchsMist(UUID ownerId) { super(ownerId, 92, "Witch's Mist", Rarity.UNCOMMON, new CardType[]{CardType.ENCHANTMENT}, "{2}{B}"); this.expansionSetCode = "FUT"; diff --git a/Mage.Sets/src/mage/sets/guildpact/AngelOfDespair.java b/Mage.Sets/src/mage/sets/guildpact/AngelOfDespair.java index 28e58abccf..6f1b286e3e 100644 --- a/Mage.Sets/src/mage/sets/guildpact/AngelOfDespair.java +++ b/Mage.Sets/src/mage/sets/guildpact/AngelOfDespair.java @@ -49,8 +49,8 @@ public class AngelOfDespair extends CardImpl { super(ownerId, 101, "Angel of Despair", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{3}{W}{W}{B}{B}"); this.expansionSetCode = "GPT"; this.subtype.add("Angel"); - this.color.setWhite(true); - this.color.setBlack(true); + this.color.setWhite(true); + this.color.setBlack(true); this.power = new MageInt(5); this.toughness = new MageInt(5); this.addAbility(FlyingAbility.getInstance()); diff --git a/Mage.Sets/src/mage/sets/guildpact/BurningTreeShaman.java b/Mage.Sets/src/mage/sets/guildpact/BurningTreeShaman.java index fb855189db..67b8674f88 100644 --- a/Mage.Sets/src/mage/sets/guildpact/BurningTreeShaman.java +++ b/Mage.Sets/src/mage/sets/guildpact/BurningTreeShaman.java @@ -54,8 +54,8 @@ public class BurningTreeShaman extends CardImpl { this.expansionSetCode = "GPT"; this.subtype.add("Centaur"); this.subtype.add("Shaman"); - this.color.setRed(true); - this.color.setGreen(true); + this.color.setRed(true); + this.color.setGreen(true); this.power = new MageInt(3); this.toughness = new MageInt(4); this.addAbility(new BurningTreeShamanTriggeredAbility()); diff --git a/Mage.Sets/src/mage/sets/guildpact/CrystalSeer.java b/Mage.Sets/src/mage/sets/guildpact/CrystalSeer.java index 88e984600e..77621e4bb4 100644 --- a/Mage.Sets/src/mage/sets/guildpact/CrystalSeer.java +++ b/Mage.Sets/src/mage/sets/guildpact/CrystalSeer.java @@ -55,7 +55,7 @@ public class CrystalSeer extends CardImpl { this.color.setBlue(true); this.power = new MageInt(2); this.toughness = new MageInt(2); - + // When Crystal Seer enters the battlefield, look at the top four cards of your library, then put them back in any order. this.addAbility(new EntersBattlefieldTriggeredAbility(new LookLibraryControllerEffect(4))); diff --git a/Mage.Sets/src/mage/sets/guildpact/DaggerclawImp.java b/Mage.Sets/src/mage/sets/guildpact/DaggerclawImp.java index 22fafa83f1..645897d9c6 100644 --- a/Mage.Sets/src/mage/sets/guildpact/DaggerclawImp.java +++ b/Mage.Sets/src/mage/sets/guildpact/DaggerclawImp.java @@ -46,7 +46,7 @@ public class DaggerclawImp extends CardImpl { super(ownerId, 48, "Daggerclaw Imp", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{2}{B}"); this.expansionSetCode = "GPT"; this.subtype.add("Imp"); - this.color.setBlack(true); + this.color.setBlack(true); this.power = new MageInt(3); this.toughness = new MageInt(1); this.addAbility(FlyingAbility.getInstance()); diff --git a/Mage.Sets/src/mage/sets/guildpact/GhostCouncilOfOrzhova.java b/Mage.Sets/src/mage/sets/guildpact/GhostCouncilOfOrzhova.java index 836a6c8f3f..6954dc39e1 100644 --- a/Mage.Sets/src/mage/sets/guildpact/GhostCouncilOfOrzhova.java +++ b/Mage.Sets/src/mage/sets/guildpact/GhostCouncilOfOrzhova.java @@ -60,8 +60,8 @@ public class GhostCouncilOfOrzhova extends CardImpl { this.expansionSetCode = "GPT"; this.supertype.add("Legendary"); this.subtype.add("Spirit"); - this.color.setWhite(true); - this.color.setBlack(true); + this.color.setWhite(true); + this.color.setBlack(true); this.power = new MageInt(4); this.toughness = new MageInt(4); Ability ability = new EntersBattlefieldTriggeredAbility(new GhostCouncilOfOrzhovaEffect()); @@ -113,37 +113,37 @@ class GhostCouncilOfOrzhovaEffect extends OneShotEffect { - private static final String effectText = "Exile {this}. Return it to the battlefield under its owner's control at the beginning of the next end step"; + private static final String effectText = "Exile {this}. Return it to the battlefield under its owner's control at the beginning of the next end step"; - GhostCouncilOfOrzhovaRemovingEffect () { - super(Outcome.Benefit); - staticText = effectText; - } + GhostCouncilOfOrzhovaRemovingEffect () { + super(Outcome.Benefit); + staticText = effectText; + } - GhostCouncilOfOrzhovaRemovingEffect(GhostCouncilOfOrzhovaRemovingEffect effect) { - super(effect); - } + GhostCouncilOfOrzhovaRemovingEffect(GhostCouncilOfOrzhovaRemovingEffect effect) { + super(effect); + } - @Override - public boolean apply(Game game, Ability source) { - Permanent permanent = game.getPermanent(source.getSourceId()); - if (permanent != null) { - if (permanent.moveToExile(source.getSourceId(), " Ghost Council of Orzhova Exile", source.getId(), game)) { - //create delayed triggered ability - AtEndOfTurnDelayedTriggeredAbility delayedAbility = new AtEndOfTurnDelayedTriggeredAbility( - new ReturnFromExileEffect(source.getSourceId(), Zone.BATTLEFIELD)); - delayedAbility.setSourceId(source.getSourceId()); - delayedAbility.setControllerId(source.getControllerId()); - game.addDelayedTriggeredAbility(delayedAbility); - return true; - } - } - return false; - } + @Override + public boolean apply(Game game, Ability source) { + Permanent permanent = game.getPermanent(source.getSourceId()); + if (permanent != null) { + if (permanent.moveToExile(source.getSourceId(), " Ghost Council of Orzhova Exile", source.getId(), game)) { + //create delayed triggered ability + AtEndOfTurnDelayedTriggeredAbility delayedAbility = new AtEndOfTurnDelayedTriggeredAbility( + new ReturnFromExileEffect(source.getSourceId(), Zone.BATTLEFIELD)); + delayedAbility.setSourceId(source.getSourceId()); + delayedAbility.setControllerId(source.getControllerId()); + game.addDelayedTriggeredAbility(delayedAbility); + return true; + } + } + return false; + } - @Override - public GhostCouncilOfOrzhovaRemovingEffect copy() { - return new GhostCouncilOfOrzhovaRemovingEffect(this); - } + @Override + public GhostCouncilOfOrzhovaRemovingEffect copy() { + return new GhostCouncilOfOrzhovaRemovingEffect(this); + } } diff --git a/Mage.Sets/src/mage/sets/guildpact/HatchingPlans.java b/Mage.Sets/src/mage/sets/guildpact/HatchingPlans.java index 3999833c19..0622c951ec 100644 --- a/Mage.Sets/src/mage/sets/guildpact/HatchingPlans.java +++ b/Mage.Sets/src/mage/sets/guildpact/HatchingPlans.java @@ -44,7 +44,7 @@ public class HatchingPlans extends CardImpl { public HatchingPlans (UUID ownerId) { super(ownerId, 27, "Hatching Plans", Rarity.RARE, new CardType[]{CardType.ENCHANTMENT}, "{1}{U}"); this.expansionSetCode = "GPT"; - this.color.setBlue(true); + this.color.setBlue(true); this.addAbility(new DiesTriggeredAbility(new DrawCardControllerEffect(3))); } diff --git a/Mage.Sets/src/mage/sets/guildpact/HypervoltGrasp.java b/Mage.Sets/src/mage/sets/guildpact/HypervoltGrasp.java index d6f4ed92f9..3340bcb3d7 100644 --- a/Mage.Sets/src/mage/sets/guildpact/HypervoltGrasp.java +++ b/Mage.Sets/src/mage/sets/guildpact/HypervoltGrasp.java @@ -58,10 +58,10 @@ public class HypervoltGrasp extends CardImpl { this.subtype.add("Aura"); this.color.setRed(true); TargetPermanent auraTarget = new TargetCreaturePermanent(); - this.getSpellAbility().addTarget(auraTarget); - this.getSpellAbility().addEffect(new AttachEffect(Constants.Outcome.BoostCreature)); - Ability ability = new EnchantAbility(auraTarget.getTargetName()); - this.addAbility(ability); + this.getSpellAbility().addTarget(auraTarget); + this.getSpellAbility().addEffect(new AttachEffect(Constants.Outcome.BoostCreature)); + Ability ability = new EnchantAbility(auraTarget.getTargetName()); + this.addAbility(ability); Ability gainedAbility = new SimpleActivatedAbility(Constants.Zone.BATTLEFIELD, new DamageTargetEffect(1), new TapSourceCost()); gainedAbility.addTarget(new TargetCreatureOrPlayer()); this.addAbility(new SimpleStaticAbility(Constants.Zone.BATTLEFIELD, new GainAbilityAttachedEffect(gainedAbility, Constants.AttachmentType.AURA))); diff --git a/Mage.Sets/src/mage/sets/guildpact/ShadowLance.java b/Mage.Sets/src/mage/sets/guildpact/ShadowLance.java index 7ae9093ad6..2ed29431a3 100644 --- a/Mage.Sets/src/mage/sets/guildpact/ShadowLance.java +++ b/Mage.Sets/src/mage/sets/guildpact/ShadowLance.java @@ -59,10 +59,10 @@ public class ShadowLance extends CardImpl { this.color.setWhite(true); TargetPermanent auraTarget = new TargetCreaturePermanent(); - this.getSpellAbility().addTarget(auraTarget); - this.getSpellAbility().addEffect(new AttachEffect(Constants.Outcome.BoostCreature)); - Ability ability = new EnchantAbility(auraTarget.getTargetName()); - this.addAbility(ability); + this.getSpellAbility().addTarget(auraTarget); + this.getSpellAbility().addEffect(new AttachEffect(Constants.Outcome.BoostCreature)); + Ability ability = new EnchantAbility(auraTarget.getTargetName()); + this.addAbility(ability); this.addAbility(new SimpleStaticAbility(Constants.Zone.BATTLEFIELD, new GainAbilityAttachedEffect(FirstStrikeAbility.getInstance(), Constants.AttachmentType.AURA))); this.addAbility(new SimpleActivatedAbility(Constants.Zone.BATTLEFIELD, new BoostEquippedEffect(2, 2, Constants.Duration.EndOfTurn), new ManaCostsImpl("{1}{B}"))); } diff --git a/Mage.Sets/src/mage/sets/guildpact/TiborAndLumia.java b/Mage.Sets/src/mage/sets/guildpact/TiborAndLumia.java index 2ec151d8b1..2942d7d979 100644 --- a/Mage.Sets/src/mage/sets/guildpact/TiborAndLumia.java +++ b/Mage.Sets/src/mage/sets/guildpact/TiborAndLumia.java @@ -60,7 +60,7 @@ public class TiborAndLumia extends CardImpl { filterRed.setUseColor(true); filterRed.getColor().setRed(true); } - + public TiborAndLumia(UUID ownerId) { super(ownerId, 135, "Tibor and Lumia", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{2}{U}{R}"); this.expansionSetCode = "GPT"; diff --git a/Mage.Sets/src/mage/sets/guildpact/TorchDrake.java b/Mage.Sets/src/mage/sets/guildpact/TorchDrake.java index 5fe869f11b..ff68d7cb54 100644 --- a/Mage.Sets/src/mage/sets/guildpact/TorchDrake.java +++ b/Mage.Sets/src/mage/sets/guildpact/TorchDrake.java @@ -51,7 +51,7 @@ public class TorchDrake extends CardImpl { super(ownerId, 38, "Torch Drake", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{3}{U}"); this.expansionSetCode = "GPT"; this.subtype.add("Drake"); - this.color.setBlue(true); + this.color.setBlue(true); this.power = new MageInt(2); this.toughness = new MageInt(2); this.addAbility(FlyingAbility.getInstance()); diff --git a/Mage.Sets/src/mage/sets/guildpact/WurmweaverCoil.java b/Mage.Sets/src/mage/sets/guildpact/WurmweaverCoil.java index ab5236c5e7..95b5da8a96 100644 --- a/Mage.Sets/src/mage/sets/guildpact/WurmweaverCoil.java +++ b/Mage.Sets/src/mage/sets/guildpact/WurmweaverCoil.java @@ -67,11 +67,11 @@ public class WurmweaverCoil extends CardImpl { this.subtype.add("Aura"); this.color.setGreen(true); TargetPermanent auraTarget = new TargetCreaturePermanent(filter); - this.getSpellAbility().addTarget(auraTarget); - this.getSpellAbility().addEffect(new AttachEffect(Constants.Outcome.Benefit)); - Ability ability = new EnchantAbility(auraTarget.getTargetName()); - this.addAbility(ability); - this.addAbility(new SimpleStaticAbility(Constants.Zone.BATTLEFIELD, new BoostEnchantedEffect(6, 6, Constants.Duration.WhileOnBattlefield))); + this.getSpellAbility().addTarget(auraTarget); + this.getSpellAbility().addEffect(new AttachEffect(Constants.Outcome.Benefit)); + Ability ability = new EnchantAbility(auraTarget.getTargetName()); + this.addAbility(ability); + this.addAbility(new SimpleStaticAbility(Constants.Zone.BATTLEFIELD, new BoostEnchantedEffect(6, 6, Constants.Duration.WhileOnBattlefield))); Ability activatedAbility = new SimpleActivatedAbility(Constants.Zone.BATTLEFIELD, new CreateTokenEffect(new WurmweaverCoilToken(), 1), new ManaCostsImpl("{G}{G}{G}")); activatedAbility.addCost(new SacrificeSourceCost()); this.addAbility(activatedAbility); diff --git a/Mage.Sets/src/mage/sets/guru/Forest.java b/Mage.Sets/src/mage/sets/guru/Forest.java index 1b147f6cdf..f376d10ebf 100644 --- a/Mage.Sets/src/mage/sets/guru/Forest.java +++ b/Mage.Sets/src/mage/sets/guru/Forest.java @@ -36,16 +36,16 @@ import java.util.UUID; public class Forest extends mage.cards.basiclands.Forest { public Forest(UUID ownerId) { - super(ownerId, 1); - this.expansionSetCode = "GUR"; - } + super(ownerId, 1); + this.expansionSetCode = "GUR"; + } - public Forest(final Forest card) { - super(card); - } + public Forest(final Forest card) { + super(card); + } - @Override - public Forest copy() { - return new Forest(this); - } + @Override + public Forest copy() { + return new Forest(this); + } } diff --git a/Mage.Sets/src/mage/sets/guru/Island.java b/Mage.Sets/src/mage/sets/guru/Island.java index a7d31eeb44..8636c94427 100644 --- a/Mage.Sets/src/mage/sets/guru/Island.java +++ b/Mage.Sets/src/mage/sets/guru/Island.java @@ -36,18 +36,18 @@ import java.util.UUID; */ public class Island extends mage.cards.basiclands.Island { - public Island(UUID ownerId) { - super(ownerId, 2); - this.expansionSetCode = "GUR"; - } + public Island(UUID ownerId) { + super(ownerId, 2); + this.expansionSetCode = "GUR"; + } - public Island(final Island card) { - super(card); - } + public Island(final Island card) { + super(card); + } - @Override - public Island copy() { - return new Island(this); - } + @Override + public Island copy() { + return new Island(this); + } } diff --git a/Mage.Sets/src/mage/sets/guru/Mountain.java b/Mage.Sets/src/mage/sets/guru/Mountain.java index 5fcc376db2..dab0670184 100644 --- a/Mage.Sets/src/mage/sets/guru/Mountain.java +++ b/Mage.Sets/src/mage/sets/guru/Mountain.java @@ -36,19 +36,19 @@ import java.util.UUID; */ public class Mountain extends mage.cards.basiclands.Mountain { - public Mountain(UUID ownerId) { - super(ownerId, 3); - this.expansionSetCode = "GUR"; - } + public Mountain(UUID ownerId) { + super(ownerId, 3); + this.expansionSetCode = "GUR"; + } - public Mountain(final Mountain card) { - super(card); - } + public Mountain(final Mountain card) { + super(card); + } - @Override - public Mountain copy() { - return new Mountain(this); - } + @Override + public Mountain copy() { + return new Mountain(this); + } } diff --git a/Mage.Sets/src/mage/sets/guru/Plains.java b/Mage.Sets/src/mage/sets/guru/Plains.java index 6e6ae23bca..6f0d7226c3 100644 --- a/Mage.Sets/src/mage/sets/guru/Plains.java +++ b/Mage.Sets/src/mage/sets/guru/Plains.java @@ -36,18 +36,18 @@ import java.util.UUID; */ public class Plains extends mage.cards.basiclands.Plains { - public Plains(UUID ownerId) { - super(ownerId, 4); - this.expansionSetCode = "GUR"; - } + public Plains(UUID ownerId) { + super(ownerId, 4); + this.expansionSetCode = "GUR"; + } - public Plains(final Plains card) { - super(card); - } + public Plains(final Plains card) { + super(card); + } - @Override - public Plains copy() { - return new Plains(this); - } + @Override + public Plains copy() { + return new Plains(this); + } } diff --git a/Mage.Sets/src/mage/sets/guru/Swamp.java b/Mage.Sets/src/mage/sets/guru/Swamp.java index 104defe513..f2a90ba395 100644 --- a/Mage.Sets/src/mage/sets/guru/Swamp.java +++ b/Mage.Sets/src/mage/sets/guru/Swamp.java @@ -36,18 +36,18 @@ import java.util.UUID; */ public class Swamp extends mage.cards.basiclands.Swamp { - public Swamp(UUID ownerId) { - super(ownerId, 5); - this.expansionSetCode = "GUR"; - } + public Swamp(UUID ownerId) { + super(ownerId, 5); + this.expansionSetCode = "GUR"; + } - public Swamp(final Swamp card) { - super(card); - } + public Swamp(final Swamp card) { + super(card); + } - @Override - public Swamp copy() { - return new Swamp(this); - } + @Override + public Swamp copy() { + return new Swamp(this); + } } diff --git a/Mage.Sets/src/mage/sets/innistrad/AbattoirGhoul.java b/Mage.Sets/src/mage/sets/innistrad/AbattoirGhoul.java index a3c5430d37..07001e58f9 100644 --- a/Mage.Sets/src/mage/sets/innistrad/AbattoirGhoul.java +++ b/Mage.Sets/src/mage/sets/innistrad/AbattoirGhoul.java @@ -66,7 +66,7 @@ public class AbattoirGhoul extends CardImpl { this.addAbility(FirstStrikeAbility.getInstance()); // Whenever a creature dealt damage by Abattoir Ghoul this turn dies, you gain life equal to that creature's toughness. AbattoirGhoulEffect effect = new AbattoirGhoulEffect(); - + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, effect)); this.addWatcher(new DamagedByWatcher()); } @@ -83,48 +83,48 @@ public class AbattoirGhoul extends CardImpl { class AbattoirGhoulEffect extends ReplacementEffectImpl { - public AbattoirGhoulEffect() { - super(Duration.EndOfTurn, Outcome.GainLife); - staticText = "Whenever a creature dealt damage by Abattoir Ghoul this turn dies, you gain life equal to that creature's toughness"; - } + public AbattoirGhoulEffect() { + super(Duration.EndOfTurn, Outcome.GainLife); + staticText = "Whenever a creature dealt damage by Abattoir Ghoul this turn dies, you gain life equal to that creature's toughness"; + } - public AbattoirGhoulEffect(final AbattoirGhoulEffect effect) { - super(effect); - } + public AbattoirGhoulEffect(final AbattoirGhoulEffect effect) { + super(effect); + } - @Override - public AbattoirGhoulEffect copy() { - return new AbattoirGhoulEffect(this); - } + @Override + public AbattoirGhoulEffect copy() { + return new AbattoirGhoulEffect(this); + } - @Override - public boolean apply(Game game, Ability source) { - return true; - } + @Override + public boolean apply(Game game, Ability source) { + return true; + } - @Override - public boolean replaceEvent(GameEvent event, Ability source, Game game) { + @Override + public boolean replaceEvent(GameEvent event, Ability source, Game game) { Permanent permanent = ((ZoneChangeEvent)event).getTarget(); if (permanent != null) { - MageInt toughness = permanent.getToughness(); - Player player = (Player)this.getValue("player"); - player.gainLife(toughness.getValue(), game); + MageInt toughness = permanent.getToughness(); + Player player = (Player)this.getValue("player"); + player.gainLife(toughness.getValue(), game); return true; } - return false; - } + return false; + } - @Override - public boolean applies(GameEvent event, Ability source, Game game) { - if (event.getType() == EventType.ZONE_CHANGE && ((ZoneChangeEvent)event).isDiesEvent()) { + @Override + public boolean applies(GameEvent event, Ability source, Game game) { + if (event.getType() == EventType.ZONE_CHANGE && ((ZoneChangeEvent)event).isDiesEvent()) { Permanent p = game.getPermanent(source.getSourceId()); if (p != null) { DamagedByWatcher watcher = (DamagedByWatcher) game.getState().getWatchers().get("DamagedByWatcher", source.getSourceId()); if (watcher != null) return watcher.damagedCreatures.contains(event.getTargetId()); } - } - return false; - } + } + return false; + } } diff --git a/Mage.Sets/src/mage/sets/innistrad/AbbeyGriffin.java b/Mage.Sets/src/mage/sets/innistrad/AbbeyGriffin.java index 6bf92157ba..4a0fc7a539 100644 --- a/Mage.Sets/src/mage/sets/innistrad/AbbeyGriffin.java +++ b/Mage.Sets/src/mage/sets/innistrad/AbbeyGriffin.java @@ -42,25 +42,25 @@ import mage.cards.CardImpl; */ public class AbbeyGriffin extends CardImpl { - public AbbeyGriffin(UUID ownerId) { - super(ownerId, 1, "Abbey Griffin", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{3}{W}"); - this.expansionSetCode = "ISD"; - this.subtype.add("Griffin"); - this.color.setWhite(true); - this.power = new MageInt(2); - this.toughness = new MageInt(2); + public AbbeyGriffin(UUID ownerId) { + super(ownerId, 1, "Abbey Griffin", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{3}{W}"); + this.expansionSetCode = "ISD"; + this.subtype.add("Griffin"); + this.color.setWhite(true); + this.power = new MageInt(2); + this.toughness = new MageInt(2); - this.addAbility(FlyingAbility.getInstance()); - this.addAbility(VigilanceAbility.getInstance()); - } + this.addAbility(FlyingAbility.getInstance()); + this.addAbility(VigilanceAbility.getInstance()); + } - public AbbeyGriffin(final AbbeyGriffin card) { - super(card); - } + public AbbeyGriffin(final AbbeyGriffin card) { + super(card); + } - @Override - public AbbeyGriffin copy() { - return new AbbeyGriffin(this); - } + @Override + public AbbeyGriffin copy() { + return new AbbeyGriffin(this); + } } diff --git a/Mage.Sets/src/mage/sets/innistrad/AngelOfFlightAlabaster.java b/Mage.Sets/src/mage/sets/innistrad/AngelOfFlightAlabaster.java index 635011639a..9fef330bc9 100644 --- a/Mage.Sets/src/mage/sets/innistrad/AngelOfFlightAlabaster.java +++ b/Mage.Sets/src/mage/sets/innistrad/AngelOfFlightAlabaster.java @@ -25,10 +25,10 @@ public class AngelOfFlightAlabaster extends CardImpl { public AngelOfFlightAlabaster(UUID ownerId) { super(ownerId, 2, "Angel of Flight Alabaster", Constants.Rarity.RARE, new Constants.CardType[]{Constants.CardType.CREATURE}, "{4}{W}"); this.expansionSetCode = "ISD"; - this.subtype.add("Angel"); - this.color.setWhite(true); - this.power = new MageInt(4); - this.toughness = new MageInt(4); + this.subtype.add("Angel"); + this.color.setWhite(true); + this.power = new MageInt(4); + this.toughness = new MageInt(4); this.addAbility(FlyingAbility.getInstance()); Ability ability = new BeginningOfUpkeepTriggeredAbility(new ReturnToHandTargetEffect(), Constants.TargetController.YOU, false); diff --git a/Mage.Sets/src/mage/sets/innistrad/AvacynsPilgrim.java b/Mage.Sets/src/mage/sets/innistrad/AvacynsPilgrim.java index d3d516b0c2..cd46d92424 100644 --- a/Mage.Sets/src/mage/sets/innistrad/AvacynsPilgrim.java +++ b/Mage.Sets/src/mage/sets/innistrad/AvacynsPilgrim.java @@ -41,24 +41,24 @@ import java.util.UUID; */ public class AvacynsPilgrim extends CardImpl { - public AvacynsPilgrim(UUID ownerId) { - super(ownerId, 170, "Avacyn's Pilgrim", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{G}"); - this.expansionSetCode = "ISD"; - this.subtype.add("Human"); - this.subtype.add("Monk"); - this.color.setGreen(true); - this.power = new MageInt(1); - this.toughness = new MageInt(1); - this.addAbility(new WhiteManaAbility()); - } + public AvacynsPilgrim(UUID ownerId) { + super(ownerId, 170, "Avacyn's Pilgrim", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{G}"); + this.expansionSetCode = "ISD"; + this.subtype.add("Human"); + this.subtype.add("Monk"); + this.color.setGreen(true); + this.power = new MageInt(1); + this.toughness = new MageInt(1); + this.addAbility(new WhiteManaAbility()); + } - public AvacynsPilgrim(final AvacynsPilgrim card) { - super(card); - } + public AvacynsPilgrim(final AvacynsPilgrim card) { + super(card); + } - @Override - public AvacynsPilgrim copy() { - return new AvacynsPilgrim(this); - } + @Override + public AvacynsPilgrim copy() { + return new AvacynsPilgrim(this); + } } diff --git a/Mage.Sets/src/mage/sets/innistrad/BackFromTheBrink.java b/Mage.Sets/src/mage/sets/innistrad/BackFromTheBrink.java index 7dd3ccd2cc..d4ec8036f1 100644 --- a/Mage.Sets/src/mage/sets/innistrad/BackFromTheBrink.java +++ b/Mage.Sets/src/mage/sets/innistrad/BackFromTheBrink.java @@ -61,7 +61,7 @@ public class BackFromTheBrink extends CardImpl { // Exile a creature card from your graveyard and pay its mana cost: Put a token onto the battlefield that's a copy of that card. Activate this ability only any time you could cast a sorcery. this.addAbility(new ActivateAsSorceryActivatedAbility(Zone.BATTLEFIELD, new BackFromTheBrinkEffect(), new BackFromTheBrinkCost())); - + } public BackFromTheBrink(final BackFromTheBrink card) { @@ -80,11 +80,11 @@ class BackFromTheBrinkEffect extends OneShotEffect { super(Outcome.PutCreatureInPlay); staticText = "Put a token onto the battlefield that's a copy of that card. Activate this ability only any time you could cast a sorcery"; } - + public BackFromTheBrinkEffect(final BackFromTheBrinkEffect effect) { super(effect); } - + @Override public boolean apply(Game game, Ability source) { Card card = game.getCard(this.targetPointer.getFirst(game, source)); @@ -101,7 +101,7 @@ class BackFromTheBrinkEffect extends OneShotEffect { public BackFromTheBrinkEffect copy() { return new BackFromTheBrinkEffect(this); } - + } class BackFromTheBrinkCost extends CostImpl { @@ -110,11 +110,11 @@ class BackFromTheBrinkCost extends CostImpl { this.addTarget(new TargetCardInYourGraveyard(new FilterCreatureCard("creature card from your graveyard"))); this.text = "Exile a creature card from your graveyard and pay its mana cost"; } - + public BackFromTheBrinkCost(final BackFromTheBrinkCost cost) { super(cost); } - + @Override public BackFromTheBrinkCost copy() { return new BackFromTheBrinkCost(this); @@ -139,5 +139,5 @@ class BackFromTheBrinkCost extends CostImpl { } return paid; } - + } \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/innistrad/BalefireDragon.java b/Mage.Sets/src/mage/sets/innistrad/BalefireDragon.java index 966e4d9aea..9910eec4a5 100644 --- a/Mage.Sets/src/mage/sets/innistrad/BalefireDragon.java +++ b/Mage.Sets/src/mage/sets/innistrad/BalefireDragon.java @@ -59,8 +59,8 @@ public class BalefireDragon extends CardImpl { this.addAbility(FlyingAbility.getInstance()); // Whenever Balefire Dragon deals combat damage to a player, it deals that much damage to each creature that player controls. - this.addAbility(new DealsCombatDamageToAPlayerTriggeredAbility(new BalefireDragonEffect(), false, true)); - + this.addAbility(new DealsCombatDamageToAPlayerTriggeredAbility(new BalefireDragonEffect(), false, true)); + } public BalefireDragon(final BalefireDragon card) { @@ -75,33 +75,33 @@ public class BalefireDragon extends CardImpl { class BalefireDragonEffect extends OneShotEffect { - public BalefireDragonEffect() { - super(Outcome.Damage); - staticText = "it deals that much damage to each creature that player controls"; - } + public BalefireDragonEffect() { + super(Outcome.Damage); + staticText = "it deals that much damage to each creature that player controls"; + } - public BalefireDragonEffect(final BalefireDragonEffect effect) { - super(effect); - } + public BalefireDragonEffect(final BalefireDragonEffect effect) { + super(effect); + } - @Override - public boolean apply(Game game, Ability source) { - Player player = game.getPlayer(targetPointer.getFirst(game, source)); - if (player != null) { + @Override + public boolean apply(Game game, Ability source) { + Player player = game.getPlayer(targetPointer.getFirst(game, source)); + if (player != null) { int amount = (Integer)getValue("damage"); if (amount > 0) { for (Permanent creature: game.getBattlefield().getAllActivePermanents(new FilterCreaturePermanent(), player.getId(), game)) { creature.damage(amount, source.getSourceId(), game, true, false); } } - return true; - } - return false; - } + return true; + } + return false; + } - @Override - public BalefireDragonEffect copy() { - return new BalefireDragonEffect(this); - } + @Override + public BalefireDragonEffect copy() { + return new BalefireDragonEffect(this); + } } \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/innistrad/BattlegroundGeist.java b/Mage.Sets/src/mage/sets/innistrad/BattlegroundGeist.java index 5e3462f00b..276c1d0fac 100644 --- a/Mage.Sets/src/mage/sets/innistrad/BattlegroundGeist.java +++ b/Mage.Sets/src/mage/sets/innistrad/BattlegroundGeist.java @@ -45,34 +45,34 @@ import java.util.UUID; */ public class BattlegroundGeist extends CardImpl { - private final static FilterCreaturePermanent filter = new FilterCreaturePermanent("Spirit creatures"); + private final static FilterCreaturePermanent filter = new FilterCreaturePermanent("Spirit creatures"); - static { - filter.getSubtype().add("Spirit"); - filter.setScopeSubtype(Filter.ComparisonScope.Any); - } + static { + filter.getSubtype().add("Spirit"); + filter.setScopeSubtype(Filter.ComparisonScope.Any); + } - public BattlegroundGeist(UUID ownerId) { - super(ownerId, 45, "Battleground Geist", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{4}{U}"); - this.expansionSetCode = "ISD"; - this.subtype.add("Spirit"); + public BattlegroundGeist(UUID ownerId) { + super(ownerId, 45, "Battleground Geist", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{4}{U}"); + this.expansionSetCode = "ISD"; + this.subtype.add("Spirit"); - this.color.setBlue(true); - this.power = new MageInt(3); - this.toughness = new MageInt(3); + this.color.setBlue(true); + this.power = new MageInt(3); + this.toughness = new MageInt(3); - this.addAbility(FlyingAbility.getInstance()); + this.addAbility(FlyingAbility.getInstance()); - // Other Spirit creatures you control get +1/+0. - this.addAbility(new SimpleStaticAbility(Constants.Zone.BATTLEFIELD, new BoostControlledEffect(1, 0, Constants.Duration.WhileOnBattlefield, filter, true))); - } + // Other Spirit creatures you control get +1/+0. + this.addAbility(new SimpleStaticAbility(Constants.Zone.BATTLEFIELD, new BoostControlledEffect(1, 0, Constants.Duration.WhileOnBattlefield, filter, true))); + } - public BattlegroundGeist(final BattlegroundGeist card) { - super(card); - } + public BattlegroundGeist(final BattlegroundGeist card) { + super(card); + } - @Override - public BattlegroundGeist copy() { - return new BattlegroundGeist(this); - } + @Override + public BattlegroundGeist copy() { + return new BattlegroundGeist(this); + } } diff --git a/Mage.Sets/src/mage/sets/innistrad/BitterheartWitch.java b/Mage.Sets/src/mage/sets/innistrad/BitterheartWitch.java index e25072a17e..454703c382 100644 --- a/Mage.Sets/src/mage/sets/innistrad/BitterheartWitch.java +++ b/Mage.Sets/src/mage/sets/innistrad/BitterheartWitch.java @@ -63,12 +63,12 @@ public class BitterheartWitch extends CardImpl { this.toughness = new MageInt(2); this.addAbility(DeathtouchAbility.getInstance()); - + // When Bitterheart Witch dies, you may search your library for a Curse card, put it onto the battlefield attached to target player, then shuffle your library. Ability ability = new DiesTriggeredAbility(new BitterheartWitchEffect(), true); ability.addTarget(new TargetPlayer()); this.addAbility(ability); - + } public BitterheartWitch(final BitterheartWitch card) { @@ -84,11 +84,11 @@ public class BitterheartWitch extends CardImpl { class BitterheartWitchEffect extends OneShotEffect { private final static FilterCard filter = new FilterCard("Curse card in your library"); - + static { filter.getSubtype().add("Curse"); } - + public BitterheartWitchEffect() { super(Outcome.Detriment); staticText = "you may search your library for a Curse card, put it onto the battlefield attached to target player, then shuffle your library"; diff --git a/Mage.Sets/src/mage/sets/innistrad/BloodlineKeeper.java b/Mage.Sets/src/mage/sets/innistrad/BloodlineKeeper.java index f4b6b9e01d..e9dfbc7f36 100644 --- a/Mage.Sets/src/mage/sets/innistrad/BloodlineKeeper.java +++ b/Mage.Sets/src/mage/sets/innistrad/BloodlineKeeper.java @@ -122,7 +122,7 @@ class ControlFiveVampiresCost extends CostImpl { @Override public boolean pay(Ability ability, Game game, UUID sourceId, UUID controllerId, boolean noMana) { this.paid = true; - return paid; + return paid; } @Override diff --git a/Mage.Sets/src/mage/sets/innistrad/BoneyardWurm.java b/Mage.Sets/src/mage/sets/innistrad/BoneyardWurm.java index ae6d827ebd..536fcbed36 100644 --- a/Mage.Sets/src/mage/sets/innistrad/BoneyardWurm.java +++ b/Mage.Sets/src/mage/sets/innistrad/BoneyardWurm.java @@ -45,23 +45,23 @@ import java.util.UUID; */ public class BoneyardWurm extends CardImpl { - public BoneyardWurm(UUID ownerId) { - super(ownerId, 171, "Boneyard Wurm", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{1}{G}"); - this.expansionSetCode = "ISD"; - this.subtype.add("Wurm"); - this.color.setGreen(true); + public BoneyardWurm(UUID ownerId) { + super(ownerId, 171, "Boneyard Wurm", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{1}{G}"); + this.expansionSetCode = "ISD"; + this.subtype.add("Wurm"); + this.color.setGreen(true); - // Boneyard Wurm's power and toughness are each equal to the number of creature cards in your graveyard. - DynamicValue value = new CardsInControllerGraveyardCount(new FilterCreatureCard()); - this.addAbility(new SimpleStaticAbility(Zone.ALL, new SetPowerToughnessSourceEffect(value, Constants.Duration.EndOfGame))); - } + // Boneyard Wurm's power and toughness are each equal to the number of creature cards in your graveyard. + DynamicValue value = new CardsInControllerGraveyardCount(new FilterCreatureCard()); + this.addAbility(new SimpleStaticAbility(Zone.ALL, new SetPowerToughnessSourceEffect(value, Constants.Duration.EndOfGame))); + } - public BoneyardWurm(final BoneyardWurm card) { - super(card); - } + public BoneyardWurm(final BoneyardWurm card) { + super(card); + } - @Override - public BoneyardWurm copy() { - return new BoneyardWurm(this); - } + @Override + public BoneyardWurm copy() { + return new BoneyardWurm(this); + } } diff --git a/Mage.Sets/src/mage/sets/innistrad/BrimstoneVolley.java b/Mage.Sets/src/mage/sets/innistrad/BrimstoneVolley.java index 95e822f638..f843c6759b 100644 --- a/Mage.Sets/src/mage/sets/innistrad/BrimstoneVolley.java +++ b/Mage.Sets/src/mage/sets/innistrad/BrimstoneVolley.java @@ -46,62 +46,62 @@ import java.util.UUID; */ public class BrimstoneVolley extends CardImpl { - public BrimstoneVolley(UUID ownerId) { - super(ownerId, 132, "Brimstone Volley", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{2}{R}"); - this.expansionSetCode = "ISD"; + public BrimstoneVolley(UUID ownerId) { + super(ownerId, 132, "Brimstone Volley", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{2}{R}"); + this.expansionSetCode = "ISD"; - this.color.setRed(true); + this.color.setRed(true); - // Brimstone Volley deals 3 damage to target creature or player. - // Morbid - Brimstone Volley deals 5 damage to that creature or player instead if a creature died this turn. - this.getSpellAbility().addEffect(new BrimstoneVolleyEffect()); - this.getSpellAbility().addTarget(new TargetCreatureOrPlayer()); - } + // Brimstone Volley deals 3 damage to target creature or player. + // Morbid - Brimstone Volley deals 5 damage to that creature or player instead if a creature died this turn. + this.getSpellAbility().addEffect(new BrimstoneVolleyEffect()); + this.getSpellAbility().addTarget(new TargetCreatureOrPlayer()); + } - public BrimstoneVolley(final BrimstoneVolley card) { - super(card); - } + public BrimstoneVolley(final BrimstoneVolley card) { + super(card); + } - @Override - public BrimstoneVolley copy() { - return new BrimstoneVolley(this); - } + @Override + public BrimstoneVolley copy() { + return new BrimstoneVolley(this); + } } class BrimstoneVolleyEffect extends OneShotEffect { - public BrimstoneVolleyEffect() { - super(Constants.Outcome.Damage); - staticText = "{this} deals 3 damage to target creature or player.\n Morbid - {this} deals 5 damage to that creature or player instead if a creature died this turn"; - } + public BrimstoneVolleyEffect() { + super(Constants.Outcome.Damage); + staticText = "{this} deals 3 damage to target creature or player.\n Morbid - {this} deals 5 damage to that creature or player instead if a creature died this turn"; + } - public BrimstoneVolleyEffect(final BrimstoneVolleyEffect effect) { - super(effect); - } + public BrimstoneVolleyEffect(final BrimstoneVolleyEffect effect) { + super(effect); + } - @Override - public boolean apply(Game game, Ability source) { - int damage = 3; - Watcher watcher = game.getState().getWatchers().get("Morbid"); - if (watcher.conditionMet()) { - damage = 5; - } - Permanent permanent = game.getPermanent(targetPointer.getFirst(game, source)); - if (permanent != null) { - permanent.damage(damage, source.getSourceId(), game, true, false); - return true; - } - Player player = game.getPlayer(targetPointer.getFirst(game, source)); - if (player != null) { - player.damage(damage, source.getSourceId(), game, false, true); - return true; - } - return false; - } + @Override + public boolean apply(Game game, Ability source) { + int damage = 3; + Watcher watcher = game.getState().getWatchers().get("Morbid"); + if (watcher.conditionMet()) { + damage = 5; + } + Permanent permanent = game.getPermanent(targetPointer.getFirst(game, source)); + if (permanent != null) { + permanent.damage(damage, source.getSourceId(), game, true, false); + return true; + } + Player player = game.getPlayer(targetPointer.getFirst(game, source)); + if (player != null) { + player.damage(damage, source.getSourceId(), game, false, true); + return true; + } + return false; + } - @Override - public BrimstoneVolleyEffect copy() { - return new BrimstoneVolleyEffect(this); - } + @Override + public BrimstoneVolleyEffect copy() { + return new BrimstoneVolleyEffect(this); + } } diff --git a/Mage.Sets/src/mage/sets/innistrad/ButchersCleaver.java b/Mage.Sets/src/mage/sets/innistrad/ButchersCleaver.java index 0917f1f078..ecb7e730b1 100644 --- a/Mage.Sets/src/mage/sets/innistrad/ButchersCleaver.java +++ b/Mage.Sets/src/mage/sets/innistrad/ButchersCleaver.java @@ -59,7 +59,7 @@ public class ButchersCleaver extends CardImpl { // As long as equipped creature is a Human, it has lifelink. this.addAbility(new SimpleStaticAbility(Constants.Zone.BATTLEFIELD, new ConditionalContinousEffect(new GainAbilityAttachedEffect(LifelinkAbility.getInstance(), Constants.AttachmentType.EQUIPMENT), new EquippedHasSubtypeCondition("Human"), staticText))); - + // Equip {3} this.addAbility(new EquipAbility(Constants.Outcome.AddAbility, new GenericManaCost(3))); diff --git a/Mage.Sets/src/mage/sets/innistrad/ClifftopRetreat.java b/Mage.Sets/src/mage/sets/innistrad/ClifftopRetreat.java index 34120b43b2..547b990c5b 100644 --- a/Mage.Sets/src/mage/sets/innistrad/ClifftopRetreat.java +++ b/Mage.Sets/src/mage/sets/innistrad/ClifftopRetreat.java @@ -49,32 +49,32 @@ import java.util.UUID; */ public class ClifftopRetreat extends CardImpl { - private static final FilterLandPermanent filter = new FilterLandPermanent(); + private static final FilterLandPermanent filter = new FilterLandPermanent(); - static { - filter.getSubtype().add("Mountain"); - filter.getSubtype().add("Plains"); - filter.setScopeSubtype(ComparisonScope.Any); - filter.setMessage("Mountain or a Plains"); - } + static { + filter.getSubtype().add("Mountain"); + filter.getSubtype().add("Plains"); + filter.setScopeSubtype(ComparisonScope.Any); + filter.setMessage("Mountain or a Plains"); + } - public ClifftopRetreat(UUID ownerId) { - super(ownerId, 238, "Clifftop Retreat", Rarity.RARE, new CardType[]{CardType.LAND}, null); - this.expansionSetCode = "ISD"; + public ClifftopRetreat(UUID ownerId) { + super(ownerId, 238, "Clifftop Retreat", Rarity.RARE, new CardType[]{CardType.LAND}, null); + this.expansionSetCode = "ISD"; - Condition controls = new UnlessCondition(new ControlsPermanentCondition(filter, ControlsPermanentCondition.CountType.MORE_THAN, 0)); - String abilityText = "tap it unless you control a " + filter.getMessage(); - this.addAbility(new EntersBattlefieldAbility(new ConditionalOneShotEffect(new TapSourceEffect(), controls, abilityText), abilityText)); - this.addAbility(new RedManaAbility()); - this.addAbility(new WhiteManaAbility()); - } + Condition controls = new UnlessCondition(new ControlsPermanentCondition(filter, ControlsPermanentCondition.CountType.MORE_THAN, 0)); + String abilityText = "tap it unless you control a " + filter.getMessage(); + this.addAbility(new EntersBattlefieldAbility(new ConditionalOneShotEffect(new TapSourceEffect(), controls, abilityText), abilityText)); + this.addAbility(new RedManaAbility()); + this.addAbility(new WhiteManaAbility()); + } - public ClifftopRetreat(final ClifftopRetreat card) { - super(card); - } + public ClifftopRetreat(final ClifftopRetreat card) { + super(card); + } - @Override - public ClifftopRetreat copy() { - return new ClifftopRetreat(this); - } + @Override + public ClifftopRetreat copy() { + return new ClifftopRetreat(this); + } } diff --git a/Mage.Sets/src/mage/sets/innistrad/CreepingRenaissance.java b/Mage.Sets/src/mage/sets/innistrad/CreepingRenaissance.java index 6678426855..6a89b3728f 100644 --- a/Mage.Sets/src/mage/sets/innistrad/CreepingRenaissance.java +++ b/Mage.Sets/src/mage/sets/innistrad/CreepingRenaissance.java @@ -78,14 +78,14 @@ class CreepingRenaissanceEffect extends OneShotEffect super(Constants.Outcome.Detriment); staticText = "Choose a permanent type. Return all cards of the chosen type from your graveyard to your hand"; } - + public CreepingRenaissanceEffect(final CreepingRenaissanceEffect effect) { super(effect); } - + @Override public boolean apply(Game game, Ability source) { - Player controller = game.getPlayer(source.getControllerId()); + Player controller = game.getPlayer(source.getControllerId()); if (controller != null) { Choice typeChoice = new ChoiceImpl(); typeChoice.setMessage("Choose permanent type"); @@ -121,5 +121,5 @@ class CreepingRenaissanceEffect extends OneShotEffect public CreepingRenaissanceEffect copy() { return new CreepingRenaissanceEffect(this); } - + } diff --git a/Mage.Sets/src/mage/sets/innistrad/CurseOfDeathsHold.java b/Mage.Sets/src/mage/sets/innistrad/CurseOfDeathsHold.java index 4f675f325f..3bf52bbd5b 100644 --- a/Mage.Sets/src/mage/sets/innistrad/CurseOfDeathsHold.java +++ b/Mage.Sets/src/mage/sets/innistrad/CurseOfDeathsHold.java @@ -61,7 +61,7 @@ public class CurseOfDeathsHold extends CardImpl { this.getSpellAbility().addTarget(auraTarget); this.getSpellAbility().addEffect(new AttachEffect(Outcome.UnboostCreature)); this.addAbility(new EnchantAbility(auraTarget.getTargetName())); - + // Creatures enchanted player controls get -1/-1. this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new CurseOfDeathsHoldEffect())); } @@ -86,13 +86,13 @@ class CurseOfDeathsHoldEffect extends ContinuousEffectImpl { class CurseOfOblivionAbility extends TriggeredAbilityImpl { - public CurseOfOblivionAbility() { - super(Zone.BATTLEFIELD, new ExileFromZoneTargetEffect(Zone.GRAVEYARD, null, "", new FilterCard(), 2)); - } + public CurseOfOblivionAbility() { + super(Zone.BATTLEFIELD, new ExileFromZoneTargetEffect(Zone.GRAVEYARD, null, "", new FilterCard(), 2)); + } - public CurseOfOblivionAbility(final CurseOfOblivionAbility ability) { - super(ability); - } + public CurseOfOblivionAbility(final CurseOfOblivionAbility ability) { + super(ability); + } - @Override - public CurseOfOblivionAbility copy() { - return new CurseOfOblivionAbility(this); - } + @Override + public CurseOfOblivionAbility copy() { + return new CurseOfOblivionAbility(this); + } - @Override - public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == EventType.UPKEEP_STEP_PRE) { + @Override + public boolean checkTrigger(GameEvent event, Game game) { + if (event.getType() == EventType.UPKEEP_STEP_PRE) { Permanent enchantment = game.getPermanent(this.sourceId); if (enchantment != null && enchantment.getAttachedTo() != null) { Player player = game.getPlayer(enchantment.getAttachedTo()); if (player != null && game.getActivePlayerId().equals(player.getId())) { this.getEffects().get(0).setTargetPointer(new FixedTarget(player.getId())); - return true; + return true; } } - } - return false; - } + } + return false; + } - @Override - public String getRule() { - return "At the beginning of enchanted player's upkeep, that player exiles two cards from his or her graveyard."; - } + @Override + public String getRule() { + return "At the beginning of enchanted player's upkeep, that player exiles two cards from his or her graveyard."; + } } \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/innistrad/CurseOfStalkedPrey.java b/Mage.Sets/src/mage/sets/innistrad/CurseOfStalkedPrey.java index 5f48898a8a..be8105760a 100644 --- a/Mage.Sets/src/mage/sets/innistrad/CurseOfStalkedPrey.java +++ b/Mage.Sets/src/mage/sets/innistrad/CurseOfStalkedPrey.java @@ -64,14 +64,14 @@ public class CurseOfStalkedPrey extends CardImpl { // Enchant player TargetPlayer target = new TargetPlayer(); - this.getSpellAbility().addTarget(target); - this.getSpellAbility().addEffect(new AttachEffect(Constants.Outcome.AddAbility)); - Ability ability = new EnchantAbility(target.getTargetName()); - this.addAbility(ability); + this.getSpellAbility().addTarget(target); + this.getSpellAbility().addEffect(new AttachEffect(Constants.Outcome.AddAbility)); + Ability ability = new EnchantAbility(target.getTargetName()); + this.addAbility(ability); // Whenever a creature deals combat damage to enchanted player, put a +1/+1 counter on that creature. this.addAbility(new CurseOfStalkedPreyTriggeredAbility()); - + } public CurseOfStalkedPrey(final CurseOfStalkedPrey card) { @@ -86,37 +86,37 @@ public class CurseOfStalkedPrey extends CardImpl { class CurseOfStalkedPreyTriggeredAbility extends TriggeredAbilityImpl { - public CurseOfStalkedPreyTriggeredAbility() { - super(Zone.BATTLEFIELD, new AddCountersTargetEffect(CounterType.P1P1.createInstance())); - } + public CurseOfStalkedPreyTriggeredAbility() { + super(Zone.BATTLEFIELD, new AddCountersTargetEffect(CounterType.P1P1.createInstance())); + } - public CurseOfStalkedPreyTriggeredAbility(final CurseOfStalkedPreyTriggeredAbility ability) { - super(ability); - } + public CurseOfStalkedPreyTriggeredAbility(final CurseOfStalkedPreyTriggeredAbility ability) { + super(ability); + } - @Override - public CurseOfStalkedPreyTriggeredAbility copy() { - return new CurseOfStalkedPreyTriggeredAbility(this); - } + @Override + public CurseOfStalkedPreyTriggeredAbility copy() { + return new CurseOfStalkedPreyTriggeredAbility(this); + } - @Override - public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == EventType.DAMAGED_PLAYER && ((DamagedPlayerEvent) event).isCombatDamage()) { + @Override + public boolean checkTrigger(GameEvent event, Game game) { + if (event.getType() == EventType.DAMAGED_PLAYER && ((DamagedPlayerEvent) event).isCombatDamage()) { Permanent enchantment = game.getPermanent(this.sourceId); if (enchantment != null && enchantment.getAttachedTo() != null) { Player player = game.getPlayer(enchantment.getAttachedTo()); if (player != null && event.getTargetId().equals(player.getId())) { getEffects().get(0).setTargetPointer(new FixedTarget(event.getSourceId())); - return true; + return true; } } - } - return false; - } + } + return false; + } - @Override - public String getRule() { - return "Whenever a creature deals combat damage to enchanted player, put a +1/+1 counter on that creature"; - } + @Override + public String getRule() { + return "Whenever a creature deals combat damage to enchanted player, put a +1/+1 counter on that creature"; + } } diff --git a/Mage.Sets/src/mage/sets/innistrad/CurseOfTheBloodyTome.java b/Mage.Sets/src/mage/sets/innistrad/CurseOfTheBloodyTome.java index fd03a1437f..b7ae49eb34 100644 --- a/Mage.Sets/src/mage/sets/innistrad/CurseOfTheBloodyTome.java +++ b/Mage.Sets/src/mage/sets/innistrad/CurseOfTheBloodyTome.java @@ -63,13 +63,13 @@ public class CurseOfTheBloodyTome extends CardImpl { // Enchant player TargetPlayer target = new TargetPlayer(); - this.getSpellAbility().addTarget(target); - this.getSpellAbility().addEffect(new AttachEffect(Constants.Outcome.AddAbility)); - Ability ability = new EnchantAbility(target.getTargetName()); - this.addAbility(ability); + this.getSpellAbility().addTarget(target); + this.getSpellAbility().addEffect(new AttachEffect(Constants.Outcome.AddAbility)); + Ability ability = new EnchantAbility(target.getTargetName()); + this.addAbility(ability); // At the beginning of enchanted player's upkeep, that player puts the top two cards of his or her library into his or her graveyard. - this.addAbility(new CurseOfTheBloodyTomeAbility()); - + this.addAbility(new CurseOfTheBloodyTomeAbility()); + } public CurseOfTheBloodyTome(final CurseOfTheBloodyTome card) { @@ -84,37 +84,37 @@ public class CurseOfTheBloodyTome extends CardImpl { class CurseOfTheBloodyTomeAbility extends TriggeredAbilityImpl { - public CurseOfTheBloodyTomeAbility() { - super(Zone.BATTLEFIELD, new PutLibraryIntoGraveTargetEffect(2)); - } + public CurseOfTheBloodyTomeAbility() { + super(Zone.BATTLEFIELD, new PutLibraryIntoGraveTargetEffect(2)); + } - public CurseOfTheBloodyTomeAbility(final CurseOfTheBloodyTomeAbility ability) { - super(ability); - } + public CurseOfTheBloodyTomeAbility(final CurseOfTheBloodyTomeAbility ability) { + super(ability); + } - @Override - public CurseOfTheBloodyTomeAbility copy() { - return new CurseOfTheBloodyTomeAbility(this); - } + @Override + public CurseOfTheBloodyTomeAbility copy() { + return new CurseOfTheBloodyTomeAbility(this); + } - @Override - public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == EventType.DRAW_STEP_PRE) { + @Override + public boolean checkTrigger(GameEvent event, Game game) { + if (event.getType() == EventType.DRAW_STEP_PRE) { Permanent enchantment = game.getPermanent(this.sourceId); if (enchantment != null && enchantment.getAttachedTo() != null) { Player player = game.getPlayer(enchantment.getAttachedTo()); if (player != null && game.getActivePlayerId().equals(player.getId())) { this.getEffects().get(0).setTargetPointer(new FixedTarget(player.getId())); - return true; + return true; } } - } - return false; - } + } + return false; + } - @Override - public String getRule() { - return "At the beginning of enchanted player's upkeep, that player puts the top two cards of his or her library into his or her graveyard."; - } + @Override + public String getRule() { + return "At the beginning of enchanted player's upkeep, that player puts the top two cards of his or her library into his or her graveyard."; + } } \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/innistrad/CurseOfTheNightlyHunt.java b/Mage.Sets/src/mage/sets/innistrad/CurseOfTheNightlyHunt.java index c97f409170..fbd29adb35 100644 --- a/Mage.Sets/src/mage/sets/innistrad/CurseOfTheNightlyHunt.java +++ b/Mage.Sets/src/mage/sets/innistrad/CurseOfTheNightlyHunt.java @@ -65,7 +65,7 @@ public class CurseOfTheNightlyHunt extends CardImpl { // Creatures enchanted player controls attack each turn if able. this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new CurseOfTheNightlyHuntEffect())); - + } public CurseOfTheNightlyHunt(final CurseOfTheNightlyHunt card) { @@ -80,36 +80,36 @@ public class CurseOfTheNightlyHunt extends CardImpl { class CurseOfTheNightlyHuntEffect extends RequirementEffect { - public CurseOfTheNightlyHuntEffect() { - super(Duration.WhileOnBattlefield); + public CurseOfTheNightlyHuntEffect() { + super(Duration.WhileOnBattlefield); staticText = "Creatures enchanted player controls attack each turn if able"; - } + } - public CurseOfTheNightlyHuntEffect(final CurseOfTheNightlyHuntEffect effect) { - super(effect); - } + public CurseOfTheNightlyHuntEffect(final CurseOfTheNightlyHuntEffect effect) { + super(effect); + } - @Override - public CurseOfTheNightlyHuntEffect copy() { - return new CurseOfTheNightlyHuntEffect(this); - } + @Override + public CurseOfTheNightlyHuntEffect copy() { + return new CurseOfTheNightlyHuntEffect(this); + } - @Override - public boolean applies(Permanent permanent, Ability source, Game game) { - if (source.getControllerId().equals(permanent.getControllerId())) { - return true; - } - return false; - } + @Override + public boolean applies(Permanent permanent, Ability source, Game game) { + if (source.getControllerId().equals(permanent.getControllerId())) { + return true; + } + return false; + } - @Override - public boolean mustAttack(Game game) { - return true; - } + @Override + public boolean mustAttack(Game game) { + return true; + } - @Override - public boolean mustBlock(Game game) { - return false; - } + @Override + public boolean mustBlock(Game game) { + return false; + } } \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/innistrad/CurseOfThePiercedHeart.java b/Mage.Sets/src/mage/sets/innistrad/CurseOfThePiercedHeart.java index 01f9113eed..005a393e3b 100644 --- a/Mage.Sets/src/mage/sets/innistrad/CurseOfThePiercedHeart.java +++ b/Mage.Sets/src/mage/sets/innistrad/CurseOfThePiercedHeart.java @@ -83,37 +83,37 @@ public class CurseOfThePiercedHeart extends CardImpl { class CurseOfThePiercedHeartAbility extends TriggeredAbilityImpl { - public CurseOfThePiercedHeartAbility() { - super(Zone.BATTLEFIELD, new DamageTargetEffect(1)); - } + public CurseOfThePiercedHeartAbility() { + super(Zone.BATTLEFIELD, new DamageTargetEffect(1)); + } - public CurseOfThePiercedHeartAbility(final CurseOfThePiercedHeartAbility ability) { - super(ability); - } + public CurseOfThePiercedHeartAbility(final CurseOfThePiercedHeartAbility ability) { + super(ability); + } - @Override - public CurseOfThePiercedHeartAbility copy() { - return new CurseOfThePiercedHeartAbility(this); - } + @Override + public CurseOfThePiercedHeartAbility copy() { + return new CurseOfThePiercedHeartAbility(this); + } - @Override - public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == EventType.DRAW_STEP_PRE) { + @Override + public boolean checkTrigger(GameEvent event, Game game) { + if (event.getType() == EventType.DRAW_STEP_PRE) { Permanent enchantment = game.getPermanent(this.sourceId); if (enchantment != null && enchantment.getAttachedTo() != null) { Player player = game.getPlayer(enchantment.getAttachedTo()); if (player != null && game.getActivePlayerId().equals(player.getId())) { this.getEffects().get(0).setTargetPointer(new FixedTarget(player.getId())); - return true; + return true; } } - } - return false; - } + } + return false; + } - @Override - public String getRule() { - return "At the beginning of enchanted player's upkeep, Curse of the Pierced Heart deals 1 damage to that player."; - } + @Override + public String getRule() { + return "At the beginning of enchanted player's upkeep, Curse of the Pierced Heart deals 1 damage to that player."; + } } \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/innistrad/DearlyDeparted.java b/Mage.Sets/src/mage/sets/innistrad/DearlyDeparted.java index 1f10f5c105..e2bc697e54 100644 --- a/Mage.Sets/src/mage/sets/innistrad/DearlyDeparted.java +++ b/Mage.Sets/src/mage/sets/innistrad/DearlyDeparted.java @@ -54,7 +54,7 @@ public class DearlyDeparted extends CardImpl { private static final FilterCreaturePermanent filterHuman = new FilterCreaturePermanent("Human creatures"); private static final String ruleText = "As long as Dearly Departed is in your graveyard, each Human creature you control enters the battlefield with an additional +1/+1 counter on it"; - + static { filterHuman.getSubtype().add("Human"); filterHuman.setScopeSubtype(Filter.ComparisonScope.Any); diff --git a/Mage.Sets/src/mage/sets/innistrad/DelverOfSecrets.java b/Mage.Sets/src/mage/sets/innistrad/DelverOfSecrets.java index 21eb6b4257..c7a86c14c1 100644 --- a/Mage.Sets/src/mage/sets/innistrad/DelverOfSecrets.java +++ b/Mage.Sets/src/mage/sets/innistrad/DelverOfSecrets.java @@ -59,7 +59,7 @@ public class DelverOfSecrets extends CardImpl { this.color.setBlue(true); this.power = new MageInt(1); this.toughness = new MageInt(1); - + this.canTransform = true; this.secondSideCard = new InsectileAberration(ownerId); @@ -96,19 +96,19 @@ class DelverOfSecretsAbility extends TriggeredAbilityImpl 0) { + Player player = game.getPlayer(this.controllerId); + if (player != null && player.getLibrary().size() > 0) { Card card = player.getLibrary().getFromTop(game); Cards cards = new CardsImpl(); cards.add(card); player.lookAtCards("This card", cards, game); if (player.chooseUse(Outcome.DrawCard, "Do you wish to reveal the card at the top of the liberary?", game)) { - player.revealCards("Delver of Secrets", cards, game); - if ((card.getCardType().contains(CardType.INSTANT) || card.getCardType().contains(CardType.SORCERY))) { - return true; - } - } + player.revealCards("Delver of Secrets", cards, game); + if ((card.getCardType().contains(CardType.INSTANT) || card.getCardType().contains(CardType.SORCERY))) { + return true; + } + } } } return false; diff --git a/Mage.Sets/src/mage/sets/innistrad/DiregrafGhoul.java b/Mage.Sets/src/mage/sets/innistrad/DiregrafGhoul.java index 9d692fafe3..983e7079ec 100644 --- a/Mage.Sets/src/mage/sets/innistrad/DiregrafGhoul.java +++ b/Mage.Sets/src/mage/sets/innistrad/DiregrafGhoul.java @@ -41,7 +41,7 @@ import mage.cards.CardImpl; */ public class DiregrafGhoul extends CardImpl { - private static final String staticText = "{this} enters the battlefield tapped"; + private static final String staticText = "{this} enters the battlefield tapped"; public DiregrafGhoul(UUID ownerId) { super(ownerId, 97, "Diregraf Ghoul", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{B}"); @@ -53,7 +53,7 @@ public class DiregrafGhoul extends CardImpl { this.toughness = new MageInt(2); // Diregraf Ghoul enters the battlefield tapped. - this.addAbility(new EntersBattlefieldAbility(new TapSourceEffect(), staticText)); + this.addAbility(new EntersBattlefieldAbility(new TapSourceEffect(), staticText)); } public DiregrafGhoul(final DiregrafGhoul card) { diff --git a/Mage.Sets/src/mage/sets/innistrad/EndlessRanksOfTheDead.java b/Mage.Sets/src/mage/sets/innistrad/EndlessRanksOfTheDead.java index 87c3105f33..4cbcb7e729 100644 --- a/Mage.Sets/src/mage/sets/innistrad/EndlessRanksOfTheDead.java +++ b/Mage.Sets/src/mage/sets/innistrad/EndlessRanksOfTheDead.java @@ -71,7 +71,7 @@ class HalfZombiesCount implements DynamicValue { private static HalfZombiesCount instance; private static final FilterCreaturePermanent filter = new FilterCreaturePermanent(); - + static { filter.getSubtype().add("Zombie"); } diff --git a/Mage.Sets/src/mage/sets/innistrad/EssenceOfTheWild.java b/Mage.Sets/src/mage/sets/innistrad/EssenceOfTheWild.java index 03da87f1bd..eaac62921f 100644 --- a/Mage.Sets/src/mage/sets/innistrad/EssenceOfTheWild.java +++ b/Mage.Sets/src/mage/sets/innistrad/EssenceOfTheWild.java @@ -77,33 +77,33 @@ public class EssenceOfTheWild extends CardImpl { class EssenceOfTheWildEffect extends ReplacementEffectImpl { - public EssenceOfTheWildEffect() { - super(Duration.WhileOnBattlefield, Outcome.Copy); + public EssenceOfTheWildEffect() { + super(Duration.WhileOnBattlefield, Outcome.Copy); staticText = "Creatures you control enter the battlefield as a copy of {this}"; - } + } - public EssenceOfTheWildEffect(EssenceOfTheWildEffect effect) { - super(effect); - } + public EssenceOfTheWildEffect(EssenceOfTheWildEffect effect) { + super(effect); + } - @Override - public boolean applies(GameEvent event, Ability source, Game game) { - if (event.getType() == EventType.ENTERS_THE_BATTLEFIELD) { + @Override + public boolean applies(GameEvent event, Ability source, Game game) { + if (event.getType() == EventType.ENTERS_THE_BATTLEFIELD) { Permanent perm = game.getPermanent(event.getTargetId()); if (perm != null && perm.getCardType().contains(CardType.CREATURE) && perm.getControllerId().equals(source.getControllerId())) { - return true; + return true; } - } - return false; - } + } + return false; + } - @Override - public boolean apply(Game game, Ability source) { - return false; - } + @Override + public boolean apply(Game game, Ability source) { + return false; + } - @Override - public boolean replaceEvent(GameEvent event, Ability source, Game game) { + @Override + public boolean replaceEvent(GameEvent event, Ability source, Game game) { Permanent perm = game.getPermanent(source.getSourceId()); if (perm != null) { perm = perm.copy(); @@ -111,13 +111,13 @@ class EssenceOfTheWildEffect extends ReplacementEffectImpl { this.toughness = new MageInt(0); // You may have Evil Twin enter the battlefield as a copy of any creature on the battlefield except it gains "{U}{B}, {T}: Destroy target creature with the same name as this creature. - Ability ability1 = new EntersBattlefieldAbility(new EntersBattlefieldEffect(new CopyPermanentEffect()), "You may have {this} enter the battlefield as a copy of any creature on the battlefield except it gains {U}{B}, {T}: Destroy target creature with the same name as this creature"); + Ability ability1 = new EntersBattlefieldAbility(new EntersBattlefieldEffect(new CopyPermanentEffect()), "You may have {this} enter the battlefield as a copy of any creature on the battlefield except it gains {U}{B}, {T}: Destroy target creature with the same name as this creature"); Ability ability2 = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DestroyTargetEffect(), new ManaCostsImpl("{U}{B}")); ability2.addCost(new TapSourceCost()); ability2.addTarget(new TargetCreaturePermanent(new EvilTwinFilter())); - ability1.addEffect(new GainAbilitySourceEffect(ability2)); - this.addAbility(ability1); + ability1.addEffect(new GainAbilitySourceEffect(ability2)); + this.addAbility(ability1); } public EvilTwin(final EvilTwin card) { @@ -83,23 +83,23 @@ public class EvilTwin extends CardImpl { } class EvilTwinFilter extends FilterCreaturePermanent { - + public EvilTwinFilter() { super("creature with the same name as this creature"); } - + @Override - public boolean match(Permanent permanent, UUID sourceId, UUID playerId, Game game) { - if (!super.match(permanent, game)) - return notFilter; - - Permanent twin = game.getPermanent(sourceId); - if (twin != null) { + public boolean match(Permanent permanent, UUID sourceId, UUID playerId, Game game) { + if (!super.match(permanent, game)) + return notFilter; + + Permanent twin = game.getPermanent(sourceId); + if (twin != null) { if (!permanent.getName().equals(twin.getName())) return false; } - + return !notFilter; } - + } diff --git a/Mage.Sets/src/mage/sets/innistrad/FalkenrathMarauders.java b/Mage.Sets/src/mage/sets/innistrad/FalkenrathMarauders.java index 1e86a0cfb4..ccf4455325 100644 --- a/Mage.Sets/src/mage/sets/innistrad/FalkenrathMarauders.java +++ b/Mage.Sets/src/mage/sets/innistrad/FalkenrathMarauders.java @@ -58,7 +58,7 @@ public class FalkenrathMarauders extends CardImpl { this.addAbility(HasteAbility.getInstance()); // Whenever Falkenrath Marauders deals combat damage to a player, put two +1/+1 counters on it. - this.addAbility(new DealsCombatDamageToAPlayerTriggeredAbility(new AddCountersSourceEffect(CounterType.P1P1.createInstance(2)), false)); + this.addAbility(new DealsCombatDamageToAPlayerTriggeredAbility(new AddCountersSourceEffect(CounterType.P1P1.createInstance(2)), false)); } public FalkenrathMarauders(final FalkenrathMarauders card) { diff --git a/Mage.Sets/src/mage/sets/innistrad/FeralRidgewolf.java b/Mage.Sets/src/mage/sets/innistrad/FeralRidgewolf.java index aec078e680..27b9e48235 100644 --- a/Mage.Sets/src/mage/sets/innistrad/FeralRidgewolf.java +++ b/Mage.Sets/src/mage/sets/innistrad/FeralRidgewolf.java @@ -44,27 +44,27 @@ import mage.cards.CardImpl; */ public class FeralRidgewolf extends CardImpl { - public FeralRidgewolf(UUID ownerId) { - super(ownerId, 142, "Feral Ridgewolf", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{2}{R}"); - this.expansionSetCode = "ISD"; - this.subtype.add("Wolf"); + public FeralRidgewolf(UUID ownerId) { + super(ownerId, 142, "Feral Ridgewolf", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{2}{R}"); + this.expansionSetCode = "ISD"; + this.subtype.add("Wolf"); - this.color.setRed(true); - this.power = new MageInt(1); - this.toughness = new MageInt(2); + this.color.setRed(true); + this.power = new MageInt(1); + this.toughness = new MageInt(2); - this.addAbility(TrampleAbility.getInstance()); + this.addAbility(TrampleAbility.getInstance()); - // {1}{R}: Feral Ridgewolf gets +2/+0 until end of turn. - this.addAbility(new SimpleActivatedAbility(Constants.Zone.BATTLEFIELD, new BoostSourceEffect(2, 0, Constants.Duration.EndOfTurn), new ManaCostsImpl("{1}{R}"))); - } + // {1}{R}: Feral Ridgewolf gets +2/+0 until end of turn. + this.addAbility(new SimpleActivatedAbility(Constants.Zone.BATTLEFIELD, new BoostSourceEffect(2, 0, Constants.Duration.EndOfTurn), new ManaCostsImpl("{1}{R}"))); + } - public FeralRidgewolf(final FeralRidgewolf card) { - super(card); - } + public FeralRidgewolf(final FeralRidgewolf card) { + super(card); + } - @Override - public FeralRidgewolf copy() { - return new FeralRidgewolf(this); - } + @Override + public FeralRidgewolf copy() { + return new FeralRidgewolf(this); + } } diff --git a/Mage.Sets/src/mage/sets/innistrad/FrightfulDelusion.java b/Mage.Sets/src/mage/sets/innistrad/FrightfulDelusion.java index b7e1d8bb1c..ca0071ce62 100644 --- a/Mage.Sets/src/mage/sets/innistrad/FrightfulDelusion.java +++ b/Mage.Sets/src/mage/sets/innistrad/FrightfulDelusion.java @@ -47,7 +47,7 @@ import mage.target.TargetSpell; */ public class FrightfulDelusion extends CardImpl { - public FrightfulDelusion(UUID ownerId) { + public FrightfulDelusion(UUID ownerId) { super(ownerId, 57, "Frightful Delusion", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{2}{U}"); this.expansionSetCode = "ISD"; @@ -55,54 +55,54 @@ public class FrightfulDelusion extends CardImpl { // Counter target spell unless its controller pays {1}. That player discards a card. this.getSpellAbility().addTarget(new TargetSpell()); - this.getSpellAbility().addEffect(new FrightfulDelusionEffect()); + this.getSpellAbility().addEffect(new FrightfulDelusionEffect()); } - public FrightfulDelusion(final FrightfulDelusion card) { - super(card); - } + public FrightfulDelusion(final FrightfulDelusion card) { + super(card); + } - @Override - public FrightfulDelusion copy() { - return new FrightfulDelusion(this); - } + @Override + public FrightfulDelusion copy() { + return new FrightfulDelusion(this); + } } class FrightfulDelusionEffect extends OneShotEffect { - public FrightfulDelusionEffect() { - super(Outcome.Detriment); - this.staticText = "Counter target spell unless its controller pays {1}. That player discards a card."; - } + public FrightfulDelusionEffect() { + super(Outcome.Detriment); + this.staticText = "Counter target spell unless its controller pays {1}. That player discards a card."; + } - public FrightfulDelusionEffect(final FrightfulDelusionEffect effect) { - super(effect); - } + public FrightfulDelusionEffect(final FrightfulDelusionEffect effect) { + super(effect); + } - @Override - public FrightfulDelusionEffect copy() { - return new FrightfulDelusionEffect(this); - } + @Override + public FrightfulDelusionEffect copy() { + return new FrightfulDelusionEffect(this); + } - @Override - public boolean apply(Game game, Ability source) { - StackObject spell = game.getStack().getStackObject( - targetPointer.getFirst(game, source)); - Cost cost = new GenericManaCost(1); - if (spell != null) { - Player player = game.getPlayer(spell.getControllerId()); - if (player != null) { - cost.clearPaid(); - game.getPlayer(spell.getControllerId()).discard( - 1, source, game); - if (!cost.pay(source, game, spell.getControllerId(), - spell.getControllerId(), false)) { - return game.getStack().counter(source.getFirstTarget(), - source.getSourceId(), game); - } - } - } - return false; - } + @Override + public boolean apply(Game game, Ability source) { + StackObject spell = game.getStack().getStackObject( + targetPointer.getFirst(game, source)); + Cost cost = new GenericManaCost(1); + if (spell != null) { + Player player = game.getPlayer(spell.getControllerId()); + if (player != null) { + cost.clearPaid(); + game.getPlayer(spell.getControllerId()).discard( + 1, source, game); + if (!cost.pay(source, game, spell.getControllerId(), + spell.getControllerId(), false)) { + return game.getStack().counter(source.getFirstTarget(), + source.getSourceId(), game); + } + } + } + return false; + } } diff --git a/Mage.Sets/src/mage/sets/innistrad/GhostlyPossession.java b/Mage.Sets/src/mage/sets/innistrad/GhostlyPossession.java index f86894afc9..329ba29b75 100644 --- a/Mage.Sets/src/mage/sets/innistrad/GhostlyPossession.java +++ b/Mage.Sets/src/mage/sets/innistrad/GhostlyPossession.java @@ -62,10 +62,10 @@ public class GhostlyPossession extends CardImpl { this.color.setWhite(true); TargetPermanent auraTarget = new TargetCreaturePermanent(); - this.getSpellAbility().addTarget(auraTarget); - this.getSpellAbility().addEffect(new AttachEffect(Constants.Outcome.AddAbility)); - Ability ability = new EnchantAbility(auraTarget.getTargetName()); - this.addAbility(ability); + this.getSpellAbility().addTarget(auraTarget); + this.getSpellAbility().addEffect(new AttachEffect(Constants.Outcome.AddAbility)); + Ability ability = new EnchantAbility(auraTarget.getTargetName()); + this.addAbility(ability); //Enchanted creature has flying this.addAbility(new SimpleStaticAbility(Constants.Zone.BATTLEFIELD, new GainAbilityAttachedEffect(FlyingAbility.getInstance(), Constants.AttachmentType.AURA))); @@ -86,38 +86,38 @@ public class GhostlyPossession extends CardImpl { class GhostlyPossessionEffect extends PreventionEffectImpl { - public GhostlyPossessionEffect() { - super(Duration.WhileOnBattlefield); - staticText = "Prevent all combat damage that would be dealt to and dealt by enchanted creature"; - } + public GhostlyPossessionEffect() { + super(Duration.WhileOnBattlefield); + staticText = "Prevent all combat damage that would be dealt to and dealt by enchanted creature"; + } - public GhostlyPossessionEffect(final GhostlyPossessionEffect effect) { - super(effect); - } + public GhostlyPossessionEffect(final GhostlyPossessionEffect effect) { + super(effect); + } - @Override - public GhostlyPossessionEffect copy() { - return new GhostlyPossessionEffect(this); - } + @Override + public GhostlyPossessionEffect copy() { + return new GhostlyPossessionEffect(this); + } - @Override - public boolean apply(Game game, Ability source) { - return true; - } + @Override + public boolean apply(Game game, Ability source) { + return true; + } - @Override - public boolean replaceEvent(GameEvent event, Ability source, Game game) { - GameEvent preventEvent = new GameEvent(GameEvent.EventType.PREVENT_DAMAGE, source.getFirstTarget(), source.getId(), source.getControllerId(), event.getAmount(), false); - if (!game.replaceEvent(preventEvent)) { - int damage = event.getAmount(); - event.setAmount(0); - game.fireEvent(GameEvent.getEvent(GameEvent.EventType.PREVENTED_DAMAGE, source.getFirstTarget(), source.getId(), source.getControllerId(), damage)); - } - return false; - } + @Override + public boolean replaceEvent(GameEvent event, Ability source, Game game) { + GameEvent preventEvent = new GameEvent(GameEvent.EventType.PREVENT_DAMAGE, source.getFirstTarget(), source.getId(), source.getControllerId(), event.getAmount(), false); + if (!game.replaceEvent(preventEvent)) { + int damage = event.getAmount(); + event.setAmount(0); + game.fireEvent(GameEvent.getEvent(GameEvent.EventType.PREVENTED_DAMAGE, source.getFirstTarget(), source.getId(), source.getControllerId(), damage)); + } + return false; + } - @Override - public boolean applies(GameEvent event, Ability source, Game game) { + @Override + public boolean applies(GameEvent event, Ability source, Game game) { if (super.applies(event, source, game) && event instanceof DamageEvent) { DamageEvent damageEvent = (DamageEvent) event; if (damageEvent.isCombatDamage()) { @@ -130,6 +130,6 @@ class GhostlyPossessionEffect extends PreventionEffectImpl { ability1.addCost(new TapSourceCost()); ability1.addCost(new DiscardTargetCost(new TargetCardInHand())); this.addAbility(ability1); - + // {tap}, Remove three study counters from Grimoire of the Dead and sacrifice it: Put all creature cards from all graveyards onto the battlefield under your control. They're black Zombies in addition to their other colors and types. Ability ability2 = new SimpleActivatedAbility(Zone.BATTLEFIELD, new GrimoireOfTheDeadEffect(), new TapSourceCost()); ability2.addCost(new RemoveCountersSourceCost(CounterType.STUDY.createInstance(3))); ability2.addCost(new SacrificeSourceCost()); this.addAbility(ability2); - + } public GrimoireOfTheDead(final GrimoireOfTheDead card) { @@ -90,84 +90,84 @@ public class GrimoireOfTheDead extends CardImpl { class GrimoireOfTheDeadEffect extends OneShotEffect { - public GrimoireOfTheDeadEffect() { - super(Outcome.PutCreatureInPlay); - staticText = "Put all creature cards in all graveyards onto the battlefield under your control. They're black Zombies in addition to their other colors and types"; - } + public GrimoireOfTheDeadEffect() { + super(Outcome.PutCreatureInPlay); + staticText = "Put all creature cards in all graveyards onto the battlefield under your control. They're black Zombies in addition to their other colors and types"; + } - public GrimoireOfTheDeadEffect(final GrimoireOfTheDeadEffect effect) { - super(effect); - } + public GrimoireOfTheDeadEffect(final GrimoireOfTheDeadEffect effect) { + super(effect); + } - @Override - public boolean apply(Game game, Ability source) { - for (Player player: game.getPlayers().values()) { - for (Card card: player.getGraveyard().getCards(game)) { - if (card.getCardType().contains(CardType.CREATURE)) { - card.putOntoBattlefield(game, Zone.GRAVEYARD, source.getId(), source.getControllerId()); + @Override + public boolean apply(Game game, Ability source) { + for (Player player: game.getPlayers().values()) { + for (Card card: player.getGraveyard().getCards(game)) { + if (card.getCardType().contains(CardType.CREATURE)) { + card.putOntoBattlefield(game, Zone.GRAVEYARD, source.getId(), source.getControllerId()); game.addEffect(new GrimoireOfTheDeadEffect2(card.getId()), source); - } - } - } - return true; - } + } + } + } + return true; + } - @Override - public GrimoireOfTheDeadEffect copy() { - return new GrimoireOfTheDeadEffect(this); - } + @Override + public GrimoireOfTheDeadEffect copy() { + return new GrimoireOfTheDeadEffect(this); + } } class GrimoireOfTheDeadEffect2 extends ContinuousEffectImpl { private UUID targetId; - - public GrimoireOfTheDeadEffect2(UUID targetId) { - super(Duration.EndOfGame, Outcome.Neutral); + + public GrimoireOfTheDeadEffect2(UUID targetId) { + super(Duration.EndOfGame, Outcome.Neutral); this.targetId = targetId; - staticText = "Becomes a black Zombie in addition to its other colors and types"; - } + staticText = "Becomes a black Zombie in addition to its other colors and types"; + } - public GrimoireOfTheDeadEffect2(final GrimoireOfTheDeadEffect2 effect) { - super(effect); + public GrimoireOfTheDeadEffect2(final GrimoireOfTheDeadEffect2 effect) { + super(effect); this.targetId = effect.targetId; - } + } - @Override - public GrimoireOfTheDeadEffect2 copy() { - return new GrimoireOfTheDeadEffect2(this); - } + @Override + public GrimoireOfTheDeadEffect2 copy() { + return new GrimoireOfTheDeadEffect2(this); + } - @Override - public boolean apply(Layer layer, SubLayer sublayer, Ability source, Game game) { - Permanent permanent = game.getPermanent(targetId); - if (permanent != null) { - switch (layer) { - case ColorChangingEffects_5: - if (sublayer == SubLayer.NA) { - permanent.getColor().setBlack(true); - } - break; - case TypeChangingEffects_4: - if (sublayer == SubLayer.NA) { - permanent.getSubtype().add("Zombie"); - } - break; - } - return true; - } - return false; - } + @Override + public boolean apply(Layer layer, SubLayer sublayer, Ability source, Game game) { + Permanent permanent = game.getPermanent(targetId); + if (permanent != null) { + switch (layer) { + case ColorChangingEffects_5: + if (sublayer == SubLayer.NA) { + permanent.getColor().setBlack(true); + } + break; + case TypeChangingEffects_4: + if (sublayer == SubLayer.NA) { + permanent.getSubtype().add("Zombie"); + } + break; + } + return true; + } + return false; + } - @Override - public boolean apply(Game game, Ability source) { - return false; - } + @Override + public boolean apply(Game game, Ability source) { + return false; + } - @Override - public boolean hasLayer(Layer layer) { - return layer == Layer.ColorChangingEffects_5 || layer == Layer.TypeChangingEffects_4; - } + @Override + public boolean hasLayer(Layer layer) { + return layer == Layer.ColorChangingEffects_5 || layer == Layer.TypeChangingEffects_4; + } } \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/innistrad/GruesomeDeformity.java b/Mage.Sets/src/mage/sets/innistrad/GruesomeDeformity.java index 2ee65e6c16..e1a891a825 100644 --- a/Mage.Sets/src/mage/sets/innistrad/GruesomeDeformity.java +++ b/Mage.Sets/src/mage/sets/innistrad/GruesomeDeformity.java @@ -57,12 +57,12 @@ public class GruesomeDeformity extends CardImpl { // Enchant creature TargetPermanent target = new TargetCreaturePermanent(); - this.getSpellAbility().addTarget(target); - this.getSpellAbility().addEffect(new AttachEffect(Constants.Outcome.AddAbility)); - Ability ability = new EnchantAbility(target.getTargetName()); - this.addAbility(ability); + this.getSpellAbility().addTarget(target); + this.getSpellAbility().addEffect(new AttachEffect(Constants.Outcome.AddAbility)); + Ability ability = new EnchantAbility(target.getTargetName()); + this.addAbility(ability); // Enchanted creature has intimidate. - this.addAbility(new SimpleStaticAbility(Constants.Zone.BATTLEFIELD, new GainAbilityAttachedEffect(IntimidateAbility.getInstance(), Constants.AttachmentType.AURA))); + this.addAbility(new SimpleStaticAbility(Constants.Zone.BATTLEFIELD, new GainAbilityAttachedEffect(IntimidateAbility.getInstance(), Constants.AttachmentType.AURA))); } public GruesomeDeformity(final GruesomeDeformity card) { diff --git a/Mage.Sets/src/mage/sets/innistrad/GutterGrime.java b/Mage.Sets/src/mage/sets/innistrad/GutterGrime.java index 5271f6f89a..3c44f0818e 100644 --- a/Mage.Sets/src/mage/sets/innistrad/GutterGrime.java +++ b/Mage.Sets/src/mage/sets/innistrad/GutterGrime.java @@ -126,11 +126,11 @@ class GutterGrimeEffect extends OneShotEffect { public GutterGrimeEffect() { super(Outcome.PutCreatureInPlay); } - + public GutterGrimeEffect(final GutterGrimeEffect effect) { super(effect); } - + @Override public boolean apply(Game game, Ability source) { GutterGrimeToken token = new GutterGrimeToken(source.getSourceId()); @@ -142,26 +142,26 @@ class GutterGrimeEffect extends OneShotEffect { public GutterGrimeEffect copy() { return new GutterGrimeEffect(this); } - + } class GutterGrimeToken extends Token { - public GutterGrimeToken(UUID sourceId) { - super("Ooze", "green Ooze creature token with \"This creature's power and toughness are each equal to the number of slime counters on Gutter Grime.\""); - cardType.add(CardType.CREATURE); - subtype.add("Ooze"); - color.setGreen(true); - power = new MageInt(0); - toughness = new MageInt(0); - this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new SetPowerToughnessSourceEffect(new GutterGrimeCounters(sourceId), Duration.WhileOnBattlefield))); - } + public GutterGrimeToken(UUID sourceId) { + super("Ooze", "green Ooze creature token with \"This creature's power and toughness are each equal to the number of slime counters on Gutter Grime.\""); + cardType.add(CardType.CREATURE); + subtype.add("Ooze"); + color.setGreen(true); + power = new MageInt(0); + toughness = new MageInt(0); + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new SetPowerToughnessSourceEffect(new GutterGrimeCounters(sourceId), Duration.WhileOnBattlefield))); + } } class GutterGrimeCounters implements DynamicValue { - + private UUID sourceId; - + public GutterGrimeCounters(UUID sourceId) { this.sourceId = sourceId; } diff --git a/Mage.Sets/src/mage/sets/innistrad/HarvestPyre.java b/Mage.Sets/src/mage/sets/innistrad/HarvestPyre.java index 31766906db..e5e0206f86 100644 --- a/Mage.Sets/src/mage/sets/innistrad/HarvestPyre.java +++ b/Mage.Sets/src/mage/sets/innistrad/HarvestPyre.java @@ -59,7 +59,7 @@ public class HarvestPyre extends CardImpl { // As an additional cost to cast Harvest Pyre, exile X cards from your graveyard. this.getSpellAbility().addCost(new HarvestPyreCost()); - + // Harvest Pyre deals X damage to target creature. this.getSpellAbility().addTarget(new TargetCreaturePermanent()); this.getSpellAbility().addEffect(new DamageTargetEffect(new GetXValue())); @@ -77,17 +77,17 @@ public class HarvestPyre extends CardImpl { class HarvestPyreCost extends CostImpl implements VariableCost { - protected int amountPaid = 0; - + protected int amountPaid = 0; + public HarvestPyreCost() { this.text = "As an additional cost to cast Harvest Pyre, exile X cards from your graveyard"; } - + public HarvestPyreCost(final HarvestPyreCost cost) { super(cost); this.amountPaid = cost.amountPaid; } - + @Override public boolean canPay(UUID sourceId, UUID controllerId, Game game) { return true; @@ -95,12 +95,12 @@ class HarvestPyreCost extends CostImpl implements VariableCost @Override public boolean pay(Ability ability, Game game, UUID sourceId, UUID controllerId, boolean noMana) { - amountPaid = 0; + amountPaid = 0; Target target = new TargetCardInYourGraveyard(); Player player = game.getPlayer(controllerId); - while (true) { - target.clearChosen(); - if (target.canChoose(controllerId, game) && target.choose(Outcome.Exile, controllerId, sourceId, game)) { + while (true) { + target.clearChosen(); + if (target.canChoose(controllerId, game) && target.choose(Outcome.Exile, controllerId, sourceId, game)) { Card card = player.getGraveyard().get(target.getFirstTarget(), game); if (card != null) { player.getGraveyard().remove(card); @@ -111,18 +111,18 @@ class HarvestPyreCost extends CostImpl implements VariableCost else break; } - paid = true; - return true; + paid = true; + return true; } - @Override - public int getAmount() { - return amountPaid; - } + @Override + public int getAmount() { + return amountPaid; + } - @Override - public void setFilter(FilterMana filter) { - } + @Override + public void setFilter(FilterMana filter) { + } @Override public HarvestPyreCost copy() { @@ -133,5 +133,5 @@ class HarvestPyreCost extends CostImpl implements VariableCost public void setAmount(int amount) { amountPaid = amount; } - + } diff --git a/Mage.Sets/src/mage/sets/innistrad/HeartlessSummoning.java b/Mage.Sets/src/mage/sets/innistrad/HeartlessSummoning.java index 84a2d4ded4..27ad47fa60 100644 --- a/Mage.Sets/src/mage/sets/innistrad/HeartlessSummoning.java +++ b/Mage.Sets/src/mage/sets/innistrad/HeartlessSummoning.java @@ -58,7 +58,7 @@ public class HeartlessSummoning extends CardImpl { // Creature spells you cast cost {2} less to cast. this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new HeartlessSummoningCostReductionEffect())); - + // Creatures you control get -1/-1. this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostControlledEffect(-1, -1, Constants.Duration.WhileOnBattlefield))); } @@ -75,36 +75,36 @@ public class HeartlessSummoning extends CardImpl { class HeartlessSummoningCostReductionEffect extends CostModificationEffectImpl { - HeartlessSummoningCostReductionEffect ( ) { - super(Duration.WhileOnBattlefield, Outcome.Benefit); - staticText = "Creature spells you cast cost {2} less to cast"; - } + HeartlessSummoningCostReductionEffect ( ) { + super(Duration.WhileOnBattlefield, Outcome.Benefit); + staticText = "Creature spells you cast cost {2} less to cast"; + } - HeartlessSummoningCostReductionEffect(HeartlessSummoningCostReductionEffect effect) { - super(effect); - } + HeartlessSummoningCostReductionEffect(HeartlessSummoningCostReductionEffect effect) { + super(effect); + } - @Override - public boolean apply(Game game, Ability source, Ability abilityToModify) { - SpellAbility spellAbility = (SpellAbility) abilityToModify; - CardUtil.adjustCost(spellAbility, 2); - return true; - } - - @Override - public boolean applies(Ability abilityToModify, Ability source, Game game) { - if ( abilityToModify instanceof SpellAbility ) { - Card sourceCard = game.getCard(((SpellAbility)abilityToModify).getSourceId()); - if ( sourceCard != null && sourceCard.getCardType().contains(CardType.CREATURE) && sourceCard.getOwnerId().equals(source.getControllerId()) ) { - return true; - } - } - return false; - } + @Override + public boolean apply(Game game, Ability source, Ability abilityToModify) { + SpellAbility spellAbility = (SpellAbility) abilityToModify; + CardUtil.adjustCost(spellAbility, 2); + return true; + } - @Override - public HeartlessSummoningCostReductionEffect copy() { - return new HeartlessSummoningCostReductionEffect(this); - } + @Override + public boolean applies(Ability abilityToModify, Ability source, Game game) { + if ( abilityToModify instanceof SpellAbility ) { + Card sourceCard = game.getCard(((SpellAbility)abilityToModify).getSourceId()); + if ( sourceCard != null && sourceCard.getCardType().contains(CardType.CREATURE) && sourceCard.getOwnerId().equals(source.getControllerId()) ) { + return true; + } + } + return false; + } + + @Override + public HeartlessSummoningCostReductionEffect copy() { + return new HeartlessSummoningCostReductionEffect(this); + } } diff --git a/Mage.Sets/src/mage/sets/innistrad/HereticsPunishment.java b/Mage.Sets/src/mage/sets/innistrad/HereticsPunishment.java index 12e979875d..e58a154518 100644 --- a/Mage.Sets/src/mage/sets/innistrad/HereticsPunishment.java +++ b/Mage.Sets/src/mage/sets/innistrad/HereticsPunishment.java @@ -77,11 +77,11 @@ class HereticsPunishmentEffect extends OneShotEffect { super(Outcome.Damage); staticText = "Choose target creature or player, then put the top three cards of your library into your graveyard. Heretic's Punishment deals damage to that creature or player equal to the highest converted mana cost among those cards"; } - + public HereticsPunishmentEffect(final HereticsPunishmentEffect effect) { super(effect); } - + @Override public boolean apply(Game game, Ability source) { Player player = game.getPlayer(source.getControllerId()); @@ -114,5 +114,5 @@ class HereticsPunishmentEffect extends OneShotEffect { public HereticsPunishmentEffect copy() { return new HereticsPunishmentEffect(this); } - + } \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/innistrad/HinterlandHarbor.java b/Mage.Sets/src/mage/sets/innistrad/HinterlandHarbor.java index 8f63b9e861..85c80e4137 100644 --- a/Mage.Sets/src/mage/sets/innistrad/HinterlandHarbor.java +++ b/Mage.Sets/src/mage/sets/innistrad/HinterlandHarbor.java @@ -49,32 +49,32 @@ import java.util.UUID; */ public class HinterlandHarbor extends CardImpl { - private static final FilterLandPermanent filter = new FilterLandPermanent(); + private static final FilterLandPermanent filter = new FilterLandPermanent(); - static { - filter.getSubtype().add("Forest"); - filter.getSubtype().add("Island"); - filter.setScopeSubtype(ComparisonScope.Any); - filter.setMessage("Forest or an Island"); - } + static { + filter.getSubtype().add("Forest"); + filter.getSubtype().add("Island"); + filter.setScopeSubtype(ComparisonScope.Any); + filter.setMessage("Forest or an Island"); + } - public HinterlandHarbor(UUID ownerId) { - super(ownerId, 241, "Hinterland Harbor", Rarity.RARE, new CardType[]{CardType.LAND}, null); - this.expansionSetCode = "ISD"; + public HinterlandHarbor(UUID ownerId) { + super(ownerId, 241, "Hinterland Harbor", Rarity.RARE, new CardType[]{CardType.LAND}, null); + this.expansionSetCode = "ISD"; - Condition controls = new UnlessCondition(new ControlsPermanentCondition(filter, ControlsPermanentCondition.CountType.MORE_THAN, 0)); - String abilityText = "tap it unless you control a " + filter.getMessage(); - this.addAbility(new EntersBattlefieldAbility(new ConditionalOneShotEffect(new TapSourceEffect(), controls, abilityText), abilityText)); - this.addAbility(new GreenManaAbility()); - this.addAbility(new BlueManaAbility()); - } + Condition controls = new UnlessCondition(new ControlsPermanentCondition(filter, ControlsPermanentCondition.CountType.MORE_THAN, 0)); + String abilityText = "tap it unless you control a " + filter.getMessage(); + this.addAbility(new EntersBattlefieldAbility(new ConditionalOneShotEffect(new TapSourceEffect(), controls, abilityText), abilityText)); + this.addAbility(new GreenManaAbility()); + this.addAbility(new BlueManaAbility()); + } - public HinterlandHarbor(final HinterlandHarbor card) { - super(card); - } + public HinterlandHarbor(final HinterlandHarbor card) { + super(card); + } - @Override - public HinterlandHarbor copy() { - return new HinterlandHarbor(this); - } + @Override + public HinterlandHarbor copy() { + return new HinterlandHarbor(this); + } } diff --git a/Mage.Sets/src/mage/sets/innistrad/HollowhengeScavenger.java b/Mage.Sets/src/mage/sets/innistrad/HollowhengeScavenger.java index d94a5101b3..97c8cd8ed4 100644 --- a/Mage.Sets/src/mage/sets/innistrad/HollowhengeScavenger.java +++ b/Mage.Sets/src/mage/sets/innistrad/HollowhengeScavenger.java @@ -45,19 +45,19 @@ import java.util.UUID; */ public class HollowhengeScavenger extends CardImpl { - private final static String staticText = "Morbid - When {this} enters the battlefield, if a creature died this turn, you gain 5 life."; + private final static String staticText = "Morbid - When {this} enters the battlefield, if a creature died this turn, you gain 5 life."; public HollowhengeScavenger(UUID ownerId) { - super(ownerId, 188, "Hollowhenge Scavenger", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{3}{G}{G}"); - this.expansionSetCode = "ISD"; - this.color.setGreen(true); - this.subtype.add("Elemental"); - this.power = new MageInt(4); - this.toughness = new MageInt(5); + super(ownerId, 188, "Hollowhenge Scavenger", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{3}{G}{G}"); + this.expansionSetCode = "ISD"; + this.color.setGreen(true); + this.subtype.add("Elemental"); + this.power = new MageInt(4); + this.toughness = new MageInt(5); - // 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)); + // 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)); } public HollowhengeScavenger(final HollowhengeScavenger card) { diff --git a/Mage.Sets/src/mage/sets/innistrad/HowlpackAlpha.java b/Mage.Sets/src/mage/sets/innistrad/HowlpackAlpha.java index 637ad087b9..96b0af4e35 100644 --- a/Mage.Sets/src/mage/sets/innistrad/HowlpackAlpha.java +++ b/Mage.Sets/src/mage/sets/innistrad/HowlpackAlpha.java @@ -54,7 +54,7 @@ import java.util.UUID; public class HowlpackAlpha extends CardImpl { private static final String ruleText = "At the beginning of your end step, put a 2/2 green Wolf creature token onto the battlefield"; - + private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("Werewolf and Wolf creatures"); static { diff --git a/Mage.Sets/src/mage/sets/innistrad/IntangibleVirtue.java b/Mage.Sets/src/mage/sets/innistrad/IntangibleVirtue.java index edf4975892..0e0edec357 100644 --- a/Mage.Sets/src/mage/sets/innistrad/IntangibleVirtue.java +++ b/Mage.Sets/src/mage/sets/innistrad/IntangibleVirtue.java @@ -45,7 +45,7 @@ import mage.filter.common.FilterToken; public class IntangibleVirtue extends CardImpl { private final static FilterToken filter = new FilterToken(); - + public IntangibleVirtue(UUID ownerId) { super(ownerId, 19, "Intangible Virtue", Rarity.UNCOMMON, new CardType[]{CardType.ENCHANTMENT}, "{1}{W}"); this.expansionSetCode = "ISD"; @@ -55,7 +55,7 @@ public class IntangibleVirtue extends CardImpl { // Creature tokens you control get +1/+1 and have vigilance. this.addAbility(new SimpleStaticAbility(Constants.Zone.BATTLEFIELD, new BoostControlledEffect(1, 1, Constants.Duration.WhileOnBattlefield, filter))); this.addAbility(new SimpleStaticAbility(Constants.Zone.BATTLEFIELD, new GainAbilityControlledEffect(VigilanceAbility.getInstance(), Constants.Duration.WhileOnBattlefield, filter))); - + } public IntangibleVirtue(final IntangibleVirtue card) { diff --git a/Mage.Sets/src/mage/sets/innistrad/IsolatedChapel.java b/Mage.Sets/src/mage/sets/innistrad/IsolatedChapel.java index 9226743284..6b3fce6221 100644 --- a/Mage.Sets/src/mage/sets/innistrad/IsolatedChapel.java +++ b/Mage.Sets/src/mage/sets/innistrad/IsolatedChapel.java @@ -49,32 +49,32 @@ import java.util.UUID; */ public class IsolatedChapel extends CardImpl { - private static final FilterLandPermanent filter = new FilterLandPermanent(); + private static final FilterLandPermanent filter = new FilterLandPermanent(); - static { - filter.getSubtype().add("Plains"); - filter.getSubtype().add("Swamp"); - filter.setScopeSubtype(ComparisonScope.Any); - filter.setMessage("Plains or a Swamp"); - } + static { + filter.getSubtype().add("Plains"); + filter.getSubtype().add("Swamp"); + filter.setScopeSubtype(ComparisonScope.Any); + filter.setMessage("Plains or a Swamp"); + } - public IsolatedChapel(UUID ownerId) { - super(ownerId, 242, "Isolated Chapel", Rarity.RARE, new CardType[]{CardType.LAND}, null); - this.expansionSetCode = "ISD"; + public IsolatedChapel(UUID ownerId) { + super(ownerId, 242, "Isolated Chapel", Rarity.RARE, new CardType[]{CardType.LAND}, null); + this.expansionSetCode = "ISD"; - Condition controls = new UnlessCondition(new ControlsPermanentCondition(filter, ControlsPermanentCondition.CountType.MORE_THAN, 0)); - String abilityText = "tap it unless you control a " + filter.getMessage(); - this.addAbility(new EntersBattlefieldAbility(new ConditionalOneShotEffect(new TapSourceEffect(), controls, abilityText), abilityText)); - this.addAbility(new WhiteManaAbility()); - this.addAbility(new BlackManaAbility()); - } + Condition controls = new UnlessCondition(new ControlsPermanentCondition(filter, ControlsPermanentCondition.CountType.MORE_THAN, 0)); + String abilityText = "tap it unless you control a " + filter.getMessage(); + this.addAbility(new EntersBattlefieldAbility(new ConditionalOneShotEffect(new TapSourceEffect(), controls, abilityText), abilityText)); + this.addAbility(new WhiteManaAbility()); + this.addAbility(new BlackManaAbility()); + } - public IsolatedChapel(final IsolatedChapel card) { - super(card); - } + public IsolatedChapel(final IsolatedChapel card) { + super(card); + } - @Override - public IsolatedChapel copy() { - return new IsolatedChapel(this); - } + @Override + public IsolatedChapel copy() { + return new IsolatedChapel(this); + } } diff --git a/Mage.Sets/src/mage/sets/innistrad/KessigWolfRun.java b/Mage.Sets/src/mage/sets/innistrad/KessigWolfRun.java index 5c8403e98a..6ad6331dd4 100644 --- a/Mage.Sets/src/mage/sets/innistrad/KessigWolfRun.java +++ b/Mage.Sets/src/mage/sets/innistrad/KessigWolfRun.java @@ -50,27 +50,27 @@ import java.util.UUID; */ public class KessigWolfRun extends CardImpl { - public KessigWolfRun(UUID ownerId) { - super(ownerId, 243, "Kessig Wolf Run", Rarity.RARE, new CardType[]{CardType.LAND}, ""); - this.expansionSetCode = "ISD"; + public KessigWolfRun(UUID ownerId) { + super(ownerId, 243, "Kessig Wolf Run", Rarity.RARE, new CardType[]{CardType.LAND}, ""); + this.expansionSetCode = "ISD"; - // {T}: Add {1} to your mana pool. - this.addAbility(new ColorlessManaAbility()); + // {T}: Add {1} to your mana pool. + this.addAbility(new ColorlessManaAbility()); - // {X}{R}{G}, {T}: Target creature gets +X/+0 and gains trample until end of turn. - Ability ability = new SimpleActivatedAbility(Constants.Zone.BATTLEFIELD, new GainAbilityTargetEffect(TrampleAbility.getInstance(), Constants.Duration.EndOfTurn), new ManaCostsImpl("{X}{R}{G}")); - ability.addCost(new TapSourceCost()); - ability.addEffect(new BoostTargetEffect(new ManacostVariableValue(), new StaticValue(0), Constants.Duration.EndOfTurn)); - ability.addTarget(new TargetCreaturePermanent()); - this.addAbility(ability); - } + // {X}{R}{G}, {T}: Target creature gets +X/+0 and gains trample until end of turn. + Ability ability = new SimpleActivatedAbility(Constants.Zone.BATTLEFIELD, new GainAbilityTargetEffect(TrampleAbility.getInstance(), Constants.Duration.EndOfTurn), new ManaCostsImpl("{X}{R}{G}")); + ability.addCost(new TapSourceCost()); + ability.addEffect(new BoostTargetEffect(new ManacostVariableValue(), new StaticValue(0), Constants.Duration.EndOfTurn)); + ability.addTarget(new TargetCreaturePermanent()); + this.addAbility(ability); + } - public KessigWolfRun(final KessigWolfRun card) { - super(card); - } + public KessigWolfRun(final KessigWolfRun card) { + super(card); + } - @Override - public KessigWolfRun copy() { - return new KessigWolfRun(this); - } + @Override + public KessigWolfRun copy() { + return new KessigWolfRun(this); + } } diff --git a/Mage.Sets/src/mage/sets/innistrad/LaboratoryManiac.java b/Mage.Sets/src/mage/sets/innistrad/LaboratoryManiac.java index 4310c85110..f39eb80aee 100644 --- a/Mage.Sets/src/mage/sets/innistrad/LaboratoryManiac.java +++ b/Mage.Sets/src/mage/sets/innistrad/LaboratoryManiac.java @@ -109,9 +109,9 @@ class LaboratoryManiacEffect extends ReplacementEffectImpl 0 && player.isEmptyDraw() && player.getCounters().getCount(CounterType.POISON) < 10)) { - return true; - } + if (!player.hasLost() && (player.getLife() > 0 && player.isEmptyDraw() && player.getCounters().getCount(CounterType.POISON) < 10)) { + return true; + } } return false; } diff --git a/Mage.Sets/src/mage/sets/innistrad/LilianaOfTheVeil.java b/Mage.Sets/src/mage/sets/innistrad/LilianaOfTheVeil.java index b5ae050c9f..a9339479fe 100644 --- a/Mage.Sets/src/mage/sets/innistrad/LilianaOfTheVeil.java +++ b/Mage.Sets/src/mage/sets/innistrad/LilianaOfTheVeil.java @@ -129,7 +129,7 @@ class LilianaOfTheVeilEffect extends OneShotEffect { } boolean choice = targetPlayer.choosePile(Outcome.DestroyPermanent, "Choose a pile to sacrifice.", pile1, pile2, game); - + if (choice) { sacrificePermanents(pile1, game, source); } else { diff --git a/Mage.Sets/src/mage/sets/innistrad/MayorOfAvabruck.java b/Mage.Sets/src/mage/sets/innistrad/MayorOfAvabruck.java index ac5433a493..be856ee285 100644 --- a/Mage.Sets/src/mage/sets/innistrad/MayorOfAvabruck.java +++ b/Mage.Sets/src/mage/sets/innistrad/MayorOfAvabruck.java @@ -54,7 +54,7 @@ import java.util.UUID; public class MayorOfAvabruck extends CardImpl { private static final String ruleText = "Other Human creatures you control get +1/+1"; - + private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("Human creatures"); static { diff --git a/Mage.Sets/src/mage/sets/innistrad/MentorOfTheMeek.java b/Mage.Sets/src/mage/sets/innistrad/MentorOfTheMeek.java index d2a8816a43..4c8725ee90 100644 --- a/Mage.Sets/src/mage/sets/innistrad/MentorOfTheMeek.java +++ b/Mage.Sets/src/mage/sets/innistrad/MentorOfTheMeek.java @@ -57,10 +57,10 @@ public class MentorOfTheMeek extends CardImpl { this.color.setWhite(true); this.power = new MageInt(2); this.toughness = new MageInt(2); - + //Whenever another creature with power 2 or less enters the battlefield under your control, you may pay 1. If you do, draw a card. this.addAbility(new MentorOfTheMeekAbility()); - + } public MentorOfTheMeek(final MentorOfTheMeek card) { @@ -92,20 +92,20 @@ class MentorOfTheMeekAbility extends TriggeredAbilityImpl { Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new MindshriekerEffect(), new ManaCostsImpl("{2}")); ability.addTarget(new TargetPlayer()); this.addAbility(ability); - + } public Mindshrieker(final Mindshrieker card) { @@ -86,18 +86,18 @@ class MindshriekerEffect extends OneShotEffect { super(Outcome.BoostCreature); staticText = "Target player puts the top card of his or her library into his or her graveyard. {this} gets +X/+X until end of turn, where X is that card's converted mana cost"; } - + public MindshriekerEffect(final MindshriekerEffect effect) { super(effect); } - + @Override public boolean apply(Game game, Ability source) { - Player player = game.getPlayer(source.getFirstTarget()); - if (player != null && player.getLibrary().size() > 0) { - Card card = player.getLibrary().removeFromTop(game); - if (card != null) { - card.moveToZone(Zone.GRAVEYARD, source.getId(), game, false); + Player player = game.getPlayer(source.getFirstTarget()); + if (player != null && player.getLibrary().size() > 0) { + Card card = player.getLibrary().removeFromTop(game); + if (card != null) { + card.moveToZone(Zone.GRAVEYARD, source.getId(), game, false); int amount = card.getManaCost().convertedManaCost(); if (amount > 0) game.addEffect(new BoostSourceEffect(amount, amount, Duration.EndOfTurn), source); @@ -111,5 +111,5 @@ class MindshriekerEffect extends OneShotEffect { public MindshriekerEffect copy() { return new MindshriekerEffect(this); } - + } \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/innistrad/MirrorMadPhantasm.java b/Mage.Sets/src/mage/sets/innistrad/MirrorMadPhantasm.java index 629f0b9d0f..f1164c34a6 100644 --- a/Mage.Sets/src/mage/sets/innistrad/MirrorMadPhantasm.java +++ b/Mage.Sets/src/mage/sets/innistrad/MirrorMadPhantasm.java @@ -64,7 +64,7 @@ public class MirrorMadPhantasm extends CardImpl { this.addAbility(FlyingAbility.getInstance()); // {1}{U}: Mirror-Mad Phantasm's owner shuffles it into his or her library. If that player does, he or she reveals cards from the top of that library until a card named Mirror-Mad Phantasm is revealed. That player puts that card onto the battlefield and all other cards revealed this way into his or her graveyard. this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new MirrorMadPhantasmEffect(), new ManaCostsImpl("{1}{U}"))); - + } public MirrorMadPhantasm(final MirrorMadPhantasm card) { @@ -78,12 +78,12 @@ public class MirrorMadPhantasm extends CardImpl { } class MirrorMadPhantasmEffect extends OneShotEffect { - + public MirrorMadPhantasmEffect() { super(Outcome.Detriment); this.staticText = "{this}'s owner shuffles it into his or her library. If that player does, he or she reveals cards from the top of that library until a card named Mirror-Mad Phantasm is revealed. That player puts that card onto the battlefield and all other cards revealed this way into his or her graveyard"; } - + public MirrorMadPhantasmEffect(final MirrorMadPhantasmEffect effect) { super(effect); } @@ -121,5 +121,5 @@ class MirrorMadPhantasmEffect extends OneShotEffect { public MirrorMadPhantasmEffect copy() { return new MirrorMadPhantasmEffect(this); } - + } \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/innistrad/Moonmist.java b/Mage.Sets/src/mage/sets/innistrad/Moonmist.java index ba340d6b80..1dfb629d2c 100644 --- a/Mage.Sets/src/mage/sets/innistrad/Moonmist.java +++ b/Mage.Sets/src/mage/sets/innistrad/Moonmist.java @@ -48,14 +48,14 @@ import mage.game.permanent.Permanent; public class Moonmist extends CardImpl { private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("creatures other than Werewolves and Wolves"); - + static { filter.getSubtype().add("Werewolf"); filter.getSubtype().add("Wolf"); filter.setScopeSubtype(ComparisonScope.Any); filter.setNotFilter(true); } - + public Moonmist(UUID ownerId) { super(ownerId, 195, "Moonmist", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{1}{G}"); this.expansionSetCode = "ISD"; @@ -80,19 +80,19 @@ public class Moonmist extends CardImpl { class MoonmistEffect extends OneShotEffect { private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("humans"); - + static { filter.getSubtype().add("Human"); } - + public MoonmistEffect() { super(Outcome.PreventDamage); } - + public MoonmistEffect(final MoonmistEffect effect) { super(effect); } - + @Override public boolean apply(Game game, Ability source) { for (Permanent permanent: game.getBattlefield().getActivePermanents(filter, source.getControllerId(), game)) { diff --git a/Mage.Sets/src/mage/sets/innistrad/MorkrutBanshee.java b/Mage.Sets/src/mage/sets/innistrad/MorkrutBanshee.java index 940c39664c..b295835d15 100644 --- a/Mage.Sets/src/mage/sets/innistrad/MorkrutBanshee.java +++ b/Mage.Sets/src/mage/sets/innistrad/MorkrutBanshee.java @@ -48,28 +48,28 @@ public class MorkrutBanshee extends CardImpl { private final static String staticText = "Morbid - When {this} enters the battlefield, if a creature died this turn, target creature gets -4/-4 until end of turn."; - public MorkrutBanshee(UUID ownerId) { - super(ownerId, 110, "Morkrut Banshee", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{3}{B}{B}"); - this.expansionSetCode = "ISD"; - this.subtype.add("Spirit"); + public MorkrutBanshee(UUID ownerId) { + super(ownerId, 110, "Morkrut Banshee", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{3}{B}{B}"); + this.expansionSetCode = "ISD"; + this.subtype.add("Spirit"); - this.color.setBlack(true); - this.power = new MageInt(4); - this.toughness = new MageInt(4); + this.color.setBlack(true); + this.power = new MageInt(4); + this.toughness = new MageInt(4); - // Morbid - When Morkut Banshee enters the battlefield, if a creature died this turn, target creature gets -4/-4 until end of turn. + // 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); - ability.addTarget(new TargetCreaturePermanent()); - this.addAbility(ability); - } + TriggeredAbility ability = new ConditionalTriggeredAbility(triggeredAbility, MorbidCondition.getInstance(), staticText); + ability.addTarget(new TargetCreaturePermanent()); + this.addAbility(ability); + } - public MorkrutBanshee(final MorkrutBanshee card) { - super(card); - } + public MorkrutBanshee(final MorkrutBanshee card) { + super(card); + } - @Override - public MorkrutBanshee copy() { - return new MorkrutBanshee(this); - } + @Override + public MorkrutBanshee copy() { + return new MorkrutBanshee(this); + } } diff --git a/Mage.Sets/src/mage/sets/innistrad/NephaliaDrownyard.java b/Mage.Sets/src/mage/sets/innistrad/NephaliaDrownyard.java index 078d18f148..70233affb9 100644 --- a/Mage.Sets/src/mage/sets/innistrad/NephaliaDrownyard.java +++ b/Mage.Sets/src/mage/sets/innistrad/NephaliaDrownyard.java @@ -46,26 +46,26 @@ import java.util.UUID; */ public class NephaliaDrownyard extends CardImpl { - public NephaliaDrownyard(UUID ownerId) { - super(ownerId, 245, "Nephalia Drownyard", Rarity.RARE, new CardType[]{CardType.LAND}, ""); - this.expansionSetCode = "ISD"; + public NephaliaDrownyard(UUID ownerId) { + super(ownerId, 245, "Nephalia Drownyard", Rarity.RARE, new CardType[]{CardType.LAND}, ""); + this.expansionSetCode = "ISD"; - // {T}: Add 1 to your mana pool. - this.addAbility(new ColorlessManaAbility()); + // {T}: Add 1 to your mana pool. + this.addAbility(new ColorlessManaAbility()); - // {1}{U}{B}, {T}: Target player puts the top three cards of his or her library into his or her graveyard. - Ability ability = new SimpleActivatedAbility(Constants.Zone.BATTLEFIELD, new PutLibraryIntoGraveTargetEffect(3), new ManaCostsImpl("{1}{U}{B}")); - ability.addCost(new TapSourceCost()); - ability.addTarget(new TargetPlayer()); - this.addAbility(ability); - } + // {1}{U}{B}, {T}: Target player puts the top three cards of his or her library into his or her graveyard. + Ability ability = new SimpleActivatedAbility(Constants.Zone.BATTLEFIELD, new PutLibraryIntoGraveTargetEffect(3), new ManaCostsImpl("{1}{U}{B}")); + ability.addCost(new TapSourceCost()); + ability.addTarget(new TargetPlayer()); + this.addAbility(ability); + } - public NephaliaDrownyard(final NephaliaDrownyard card) { - super(card); - } + public NephaliaDrownyard(final NephaliaDrownyard card) { + super(card); + } - @Override - public NephaliaDrownyard copy() { - return new NephaliaDrownyard(this); - } + @Override + public NephaliaDrownyard copy() { + return new NephaliaDrownyard(this); + } } diff --git a/Mage.Sets/src/mage/sets/innistrad/Nevermore.java b/Mage.Sets/src/mage/sets/innistrad/Nevermore.java index 5b6891f841..72885766b4 100644 --- a/Mage.Sets/src/mage/sets/innistrad/Nevermore.java +++ b/Mage.Sets/src/mage/sets/innistrad/Nevermore.java @@ -54,27 +54,27 @@ import mage.sets.Sets; */ public class Nevermore extends CardImpl { - public Nevermore(UUID ownerId) { - super(ownerId, 25, "Nevermore", Rarity.RARE, new CardType[]{CardType.ENCHANTMENT}, "{1}{W}{W}"); - this.expansionSetCode = "ISD"; - this.color.setWhite(true); - - //As Nevermore enters the battlefield, name a nonland card. - this.addAbility(new EntersBattlefieldTriggeredAbility(new NevermoreEffect1())); - + public Nevermore(UUID ownerId) { + super(ownerId, 25, "Nevermore", Rarity.RARE, new CardType[]{CardType.ENCHANTMENT}, "{1}{W}{W}"); + this.expansionSetCode = "ISD"; + this.color.setWhite(true); + + //As Nevermore enters the battlefield, name a nonland card. + this.addAbility(new EntersBattlefieldTriggeredAbility(new NevermoreEffect1())); + //The named card can't be cast. this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new NevermoreEffect2())); - - } - public Nevermore(final Nevermore card) { - super(card); - } + } - @Override - public Nevermore copy() { - return new Nevermore(this); - } + public Nevermore(final Nevermore card) { + super(card); + } + + @Override + public Nevermore copy() { + return new Nevermore(this); + } } class NevermoreEffect1 extends OneShotEffect { @@ -83,14 +83,14 @@ class NevermoreEffect1 extends OneShotEffect { super(Outcome.Detriment); staticText = "name a nonland card"; } - + public NevermoreEffect1(final NevermoreEffect1 effect) { super(effect); } - + @Override public boolean apply(Game game, Ability source) { - Player controller = game.getPlayer(source.getControllerId()); + Player controller = game.getPlayer(source.getControllerId()); if (controller != null) { Choice cardChoice = new ChoiceImpl(); cardChoice.setChoices(Sets.getNonLandCardNames()); @@ -109,7 +109,7 @@ class NevermoreEffect1 extends OneShotEffect { public NevermoreEffect1 copy() { return new NevermoreEffect1(this); } - + } class NevermoreEffect2 extends ReplacementEffectImpl { @@ -118,11 +118,11 @@ class NevermoreEffect2 extends ReplacementEffectImpl { super(Duration.WhileOnBattlefield, Outcome.Detriment); staticText = "The named card can't be cast"; } - + public NevermoreEffect2(final NevermoreEffect2 effect) { super(effect); } - + @Override public boolean apply(Game game, Ability source) { return true; @@ -148,5 +148,5 @@ class NevermoreEffect2 extends ReplacementEffectImpl { } return false; } - + } diff --git a/Mage.Sets/src/mage/sets/innistrad/ParallelLives.java b/Mage.Sets/src/mage/sets/innistrad/ParallelLives.java index c050fd4de1..3064c4a8b9 100644 --- a/Mage.Sets/src/mage/sets/innistrad/ParallelLives.java +++ b/Mage.Sets/src/mage/sets/innistrad/ParallelLives.java @@ -69,40 +69,40 @@ public class ParallelLives extends CardImpl { class ParallelLivesEffect extends ReplacementEffectImpl { - public ParallelLivesEffect() { - super(Duration.WhileOnBattlefield, Outcome.Copy); - staticText = "If an effect would put one or more tokens onto the battlefield under your control, it puts twice that many of those tokens onto the battlefield instead"; - } + public ParallelLivesEffect() { + super(Duration.WhileOnBattlefield, Outcome.Copy); + staticText = "If an effect would put one or more tokens onto the battlefield under your control, it puts twice that many of those tokens onto the battlefield instead"; + } - public ParallelLivesEffect(final ParallelLivesEffect effect) { - super(effect); - } + public ParallelLivesEffect(final ParallelLivesEffect effect) { + super(effect); + } - @Override - public ParallelLivesEffect copy() { - return new ParallelLivesEffect(this); - } + @Override + public ParallelLivesEffect copy() { + return new ParallelLivesEffect(this); + } - @Override - public boolean applies(GameEvent event, Ability source, Game game) { - switch (event.getType()) { - case CREATE_TOKEN: - StackObject spell = game.getStack().getStackObject(event.getSourceId()); - if (spell != null && spell.getControllerId().equals(source.getControllerId())) { - event.setAmount(event.getAmount() * 2); - } - } - return false; - } + @Override + public boolean applies(GameEvent event, Ability source, Game game) { + switch (event.getType()) { + case CREATE_TOKEN: + StackObject spell = game.getStack().getStackObject(event.getSourceId()); + if (spell != null && spell.getControllerId().equals(source.getControllerId())) { + event.setAmount(event.getAmount() * 2); + } + } + return false; + } - @Override - public boolean apply(Game game, Ability source) { - return true; - } + @Override + public boolean apply(Game game, Ability source) { + return true; + } - @Override - public boolean replaceEvent(GameEvent event, Ability source, Game game) { - return apply(game, source); - } + @Override + public boolean replaceEvent(GameEvent event, Ability source, Game game) { + return apply(game, source); + } } \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/innistrad/PastInFlames.java b/Mage.Sets/src/mage/sets/innistrad/PastInFlames.java index 4f25d3cf4e..304791b07f 100644 --- a/Mage.Sets/src/mage/sets/innistrad/PastInFlames.java +++ b/Mage.Sets/src/mage/sets/innistrad/PastInFlames.java @@ -58,7 +58,7 @@ public class PastInFlames extends CardImpl { // Each instant and sorcery card in your graveyard gains flashback until end of turn. The flashback cost is equal to its mana cost. this.getSpellAbility().addEffect(new PastInFlamesEffect()); - + // Flashback {4}{R} this.addAbility(new FlashbackAbility(new ManaCostsImpl("{4}{R}"), TimingRule.SORCERY)); @@ -76,20 +76,20 @@ public class PastInFlames extends CardImpl { class PastInFlamesEffect extends ContinuousEffectImpl { - public PastInFlamesEffect() { - super(Duration.EndOfTurn, Layer.AbilityAddingRemovingEffects_6, SubLayer.NA, Outcome.AddAbility); + public PastInFlamesEffect() { + super(Duration.EndOfTurn, Layer.AbilityAddingRemovingEffects_6, SubLayer.NA, Outcome.AddAbility); this.staticText = "Each instant and sorcery card in your graveyard gains flashback until end of turn. The flashback cost is equal to its mana cost"; - } + } - public PastInFlamesEffect(final PastInFlamesEffect effect) { - super(effect); - } + public PastInFlamesEffect(final PastInFlamesEffect effect) { + super(effect); + } + + @Override + public PastInFlamesEffect copy() { + return new PastInFlamesEffect(this); + } - @Override - public PastInFlamesEffect copy() { - return new PastInFlamesEffect(this); - } - @Override public void init(Ability source, Game game) { super.init(source, game); @@ -106,8 +106,8 @@ class PastInFlamesEffect extends ContinuousEffectImpl { } } - @Override - public boolean apply(Game game, Ability source) { + @Override + public boolean apply(Game game, Ability source) { Player player = game.getPlayer(source.getControllerId()); if (player != null) { for (UUID cardId: player.getGraveyard()) { @@ -127,6 +127,6 @@ class PastInFlamesEffect extends ContinuousEffectImpl { } return true; } - return false; - } + return false; + } } \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/innistrad/PreyUpon.java b/Mage.Sets/src/mage/sets/innistrad/PreyUpon.java index 5f88d20341..0b1a5b42c3 100644 --- a/Mage.Sets/src/mage/sets/innistrad/PreyUpon.java +++ b/Mage.Sets/src/mage/sets/innistrad/PreyUpon.java @@ -44,11 +44,11 @@ import mage.target.common.TargetCreaturePermanent; public class PreyUpon extends CardImpl { private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("creature you don't control"); - + static { filter.setTargetController(TargetController.NOT_YOU); } - + public PreyUpon(UUID ownerId) { super(ownerId, 200, "Prey Upon", Rarity.COMMON, new CardType[]{CardType.SORCERY}, "{G}"); this.expansionSetCode = "ISD"; diff --git a/Mage.Sets/src/mage/sets/innistrad/RakishHeir.java b/Mage.Sets/src/mage/sets/innistrad/RakishHeir.java index 32c7cfd346..22b2027a69 100644 --- a/Mage.Sets/src/mage/sets/innistrad/RakishHeir.java +++ b/Mage.Sets/src/mage/sets/innistrad/RakishHeir.java @@ -102,7 +102,7 @@ class RakishHeirTriggeredAbility extends TriggeredAbilityImpl { - public RallyThePeasants(UUID ownerId) { - super(ownerId, 28, "Rally the Peasants", Rarity.UNCOMMON, new CardType[]{CardType.INSTANT}, "{2}{W}"); - this.expansionSetCode = "ISD"; + public RallyThePeasants(UUID ownerId) { + super(ownerId, 28, "Rally the Peasants", Rarity.UNCOMMON, new CardType[]{CardType.INSTANT}, "{2}{W}"); + this.expansionSetCode = "ISD"; - this.color.setWhite(true); + this.color.setWhite(true); - // Creatures you control get +2/+0 until end of turn. - this.getSpellAbility().addEffect(new BoostControlledEffect(2, 0, Constants.Duration.EndOfTurn)); + // Creatures you control get +2/+0 until end of turn. + this.getSpellAbility().addEffect(new BoostControlledEffect(2, 0, Constants.Duration.EndOfTurn)); - // Flashback {2}{R} - this.addAbility(new FlashbackAbility(new ManaCostsImpl("{2}{R}"), Constants.TimingRule.INSTANT)); - } + // Flashback {2}{R} + this.addAbility(new FlashbackAbility(new ManaCostsImpl("{2}{R}"), Constants.TimingRule.INSTANT)); + } - public RallyThePeasants(final RallyThePeasants card) { - super(card); - } + public RallyThePeasants(final RallyThePeasants card) { + super(card); + } - @Override - public RallyThePeasants copy() { - return new RallyThePeasants(this); - } + @Override + public RallyThePeasants copy() { + return new RallyThePeasants(this); + } } diff --git a/Mage.Sets/src/mage/sets/innistrad/ReaperFromTheAbyss.java b/Mage.Sets/src/mage/sets/innistrad/ReaperFromTheAbyss.java index a7da98ed1e..39408dd3c2 100644 --- a/Mage.Sets/src/mage/sets/innistrad/ReaperFromTheAbyss.java +++ b/Mage.Sets/src/mage/sets/innistrad/ReaperFromTheAbyss.java @@ -51,39 +51,39 @@ import mage.watchers.Watcher; public class ReaperFromTheAbyss extends CardImpl { private static FilterCreaturePermanent filter = new FilterCreaturePermanent("non-Demon creature"); - + static { filter.getSubtype().add("Demon"); filter.setNotSubtype(true); } public ReaperFromTheAbyss(UUID ownerId) { - super(ownerId, 112, "Reaper from the Abyss", Rarity.MYTHIC, new CardType[]{CardType.CREATURE}, "{3}{B}{B}{B}"); - this.expansionSetCode = "ISD"; - this.subtype.add("Demon"); - this.color.setBlack(true); - this.power = new MageInt(6); - this.toughness = new MageInt(6); + super(ownerId, 112, "Reaper from the Abyss", Rarity.MYTHIC, new CardType[]{CardType.CREATURE}, "{3}{B}{B}{B}"); + this.expansionSetCode = "ISD"; + this.subtype.add("Demon"); + this.color.setBlack(true); + this.power = new MageInt(6); + this.toughness = new MageInt(6); - this.addAbility(FlyingAbility.getInstance()); + this.addAbility(FlyingAbility.getInstance()); Ability ability = new ReaperFromTheAbyssAbility(); ability.addTarget(new TargetCreaturePermanent(filter)); this.addAbility(ability); - } + } - public ReaperFromTheAbyss(final ReaperFromTheAbyss card) { - super(card); - } + public ReaperFromTheAbyss(final ReaperFromTheAbyss card) { + super(card); + } - @Override - public ReaperFromTheAbyss copy() { - return new ReaperFromTheAbyss(this); - } + @Override + public ReaperFromTheAbyss copy() { + return new ReaperFromTheAbyss(this); + } } class ReaperFromTheAbyssAbility extends TriggeredAbilityImpl { - + public ReaperFromTheAbyssAbility() { super(Constants.Zone.BATTLEFIELD, new DestroyTargetEffect(), false); } @@ -102,8 +102,8 @@ class ReaperFromTheAbyssAbility extends TriggeredAbilityImpl { this.color.setBlue(true); // You may pay {0} rather than pay the mana cost for Zombie creature spells you cast. - this.addAbility(new SimpleStaticAbility(Constants.Zone.BATTLEFIELD, new RooftopStormCostReductionEffect())); - + this.addAbility(new SimpleStaticAbility(Constants.Zone.BATTLEFIELD, new RooftopStormCostReductionEffect())); + } public RooftopStorm(final RooftopStorm card) { @@ -100,29 +100,29 @@ public class RooftopStorm extends CardImpl { class RooftopStormCostReductionEffect extends CostModificationEffectImpl { - private static final String effectText = "You may pay {0} rather than pay the mana cost for Zombie creature spells you cast"; + private static final String effectText = "You may pay {0} rather than pay the mana cost for Zombie creature spells you cast"; - RooftopStormCostReductionEffect() { - super(Constants.Duration.WhileOnBattlefield, Constants.Outcome.Benefit); - staticText = effectText; - } + RooftopStormCostReductionEffect() { + super(Constants.Duration.WhileOnBattlefield, Constants.Outcome.Benefit); + staticText = effectText; + } - RooftopStormCostReductionEffect(RooftopStormCostReductionEffect effect) { - super(effect); - } + RooftopStormCostReductionEffect(RooftopStormCostReductionEffect effect) { + super(effect); + } - @Override - public boolean apply(Game game, Ability source, Ability abilityToModify) { - SpellAbility spellAbility = (SpellAbility) abilityToModify; - CardUtil.adjustCost(spellAbility, 2); - return true; - } + @Override + public boolean apply(Game game, Ability source, Ability abilityToModify) { + SpellAbility spellAbility = (SpellAbility) abilityToModify; + CardUtil.adjustCost(spellAbility, 2); + return true; + } - @Override - public boolean applies(Ability abilityToModify, Ability source, Game game) { - if (abilityToModify instanceof SpellAbility) { + @Override + public boolean applies(Ability abilityToModify, Ability source, Game game) { + if (abilityToModify instanceof SpellAbility) { SpellAbility spell = (SpellAbility) abilityToModify; - if (spell.getControllerId().equals(source.getControllerId())) { + if (spell.getControllerId().equals(source.getControllerId())) { Card sourceCard = game.getCard(spell.getSourceId()); if (sourceCard != null && sourceCard.getSubtype().contains("Zombie")) { Player player = game.getPlayer(spell.getControllerId()); @@ -133,13 +133,13 @@ class RooftopStormCostReductionEffect extends CostModificationEffectImpl { private static final FilterCard filter = new FilterCard("exiled card with flashback you own"); - + static { filter.setTargetOwner(TargetController.YOU); filter.getAbilities().add(new FlashbackAbility(new ManaCostsImpl("{0}"), TimingRule.INSTANT)); } - + public RunicRepetition(UUID ownerId) { super(ownerId, 72, "Runic Repetition", Rarity.UNCOMMON, new CardType[]{CardType.SORCERY}, "{2}{U}"); this.expansionSetCode = "ISD"; @@ -72,5 +72,5 @@ public class RunicRepetition extends CardImpl { public RunicRepetition copy() { return new RunicRepetition(this); } - + } diff --git a/Mage.Sets/src/mage/sets/innistrad/SilentDeparture.java b/Mage.Sets/src/mage/sets/innistrad/SilentDeparture.java index f8ec21b87b..a43f7aaea4 100644 --- a/Mage.Sets/src/mage/sets/innistrad/SilentDeparture.java +++ b/Mage.Sets/src/mage/sets/innistrad/SilentDeparture.java @@ -52,7 +52,7 @@ public class SilentDeparture extends CardImpl { // Return target creature to its owner's hand. this.getSpellAbility().addTarget(new TargetCreaturePermanent()); - this.getSpellAbility().addEffect(new ReturnToHandTargetEffect()); + this.getSpellAbility().addEffect(new ReturnToHandTargetEffect()); // Flashback {4}{U} this.addAbility(new FlashbackAbility(new ManaCostsImpl("{4}{U}"), Constants.TimingRule.SORCERY)); diff --git a/Mage.Sets/src/mage/sets/innistrad/SkaabRuinator.java b/Mage.Sets/src/mage/sets/innistrad/SkaabRuinator.java index ca80654f4a..1e1f5dc60c 100644 --- a/Mage.Sets/src/mage/sets/innistrad/SkaabRuinator.java +++ b/Mage.Sets/src/mage/sets/innistrad/SkaabRuinator.java @@ -68,11 +68,11 @@ public class SkaabRuinator extends CardImpl { // As an additional cost to cast Skaab Ruinator, exile three creature cards from your graveyard. this.getSpellAbility().addCost(new ExileFromGraveCost(new TargetCardInYourGraveyard(3, 3, new FilterCreatureCard("creature card from your graveyard")))); - + this.addAbility(FlyingAbility.getInstance()); // You may cast Skaab Ruinator from your graveyard. this.addAbility(new SkaabRuinatorAbility(new ManaCostsImpl("{1}{U}{U}"), TimingRule.INSTANT)); - + } public SkaabRuinator(final SkaabRuinator card) { @@ -87,65 +87,65 @@ public class SkaabRuinator extends CardImpl { class SkaabRuinatorAbility extends ActivatedAbilityImpl { - public SkaabRuinatorAbility(ManaCosts costs, Constants.TimingRule timingRule) { - super(Constants.Zone.GRAVEYARD, new SkaabRuinatorEffect(), costs); - this.timing = TimingRule.SORCERY; - this.addCost(new ExileFromGraveCost(new TargetCardInYourGraveyard(3, 3, new FilterCreatureCard("creature card from your graveyard")))); - this.usesStack = false; - } + public SkaabRuinatorAbility(ManaCosts costs, Constants.TimingRule timingRule) { + super(Constants.Zone.GRAVEYARD, new SkaabRuinatorEffect(), costs); + this.timing = TimingRule.SORCERY; + this.addCost(new ExileFromGraveCost(new TargetCardInYourGraveyard(3, 3, new FilterCreatureCard("creature card from your graveyard")))); + this.usesStack = false; + } - @Override - public boolean activate(Game game, boolean noMana) { - Card card = game.getCard(sourceId); - if (card != null) { - getEffects().get(0).setTargetPointer(new FixedTarget(card.getId())); - return super.activate(game, noMana); - } - return false; - } + @Override + public boolean activate(Game game, boolean noMana) { + Card card = game.getCard(sourceId); + if (card != null) { + getEffects().get(0).setTargetPointer(new FixedTarget(card.getId())); + return super.activate(game, noMana); + } + return false; + } - public SkaabRuinatorAbility(final SkaabRuinatorAbility ability) { - super(ability); - } + public SkaabRuinatorAbility(final SkaabRuinatorAbility ability) { + super(ability); + } - @Override - public SkaabRuinatorAbility copy() { - return new SkaabRuinatorAbility(this); - } + @Override + public SkaabRuinatorAbility copy() { + return new SkaabRuinatorAbility(this); + } - @Override - public String getRule() { - return "You may cast Skaab Ruinator from your graveyard."; - } + @Override + public String getRule() { + return "You may cast Skaab Ruinator from your graveyard."; + } } class SkaabRuinatorEffect extends OneShotEffect { - public SkaabRuinatorEffect() { - // should it be? - super(Constants.Outcome.PutCreatureInPlay); - staticText = ""; - } + public SkaabRuinatorEffect() { + // should it be? + super(Constants.Outcome.PutCreatureInPlay); + staticText = ""; + } - public SkaabRuinatorEffect(final SkaabRuinatorEffect effect) { - super(effect); - } + public SkaabRuinatorEffect(final SkaabRuinatorEffect effect) { + super(effect); + } - @Override - public SkaabRuinatorEffect copy() { - return new SkaabRuinatorEffect(this); - } + @Override + public SkaabRuinatorEffect copy() { + return new SkaabRuinatorEffect(this); + } - @Override - public boolean apply(Game game, Ability source) { - Card target = (Card) game.getObject(targetPointer.getFirst(game, source)); - if (target != null) { - Player controller = game.getPlayer(target.getOwnerId()); - if (controller != null) { - //return controller.cast(target.getSpellAbility(), game, true); - return target.cast(game, Zone.GRAVEYARD, target.getSpellAbility(), controller.getId()); - } - } - return false; - } + @Override + public boolean apply(Game game, Ability source) { + Card target = (Card) game.getObject(targetPointer.getFirst(game, source)); + if (target != null) { + Player controller = game.getPlayer(target.getOwnerId()); + if (controller != null) { + //return controller.cast(target.getSpellAbility(), game, true); + return target.cast(game, Zone.GRAVEYARD, target.getSpellAbility(), controller.getId()); + } + } + return false; + } } diff --git a/Mage.Sets/src/mage/sets/innistrad/SkirsdagCultist.java b/Mage.Sets/src/mage/sets/innistrad/SkirsdagCultist.java index 0e93b01e01..1e52b25bd5 100644 --- a/Mage.Sets/src/mage/sets/innistrad/SkirsdagCultist.java +++ b/Mage.Sets/src/mage/sets/innistrad/SkirsdagCultist.java @@ -48,30 +48,30 @@ import java.util.UUID; */ public class SkirsdagCultist extends CardImpl { - public SkirsdagCultist(UUID ownerId) { - super(ownerId, 163, "Skirsdag Cultist", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{2}{R}{R}"); - this.expansionSetCode = "ISD"; - this.subtype.add("Human"); - this.subtype.add("Shaman"); + public SkirsdagCultist(UUID ownerId) { + super(ownerId, 163, "Skirsdag Cultist", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{2}{R}{R}"); + this.expansionSetCode = "ISD"; + this.subtype.add("Human"); + this.subtype.add("Shaman"); - this.color.setRed(true); - this.power = new MageInt(2); - this.toughness = new MageInt(2); + this.color.setRed(true); + this.power = new MageInt(2); + this.toughness = new MageInt(2); - // {R}, {T}, Sacrifice a creature: Skirsdag Cultist deals 2 damage to target creature or player. - Ability ability = new SimpleActivatedAbility(Constants.Zone.BATTLEFIELD, new DamageTargetEffect(2), new ManaCostsImpl("{R}")); - ability.addCost(new TapSourceCost()); - ability.addCost(new SacrificeTargetCost(new TargetControlledCreaturePermanent())); - ability.addTarget(new TargetCreatureOrPlayer()); - this.addAbility(ability); - } + // {R}, {T}, Sacrifice a creature: Skirsdag Cultist deals 2 damage to target creature or player. + Ability ability = new SimpleActivatedAbility(Constants.Zone.BATTLEFIELD, new DamageTargetEffect(2), new ManaCostsImpl("{R}")); + ability.addCost(new TapSourceCost()); + ability.addCost(new SacrificeTargetCost(new TargetControlledCreaturePermanent())); + ability.addTarget(new TargetCreatureOrPlayer()); + this.addAbility(ability); + } - public SkirsdagCultist(final SkirsdagCultist card) { - super(card); - } + public SkirsdagCultist(final SkirsdagCultist card) { + super(card); + } - @Override - public SkirsdagCultist copy() { - return new SkirsdagCultist(this); - } + @Override + public SkirsdagCultist copy() { + return new SkirsdagCultist(this); + } } diff --git a/Mage.Sets/src/mage/sets/innistrad/SnapcasterMage.java b/Mage.Sets/src/mage/sets/innistrad/SnapcasterMage.java index 91df7ef935..59de40467b 100644 --- a/Mage.Sets/src/mage/sets/innistrad/SnapcasterMage.java +++ b/Mage.Sets/src/mage/sets/innistrad/SnapcasterMage.java @@ -54,13 +54,13 @@ import mage.target.common.TargetCardInYourGraveyard; */ public class SnapcasterMage extends CardImpl { - private static final FilterCard filter = new FilterCard("instant or sorcery card in your graveyard"); + private static final FilterCard filter = new FilterCard("instant or sorcery card in your graveyard"); - static { - filter.getCardType().add(CardType.INSTANT); - filter.getCardType().add(CardType.SORCERY); - filter.setScopeCardType(ComparisonScope.Any); - } + static { + filter.getCardType().add(CardType.INSTANT); + filter.getCardType().add(CardType.SORCERY); + filter.setScopeCardType(ComparisonScope.Any); + } public SnapcasterMage(UUID ownerId) { super(ownerId, 78, "Snapcaster Mage", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{1}{U}"); @@ -77,7 +77,7 @@ public class SnapcasterMage extends CardImpl { Ability ability = new EntersBattlefieldTriggeredAbility(new SnapcasterMageEffect()); ability.addTarget(new TargetCardInYourGraveyard(filter)); this.addAbility(ability); - + } public SnapcasterMage(final SnapcasterMage card) { @@ -92,24 +92,24 @@ public class SnapcasterMage extends CardImpl { class SnapcasterMageEffect extends ContinuousEffectImpl { - public SnapcasterMageEffect() { - super(Duration.EndOfTurn, Layer.AbilityAddingRemovingEffects_6, SubLayer.NA, Outcome.AddAbility); + public SnapcasterMageEffect() { + super(Duration.EndOfTurn, Layer.AbilityAddingRemovingEffects_6, SubLayer.NA, Outcome.AddAbility); this.staticText = "target instant or sorcery card in your graveyard gains flashback until end of turn. The flashback cost is equal to its mana cost"; - } + } - public SnapcasterMageEffect(final SnapcasterMageEffect effect) { - super(effect); - } + public SnapcasterMageEffect(final SnapcasterMageEffect effect) { + super(effect); + } - @Override - public SnapcasterMageEffect copy() { - return new SnapcasterMageEffect(this); - } + @Override + public SnapcasterMageEffect copy() { + return new SnapcasterMageEffect(this); + } - @Override - public boolean apply(Game game, Ability source) { - Card card = game.getCard(targetPointer.getFirst(game, source)); - if (card != null) { + @Override + public boolean apply(Game game, Ability source) { + Card card = game.getCard(targetPointer.getFirst(game, source)); + if (card != null) { FlashbackAbility ability; if (card.getCardType().contains(CardType.INSTANT)) ability = new FlashbackAbility(card.getManaCost(), TimingRule.INSTANT); @@ -119,7 +119,7 @@ class SnapcasterMageEffect extends ContinuousEffectImpl { ability.setControllerId(card.getOwnerId()); game.getState().addOtherAbility(card.getId(), ability); return true; - } - return false; - } + } + return false; + } } \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/innistrad/SpectralFlight.java b/Mage.Sets/src/mage/sets/innistrad/SpectralFlight.java index 26fc44deeb..0f6479d905 100644 --- a/Mage.Sets/src/mage/sets/innistrad/SpectralFlight.java +++ b/Mage.Sets/src/mage/sets/innistrad/SpectralFlight.java @@ -58,14 +58,14 @@ public class SpectralFlight extends CardImpl { // Enchant creature TargetPermanent target = new TargetCreaturePermanent(); - this.getSpellAbility().addTarget(target); - this.getSpellAbility().addEffect(new AttachEffect(Constants.Outcome.AddAbility)); - Ability ability = new EnchantAbility(target.getTargetName()); - this.addAbility(ability); - + this.getSpellAbility().addTarget(target); + this.getSpellAbility().addEffect(new AttachEffect(Constants.Outcome.AddAbility)); + Ability ability = new EnchantAbility(target.getTargetName()); + this.addAbility(ability); + // Enchanted creature gets +2/+2 and has flying. - this.addAbility(new SimpleStaticAbility(Constants.Zone.BATTLEFIELD, new BoostEnchantedEffect(2, 2, Constants.Duration.WhileOnBattlefield))); - this.addAbility(new SimpleStaticAbility(Constants.Zone.BATTLEFIELD, new GainAbilityAttachedEffect(FlyingAbility.getInstance(), Constants.AttachmentType.AURA))); + this.addAbility(new SimpleStaticAbility(Constants.Zone.BATTLEFIELD, new BoostEnchantedEffect(2, 2, Constants.Duration.WhileOnBattlefield))); + this.addAbility(new SimpleStaticAbility(Constants.Zone.BATTLEFIELD, new GainAbilityAttachedEffect(FlyingAbility.getInstance(), Constants.AttachmentType.AURA))); } public SpectralFlight(final SpectralFlight card) { diff --git a/Mage.Sets/src/mage/sets/innistrad/SpideryGrasp.java b/Mage.Sets/src/mage/sets/innistrad/SpideryGrasp.java index 01cfcd1eae..c920f806f6 100644 --- a/Mage.Sets/src/mage/sets/innistrad/SpideryGrasp.java +++ b/Mage.Sets/src/mage/sets/innistrad/SpideryGrasp.java @@ -44,24 +44,24 @@ import java.util.UUID; */ public class SpideryGrasp extends CardImpl { - public SpideryGrasp(UUID ownerId) { - super(ownerId, 204, "Spidery Grasp", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{2}{G}"); - this.expansionSetCode = "ISD"; - this.color.setGreen(true); + public SpideryGrasp(UUID ownerId) { + super(ownerId, 204, "Spidery Grasp", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{2}{G}"); + this.expansionSetCode = "ISD"; + this.color.setGreen(true); - // Untap target creature. It gets +2/+4 and gains reach until end of turn. - this.getSpellAbility().addEffect(new UntapTargetEffect()); - this.getSpellAbility().addEffect(new GainAbilityTargetEffect(ReachAbility.getInstance(), Constants.Duration.EndOfTurn)); - this.getSpellAbility().addEffect(new BoostTargetEffect(2, 4, Constants.Duration.EndOfTurn)); - this.getSpellAbility().addTarget(new TargetCreaturePermanent()); - } + // Untap target creature. It gets +2/+4 and gains reach until end of turn. + this.getSpellAbility().addEffect(new UntapTargetEffect()); + this.getSpellAbility().addEffect(new GainAbilityTargetEffect(ReachAbility.getInstance(), Constants.Duration.EndOfTurn)); + this.getSpellAbility().addEffect(new BoostTargetEffect(2, 4, Constants.Duration.EndOfTurn)); + this.getSpellAbility().addTarget(new TargetCreaturePermanent()); + } - public SpideryGrasp(final SpideryGrasp card) { - super(card); - } + public SpideryGrasp(final SpideryGrasp card) { + super(card); + } - @Override - public SpideryGrasp copy() { - return new SpideryGrasp(this); - } + @Override + public SpideryGrasp copy() { + return new SpideryGrasp(this); + } } diff --git a/Mage.Sets/src/mage/sets/innistrad/StensiaBloodhall.java b/Mage.Sets/src/mage/sets/innistrad/StensiaBloodhall.java index 7bd97e7ab1..a4c7f83b3e 100644 --- a/Mage.Sets/src/mage/sets/innistrad/StensiaBloodhall.java +++ b/Mage.Sets/src/mage/sets/innistrad/StensiaBloodhall.java @@ -46,26 +46,26 @@ import java.util.UUID; */ public class StensiaBloodhall extends CardImpl { - public StensiaBloodhall(UUID ownerId) { - super(ownerId, 247, "Stensia Bloodhall", Rarity.RARE, new CardType[]{CardType.LAND}, ""); - this.expansionSetCode = "ISD"; + public StensiaBloodhall(UUID ownerId) { + super(ownerId, 247, "Stensia Bloodhall", Rarity.RARE, new CardType[]{CardType.LAND}, ""); + this.expansionSetCode = "ISD"; - // {T}: Add {1} to your mana pool. - this.addAbility(new ColorlessManaAbility()); + // {T}: Add {1} to your mana pool. + this.addAbility(new ColorlessManaAbility()); - // {3}{B}{R}, {T}: Stensia Bloodhall deals 2 damage to target player. - Ability ability = new SimpleActivatedAbility(Constants.Zone.BATTLEFIELD, new DamageTargetEffect(2), new ManaCostsImpl("{3}{B}{R}")); - ability.addCost(new TapSourceCost()); - ability.addTarget(new TargetPlayer()); - this.addAbility(ability); - } + // {3}{B}{R}, {T}: Stensia Bloodhall deals 2 damage to target player. + Ability ability = new SimpleActivatedAbility(Constants.Zone.BATTLEFIELD, new DamageTargetEffect(2), new ManaCostsImpl("{3}{B}{R}")); + ability.addCost(new TapSourceCost()); + ability.addTarget(new TargetPlayer()); + this.addAbility(ability); + } - public StensiaBloodhall(final StensiaBloodhall card) { - super(card); - } + public StensiaBloodhall(final StensiaBloodhall card) { + super(card); + } - @Override - public StensiaBloodhall copy() { - return new StensiaBloodhall(this); - } + @Override + public StensiaBloodhall copy() { + return new StensiaBloodhall(this); + } } diff --git a/Mage.Sets/src/mage/sets/innistrad/StitchedDrake.java b/Mage.Sets/src/mage/sets/innistrad/StitchedDrake.java index 1eea60cfba..9a3976212d 100644 --- a/Mage.Sets/src/mage/sets/innistrad/StitchedDrake.java +++ b/Mage.Sets/src/mage/sets/innistrad/StitchedDrake.java @@ -43,28 +43,28 @@ import java.util.UUID; */ public class StitchedDrake extends CardImpl { - public StitchedDrake(UUID ownerId) { - super(ownerId, 80, "Stitched Drake", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{1}{U}{U}"); - this.expansionSetCode = "ISD"; - this.subtype.add("Zombie"); - this.subtype.add("Drake"); + public StitchedDrake(UUID ownerId) { + super(ownerId, 80, "Stitched Drake", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{1}{U}{U}"); + this.expansionSetCode = "ISD"; + this.subtype.add("Zombie"); + this.subtype.add("Drake"); - this.color.setBlue(true); - this.power = new MageInt(3); - this.toughness = new MageInt(4); + this.color.setBlue(true); + this.power = new MageInt(3); + this.toughness = new MageInt(4); - this.addAbility(FlyingAbility.getInstance()); + this.addAbility(FlyingAbility.getInstance()); - // As an addition cost to cast Stitched Drake, exile a creature card from your graveyard. - this.getSpellAbility().addCost(new ExileFromGraveCost(new TargetCardInYourGraveyard(new FilterCreatureCard("creature card from your graveyard")))); - } + // As an addition cost to cast Stitched Drake, exile a creature card from your graveyard. + this.getSpellAbility().addCost(new ExileFromGraveCost(new TargetCardInYourGraveyard(new FilterCreatureCard("creature card from your graveyard")))); + } - public StitchedDrake(final StitchedDrake card) { - super(card); - } + public StitchedDrake(final StitchedDrake card) { + super(card); + } - @Override - public StitchedDrake copy() { - return new StitchedDrake(this); - } + @Override + public StitchedDrake copy() { + return new StitchedDrake(this); + } } diff --git a/Mage.Sets/src/mage/sets/innistrad/StonySilence.java b/Mage.Sets/src/mage/sets/innistrad/StonySilence.java index c01dea77af..9e014e8982 100644 --- a/Mage.Sets/src/mage/sets/innistrad/StonySilence.java +++ b/Mage.Sets/src/mage/sets/innistrad/StonySilence.java @@ -56,7 +56,7 @@ public class StonySilence extends CardImpl { // Activated abilities of artifacts can't be activated. this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new StonySilenceEffect())); - + } public StonySilence(final StonySilence card) { @@ -68,18 +68,18 @@ public class StonySilence extends CardImpl { return new StonySilence(this); } } - + class StonySilenceEffect extends ReplacementEffectImpl { public StonySilenceEffect() { super(Duration.WhileOnBattlefield, Outcome.Detriment); staticText = "Activated abilities of artifacts can't be activated"; } - + public StonySilenceEffect(final StonySilenceEffect effect) { super(effect); } - + @Override public boolean apply(Game game, Ability source) { return true; @@ -105,5 +105,5 @@ class StonySilenceEffect extends ReplacementEffectImpl { } return false; } - + } diff --git a/Mage.Sets/src/mage/sets/innistrad/StromkirkNoble.java b/Mage.Sets/src/mage/sets/innistrad/StromkirkNoble.java index a15aed4a9c..97ff697465 100644 --- a/Mage.Sets/src/mage/sets/innistrad/StromkirkNoble.java +++ b/Mage.Sets/src/mage/sets/innistrad/StromkirkNoble.java @@ -64,7 +64,7 @@ public class StromkirkNoble extends CardImpl { this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new StromkirkEffect())); // Whenever Stromkirk Noble deals combat damage to a player, put a +1/+1 counter on it. this.addAbility(new DealsCombatDamageToAPlayerTriggeredAbility(new AddCountersSourceEffect(CounterType.P1P1.createInstance()), false)); - + } public StromkirkNoble(final StromkirkNoble card) { @@ -79,30 +79,30 @@ public class StromkirkNoble extends CardImpl { class StromkirkEffect extends RestrictionEffect { - public StromkirkEffect() { - super(Duration.WhileOnBattlefield); - } + public StromkirkEffect() { + super(Duration.WhileOnBattlefield); + } - public StromkirkEffect(final StromkirkEffect effect) { - super(effect); - } + public StromkirkEffect(final StromkirkEffect effect) { + super(effect); + } @Override - public boolean applies(Permanent permanent, Ability source, Game game) { - if (permanent.getId().equals(source.getSourceId())) { - return true; - } - return false; - } + public boolean applies(Permanent permanent, Ability source, Game game) { + if (permanent.getId().equals(source.getSourceId())) { + return true; + } + return false; + } - @Override - public boolean canBeBlocked(Permanent attacker, Permanent blocker, Ability source, Game game) { - return !blocker.hasSubtype("Human"); - } + @Override + public boolean canBeBlocked(Permanent attacker, Permanent blocker, Ability source, Game game) { + return !blocker.hasSubtype("Human"); + } - @Override - public StromkirkEffect copy() { - return new StromkirkEffect(this); - } + @Override + public StromkirkEffect copy() { + return new StromkirkEffect(this); + } } \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/innistrad/SulfurFalls.java b/Mage.Sets/src/mage/sets/innistrad/SulfurFalls.java index 4e4bd9017f..4c9bf1c0f7 100644 --- a/Mage.Sets/src/mage/sets/innistrad/SulfurFalls.java +++ b/Mage.Sets/src/mage/sets/innistrad/SulfurFalls.java @@ -49,32 +49,32 @@ import java.util.UUID; */ public class SulfurFalls extends CardImpl { - private static final FilterLandPermanent filter = new FilterLandPermanent(); + private static final FilterLandPermanent filter = new FilterLandPermanent(); - static { - filter.getSubtype().add("Island"); - filter.getSubtype().add("Mountain"); - filter.setScopeSubtype(ComparisonScope.Any); - filter.setMessage("Island or a Mountain"); - } + static { + filter.getSubtype().add("Island"); + filter.getSubtype().add("Mountain"); + filter.setScopeSubtype(ComparisonScope.Any); + filter.setMessage("Island or a Mountain"); + } - public SulfurFalls(UUID ownerId) { - super(ownerId, 248, "Sulfur Falls", Rarity.RARE, new CardType[]{CardType.LAND}, null); - this.expansionSetCode = "ISD"; + public SulfurFalls(UUID ownerId) { + super(ownerId, 248, "Sulfur Falls", Rarity.RARE, new CardType[]{CardType.LAND}, null); + this.expansionSetCode = "ISD"; - Condition controls = new UnlessCondition(new ControlsPermanentCondition(filter, ControlsPermanentCondition.CountType.MORE_THAN, 0)); - String abilityText = "tap it unless you control a " + filter.getMessage(); - this.addAbility(new EntersBattlefieldAbility(new ConditionalOneShotEffect(new TapSourceEffect(), controls, abilityText), abilityText)); - this.addAbility(new BlueManaAbility()); - this.addAbility(new RedManaAbility()); - } + Condition controls = new UnlessCondition(new ControlsPermanentCondition(filter, ControlsPermanentCondition.CountType.MORE_THAN, 0)); + String abilityText = "tap it unless you control a " + filter.getMessage(); + this.addAbility(new EntersBattlefieldAbility(new ConditionalOneShotEffect(new TapSourceEffect(), controls, abilityText), abilityText)); + this.addAbility(new BlueManaAbility()); + this.addAbility(new RedManaAbility()); + } - public SulfurFalls(final SulfurFalls card) { - super(card); - } + public SulfurFalls(final SulfurFalls card) { + super(card); + } - @Override - public SulfurFalls copy() { - return new SulfurFalls(this); - } + @Override + public SulfurFalls copy() { + return new SulfurFalls(this); + } } diff --git a/Mage.Sets/src/mage/sets/innistrad/TreeOfRedemption.java b/Mage.Sets/src/mage/sets/innistrad/TreeOfRedemption.java index 7896b701d3..efecaa39bd 100644 --- a/Mage.Sets/src/mage/sets/innistrad/TreeOfRedemption.java +++ b/Mage.Sets/src/mage/sets/innistrad/TreeOfRedemption.java @@ -61,7 +61,7 @@ public class TreeOfRedemption extends CardImpl { this.toughness = new MageInt(13); this.addAbility(DefenderAbility.getInstance()); - + // {tap}: Exchange your life total with Tree of Redemption's toughness. this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new TreeOfRedemptionEffect(), new TapSourceCost())); } @@ -82,11 +82,11 @@ class TreeOfRedemptionEffect extends OneShotEffect { super(Outcome.GainLife); staticText = "Exchange your life total with Tree of Redemption's toughness"; } - + public TreeOfRedemptionEffect(final TreeOfRedemptionEffect effect) { super(effect); } - + @Override public boolean apply(Game game, Ability source) { Player player = game.getPlayer(source.getControllerId()); @@ -113,5 +113,5 @@ class TreeOfRedemptionEffect extends OneShotEffect { public TreeOfRedemptionEffect copy() { return new TreeOfRedemptionEffect(this); } - + } \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/innistrad/UnbreathingHorde.java b/Mage.Sets/src/mage/sets/innistrad/UnbreathingHorde.java index 63eb9c5176..a9f9f1eda2 100644 --- a/Mage.Sets/src/mage/sets/innistrad/UnbreathingHorde.java +++ b/Mage.Sets/src/mage/sets/innistrad/UnbreathingHorde.java @@ -64,8 +64,8 @@ public class UnbreathingHorde extends CardImpl { this.toughness = new MageInt(0); // Unbreathing Horde enters the battlefield with a +1/+1 counter on it for each other Zombie you control and each Zombie card in your graveyard. - this.addAbility(new EntersBattlefieldAbility(new UnbreathingHordeEffect1(), "with a +1/+1 counter on it for each other Zombie you control and each Zombie card in your graveyard")); - + this.addAbility(new EntersBattlefieldAbility(new UnbreathingHordeEffect1(), "with a +1/+1 counter on it for each other Zombie you control and each Zombie card in your graveyard")); + // If Unbreathing Horde would be dealt damage, prevent that damage and remove a +1/+1 counter from it. this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new UnbreathingHordeEffect2())); } @@ -84,12 +84,12 @@ class UnbreathingHordeEffect1 extends OneShotEffect { private static final FilterCreaturePermanent filter1 = new FilterCreaturePermanent(); private static final FilterCreatureCard filter2 = new FilterCreatureCard(); - + static { filter1.getSubtype().add("Zombie"); filter2.getSubtype().add("Zombie"); } - + public UnbreathingHordeEffect1() { super(Outcome.BoostCreature); staticText = "{this} enters the battlefield with a +1/+1 counter on it for each other Zombie you control and each Zombie card in your graveyard"; diff --git a/Mage.Sets/src/mage/sets/innistrad/UndeadAlchemist.java b/Mage.Sets/src/mage/sets/innistrad/UndeadAlchemist.java index bab0105a0c..4f2ec04a39 100644 --- a/Mage.Sets/src/mage/sets/innistrad/UndeadAlchemist.java +++ b/Mage.Sets/src/mage/sets/innistrad/UndeadAlchemist.java @@ -67,7 +67,7 @@ public class UndeadAlchemist extends CardImpl { // If a Zombie you control would deal combat damage to a player, instead that player puts that many cards from the top of his or her library into his or her graveyard. this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new UndeadAlchemistEffect())); - + // Whenever a creature card is put into an opponent's graveyard from his or her library, exile that card and put a 2/2 black Zombie creature token onto the battlefield. this.addAbility(new UndeadAlchemistTriggeredAbility()); } @@ -83,44 +83,44 @@ public class UndeadAlchemist extends CardImpl { } class UndeadAlchemistTriggeredAbility extends TriggeredAbilityImpl { - + public UndeadAlchemistTriggeredAbility() { - super(Constants.Zone.BATTLEFIELD, new ExileTargetEffect(), true); + super(Constants.Zone.BATTLEFIELD, new ExileTargetEffect(), true); this.addEffect(new CreateTokenEffect(new ZombieToken())); - } + } - public UndeadAlchemistTriggeredAbility(final UndeadAlchemistTriggeredAbility ability) { - super(ability); - } + public UndeadAlchemistTriggeredAbility(final UndeadAlchemistTriggeredAbility ability) { + super(ability); + } - @Override - public UndeadAlchemistTriggeredAbility copy() { - return new UndeadAlchemistTriggeredAbility(this); - } + @Override + public UndeadAlchemistTriggeredAbility copy() { + return new UndeadAlchemistTriggeredAbility(this); + } - @Override - public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == GameEvent.EventType.ZONE_CHANGE) { - ZoneChangeEvent zEvent = (ZoneChangeEvent)event; - if (zEvent.getFromZone() == Constants.Zone.LIBRARY && zEvent.getToZone() == Constants.Zone.GRAVEYARD && game.getOpponents(this.getControllerId()).contains(zEvent.getPlayerId())) { + @Override + public boolean checkTrigger(GameEvent event, Game game) { + if (event.getType() == GameEvent.EventType.ZONE_CHANGE) { + ZoneChangeEvent zEvent = (ZoneChangeEvent)event; + if (zEvent.getFromZone() == Constants.Zone.LIBRARY && zEvent.getToZone() == Constants.Zone.GRAVEYARD && game.getOpponents(this.getControllerId()).contains(zEvent.getPlayerId())) { Card card = game.getCard(event.getTargetId()); if (card != null && card.getCardType().contains(CardType.CREATURE)) { this.getEffects().get(0).setTargetPointer(new FixedTarget(card.getId())); return true; } - } - } - return false; - } + } + } + return false; + } - @Override - public String getRule() { - return "Whenever a creature card is put into an opponent's graveyard from his or her library, exile that card and put a 2/2 black Zombie creature token onto the battlefield."; - } + @Override + public String getRule() { + return "Whenever a creature card is put into an opponent's graveyard from his or her library, exile that card and put a 2/2 black Zombie creature token onto the battlefield."; + } } class UndeadAlchemistEffect extends ReplacementEffectImpl { - + UndeadAlchemistEffect() { super(Constants.Duration.WhileOnBattlefield, Constants.Outcome.RedirectDamage); staticText = "If a Zombie you control would deal combat damage to a player, instead that player puts that many cards from the top of his or her library into his or her graveyard"; @@ -134,15 +134,15 @@ class UndeadAlchemistEffect extends ReplacementEffectImpl public boolean replaceEvent(GameEvent event, Ability source, Game game) { Player player = game.getPlayer(event.getTargetId()); if (player != null) { - int cardsCount = Math.min(event.getAmount(), player.getLibrary().size()); - for (int i = 0; i < cardsCount; i++) { - Card card = player.getLibrary().removeFromTop(game); - if (card != null) - card.moveToZone(Zone.GRAVEYARD, source.getId(), game, false); - else - break; - } - + int cardsCount = Math.min(event.getAmount(), player.getLibrary().size()); + for (int i = 0; i < cardsCount; i++) { + Card card = player.getLibrary().removeFromTop(game); + if (card != null) + card.moveToZone(Zone.GRAVEYARD, source.getId(), game, false); + else + break; + } + return true; } return true; diff --git a/Mage.Sets/src/mage/sets/innistrad/UrgentExorcism.java b/Mage.Sets/src/mage/sets/innistrad/UrgentExorcism.java index 42c94d8a45..be92f6638f 100644 --- a/Mage.Sets/src/mage/sets/innistrad/UrgentExorcism.java +++ b/Mage.Sets/src/mage/sets/innistrad/UrgentExorcism.java @@ -76,7 +76,7 @@ class FilterSpiritOrEnchantment extends FilterPermanent { - public VampireInterloper(UUID ownerId) { - super(ownerId, 123, "Vampire Interloper", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{1}{B}"); - this.expansionSetCode = "ISD"; - this.subtype.add("Vampire"); - this.subtype.add("Scout"); + public VampireInterloper(UUID ownerId) { + super(ownerId, 123, "Vampire Interloper", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{1}{B}"); + this.expansionSetCode = "ISD"; + this.subtype.add("Vampire"); + this.subtype.add("Scout"); - this.color.setBlack(true); - this.power = new MageInt(2); - this.toughness = new MageInt(1); + this.color.setBlack(true); + this.power = new MageInt(2); + this.toughness = new MageInt(1); - this.addAbility(FlyingAbility.getInstance()); + this.addAbility(FlyingAbility.getInstance()); - // Vampire Interloper can't block. - this.addAbility(CantBlockAbility.getInstance()); - } + // Vampire Interloper can't block. + this.addAbility(CantBlockAbility.getInstance()); + } - public VampireInterloper(final VampireInterloper card) { - super(card); - } + public VampireInterloper(final VampireInterloper card) { + super(card); + } - @Override - public VampireInterloper copy() { - return new VampireInterloper(this); - } + @Override + public VampireInterloper copy() { + return new VampireInterloper(this); + } } diff --git a/Mage.Sets/src/mage/sets/innistrad/VampiricFury.java b/Mage.Sets/src/mage/sets/innistrad/VampiricFury.java index fe5f9d7186..649b965e4b 100644 --- a/Mage.Sets/src/mage/sets/innistrad/VampiricFury.java +++ b/Mage.Sets/src/mage/sets/innistrad/VampiricFury.java @@ -45,31 +45,31 @@ import java.util.UUID; */ public class VampiricFury extends CardImpl { - private static final FilterCreaturePermanent vampires = new FilterCreaturePermanent("Vampire creatures"); + private static final FilterCreaturePermanent vampires = new FilterCreaturePermanent("Vampire creatures"); - static { - vampires.getSubtype().add("Vampire"); - vampires.setScopeSubtype(Filter.ComparisonScope.Any); - vampires.setTargetController(Constants.TargetController.YOU); - } + static { + vampires.getSubtype().add("Vampire"); + vampires.setScopeSubtype(Filter.ComparisonScope.Any); + vampires.setTargetController(Constants.TargetController.YOU); + } - public VampiricFury(UUID ownerId) { - super(ownerId, 167, "Vampiric Fury", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{1}{R}"); - this.expansionSetCode = "ISD"; + public VampiricFury(UUID ownerId) { + super(ownerId, 167, "Vampiric Fury", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{1}{R}"); + this.expansionSetCode = "ISD"; - this.color.setRed(true); + this.color.setRed(true); - // Vampire creatures you control get +2/+0 and gain first strike until end of turn. - this.getSpellAbility().addEffect(new BoostControlledEffect(2, 0, Constants.Duration.EndOfTurn, vampires)); + // Vampire creatures you control get +2/+0 and gain first strike until end of turn. + this.getSpellAbility().addEffect(new BoostControlledEffect(2, 0, Constants.Duration.EndOfTurn, vampires)); this.getSpellAbility().addEffect(new GainAbilityControlledEffect(FirstStrikeAbility.getInstance(), Duration.EndOfTurn, vampires)); - } + } - public VampiricFury(final VampiricFury card) { - super(card); - } + public VampiricFury(final VampiricFury card) { + super(card); + } - @Override - public VampiricFury copy() { - return new VampiricFury(this); - } + @Override + public VampiricFury copy() { + return new VampiricFury(this); + } } diff --git a/Mage.Sets/src/mage/sets/innistrad/WalkingCorpse.java b/Mage.Sets/src/mage/sets/innistrad/WalkingCorpse.java index 3ab093379e..71c82b5381 100644 --- a/Mage.Sets/src/mage/sets/innistrad/WalkingCorpse.java +++ b/Mage.Sets/src/mage/sets/innistrad/WalkingCorpse.java @@ -39,22 +39,22 @@ import java.util.UUID; */ public class WalkingCorpse extends CardImpl { - public WalkingCorpse(UUID ownerId) { - super(ownerId, 126, "Walking Corpse", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{1}{B}"); - this.expansionSetCode = "ISD"; - this.subtype.add("Zombie"); + public WalkingCorpse(UUID ownerId) { + super(ownerId, 126, "Walking Corpse", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{1}{B}"); + this.expansionSetCode = "ISD"; + this.subtype.add("Zombie"); - this.color.setBlack(true); - this.power = new MageInt(2); - this.toughness = new MageInt(2); - } + this.color.setBlack(true); + this.power = new MageInt(2); + this.toughness = new MageInt(2); + } - public WalkingCorpse(final WalkingCorpse card) { - super(card); - } + public WalkingCorpse(final WalkingCorpse card) { + super(card); + } - @Override - public WalkingCorpse copy() { - return new WalkingCorpse(this); - } + @Override + public WalkingCorpse copy() { + return new WalkingCorpse(this); + } } diff --git a/Mage.Sets/src/mage/sets/innistrad/WitchbaneOrb.java b/Mage.Sets/src/mage/sets/innistrad/WitchbaneOrb.java index 558e1233e3..dbccd21567 100644 --- a/Mage.Sets/src/mage/sets/innistrad/WitchbaneOrb.java +++ b/Mage.Sets/src/mage/sets/innistrad/WitchbaneOrb.java @@ -55,7 +55,7 @@ public class WitchbaneOrb extends CardImpl { // When Witchbane Orb enters the battlefield, destroy all Curses attached to you. this.addAbility(new EntersBattlefieldTriggeredAbility(new WitchbaneOrbEffect())); - + // You have hexproof. this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityControllerEffect(HexproofAbility.getInstance()))); @@ -76,11 +76,11 @@ class WitchbaneOrbEffect extends OneShotEffect { public WitchbaneOrbEffect() { super(Outcome.Protect); } - + public WitchbaneOrbEffect(final WitchbaneOrbEffect effect) { super(effect); } - + @Override public boolean apply(Game game, Ability source) { Player player = game.getPlayer(source.getControllerId()); @@ -100,5 +100,5 @@ class WitchbaneOrbEffect extends OneShotEffect { public WitchbaneOrbEffect copy() { return new WitchbaneOrbEffect(this); } - + } \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/innistrad/WoodlandCemetery.java b/Mage.Sets/src/mage/sets/innistrad/WoodlandCemetery.java index 08989c7b66..2c4353ff1f 100644 --- a/Mage.Sets/src/mage/sets/innistrad/WoodlandCemetery.java +++ b/Mage.Sets/src/mage/sets/innistrad/WoodlandCemetery.java @@ -49,32 +49,32 @@ import java.util.UUID; */ public class WoodlandCemetery extends CardImpl { - private static final FilterLandPermanent filter = new FilterLandPermanent(); + private static final FilterLandPermanent filter = new FilterLandPermanent(); - static { - filter.getSubtype().add("Forest"); - filter.getSubtype().add("Swamp"); - filter.setScopeSubtype(ComparisonScope.Any); - filter.setMessage("Swamp or a Forest"); - } + static { + filter.getSubtype().add("Forest"); + filter.getSubtype().add("Swamp"); + filter.setScopeSubtype(ComparisonScope.Any); + filter.setMessage("Swamp or a Forest"); + } - public WoodlandCemetery(UUID ownerId) { - super(ownerId, 249, "Woodland Cemetery", Rarity.RARE, new CardType[]{CardType.LAND}, null); - this.expansionSetCode = "ISD"; + public WoodlandCemetery(UUID ownerId) { + super(ownerId, 249, "Woodland Cemetery", Rarity.RARE, new CardType[]{CardType.LAND}, null); + this.expansionSetCode = "ISD"; - Condition controls = new UnlessCondition(new ControlsPermanentCondition(filter, ControlsPermanentCondition.CountType.MORE_THAN, 0)); - String abilityText = "tap it unless you control a " + filter.getMessage(); - this.addAbility(new EntersBattlefieldAbility(new ConditionalOneShotEffect(new TapSourceEffect(), controls, abilityText), abilityText)); - this.addAbility(new BlackManaAbility()); - this.addAbility(new GreenManaAbility()); - } + Condition controls = new UnlessCondition(new ControlsPermanentCondition(filter, ControlsPermanentCondition.CountType.MORE_THAN, 0)); + String abilityText = "tap it unless you control a " + filter.getMessage(); + this.addAbility(new EntersBattlefieldAbility(new ConditionalOneShotEffect(new TapSourceEffect(), controls, abilityText), abilityText)); + this.addAbility(new BlackManaAbility()); + this.addAbility(new GreenManaAbility()); + } - public WoodlandCemetery(final WoodlandCemetery card) { - super(card); - } + public WoodlandCemetery(final WoodlandCemetery card) { + super(card); + } - @Override - public WoodlandCemetery copy() { - return new WoodlandCemetery(this); - } + @Override + public WoodlandCemetery copy() { + return new WoodlandCemetery(this); + } } diff --git a/Mage.Sets/src/mage/sets/innistrad/WreathofGeists.java b/Mage.Sets/src/mage/sets/innistrad/WreathofGeists.java index 0c4401ad3c..aaa8221e3f 100644 --- a/Mage.Sets/src/mage/sets/innistrad/WreathofGeists.java +++ b/Mage.Sets/src/mage/sets/innistrad/WreathofGeists.java @@ -55,17 +55,17 @@ public class WreathofGeists extends CardImpl { super(ownerId, 211, "Wreath of Geists", Rarity.UNCOMMON, new CardType[]{CardType.ENCHANTMENT}, "{G}"); this.expansionSetCode = "ISD"; this.subtype.add("Aura"); - this.color.setGreen(true); + this.color.setGreen(true); - // Enchant creature - TargetPermanent auraTarget = new TargetCreaturePermanent(); - this.getSpellAbility().addTarget(auraTarget); - this.getSpellAbility().addEffect(new AttachEffect(Outcome.BoostCreature)); + // Enchant creature + TargetPermanent auraTarget = new TargetCreaturePermanent(); + this.getSpellAbility().addTarget(auraTarget); + this.getSpellAbility().addEffect(new AttachEffect(Outcome.BoostCreature)); - Ability ability = new EnchantAbility(auraTarget.getTargetName()); - this.addAbility(ability); + Ability ability = new EnchantAbility(auraTarget.getTargetName()); + this.addAbility(ability); - // Enchanted creature gets +X/+X, where X is the number of creature cards in your graveyard. + // Enchanted creature gets +X/+X, where X is the number of creature cards in your graveyard. DynamicValue value = new CardsInControllerGraveyardCount(new FilterCreatureCard()); this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostEnchantedEffect(value, value))); } diff --git a/Mage.Sets/src/mage/sets/invasion/FactOrFiction.java b/Mage.Sets/src/mage/sets/invasion/FactOrFiction.java index ea56d34f64..83816650e4 100644 --- a/Mage.Sets/src/mage/sets/invasion/FactOrFiction.java +++ b/Mage.Sets/src/mage/sets/invasion/FactOrFiction.java @@ -96,7 +96,7 @@ class FactOrFictionEffect extends OneShotEffect { } Cards cards = new CardsImpl(Zone.PICK); - int count = Math.min(player.getLibrary().size(), 5); + int count = Math.min(player.getLibrary().size(), 5); for (int i = 0; i < count; i++) { Card card = player.getLibrary().removeFromTop(game); if (card != null) { diff --git a/Mage.Sets/src/mage/sets/lorwyn/BattleMastery.java b/Mage.Sets/src/mage/sets/lorwyn/BattleMastery.java index 3ed1a27a76..16c7437ae5 100644 --- a/Mage.Sets/src/mage/sets/lorwyn/BattleMastery.java +++ b/Mage.Sets/src/mage/sets/lorwyn/BattleMastery.java @@ -54,11 +54,11 @@ public class BattleMastery extends CardImpl { this.subtype.add("Aura"); this.color.setWhite(true); TargetPermanent auraTarget = new TargetCreaturePermanent(); - this.getSpellAbility().addTarget(auraTarget); - this.getSpellAbility().addEffect(new AttachEffect(Constants.Outcome.AddAbility)); - Ability ability = new EnchantAbility(auraTarget.getTargetName()); - this.addAbility(ability); - this.addAbility(new SimpleStaticAbility(Constants.Zone.BATTLEFIELD, new GainAbilityAttachedEffect(DoubleStrikeAbility.getInstance(), Constants.AttachmentType.AURA))); + this.getSpellAbility().addTarget(auraTarget); + this.getSpellAbility().addEffect(new AttachEffect(Constants.Outcome.AddAbility)); + Ability ability = new EnchantAbility(auraTarget.getTargetName()); + this.addAbility(ability); + this.addAbility(new SimpleStaticAbility(Constants.Zone.BATTLEFIELD, new GainAbilityAttachedEffect(DoubleStrikeAbility.getInstance(), Constants.AttachmentType.AURA))); } public BattleMastery(final BattleMastery card) { diff --git a/Mage.Sets/src/mage/sets/lorwyn/EpicProportions.java b/Mage.Sets/src/mage/sets/lorwyn/EpicProportions.java index 16fb3b9e30..5e51120693 100644 --- a/Mage.Sets/src/mage/sets/lorwyn/EpicProportions.java +++ b/Mage.Sets/src/mage/sets/lorwyn/EpicProportions.java @@ -57,11 +57,11 @@ public class EpicProportions extends CardImpl { this.color.setGreen(true); this.addAbility(FlashAbility.getInstance()); TargetPermanent auraTarget = new TargetCreaturePermanent(); - this.getSpellAbility().addTarget(auraTarget); - this.getSpellAbility().addEffect(new AttachEffect(Constants.Outcome.BoostCreature)); - Ability ability = new EnchantAbility(auraTarget.getTargetName()); - this.addAbility(ability); - this.addAbility(new SimpleStaticAbility(Constants.Zone.BATTLEFIELD, new BoostEnchantedEffect(5, 5, Constants.Duration.WhileOnBattlefield))); + this.getSpellAbility().addTarget(auraTarget); + this.getSpellAbility().addEffect(new AttachEffect(Constants.Outcome.BoostCreature)); + Ability ability = new EnchantAbility(auraTarget.getTargetName()); + this.addAbility(ability); + this.addAbility(new SimpleStaticAbility(Constants.Zone.BATTLEFIELD, new BoostEnchantedEffect(5, 5, Constants.Duration.WhileOnBattlefield))); this.addAbility(new SimpleStaticAbility(Constants.Zone.BATTLEFIELD, new GainAbilityAttachedEffect(TrampleAbility.getInstance(), Constants.AttachmentType.AURA))); } diff --git a/Mage.Sets/src/mage/sets/lorwyn/FinalRevels.java b/Mage.Sets/src/mage/sets/lorwyn/FinalRevels.java index 7efb776800..41d3907eaf 100644 --- a/Mage.Sets/src/mage/sets/lorwyn/FinalRevels.java +++ b/Mage.Sets/src/mage/sets/lorwyn/FinalRevels.java @@ -49,8 +49,8 @@ public class FinalRevels extends CardImpl { this.color.setBlack(true); this.getSpellAbility().addEffect(new BoostAllEffect(2, 0, Constants.Duration.EndOfTurn, new FilterCreaturePermanent(), false)); Mode mode = new Mode(); - mode.getEffects().add(new BoostAllEffect(0, -2, Constants.Duration.EndOfTurn, new FilterCreaturePermanent(), false)); - this.getSpellAbility().addMode(mode); + mode.getEffects().add(new BoostAllEffect(0, -2, Constants.Duration.EndOfTurn, new FilterCreaturePermanent(), false)); + this.getSpellAbility().addMode(mode); } public FinalRevels(final FinalRevels card) { diff --git a/Mage.Sets/src/mage/sets/lorwyn/HurlyBurly.java b/Mage.Sets/src/mage/sets/lorwyn/HurlyBurly.java index 31fa0f6610..f19875f8f2 100644 --- a/Mage.Sets/src/mage/sets/lorwyn/HurlyBurly.java +++ b/Mage.Sets/src/mage/sets/lorwyn/HurlyBurly.java @@ -58,8 +58,8 @@ public class HurlyBurly extends CardImpl { this.color.setRed(true); this.getSpellAbility().addEffect(new DamageAllEffect(1, filterWithFlying)); Mode mode = new Mode(); - mode.getEffects().add(new DamageAllEffect(1, filterWithoutFlying)); - this.getSpellAbility().addMode(mode); + mode.getEffects().add(new DamageAllEffect(1, filterWithoutFlying)); + this.getSpellAbility().addMode(mode); } public HurlyBurly(final HurlyBurly card) { diff --git a/Mage.Sets/src/mage/sets/lorwyn/ProtectiveBubble.java b/Mage.Sets/src/mage/sets/lorwyn/ProtectiveBubble.java index 0c9a021b4f..8da8e57f57 100644 --- a/Mage.Sets/src/mage/sets/lorwyn/ProtectiveBubble.java +++ b/Mage.Sets/src/mage/sets/lorwyn/ProtectiveBubble.java @@ -56,10 +56,10 @@ public class ProtectiveBubble extends CardImpl { this.color.setBlue(true); // Enchant creature TargetPermanent auraTarget = new TargetCreaturePermanent(); - this.getSpellAbility().addTarget(auraTarget); - this.getSpellAbility().addEffect(new AttachEffect(Constants.Outcome.BoostCreature)); - Ability ability = new EnchantAbility(auraTarget.getTargetName()); - this.addAbility(ability); + this.getSpellAbility().addTarget(auraTarget); + this.getSpellAbility().addEffect(new AttachEffect(Constants.Outcome.BoostCreature)); + Ability ability = new EnchantAbility(auraTarget.getTargetName()); + this.addAbility(ability); // Enchanted creature is unblockable and has shroud. this.addAbility(new SimpleStaticAbility(Constants.Zone.BATTLEFIELD, new GainAbilityAttachedEffect(UnblockableAbility.getInstance(), Constants.AttachmentType.AURA))); this.addAbility(new SimpleStaticAbility(Constants.Zone.BATTLEFIELD, new GainAbilityAttachedEffect(ShroudAbility.getInstance(), Constants.AttachmentType.AURA))); diff --git a/Mage.Sets/src/mage/sets/lorwyn/ZephyrNet.java b/Mage.Sets/src/mage/sets/lorwyn/ZephyrNet.java index 77df675a32..7c6c9619e9 100644 --- a/Mage.Sets/src/mage/sets/lorwyn/ZephyrNet.java +++ b/Mage.Sets/src/mage/sets/lorwyn/ZephyrNet.java @@ -56,10 +56,10 @@ public class ZephyrNet extends CardImpl { this.color.setBlue(true); // Enchant creature TargetPermanent auraTarget = new TargetCreaturePermanent(); - this.getSpellAbility().addTarget(auraTarget); - this.getSpellAbility().addEffect(new AttachEffect(Constants.Outcome.BoostCreature)); - Ability ability = new EnchantAbility(auraTarget.getTargetName()); - this.addAbility(ability); + this.getSpellAbility().addTarget(auraTarget); + this.getSpellAbility().addEffect(new AttachEffect(Constants.Outcome.BoostCreature)); + Ability ability = new EnchantAbility(auraTarget.getTargetName()); + this.addAbility(ability); // Enchanted creature has defender and flying. this.addAbility(new SimpleStaticAbility(Constants.Zone.BATTLEFIELD, new GainAbilityAttachedEffect(DefenderAbility.getInstance(), Constants.AttachmentType.AURA))); this.addAbility(new SimpleStaticAbility(Constants.Zone.BATTLEFIELD, new GainAbilityAttachedEffect(FlyingAbility.getInstance(), Constants.AttachmentType.AURA))); diff --git a/Mage.Sets/src/mage/sets/magic2010/AcidicSlime.java b/Mage.Sets/src/mage/sets/magic2010/AcidicSlime.java index 77d7773bc5..b6c727d9e3 100644 --- a/Mage.Sets/src/mage/sets/magic2010/AcidicSlime.java +++ b/Mage.Sets/src/mage/sets/magic2010/AcidicSlime.java @@ -48,38 +48,38 @@ import mage.target.TargetPermanent; */ public class AcidicSlime extends CardImpl { - private static final FilterPermanent filter = new FilterPermanent("artifact, enchantment, or land"); + private static final FilterPermanent filter = new FilterPermanent("artifact, enchantment, or land"); - static { - filter.getCardType().add(CardType.ARTIFACT); - filter.getCardType().add(CardType.ENCHANTMENT); - filter.getCardType().add(CardType.LAND); - filter.setScopeCardType(ComparisonScope.Any); - } + static { + filter.getCardType().add(CardType.ARTIFACT); + filter.getCardType().add(CardType.ENCHANTMENT); + filter.getCardType().add(CardType.LAND); + filter.setScopeCardType(ComparisonScope.Any); + } - public AcidicSlime(UUID ownerId) { - super(ownerId, 165, "Acidic Slime", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{3}{G}{G}"); - this.expansionSetCode = "M10"; - this.subtype.add("Ooze"); - this.color.setGreen(true); - this.power = new MageInt(2); - this.toughness = new MageInt(2); + public AcidicSlime(UUID ownerId) { + super(ownerId, 165, "Acidic Slime", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{3}{G}{G}"); + this.expansionSetCode = "M10"; + this.subtype.add("Ooze"); + this.color.setGreen(true); + this.power = new MageInt(2); + this.toughness = new MageInt(2); - this.addAbility(DeathtouchAbility.getInstance()); - Ability ability = new EntersBattlefieldTriggeredAbility(new DestroyTargetEffect(), false); - Target target = new TargetPermanent(filter); - target.setRequired(true); - ability.addTarget(target); - this.addAbility(ability); - } + this.addAbility(DeathtouchAbility.getInstance()); + Ability ability = new EntersBattlefieldTriggeredAbility(new DestroyTargetEffect(), false); + Target target = new TargetPermanent(filter); + target.setRequired(true); + ability.addTarget(target); + this.addAbility(ability); + } - public AcidicSlime(final AcidicSlime card) { - super(card); - } + public AcidicSlime(final AcidicSlime card) { + super(card); + } - @Override - public AcidicSlime copy() { - return new AcidicSlime(this); - } + @Override + public AcidicSlime copy() { + return new AcidicSlime(this); + } } diff --git a/Mage.Sets/src/mage/sets/magic2010/AcolyteOfXathrid.java b/Mage.Sets/src/mage/sets/magic2010/AcolyteOfXathrid.java index 09d573e3c9..01e57c4de9 100644 --- a/Mage.Sets/src/mage/sets/magic2010/AcolyteOfXathrid.java +++ b/Mage.Sets/src/mage/sets/magic2010/AcolyteOfXathrid.java @@ -47,27 +47,27 @@ import mage.target.TargetPlayer; */ public class AcolyteOfXathrid extends CardImpl { - public AcolyteOfXathrid(UUID ownerId) { - super(ownerId, 83, "Acolyte of Xathrid", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{B}"); - this.expansionSetCode = "M10"; - this.subtype.add("Human"); - this.subtype.add("Cleric"); - this.color.setBlack(true); - this.power = new MageInt(0); - this.toughness = new MageInt(1); - Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new LoseLifeTargetEffect(1), new ManaCostsImpl("{1}{B}")); - ability.addCost(new TapSourceCost()); - ability.addTarget(new TargetPlayer()); - this.addAbility(ability); - } + public AcolyteOfXathrid(UUID ownerId) { + super(ownerId, 83, "Acolyte of Xathrid", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{B}"); + this.expansionSetCode = "M10"; + this.subtype.add("Human"); + this.subtype.add("Cleric"); + this.color.setBlack(true); + this.power = new MageInt(0); + this.toughness = new MageInt(1); + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new LoseLifeTargetEffect(1), new ManaCostsImpl("{1}{B}")); + ability.addCost(new TapSourceCost()); + ability.addTarget(new TargetPlayer()); + this.addAbility(ability); + } - public AcolyteOfXathrid(final AcolyteOfXathrid card) { - super(card); - } + public AcolyteOfXathrid(final AcolyteOfXathrid card) { + super(card); + } - @Override - public AcolyteOfXathrid copy() { - return new AcolyteOfXathrid(this); - } + @Override + public AcolyteOfXathrid copy() { + return new AcolyteOfXathrid(this); + } } diff --git a/Mage.Sets/src/mage/sets/magic2010/ActOfTreason.java b/Mage.Sets/src/mage/sets/magic2010/ActOfTreason.java index 02ebf0c2c7..f99066bcbd 100644 --- a/Mage.Sets/src/mage/sets/magic2010/ActOfTreason.java +++ b/Mage.Sets/src/mage/sets/magic2010/ActOfTreason.java @@ -45,24 +45,24 @@ import mage.target.common.TargetCreaturePermanent; */ public class ActOfTreason extends CardImpl { - public ActOfTreason(UUID ownerId) { - super(ownerId, 124, "Act of Treason", Rarity.UNCOMMON, new CardType[]{CardType.SORCERY}, "{2}{R}"); - this.expansionSetCode = "M10"; - this.color.setRed(true); - this.getSpellAbility().addTarget(new TargetCreaturePermanent()); - this.getSpellAbility().addEffect(new GainControlTargetEffect(Duration.EndOfTurn)); - this.getSpellAbility().addEffect(new UntapTargetEffect()); - this.getSpellAbility().addEffect(new GainAbilityTargetEffect(HasteAbility.getInstance(), Duration.EndOfTurn)); + public ActOfTreason(UUID ownerId) { + super(ownerId, 124, "Act of Treason", Rarity.UNCOMMON, new CardType[]{CardType.SORCERY}, "{2}{R}"); + this.expansionSetCode = "M10"; + this.color.setRed(true); + this.getSpellAbility().addTarget(new TargetCreaturePermanent()); + this.getSpellAbility().addEffect(new GainControlTargetEffect(Duration.EndOfTurn)); + this.getSpellAbility().addEffect(new UntapTargetEffect()); + this.getSpellAbility().addEffect(new GainAbilityTargetEffect(HasteAbility.getInstance(), Duration.EndOfTurn)); - } + } - public ActOfTreason(final ActOfTreason card) { - super(card); - } + public ActOfTreason(final ActOfTreason card) { + super(card); + } - @Override - public ActOfTreason copy() { - return new ActOfTreason(this); - } + @Override + public ActOfTreason copy() { + return new ActOfTreason(this); + } } diff --git a/Mage.Sets/src/mage/sets/magic2010/AirElemental.java b/Mage.Sets/src/mage/sets/magic2010/AirElemental.java index 43753f5bf8..6bbaa5a53d 100644 --- a/Mage.Sets/src/mage/sets/magic2010/AirElemental.java +++ b/Mage.Sets/src/mage/sets/magic2010/AirElemental.java @@ -41,23 +41,23 @@ import mage.cards.CardImpl; */ public class AirElemental extends CardImpl { - public AirElemental(UUID ownerId) { - super(ownerId, 42, "Air Elemental", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{3}{U}{U}"); - this.expansionSetCode = "M10"; - this.color.setBlue(true); - this.subtype.add("Elemental"); - this.power = new MageInt(4); - this.toughness = new MageInt(4); - this.addAbility(FlyingAbility.getInstance()); - } + public AirElemental(UUID ownerId) { + super(ownerId, 42, "Air Elemental", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{3}{U}{U}"); + this.expansionSetCode = "M10"; + this.color.setBlue(true); + this.subtype.add("Elemental"); + this.power = new MageInt(4); + this.toughness = new MageInt(4); + this.addAbility(FlyingAbility.getInstance()); + } - public AirElemental(final AirElemental card) { - super(card); - } + public AirElemental(final AirElemental card) { + super(card); + } - @Override - public AirElemental copy() { - return new AirElemental(this); - } + @Override + public AirElemental copy() { + return new AirElemental(this); + } } diff --git a/Mage.Sets/src/mage/sets/magic2010/AjaniGoldmane.java b/Mage.Sets/src/mage/sets/magic2010/AjaniGoldmane.java index fde9d3bad4..5d47120598 100644 --- a/Mage.Sets/src/mage/sets/magic2010/AjaniGoldmane.java +++ b/Mage.Sets/src/mage/sets/magic2010/AjaniGoldmane.java @@ -63,74 +63,74 @@ import mage.players.Player; */ public class AjaniGoldmane extends CardImpl { - public AjaniGoldmane(UUID ownerId) { - super(ownerId, 1, "Ajani Goldmane", Rarity.MYTHIC, new CardType[]{CardType.PLANESWALKER}, "{2}{W}{W}"); - this.expansionSetCode = "M10"; - this.subtype.add("Ajani"); - this.color.setWhite(true); - this.addAbility(new EntersBattlefieldAbility(new AddCountersSourceEffect(CounterType.LOYALTY.createInstance(4)), "")); + public AjaniGoldmane(UUID ownerId) { + super(ownerId, 1, "Ajani Goldmane", Rarity.MYTHIC, new CardType[]{CardType.PLANESWALKER}, "{2}{W}{W}"); + this.expansionSetCode = "M10"; + this.subtype.add("Ajani"); + this.color.setWhite(true); + this.addAbility(new EntersBattlefieldAbility(new AddCountersSourceEffect(CounterType.LOYALTY.createInstance(4)), "")); - this.addAbility(new LoyaltyAbility(new GainLifeEffect(2), 1)); + this.addAbility(new LoyaltyAbility(new GainLifeEffect(2), 1)); - Effects effects1 = new Effects(); - effects1.add(new AddCountersAllEffect(CounterType.P1P1.createInstance(), new FilterControlledCreaturePermanent())); - effects1.add(new GainAbilityControlledEffect(VigilanceAbility.getInstance(), Duration.EndOfTurn, new FilterCreaturePermanent())); - this.addAbility(new LoyaltyAbility(effects1, -1)); + Effects effects1 = new Effects(); + effects1.add(new AddCountersAllEffect(CounterType.P1P1.createInstance(), new FilterControlledCreaturePermanent())); + effects1.add(new GainAbilityControlledEffect(VigilanceAbility.getInstance(), Duration.EndOfTurn, new FilterCreaturePermanent())); + this.addAbility(new LoyaltyAbility(effects1, -1)); - this.addAbility(new LoyaltyAbility(new CreateTokenEffect(new AvatarToken()), -6)); + this.addAbility(new LoyaltyAbility(new CreateTokenEffect(new AvatarToken()), -6)); - } + } - public AjaniGoldmane(final AjaniGoldmane card) { - super(card); - } + public AjaniGoldmane(final AjaniGoldmane card) { + super(card); + } - @Override - public AjaniGoldmane copy() { - return new AjaniGoldmane(this); - } + @Override + public AjaniGoldmane copy() { + return new AjaniGoldmane(this); + } } class AvatarToken extends Token { - public AvatarToken() { - super("Avatar", "white Avatar creature token with \"This creature's power and toughness are each equal to your life total.\""); - cardType.add(CardType.CREATURE); - subtype.add("Avatar"); - color.setWhite(true); - this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new AvatarTokenEffect())); - } + public AvatarToken() { + super("Avatar", "white Avatar creature token with \"This creature's power and toughness are each equal to your life total.\""); + cardType.add(CardType.CREATURE); + subtype.add("Avatar"); + color.setWhite(true); + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new AvatarTokenEffect())); + } } class AvatarTokenEffect extends ContinuousEffectImpl { - public AvatarTokenEffect() { - super(Duration.WhileOnBattlefield, Layer.PTChangingEffects_7, SubLayer.SetPT_7b, Outcome.BoostCreature); - } + public AvatarTokenEffect() { + super(Duration.WhileOnBattlefield, Layer.PTChangingEffects_7, SubLayer.SetPT_7b, Outcome.BoostCreature); + } - public AvatarTokenEffect(final AvatarTokenEffect effect) { - super(effect); - } + public AvatarTokenEffect(final AvatarTokenEffect effect) { + super(effect); + } - @Override - public AvatarTokenEffect copy() { - return new AvatarTokenEffect(this); - } + @Override + public AvatarTokenEffect copy() { + return new AvatarTokenEffect(this); + } - @Override - public boolean apply(Game game, Ability source) { - Permanent token = game.getPermanent(source.getSourceId()); - if (token != null) { - Player controller = game.getPlayer(source.getControllerId()); - if (controller != null) { - token.getPower().setValue(controller.getLife()); - token.getToughness().setValue(controller.getLife()); - return true; - } - } - return false; - } + @Override + public boolean apply(Game game, Ability source) { + Permanent token = game.getPermanent(source.getSourceId()); + if (token != null) { + Player controller = game.getPlayer(source.getControllerId()); + if (controller != null) { + token.getPower().setValue(controller.getLife()); + token.getToughness().setValue(controller.getLife()); + return true; + } + } + return false; + } } \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/magic2010/AlluringSiren.java b/Mage.Sets/src/mage/sets/magic2010/AlluringSiren.java index 87cb06c50f..9a521959c9 100644 --- a/Mage.Sets/src/mage/sets/magic2010/AlluringSiren.java +++ b/Mage.Sets/src/mage/sets/magic2010/AlluringSiren.java @@ -49,31 +49,31 @@ import mage.target.common.TargetCreaturePermanent; */ public class AlluringSiren extends CardImpl { - private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("creature an opponent controls"); + private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("creature an opponent controls"); - static { - filter.setTargetController(TargetController.OPPONENT); - } + static { + filter.setTargetController(TargetController.OPPONENT); + } - public AlluringSiren(UUID ownerId) { - super(ownerId, 43, "Alluring Siren", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{1}{U}"); - this.expansionSetCode = "M10"; - this.color.setBlue(true); - this.subtype.add("Siren"); - this.power = new MageInt(1); - this.toughness = new MageInt(1); - Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new AttacksIfAbleTargetEffect(Duration.EndOfTurn), new TapSourceCost()); - ability.addTarget(new TargetCreaturePermanent(filter)); - this.addAbility(ability); - } + public AlluringSiren(UUID ownerId) { + super(ownerId, 43, "Alluring Siren", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{1}{U}"); + this.expansionSetCode = "M10"; + this.color.setBlue(true); + this.subtype.add("Siren"); + this.power = new MageInt(1); + this.toughness = new MageInt(1); + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new AttacksIfAbleTargetEffect(Duration.EndOfTurn), new TapSourceCost()); + ability.addTarget(new TargetCreaturePermanent(filter)); + this.addAbility(ability); + } - public AlluringSiren(final AlluringSiren card) { - super(card); - } + public AlluringSiren(final AlluringSiren card) { + super(card); + } - @Override - public AlluringSiren copy() { - return new AlluringSiren(this); - } + @Override + public AlluringSiren copy() { + return new AlluringSiren(this); + } } \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/magic2010/AngelsFeather.java b/Mage.Sets/src/mage/sets/magic2010/AngelsFeather.java index b99dd93d6a..95659ae6bd 100644 --- a/Mage.Sets/src/mage/sets/magic2010/AngelsFeather.java +++ b/Mage.Sets/src/mage/sets/magic2010/AngelsFeather.java @@ -36,19 +36,19 @@ import java.util.UUID; */ public class AngelsFeather extends mage.sets.tenth.AngelsFeather { - public AngelsFeather(UUID ownerId) { - super(ownerId); - this.cardNumber = 206; - this.expansionSetCode = "M10"; - } + public AngelsFeather(UUID ownerId) { + super(ownerId); + this.cardNumber = 206; + this.expansionSetCode = "M10"; + } - public AngelsFeather(final AngelsFeather card) { - super(card); - } + public AngelsFeather(final AngelsFeather card) { + super(card); + } - @Override - public AngelsFeather copy() { - return new AngelsFeather(this); - } + @Override + public AngelsFeather copy() { + return new AngelsFeather(this); + } } diff --git a/Mage.Sets/src/mage/sets/magic2010/AngelsMercy.java b/Mage.Sets/src/mage/sets/magic2010/AngelsMercy.java index c19d36ae57..e4b0191d0a 100644 --- a/Mage.Sets/src/mage/sets/magic2010/AngelsMercy.java +++ b/Mage.Sets/src/mage/sets/magic2010/AngelsMercy.java @@ -40,19 +40,19 @@ import mage.cards.CardImpl; */ public class AngelsMercy extends CardImpl { - public AngelsMercy(UUID ownerId) { - super(ownerId, 2, "Angel's Mercy", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{2}{W}{W}"); - this.expansionSetCode = "M10"; - this.color.setWhite(true); - this.getSpellAbility().addEffect(new GainLifeEffect(7)); - } + public AngelsMercy(UUID ownerId) { + super(ownerId, 2, "Angel's Mercy", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{2}{W}{W}"); + this.expansionSetCode = "M10"; + this.color.setWhite(true); + this.getSpellAbility().addEffect(new GainLifeEffect(7)); + } - public AngelsMercy(final AngelsMercy card) { - super(card); - } + public AngelsMercy(final AngelsMercy card) { + super(card); + } - @Override - public AngelsMercy copy() { - return new AngelsMercy(this); - } + @Override + public AngelsMercy copy() { + return new AngelsMercy(this); + } } diff --git a/Mage.Sets/src/mage/sets/magic2010/AntQueen.java b/Mage.Sets/src/mage/sets/magic2010/AntQueen.java index 95ad0f35cf..689b34c359 100644 --- a/Mage.Sets/src/mage/sets/magic2010/AntQueen.java +++ b/Mage.Sets/src/mage/sets/magic2010/AntQueen.java @@ -45,27 +45,27 @@ import mage.game.permanent.token.InsectToken; */ public class AntQueen extends CardImpl { - private static InsectToken insectToken = new InsectToken(); + private static InsectToken insectToken = new InsectToken(); - public AntQueen(UUID ownerId) { - super(ownerId, 166, "Ant Queen", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{3}{G}{G}"); - this.expansionSetCode = "M10"; - this.subtype.add("Insect"); - this.color.setGreen(true); -// this.art = "122179_typ_reg_sty_010.jpg"; - this.power = new MageInt(5); - this.toughness = new MageInt(5); + public AntQueen(UUID ownerId) { + super(ownerId, 166, "Ant Queen", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{3}{G}{G}"); + this.expansionSetCode = "M10"; + this.subtype.add("Insect"); + this.color.setGreen(true); +// this.art = "122179_typ_reg_sty_010.jpg"; + this.power = new MageInt(5); + this.toughness = new MageInt(5); - this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new CreateTokenEffect(insectToken), new ManaCostsImpl("{1}{G}"))); - } + this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new CreateTokenEffect(insectToken), new ManaCostsImpl("{1}{G}"))); + } - public AntQueen(final AntQueen card) { - super(card); - } + public AntQueen(final AntQueen card) { + super(card); + } - @Override - public AntQueen copy() { - return new AntQueen(this); - } + @Override + public AntQueen copy() { + return new AntQueen(this); + } } diff --git a/Mage.Sets/src/mage/sets/magic2010/ArmoredAscension.java b/Mage.Sets/src/mage/sets/magic2010/ArmoredAscension.java index fda286b46a..42a29d9070 100644 --- a/Mage.Sets/src/mage/sets/magic2010/ArmoredAscension.java +++ b/Mage.Sets/src/mage/sets/magic2010/ArmoredAscension.java @@ -70,7 +70,7 @@ public class ArmoredAscension extends CardImpl { this.getSpellAbility().addTarget(auraTarget); this.getSpellAbility().addEffect(new AttachEffect(Outcome.BoostCreature)); this.addAbility(new EnchantAbility(auraTarget.getTargetName())); - + PermanentsOnBattlefieldCount amount = new PermanentsOnBattlefieldCount(filter, 1); SimpleStaticAbility ability = new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostEnchantedEffect(amount, amount, Duration.WhileOnBattlefield)); ability.addEffect(new GainAbilityAttachedEffect(FlyingAbility.getInstance(), AttachmentType.AURA)); diff --git a/Mage.Sets/src/mage/sets/magic2010/Assassinate.java b/Mage.Sets/src/mage/sets/magic2010/Assassinate.java index ec62f1d5b1..766bbe97f2 100644 --- a/Mage.Sets/src/mage/sets/magic2010/Assassinate.java +++ b/Mage.Sets/src/mage/sets/magic2010/Assassinate.java @@ -36,19 +36,19 @@ import java.util.UUID; */ public class Assassinate extends mage.sets.tenth.Assassinate { - public Assassinate(UUID ownerId) { - super(ownerId); - this.cardNumber = 84; - this.expansionSetCode = "M10"; - } + public Assassinate(UUID ownerId) { + super(ownerId); + this.cardNumber = 84; + this.expansionSetCode = "M10"; + } - public Assassinate(final Assassinate card) { - super(card); - } + public Assassinate(final Assassinate card) { + super(card); + } - @Override - public Assassinate copy() { - return new Assassinate(this); - } + @Override + public Assassinate copy() { + return new Assassinate(this); + } } diff --git a/Mage.Sets/src/mage/sets/magic2010/AwakenerDruid.java b/Mage.Sets/src/mage/sets/magic2010/AwakenerDruid.java index f368b35688..dd48a74eba 100644 --- a/Mage.Sets/src/mage/sets/magic2010/AwakenerDruid.java +++ b/Mage.Sets/src/mage/sets/magic2010/AwakenerDruid.java @@ -47,45 +47,45 @@ import mage.target.common.TargetLandPermanent; */ public class AwakenerDruid extends CardImpl { - private static final FilterLandPermanent filter = new FilterLandPermanent("Forest"); + private static final FilterLandPermanent filter = new FilterLandPermanent("Forest"); - static { - filter.getSubtype().add("Forest"); - } + static { + filter.getSubtype().add("Forest"); + } - public AwakenerDruid(UUID ownerId) { - super(ownerId, 167, "Awakener Druid", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{2}{G}"); - this.expansionSetCode = "M10"; - this.color.setGreen(true); - this.subtype.add("Human"); - this.subtype.add("Druid"); - this.power = new MageInt(1); - this.toughness = new MageInt(1); - Ability ability = new EntersBattlefieldTriggeredAbility(new BecomesCreatureTargetEffect(new AwakenerDruidToken(), "land", Duration.WhileOnBattlefield), false); - ability.addTarget(new TargetLandPermanent(filter)); - this.addAbility(ability); - } + public AwakenerDruid(UUID ownerId) { + super(ownerId, 167, "Awakener Druid", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{2}{G}"); + this.expansionSetCode = "M10"; + this.color.setGreen(true); + this.subtype.add("Human"); + this.subtype.add("Druid"); + this.power = new MageInt(1); + this.toughness = new MageInt(1); + Ability ability = new EntersBattlefieldTriggeredAbility(new BecomesCreatureTargetEffect(new AwakenerDruidToken(), "land", Duration.WhileOnBattlefield), false); + ability.addTarget(new TargetLandPermanent(filter)); + this.addAbility(ability); + } - public AwakenerDruid(final AwakenerDruid card) { - super(card); - } + public AwakenerDruid(final AwakenerDruid card) { + super(card); + } - @Override - public AwakenerDruid copy() { - return new AwakenerDruid(this); - } + @Override + public AwakenerDruid copy() { + return new AwakenerDruid(this); + } } class AwakenerDruidToken extends Token { - public AwakenerDruidToken() { - super("", "4/5 green Treefolk creature"); - cardType.add(CardType.CREATURE); - subtype.add("Treefolk"); - color.setGreen(true); - power = new MageInt(4); - toughness = new MageInt(5); - } + public AwakenerDruidToken() { + super("", "4/5 green Treefolk creature"); + cardType.add(CardType.CREATURE); + subtype.add("Treefolk"); + color.setGreen(true); + power = new MageInt(4); + toughness = new MageInt(5); + } } \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/magic2010/BallLightning.java b/Mage.Sets/src/mage/sets/magic2010/BallLightning.java index 39d15e4a69..323da8c976 100644 --- a/Mage.Sets/src/mage/sets/magic2010/BallLightning.java +++ b/Mage.Sets/src/mage/sets/magic2010/BallLightning.java @@ -45,26 +45,26 @@ import mage.game.events.GameEvent.EventType; */ public class BallLightning extends CardImpl { - public BallLightning(UUID ownerId) { - super(ownerId, 125, "Ball Lightning", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{R}{R}{R}"); - this.expansionSetCode = "M10"; - this.subtype.add("Elemental"); - this.color.setRed(true); - this.power = new MageInt(6); - this.toughness = new MageInt(1); + public BallLightning(UUID ownerId) { + super(ownerId, 125, "Ball Lightning", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{R}{R}{R}"); + this.expansionSetCode = "M10"; + this.subtype.add("Elemental"); + this.color.setRed(true); + this.power = new MageInt(6); + this.toughness = new MageInt(1); - this.addAbility(TrampleAbility.getInstance()); - this.addAbility(HasteAbility.getInstance()); - this.addAbility(new OnEventTriggeredAbility(EventType.END_TURN_STEP_PRE, "beginning of the end step", true, new SacrificeSourceEffect())); - } + this.addAbility(TrampleAbility.getInstance()); + this.addAbility(HasteAbility.getInstance()); + this.addAbility(new OnEventTriggeredAbility(EventType.END_TURN_STEP_PRE, "beginning of the end step", true, new SacrificeSourceEffect())); + } - public BallLightning(final BallLightning card) { - super(card); - } + public BallLightning(final BallLightning card) { + super(card); + } - @Override - public BallLightning copy() { - return new BallLightning(this); - } + @Override + public BallLightning copy() { + return new BallLightning(this); + } } diff --git a/Mage.Sets/src/mage/sets/magic2010/BaneslayerAngel.java b/Mage.Sets/src/mage/sets/magic2010/BaneslayerAngel.java index b6b7fc993c..41f90e64e6 100644 --- a/Mage.Sets/src/mage/sets/magic2010/BaneslayerAngel.java +++ b/Mage.Sets/src/mage/sets/magic2010/BaneslayerAngel.java @@ -52,32 +52,32 @@ public class BaneslayerAngel extends CardImpl { static { filter1.getSubtype().add("Demon"); filter2.getSubtype().add("Dragon"); - filter1.setScopeSubtype(ComparisonScope.Any); - filter2.setScopeSubtype(ComparisonScope.Any); + filter1.setScopeSubtype(ComparisonScope.Any); + filter2.setScopeSubtype(ComparisonScope.Any); } - public BaneslayerAngel(UUID ownerId) { - super(ownerId, 4, "Baneslayer Angel", Rarity.MYTHIC, new CardType[]{CardType.CREATURE}, "{3}{W}{W}"); - this.expansionSetCode = "M10"; - this.subtype.add("Angel"); - this.color.setWhite(true); - this.power = new MageInt(5); - this.toughness = new MageInt(5); + public BaneslayerAngel(UUID ownerId) { + super(ownerId, 4, "Baneslayer Angel", Rarity.MYTHIC, new CardType[]{CardType.CREATURE}, "{3}{W}{W}"); + this.expansionSetCode = "M10"; + this.subtype.add("Angel"); + this.color.setWhite(true); + this.power = new MageInt(5); + this.toughness = new MageInt(5); - this.addAbility(FlyingAbility.getInstance()); - this.addAbility(FirstStrikeAbility.getInstance()); - this.addAbility(LifelinkAbility.getInstance()); - this.addAbility(new ProtectionAbility(filter1)); - this.addAbility(new ProtectionAbility(filter2)); - } + this.addAbility(FlyingAbility.getInstance()); + this.addAbility(FirstStrikeAbility.getInstance()); + this.addAbility(LifelinkAbility.getInstance()); + this.addAbility(new ProtectionAbility(filter1)); + this.addAbility(new ProtectionAbility(filter2)); + } - public BaneslayerAngel(final BaneslayerAngel card) { - super(card); - } + public BaneslayerAngel(final BaneslayerAngel card) { + super(card); + } - @Override - public BaneslayerAngel copy() { - return new BaneslayerAngel(this); - } + @Override + public BaneslayerAngel copy() { + return new BaneslayerAngel(this); + } } diff --git a/Mage.Sets/src/mage/sets/magic2010/BerserkersOfBloodRidge.java b/Mage.Sets/src/mage/sets/magic2010/BerserkersOfBloodRidge.java index 961b2f685d..620a29b730 100644 --- a/Mage.Sets/src/mage/sets/magic2010/BerserkersOfBloodRidge.java +++ b/Mage.Sets/src/mage/sets/magic2010/BerserkersOfBloodRidge.java @@ -41,24 +41,24 @@ import mage.cards.CardImpl; */ public class BerserkersOfBloodRidge extends CardImpl { - public BerserkersOfBloodRidge(UUID ownerId) { - super(ownerId, 126, "Berserkers of Blood Ridge", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{4}{R}"); - this.expansionSetCode = "M10"; - this.color.setRed(true); - this.subtype.add("Human"); - this.subtype.add("Berserker"); - this.power = new MageInt(4); - this.toughness = new MageInt(4); - this.addAbility(new AttacksEachTurnStaticAbility()); - } + public BerserkersOfBloodRidge(UUID ownerId) { + super(ownerId, 126, "Berserkers of Blood Ridge", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{4}{R}"); + this.expansionSetCode = "M10"; + this.color.setRed(true); + this.subtype.add("Human"); + this.subtype.add("Berserker"); + this.power = new MageInt(4); + this.toughness = new MageInt(4); + this.addAbility(new AttacksEachTurnStaticAbility()); + } - public BerserkersOfBloodRidge(final BerserkersOfBloodRidge card) { - super(card); - } + public BerserkersOfBloodRidge(final BerserkersOfBloodRidge card) { + super(card); + } - @Override - public BerserkersOfBloodRidge copy() { - return new BerserkersOfBloodRidge(this); - } + @Override + public BerserkersOfBloodRidge copy() { + return new BerserkersOfBloodRidge(this); + } } diff --git a/Mage.Sets/src/mage/sets/magic2010/BirdsOfParadise.java b/Mage.Sets/src/mage/sets/magic2010/BirdsOfParadise.java index 217617225a..1fe2d1ead4 100644 --- a/Mage.Sets/src/mage/sets/magic2010/BirdsOfParadise.java +++ b/Mage.Sets/src/mage/sets/magic2010/BirdsOfParadise.java @@ -36,19 +36,19 @@ import java.util.UUID; */ public class BirdsOfParadise extends mage.sets.tenth.BirdsOfParadise { - public BirdsOfParadise(UUID ownerId) { - super(ownerId); - this.cardNumber = 168; - this.expansionSetCode = "M10"; - } + public BirdsOfParadise(UUID ownerId) { + super(ownerId); + this.cardNumber = 168; + this.expansionSetCode = "M10"; + } - public BirdsOfParadise(final BirdsOfParadise card) { - super(card); - } + public BirdsOfParadise(final BirdsOfParadise card) { + super(card); + } - @Override - public BirdsOfParadise copy() { - return new BirdsOfParadise(this); - } + @Override + public BirdsOfParadise copy() { + return new BirdsOfParadise(this); + } } diff --git a/Mage.Sets/src/mage/sets/magic2010/BlackKnight.java b/Mage.Sets/src/mage/sets/magic2010/BlackKnight.java index 0c8c5c04d7..996d08e1cf 100644 --- a/Mage.Sets/src/mage/sets/magic2010/BlackKnight.java +++ b/Mage.Sets/src/mage/sets/magic2010/BlackKnight.java @@ -44,34 +44,34 @@ import mage.filter.FilterCard; */ public class BlackKnight extends CardImpl { - private static final FilterCard filter = new FilterCard("White"); + private static final FilterCard filter = new FilterCard("White"); - static { - filter.setUseColor(true); - filter.getColor().setWhite(true); - filter.setScopeColor(ComparisonScope.Any); - } + static { + filter.setUseColor(true); + filter.getColor().setWhite(true); + filter.setScopeColor(ComparisonScope.Any); + } - public BlackKnight(UUID ownerId) { - super(ownerId, 85, "Black Knight", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{B}{B}"); - this.expansionSetCode = "M10"; - this.subtype.add("Human"); - this.subtype.add("Knight"); - this.color.setBlack(true); - this.power = new MageInt(2); - this.toughness = new MageInt(2); + public BlackKnight(UUID ownerId) { + super(ownerId, 85, "Black Knight", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{B}{B}"); + this.expansionSetCode = "M10"; + this.subtype.add("Human"); + this.subtype.add("Knight"); + this.color.setBlack(true); + this.power = new MageInt(2); + this.toughness = new MageInt(2); - this.addAbility(FirstStrikeAbility.getInstance()); - this.addAbility(new ProtectionAbility(filter)); - } + this.addAbility(FirstStrikeAbility.getInstance()); + this.addAbility(new ProtectionAbility(filter)); + } - public BlackKnight(final BlackKnight card) { - super(card); - } + public BlackKnight(final BlackKnight card) { + super(card); + } - @Override - public BlackKnight copy() { - return new BlackKnight(this); - } + @Override + public BlackKnight copy() { + return new BlackKnight(this); + } } diff --git a/Mage.Sets/src/mage/sets/magic2010/BlindingMage.java b/Mage.Sets/src/mage/sets/magic2010/BlindingMage.java index 8d7e9805d5..65638de63f 100644 --- a/Mage.Sets/src/mage/sets/magic2010/BlindingMage.java +++ b/Mage.Sets/src/mage/sets/magic2010/BlindingMage.java @@ -47,27 +47,27 @@ import mage.target.common.TargetCreaturePermanent; */ public class BlindingMage extends CardImpl { - public BlindingMage(UUID ownerId) { - super(ownerId, 5, "Blinding Mage", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{1}{W}"); - this.expansionSetCode = "M10"; - this.subtype.add("Human"); - this.subtype.add("Wizard"); - this.color.setWhite(true); - this.power = new MageInt(1); - this.toughness = new MageInt(2); - Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new TapTargetEffect(), new ManaCostsImpl("{W}")); - ability.addCost(new TapSourceCost()); - ability.addTarget(new TargetCreaturePermanent()); - this.addAbility(ability); - } + public BlindingMage(UUID ownerId) { + super(ownerId, 5, "Blinding Mage", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{1}{W}"); + this.expansionSetCode = "M10"; + this.subtype.add("Human"); + this.subtype.add("Wizard"); + this.color.setWhite(true); + this.power = new MageInt(1); + this.toughness = new MageInt(2); + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new TapTargetEffect(), new ManaCostsImpl("{W}")); + ability.addCost(new TapSourceCost()); + ability.addTarget(new TargetCreaturePermanent()); + this.addAbility(ability); + } - public BlindingMage(final BlindingMage card) { - super(card); - } + public BlindingMage(final BlindingMage card) { + super(card); + } - @Override - public BlindingMage copy() { - return new BlindingMage(this); - } + @Override + public BlindingMage copy() { + return new BlindingMage(this); + } } diff --git a/Mage.Sets/src/mage/sets/magic2010/BogWraith.java b/Mage.Sets/src/mage/sets/magic2010/BogWraith.java index 1518fa58f7..ef88792522 100644 --- a/Mage.Sets/src/mage/sets/magic2010/BogWraith.java +++ b/Mage.Sets/src/mage/sets/magic2010/BogWraith.java @@ -41,23 +41,23 @@ import mage.cards.CardImpl; */ public class BogWraith extends CardImpl { - public BogWraith(UUID ownerId) { - super(ownerId, 86, "Bog Wraith", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{3}{B}"); - this.expansionSetCode = "M10"; - this.color.setBlack(true); - this.subtype.add("Wraith"); - this.power = new MageInt(3); - this.toughness = new MageInt(3); - this.addAbility(new SwampwalkAbility()); - } + public BogWraith(UUID ownerId) { + super(ownerId, 86, "Bog Wraith", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{3}{B}"); + this.expansionSetCode = "M10"; + this.color.setBlack(true); + this.subtype.add("Wraith"); + this.power = new MageInt(3); + this.toughness = new MageInt(3); + this.addAbility(new SwampwalkAbility()); + } - public BogWraith(final BogWraith card) { - super(card); - } + public BogWraith(final BogWraith card) { + super(card); + } - @Override - public BogWraith copy() { - return new BogWraith(this); - } + @Override + public BogWraith copy() { + return new BogWraith(this); + } } diff --git a/Mage.Sets/src/mage/sets/magic2010/BogardanHellkite.java b/Mage.Sets/src/mage/sets/magic2010/BogardanHellkite.java index afcbc9f121..1399aacc1b 100644 --- a/Mage.Sets/src/mage/sets/magic2010/BogardanHellkite.java +++ b/Mage.Sets/src/mage/sets/magic2010/BogardanHellkite.java @@ -46,28 +46,28 @@ import mage.target.common.TargetCreatureOrPlayerAmount; */ public class BogardanHellkite extends CardImpl { - public BogardanHellkite(UUID ownerId) { - super(ownerId, 127, "Bogardan Hellkite", Rarity.MYTHIC, new CardType[]{CardType.CREATURE}, "{6}{R}{R}"); - this.expansionSetCode = "M10"; - this.subtype.add("Dragon"); - this.color.setRed(true); - this.power = new MageInt(5); - this.toughness = new MageInt(5); + public BogardanHellkite(UUID ownerId) { + super(ownerId, 127, "Bogardan Hellkite", Rarity.MYTHIC, new CardType[]{CardType.CREATURE}, "{6}{R}{R}"); + this.expansionSetCode = "M10"; + this.subtype.add("Dragon"); + this.color.setRed(true); + this.power = new MageInt(5); + this.toughness = new MageInt(5); - this.addAbility(FlashAbility.getInstance()); - this.addAbility(FlyingAbility.getInstance()); - Ability ability = new EntersBattlefieldTriggeredAbility(new DamageMultiEffect(5), false); - ability.addTarget(new TargetCreatureOrPlayerAmount(5)); - this.addAbility(ability); - } + this.addAbility(FlashAbility.getInstance()); + this.addAbility(FlyingAbility.getInstance()); + Ability ability = new EntersBattlefieldTriggeredAbility(new DamageMultiEffect(5), false); + ability.addTarget(new TargetCreatureOrPlayerAmount(5)); + this.addAbility(ability); + } - public BogardanHellkite(final BogardanHellkite card) { - super(card); - } + public BogardanHellkite(final BogardanHellkite card) { + super(card); + } - @Override - public BogardanHellkite copy() { - return new BogardanHellkite(this); - } + @Override + public BogardanHellkite copy() { + return new BogardanHellkite(this); + } } diff --git a/Mage.Sets/src/mage/sets/magic2010/Cancel.java b/Mage.Sets/src/mage/sets/magic2010/Cancel.java index 7c20e0f8ce..3254122783 100644 --- a/Mage.Sets/src/mage/sets/magic2010/Cancel.java +++ b/Mage.Sets/src/mage/sets/magic2010/Cancel.java @@ -36,19 +36,19 @@ import java.util.UUID; */ public class Cancel extends mage.sets.tenth.Cancel { - public Cancel(UUID ownerId) { - super(ownerId); - this.cardNumber = 44; - this.expansionSetCode = "M10"; - } + public Cancel(UUID ownerId) { + super(ownerId); + this.cardNumber = 44; + this.expansionSetCode = "M10"; + } - public Cancel(final Cancel card) { - super(card); - } + public Cancel(final Cancel card) { + super(card); + } - @Override - public Cancel copy() { - return new Cancel(this); - } + @Override + public Cancel copy() { + return new Cancel(this); + } } \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/magic2010/CanyonMinotaur.java b/Mage.Sets/src/mage/sets/magic2010/CanyonMinotaur.java index e88d4f980c..302c769a92 100644 --- a/Mage.Sets/src/mage/sets/magic2010/CanyonMinotaur.java +++ b/Mage.Sets/src/mage/sets/magic2010/CanyonMinotaur.java @@ -36,19 +36,19 @@ import java.util.UUID; */ public class CanyonMinotaur extends mage.sets.conflux.CanyonMinotaur { - public CanyonMinotaur(UUID ownerId) { - super(ownerId); - this.cardNumber = 130; - this.expansionSetCode = "M10"; - } + public CanyonMinotaur(UUID ownerId) { + super(ownerId); + this.cardNumber = 130; + this.expansionSetCode = "M10"; + } - public CanyonMinotaur(final CanyonMinotaur card) { - super(card); - } + public CanyonMinotaur(final CanyonMinotaur card) { + super(card); + } - @Override - public CanyonMinotaur copy() { - return new CanyonMinotaur(this); - } + @Override + public CanyonMinotaur copy() { + return new CanyonMinotaur(this); + } } diff --git a/Mage.Sets/src/mage/sets/magic2010/CelestialPurge.java b/Mage.Sets/src/mage/sets/magic2010/CelestialPurge.java index 4038973dea..4d1c8bfef3 100644 --- a/Mage.Sets/src/mage/sets/magic2010/CelestialPurge.java +++ b/Mage.Sets/src/mage/sets/magic2010/CelestialPurge.java @@ -36,19 +36,19 @@ import java.util.UUID; */ public class CelestialPurge extends mage.sets.conflux.CelestialPurge { - public CelestialPurge(UUID ownerId) { - super(ownerId); - this.cardNumber = 7; - this.expansionSetCode = "M10"; - } + public CelestialPurge(UUID ownerId) { + super(ownerId); + this.cardNumber = 7; + this.expansionSetCode = "M10"; + } - public CelestialPurge(final CelestialPurge card) { - super(card); - } + public CelestialPurge(final CelestialPurge card) { + super(card); + } - @Override - public CelestialPurge copy() { - return new CelestialPurge(this); - } + @Override + public CelestialPurge copy() { + return new CelestialPurge(this); + } } \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/magic2010/ChandraNalaar.java b/Mage.Sets/src/mage/sets/magic2010/ChandraNalaar.java index 8b9119d191..ef59e52ca5 100644 --- a/Mage.Sets/src/mage/sets/magic2010/ChandraNalaar.java +++ b/Mage.Sets/src/mage/sets/magic2010/ChandraNalaar.java @@ -55,38 +55,38 @@ import java.util.UUID; */ public class ChandraNalaar extends CardImpl { - public ChandraNalaar(UUID ownerId) { - super(ownerId, 132, "Chandra Nalaar", Rarity.MYTHIC, new CardType[]{CardType.PLANESWALKER}, "{3}{R}{R}"); - this.expansionSetCode = "M10"; - this.subtype.add("Chandra"); - this.color.setRed(true); - this.addAbility(new EntersBattlefieldAbility(new AddCountersSourceEffect(CounterType.LOYALTY.createInstance(6)), "")); + public ChandraNalaar(UUID ownerId) { + super(ownerId, 132, "Chandra Nalaar", Rarity.MYTHIC, new CardType[]{CardType.PLANESWALKER}, "{3}{R}{R}"); + this.expansionSetCode = "M10"; + this.subtype.add("Chandra"); + this.color.setRed(true); + this.addAbility(new EntersBattlefieldAbility(new AddCountersSourceEffect(CounterType.LOYALTY.createInstance(6)), "")); - LoyaltyAbility ability1 = new LoyaltyAbility(new DamageTargetEffect(1), 1); - ability1.addTarget(new TargetPlayer()); - this.addAbility(ability1); + LoyaltyAbility ability1 = new LoyaltyAbility(new DamageTargetEffect(1), 1); + ability1.addTarget(new TargetPlayer()); + this.addAbility(ability1); - LoyaltyAbility ability2 = new LoyaltyAbility(new DamageTargetEffect(ChandraNalaarXValue.getDefault())); - ability2.addTarget(new TargetCreaturePermanent()); - this.addAbility(ability2); + LoyaltyAbility ability2 = new LoyaltyAbility(new DamageTargetEffect(ChandraNalaarXValue.getDefault())); + ability2.addTarget(new TargetCreaturePermanent()); + this.addAbility(ability2); - Effects effects1 = new Effects(); - effects1.add(new DamageTargetEffect(10)); - effects1.add(new DamageAllControlledTargetEffect(10, new FilterCreaturePermanent())); - LoyaltyAbility ability3 = new LoyaltyAbility(effects1, -8); - ability3.addTarget(new TargetPlayer()); - this.addAbility(ability3); - } + Effects effects1 = new Effects(); + effects1.add(new DamageTargetEffect(10)); + effects1.add(new DamageAllControlledTargetEffect(10, new FilterCreaturePermanent())); + LoyaltyAbility ability3 = new LoyaltyAbility(effects1, -8); + ability3.addTarget(new TargetPlayer()); + this.addAbility(ability3); + } - public ChandraNalaar(final ChandraNalaar card) { - super(card); - } + public ChandraNalaar(final ChandraNalaar card) { + super(card); + } - @Override - public ChandraNalaar copy() { - return new ChandraNalaar(this); - } + @Override + public ChandraNalaar copy() { + return new ChandraNalaar(this); + } } class ChandraNalaarXValue implements DynamicValue { diff --git a/Mage.Sets/src/mage/sets/magic2010/ChildOfNight.java b/Mage.Sets/src/mage/sets/magic2010/ChildOfNight.java index fcf6f5c5a3..d57a088296 100644 --- a/Mage.Sets/src/mage/sets/magic2010/ChildOfNight.java +++ b/Mage.Sets/src/mage/sets/magic2010/ChildOfNight.java @@ -41,24 +41,24 @@ import mage.cards.CardImpl; */ public class ChildOfNight extends CardImpl { - public ChildOfNight(UUID ownerId) { - super(ownerId, 88, "Child of Night", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{1}{B}"); - this.expansionSetCode = "M10"; - this.color.setBlack(true); - this.subtype.add("Vampire"); - this.power = new MageInt(2); - this.toughness = new MageInt(1); + public ChildOfNight(UUID ownerId) { + super(ownerId, 88, "Child of Night", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{1}{B}"); + this.expansionSetCode = "M10"; + this.color.setBlack(true); + this.subtype.add("Vampire"); + this.power = new MageInt(2); + this.toughness = new MageInt(1); - this.addAbility(LifelinkAbility.getInstance()); - } + this.addAbility(LifelinkAbility.getInstance()); + } - public ChildOfNight(final ChildOfNight card) { - super(card); - } + public ChildOfNight(final ChildOfNight card) { + super(card); + } - @Override - public ChildOfNight copy() { - return new ChildOfNight(this); - } + @Override + public ChildOfNight copy() { + return new ChildOfNight(this); + } } diff --git a/Mage.Sets/src/mage/sets/magic2010/Clone.java b/Mage.Sets/src/mage/sets/magic2010/Clone.java index 0ecc9b9c0a..dd40122eec 100644 --- a/Mage.Sets/src/mage/sets/magic2010/Clone.java +++ b/Mage.Sets/src/mage/sets/magic2010/Clone.java @@ -36,19 +36,19 @@ import java.util.UUID; */ public class Clone extends mage.sets.tenth.Clone { - public Clone(UUID ownerId) { - super(ownerId); - this.cardNumber = 45; - this.expansionSetCode = "M10"; - } + public Clone(UUID ownerId) { + super(ownerId); + this.cardNumber = 45; + this.expansionSetCode = "M10"; + } - public Clone(final Clone card) { - super(card); - } + public Clone(final Clone card) { + super(card); + } - @Override - public Clone copy() { - return new Clone(this); - } + @Override + public Clone copy() { + return new Clone(this); + } } \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/magic2010/ConsumeSpirit.java b/Mage.Sets/src/mage/sets/magic2010/ConsumeSpirit.java index ea81575f72..fdc36b319f 100644 --- a/Mage.Sets/src/mage/sets/magic2010/ConsumeSpirit.java +++ b/Mage.Sets/src/mage/sets/magic2010/ConsumeSpirit.java @@ -46,67 +46,67 @@ import java.util.UUID; */ public class ConsumeSpirit extends CardImpl { - public static final FilterMana filterBlack = new FilterMana(); + public static final FilterMana filterBlack = new FilterMana(); - static { - filterBlack.setBlack(true); - } + static { + filterBlack.setBlack(true); + } - public ConsumeSpirit(UUID ownerId) { - super(ownerId, 89, "Consume Spirit", Rarity.UNCOMMON, new CardType[]{CardType.SORCERY}, "{X}{1}{B}"); - this.expansionSetCode = "M10"; + public ConsumeSpirit(UUID ownerId) { + super(ownerId, 89, "Consume Spirit", Rarity.UNCOMMON, new CardType[]{CardType.SORCERY}, "{X}{1}{B}"); + this.expansionSetCode = "M10"; - this.color.setBlack(true); + this.color.setBlack(true); - // Spend only black mana on X. - // Consume Spirit deals X damage to target creature or player and you gain X life. - this.getSpellAbility().addTarget(new TargetCreatureOrPlayer()); - this.getSpellAbility().addEffect(new ConsumeSpiritEffect()); - this.getSpellAbility().getManaCostsToPay().getVariableCosts().get(0).setFilter(filterBlack); - } + // Spend only black mana on X. + // Consume Spirit deals X damage to target creature or player and you gain X life. + this.getSpellAbility().addTarget(new TargetCreatureOrPlayer()); + this.getSpellAbility().addEffect(new ConsumeSpiritEffect()); + this.getSpellAbility().getManaCostsToPay().getVariableCosts().get(0).setFilter(filterBlack); + } - public ConsumeSpirit(final ConsumeSpirit card) { - super(card); - } + public ConsumeSpirit(final ConsumeSpirit card) { + super(card); + } - @Override - public ConsumeSpirit copy() { - return new ConsumeSpirit(this); - } + @Override + public ConsumeSpirit copy() { + return new ConsumeSpirit(this); + } } class ConsumeSpiritEffect extends OneShotEffect { - public ConsumeSpiritEffect() { - super(Constants.Outcome.Damage); - staticText = "Consume Spirit deals X damage to target creature or player and you gain X life.Spend only black mana on X"; - } + public ConsumeSpiritEffect() { + super(Constants.Outcome.Damage); + staticText = "Consume Spirit deals X damage to target creature or player and you gain X life.Spend only black mana on X"; + } - public ConsumeSpiritEffect(final ConsumeSpiritEffect effect) { - super(effect); - } + public ConsumeSpiritEffect(final ConsumeSpiritEffect effect) { + super(effect); + } - @Override - public boolean apply(Game game, Ability source) { - int damage = source.getManaCostsToPay().getX(); - if (damage > 0) { - Permanent permanent = game.getPermanent(getTargetPointer().getFirst(game, source)); - if (permanent != null) { - permanent.damage(damage, source.getSourceId(), game, true, false); - } else { - Player player = game.getPlayer(getTargetPointer().getFirst(game, source)); - if (player != null) { - player.damage(damage, source.getSourceId(), game, false, true); - } - } - return true; - } - return false; - } + @Override + public boolean apply(Game game, Ability source) { + int damage = source.getManaCostsToPay().getX(); + if (damage > 0) { + Permanent permanent = game.getPermanent(getTargetPointer().getFirst(game, source)); + if (permanent != null) { + permanent.damage(damage, source.getSourceId(), game, true, false); + } else { + Player player = game.getPlayer(getTargetPointer().getFirst(game, source)); + if (player != null) { + player.damage(damage, source.getSourceId(), game, false, true); + } + } + return true; + } + return false; + } - @Override - public ConsumeSpiritEffect copy() { - return new ConsumeSpiritEffect(this); - } + @Override + public ConsumeSpiritEffect copy() { + return new ConsumeSpiritEffect(this); + } } diff --git a/Mage.Sets/src/mage/sets/magic2010/CoralMerfolk.java b/Mage.Sets/src/mage/sets/magic2010/CoralMerfolk.java index bd4864565e..c7142dd95d 100644 --- a/Mage.Sets/src/mage/sets/magic2010/CoralMerfolk.java +++ b/Mage.Sets/src/mage/sets/magic2010/CoralMerfolk.java @@ -46,7 +46,7 @@ public class CoralMerfolk extends CardImpl { this.color.setBlue(true); this.subtype.add("Merfolk"); this.power = new MageInt(2); - this.toughness = new MageInt(1); + this.toughness = new MageInt(1); } public CoralMerfolk(final CoralMerfolk card) { diff --git a/Mage.Sets/src/mage/sets/magic2010/CudgelTroll.java b/Mage.Sets/src/mage/sets/magic2010/CudgelTroll.java index 1df403db42..2aa93b7b2e 100644 --- a/Mage.Sets/src/mage/sets/magic2010/CudgelTroll.java +++ b/Mage.Sets/src/mage/sets/magic2010/CudgelTroll.java @@ -44,24 +44,24 @@ import mage.cards.CardImpl; */ public class CudgelTroll extends CardImpl { - public CudgelTroll(UUID ownerId) { - super(ownerId, 174, "Cudgel Troll", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{2}{G}{G}"); - this.expansionSetCode = "M10"; - this.color.setGreen(true); - this.subtype.add("Troll"); - this.power = new MageInt(4); - this.toughness = new MageInt(3); + public CudgelTroll(UUID ownerId) { + super(ownerId, 174, "Cudgel Troll", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{2}{G}{G}"); + this.expansionSetCode = "M10"; + this.color.setGreen(true); + this.subtype.add("Troll"); + this.power = new MageInt(4); + this.toughness = new MageInt(3); - this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new RegenerateSourceEffect(), new ManaCostsImpl("{G}"))); - } + this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new RegenerateSourceEffect(), new ManaCostsImpl("{G}"))); + } - public CudgelTroll(final CudgelTroll card) { - super(card); - } + public CudgelTroll(final CudgelTroll card) { + super(card); + } - @Override - public CudgelTroll copy() { - return new CudgelTroll(this); - } + @Override + public CudgelTroll copy() { + return new CudgelTroll(this); + } } diff --git a/Mage.Sets/src/mage/sets/magic2010/DeadlyRecluse.java b/Mage.Sets/src/mage/sets/magic2010/DeadlyRecluse.java index c76f2ec384..c83dec96c7 100644 --- a/Mage.Sets/src/mage/sets/magic2010/DeadlyRecluse.java +++ b/Mage.Sets/src/mage/sets/magic2010/DeadlyRecluse.java @@ -48,7 +48,7 @@ public class DeadlyRecluse extends CardImpl { this.color.setGreen(true); this.subtype.add("Spider"); this.power = new MageInt(1); - this.toughness = new MageInt(2); + this.toughness = new MageInt(2); this.addAbility(ReachAbility.getInstance()); this.addAbility(DeathtouchAbility.getInstance()); } diff --git a/Mage.Sets/src/mage/sets/magic2010/Deathmark.java b/Mage.Sets/src/mage/sets/magic2010/Deathmark.java index ff99824023..9cd375292e 100644 --- a/Mage.Sets/src/mage/sets/magic2010/Deathmark.java +++ b/Mage.Sets/src/mage/sets/magic2010/Deathmark.java @@ -36,19 +36,19 @@ import java.util.UUID; */ public class Deathmark extends mage.sets.tenth.Deathmark { - public Deathmark(UUID ownerId) { - super(ownerId); - this.cardNumber = 90; - this.expansionSetCode = "M10"; - } + public Deathmark(UUID ownerId) { + super(ownerId); + this.cardNumber = 90; + this.expansionSetCode = "M10"; + } - public Deathmark(final Deathmark card) { - super(card); - } + public Deathmark(final Deathmark card) { + super(card); + } - @Override - public Deathmark copy() { - return new Deathmark(this); - } + @Override + public Deathmark copy() { + return new Deathmark(this); + } } \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/magic2010/DemonsHorn.java b/Mage.Sets/src/mage/sets/magic2010/DemonsHorn.java index fabd9818a5..98d2dc8077 100644 --- a/Mage.Sets/src/mage/sets/magic2010/DemonsHorn.java +++ b/Mage.Sets/src/mage/sets/magic2010/DemonsHorn.java @@ -36,19 +36,19 @@ import java.util.UUID; */ public class DemonsHorn extends mage.sets.tenth.DemonsHorn { - public DemonsHorn(UUID ownerId) { - super(ownerId); - this.cardNumber = 209; - this.expansionSetCode = "M10"; - } + public DemonsHorn(UUID ownerId) { + super(ownerId); + this.cardNumber = 209; + this.expansionSetCode = "M10"; + } - public DemonsHorn(final DemonsHorn card) { - super(card); - } + public DemonsHorn(final DemonsHorn card) { + super(card); + } - @Override - public DemonsHorn copy() { - return new DemonsHorn(this); - } + @Override + public DemonsHorn copy() { + return new DemonsHorn(this); + } } diff --git a/Mage.Sets/src/mage/sets/magic2010/DiabolicTutor.java b/Mage.Sets/src/mage/sets/magic2010/DiabolicTutor.java index a3ea5925d9..877103a95c 100644 --- a/Mage.Sets/src/mage/sets/magic2010/DiabolicTutor.java +++ b/Mage.Sets/src/mage/sets/magic2010/DiabolicTutor.java @@ -36,19 +36,19 @@ import java.util.UUID; */ public class DiabolicTutor extends mage.sets.tenth.DiabolicTutor { - public DiabolicTutor(UUID ownerId) { - super(ownerId); - this.cardNumber = 91; - this.expansionSetCode = "M10"; - } + public DiabolicTutor(UUID ownerId) { + super(ownerId); + this.cardNumber = 91; + this.expansionSetCode = "M10"; + } - public DiabolicTutor(final DiabolicTutor card) { - super(card); - } + public DiabolicTutor(final DiabolicTutor card) { + super(card); + } - @Override - public DiabolicTutor copy() { - return new DiabolicTutor(this); - } + @Override + public DiabolicTutor copy() { + return new DiabolicTutor(this); + } } diff --git a/Mage.Sets/src/mage/sets/magic2010/Disentomb.java b/Mage.Sets/src/mage/sets/magic2010/Disentomb.java index 55741fa4e8..4b77a3f883 100644 --- a/Mage.Sets/src/mage/sets/magic2010/Disentomb.java +++ b/Mage.Sets/src/mage/sets/magic2010/Disentomb.java @@ -42,23 +42,23 @@ import mage.target.common.TargetCardInYourGraveyard; */ public class Disentomb extends CardImpl { - private static FilterCreatureCard filter = new FilterCreatureCard("creature card from your graveyard"); + private static FilterCreatureCard filter = new FilterCreatureCard("creature card from your graveyard"); - public Disentomb(UUID ownerId) { - super(ownerId, 92, "Disentomb", Rarity.COMMON, new CardType[]{CardType.SORCERY}, "{B}"); - this.expansionSetCode = "M10"; - this.color.setBlack(true); - this.getSpellAbility().addTarget(new TargetCardInYourGraveyard(filter)); - this.getSpellAbility().addEffect(new ReturnToHandTargetEffect()); - } + public Disentomb(UUID ownerId) { + super(ownerId, 92, "Disentomb", Rarity.COMMON, new CardType[]{CardType.SORCERY}, "{B}"); + this.expansionSetCode = "M10"; + this.color.setBlack(true); + this.getSpellAbility().addTarget(new TargetCardInYourGraveyard(filter)); + this.getSpellAbility().addEffect(new ReturnToHandTargetEffect()); + } - public Disentomb(final Disentomb card) { - super(card); - } + public Disentomb(final Disentomb card) { + super(card); + } - @Override - public Disentomb copy() { - return new Disentomb(this); - } + @Override + public Disentomb copy() { + return new Disentomb(this); + } } diff --git a/Mage.Sets/src/mage/sets/magic2010/DjinnOfWishes.java b/Mage.Sets/src/mage/sets/magic2010/DjinnOfWishes.java index 68e5200063..0f727779f2 100644 --- a/Mage.Sets/src/mage/sets/magic2010/DjinnOfWishes.java +++ b/Mage.Sets/src/mage/sets/magic2010/DjinnOfWishes.java @@ -56,7 +56,7 @@ import mage.players.Player; */ public class DjinnOfWishes extends CardImpl { - private static final String ruleText = "Djinn of Wishes enters the battlefield with three wish counters on it"; + private static final String ruleText = "Djinn of Wishes enters the battlefield with three wish counters on it"; public DjinnOfWishes(UUID ownerId) { super(ownerId, 50, "Djinn of Wishes", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{3}{U}{U}"); @@ -69,12 +69,12 @@ public class DjinnOfWishes extends CardImpl { this.addAbility(FlyingAbility.getInstance()); // Djinn of Wishes enters the battlefield with three wish counters on it. - this.addAbility(new EntersBattlefieldAbility(new AddCountersSourceEffect(CounterType.WISH.createInstance(3)), ruleText)); + this.addAbility(new EntersBattlefieldAbility(new AddCountersSourceEffect(CounterType.WISH.createInstance(3)), ruleText)); // {2}{U}{U}, Remove a wish counter from Djinn of Wishes: Reveal the top card of your library. You may play that card without paying its mana cost. If you don't, exile it. - Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DjinnOfWishesEffect(), new ManaCostsImpl("{2}{U}{U}")); - ability.addCost(new RemoveCountersSourceCost(CounterType.WISH.createInstance())); - this.addAbility(ability); + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DjinnOfWishesEffect(), new ManaCostsImpl("{2}{U}{U}")); + ability.addCost(new RemoveCountersSourceCost(CounterType.WISH.createInstance())); + this.addAbility(ability); } public DjinnOfWishes(final DjinnOfWishes card) { @@ -89,52 +89,52 @@ public class DjinnOfWishes extends CardImpl { class DjinnOfWishesEffect extends OneShotEffect { - public DjinnOfWishesEffect() { - super(Outcome.PlayForFree); - staticText = "Reveal the top card of your library. You may play that card without paying its mana cost. If you don't, exile it"; - } + public DjinnOfWishesEffect() { + super(Outcome.PlayForFree); + staticText = "Reveal the top card of your library. You may play that card without paying its mana cost. If you don't, exile it"; + } - public DjinnOfWishesEffect(final DjinnOfWishesEffect effect) { - super(effect); - } + public DjinnOfWishesEffect(final DjinnOfWishesEffect effect) { + super(effect); + } - @Override - public boolean apply(Game game, Ability source) { - Player player = game.getPlayer(source.getControllerId()); - if (player != null && player.getLibrary().size() > 0) { - Card card = player.getLibrary().getFromTop(game); - Cards cards = new CardsImpl(); - cards.add(card); - player.revealCards("Djinn Of Wishes", cards, game); + @Override + public boolean apply(Game game, Ability source) { + Player player = game.getPlayer(source.getControllerId()); + if (player != null && player.getLibrary().size() > 0) { + Card card = player.getLibrary().getFromTop(game); + Cards cards = new CardsImpl(); + cards.add(card); + player.revealCards("Djinn Of Wishes", cards, game); - player.getLibrary().removeFromTop(game); + player.getLibrary().removeFromTop(game); - boolean used = false; - if (player.chooseUse(Outcome.PlayForFree, "Play " + card.getName() + " without paying its mana cost?", game)) { - if (card.getCardType().contains(CardType.LAND)) { - // If the revealed card is a land, you can play it only if it's your turn and you haven't yet played a land this turn. - if (game.getActivePlayerId().equals(player.getId()) && player.getLandsPlayed() < player.getLandsPerTurn()) { - used = true; - player.playLand(card, game); - } - } else { - used = true; - player.cast(card.getSpellAbility(), game, true); - } + boolean used = false; + if (player.chooseUse(Outcome.PlayForFree, "Play " + card.getName() + " without paying its mana cost?", game)) { + if (card.getCardType().contains(CardType.LAND)) { + // If the revealed card is a land, you can play it only if it's your turn and you haven't yet played a land this turn. + if (game.getActivePlayerId().equals(player.getId()) && player.getLandsPlayed() < player.getLandsPerTurn()) { + used = true; + player.playLand(card, game); + } + } else { + used = true; + player.cast(card.getSpellAbility(), game, true); + } } - if (!used) { - card.moveToZone(Zone.EXILED, source.getSourceId(), game, false); - } + if (!used) { + card.moveToZone(Zone.EXILED, source.getSourceId(), game, false); + } - return true; - } - return false; - } + return true; + } + return false; + } - @Override - public DjinnOfWishesEffect copy() { - return new DjinnOfWishesEffect(this); - } + @Override + public DjinnOfWishesEffect copy() { + return new DjinnOfWishesEffect(this); + } } diff --git a/Mage.Sets/src/mage/sets/magic2010/DoomBlade.java b/Mage.Sets/src/mage/sets/magic2010/DoomBlade.java index e5e77e219a..fbaf5aa223 100644 --- a/Mage.Sets/src/mage/sets/magic2010/DoomBlade.java +++ b/Mage.Sets/src/mage/sets/magic2010/DoomBlade.java @@ -44,11 +44,11 @@ public class DoomBlade extends CardImpl { private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("nonblack creature"); - static { - filter.setUseColor(true); - filter.getColor().setBlack(true); - filter.setNotColor(true); - } + static { + filter.setUseColor(true); + filter.getColor().setBlack(true); + filter.setNotColor(true); + } public DoomBlade(UUID ownerId){ super(ownerId, 93, "Doom Blade", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{1}{B}"); @@ -58,12 +58,12 @@ public class DoomBlade extends CardImpl { this.getSpellAbility().addEffect(new DestroyTargetEffect()); } - public DoomBlade(final DoomBlade card) { - super(card); - } + public DoomBlade(final DoomBlade card) { + super(card); + } - @Override - public DoomBlade copy() { - return new DoomBlade(this); - } + @Override + public DoomBlade copy() { + return new DoomBlade(this); + } } diff --git a/Mage.Sets/src/mage/sets/magic2010/DragonsClaw.java b/Mage.Sets/src/mage/sets/magic2010/DragonsClaw.java index 1789448c97..5fdcc8eeb4 100644 --- a/Mage.Sets/src/mage/sets/magic2010/DragonsClaw.java +++ b/Mage.Sets/src/mage/sets/magic2010/DragonsClaw.java @@ -36,19 +36,19 @@ import java.util.UUID; */ public class DragonsClaw extends mage.sets.tenth.DragonsClaw { - public DragonsClaw(UUID ownerId) { - super(ownerId); - this.cardNumber = 210; - this.expansionSetCode = "M10"; - } + public DragonsClaw(UUID ownerId) { + super(ownerId); + this.cardNumber = 210; + this.expansionSetCode = "M10"; + } - public DragonsClaw(final DragonsClaw card) { - super(card); - } + public DragonsClaw(final DragonsClaw card) { + super(card); + } - @Override - public DragonsClaw copy() { - return new DragonsClaw(this); - } + @Override + public DragonsClaw copy() { + return new DragonsClaw(this); + } } diff --git a/Mage.Sets/src/mage/sets/magic2010/DragonskullSummit.java b/Mage.Sets/src/mage/sets/magic2010/DragonskullSummit.java index 36466afb46..ada8d86863 100644 --- a/Mage.Sets/src/mage/sets/magic2010/DragonskullSummit.java +++ b/Mage.Sets/src/mage/sets/magic2010/DragonskullSummit.java @@ -49,32 +49,32 @@ import mage.filter.common.FilterLandPermanent; */ public class DragonskullSummit extends CardImpl { - private static final FilterLandPermanent filter = new FilterLandPermanent(); + private static final FilterLandPermanent filter = new FilterLandPermanent(); - static { - filter.getSubtype().add("Swamp"); - filter.getSubtype().add("Mountain"); - filter.setScopeSubtype(ComparisonScope.Any); - filter.setMessage("Swamp or a Mountain"); - } + static { + filter.getSubtype().add("Swamp"); + filter.getSubtype().add("Mountain"); + filter.setScopeSubtype(ComparisonScope.Any); + filter.setMessage("Swamp or a Mountain"); + } - public DragonskullSummit(UUID ownerId) { - super(ownerId, 223, "Dragonskull Summit", Rarity.RARE, new CardType[]{CardType.LAND}, null); - this.expansionSetCode = "M10"; + public DragonskullSummit(UUID ownerId) { + super(ownerId, 223, "Dragonskull Summit", Rarity.RARE, new CardType[]{CardType.LAND}, null); + this.expansionSetCode = "M10"; - Condition controls = new UnlessCondition(new ControlsPermanentCondition(filter, ControlsPermanentCondition.CountType.MORE_THAN, 0)); - String abilityText = "tap it unless you control a " + filter.getMessage(); - this.addAbility(new EntersBattlefieldAbility(new ConditionalOneShotEffect(new TapSourceEffect(), controls, abilityText), abilityText)); - this.addAbility(new BlackManaAbility()); - this.addAbility(new RedManaAbility()); - } + Condition controls = new UnlessCondition(new ControlsPermanentCondition(filter, ControlsPermanentCondition.CountType.MORE_THAN, 0)); + String abilityText = "tap it unless you control a " + filter.getMessage(); + this.addAbility(new EntersBattlefieldAbility(new ConditionalOneShotEffect(new TapSourceEffect(), controls, abilityText), abilityText)); + this.addAbility(new BlackManaAbility()); + this.addAbility(new RedManaAbility()); + } - public DragonskullSummit(final DragonskullSummit card) { - super(card); - } + public DragonskullSummit(final DragonskullSummit card) { + super(card); + } - @Override - public DragonskullSummit copy() { - return new DragonskullSummit(this); - } + @Override + public DragonskullSummit copy() { + return new DragonskullSummit(this); + } } diff --git a/Mage.Sets/src/mage/sets/magic2010/DrownedCatacomb.java b/Mage.Sets/src/mage/sets/magic2010/DrownedCatacomb.java index c680b37b98..bde1eee84f 100644 --- a/Mage.Sets/src/mage/sets/magic2010/DrownedCatacomb.java +++ b/Mage.Sets/src/mage/sets/magic2010/DrownedCatacomb.java @@ -49,32 +49,32 @@ import mage.filter.common.FilterLandPermanent; */ public class DrownedCatacomb extends CardImpl { - private static final FilterLandPermanent filter = new FilterLandPermanent(); + private static final FilterLandPermanent filter = new FilterLandPermanent(); - static { - filter.getSubtype().add("Swamp"); - filter.getSubtype().add("Island"); - filter.setScopeSubtype(ComparisonScope.Any); - filter.setMessage("Island or a Swamp"); - } + static { + filter.getSubtype().add("Swamp"); + filter.getSubtype().add("Island"); + filter.setScopeSubtype(ComparisonScope.Any); + filter.setMessage("Island or a Swamp"); + } - public DrownedCatacomb(UUID ownerId) { - super(ownerId, 224, "Drowned Catacomb", Rarity.RARE, new CardType[]{CardType.LAND}, null); - this.expansionSetCode = "M10"; + public DrownedCatacomb(UUID ownerId) { + super(ownerId, 224, "Drowned Catacomb", Rarity.RARE, new CardType[]{CardType.LAND}, null); + this.expansionSetCode = "M10"; - Condition controls = new UnlessCondition(new ControlsPermanentCondition(filter, ControlsPermanentCondition.CountType.MORE_THAN, 0)); - String abilityText = "tap it unless you control a " + filter.getMessage(); - this.addAbility(new EntersBattlefieldAbility(new ConditionalOneShotEffect(new TapSourceEffect(), controls, abilityText), abilityText)); - this.addAbility(new BlackManaAbility()); - this.addAbility(new BlueManaAbility()); - } + Condition controls = new UnlessCondition(new ControlsPermanentCondition(filter, ControlsPermanentCondition.CountType.MORE_THAN, 0)); + String abilityText = "tap it unless you control a " + filter.getMessage(); + this.addAbility(new EntersBattlefieldAbility(new ConditionalOneShotEffect(new TapSourceEffect(), controls, abilityText), abilityText)); + this.addAbility(new BlackManaAbility()); + this.addAbility(new BlueManaAbility()); + } - public DrownedCatacomb(final DrownedCatacomb card) { - super(card); - } + public DrownedCatacomb(final DrownedCatacomb card) { + super(card); + } - @Override - public DrownedCatacomb copy() { - return new DrownedCatacomb(this); - } + @Override + public DrownedCatacomb copy() { + return new DrownedCatacomb(this); + } } diff --git a/Mage.Sets/src/mage/sets/magic2010/Duress.java b/Mage.Sets/src/mage/sets/magic2010/Duress.java index 3c1d31ab91..cdfafc8a60 100644 --- a/Mage.Sets/src/mage/sets/magic2010/Duress.java +++ b/Mage.Sets/src/mage/sets/magic2010/Duress.java @@ -57,57 +57,57 @@ public class Duress extends CardImpl { this.getSpellAbility().addEffect(new DuressEffect()); } - public Duress(final Duress card) { - super(card); - } + public Duress(final Duress card) { + super(card); + } - @Override - public Duress copy() { - return new Duress(this); - } + @Override + public Duress copy() { + return new Duress(this); + } } class DuressEffect extends OneShotEffect { - private static final FilterCard filter = new FilterCard("noncreature, nonland card"); + private static final FilterCard filter = new FilterCard("noncreature, nonland card"); - static { - filter.getNotCardType().add(CardType.CREATURE); - filter.getNotCardType().add(CardType.LAND); - } + static { + filter.getNotCardType().add(CardType.CREATURE); + filter.getNotCardType().add(CardType.LAND); + } - public DuressEffect() { - super(Outcome.Discard); - staticText = "Target opponent reveals his or her hand. You choose a noncreature, nonland card from it. That player discards that card"; - } + public DuressEffect() { + super(Outcome.Discard); + staticText = "Target opponent reveals his or her hand. You choose a noncreature, nonland card from it. That player discards that card"; + } - public DuressEffect(final DuressEffect effect) { - super(effect); - } + public DuressEffect(final DuressEffect effect) { + super(effect); + } - @Override - public boolean apply(Game game, Ability source) { - Player player = game.getPlayer(source.getFirstTarget()); - if (player != null) { - player.revealCards("Duress", player.getHand(), game); - Player you = game.getPlayer(source.getControllerId()); - if (you != null) { - TargetCard target = new TargetCard(Zone.PICK, filter); + @Override + public boolean apply(Game game, Ability source) { + Player player = game.getPlayer(source.getFirstTarget()); + if (player != null) { + player.revealCards("Duress", player.getHand(), game); + Player you = game.getPlayer(source.getControllerId()); + if (you != null) { + TargetCard target = new TargetCard(Zone.PICK, filter); target.setRequired(true); - if (you.choose(Outcome.Benefit, player.getHand(), target, game)) { - Card card = player.getHand().get(target.getFirstTarget(), game); - if (card != null) { - return player.discard(card, source, game); - } - } - } - } - return false; - } + if (you.choose(Outcome.Benefit, player.getHand(), target, game)) { + Card card = player.getHand().get(target.getFirstTarget(), game); + if (card != null) { + return player.discard(card, source, game); + } + } + } + } + return false; + } - @Override - public DuressEffect copy() { - return new DuressEffect(this); - } + @Override + public DuressEffect copy() { + return new DuressEffect(this); + } } diff --git a/Mage.Sets/src/mage/sets/magic2010/Earthquake.java b/Mage.Sets/src/mage/sets/magic2010/Earthquake.java index 9e826d489b..fb82a3233e 100644 --- a/Mage.Sets/src/mage/sets/magic2010/Earthquake.java +++ b/Mage.Sets/src/mage/sets/magic2010/Earthquake.java @@ -47,58 +47,58 @@ import mage.players.Player; */ public class Earthquake extends CardImpl { - public Earthquake(UUID ownerId) { - super(ownerId, 134, "Earthquake", Rarity.RARE, new CardType[]{CardType.SORCERY}, "{X}{R}"); - this.expansionSetCode = "M10"; - this.color.setRed(true); - this.getSpellAbility().addEffect(new EarthquakeEffect()); - } + public Earthquake(UUID ownerId) { + super(ownerId, 134, "Earthquake", Rarity.RARE, new CardType[]{CardType.SORCERY}, "{X}{R}"); + this.expansionSetCode = "M10"; + this.color.setRed(true); + this.getSpellAbility().addEffect(new EarthquakeEffect()); + } - public Earthquake(final Earthquake card) { - super(card); - } + public Earthquake(final Earthquake card) { + super(card); + } - @Override - public Earthquake copy() { - return new Earthquake(this); - } + @Override + public Earthquake copy() { + return new Earthquake(this); + } } class EarthquakeEffect extends OneShotEffect { - private static final FilterCreaturePermanent filter = new FilterCreaturePermanent(); + private static final FilterCreaturePermanent filter = new FilterCreaturePermanent(); - static { - filter.getAbilities().add(FlyingAbility.getInstance()); - filter.setNotAbilities(true); - } + static { + filter.getAbilities().add(FlyingAbility.getInstance()); + filter.setNotAbilities(true); + } - public EarthquakeEffect() { - super(Outcome.Damage); - staticText = "{this} deals X damage to each creature without flying and each player"; - } + public EarthquakeEffect() { + super(Outcome.Damage); + staticText = "{this} deals X damage to each creature without flying and each player"; + } - public EarthquakeEffect(final EarthquakeEffect effect) { - super(effect); - } + public EarthquakeEffect(final EarthquakeEffect effect) { + super(effect); + } - @Override - public EarthquakeEffect copy() { - return new EarthquakeEffect(this); - } + @Override + public EarthquakeEffect copy() { + return new EarthquakeEffect(this); + } - @Override - public boolean apply(Game game, Ability source) { - int amount = source.getManaCostsToPay().getX(); - for (Permanent permanent: game.getBattlefield().getActivePermanents(filter, source.getControllerId(), game)) { - permanent.damage(amount, source.getId(), game, true, false); - } - for (UUID playerId: game.getPlayer(source.getControllerId()).getInRange()) { - Player player = game.getPlayer(playerId); - if (player != null) - player.damage(amount, source.getSourceId(), game, false, true); - } - return true; - } + @Override + public boolean apply(Game game, Ability source) { + int amount = source.getManaCostsToPay().getX(); + for (Permanent permanent: game.getBattlefield().getActivePermanents(filter, source.getControllerId(), game)) { + permanent.damage(amount, source.getId(), game, true, false); + } + for (UUID playerId: game.getPlayer(source.getControllerId()).getInRange()) { + Player player = game.getPlayer(playerId); + if (player != null) + player.damage(amount, source.getSourceId(), game, false, true); + } + return true; + } } diff --git a/Mage.Sets/src/mage/sets/magic2010/EliteVanguard.java b/Mage.Sets/src/mage/sets/magic2010/EliteVanguard.java index 919f04883f..e5d53d2ec4 100644 --- a/Mage.Sets/src/mage/sets/magic2010/EliteVanguard.java +++ b/Mage.Sets/src/mage/sets/magic2010/EliteVanguard.java @@ -40,23 +40,23 @@ import mage.cards.CardImpl; */ public class EliteVanguard extends CardImpl { - public EliteVanguard(UUID ownerId) { - super(ownerId, 9, "Elite Vanguard", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{W}"); - this.expansionSetCode = "M10"; - this.color.setWhite(true); - this.subtype.add("Human"); - this.subtype.add("Soldier"); - this.power = new MageInt(2); - this.toughness = new MageInt(1); - } + public EliteVanguard(UUID ownerId) { + super(ownerId, 9, "Elite Vanguard", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{W}"); + this.expansionSetCode = "M10"; + this.color.setWhite(true); + this.subtype.add("Human"); + this.subtype.add("Soldier"); + this.power = new MageInt(2); + this.toughness = new MageInt(1); + } - public EliteVanguard(final EliteVanguard card) { - super(card); - } + public EliteVanguard(final EliteVanguard card) { + super(card); + } - @Override - public EliteVanguard copy() { - return new EliteVanguard(this); - } + @Override + public EliteVanguard copy() { + return new EliteVanguard(this); + } } diff --git a/Mage.Sets/src/mage/sets/magic2010/ElvishArchdruid.java b/Mage.Sets/src/mage/sets/magic2010/ElvishArchdruid.java index dad71fcd7a..e9b7a9b0e5 100644 --- a/Mage.Sets/src/mage/sets/magic2010/ElvishArchdruid.java +++ b/Mage.Sets/src/mage/sets/magic2010/ElvishArchdruid.java @@ -49,33 +49,33 @@ import mage.filter.common.FilterCreaturePermanent; */ public class ElvishArchdruid extends CardImpl { - private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("Elf creatures"); + private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("Elf creatures"); private static final FilterControlledCreaturePermanent filterCount = new FilterControlledCreaturePermanent("Elf you control"); - static { - filter.getSubtype().add("Elf"); - filterCount.getSubtype().add("Elf"); - } + static { + filter.getSubtype().add("Elf"); + filterCount.getSubtype().add("Elf"); + } - public ElvishArchdruid(UUID ownerId) { - super(ownerId, 176, "Elvish Archdruid", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{1}{G}{G}"); - this.expansionSetCode = "M10"; - this.subtype.add("Elf"); - this.subtype.add("Druid"); - this.color.setGreen(true); - this.power = new MageInt(2); - this.toughness = new MageInt(2); + public ElvishArchdruid(UUID ownerId) { + super(ownerId, 176, "Elvish Archdruid", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{1}{G}{G}"); + this.expansionSetCode = "M10"; + this.subtype.add("Elf"); + this.subtype.add("Druid"); + this.color.setGreen(true); + this.power = new MageInt(2); + this.toughness = new MageInt(2); - this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostControlledEffect(1, 1, Duration.WhileOnBattlefield, filter, true))); + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostControlledEffect(1, 1, Duration.WhileOnBattlefield, filter, true))); this.addAbility(new DynamicManaAbility(Mana.GreenMana, new PermanentsOnBattlefieldCount(filterCount))); - } + } - public ElvishArchdruid(final ElvishArchdruid card) { - super(card); - } + public ElvishArchdruid(final ElvishArchdruid card) { + super(card); + } - @Override - public ElvishArchdruid copy() { - return new ElvishArchdruid(this); - } + @Override + public ElvishArchdruid copy() { + return new ElvishArchdruid(this); + } } diff --git a/Mage.Sets/src/mage/sets/magic2010/EmeraldOryx.java b/Mage.Sets/src/mage/sets/magic2010/EmeraldOryx.java index 572d9daf58..c046866650 100644 --- a/Mage.Sets/src/mage/sets/magic2010/EmeraldOryx.java +++ b/Mage.Sets/src/mage/sets/magic2010/EmeraldOryx.java @@ -47,7 +47,7 @@ public class EmeraldOryx extends CardImpl { this.color.setGreen(true); this.subtype.add("Antelope"); this.power = new MageInt(2); - this.toughness = new MageInt(3); + this.toughness = new MageInt(3); this.addAbility(new ForestwalkAbility()); } diff --git a/Mage.Sets/src/mage/sets/magic2010/Excommunicate.java b/Mage.Sets/src/mage/sets/magic2010/Excommunicate.java index 6fb64edf35..c7bdd3bfe1 100644 --- a/Mage.Sets/src/mage/sets/magic2010/Excommunicate.java +++ b/Mage.Sets/src/mage/sets/magic2010/Excommunicate.java @@ -36,19 +36,19 @@ import java.util.UUID; */ public class Excommunicate extends mage.sets.shardsofalara.Excommunicate { - public Excommunicate(UUID ownerId) { - super(ownerId); - this.cardNumber = 10; - this.expansionSetCode = "M10"; - } + public Excommunicate(UUID ownerId) { + super(ownerId); + this.cardNumber = 10; + this.expansionSetCode = "M10"; + } - public Excommunicate(final Excommunicate card) { - super(card); - } + public Excommunicate(final Excommunicate card) { + super(card); + } - @Override - public Excommunicate copy() { - return new Excommunicate(this); - } + @Override + public Excommunicate copy() { + return new Excommunicate(this); + } } \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/magic2010/FieryHellhound.java b/Mage.Sets/src/mage/sets/magic2010/FieryHellhound.java index f31a6a7231..484ff91407 100644 --- a/Mage.Sets/src/mage/sets/magic2010/FieryHellhound.java +++ b/Mage.Sets/src/mage/sets/magic2010/FieryHellhound.java @@ -45,25 +45,25 @@ import mage.cards.CardImpl; */ public class FieryHellhound extends CardImpl { - public FieryHellhound(UUID ownerId) { - super(ownerId, 135, "Fiery Hellhound", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{1}{R}{R}"); - this.expansionSetCode = "M10"; - this.subtype.add("Elemental"); - this.subtype.add("Hound"); - this.color.setRed(true); - this.power = new MageInt(2); - this.toughness = new MageInt(2); + public FieryHellhound(UUID ownerId) { + super(ownerId, 135, "Fiery Hellhound", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{1}{R}{R}"); + this.expansionSetCode = "M10"; + this.subtype.add("Elemental"); + this.subtype.add("Hound"); + this.color.setRed(true); + this.power = new MageInt(2); + this.toughness = new MageInt(2); - this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new BoostSourceEffect(1, 0, Duration.EndOfTurn), new ManaCostsImpl("{R}"))); - } + this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new BoostSourceEffect(1, 0, Duration.EndOfTurn), new ManaCostsImpl("{R}"))); + } - public FieryHellhound(final FieryHellhound card) { - super(card); - } + public FieryHellhound(final FieryHellhound card) { + super(card); + } - @Override - public FieryHellhound copy() { - return new FieryHellhound(this); - } + @Override + public FieryHellhound copy() { + return new FieryHellhound(this); + } } diff --git a/Mage.Sets/src/mage/sets/magic2010/Fireball.java b/Mage.Sets/src/mage/sets/magic2010/Fireball.java index e4b75cd70f..68e5200eeb 100644 --- a/Mage.Sets/src/mage/sets/magic2010/Fireball.java +++ b/Mage.Sets/src/mage/sets/magic2010/Fireball.java @@ -47,71 +47,71 @@ import mage.target.common.TargetCreatureOrPlayer; */ public class Fireball extends CardImpl { - public Fireball(UUID ownerId) { - super(ownerId, 136, "Fireball", Rarity.UNCOMMON, new CardType[]{CardType.SORCERY}, "{X}{R}"); - this.expansionSetCode = "M10"; - this.color.setRed(true); - this.getSpellAbility().addTarget(new TargetCreatureOrPlayer(0, Integer.MAX_VALUE)); - this.getSpellAbility().addEffect(new FireballEffect()); - } + public Fireball(UUID ownerId) { + super(ownerId, 136, "Fireball", Rarity.UNCOMMON, new CardType[]{CardType.SORCERY}, "{X}{R}"); + this.expansionSetCode = "M10"; + this.color.setRed(true); + this.getSpellAbility().addTarget(new TargetCreatureOrPlayer(0, Integer.MAX_VALUE)); + this.getSpellAbility().addEffect(new FireballEffect()); + } - @Override - public void adjustCosts(Ability ability, Game game) { - int numTargets = ability.getTargets().get(0).getTargets().size(); - if (numTargets > 1) { - ability.getManaCostsToPay().add(new GenericManaCost(numTargets - 1)); - } - } + @Override + public void adjustCosts(Ability ability, Game game) { + int numTargets = ability.getTargets().get(0).getTargets().size(); + if (numTargets > 1) { + ability.getManaCostsToPay().add(new GenericManaCost(numTargets - 1)); + } + } - public Fireball(final Fireball card) { - super(card); - } + public Fireball(final Fireball card) { + super(card); + } - @Override - public Fireball copy() { - return new Fireball(this); - } + @Override + public Fireball copy() { + return new Fireball(this); + } } class FireballEffect extends OneShotEffect { - public FireballEffect() { - super(Outcome.Damage); - staticText = "{this} deals X damage divided evenly, rounded down, among any number of target creatures and/or players.\n {this} costs {1} more to cast for each target beyond the first"; - } + public FireballEffect() { + super(Outcome.Damage); + staticText = "{this} deals X damage divided evenly, rounded down, among any number of target creatures and/or players.\n {this} costs {1} more to cast for each target beyond the first"; + } - public FireballEffect(final FireballEffect effect) { - super(effect); - } + public FireballEffect(final FireballEffect effect) { + super(effect); + } - @Override - public boolean apply(Game game, Ability source) { - int numTargets = targetPointer.getTargets(game, source).size(); - int damage = source.getManaCostsToPay().getX(); - if (numTargets > 0) { - int damagePer = damage/numTargets; - if (damagePer > 0) { - for (UUID targetId: targetPointer.getTargets(game, source)) { - Permanent permanent = game.getPermanent(targetId); - if (permanent != null) { - permanent.damage(damagePer, source.getSourceId(), game, true, false); - } - else { - Player player = game.getPlayer(targetId); - if (player != null) { - player.damage(damagePer, source.getSourceId(), game, false, true); - } - } - } - return true; - } - } - return false; - } + @Override + public boolean apply(Game game, Ability source) { + int numTargets = targetPointer.getTargets(game, source).size(); + int damage = source.getManaCostsToPay().getX(); + if (numTargets > 0) { + int damagePer = damage/numTargets; + if (damagePer > 0) { + for (UUID targetId: targetPointer.getTargets(game, source)) { + Permanent permanent = game.getPermanent(targetId); + if (permanent != null) { + permanent.damage(damagePer, source.getSourceId(), game, true, false); + } + else { + Player player = game.getPlayer(targetId); + if (player != null) { + player.damage(damagePer, source.getSourceId(), game, false, true); + } + } + } + return true; + } + } + return false; + } - @Override - public FireballEffect copy() { - return new FireballEffect(this); - } + @Override + public FireballEffect copy() { + return new FireballEffect(this); + } } \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/magic2010/Flashfreeze.java b/Mage.Sets/src/mage/sets/magic2010/Flashfreeze.java index 57de3832b0..e746041bf8 100644 --- a/Mage.Sets/src/mage/sets/magic2010/Flashfreeze.java +++ b/Mage.Sets/src/mage/sets/magic2010/Flashfreeze.java @@ -36,19 +36,19 @@ import java.util.UUID; */ public class Flashfreeze extends mage.sets.tenth.Flashfreeze { - public Flashfreeze(UUID ownerId) { - super(ownerId); - this.cardNumber = 53; - this.expansionSetCode = "M10"; - } + public Flashfreeze(UUID ownerId) { + super(ownerId); + this.cardNumber = 53; + this.expansionSetCode = "M10"; + } - public Flashfreeze(final Flashfreeze card) { - super(card); - } + public Flashfreeze(final Flashfreeze card) { + super(card); + } - @Override - public Flashfreeze copy() { - return new Flashfreeze(this); - } + @Override + public Flashfreeze copy() { + return new Flashfreeze(this); + } } \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/magic2010/Fog.java b/Mage.Sets/src/mage/sets/magic2010/Fog.java index 2a30570f8d..ff2d01424c 100644 --- a/Mage.Sets/src/mage/sets/magic2010/Fog.java +++ b/Mage.Sets/src/mage/sets/magic2010/Fog.java @@ -41,20 +41,20 @@ import mage.cards.CardImpl; */ public class Fog extends CardImpl { - public Fog(UUID ownerId) { - super(ownerId, 182, "Fog", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{G}"); - this.expansionSetCode = "M10"; - this.color.setGreen(true); - this.getSpellAbility().addEffect(new PreventAllDamageEffect(Duration.EndOfTurn, true)); - } + public Fog(UUID ownerId) { + super(ownerId, 182, "Fog", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{G}"); + this.expansionSetCode = "M10"; + this.color.setGreen(true); + this.getSpellAbility().addEffect(new PreventAllDamageEffect(Duration.EndOfTurn, true)); + } - public Fog(final Fog card) { - super(card); - } + public Fog(final Fog card) { + super(card); + } - @Override - public Fog copy() { - return new Fog(this); - } + @Override + public Fog copy() { + return new Fog(this); + } } diff --git a/Mage.Sets/src/mage/sets/magic2010/Forest1.java b/Mage.Sets/src/mage/sets/magic2010/Forest1.java index 4853829c52..55e8a340d6 100644 --- a/Mage.Sets/src/mage/sets/magic2010/Forest1.java +++ b/Mage.Sets/src/mage/sets/magic2010/Forest1.java @@ -36,18 +36,18 @@ import java.util.UUID; */ public class Forest1 extends mage.cards.basiclands.Forest { - public Forest1(UUID ownerId) { - super(ownerId, 246); - this.expansionSetCode = "M10"; - } + public Forest1(UUID ownerId) { + super(ownerId, 246); + this.expansionSetCode = "M10"; + } - public Forest1(final Forest1 card) { - super(card); - } + public Forest1(final Forest1 card) { + super(card); + } - @Override - public Forest1 copy() { - return new Forest1(this); - } + @Override + public Forest1 copy() { + return new Forest1(this); + } } diff --git a/Mage.Sets/src/mage/sets/magic2010/Forest2.java b/Mage.Sets/src/mage/sets/magic2010/Forest2.java index 058c51660a..efbad2337e 100644 --- a/Mage.Sets/src/mage/sets/magic2010/Forest2.java +++ b/Mage.Sets/src/mage/sets/magic2010/Forest2.java @@ -36,18 +36,18 @@ import java.util.UUID; */ public class Forest2 extends mage.cards.basiclands.Forest { - public Forest2(UUID ownerId) { - super(ownerId, 247); - this.expansionSetCode = "M10"; - } + public Forest2(UUID ownerId) { + super(ownerId, 247); + this.expansionSetCode = "M10"; + } - public Forest2(final Forest2 card) { - super(card); - } + public Forest2(final Forest2 card) { + super(card); + } - @Override - public Forest2 copy() { - return new Forest2(this); - } + @Override + public Forest2 copy() { + return new Forest2(this); + } } diff --git a/Mage.Sets/src/mage/sets/magic2010/Forest3.java b/Mage.Sets/src/mage/sets/magic2010/Forest3.java index 7218dfe55a..fe07d1ff20 100644 --- a/Mage.Sets/src/mage/sets/magic2010/Forest3.java +++ b/Mage.Sets/src/mage/sets/magic2010/Forest3.java @@ -36,18 +36,18 @@ import java.util.UUID; */ public class Forest3 extends mage.cards.basiclands.Forest { - public Forest3(UUID ownerId) { - super(ownerId, 248); - this.expansionSetCode = "M10"; - } + public Forest3(UUID ownerId) { + super(ownerId, 248); + this.expansionSetCode = "M10"; + } - public Forest3(final Forest3 card) { - super(card); - } + public Forest3(final Forest3 card) { + super(card); + } - @Override - public Forest3 copy() { - return new Forest3(this); - } + @Override + public Forest3 copy() { + return new Forest3(this); + } } diff --git a/Mage.Sets/src/mage/sets/magic2010/Forest4.java b/Mage.Sets/src/mage/sets/magic2010/Forest4.java index c1c6db5f7a..64f5c88f82 100644 --- a/Mage.Sets/src/mage/sets/magic2010/Forest4.java +++ b/Mage.Sets/src/mage/sets/magic2010/Forest4.java @@ -36,18 +36,18 @@ import java.util.UUID; */ public class Forest4 extends mage.cards.basiclands.Forest { - public Forest4(UUID ownerId) { - super(ownerId, 249); - this.expansionSetCode = "M10"; - } + public Forest4(UUID ownerId) { + super(ownerId, 249); + this.expansionSetCode = "M10"; + } - public Forest4(final Forest4 card) { - super(card); - } + public Forest4(final Forest4 card) { + super(card); + } - @Override - public Forest4 copy() { - return new Forest4(this); - } + @Override + public Forest4 copy() { + return new Forest4(this); + } } diff --git a/Mage.Sets/src/mage/sets/magic2010/GargoyleCastle.java b/Mage.Sets/src/mage/sets/magic2010/GargoyleCastle.java index 0f99b375f4..e3d5845420 100644 --- a/Mage.Sets/src/mage/sets/magic2010/GargoyleCastle.java +++ b/Mage.Sets/src/mage/sets/magic2010/GargoyleCastle.java @@ -49,54 +49,54 @@ import mage.game.permanent.token.Token; */ public class GargoyleCastle extends CardImpl { - public GargoyleCastle(UUID ownerId) { - super(ownerId, 225, "Gargoyle Castle", Rarity.RARE, new CardType[]{CardType.LAND}, null); - this.expansionSetCode = "M10"; - this.addAbility(new ColorlessManaAbility()); - this.addAbility(new GargoyleCastleAbility()); - } + public GargoyleCastle(UUID ownerId) { + super(ownerId, 225, "Gargoyle Castle", Rarity.RARE, new CardType[]{CardType.LAND}, null); + this.expansionSetCode = "M10"; + this.addAbility(new ColorlessManaAbility()); + this.addAbility(new GargoyleCastleAbility()); + } - public GargoyleCastle(final GargoyleCastle card) { - super(card); - } + public GargoyleCastle(final GargoyleCastle card) { + super(card); + } - @Override - public GargoyleCastle copy() { - return new GargoyleCastle(this); - } + @Override + public GargoyleCastle copy() { + return new GargoyleCastle(this); + } } class GargoyleCastleAbility extends ActivatedAbilityImpl { - public GargoyleCastleAbility() { - super(Zone.BATTLEFIELD, null); - addCost(new TapSourceCost()); - addCost(new GenericManaCost(5)); - addCost(new SacrificeSourceCost()); - addEffect(new CreateTokenEffect(new GargoyleToken())); - } + public GargoyleCastleAbility() { + super(Zone.BATTLEFIELD, null); + addCost(new TapSourceCost()); + addCost(new GenericManaCost(5)); + addCost(new SacrificeSourceCost()); + addEffect(new CreateTokenEffect(new GargoyleToken())); + } - public GargoyleCastleAbility(final GargoyleCastleAbility ability) { - super(ability); - } + public GargoyleCastleAbility(final GargoyleCastleAbility ability) { + super(ability); + } - @Override - public GargoyleCastleAbility copy() { - return new GargoyleCastleAbility(this); - } + @Override + public GargoyleCastleAbility copy() { + return new GargoyleCastleAbility(this); + } } class GargoyleToken extends Token { - public GargoyleToken() { - super("Gargoyle", "3/4 colorless Gargoyle artifact creature token with flying"); - cardType.add(CardType.CREATURE); - cardType.add(CardType.ARTIFACT); - subtype.add("Gargoyle"); - power = new MageInt(3); - toughness = new MageInt(4); - addAbility(FlyingAbility.getInstance()); - } + public GargoyleToken() { + super("Gargoyle", "3/4 colorless Gargoyle artifact creature token with flying"); + cardType.add(CardType.CREATURE); + cardType.add(CardType.ARTIFACT); + subtype.add("Gargoyle"); + power = new MageInt(3); + toughness = new MageInt(4); + addAbility(FlyingAbility.getInstance()); + } } diff --git a/Mage.Sets/src/mage/sets/magic2010/GarrukWildspeaker.java b/Mage.Sets/src/mage/sets/magic2010/GarrukWildspeaker.java index b7a2384757..bf74d8899d 100644 --- a/Mage.Sets/src/mage/sets/magic2010/GarrukWildspeaker.java +++ b/Mage.Sets/src/mage/sets/magic2010/GarrukWildspeaker.java @@ -53,34 +53,34 @@ import mage.target.common.TargetLandPermanent; */ public class GarrukWildspeaker extends CardImpl { - private static BeastToken beastToken = new BeastToken(); + private static BeastToken beastToken = new BeastToken(); - public GarrukWildspeaker(UUID ownerId) { - super(ownerId, 183, "Garruk Wildspeaker", Rarity.MYTHIC, new CardType[]{CardType.PLANESWALKER}, "{2}{G}{G}"); - this.expansionSetCode = "M10"; - this.subtype.add("Garruk"); - this.color.setGreen(true); - this.addAbility(new EntersBattlefieldAbility(new AddCountersSourceEffect(CounterType.LOYALTY.createInstance(3)), "")); + public GarrukWildspeaker(UUID ownerId) { + super(ownerId, 183, "Garruk Wildspeaker", Rarity.MYTHIC, new CardType[]{CardType.PLANESWALKER}, "{2}{G}{G}"); + this.expansionSetCode = "M10"; + this.subtype.add("Garruk"); + this.color.setGreen(true); + this.addAbility(new EntersBattlefieldAbility(new AddCountersSourceEffect(CounterType.LOYALTY.createInstance(3)), "")); - LoyaltyAbility ability1 = new LoyaltyAbility(new UntapTargetEffect(), 1); - ability1.addTarget(new TargetLandPermanent(2)); - this.addAbility(ability1); + LoyaltyAbility ability1 = new LoyaltyAbility(new UntapTargetEffect(), 1); + ability1.addTarget(new TargetLandPermanent(2)); + this.addAbility(ability1); - this.addAbility(new LoyaltyAbility(new CreateTokenEffect(beastToken), -1)); + this.addAbility(new LoyaltyAbility(new CreateTokenEffect(beastToken), -1)); - Effects effects1 = new Effects(); - effects1.add(new BoostControlledEffect(3, 3, Duration.EndOfTurn)); - effects1.add(new GainAbilityControlledEffect(TrampleAbility.getInstance(), Duration.EndOfTurn, new FilterCreaturePermanent())); - this.addAbility(new LoyaltyAbility(effects1, -4)); - } + Effects effects1 = new Effects(); + effects1.add(new BoostControlledEffect(3, 3, Duration.EndOfTurn)); + effects1.add(new GainAbilityControlledEffect(TrampleAbility.getInstance(), Duration.EndOfTurn, new FilterCreaturePermanent())); + this.addAbility(new LoyaltyAbility(effects1, -4)); + } - public GarrukWildspeaker(final GarrukWildspeaker card) { - super(card); - } + public GarrukWildspeaker(final GarrukWildspeaker card) { + super(card); + } - @Override - public GarrukWildspeaker copy() { - return new GarrukWildspeaker(this); - } + @Override + public GarrukWildspeaker copy() { + return new GarrukWildspeaker(this); + } } diff --git a/Mage.Sets/src/mage/sets/magic2010/GiantGrowth.java b/Mage.Sets/src/mage/sets/magic2010/GiantGrowth.java index 60b05ac9db..d1ff7fb365 100644 --- a/Mage.Sets/src/mage/sets/magic2010/GiantGrowth.java +++ b/Mage.Sets/src/mage/sets/magic2010/GiantGrowth.java @@ -36,19 +36,19 @@ import java.util.UUID; */ public class GiantGrowth extends mage.sets.tenth.GiantGrowth { - public GiantGrowth(UUID ownerId) { - super(ownerId); - this.cardNumber = 184; - this.expansionSetCode = "M10"; - } + public GiantGrowth(UUID ownerId) { + super(ownerId); + this.cardNumber = 184; + this.expansionSetCode = "M10"; + } - public GiantGrowth(final GiantGrowth card) { - super(card); - } + public GiantGrowth(final GiantGrowth card) { + super(card); + } - @Override - public GiantGrowth copy() { - return new GiantGrowth(this); - } + @Override + public GiantGrowth copy() { + return new GiantGrowth(this); + } } \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/magic2010/GiantSpider.java b/Mage.Sets/src/mage/sets/magic2010/GiantSpider.java index ca4f210b2e..133f490082 100644 --- a/Mage.Sets/src/mage/sets/magic2010/GiantSpider.java +++ b/Mage.Sets/src/mage/sets/magic2010/GiantSpider.java @@ -36,19 +36,19 @@ import java.util.UUID; */ public class GiantSpider extends mage.sets.tenth.GiantSpider { - public GiantSpider(UUID ownerId) { - super(ownerId); - this.cardNumber = 185; - this.expansionSetCode = "M10"; - } + public GiantSpider(UUID ownerId) { + super(ownerId); + this.cardNumber = 185; + this.expansionSetCode = "M10"; + } - public GiantSpider(final GiantSpider card) { - super(card); - } + public GiantSpider(final GiantSpider card) { + super(card); + } - @Override - public GiantSpider copy() { - return new GiantSpider(this); - } + @Override + public GiantSpider copy() { + return new GiantSpider(this); + } } \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/magic2010/GlacialFortress.java b/Mage.Sets/src/mage/sets/magic2010/GlacialFortress.java index 56732dbe50..1aea23b5e1 100644 --- a/Mage.Sets/src/mage/sets/magic2010/GlacialFortress.java +++ b/Mage.Sets/src/mage/sets/magic2010/GlacialFortress.java @@ -49,32 +49,32 @@ import mage.filter.common.FilterLandPermanent; */ public class GlacialFortress extends CardImpl { - private static final FilterLandPermanent filter = new FilterLandPermanent(); + private static final FilterLandPermanent filter = new FilterLandPermanent(); - static { - filter.getSubtype().add("Plains"); - filter.getSubtype().add("Island"); - filter.setScopeSubtype(ComparisonScope.Any); - filter.setMessage("Plains or an Island"); - } + static { + filter.getSubtype().add("Plains"); + filter.getSubtype().add("Island"); + filter.setScopeSubtype(ComparisonScope.Any); + filter.setMessage("Plains or an Island"); + } - public GlacialFortress(UUID ownerId) { - super(ownerId, 226, "Glacial Fortress", Rarity.RARE, new CardType[]{CardType.LAND}, null); - this.expansionSetCode = "M10"; + public GlacialFortress(UUID ownerId) { + super(ownerId, 226, "Glacial Fortress", Rarity.RARE, new CardType[]{CardType.LAND}, null); + this.expansionSetCode = "M10"; - Condition controls = new UnlessCondition(new ControlsPermanentCondition(filter, ControlsPermanentCondition.CountType.MORE_THAN, 0)); - String abilityText = "tap it unless you control a " + filter.getMessage(); - this.addAbility(new EntersBattlefieldAbility(new ConditionalOneShotEffect(new TapSourceEffect(), controls, abilityText), abilityText)); - this.addAbility(new BlueManaAbility()); - this.addAbility(new WhiteManaAbility()); - } + Condition controls = new UnlessCondition(new ControlsPermanentCondition(filter, ControlsPermanentCondition.CountType.MORE_THAN, 0)); + String abilityText = "tap it unless you control a " + filter.getMessage(); + this.addAbility(new EntersBattlefieldAbility(new ConditionalOneShotEffect(new TapSourceEffect(), controls, abilityText), abilityText)); + this.addAbility(new BlueManaAbility()); + this.addAbility(new WhiteManaAbility()); + } - public GlacialFortress(final GlacialFortress card) { - super(card); - } + public GlacialFortress(final GlacialFortress card) { + super(card); + } - @Override - public GlacialFortress copy() { - return new GlacialFortress(this); - } + @Override + public GlacialFortress copy() { + return new GlacialFortress(this); + } } diff --git a/Mage.Sets/src/mage/sets/magic2010/GoblinChieftain.java b/Mage.Sets/src/mage/sets/magic2010/GoblinChieftain.java index 41e807c970..c7d07e536c 100644 --- a/Mage.Sets/src/mage/sets/magic2010/GoblinChieftain.java +++ b/Mage.Sets/src/mage/sets/magic2010/GoblinChieftain.java @@ -48,33 +48,33 @@ import mage.filter.common.FilterCreaturePermanent; */ public class GoblinChieftain extends CardImpl { - private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("Goblin creatures"); + private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("Goblin creatures"); - static { - filter.getSubtype().add("Goblin"); + static { + filter.getSubtype().add("Goblin"); filter.setScopeSupertype(Filter.ComparisonScope.Any); - } + } - public GoblinChieftain(UUID ownerId) { - super(ownerId, 139, "Goblin Chieftain", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{1}{R}{R}"); - this.expansionSetCode = "M10"; - this.subtype.add("Goblin"); - this.color.setRed(true); - this.power = new MageInt(2); - this.toughness = new MageInt(2); + public GoblinChieftain(UUID ownerId) { + super(ownerId, 139, "Goblin Chieftain", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{1}{R}{R}"); + this.expansionSetCode = "M10"; + this.subtype.add("Goblin"); + this.color.setRed(true); + this.power = new MageInt(2); + this.toughness = new MageInt(2); - this.addAbility(HasteAbility.getInstance()); - this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostControlledEffect(1, 1, Duration.WhileOnBattlefield, filter, true))); - this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityControlledEffect(HasteAbility.getInstance(), Duration.WhileOnBattlefield, filter, true))); - } + this.addAbility(HasteAbility.getInstance()); + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostControlledEffect(1, 1, Duration.WhileOnBattlefield, filter, true))); + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityControlledEffect(HasteAbility.getInstance(), Duration.WhileOnBattlefield, filter, true))); + } - public GoblinChieftain(final GoblinChieftain card) { - super(card); - } + public GoblinChieftain(final GoblinChieftain card) { + super(card); + } - @Override - public GoblinChieftain copy() { - return new GoblinChieftain(this); - } + @Override + public GoblinChieftain copy() { + return new GoblinChieftain(this); + } } diff --git a/Mage.Sets/src/mage/sets/magic2010/GoblinPiker.java b/Mage.Sets/src/mage/sets/magic2010/GoblinPiker.java index dff93532a2..a4660ae9e6 100644 --- a/Mage.Sets/src/mage/sets/magic2010/GoblinPiker.java +++ b/Mage.Sets/src/mage/sets/magic2010/GoblinPiker.java @@ -36,19 +36,19 @@ import java.util.UUID; */ public class GoblinPiker extends mage.sets.tenth.GoblinPiker { - public GoblinPiker(UUID ownerId) { - super(ownerId); - this.cardNumber = 140; - this.expansionSetCode = "M10"; - } + public GoblinPiker(UUID ownerId) { + super(ownerId); + this.cardNumber = 140; + this.expansionSetCode = "M10"; + } - public GoblinPiker(final GoblinPiker card) { - super(card); - } + public GoblinPiker(final GoblinPiker card) { + super(card); + } - @Override - public GoblinPiker copy() { - return new GoblinPiker(this); - } + @Override + public GoblinPiker copy() { + return new GoblinPiker(this); + } } \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/magic2010/Gravedigger.java b/Mage.Sets/src/mage/sets/magic2010/Gravedigger.java index cf51340b3d..a601a6e915 100644 --- a/Mage.Sets/src/mage/sets/magic2010/Gravedigger.java +++ b/Mage.Sets/src/mage/sets/magic2010/Gravedigger.java @@ -36,19 +36,19 @@ import java.util.UUID; */ public class Gravedigger extends mage.sets.tenth.Gravedigger { - public Gravedigger(UUID ownerId) { - super(ownerId); - this.cardNumber = 97; - this.expansionSetCode = "M10"; - } + public Gravedigger(UUID ownerId) { + super(ownerId); + this.cardNumber = 97; + this.expansionSetCode = "M10"; + } - public Gravedigger(final Gravedigger card) { - super(card); - } + public Gravedigger(final Gravedigger card) { + super(card); + } - @Override - public Gravedigger copy() { - return new Gravedigger(this); - } + @Override + public Gravedigger copy() { + return new Gravedigger(this); + } } \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/magic2010/GreatSableStag.java b/Mage.Sets/src/mage/sets/magic2010/GreatSableStag.java index f67bf8882d..1eba9ab2c9 100644 --- a/Mage.Sets/src/mage/sets/magic2010/GreatSableStag.java +++ b/Mage.Sets/src/mage/sets/magic2010/GreatSableStag.java @@ -51,32 +51,32 @@ public class GreatSableStag extends CardImpl { static { filter1.setUseColor(true); filter1.getColor().setBlue(true); - filter1.setScopeColor(ComparisonScope.Any); + filter1.setScopeColor(ComparisonScope.Any); filter2.setUseColor(true); filter2.getColor().setBlack(true); - filter2.setScopeColor(ComparisonScope.Any); + filter2.setScopeColor(ComparisonScope.Any); } - public GreatSableStag(UUID ownerId) { - super(ownerId, 186, "Great Sable Stag", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{1}{G}{G}"); - this.expansionSetCode = "M10"; - this.subtype.add("Elk"); - this.color.setGreen(true); - this.power = new MageInt(3); - this.toughness = new MageInt(3); + public GreatSableStag(UUID ownerId) { + super(ownerId, 186, "Great Sable Stag", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{1}{G}{G}"); + this.expansionSetCode = "M10"; + this.subtype.add("Elk"); + this.color.setGreen(true); + this.power = new MageInt(3); + this.toughness = new MageInt(3); - this.addAbility(new ProtectionAbility(filter1)); - this.addAbility(new ProtectionAbility(filter2)); - this.addAbility(new SimpleStaticAbility(Zone.STACK, new CantCounterSourceEffect())); - } + this.addAbility(new ProtectionAbility(filter1)); + this.addAbility(new ProtectionAbility(filter2)); + this.addAbility(new SimpleStaticAbility(Zone.STACK, new CantCounterSourceEffect())); + } - public GreatSableStag(final GreatSableStag card) { - super(card); - } + public GreatSableStag(final GreatSableStag card) { + super(card); + } - @Override - public GreatSableStag copy() { - return new GreatSableStag(this); - } + @Override + public GreatSableStag copy() { + return new GreatSableStag(this); + } } diff --git a/Mage.Sets/src/mage/sets/magic2010/HauntingEchoes.java b/Mage.Sets/src/mage/sets/magic2010/HauntingEchoes.java index 026dea90b6..a9e987809e 100644 --- a/Mage.Sets/src/mage/sets/magic2010/HauntingEchoes.java +++ b/Mage.Sets/src/mage/sets/magic2010/HauntingEchoes.java @@ -51,71 +51,71 @@ import java.util.UUID; */ public class HauntingEchoes extends CardImpl { - public HauntingEchoes(UUID ownerId) { - super(ownerId, 98, "Haunting Echoes", Rarity.RARE, new CardType[]{CardType.SORCERY}, "{3}{B}{B}"); - this.expansionSetCode = "M10"; - this.color.setBlack(true); - this.getSpellAbility().addTarget(new TargetPlayer()); - this.getSpellAbility().addEffect(new HauntingEchoesEffect()); - } + public HauntingEchoes(UUID ownerId) { + super(ownerId, 98, "Haunting Echoes", Rarity.RARE, new CardType[]{CardType.SORCERY}, "{3}{B}{B}"); + this.expansionSetCode = "M10"; + this.color.setBlack(true); + this.getSpellAbility().addTarget(new TargetPlayer()); + this.getSpellAbility().addEffect(new HauntingEchoesEffect()); + } - public HauntingEchoes(final HauntingEchoes card) { - super(card); - } + public HauntingEchoes(final HauntingEchoes card) { + super(card); + } - @Override - public HauntingEchoes copy() { - return new HauntingEchoes(this); - } + @Override + public HauntingEchoes copy() { + return new HauntingEchoes(this); + } } class HauntingEchoesEffect extends OneShotEffect { - private static final FilterBasicLandCard filter = new FilterBasicLandCard(); + private static final FilterBasicLandCard filter = new FilterBasicLandCard(); - public HauntingEchoesEffect() { - super(Outcome.Detriment); - staticText = "Exile all cards from target player's graveyard other than basic land cards. For each card exiled this way, search that player's library for all cards with the same name as that card and exile them. Then that player shuffles his or her library"; - } + public HauntingEchoesEffect() { + super(Outcome.Detriment); + staticText = "Exile all cards from target player's graveyard other than basic land cards. For each card exiled this way, search that player's library for all cards with the same name as that card and exile them. Then that player shuffles his or her library"; + } - public HauntingEchoesEffect(final HauntingEchoesEffect effect) { - super(effect); - } + public HauntingEchoesEffect(final HauntingEchoesEffect effect) { + super(effect); + } - @Override - public boolean apply(Game game, Ability source) { - Player player = game.getPlayer(source.getControllerId()); - Player targetPlayer = game.getPlayer(source.getFirstTarget()); - if (targetPlayer != null) { - for (Card card: targetPlayer.getGraveyard().getCards(game)) { - if (!filter.match(card, game)) { - card.moveToExile(null, "", source.getId(), game); + @Override + public boolean apply(Game game, Ability source) { + Player player = game.getPlayer(source.getControllerId()); + Player targetPlayer = game.getPlayer(source.getFirstTarget()); + if (targetPlayer != null) { + for (Card card: targetPlayer.getGraveyard().getCards(game)) { + if (!filter.match(card, game)) { + card.moveToExile(null, "", source.getId(), game); - FilterCard filterCard = new FilterCard("cards named " + card.getName()); - filterCard.getName().add(card.getName()); - int count = targetPlayer.getLibrary().count(filterCard, game); - TargetCardInLibrary target = new TargetCardInLibrary(count, count, filterCard); - target.setRequired(true); + FilterCard filterCard = new FilterCard("cards named " + card.getName()); + filterCard.getName().add(card.getName()); + int count = targetPlayer.getLibrary().count(filterCard, game); + TargetCardInLibrary target = new TargetCardInLibrary(count, count, filterCard); + target.setRequired(true); - player.searchLibrary(target, game, targetPlayer.getId()); - List targets = target.getTargets(); - for(UUID cardId : targets){ - Card libraryCard = game.getCard(cardId); - if (libraryCard != null) { - libraryCard.moveToExile(null, "", source.getId(), game); - } - } - } - } - targetPlayer.shuffleLibrary(game); - return true; - } - return false; - } + player.searchLibrary(target, game, targetPlayer.getId()); + List targets = target.getTargets(); + for(UUID cardId : targets){ + Card libraryCard = game.getCard(cardId); + if (libraryCard != null) { + libraryCard.moveToExile(null, "", source.getId(), game); + } + } + } + } + targetPlayer.shuffleLibrary(game); + return true; + } + return false; + } - @Override - public HauntingEchoesEffect copy() { - return new HauntingEchoesEffect(this); - } + @Override + public HauntingEchoesEffect copy() { + return new HauntingEchoesEffect(this); + } } \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/magic2010/HolyStrength.java b/Mage.Sets/src/mage/sets/magic2010/HolyStrength.java index da27e9fd5e..fde419cb81 100644 --- a/Mage.Sets/src/mage/sets/magic2010/HolyStrength.java +++ b/Mage.Sets/src/mage/sets/magic2010/HolyStrength.java @@ -36,19 +36,19 @@ import java.util.UUID; */ public class HolyStrength extends mage.sets.tenth.HolyStrength { - public HolyStrength(UUID ownerId) { - super(ownerId); - this.cardNumber = 15; - this.expansionSetCode = "M10"; - } + public HolyStrength(UUID ownerId) { + super(ownerId); + this.cardNumber = 15; + this.expansionSetCode = "M10"; + } - public HolyStrength(final HolyStrength card) { - super(card); - } + public HolyStrength(final HolyStrength card) { + super(card); + } - @Override - public HolyStrength copy() { - return new HolyStrength(this); - } + @Override + public HolyStrength copy() { + return new HolyStrength(this); + } } \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/magic2010/HonorOfThePure.java b/Mage.Sets/src/mage/sets/magic2010/HonorOfThePure.java index eb2f18c314..699e61e6ba 100644 --- a/Mage.Sets/src/mage/sets/magic2010/HonorOfThePure.java +++ b/Mage.Sets/src/mage/sets/magic2010/HonorOfThePure.java @@ -44,27 +44,27 @@ import mage.filter.common.FilterCreaturePermanent; */ public class HonorOfThePure extends CardImpl { - private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("White creatures"); + private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("White creatures"); - static { - filter.setUseColor(true); - filter.getColor().setWhite(true); - } + static { + filter.setUseColor(true); + filter.getColor().setWhite(true); + } - public HonorOfThePure(UUID ownerId) { - super(ownerId, 16, "Honor of the Pure", Rarity.RARE, new CardType[]{CardType.ENCHANTMENT}, "{1}{W}"); - this.expansionSetCode = "M10"; - this.color.setWhite(true); - this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostControlledEffect(1, 1, Duration.WhileOnBattlefield, filter, false))); - } + public HonorOfThePure(UUID ownerId) { + super(ownerId, 16, "Honor of the Pure", Rarity.RARE, new CardType[]{CardType.ENCHANTMENT}, "{1}{W}"); + this.expansionSetCode = "M10"; + this.color.setWhite(true); + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostControlledEffect(1, 1, Duration.WhileOnBattlefield, filter, false))); + } - public HonorOfThePure(final HonorOfThePure card) { - super(card); - } + public HonorOfThePure(final HonorOfThePure card) { + super(card); + } - @Override - public HonorOfThePure copy() { - return new HonorOfThePure(this); - } + @Override + public HonorOfThePure copy() { + return new HonorOfThePure(this); + } } diff --git a/Mage.Sets/src/mage/sets/magic2010/HowlingBanshee.java b/Mage.Sets/src/mage/sets/magic2010/HowlingBanshee.java index cd162edb11..cd64bdbc2e 100644 --- a/Mage.Sets/src/mage/sets/magic2010/HowlingBanshee.java +++ b/Mage.Sets/src/mage/sets/magic2010/HowlingBanshee.java @@ -43,26 +43,26 @@ import mage.cards.CardImpl; */ public class HowlingBanshee extends CardImpl { - public HowlingBanshee(UUID ownerId) { - super(ownerId, 99, "Howling Banshee", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{2}{B}{B}"); - this.expansionSetCode = "M10"; - this.subtype.add("Spirit"); - this.color.setBlack(true); - this.power = new MageInt(3); - this.toughness = new MageInt(3); + public HowlingBanshee(UUID ownerId) { + super(ownerId, 99, "Howling Banshee", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{2}{B}{B}"); + this.expansionSetCode = "M10"; + this.subtype.add("Spirit"); + this.color.setBlack(true); + this.power = new MageInt(3); + this.toughness = new MageInt(3); - this.addAbility(FlyingAbility.getInstance()); - this.addAbility(new EntersBattlefieldTriggeredAbility(new LoseLifePlayersEffect(3), false)); - } + this.addAbility(FlyingAbility.getInstance()); + this.addAbility(new EntersBattlefieldTriggeredAbility(new LoseLifePlayersEffect(3), false)); + } - public HowlingBanshee(final HowlingBanshee card) { - super(card); - } + public HowlingBanshee(final HowlingBanshee card) { + super(card); + } - @Override - public HowlingBanshee copy() { - return new HowlingBanshee(this); - } + @Override + public HowlingBanshee copy() { + return new HowlingBanshee(this); + } } diff --git a/Mage.Sets/src/mage/sets/magic2010/HowlingMine.java b/Mage.Sets/src/mage/sets/magic2010/HowlingMine.java index a8d4461168..fda902f4bb 100644 --- a/Mage.Sets/src/mage/sets/magic2010/HowlingMine.java +++ b/Mage.Sets/src/mage/sets/magic2010/HowlingMine.java @@ -45,55 +45,55 @@ import mage.target.targetpointer.FixedTarget; */ public class HowlingMine extends CardImpl { - public HowlingMine(UUID ownerId) { - super(ownerId, 212, "Howling Mine", Rarity.RARE, new CardType[]{CardType.ARTIFACT}, "{2}"); - this.expansionSetCode = "M10"; - this.addAbility(new HowlingMineAbility()); - } + public HowlingMine(UUID ownerId) { + super(ownerId, 212, "Howling Mine", Rarity.RARE, new CardType[]{CardType.ARTIFACT}, "{2}"); + this.expansionSetCode = "M10"; + this.addAbility(new HowlingMineAbility()); + } - public HowlingMine(final HowlingMine card) { - super(card); - } + public HowlingMine(final HowlingMine card) { + super(card); + } - @Override - public HowlingMine copy() { - return new HowlingMine(this); - } + @Override + public HowlingMine copy() { + return new HowlingMine(this); + } } class HowlingMineAbility extends TriggeredAbilityImpl { - public HowlingMineAbility() { - super(Zone.BATTLEFIELD, new DrawCardTargetEffect(1)); - } + public HowlingMineAbility() { + super(Zone.BATTLEFIELD, new DrawCardTargetEffect(1)); + } - public HowlingMineAbility(final HowlingMineAbility ability) { - super(ability); - } + public HowlingMineAbility(final HowlingMineAbility ability) { + super(ability); + } - @Override - public HowlingMineAbility copy() { - return new HowlingMineAbility(this); - } + @Override + public HowlingMineAbility copy() { + return new HowlingMineAbility(this); + } - @Override - public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == EventType.DRAW_STEP_PRE) { + @Override + public boolean checkTrigger(GameEvent event, Game game) { + if (event.getType() == EventType.DRAW_STEP_PRE) { this.getEffects().get(0).setTargetPointer(new FixedTarget(event.getPlayerId())); - return true; - } - return false; - } + return true; + } + return false; + } - @Override - public boolean checkInterveningIfClause(Game game) { - return !game.getPermanent(this.sourceId).isTapped(); - } + @Override + public boolean checkInterveningIfClause(Game game) { + return !game.getPermanent(this.sourceId).isTapped(); + } - @Override - public String getRule() { - return "At the beginning of each player's draw step, if {this} is untapped, that player draws an additional card."; - } + @Override + public String getRule() { + return "At the beginning of each player's draw step, if {this} is untapped, that player draws an additional card."; + } } diff --git a/Mage.Sets/src/mage/sets/magic2010/IceCage.java b/Mage.Sets/src/mage/sets/magic2010/IceCage.java index 0615f7676a..2aa540d6ce 100644 --- a/Mage.Sets/src/mage/sets/magic2010/IceCage.java +++ b/Mage.Sets/src/mage/sets/magic2010/IceCage.java @@ -55,103 +55,103 @@ import mage.target.common.TargetCreaturePermanent; */ public class IceCage extends CardImpl { - public IceCage(UUID ownerId) { - super(ownerId, 56, "Ice Cage", Rarity.COMMON, new CardType[]{CardType.ENCHANTMENT}, "{1}{U}"); - this.expansionSetCode = "M10"; - this.color.setBlue(true); - this.subtype.add("Aura"); + public IceCage(UUID ownerId) { + super(ownerId, 56, "Ice Cage", Rarity.COMMON, new CardType[]{CardType.ENCHANTMENT}, "{1}{U}"); + this.expansionSetCode = "M10"; + this.color.setBlue(true); + this.subtype.add("Aura"); - TargetPermanent auraTarget = new TargetCreaturePermanent(); - this.getSpellAbility().addTarget(auraTarget); - this.getSpellAbility().addEffect(new AttachEffect(Outcome.Detriment)); - Ability ability = new EnchantAbility(auraTarget.getTargetName()); - this.addAbility(ability); - this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new IceCageEffect())); - this.addAbility(new IceCageAbility()); - } + TargetPermanent auraTarget = new TargetCreaturePermanent(); + this.getSpellAbility().addTarget(auraTarget); + this.getSpellAbility().addEffect(new AttachEffect(Outcome.Detriment)); + Ability ability = new EnchantAbility(auraTarget.getTargetName()); + this.addAbility(ability); + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new IceCageEffect())); + this.addAbility(new IceCageAbility()); + } - public IceCage(final IceCage card) { - super(card); - } + public IceCage(final IceCage card) { + super(card); + } - @Override - public IceCage copy() { - return new IceCage(this); - } + @Override + public IceCage copy() { + return new IceCage(this); + } } class IceCageEffect extends ReplacementEffectImpl { - public IceCageEffect() { - super(Duration.WhileOnBattlefield, Outcome.Detriment); - staticText = "Enchanted creature can't attack or block, and its activated abilities can't be activated"; - } + public IceCageEffect() { + super(Duration.WhileOnBattlefield, Outcome.Detriment); + staticText = "Enchanted creature can't attack or block, and its activated abilities can't be activated"; + } - public IceCageEffect(final IceCageEffect effect) { - super(effect); - } + public IceCageEffect(final IceCageEffect effect) { + super(effect); + } - @Override - public IceCageEffect copy() { - return new IceCageEffect(this); - } + @Override + public IceCageEffect copy() { + return new IceCageEffect(this); + } - @Override - public boolean apply(Game game, Ability source) { - return true; - } + @Override + public boolean apply(Game game, Ability source) { + return true; + } - @Override - public boolean replaceEvent(GameEvent event, Ability source, Game game) { - return true; - } + @Override + public boolean replaceEvent(GameEvent event, Ability source, Game game) { + return true; + } - @Override - public boolean applies(GameEvent event, Ability source, Game game) { - if (event.getType() == EventType.DECLARE_ATTACKER || event.getType() == EventType.DECLARE_BLOCKER || event.getType() == EventType.ACTIVATE_ABILITY) { - Permanent enchantment = game.getPermanent(source.getSourceId()); - if (enchantment != null && enchantment.getAttachedTo() != null) { - if (event.getSourceId().equals(enchantment.getAttachedTo())) { - return true; - } - } - } - return false; - } + @Override + public boolean applies(GameEvent event, Ability source, Game game) { + if (event.getType() == EventType.DECLARE_ATTACKER || event.getType() == EventType.DECLARE_BLOCKER || event.getType() == EventType.ACTIVATE_ABILITY) { + Permanent enchantment = game.getPermanent(source.getSourceId()); + if (enchantment != null && enchantment.getAttachedTo() != null) { + if (event.getSourceId().equals(enchantment.getAttachedTo())) { + return true; + } + } + } + return false; + } } class IceCageAbility extends TriggeredAbilityImpl { - public IceCageAbility() { - super(Zone.BATTLEFIELD, new DestroySourceEffect()); - } + public IceCageAbility() { + super(Zone.BATTLEFIELD, new DestroySourceEffect()); + } - public IceCageAbility(final IceCageAbility ability) { - super(ability); - } + public IceCageAbility(final IceCageAbility ability) { + super(ability); + } - @Override - public IceCageAbility copy() { - return new IceCageAbility(this); - } + @Override + public IceCageAbility copy() { + return new IceCageAbility(this); + } - @Override - public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == EventType.TARGETED) { - Permanent enchantment = game.getPermanent(sourceId); - if (enchantment != null && enchantment.getAttachedTo() != null) { - if (event.getTargetId().equals(enchantment.getAttachedTo())) { - return true; - } - } - } - return false; - } + @Override + public boolean checkTrigger(GameEvent event, Game game) { + if (event.getType() == EventType.TARGETED) { + Permanent enchantment = game.getPermanent(sourceId); + if (enchantment != null && enchantment.getAttachedTo() != null) { + if (event.getTargetId().equals(enchantment.getAttachedTo())) { + return true; + } + } + } + return false; + } - @Override - public String getRule() { - return "When enchanted creature becomes the target of a spell or ability, destroy {this}."; - } + @Override + public String getRule() { + return "When enchanted creature becomes the target of a spell or ability, destroy {this}."; + } } diff --git a/Mage.Sets/src/mage/sets/magic2010/Island1.java b/Mage.Sets/src/mage/sets/magic2010/Island1.java index e795bd524b..8cd9745c02 100644 --- a/Mage.Sets/src/mage/sets/magic2010/Island1.java +++ b/Mage.Sets/src/mage/sets/magic2010/Island1.java @@ -36,18 +36,18 @@ import java.util.UUID; */ public class Island1 extends mage.cards.basiclands.Island { - public Island1(UUID ownerId) { - super(ownerId, 234); - this.expansionSetCode = "M10"; - } + public Island1(UUID ownerId) { + super(ownerId, 234); + this.expansionSetCode = "M10"; + } - public Island1(final Island1 card) { - super(card); - } + public Island1(final Island1 card) { + super(card); + } - @Override - public Island1 copy() { - return new Island1(this); - } + @Override + public Island1 copy() { + return new Island1(this); + } } diff --git a/Mage.Sets/src/mage/sets/magic2010/Island2.java b/Mage.Sets/src/mage/sets/magic2010/Island2.java index 14a6ddd5bd..1a5742d916 100644 --- a/Mage.Sets/src/mage/sets/magic2010/Island2.java +++ b/Mage.Sets/src/mage/sets/magic2010/Island2.java @@ -36,18 +36,18 @@ import java.util.UUID; */ public class Island2 extends mage.cards.basiclands.Island { - public Island2(UUID ownerId) { - super(ownerId, 235); - this.expansionSetCode = "M10"; - } + public Island2(UUID ownerId) { + super(ownerId, 235); + this.expansionSetCode = "M10"; + } - public Island2(final Island2 card) { - super(card); - } + public Island2(final Island2 card) { + super(card); + } - @Override - public Island2 copy() { - return new Island2(this); - } + @Override + public Island2 copy() { + return new Island2(this); + } } diff --git a/Mage.Sets/src/mage/sets/magic2010/Island3.java b/Mage.Sets/src/mage/sets/magic2010/Island3.java index 4077ac0d9c..059d9c75b8 100644 --- a/Mage.Sets/src/mage/sets/magic2010/Island3.java +++ b/Mage.Sets/src/mage/sets/magic2010/Island3.java @@ -36,18 +36,18 @@ import java.util.UUID; */ public class Island3 extends mage.cards.basiclands.Island { - public Island3(UUID ownerId) { - super(ownerId, 236); - this.expansionSetCode = "M10"; - } + public Island3(UUID ownerId) { + super(ownerId, 236); + this.expansionSetCode = "M10"; + } - public Island3(final Island3 card) { - super(card); - } + public Island3(final Island3 card) { + super(card); + } - @Override - public Island3 copy() { - return new Island3(this); - } + @Override + public Island3 copy() { + return new Island3(this); + } } diff --git a/Mage.Sets/src/mage/sets/magic2010/Island4.java b/Mage.Sets/src/mage/sets/magic2010/Island4.java index 8d60a2a355..abe0aaa5a3 100644 --- a/Mage.Sets/src/mage/sets/magic2010/Island4.java +++ b/Mage.Sets/src/mage/sets/magic2010/Island4.java @@ -36,18 +36,18 @@ import java.util.UUID; */ public class Island4 extends mage.cards.basiclands.Island { - public Island4(UUID ownerId) { - super(ownerId, 237); - this.expansionSetCode = "M10"; - } + public Island4(UUID ownerId) { + super(ownerId, 237); + this.expansionSetCode = "M10"; + } - public Island4(final Island4 card) { - super(card); - } + public Island4(final Island4 card) { + super(card); + } - @Override - public Island4 copy() { - return new Island4(this); - } + @Override + public Island4 copy() { + return new Island4(this); + } } diff --git a/Mage.Sets/src/mage/sets/magic2010/JaceBeleren.java b/Mage.Sets/src/mage/sets/magic2010/JaceBeleren.java index e87bb731bd..abba6bf727 100644 --- a/Mage.Sets/src/mage/sets/magic2010/JaceBeleren.java +++ b/Mage.Sets/src/mage/sets/magic2010/JaceBeleren.java @@ -47,33 +47,33 @@ import mage.target.TargetPlayer; */ public class JaceBeleren extends CardImpl { - public JaceBeleren(UUID ownerId) { - super(ownerId, 58, "Jace Beleren", Rarity.MYTHIC, new CardType[]{CardType.PLANESWALKER}, "{1}{U}{U}"); - this.expansionSetCode = "M10"; - this.subtype.add("Jace"); - this.color.setBlue(true); - this.addAbility(new EntersBattlefieldAbility(new AddCountersSourceEffect(CounterType.LOYALTY.createInstance(3)), "")); + public JaceBeleren(UUID ownerId) { + super(ownerId, 58, "Jace Beleren", Rarity.MYTHIC, new CardType[]{CardType.PLANESWALKER}, "{1}{U}{U}"); + this.expansionSetCode = "M10"; + this.subtype.add("Jace"); + this.color.setBlue(true); + this.addAbility(new EntersBattlefieldAbility(new AddCountersSourceEffect(CounterType.LOYALTY.createInstance(3)), "")); - this.addAbility(new LoyaltyAbility(new DrawCardAllEffect(1), 2)); + this.addAbility(new LoyaltyAbility(new DrawCardAllEffect(1), 2)); - LoyaltyAbility ability1 = new LoyaltyAbility(new DrawCardTargetEffect(1), -1); - ability1.addTarget(new TargetPlayer()); - this.addAbility(ability1); + LoyaltyAbility ability1 = new LoyaltyAbility(new DrawCardTargetEffect(1), -1); + ability1.addTarget(new TargetPlayer()); + this.addAbility(ability1); - LoyaltyAbility ability2 = new LoyaltyAbility(new PutLibraryIntoGraveTargetEffect(20), -10); - ability2.addTarget(new TargetPlayer()); - this.addAbility(ability2); + LoyaltyAbility ability2 = new LoyaltyAbility(new PutLibraryIntoGraveTargetEffect(20), -10); + ability2.addTarget(new TargetPlayer()); + this.addAbility(ability2); - } + } - public JaceBeleren(final JaceBeleren card) { - super(card); - } + public JaceBeleren(final JaceBeleren card) { + super(card); + } - @Override - public JaceBeleren copy() { - return new JaceBeleren(this); - } + @Override + public JaceBeleren copy() { + return new JaceBeleren(this); + } } diff --git a/Mage.Sets/src/mage/sets/magic2010/KrakensEye.java b/Mage.Sets/src/mage/sets/magic2010/KrakensEye.java index f51f9a4b70..74f90814f0 100644 --- a/Mage.Sets/src/mage/sets/magic2010/KrakensEye.java +++ b/Mage.Sets/src/mage/sets/magic2010/KrakensEye.java @@ -36,19 +36,19 @@ import java.util.UUID; */ public class KrakensEye extends mage.sets.tenth.KrakensEye { - public KrakensEye(UUID ownerId) { - super(ownerId); - this.cardNumber = 213; - this.expansionSetCode = "M10"; - } + public KrakensEye(UUID ownerId) { + super(ownerId); + this.cardNumber = 213; + this.expansionSetCode = "M10"; + } - public KrakensEye(final KrakensEye card) { - super(card); - } + public KrakensEye(final KrakensEye card) { + super(card); + } - @Override - public KrakensEye copy() { - return new KrakensEye(this); - } + @Override + public KrakensEye copy() { + return new KrakensEye(this); + } } \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/magic2010/LavaAxe.java b/Mage.Sets/src/mage/sets/magic2010/LavaAxe.java index 6cc59248b2..1d0caf5e59 100644 --- a/Mage.Sets/src/mage/sets/magic2010/LavaAxe.java +++ b/Mage.Sets/src/mage/sets/magic2010/LavaAxe.java @@ -36,19 +36,19 @@ import java.util.UUID; */ public class LavaAxe extends mage.sets.tenth.LavaAxe { - public LavaAxe(UUID ownerId) { - super(ownerId); - this.cardNumber = 145; - this.expansionSetCode = "M10"; - } + public LavaAxe(UUID ownerId) { + super(ownerId); + this.cardNumber = 145; + this.expansionSetCode = "M10"; + } - public LavaAxe(final LavaAxe card) { - super(card); - } + public LavaAxe(final LavaAxe card) { + super(card); + } - @Override - public LavaAxe copy() { - return new LavaAxe(this); - } + @Override + public LavaAxe copy() { + return new LavaAxe(this); + } } \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/magic2010/Lifelink.java b/Mage.Sets/src/mage/sets/magic2010/Lifelink.java index bb4c3014be..b74e6c36ab 100644 --- a/Mage.Sets/src/mage/sets/magic2010/Lifelink.java +++ b/Mage.Sets/src/mage/sets/magic2010/Lifelink.java @@ -41,9 +41,9 @@ public class Lifelink extends mage.sets.magic2012.Lifelink { this.cardNumber = 18; this.expansionSetCode = "M10"; this.subtype.add("Aura"); - - this.color.setWhite(true); - + + this.color.setWhite(true); + } public Lifelink (final Lifelink card) { diff --git a/Mage.Sets/src/mage/sets/magic2010/LightningBolt.java b/Mage.Sets/src/mage/sets/magic2010/LightningBolt.java index 2237fb7f45..2e55951dc8 100644 --- a/Mage.Sets/src/mage/sets/magic2010/LightningBolt.java +++ b/Mage.Sets/src/mage/sets/magic2010/LightningBolt.java @@ -41,21 +41,21 @@ import mage.target.common.TargetCreatureOrPlayer; */ public class LightningBolt extends CardImpl { - public LightningBolt(UUID ownerId) { - super(ownerId, 146, "Lightning Bolt", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{R}"); - this.expansionSetCode = "M10"; - this.color.setRed(true); - this.getSpellAbility().addTarget(new TargetCreatureOrPlayer()); - this.getSpellAbility().addEffect(new DamageTargetEffect(3)); - } + public LightningBolt(UUID ownerId) { + super(ownerId, 146, "Lightning Bolt", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{R}"); + this.expansionSetCode = "M10"; + this.color.setRed(true); + this.getSpellAbility().addTarget(new TargetCreatureOrPlayer()); + this.getSpellAbility().addEffect(new DamageTargetEffect(3)); + } - public LightningBolt(final LightningBolt card) { - super(card); - } + public LightningBolt(final LightningBolt card) { + super(card); + } - @Override - public LightningBolt copy() { - return new LightningBolt(this); - } + @Override + public LightningBolt copy() { + return new LightningBolt(this); + } } diff --git a/Mage.Sets/src/mage/sets/magic2010/LilianaVess.java b/Mage.Sets/src/mage/sets/magic2010/LilianaVess.java index af04581838..f042358314 100644 --- a/Mage.Sets/src/mage/sets/magic2010/LilianaVess.java +++ b/Mage.Sets/src/mage/sets/magic2010/LilianaVess.java @@ -54,60 +54,60 @@ import mage.target.common.TargetCardInLibrary; */ public class LilianaVess extends CardImpl { - public LilianaVess(UUID ownerId) { - super(ownerId, 102, "Liliana Vess", Rarity.MYTHIC, new CardType[]{CardType.PLANESWALKER}, "{3}{B}{B}"); - this.expansionSetCode = "M10"; - this.subtype.add("Liliana"); - this.color.setBlack(true); - this.addAbility(new EntersBattlefieldAbility(new AddCountersSourceEffect(CounterType.LOYALTY.createInstance(5)), "")); + public LilianaVess(UUID ownerId) { + super(ownerId, 102, "Liliana Vess", Rarity.MYTHIC, new CardType[]{CardType.PLANESWALKER}, "{3}{B}{B}"); + this.expansionSetCode = "M10"; + this.subtype.add("Liliana"); + this.color.setBlack(true); + this.addAbility(new EntersBattlefieldAbility(new AddCountersSourceEffect(CounterType.LOYALTY.createInstance(5)), "")); - LoyaltyAbility ability1 = new LoyaltyAbility(new DiscardTargetEffect(1), 1); - ability1.addTarget(new TargetPlayer()); - this.addAbility(ability1); + LoyaltyAbility ability1 = new LoyaltyAbility(new DiscardTargetEffect(1), 1); + ability1.addTarget(new TargetPlayer()); + this.addAbility(ability1); - this.addAbility(new LoyaltyAbility(new SearchLibraryPutOnLibraryEffect(new TargetCardInLibrary()), -2)); + this.addAbility(new LoyaltyAbility(new SearchLibraryPutOnLibraryEffect(new TargetCardInLibrary()), -2)); - this.addAbility(new LoyaltyAbility(new LilianaVessEffect(), -8)); + this.addAbility(new LoyaltyAbility(new LilianaVessEffect(), -8)); - } + } - public LilianaVess(final LilianaVess card) { - super(card); - } + public LilianaVess(final LilianaVess card) { + super(card); + } - @Override - public LilianaVess copy() { - return new LilianaVess(this); - } + @Override + public LilianaVess copy() { + return new LilianaVess(this); + } } class LilianaVessEffect extends OneShotEffect { - public LilianaVessEffect() { - super(Outcome.PutCreatureInPlay); - staticText = "Put all creature cards in all graveyards onto the battlefield under your control"; - } + public LilianaVessEffect() { + super(Outcome.PutCreatureInPlay); + staticText = "Put all creature cards in all graveyards onto the battlefield under your control"; + } - public LilianaVessEffect(final LilianaVessEffect effect) { - super(effect); - } + public LilianaVessEffect(final LilianaVessEffect effect) { + super(effect); + } - @Override - public boolean apply(Game game, Ability source) { - for (Player player: game.getPlayers().values()) { - for (Card card: player.getGraveyard().getCards(game)) { - if (card.getCardType().contains(CardType.CREATURE)) { - card.putOntoBattlefield(game, Zone.GRAVEYARD, source.getId(), source.getControllerId()); - } - } - } - return true; - } + @Override + public boolean apply(Game game, Ability source) { + for (Player player: game.getPlayers().values()) { + for (Card card: player.getGraveyard().getCards(game)) { + if (card.getCardType().contains(CardType.CREATURE)) { + card.putOntoBattlefield(game, Zone.GRAVEYARD, source.getId(), source.getControllerId()); + } + } + } + return true; + } - @Override - public LilianaVessEffect copy() { - return new LilianaVessEffect(this); - } + @Override + public LilianaVessEffect copy() { + return new LilianaVessEffect(this); + } } diff --git a/Mage.Sets/src/mage/sets/magic2010/LlanowarElves.java b/Mage.Sets/src/mage/sets/magic2010/LlanowarElves.java index e4cbbab207..39aeb89224 100644 --- a/Mage.Sets/src/mage/sets/magic2010/LlanowarElves.java +++ b/Mage.Sets/src/mage/sets/magic2010/LlanowarElves.java @@ -36,19 +36,19 @@ import java.util.UUID; */ public class LlanowarElves extends mage.sets.tenth.LlanowarElves { - public LlanowarElves(UUID ownerId) { - super(ownerId); - this.cardNumber = 189; - this.expansionSetCode = "M10"; - } + public LlanowarElves(UUID ownerId) { + super(ownerId); + this.cardNumber = 189; + this.expansionSetCode = "M10"; + } - public LlanowarElves(final LlanowarElves card) { - super(card); - } + public LlanowarElves(final LlanowarElves card) { + super(card); + } - @Override - public LlanowarElves copy() { - return new LlanowarElves(this); - } + @Override + public LlanowarElves copy() { + return new LlanowarElves(this); + } } \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/magic2010/LoomingShade.java b/Mage.Sets/src/mage/sets/magic2010/LoomingShade.java index b0c395f539..5d6a66c071 100644 --- a/Mage.Sets/src/mage/sets/magic2010/LoomingShade.java +++ b/Mage.Sets/src/mage/sets/magic2010/LoomingShade.java @@ -49,9 +49,9 @@ public class LoomingShade extends CardImpl { super(ownerId, 103, "Looming Shade", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{2}{B}"); this.expansionSetCode = "M10"; this.subtype.add("Shade"); - this.color.setBlack(true); - this.power = new MageInt(1); - this.toughness = new MageInt(1); + this.color.setBlack(true); + this.power = new MageInt(1); + this.toughness = new MageInt(1); this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new BoostSourceEffect(1, 1, Duration.EndOfTurn), new ManaCostsImpl("{B}"))); } diff --git a/Mage.Sets/src/mage/sets/magic2010/MagmaPhoenix.java b/Mage.Sets/src/mage/sets/magic2010/MagmaPhoenix.java index e7971c1ed4..808f67ea38 100644 --- a/Mage.Sets/src/mage/sets/magic2010/MagmaPhoenix.java +++ b/Mage.Sets/src/mage/sets/magic2010/MagmaPhoenix.java @@ -47,26 +47,26 @@ import mage.cards.CardImpl; */ public class MagmaPhoenix extends CardImpl { - public MagmaPhoenix(UUID ownerId) { - super(ownerId, 148, "Magma Phoenix", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{3}{R}{R}"); - this.expansionSetCode = "M10"; - this.subtype.add("Phoenix"); - this.color.setRed(true); - this.power = new MageInt(3); - this.toughness = new MageInt(3); + public MagmaPhoenix(UUID ownerId) { + super(ownerId, 148, "Magma Phoenix", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{3}{R}{R}"); + this.expansionSetCode = "M10"; + this.subtype.add("Phoenix"); + this.color.setRed(true); + this.power = new MageInt(3); + this.toughness = new MageInt(3); - this.addAbility(FlyingAbility.getInstance()); - this.addAbility(new DiesTriggeredAbility(new DamageEverythingEffect(3), false)); - this.addAbility(new SimpleActivatedAbility(Zone.GRAVEYARD, new ReturnSourceFromGraveyardToHandEffect(), new ManaCostsImpl("{3}{R}{R}"))); - } + this.addAbility(FlyingAbility.getInstance()); + this.addAbility(new DiesTriggeredAbility(new DamageEverythingEffect(3), false)); + this.addAbility(new SimpleActivatedAbility(Zone.GRAVEYARD, new ReturnSourceFromGraveyardToHandEffect(), new ManaCostsImpl("{3}{R}{R}"))); + } - public MagmaPhoenix(final MagmaPhoenix card) { - super(card); - } + public MagmaPhoenix(final MagmaPhoenix card) { + super(card); + } - @Override - public MagmaPhoenix copy() { - return new MagmaPhoenix(this); - } + @Override + public MagmaPhoenix copy() { + return new MagmaPhoenix(this); + } } diff --git a/Mage.Sets/src/mage/sets/magic2010/MasterOfTheWildHunt.java b/Mage.Sets/src/mage/sets/magic2010/MasterOfTheWildHunt.java index cb2630b605..84919fdacb 100644 --- a/Mage.Sets/src/mage/sets/magic2010/MasterOfTheWildHunt.java +++ b/Mage.Sets/src/mage/sets/magic2010/MasterOfTheWildHunt.java @@ -59,73 +59,73 @@ import java.util.UUID; */ public class MasterOfTheWildHunt extends CardImpl { - private static WolfToken wolfToken = new WolfToken(); + private static WolfToken wolfToken = new WolfToken(); - public MasterOfTheWildHunt(UUID ownerId) { - super(ownerId, 191, "Master of the Wild Hunt", Rarity.MYTHIC, new CardType[]{CardType.CREATURE}, "{2}{G}{G}"); - this.expansionSetCode = "M10"; - this.subtype.add("Human"); - this.subtype.add("Shaman"); - this.color.setGreen(true); - this.power = new MageInt(3); - this.toughness = new MageInt(3); + public MasterOfTheWildHunt(UUID ownerId) { + super(ownerId, 191, "Master of the Wild Hunt", Rarity.MYTHIC, new CardType[]{CardType.CREATURE}, "{2}{G}{G}"); + this.expansionSetCode = "M10"; + this.subtype.add("Human"); + this.subtype.add("Shaman"); + this.color.setGreen(true); + this.power = new MageInt(3); + this.toughness = new MageInt(3); - this.addAbility(new OnEventTriggeredAbility(EventType.UPKEEP_STEP_PRE, "beginning of your upkeep", new CreateTokenEffect(wolfToken))); - Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new MasterOfTheWildHuntEffect(), new TapSourceCost()); - ability.addTarget(new TargetCreaturePermanent()); - this.addAbility(ability); - } + this.addAbility(new OnEventTriggeredAbility(EventType.UPKEEP_STEP_PRE, "beginning of your upkeep", new CreateTokenEffect(wolfToken))); + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new MasterOfTheWildHuntEffect(), new TapSourceCost()); + ability.addTarget(new TargetCreaturePermanent()); + this.addAbility(ability); + } - public MasterOfTheWildHunt(final MasterOfTheWildHunt card) { - super(card); - } + public MasterOfTheWildHunt(final MasterOfTheWildHunt card) { + super(card); + } - @Override - public MasterOfTheWildHunt copy() { - return new MasterOfTheWildHunt(this); - } + @Override + public MasterOfTheWildHunt copy() { + return new MasterOfTheWildHunt(this); + } } class MasterOfTheWildHuntEffect extends OneShotEffect { - private static final FilterCreaturePermanent filter = new FilterCreaturePermanent(); + private static final FilterCreaturePermanent filter = new FilterCreaturePermanent(); - static { - filter.getSubtype().add("Wolf"); + static { + filter.getSubtype().add("Wolf"); filter.setScopeSubtype(Filter.ComparisonScope.Any); - filter.setTapped(false); - filter.setUseTapped(true); - } + filter.setTapped(false); + filter.setUseTapped(true); + } - public MasterOfTheWildHuntEffect() { - super(Outcome.Damage); - staticText = "Tap all untapped Wolf creatures you control. Each Wolf tapped this way deals damage equal to its power to target creature. That creature deals damage equal to its power divided as its controller chooses among any number of those Wolves"; - } + public MasterOfTheWildHuntEffect() { + super(Outcome.Damage); + staticText = "Tap all untapped Wolf creatures you control. Each Wolf tapped this way deals damage equal to its power to target creature. That creature deals damage equal to its power divided as its controller chooses among any number of those Wolves"; + } - public MasterOfTheWildHuntEffect(final MasterOfTheWildHuntEffect effect) { - super(effect); - } + public MasterOfTheWildHuntEffect(final MasterOfTheWildHuntEffect effect) { + super(effect); + } - @Override - public MasterOfTheWildHuntEffect copy() { - return new MasterOfTheWildHuntEffect(this); - } + @Override + public MasterOfTheWildHuntEffect copy() { + return new MasterOfTheWildHuntEffect(this); + } - @Override - public boolean apply(Game game, Ability source) { - List wolves = new ArrayList(); - Permanent target = game.getPermanent(source.getFirstTarget()); - if (target != null && game.getBattlefield().countAll(filter, source.getControllerId(), game) > 0) { - for (Permanent permanent: game.getBattlefield().getAllActivePermanents(filter, source.getControllerId(), game)) { - permanent.tap(game); - target.damage(permanent.getToughness().getValue(), permanent.getId(), game, true, false); - wolves.add(permanent.getId()); - } - Player player = game.getPlayer(target.getControllerId()); - player.assignDamage(target.getPower().getValue(), wolves, "Wolf", target.getId(), game); - return true; - } - return false; - } + @Override + public boolean apply(Game game, Ability source) { + List wolves = new ArrayList(); + Permanent target = game.getPermanent(source.getFirstTarget()); + if (target != null && game.getBattlefield().countAll(filter, source.getControllerId(), game) > 0) { + for (Permanent permanent: game.getBattlefield().getAllActivePermanents(filter, source.getControllerId(), game)) { + permanent.tap(game); + target.damage(permanent.getToughness().getValue(), permanent.getId(), game, true, false); + wolves.add(permanent.getId()); + } + Player player = game.getPlayer(target.getControllerId()); + player.assignDamage(target.getPower().getValue(), wolves, "Wolf", target.getId(), game); + return true; + } + return false; + } } \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/magic2010/MerfolkSovereign.java b/Mage.Sets/src/mage/sets/magic2010/MerfolkSovereign.java index 2c3a285ebd..32edd06aa0 100644 --- a/Mage.Sets/src/mage/sets/magic2010/MerfolkSovereign.java +++ b/Mage.Sets/src/mage/sets/magic2010/MerfolkSovereign.java @@ -51,35 +51,35 @@ import mage.target.common.TargetCreaturePermanent; */ public class MerfolkSovereign extends CardImpl { - private static final FilterCreaturePermanent filter1 = new FilterCreaturePermanent("Merfolk creatures"); - private static final FilterCreaturePermanent filter2 = new FilterCreaturePermanent("Merfolk creature"); + private static final FilterCreaturePermanent filter1 = new FilterCreaturePermanent("Merfolk creatures"); + private static final FilterCreaturePermanent filter2 = new FilterCreaturePermanent("Merfolk creature"); - static { - filter1.getSubtype().add("Merfolk"); - filter2.getSubtype().add("Merfolk"); - } + static { + filter1.getSubtype().add("Merfolk"); + filter2.getSubtype().add("Merfolk"); + } - public MerfolkSovereign(UUID ownerId) { - super(ownerId, 62, "Merfolk Sovereign", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{1}{U}{U}"); - this.expansionSetCode = "M10"; - this.subtype.add("Merfolk"); - this.color.setBlue(true); - this.power = new MageInt(2); - this.toughness = new MageInt(2); + public MerfolkSovereign(UUID ownerId) { + super(ownerId, 62, "Merfolk Sovereign", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{1}{U}{U}"); + this.expansionSetCode = "M10"; + this.subtype.add("Merfolk"); + this.color.setBlue(true); + this.power = new MageInt(2); + this.toughness = new MageInt(2); - this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostControlledEffect(1, 1, Duration.WhileOnBattlefield, filter1, true))); - Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new GainAbilityTargetEffect(UnblockableAbility.getInstance(), Duration.EndOfTurn), new TapSourceCost()); - ability.addTarget(new TargetCreaturePermanent(filter2)); - this.addAbility(ability); - } + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostControlledEffect(1, 1, Duration.WhileOnBattlefield, filter1, true))); + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new GainAbilityTargetEffect(UnblockableAbility.getInstance(), Duration.EndOfTurn), new TapSourceCost()); + ability.addTarget(new TargetCreaturePermanent(filter2)); + this.addAbility(ability); + } - public MerfolkSovereign(final MerfolkSovereign card) { - super(card); - } + public MerfolkSovereign(final MerfolkSovereign card) { + super(card); + } - @Override - public MerfolkSovereign copy() { - return new MerfolkSovereign(this); - } + @Override + public MerfolkSovereign copy() { + return new MerfolkSovereign(this); + } } diff --git a/Mage.Sets/src/mage/sets/magic2010/MightOfOaks.java b/Mage.Sets/src/mage/sets/magic2010/MightOfOaks.java index 922675509b..e7b79dfda7 100644 --- a/Mage.Sets/src/mage/sets/magic2010/MightOfOaks.java +++ b/Mage.Sets/src/mage/sets/magic2010/MightOfOaks.java @@ -45,17 +45,17 @@ public class MightOfOaks extends CardImpl { public MightOfOaks(UUID ownerId){ super(ownerId, 192, "Might of Oaks", Rarity.RARE, new CardType[]{CardType.INSTANT},"{3}{G}"); this.expansionSetCode = "M10"; - this.color.setGreen(true); - this.getSpellAbility().addTarget(new TargetCreaturePermanent()); - this.getSpellAbility().addEffect(new BoostTargetEffect(7, 7, Duration.EndOfTurn)); + this.color.setGreen(true); + this.getSpellAbility().addTarget(new TargetCreaturePermanent()); + this.getSpellAbility().addEffect(new BoostTargetEffect(7, 7, Duration.EndOfTurn)); } - public MightOfOaks(final MightOfOaks card) { - super(card); - } + public MightOfOaks(final MightOfOaks card) { + super(card); + } - @Override - public MightOfOaks copy() { - return new MightOfOaks(this); - } + @Override + public MightOfOaks copy() { + return new MightOfOaks(this); + } } diff --git a/Mage.Sets/src/mage/sets/magic2010/MindControl.java b/Mage.Sets/src/mage/sets/magic2010/MindControl.java index d0ad39a67c..3a8252f1ca 100644 --- a/Mage.Sets/src/mage/sets/magic2010/MindControl.java +++ b/Mage.Sets/src/mage/sets/magic2010/MindControl.java @@ -48,28 +48,28 @@ import mage.target.common.TargetCreaturePermanent; */ public class MindControl extends CardImpl { - public MindControl(UUID ownerId) { - super(ownerId, 63, "Mind Control", Rarity.UNCOMMON, new CardType[]{CardType.ENCHANTMENT}, "{3}{U}{U}"); - this.expansionSetCode = "M10"; - this.color.setBlue(true); - this.subtype.add("Aura"); + public MindControl(UUID ownerId) { + super(ownerId, 63, "Mind Control", Rarity.UNCOMMON, new CardType[]{CardType.ENCHANTMENT}, "{3}{U}{U}"); + this.expansionSetCode = "M10"; + this.color.setBlue(true); + this.subtype.add("Aura"); - TargetPermanent auraTarget = new TargetCreaturePermanent(); - this.getSpellAbility().addTarget(auraTarget); - this.getSpellAbility().addEffect(new AttachEffect(Outcome.Detriment)); - Ability ability = new EnchantAbility(auraTarget.getTargetName()); - this.addAbility(ability); - this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new ControlEnchantedEffect())); + TargetPermanent auraTarget = new TargetCreaturePermanent(); + this.getSpellAbility().addTarget(auraTarget); + this.getSpellAbility().addEffect(new AttachEffect(Outcome.Detriment)); + Ability ability = new EnchantAbility(auraTarget.getTargetName()); + this.addAbility(ability); + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new ControlEnchantedEffect())); - } + } - public MindControl(final MindControl card) { - super(card); - } + public MindControl(final MindControl card) { + super(card); + } - @Override - public MindControl copy() { - return new MindControl(this); - } + @Override + public MindControl copy() { + return new MindControl(this); + } } diff --git a/Mage.Sets/src/mage/sets/magic2010/MindRot.java b/Mage.Sets/src/mage/sets/magic2010/MindRot.java index b68527d566..fbdd4cad63 100644 --- a/Mage.Sets/src/mage/sets/magic2010/MindRot.java +++ b/Mage.Sets/src/mage/sets/magic2010/MindRot.java @@ -36,19 +36,19 @@ import java.util.UUID; */ public class MindRot extends mage.sets.tenth.MindRot { - public MindRot(UUID ownerId) { - super(ownerId); - this.cardNumber = 105; - this.expansionSetCode = "M10"; - } + public MindRot(UUID ownerId) { + super(ownerId); + this.cardNumber = 105; + this.expansionSetCode = "M10"; + } - public MindRot(final MindRot card) { - super(card); - } + public MindRot(final MindRot card) { + super(card); + } - @Override - public MindRot copy() { - return new MindRot(this); - } + @Override + public MindRot copy() { + return new MindRot(this); + } } \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/magic2010/MindSpring.java b/Mage.Sets/src/mage/sets/magic2010/MindSpring.java index eabb45db1e..fcf8b7e302 100644 --- a/Mage.Sets/src/mage/sets/magic2010/MindSpring.java +++ b/Mage.Sets/src/mage/sets/magic2010/MindSpring.java @@ -44,49 +44,49 @@ import mage.players.Player; */ public class MindSpring extends CardImpl { - public MindSpring(UUID ownerId) { - super(ownerId, 64, "Mind Spring", Rarity.RARE, new CardType[]{CardType.SORCERY}, "{X}{U}{U}"); - this.expansionSetCode = "M10"; - this.color.setBlue(true); - this.getSpellAbility().addEffect(new MindSpringEffect()); - } + public MindSpring(UUID ownerId) { + super(ownerId, 64, "Mind Spring", Rarity.RARE, new CardType[]{CardType.SORCERY}, "{X}{U}{U}"); + this.expansionSetCode = "M10"; + this.color.setBlue(true); + this.getSpellAbility().addEffect(new MindSpringEffect()); + } - public MindSpring(final MindSpring card) { - super(card); - } + public MindSpring(final MindSpring card) { + super(card); + } - @Override - public MindSpring copy() { - return new MindSpring(this); - } + @Override + public MindSpring copy() { + return new MindSpring(this); + } } class MindSpringEffect extends OneShotEffect { - public MindSpringEffect() { - super(Outcome.DrawCard); - staticText = "Draw X cards"; - } + public MindSpringEffect() { + super(Outcome.DrawCard); + staticText = "Draw X cards"; + } - public MindSpringEffect(final MindSpringEffect effect) { - super(effect); - } + public MindSpringEffect(final MindSpringEffect effect) { + super(effect); + } - @Override - public MindSpringEffect copy() { - return new MindSpringEffect(this); - } + @Override + public MindSpringEffect copy() { + return new MindSpringEffect(this); + } - @Override - public boolean apply(Game game, Ability source) { - int amount = source.getManaCostsToPay().getX(); - Player player = game.getPlayer(source.getControllerId()); - if (player != null) { - player.drawCards(amount, game); - return true; - } - return false; - } + @Override + public boolean apply(Game game, Ability source) { + int amount = source.getManaCostsToPay().getX(); + Player player = game.getPlayer(source.getControllerId()); + if (player != null) { + player.drawCards(amount, game); + return true; + } + return false; + } } diff --git a/Mage.Sets/src/mage/sets/magic2010/MistLeopard.java b/Mage.Sets/src/mage/sets/magic2010/MistLeopard.java index 74480bc2bb..95bf6940b2 100644 --- a/Mage.Sets/src/mage/sets/magic2010/MistLeopard.java +++ b/Mage.Sets/src/mage/sets/magic2010/MistLeopard.java @@ -47,7 +47,7 @@ public class MistLeopard extends CardImpl { this.color.setGreen(true); this.subtype.add("Cat"); this.power = new MageInt(3); - this.toughness = new MageInt(2); + this.toughness = new MageInt(2); this.addAbility(ShroudAbility.getInstance()); } diff --git a/Mage.Sets/src/mage/sets/magic2010/Mountain1.java b/Mage.Sets/src/mage/sets/magic2010/Mountain1.java index 186645effa..7c0fec5ac3 100644 --- a/Mage.Sets/src/mage/sets/magic2010/Mountain1.java +++ b/Mage.Sets/src/mage/sets/magic2010/Mountain1.java @@ -36,18 +36,18 @@ import java.util.UUID; */ public class Mountain1 extends mage.cards.basiclands.Mountain { - public Mountain1(UUID ownerId) { - super(ownerId, 242); - this.expansionSetCode = "M10"; - } + public Mountain1(UUID ownerId) { + super(ownerId, 242); + this.expansionSetCode = "M10"; + } - public Mountain1(final Mountain1 card) { - super(card); - } + public Mountain1(final Mountain1 card) { + super(card); + } - @Override - public Mountain1 copy() { - return new Mountain1(this); - } + @Override + public Mountain1 copy() { + return new Mountain1(this); + } } diff --git a/Mage.Sets/src/mage/sets/magic2010/Mountain2.java b/Mage.Sets/src/mage/sets/magic2010/Mountain2.java index 78e04fc135..9c18dc5ff6 100644 --- a/Mage.Sets/src/mage/sets/magic2010/Mountain2.java +++ b/Mage.Sets/src/mage/sets/magic2010/Mountain2.java @@ -36,18 +36,18 @@ import java.util.UUID; */ public class Mountain2 extends mage.cards.basiclands.Mountain { - public Mountain2(UUID ownerId) { - super(ownerId, 243); - this.expansionSetCode = "M10"; - } + public Mountain2(UUID ownerId) { + super(ownerId, 243); + this.expansionSetCode = "M10"; + } - public Mountain2(final Mountain2 card) { - super(card); - } + public Mountain2(final Mountain2 card) { + super(card); + } - @Override - public Mountain2 copy() { - return new Mountain2(this); - } + @Override + public Mountain2 copy() { + return new Mountain2(this); + } } diff --git a/Mage.Sets/src/mage/sets/magic2010/Mountain3.java b/Mage.Sets/src/mage/sets/magic2010/Mountain3.java index 91725cb133..4ef8e950d3 100644 --- a/Mage.Sets/src/mage/sets/magic2010/Mountain3.java +++ b/Mage.Sets/src/mage/sets/magic2010/Mountain3.java @@ -36,18 +36,18 @@ import java.util.UUID; */ public class Mountain3 extends mage.cards.basiclands.Mountain { - public Mountain3(UUID ownerId) { - super(ownerId, 244); - this.expansionSetCode = "M10"; - } + public Mountain3(UUID ownerId) { + super(ownerId, 244); + this.expansionSetCode = "M10"; + } - public Mountain3(final Mountain3 card) { - super(card); - } + public Mountain3(final Mountain3 card) { + super(card); + } - @Override - public Mountain3 copy() { - return new Mountain3(this); - } + @Override + public Mountain3 copy() { + return new Mountain3(this); + } } diff --git a/Mage.Sets/src/mage/sets/magic2010/Mountain4.java b/Mage.Sets/src/mage/sets/magic2010/Mountain4.java index 3cf94b39d4..73588d2bfc 100644 --- a/Mage.Sets/src/mage/sets/magic2010/Mountain4.java +++ b/Mage.Sets/src/mage/sets/magic2010/Mountain4.java @@ -36,18 +36,18 @@ import java.util.UUID; */ public class Mountain4 extends mage.cards.basiclands.Mountain { - public Mountain4(UUID ownerId) { - super(ownerId, 245); - this.expansionSetCode = "M10"; - } + public Mountain4(UUID ownerId) { + super(ownerId, 245); + this.expansionSetCode = "M10"; + } - public Mountain4(final Mountain4 card) { - super(card); - } + public Mountain4(final Mountain4 card) { + super(card); + } - @Override - public Mountain4 copy() { - return new Mountain4(this); - } + @Override + public Mountain4 copy() { + return new Mountain4(this); + } } diff --git a/Mage.Sets/src/mage/sets/magic2010/Naturalize.java b/Mage.Sets/src/mage/sets/magic2010/Naturalize.java index 90285111ea..80d6c44cca 100644 --- a/Mage.Sets/src/mage/sets/magic2010/Naturalize.java +++ b/Mage.Sets/src/mage/sets/magic2010/Naturalize.java @@ -36,19 +36,19 @@ import java.util.UUID; */ public class Naturalize extends mage.sets.tenth.Naturalize { - public Naturalize(UUID ownerId) { - super(ownerId); - this.cardNumber = 195; - this.expansionSetCode = "M10"; - } + public Naturalize(UUID ownerId) { + super(ownerId); + this.cardNumber = 195; + this.expansionSetCode = "M10"; + } - public Naturalize(final Naturalize card) { - super(card); - } + public Naturalize(final Naturalize card) { + super(card); + } - @Override - public Naturalize copy() { - return new Naturalize(this); - } + @Override + public Naturalize copy() { + return new Naturalize(this); + } } \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/magic2010/NaturesSpiral.java b/Mage.Sets/src/mage/sets/magic2010/NaturesSpiral.java index 75200a6e88..2b1d92f1e2 100644 --- a/Mage.Sets/src/mage/sets/magic2010/NaturesSpiral.java +++ b/Mage.Sets/src/mage/sets/magic2010/NaturesSpiral.java @@ -43,31 +43,31 @@ import mage.target.common.TargetCardInYourGraveyard; */ public class NaturesSpiral extends CardImpl { - private static final FilterCard filter = new FilterCard("permanent card from your graveyard"); + private static final FilterCard filter = new FilterCard("permanent card from your graveyard"); - static { - filter.getCardType().add(CardType.ARTIFACT); - filter.getCardType().add(CardType.CREATURE); - filter.getCardType().add(CardType.ENCHANTMENT); - filter.getCardType().add(CardType.LAND); - filter.getCardType().add(CardType.PLANESWALKER); - filter.setScopeCardType(ComparisonScope.Any); - } + static { + filter.getCardType().add(CardType.ARTIFACT); + filter.getCardType().add(CardType.CREATURE); + filter.getCardType().add(CardType.ENCHANTMENT); + filter.getCardType().add(CardType.LAND); + filter.getCardType().add(CardType.PLANESWALKER); + filter.setScopeCardType(ComparisonScope.Any); + } - public NaturesSpiral(UUID ownerId) { - super(ownerId, 196, "Nature's Spiral", Rarity.UNCOMMON, new CardType[]{CardType.SORCERY}, "{1}{G}"); - this.expansionSetCode = "M10"; - this.color.setGreen(true); - this.getSpellAbility().addTarget(new TargetCardInYourGraveyard(filter)); - this.getSpellAbility().addEffect(new ReturnToHandTargetEffect()); - } + public NaturesSpiral(UUID ownerId) { + super(ownerId, 196, "Nature's Spiral", Rarity.UNCOMMON, new CardType[]{CardType.SORCERY}, "{1}{G}"); + this.expansionSetCode = "M10"; + this.color.setGreen(true); + this.getSpellAbility().addTarget(new TargetCardInYourGraveyard(filter)); + this.getSpellAbility().addEffect(new ReturnToHandTargetEffect()); + } - public NaturesSpiral(final NaturesSpiral card) { - super(card); - } + public NaturesSpiral(final NaturesSpiral card) { + super(card); + } - @Override - public NaturesSpiral copy() { - return new NaturesSpiral(this); - } + @Override + public NaturesSpiral copy() { + return new NaturesSpiral(this); + } } diff --git a/Mage.Sets/src/mage/sets/magic2010/Negate.java b/Mage.Sets/src/mage/sets/magic2010/Negate.java index 76e9ab259e..fd62f80a90 100644 --- a/Mage.Sets/src/mage/sets/magic2010/Negate.java +++ b/Mage.Sets/src/mage/sets/magic2010/Negate.java @@ -42,27 +42,27 @@ import mage.target.TargetSpell; */ public class Negate extends CardImpl { - private static final FilterSpell filter = new FilterSpell("noncreature spell"); + private static final FilterSpell filter = new FilterSpell("noncreature spell"); - static { - filter.getNotCardType().add(CardType.CREATURE); - } + static { + filter.getNotCardType().add(CardType.CREATURE); + } - public Negate(UUID ownerId) { - super(ownerId, 65, "Negate", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{1}{U}"); - this.expansionSetCode = "M10"; - this.color.setBlue(true); - this.getSpellAbility().addTarget(new TargetSpell(filter)); - this.getSpellAbility().addEffect(new CounterTargetEffect()); - } + public Negate(UUID ownerId) { + super(ownerId, 65, "Negate", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{1}{U}"); + this.expansionSetCode = "M10"; + this.color.setBlue(true); + this.getSpellAbility().addTarget(new TargetSpell(filter)); + this.getSpellAbility().addEffect(new CounterTargetEffect()); + } - public Negate(final Negate card) { - super(card); - } + public Negate(final Negate card) { + super(card); + } - @Override - public Negate copy() { - return new Negate(this); - } + @Override + public Negate copy() { + return new Negate(this); + } } diff --git a/Mage.Sets/src/mage/sets/magic2010/Oakenform.java b/Mage.Sets/src/mage/sets/magic2010/Oakenform.java index b6d3c4fea1..9aede426e3 100644 --- a/Mage.Sets/src/mage/sets/magic2010/Oakenform.java +++ b/Mage.Sets/src/mage/sets/magic2010/Oakenform.java @@ -60,11 +60,11 @@ public class Oakenform extends CardImpl { this.subtype.add("Aura"); TargetPermanent auraTarget = new TargetCreaturePermanent(); - this.getSpellAbility().addTarget(auraTarget); + this.getSpellAbility().addTarget(auraTarget); this.getSpellAbility().addEffect(new AttachEffect(Outcome.BoostCreature)); - Ability ability = new EnchantAbility(auraTarget.getTargetName()); - this.addAbility(ability); - this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new OakenformEffect())); + Ability ability = new EnchantAbility(auraTarget.getTargetName()); + this.addAbility(ability); + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new OakenformEffect())); } public Oakenform(final Oakenform card) { @@ -82,7 +82,7 @@ class OakenformEffect extends ContinuousEffectImpl { public OakenformEffect() { super(Duration.WhileOnBattlefield, Outcome.BoostCreature); - staticText = "Enchanted creature gets +3/+3"; + staticText = "Enchanted creature gets +3/+3"; } public OakenformEffect(final OakenformEffect effect) { @@ -96,27 +96,27 @@ class OakenformEffect extends ContinuousEffectImpl { @Override public boolean apply(Layer layer, SubLayer sublayer, Ability source, Game game) { - Permanent enchantment = game.getPermanent(source.getSourceId()); - if (enchantment != null && enchantment.getAttachedTo() != null) { - Permanent creature = game.getPermanent(enchantment.getAttachedTo()); - if (creature != null) { - switch (layer) { - case PTChangingEffects_7: - if (sublayer == SubLayer.ModifyPT_7c) { - creature.addPower(3); - creature.addToughness(3); - } - break; - } - return true; - } - } - return false; + Permanent enchantment = game.getPermanent(source.getSourceId()); + if (enchantment != null && enchantment.getAttachedTo() != null) { + Permanent creature = game.getPermanent(enchantment.getAttachedTo()); + if (creature != null) { + switch (layer) { + case PTChangingEffects_7: + if (sublayer == SubLayer.ModifyPT_7c) { + creature.addPower(3); + creature.addToughness(3); + } + break; + } + return true; + } + } + return false; } @Override public boolean hasLayer(Layer layer) { - return layer == Layer.PTChangingEffects_7; + return layer == Layer.PTChangingEffects_7; } @Override diff --git a/Mage.Sets/src/mage/sets/magic2010/Ornithopter.java b/Mage.Sets/src/mage/sets/magic2010/Ornithopter.java index 1a9f402446..915ec5420c 100644 --- a/Mage.Sets/src/mage/sets/magic2010/Ornithopter.java +++ b/Mage.Sets/src/mage/sets/magic2010/Ornithopter.java @@ -36,19 +36,19 @@ import java.util.UUID; */ public class Ornithopter extends mage.sets.tenth.Ornithopter { - public Ornithopter(UUID ownerId) { - super(ownerId); - this.cardNumber = 216; - this.expansionSetCode = "M10"; - } + public Ornithopter(UUID ownerId) { + super(ownerId); + this.cardNumber = 216; + this.expansionSetCode = "M10"; + } - public Ornithopter(final Ornithopter card) { - super(card); - } + public Ornithopter(final Ornithopter card) { + super(card); + } - @Override - public Ornithopter copy() { - return new Ornithopter(this); - } + @Override + public Ornithopter copy() { + return new Ornithopter(this); + } } \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/magic2010/Overrun.java b/Mage.Sets/src/mage/sets/magic2010/Overrun.java index ccef7ee360..18d25c5fea 100644 --- a/Mage.Sets/src/mage/sets/magic2010/Overrun.java +++ b/Mage.Sets/src/mage/sets/magic2010/Overrun.java @@ -47,18 +47,18 @@ public class Overrun extends CardImpl { public Overrun(UUID ownerId) { super(ownerId, 198, "Overrun", Rarity.UNCOMMON, new CardType[]{CardType.SORCERY},"{2}{G}{G}{G}"); this.expansionSetCode = "M10"; - this.color.setGreen(true); + this.color.setGreen(true); this.getSpellAbility().addEffect(new BoostControlledEffect(3, 3, Duration.EndOfTurn)); this.getSpellAbility().addEffect(new GainAbilityControlledEffect(TrampleAbility.getInstance(), Duration.EndOfTurn, new FilterCreaturePermanent())); } - public Overrun(final Overrun card) { - super(card); - } + public Overrun(final Overrun card) { + super(card); + } - @Override - public Overrun copy() { - return new Overrun(this); - } + @Override + public Overrun copy() { + return new Overrun(this); + } } diff --git a/Mage.Sets/src/mage/sets/magic2010/Pacifism.java b/Mage.Sets/src/mage/sets/magic2010/Pacifism.java index 61ea736216..5d51581e15 100644 --- a/Mage.Sets/src/mage/sets/magic2010/Pacifism.java +++ b/Mage.Sets/src/mage/sets/magic2010/Pacifism.java @@ -36,19 +36,19 @@ import java.util.UUID; */ public class Pacifism extends mage.sets.tenth.Pacifism { - public Pacifism(UUID ownerId) { - super(ownerId); - this.cardNumber = 22; - this.expansionSetCode = "M10"; - } + public Pacifism(UUID ownerId) { + super(ownerId); + this.cardNumber = 22; + this.expansionSetCode = "M10"; + } - public Pacifism(final Pacifism card) { - super(card); - } + public Pacifism(final Pacifism card) { + super(card); + } - @Override - public Pacifism copy() { - return new Pacifism(this); - } + @Override + public Pacifism copy() { + return new Pacifism(this); + } } \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/magic2010/PalaceGuard.java b/Mage.Sets/src/mage/sets/magic2010/PalaceGuard.java index 6cdc013681..53315c5ae5 100644 --- a/Mage.Sets/src/mage/sets/magic2010/PalaceGuard.java +++ b/Mage.Sets/src/mage/sets/magic2010/PalaceGuard.java @@ -50,67 +50,67 @@ import mage.game.permanent.Permanent; */ public class PalaceGuard extends CardImpl { - public PalaceGuard(UUID ownerId) { - super(ownerId, 23, "Palace Guard", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{2}{W}"); - this.expansionSetCode = "M10"; - this.subtype.add("Human"); - this.subtype.add("Soldier"); - this.color.setWhite(true); - this.power = new MageInt(1); - this.toughness = new MageInt(4); + public PalaceGuard(UUID ownerId) { + super(ownerId, 23, "Palace Guard", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{2}{W}"); + this.expansionSetCode = "M10"; + this.subtype.add("Human"); + this.subtype.add("Soldier"); + this.color.setWhite(true); + this.power = new MageInt(1); + this.toughness = new MageInt(4); - this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new PalaceGuardEffect())); - } + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new PalaceGuardEffect())); + } - public PalaceGuard(final PalaceGuard card) { - super(card); - } + public PalaceGuard(final PalaceGuard card) { + super(card); + } - @Override - public PalaceGuard copy() { - return new PalaceGuard(this); - } + @Override + public PalaceGuard copy() { + return new PalaceGuard(this); + } - class PalaceGuardEffect extends ContinuousEffectImpl { + class PalaceGuardEffect extends ContinuousEffectImpl { - public PalaceGuardEffect() { - super(Duration.WhileOnBattlefield, Outcome.Benefit); - staticText = "{this} can block any number of creatures"; - } + public PalaceGuardEffect() { + super(Duration.WhileOnBattlefield, Outcome.Benefit); + staticText = "{this} can block any number of creatures"; + } - public PalaceGuardEffect(final PalaceGuardEffect effect) { - super(effect); - } + public PalaceGuardEffect(final PalaceGuardEffect effect) { + super(effect); + } - @Override - public PalaceGuardEffect copy() { - return new PalaceGuardEffect(this); - } + @Override + public PalaceGuardEffect copy() { + return new PalaceGuardEffect(this); + } - @Override - public boolean apply(Layer layer, SubLayer sublayer, Ability source, Game game) { - Permanent perm = game.getPermanent(source.getSourceId()); - if (perm != null) { - switch (layer) { - case RulesEffects: - perm.setMaxBlocks(0); - break; - } - return true; - } - return false; - } + @Override + public boolean apply(Layer layer, SubLayer sublayer, Ability source, Game game) { + Permanent perm = game.getPermanent(source.getSourceId()); + if (perm != null) { + switch (layer) { + case RulesEffects: + perm.setMaxBlocks(0); + break; + } + return true; + } + return false; + } - @Override - public boolean apply(Game game, Ability source) { - return false; - } + @Override + public boolean apply(Game game, Ability source) { + return false; + } - @Override - public boolean hasLayer(Layer layer) { - return layer == Layer.RulesEffects; - } + @Override + public boolean hasLayer(Layer layer) { + return layer == Layer.RulesEffects; + } - } + } } diff --git a/Mage.Sets/src/mage/sets/magic2010/Plains1.java b/Mage.Sets/src/mage/sets/magic2010/Plains1.java index 9bf458abaa..e79ad58c4f 100644 --- a/Mage.Sets/src/mage/sets/magic2010/Plains1.java +++ b/Mage.Sets/src/mage/sets/magic2010/Plains1.java @@ -36,18 +36,18 @@ import java.util.UUID; */ public class Plains1 extends mage.cards.basiclands.Plains { - public Plains1(UUID ownerId) { - super(ownerId, 230); - this.expansionSetCode = "M10"; - } + public Plains1(UUID ownerId) { + super(ownerId, 230); + this.expansionSetCode = "M10"; + } - public Plains1(final Plains1 card) { - super(card); - } + public Plains1(final Plains1 card) { + super(card); + } - @Override - public Plains1 copy() { - return new Plains1(this); - } + @Override + public Plains1 copy() { + return new Plains1(this); + } } diff --git a/Mage.Sets/src/mage/sets/magic2010/Plains2.java b/Mage.Sets/src/mage/sets/magic2010/Plains2.java index 20fb645b59..83f983f084 100644 --- a/Mage.Sets/src/mage/sets/magic2010/Plains2.java +++ b/Mage.Sets/src/mage/sets/magic2010/Plains2.java @@ -36,18 +36,18 @@ import java.util.UUID; */ public class Plains2 extends mage.cards.basiclands.Plains { - public Plains2(UUID ownerId) { - super(ownerId, 231); - this.expansionSetCode = "M10"; - } + public Plains2(UUID ownerId) { + super(ownerId, 231); + this.expansionSetCode = "M10"; + } - public Plains2(final Plains2 card) { - super(card); - } + public Plains2(final Plains2 card) { + super(card); + } - @Override - public Plains2 copy() { - return new Plains2(this); - } + @Override + public Plains2 copy() { + return new Plains2(this); + } } diff --git a/Mage.Sets/src/mage/sets/magic2010/Plains3.java b/Mage.Sets/src/mage/sets/magic2010/Plains3.java index 411dca91e6..45e8271389 100644 --- a/Mage.Sets/src/mage/sets/magic2010/Plains3.java +++ b/Mage.Sets/src/mage/sets/magic2010/Plains3.java @@ -36,18 +36,18 @@ import java.util.UUID; */ public class Plains3 extends mage.cards.basiclands.Plains { - public Plains3(UUID ownerId) { - super(ownerId, 232); - this.expansionSetCode = "M10"; - } + public Plains3(UUID ownerId) { + super(ownerId, 232); + this.expansionSetCode = "M10"; + } - public Plains3(final Plains3 card) { - super(card); - } + public Plains3(final Plains3 card) { + super(card); + } - @Override - public Plains3 copy() { - return new Plains3(this); - } + @Override + public Plains3 copy() { + return new Plains3(this); + } } diff --git a/Mage.Sets/src/mage/sets/magic2010/Plains4.java b/Mage.Sets/src/mage/sets/magic2010/Plains4.java index 745babed96..697c960f19 100644 --- a/Mage.Sets/src/mage/sets/magic2010/Plains4.java +++ b/Mage.Sets/src/mage/sets/magic2010/Plains4.java @@ -36,18 +36,18 @@ import java.util.UUID; */ public class Plains4 extends mage.cards.basiclands.Plains { - public Plains4(UUID ownerId) { - super(ownerId, 233); - this.expansionSetCode = "M10"; - } + public Plains4(UUID ownerId) { + super(ownerId, 233); + this.expansionSetCode = "M10"; + } - public Plains4(final Plains4 card) { - super(card); - } + public Plains4(final Plains4 card) { + super(card); + } - @Override - public Plains4 copy() { - return new Plains4(this); - } + @Override + public Plains4 copy() { + return new Plains4(this); + } } diff --git a/Mage.Sets/src/mage/sets/magic2010/PlatinumAngel.java b/Mage.Sets/src/mage/sets/magic2010/PlatinumAngel.java index 0f14af89df..a59d0846fe 100644 --- a/Mage.Sets/src/mage/sets/magic2010/PlatinumAngel.java +++ b/Mage.Sets/src/mage/sets/magic2010/PlatinumAngel.java @@ -37,20 +37,20 @@ import mage.Constants.Rarity; */ public class PlatinumAngel extends mage.sets.tenth.PlatinumAngel { - public PlatinumAngel(UUID ownerId) { - super(ownerId); - this.cardNumber = 218; - this.expansionSetCode = "M10"; - this.rarity = Rarity.MYTHIC; - } + public PlatinumAngel(UUID ownerId) { + super(ownerId); + this.cardNumber = 218; + this.expansionSetCode = "M10"; + this.rarity = Rarity.MYTHIC; + } - public PlatinumAngel(final PlatinumAngel card) { - super(card); - } + public PlatinumAngel(final PlatinumAngel card) { + super(card); + } - @Override - public PlatinumAngel copy() { - return new PlatinumAngel(this); - } + @Override + public PlatinumAngel copy() { + return new PlatinumAngel(this); + } } \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/magic2010/Ponder.java b/Mage.Sets/src/mage/sets/magic2010/Ponder.java index 62a2aa7171..d3e1a87fb1 100644 --- a/Mage.Sets/src/mage/sets/magic2010/Ponder.java +++ b/Mage.Sets/src/mage/sets/magic2010/Ponder.java @@ -40,24 +40,24 @@ import mage.cards.CardImpl; */ public class Ponder extends CardImpl { - public Ponder(UUID ownerId) { - super(ownerId, 68, "Ponder", Rarity.COMMON, new CardType[]{CardType.SORCERY}, "{U}"); - this.expansionSetCode = "M10"; + public Ponder(UUID ownerId) { + super(ownerId, 68, "Ponder", Rarity.COMMON, new CardType[]{CardType.SORCERY}, "{U}"); + this.expansionSetCode = "M10"; - this.color.setBlue(true); + this.color.setBlue(true); - // Look at the top three cards of your library, then put them back in any order. You may shuffle your library. - this.getSpellAbility().addEffect(new LookLibraryControllerEffect(3, true)); - // Draw a card. - this.getSpellAbility().addEffect(new DrawCardControllerEffect(1)); - } + // Look at the top three cards of your library, then put them back in any order. You may shuffle your library. + this.getSpellAbility().addEffect(new LookLibraryControllerEffect(3, true)); + // Draw a card. + this.getSpellAbility().addEffect(new DrawCardControllerEffect(1)); + } - public Ponder(final Ponder card) { - super(card); - } + public Ponder(final Ponder card) { + super(card); + } - @Override - public Ponder copy() { - return new Ponder(this); - } + @Override + public Ponder copy() { + return new Ponder(this); + } } \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/magic2010/PrizedUnicorn.java b/Mage.Sets/src/mage/sets/magic2010/PrizedUnicorn.java index b5fb45e444..935236a4c4 100644 --- a/Mage.Sets/src/mage/sets/magic2010/PrizedUnicorn.java +++ b/Mage.Sets/src/mage/sets/magic2010/PrizedUnicorn.java @@ -43,24 +43,24 @@ import mage.cards.CardImpl; */ public class PrizedUnicorn extends CardImpl { - public PrizedUnicorn(UUID ownerId) { - super(ownerId, 199, "Prized Unicorn", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{3}{G}"); - this.expansionSetCode = "M10"; - this.subtype.add("Unicorn"); - this.color.setGreen(true); - this.power = new MageInt(2); - this.toughness = new MageInt(2); + public PrizedUnicorn(UUID ownerId) { + super(ownerId, 199, "Prized Unicorn", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{3}{G}"); + this.expansionSetCode = "M10"; + this.subtype.add("Unicorn"); + this.color.setGreen(true); + this.power = new MageInt(2); + this.toughness = new MageInt(2); - this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new MustBlockSourceEffect())); - } + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new MustBlockSourceEffect())); + } - public PrizedUnicorn(final PrizedUnicorn card) { - super(card); - } + public PrizedUnicorn(final PrizedUnicorn card) { + super(card); + } - @Override - public PrizedUnicorn copy() { - return new PrizedUnicorn(this); - } + @Override + public PrizedUnicorn copy() { + return new PrizedUnicorn(this); + } } diff --git a/Mage.Sets/src/mage/sets/magic2010/ProdigalPyromancer.java b/Mage.Sets/src/mage/sets/magic2010/ProdigalPyromancer.java index c72879aad9..fd4db05bab 100644 --- a/Mage.Sets/src/mage/sets/magic2010/ProdigalPyromancer.java +++ b/Mage.Sets/src/mage/sets/magic2010/ProdigalPyromancer.java @@ -37,20 +37,20 @@ import mage.Constants.Rarity; */ public class ProdigalPyromancer extends mage.sets.tenth.ProdigalPyromancer { - public ProdigalPyromancer(UUID ownerId) { - super(ownerId); - this.cardNumber = 151; - this.expansionSetCode = "M10"; - this.rarity = Rarity.UNCOMMON; - } + public ProdigalPyromancer(UUID ownerId) { + super(ownerId); + this.cardNumber = 151; + this.expansionSetCode = "M10"; + this.rarity = Rarity.UNCOMMON; + } - public ProdigalPyromancer(final ProdigalPyromancer card) { - super(card); - } + public ProdigalPyromancer(final ProdigalPyromancer card) { + super(card); + } - @Override - public ProdigalPyromancer copy() { - return new ProdigalPyromancer(this); - } + @Override + public ProdigalPyromancer copy() { + return new ProdigalPyromancer(this); + } } \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/magic2010/ProteanHydra.java b/Mage.Sets/src/mage/sets/magic2010/ProteanHydra.java index 594d4e330c..f36caf596b 100644 --- a/Mage.Sets/src/mage/sets/magic2010/ProteanHydra.java +++ b/Mage.Sets/src/mage/sets/magic2010/ProteanHydra.java @@ -56,42 +56,42 @@ import java.util.UUID; */ public class ProteanHydra extends CardImpl { - public ProteanHydra(UUID ownerId) { - super(ownerId, 200, "Protean Hydra", Rarity.MYTHIC, new CardType[]{CardType.CREATURE}, "{X}{G}"); - this.expansionSetCode = "M10"; - this.subtype.add("Hydra"); - this.color.setGreen(true); - this.power = new MageInt(0); - this.toughness = new MageInt(0); + public ProteanHydra(UUID ownerId) { + super(ownerId, 200, "Protean Hydra", Rarity.MYTHIC, new CardType[]{CardType.CREATURE}, "{X}{G}"); + this.expansionSetCode = "M10"; + this.subtype.add("Hydra"); + this.color.setGreen(true); + this.power = new MageInt(0); + this.toughness = new MageInt(0); - this.addAbility(new EntersBattlefieldAbility(new ProteanHydraEffect1(), "with X +1/+1 counters on it")); - this.addAbility(new ProteanHydraAbility()); - this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new ProteanHydraEffect2())); - } + this.addAbility(new EntersBattlefieldAbility(new ProteanHydraEffect1(), "with X +1/+1 counters on it")); + this.addAbility(new ProteanHydraAbility()); + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new ProteanHydraEffect2())); + } - public ProteanHydra(final ProteanHydra card) { - super(card); - } + public ProteanHydra(final ProteanHydra card) { + super(card); + } - @Override - public ProteanHydra copy() { - return new ProteanHydra(this); - } + @Override + public ProteanHydra copy() { + return new ProteanHydra(this); + } - class ProteanHydraEffect1 extends OneShotEffect { + class ProteanHydraEffect1 extends OneShotEffect { - public ProteanHydraEffect1() { - super(Outcome.BoostCreature); - staticText = "{this} enters the battlefield with X +1/+1 counters on it"; - } + public ProteanHydraEffect1() { + super(Outcome.BoostCreature); + staticText = "{this} enters the battlefield with X +1/+1 counters on it"; + } - public ProteanHydraEffect1(final ProteanHydraEffect1 effect) { - super(effect); - } + public ProteanHydraEffect1(final ProteanHydraEffect1 effect) { + super(effect); + } - @Override - public boolean apply(Game game, Ability source) { - Permanent permanent = game.getPermanent(source.getSourceId()); + @Override + public boolean apply(Game game, Ability source) { + Permanent permanent = game.getPermanent(source.getSourceId()); if (permanent != null) { Object obj = getValue(EntersBattlefieldEffect.SOURCE_CAST_SPELL_ABILITY); if (obj != null && obj instanceof SpellAbility) { @@ -101,123 +101,123 @@ public class ProteanHydra extends CardImpl { } } } - return true; - } + return true; + } - @Override - public ProteanHydraEffect1 copy() { - return new ProteanHydraEffect1(this); - } + @Override + public ProteanHydraEffect1 copy() { + return new ProteanHydraEffect1(this); + } - } + } - class ProteanHydraEffect2 extends PreventionEffectImpl { + class ProteanHydraEffect2 extends PreventionEffectImpl { - public ProteanHydraEffect2() { - super(Duration.WhileOnBattlefield); - } + public ProteanHydraEffect2() { + super(Duration.WhileOnBattlefield); + } - public ProteanHydraEffect2(final ProteanHydraEffect2 effect) { - super(effect); - staticText = "If damage would be dealt to {this}, prevent that damage and remove that many +1/+1 counters from it"; - } + public ProteanHydraEffect2(final ProteanHydraEffect2 effect) { + super(effect); + staticText = "If damage would be dealt to {this}, prevent that damage and remove that many +1/+1 counters from it"; + } - @Override - public ProteanHydraEffect2 copy() { - return new ProteanHydraEffect2(this); - } + @Override + public ProteanHydraEffect2 copy() { + return new ProteanHydraEffect2(this); + } - @Override - public boolean apply(Game game, Ability source) { - return true; - } + @Override + public boolean apply(Game game, Ability source) { + return true; + } - @Override - public boolean replaceEvent(GameEvent event, Ability source, Game game) { - boolean retValue = false; - GameEvent preventEvent = new GameEvent(GameEvent.EventType.PREVENT_DAMAGE, source.getFirstTarget(), source.getId(), source.getControllerId(), event.getAmount(), false); - int damage = event.getAmount(); - if (!game.replaceEvent(preventEvent)) { - event.setAmount(0); - game.fireEvent(GameEvent.getEvent(GameEvent.EventType.PREVENTED_DAMAGE, source.getFirstTarget(), source.getId(), source.getControllerId(), damage)); - retValue = true; - } - Permanent permanent = game.getPermanent(source.getSourceId()); - if (permanent != null) { - permanent.removeCounters(CounterType.P1P1.createInstance(damage), game); - } - return retValue; - } + @Override + public boolean replaceEvent(GameEvent event, Ability source, Game game) { + boolean retValue = false; + GameEvent preventEvent = new GameEvent(GameEvent.EventType.PREVENT_DAMAGE, source.getFirstTarget(), source.getId(), source.getControllerId(), event.getAmount(), false); + int damage = event.getAmount(); + if (!game.replaceEvent(preventEvent)) { + event.setAmount(0); + game.fireEvent(GameEvent.getEvent(GameEvent.EventType.PREVENTED_DAMAGE, source.getFirstTarget(), source.getId(), source.getControllerId(), damage)); + retValue = true; + } + Permanent permanent = game.getPermanent(source.getSourceId()); + if (permanent != null) { + permanent.removeCounters(CounterType.P1P1.createInstance(damage), game); + } + return retValue; + } - @Override - public boolean applies(GameEvent event, Ability source, Game game) { - if (super.applies(event, source, game)) { - if (event.getTargetId().equals(source.getSourceId())) { - return true; - } - } - return false; - } + @Override + public boolean applies(GameEvent event, Ability source, Game game) { + if (super.applies(event, source, game)) { + if (event.getTargetId().equals(source.getSourceId())) { + return true; + } + } + return false; + } - } + } - class ProteanHydraAbility extends TriggeredAbilityImpl { + class ProteanHydraAbility extends TriggeredAbilityImpl { - public ProteanHydraAbility() { - super(Zone.BATTLEFIELD, new CreateDelayedTriggeredAbilityEffect(new ProteanHydraDelayedTriggeredAbility()), false); - } + public ProteanHydraAbility() { + super(Zone.BATTLEFIELD, new CreateDelayedTriggeredAbilityEffect(new ProteanHydraDelayedTriggeredAbility()), false); + } - public ProteanHydraAbility(final ProteanHydraAbility ability) { - super(ability); - } + public ProteanHydraAbility(final ProteanHydraAbility ability) { + super(ability); + } - @Override - public ProteanHydraAbility copy() { - return new ProteanHydraAbility(this); - } + @Override + public ProteanHydraAbility copy() { + return new ProteanHydraAbility(this); + } - @Override - public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == EventType.COUNTER_REMOVED && event.getData().equals("+1/+1") && event.getTargetId().equals(this.getSourceId())) { - return true; - } - return false; - } + @Override + public boolean checkTrigger(GameEvent event, Game game) { + if (event.getType() == EventType.COUNTER_REMOVED && event.getData().equals("+1/+1") && event.getTargetId().equals(this.getSourceId())) { + return true; + } + return false; + } - @Override - public String getRule() { - return "Whenever a +1/+1 counter is removed from {this}, put two +1/+1 counters on it at the beginning of the next end step."; - } + @Override + public String getRule() { + return "Whenever a +1/+1 counter is removed from {this}, put two +1/+1 counters on it at the beginning of the next end step."; + } - } + } - class ProteanHydraDelayedTriggeredAbility extends DelayedTriggeredAbility { + class ProteanHydraDelayedTriggeredAbility extends DelayedTriggeredAbility { - public ProteanHydraDelayedTriggeredAbility() { - super(new AddCountersSourceEffect(CounterType.P1P1.createInstance(2))); - } + public ProteanHydraDelayedTriggeredAbility() { + super(new AddCountersSourceEffect(CounterType.P1P1.createInstance(2))); + } - public ProteanHydraDelayedTriggeredAbility(final ProteanHydraDelayedTriggeredAbility ability) { - super(ability); - } + public ProteanHydraDelayedTriggeredAbility(final ProteanHydraDelayedTriggeredAbility ability) { + super(ability); + } - @Override - public ProteanHydraDelayedTriggeredAbility copy() { - return new ProteanHydraDelayedTriggeredAbility(this); - } + @Override + public ProteanHydraDelayedTriggeredAbility copy() { + return new ProteanHydraDelayedTriggeredAbility(this); + } - @Override - public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == EventType.END_TURN_STEP_PRE) { - return true; - } - return false; - } + @Override + public boolean checkTrigger(GameEvent event, Game game) { + if (event.getType() == EventType.END_TURN_STEP_PRE) { + return true; + } + return false; + } - @Override - public String getRule() { - return "Put two +1/+1 counters on {this} at the beginning of the next end step"; - } + @Override + public String getRule() { + return "Put two +1/+1 counters on {this} at the beginning of the next end step"; + } - } + } } diff --git a/Mage.Sets/src/mage/sets/magic2010/Pyroclasm.java b/Mage.Sets/src/mage/sets/magic2010/Pyroclasm.java index ce870b06a5..3425a17d0b 100644 --- a/Mage.Sets/src/mage/sets/magic2010/Pyroclasm.java +++ b/Mage.Sets/src/mage/sets/magic2010/Pyroclasm.java @@ -36,19 +36,19 @@ import java.util.UUID; */ public class Pyroclasm extends mage.sets.tenth.Pyroclasm { - public Pyroclasm(UUID ownerId) { - super(ownerId); - this.cardNumber = 152; - this.expansionSetCode = "M10"; - } + public Pyroclasm(UUID ownerId) { + super(ownerId); + this.cardNumber = 152; + this.expansionSetCode = "M10"; + } - public Pyroclasm(final Pyroclasm card) { - super(card); - } + public Pyroclasm(final Pyroclasm card) { + super(card); + } - @Override - public Pyroclasm copy() { - return new Pyroclasm(this); - } + @Override + public Pyroclasm copy() { + return new Pyroclasm(this); + } } \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/magic2010/RampantGrowth.java b/Mage.Sets/src/mage/sets/magic2010/RampantGrowth.java index 729b21c495..30fcda5cf4 100644 --- a/Mage.Sets/src/mage/sets/magic2010/RampantGrowth.java +++ b/Mage.Sets/src/mage/sets/magic2010/RampantGrowth.java @@ -42,20 +42,20 @@ import mage.target.common.TargetCardInLibrary; */ public class RampantGrowth extends CardImpl { - public RampantGrowth(UUID ownerId){ - super(ownerId, 201, "Rampant Growth", Rarity.COMMON, new CardType[]{CardType.SORCERY}, "{1}{G}"); - this.expansionSetCode = "M10"; - this.color.setGreen(true); - TargetCardInLibrary target = new TargetCardInLibrary(new FilterBasicLandCard()); - this.getSpellAbility().addEffect(new SearchLibraryPutInPlayEffect(target, true)); - } + public RampantGrowth(UUID ownerId){ + super(ownerId, 201, "Rampant Growth", Rarity.COMMON, new CardType[]{CardType.SORCERY}, "{1}{G}"); + this.expansionSetCode = "M10"; + this.color.setGreen(true); + TargetCardInLibrary target = new TargetCardInLibrary(new FilterBasicLandCard()); + this.getSpellAbility().addEffect(new SearchLibraryPutInPlayEffect(target, true)); + } - public RampantGrowth(final RampantGrowth card) { - super(card); - } + public RampantGrowth(final RampantGrowth card) { + super(card); + } - @Override - public RampantGrowth copy() { - return new RampantGrowth(this); - } + @Override + public RampantGrowth copy() { + return new RampantGrowth(this); + } } diff --git a/Mage.Sets/src/mage/sets/magic2010/RelentlessRats.java b/Mage.Sets/src/mage/sets/magic2010/RelentlessRats.java index 6ad261eabe..e8fbc69396 100644 --- a/Mage.Sets/src/mage/sets/magic2010/RelentlessRats.java +++ b/Mage.Sets/src/mage/sets/magic2010/RelentlessRats.java @@ -36,19 +36,19 @@ import java.util.UUID; */ public class RelentlessRats extends mage.sets.tenth.RelentlessRats { - public RelentlessRats(UUID ownerId) { - super(ownerId); - this.cardNumber = 108; - this.expansionSetCode = "M10"; - } + public RelentlessRats(UUID ownerId) { + super(ownerId); + this.cardNumber = 108; + this.expansionSetCode = "M10"; + } - public RelentlessRats(final RelentlessRats card) { - super(card); - } + public RelentlessRats(final RelentlessRats card) { + super(card); + } - @Override - public RelentlessRats copy() { - return new RelentlessRats(this); - } + @Override + public RelentlessRats copy() { + return new RelentlessRats(this); + } } \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/magic2010/RiseFromTheGrave.java b/Mage.Sets/src/mage/sets/magic2010/RiseFromTheGrave.java index 33e3e8a6bf..ac1a6cb668 100644 --- a/Mage.Sets/src/mage/sets/magic2010/RiseFromTheGrave.java +++ b/Mage.Sets/src/mage/sets/magic2010/RiseFromTheGrave.java @@ -50,72 +50,72 @@ import mage.target.common.TargetCardInGraveyard; */ public class RiseFromTheGrave extends CardImpl { - public RiseFromTheGrave(UUID ownerId) { - super(ownerId, 109, "Rise from the Grave", Rarity.UNCOMMON, new CardType[]{CardType.SORCERY}, "{4}{B}"); - this.expansionSetCode = "M10"; - this.color.setBlack(true); - this.getSpellAbility().addTarget(new TargetCardInGraveyard(new FilterCreatureCard("creature card from a graveyard"))); - this.getSpellAbility().addEffect(new ReturnFromGraveyardToBattlefieldTargetEffect()); - this.getSpellAbility().addEffect(new RiseFromTheGraveEffect()); - } + public RiseFromTheGrave(UUID ownerId) { + super(ownerId, 109, "Rise from the Grave", Rarity.UNCOMMON, new CardType[]{CardType.SORCERY}, "{4}{B}"); + this.expansionSetCode = "M10"; + this.color.setBlack(true); + this.getSpellAbility().addTarget(new TargetCardInGraveyard(new FilterCreatureCard("creature card from a graveyard"))); + this.getSpellAbility().addEffect(new ReturnFromGraveyardToBattlefieldTargetEffect()); + this.getSpellAbility().addEffect(new RiseFromTheGraveEffect()); + } - public RiseFromTheGrave(final RiseFromTheGrave card) { - super(card); - } + public RiseFromTheGrave(final RiseFromTheGrave card) { + super(card); + } - @Override - public RiseFromTheGrave copy() { - return new RiseFromTheGrave(this); - } + @Override + public RiseFromTheGrave copy() { + return new RiseFromTheGrave(this); + } } class RiseFromTheGraveEffect extends ContinuousEffectImpl { - public RiseFromTheGraveEffect() { - super(Duration.Custom, Outcome.Neutral); - staticText = "That creature is a black Zombie in addition to its other colors and types"; - } + public RiseFromTheGraveEffect() { + super(Duration.Custom, Outcome.Neutral); + staticText = "That creature is a black Zombie in addition to its other colors and types"; + } - public RiseFromTheGraveEffect(final RiseFromTheGraveEffect effect) { - super(effect); - } + public RiseFromTheGraveEffect(final RiseFromTheGraveEffect effect) { + super(effect); + } - @Override - public RiseFromTheGraveEffect copy() { - return new RiseFromTheGraveEffect(this); - } + @Override + public RiseFromTheGraveEffect copy() { + return new RiseFromTheGraveEffect(this); + } - @Override - public boolean apply(Layer layer, SubLayer sublayer, Ability source, Game game) { - Permanent creature = game.getPermanent(source.getFirstTarget()); - if (creature != null) { - switch (layer) { - case TypeChangingEffects_4: - if (sublayer == SubLayer.NA) { - creature.getSubtype().add("Zombie"); - } - break; - case ColorChangingEffects_5: - if (sublayer == SubLayer.NA) { - creature.getColor().setBlack(true); - } - break; - } - return true; - } else { + @Override + public boolean apply(Layer layer, SubLayer sublayer, Ability source, Game game) { + Permanent creature = game.getPermanent(source.getFirstTarget()); + if (creature != null) { + switch (layer) { + case TypeChangingEffects_4: + if (sublayer == SubLayer.NA) { + creature.getSubtype().add("Zombie"); + } + break; + case ColorChangingEffects_5: + if (sublayer == SubLayer.NA) { + creature.getColor().setBlack(true); + } + break; + } + return true; + } else { this.used = true; } - return false; - } + return false; + } - @Override - public boolean apply(Game game, Ability source) { - return false; - } + @Override + public boolean apply(Game game, Ability source) { + return false; + } - @Override - public boolean hasLayer(Layer layer) { - return layer == Layer.ColorChangingEffects_5 || layer == Layer.TypeChangingEffects_4; - } + @Override + public boolean hasLayer(Layer layer) { + return layer == Layer.ColorChangingEffects_5 || layer == Layer.TypeChangingEffects_4; + } } \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/magic2010/RootboundCrag.java b/Mage.Sets/src/mage/sets/magic2010/RootboundCrag.java index 8196a95ffc..9d6bff218b 100644 --- a/Mage.Sets/src/mage/sets/magic2010/RootboundCrag.java +++ b/Mage.Sets/src/mage/sets/magic2010/RootboundCrag.java @@ -49,32 +49,32 @@ import mage.filter.common.FilterLandPermanent; */ public class RootboundCrag extends CardImpl { - private static final FilterLandPermanent filter = new FilterLandPermanent(); + private static final FilterLandPermanent filter = new FilterLandPermanent(); - static { - filter.getSubtype().add("Mountain"); - filter.getSubtype().add("Forest"); - filter.setScopeSubtype(ComparisonScope.Any); - filter.setMessage("Mountain or a Forest"); - } + static { + filter.getSubtype().add("Mountain"); + filter.getSubtype().add("Forest"); + filter.setScopeSubtype(ComparisonScope.Any); + filter.setMessage("Mountain or a Forest"); + } - public RootboundCrag(UUID ownerId) { - super(ownerId, 227, "Rootbound Crag", Rarity.RARE, new CardType[]{CardType.LAND}, null); - this.expansionSetCode = "M10"; + public RootboundCrag(UUID ownerId) { + super(ownerId, 227, "Rootbound Crag", Rarity.RARE, new CardType[]{CardType.LAND}, null); + this.expansionSetCode = "M10"; - Condition controls = new UnlessCondition(new ControlsPermanentCondition(filter, ControlsPermanentCondition.CountType.MORE_THAN, 0)); - String abilityText = "tap it unless you control a " + filter.getMessage(); - this.addAbility(new EntersBattlefieldAbility(new ConditionalOneShotEffect(new TapSourceEffect(), controls, abilityText), abilityText)); - this.addAbility(new RedManaAbility()); - this.addAbility(new GreenManaAbility()); - } + Condition controls = new UnlessCondition(new ControlsPermanentCondition(filter, ControlsPermanentCondition.CountType.MORE_THAN, 0)); + String abilityText = "tap it unless you control a " + filter.getMessage(); + this.addAbility(new EntersBattlefieldAbility(new ConditionalOneShotEffect(new TapSourceEffect(), controls, abilityText), abilityText)); + this.addAbility(new RedManaAbility()); + this.addAbility(new GreenManaAbility()); + } - public RootboundCrag(final RootboundCrag card) { - super(card); - } + public RootboundCrag(final RootboundCrag card) { + super(card); + } - @Override - public RootboundCrag copy() { - return new RootboundCrag(this); - } + @Override + public RootboundCrag copy() { + return new RootboundCrag(this); + } } diff --git a/Mage.Sets/src/mage/sets/magic2010/RoyalAssassin.java b/Mage.Sets/src/mage/sets/magic2010/RoyalAssassin.java index 0333444cc1..45ded14f15 100644 --- a/Mage.Sets/src/mage/sets/magic2010/RoyalAssassin.java +++ b/Mage.Sets/src/mage/sets/magic2010/RoyalAssassin.java @@ -36,19 +36,19 @@ import java.util.UUID; */ public class RoyalAssassin extends mage.sets.tenth.RoyalAssassin { - public RoyalAssassin(UUID ownerId) { - super(ownerId); - this.cardNumber = 110; - this.expansionSetCode = "M10"; - } + public RoyalAssassin(UUID ownerId) { + super(ownerId); + this.cardNumber = 110; + this.expansionSetCode = "M10"; + } - public RoyalAssassin(final RoyalAssassin card) { - super(card); - } + public RoyalAssassin(final RoyalAssassin card) { + super(card); + } - @Override - public RoyalAssassin copy() { - return new RoyalAssassin(this); - } + @Override + public RoyalAssassin copy() { + return new RoyalAssassin(this); + } } \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/magic2010/RuneclawBear.java b/Mage.Sets/src/mage/sets/magic2010/RuneclawBear.java index e678c3e5ed..c93e4f455a 100644 --- a/Mage.Sets/src/mage/sets/magic2010/RuneclawBear.java +++ b/Mage.Sets/src/mage/sets/magic2010/RuneclawBear.java @@ -40,23 +40,23 @@ import mage.cards.CardImpl; */ public class RuneclawBear extends CardImpl { - public RuneclawBear(UUID ownerId) { - super(ownerId, 203, "Runeclaw Bear", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{1}{G}"); - this.expansionSetCode = "M10"; - this.subtype.add("Bear"); - this.color.setGreen(true); - this.power = new MageInt(2); - this.toughness = new MageInt(2); + public RuneclawBear(UUID ownerId) { + super(ownerId, 203, "Runeclaw Bear", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{1}{G}"); + this.expansionSetCode = "M10"; + this.subtype.add("Bear"); + this.color.setGreen(true); + this.power = new MageInt(2); + this.toughness = new MageInt(2); - } + } - public RuneclawBear(final RuneclawBear card) { - super(card); - } + public RuneclawBear(final RuneclawBear card) { + super(card); + } - @Override - public RuneclawBear copy() { - return new RuneclawBear(this); - } + @Override + public RuneclawBear copy() { + return new RuneclawBear(this); + } } diff --git a/Mage.Sets/src/mage/sets/magic2010/SafePassage.java b/Mage.Sets/src/mage/sets/magic2010/SafePassage.java index 947cbca964..100dec4d41 100644 --- a/Mage.Sets/src/mage/sets/magic2010/SafePassage.java +++ b/Mage.Sets/src/mage/sets/magic2010/SafePassage.java @@ -43,27 +43,27 @@ import mage.filter.common.FilterCreatureOrPlayer; */ public class SafePassage extends CardImpl { - private static final FilterCreatureOrPlayer filter = new FilterCreatureOrPlayer("you and creatures you control"); + private static final FilterCreatureOrPlayer filter = new FilterCreatureOrPlayer("you and creatures you control"); - static { - filter.getCreatureFilter().setTargetController(TargetController.YOU); - filter.getPlayerFilter().setPlayerTarget(TargetController.YOU); - } + static { + filter.getCreatureFilter().setTargetController(TargetController.YOU); + filter.getPlayerFilter().setPlayerTarget(TargetController.YOU); + } - public SafePassage(UUID ownerId) { - super(ownerId, 28, "Safe Passage", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{2}{W}"); - this.expansionSetCode = "M10"; - this.color.setWhite(true); - this.getSpellAbility().addEffect(new PreventAllDamageToEffect(Duration.EndOfTurn, filter)); - } + public SafePassage(UUID ownerId) { + super(ownerId, 28, "Safe Passage", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{2}{W}"); + this.expansionSetCode = "M10"; + this.color.setWhite(true); + this.getSpellAbility().addEffect(new PreventAllDamageToEffect(Duration.EndOfTurn, filter)); + } - public SafePassage(final SafePassage card) { - super(card); - } + public SafePassage(final SafePassage card) { + super(card); + } - @Override - public SafePassage copy() { - return new SafePassage(this); - } + @Override + public SafePassage copy() { + return new SafePassage(this); + } } diff --git a/Mage.Sets/src/mage/sets/magic2010/SerraAngel.java b/Mage.Sets/src/mage/sets/magic2010/SerraAngel.java index d886d5b74b..4b27e76e01 100644 --- a/Mage.Sets/src/mage/sets/magic2010/SerraAngel.java +++ b/Mage.Sets/src/mage/sets/magic2010/SerraAngel.java @@ -37,20 +37,20 @@ import mage.Constants.Rarity; */ public class SerraAngel extends mage.sets.tenth.SerraAngel { - public SerraAngel(UUID ownerId) { - super(ownerId); - this.rarity = Rarity.UNCOMMON; - this.cardNumber = 29; - this.expansionSetCode = "M10"; - } + public SerraAngel(UUID ownerId) { + super(ownerId); + this.rarity = Rarity.UNCOMMON; + this.cardNumber = 29; + this.expansionSetCode = "M10"; + } - public SerraAngel(final SerraAngel card) { - super(card); - } + public SerraAngel(final SerraAngel card) { + super(card); + } - @Override - public SerraAngel copy() { - return new SerraAngel(this); - } + @Override + public SerraAngel copy() { + return new SerraAngel(this); + } } \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/magic2010/SiegeMastodon.java b/Mage.Sets/src/mage/sets/magic2010/SiegeMastodon.java index 62795f43d2..76a404007e 100644 --- a/Mage.Sets/src/mage/sets/magic2010/SiegeMastodon.java +++ b/Mage.Sets/src/mage/sets/magic2010/SiegeMastodon.java @@ -40,23 +40,23 @@ import mage.cards.CardImpl; */ public class SiegeMastodon extends CardImpl { - public SiegeMastodon(UUID ownerId) { - super(ownerId, 30, "Siege Mastodon", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{4}{W}"); - this.expansionSetCode = "M10"; - this.subtype.add("Elephant"); - this.color.setWhite(true); - this.power = new MageInt(3); - this.toughness = new MageInt(5); + public SiegeMastodon(UUID ownerId) { + super(ownerId, 30, "Siege Mastodon", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{4}{W}"); + this.expansionSetCode = "M10"; + this.subtype.add("Elephant"); + this.color.setWhite(true); + this.power = new MageInt(3); + this.toughness = new MageInt(5); - } + } - public SiegeMastodon(final SiegeMastodon card) { - super(card); - } + public SiegeMastodon(final SiegeMastodon card) { + super(card); + } - @Override - public SiegeMastodon copy() { - return new SiegeMastodon(this); - } + @Override + public SiegeMastodon copy() { + return new SiegeMastodon(this); + } } diff --git a/Mage.Sets/src/mage/sets/magic2010/SignInBlood.java b/Mage.Sets/src/mage/sets/magic2010/SignInBlood.java index 4b0796d68b..b2ee16badd 100644 --- a/Mage.Sets/src/mage/sets/magic2010/SignInBlood.java +++ b/Mage.Sets/src/mage/sets/magic2010/SignInBlood.java @@ -42,21 +42,21 @@ import mage.target.TargetPlayer; */ public class SignInBlood extends CardImpl { - public SignInBlood(UUID ownerId) { - super(ownerId, 112, "Sign in Blood", Rarity.COMMON, new CardType[]{CardType.SORCERY}, "{B}{B}"); - this.expansionSetCode = "M10"; - this.color.setBlack(true); - this.getSpellAbility().addTarget(new TargetPlayer()); - this.getSpellAbility().addEffect(new DrawCardTargetEffect(2)); - this.getSpellAbility().addEffect(new LoseLifeTargetEffect(2)); - } + public SignInBlood(UUID ownerId) { + super(ownerId, 112, "Sign in Blood", Rarity.COMMON, new CardType[]{CardType.SORCERY}, "{B}{B}"); + this.expansionSetCode = "M10"; + this.color.setBlack(true); + this.getSpellAbility().addTarget(new TargetPlayer()); + this.getSpellAbility().addEffect(new DrawCardTargetEffect(2)); + this.getSpellAbility().addEffect(new LoseLifeTargetEffect(2)); + } - public SignInBlood(final SignInBlood card) { - super(card); - } + public SignInBlood(final SignInBlood card) { + super(card); + } - @Override - public SignInBlood copy() { - return new SignInBlood(this); - } + @Override + public SignInBlood copy() { + return new SignInBlood(this); + } } diff --git a/Mage.Sets/src/mage/sets/magic2010/Silence.java b/Mage.Sets/src/mage/sets/magic2010/Silence.java index 7266026fe1..20359ed953 100644 --- a/Mage.Sets/src/mage/sets/magic2010/Silence.java +++ b/Mage.Sets/src/mage/sets/magic2010/Silence.java @@ -46,55 +46,55 @@ import mage.game.events.GameEvent.EventType; */ public class Silence extends CardImpl { - public Silence(UUID ownerId) { - super(ownerId, 31, "Silence", Rarity.RARE, new CardType[]{CardType.INSTANT}, "{W}"); - this.expansionSetCode = "M10"; - this.color.setWhite(true); - this.getSpellAbility().addEffect(new SilenceEffect()); - } + public Silence(UUID ownerId) { + super(ownerId, 31, "Silence", Rarity.RARE, new CardType[]{CardType.INSTANT}, "{W}"); + this.expansionSetCode = "M10"; + this.color.setWhite(true); + this.getSpellAbility().addEffect(new SilenceEffect()); + } - public Silence(final Silence card) { - super(card); - } + public Silence(final Silence card) { + super(card); + } - @Override - public Silence copy() { - return new Silence(this); - } + @Override + public Silence copy() { + return new Silence(this); + } } class SilenceEffect extends ReplacementEffectImpl { - public SilenceEffect() { - super(Duration.EndOfTurn, Outcome.Benefit); - staticText = "Your opponents can't cast spells this turn"; - } + public SilenceEffect() { + super(Duration.EndOfTurn, Outcome.Benefit); + staticText = "Your opponents can't cast spells this turn"; + } - public SilenceEffect(final SilenceEffect effect) { - super(effect); - } + public SilenceEffect(final SilenceEffect effect) { + super(effect); + } - @Override - public SilenceEffect copy() { - return new SilenceEffect(this); - } + @Override + public SilenceEffect copy() { + return new SilenceEffect(this); + } - @Override - public boolean apply(Game game, Ability source) { - return true; - } + @Override + public boolean apply(Game game, Ability source) { + return true; + } - @Override - public boolean replaceEvent(GameEvent event, Ability source, Game game) { - return true; - } + @Override + public boolean replaceEvent(GameEvent event, Ability source, Game game) { + return true; + } - @Override - public boolean applies(GameEvent event, Ability source, Game game) { - if (event.getType() == EventType.CAST_SPELL && game.getOpponents(source.getControllerId()).contains(event.getPlayerId())) { - return true; - } - return false; - } + @Override + public boolean applies(GameEvent event, Ability source, Game game) { + if (event.getType() == EventType.CAST_SPELL && game.getOpponents(source.getControllerId()).contains(event.getPlayerId())) { + return true; + } + return false; + } } diff --git a/Mage.Sets/src/mage/sets/magic2010/SilvercoatLion.java b/Mage.Sets/src/mage/sets/magic2010/SilvercoatLion.java index 712c9fe89e..af16d01e21 100644 --- a/Mage.Sets/src/mage/sets/magic2010/SilvercoatLion.java +++ b/Mage.Sets/src/mage/sets/magic2010/SilvercoatLion.java @@ -40,23 +40,23 @@ import mage.cards.CardImpl; */ public class SilvercoatLion extends CardImpl { - public SilvercoatLion(UUID ownerId) { - super(ownerId, 32, "Silvercoat Lion", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{1}{W}"); - this.expansionSetCode = "M10"; - this.subtype.add("Cat"); - this.color.setWhite(true); - this.power = new MageInt(2); - this.toughness = new MageInt(2); + public SilvercoatLion(UUID ownerId) { + super(ownerId, 32, "Silvercoat Lion", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{1}{W}"); + this.expansionSetCode = "M10"; + this.subtype.add("Cat"); + this.color.setWhite(true); + this.power = new MageInt(2); + this.toughness = new MageInt(2); - } + } - public SilvercoatLion(final SilvercoatLion card) { - super(card); - } + public SilvercoatLion(final SilvercoatLion card) { + super(card); + } - @Override - public SilvercoatLion copy() { - return new SilvercoatLion(this); - } + @Override + public SilvercoatLion copy() { + return new SilvercoatLion(this); + } } diff --git a/Mage.Sets/src/mage/sets/magic2010/Sleep.java b/Mage.Sets/src/mage/sets/magic2010/Sleep.java index 9d4110bfb8..a3860f9630 100644 --- a/Mage.Sets/src/mage/sets/magic2010/Sleep.java +++ b/Mage.Sets/src/mage/sets/magic2010/Sleep.java @@ -52,93 +52,93 @@ import mage.target.TargetPlayer; */ public class Sleep extends CardImpl { - public Sleep(UUID ownerId) { - super(ownerId, 71, "Sleep", Rarity.UNCOMMON, new CardType[]{CardType.SORCERY}, "{2}{U}{U}"); - this.expansionSetCode = "M10"; - this.color.setBlue(true); - this.getSpellAbility().addTarget(new TargetPlayer()); - this.getSpellAbility().addEffect(new SleepEffect()); - } + public Sleep(UUID ownerId) { + super(ownerId, 71, "Sleep", Rarity.UNCOMMON, new CardType[]{CardType.SORCERY}, "{2}{U}{U}"); + this.expansionSetCode = "M10"; + this.color.setBlue(true); + this.getSpellAbility().addTarget(new TargetPlayer()); + this.getSpellAbility().addEffect(new SleepEffect()); + } - public Sleep(final Sleep card) { - super(card); - } + public Sleep(final Sleep card) { + super(card); + } - @Override - public Sleep copy() { - return new Sleep(this); - } + @Override + public Sleep copy() { + return new Sleep(this); + } } class SleepEffect extends OneShotEffect { - public SleepEffect() { - super(Outcome.Tap); - staticText = "Tap all creatures target player controls. Those creatures don't untap during that player's next untap step"; - } + public SleepEffect() { + super(Outcome.Tap); + staticText = "Tap all creatures target player controls. Those creatures don't untap during that player's next untap step"; + } - public SleepEffect(final SleepEffect effect) { - super(effect); - } + public SleepEffect(final SleepEffect effect) { + super(effect); + } - @Override - public boolean apply(Game game, Ability source) { - Player player = game.getPlayer(source.getFirstTarget()); - if (player != null) { - for (Permanent creature: game.getBattlefield().getAllActivePermanents(new FilterCreaturePermanent(), player.getId(), game)) { - creature.tap(game); - game.addEffect(new SleepEffect2(creature.getId()), source); - } - return true; - } - return false; - } + @Override + public boolean apply(Game game, Ability source) { + Player player = game.getPlayer(source.getFirstTarget()); + if (player != null) { + for (Permanent creature: game.getBattlefield().getAllActivePermanents(new FilterCreaturePermanent(), player.getId(), game)) { + creature.tap(game); + game.addEffect(new SleepEffect2(creature.getId()), source); + } + return true; + } + return false; + } - @Override - public SleepEffect copy() { - return new SleepEffect(this); - } + @Override + public SleepEffect copy() { + return new SleepEffect(this); + } } class SleepEffect2 extends ReplacementEffectImpl { - protected UUID creatureId; + protected UUID creatureId; - public SleepEffect2(UUID creatureId) { - super(Duration.OneUse, Outcome.Detriment); - this.creatureId = creatureId; - } + public SleepEffect2(UUID creatureId) { + super(Duration.OneUse, Outcome.Detriment); + this.creatureId = creatureId; + } - public SleepEffect2(final SleepEffect2 effect) { - super(effect); - creatureId = effect.creatureId; - } + public SleepEffect2(final SleepEffect2 effect) { + super(effect); + creatureId = effect.creatureId; + } - @Override - public SleepEffect2 copy() { - return new SleepEffect2(this); - } + @Override + public SleepEffect2 copy() { + return new SleepEffect2(this); + } - @Override - public boolean apply(Game game, Ability source) { - return false; - } + @Override + public boolean apply(Game game, Ability source) { + return false; + } - @Override - public boolean replaceEvent(GameEvent event, Ability source, Game game) { - used = true; - return true; - } + @Override + public boolean replaceEvent(GameEvent event, Ability source, Game game) { + used = true; + return true; + } - @Override - public boolean applies(GameEvent event, Ability source, Game game) { - if (game.getTurn().getStepType() == PhaseStep.UNTAP && - event.getType() == EventType.UNTAP && - event.getTargetId().equals(creatureId)) { - return true; - } - return false; - } + @Override + public boolean applies(GameEvent event, Ability source, Game game) { + if (game.getTurn().getStepType() == PhaseStep.UNTAP && + event.getType() == EventType.UNTAP && + event.getTargetId().equals(creatureId)) { + return true; + } + return false; + } } diff --git a/Mage.Sets/src/mage/sets/magic2010/SolemnOffering.java b/Mage.Sets/src/mage/sets/magic2010/SolemnOffering.java index 3b1781ed80..b700cb45cc 100644 --- a/Mage.Sets/src/mage/sets/magic2010/SolemnOffering.java +++ b/Mage.Sets/src/mage/sets/magic2010/SolemnOffering.java @@ -44,29 +44,29 @@ import mage.target.TargetPermanent; */ public class SolemnOffering extends CardImpl { - private static final FilterPermanent filter = new FilterPermanent("artifact or enchantment"); + private static final FilterPermanent filter = new FilterPermanent("artifact or enchantment"); - static { - filter.getCardType().add(CardType.ARTIFACT); - filter.getCardType().add(CardType.ENCHANTMENT); - filter.setScopeCardType(ComparisonScope.Any); - } + static { + filter.getCardType().add(CardType.ARTIFACT); + filter.getCardType().add(CardType.ENCHANTMENT); + filter.setScopeCardType(ComparisonScope.Any); + } - public SolemnOffering(UUID ownerId) { - super(ownerId, 33, "Solemn Offering", Rarity.COMMON, new CardType[]{CardType.SORCERY}, "{2}{W}"); - this.expansionSetCode = "M10"; - this.color.setWhite(true); - this.getSpellAbility().addTarget(new TargetPermanent(filter)); - this.getSpellAbility().addEffect(new DestroyTargetEffect()); - this.getSpellAbility().addEffect(new GainLifeEffect(4)); - } + public SolemnOffering(UUID ownerId) { + super(ownerId, 33, "Solemn Offering", Rarity.COMMON, new CardType[]{CardType.SORCERY}, "{2}{W}"); + this.expansionSetCode = "M10"; + this.color.setWhite(true); + this.getSpellAbility().addTarget(new TargetPermanent(filter)); + this.getSpellAbility().addEffect(new DestroyTargetEffect()); + this.getSpellAbility().addEffect(new GainLifeEffect(4)); + } - public SolemnOffering(final SolemnOffering card) { - super(card); - } + public SolemnOffering(final SolemnOffering card) { + super(card); + } - @Override - public SolemnOffering copy() { - return new SolemnOffering(this); - } + @Override + public SolemnOffering copy() { + return new SolemnOffering(this); + } } diff --git a/Mage.Sets/src/mage/sets/magic2010/SoulWarden.java b/Mage.Sets/src/mage/sets/magic2010/SoulWarden.java index e1958ffa36..79ff844242 100644 --- a/Mage.Sets/src/mage/sets/magic2010/SoulWarden.java +++ b/Mage.Sets/src/mage/sets/magic2010/SoulWarden.java @@ -49,57 +49,57 @@ import java.util.UUID; */ public class SoulWarden extends CardImpl { - public SoulWarden(UUID ownerId) { - super(ownerId, 34, "Soul Warden", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{W}"); - this.expansionSetCode = "M10"; - this.subtype.add("Human"); - this.subtype.add("Cleric"); - this.color.setWhite(true); - this.power = new MageInt(1); - this.toughness = new MageInt(1); - this.addAbility(new SoulWardenAbility()); - } + public SoulWarden(UUID ownerId) { + super(ownerId, 34, "Soul Warden", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{W}"); + this.expansionSetCode = "M10"; + this.subtype.add("Human"); + this.subtype.add("Cleric"); + this.color.setWhite(true); + this.power = new MageInt(1); + this.toughness = new MageInt(1); + this.addAbility(new SoulWardenAbility()); + } - public SoulWarden(final SoulWarden card) { - super(card); - } + public SoulWarden(final SoulWarden card) { + super(card); + } - @Override - public SoulWarden copy() { - return new SoulWarden(this); - } + @Override + public SoulWarden copy() { + return new SoulWarden(this); + } } class SoulWardenAbility extends TriggeredAbilityImpl { - public SoulWardenAbility() { - super(Zone.BATTLEFIELD, new GainLifeEffect(1)); - } + public SoulWardenAbility() { + super(Zone.BATTLEFIELD, new GainLifeEffect(1)); + } - public SoulWardenAbility(final SoulWardenAbility ability) { - super(ability); - } + public SoulWardenAbility(final SoulWardenAbility ability) { + super(ability); + } - @Override - public SoulWardenAbility copy() { - return new SoulWardenAbility(this); - } + @Override + public SoulWardenAbility copy() { + return new SoulWardenAbility(this); + } - @Override - public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == EventType.ZONE_CHANGE && ((ZoneChangeEvent)event).getToZone() == Zone.BATTLEFIELD) { - Permanent permanent = game.getPermanent(event.getTargetId()); + @Override + public boolean checkTrigger(GameEvent event, Game game) { + if (event.getType() == EventType.ZONE_CHANGE && ((ZoneChangeEvent)event).getToZone() == Zone.BATTLEFIELD) { + Permanent permanent = game.getPermanent(event.getTargetId()); if (permanent.getCardType().contains(CardType.CREATURE) && !permanent.getId().equals(this.getSourceId())) { - return true; - } - } - return false; - } + return true; + } + } + return false; + } - @Override - public String getRule() { - return "Whenever another creature enters the battlefield, " + super.getRule(); - } + @Override + public String getRule() { + return "Whenever another creature enters the battlefield, " + super.getRule(); + } } diff --git a/Mage.Sets/src/mage/sets/magic2010/StormfrontPegasus.java b/Mage.Sets/src/mage/sets/magic2010/StormfrontPegasus.java index cc6603a41c..4cec85e6cd 100644 --- a/Mage.Sets/src/mage/sets/magic2010/StormfrontPegasus.java +++ b/Mage.Sets/src/mage/sets/magic2010/StormfrontPegasus.java @@ -41,24 +41,24 @@ import mage.cards.CardImpl; */ public class StormfrontPegasus extends CardImpl { - public StormfrontPegasus(UUID ownerId) { - super(ownerId, 35, "Stormfront Pegasus", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{1}{W}"); - this.expansionSetCode = "M10"; - this.subtype.add("Pegasus"); - this.color.setWhite(true); - this.power = new MageInt(2); - this.toughness = new MageInt(1); + public StormfrontPegasus(UUID ownerId) { + super(ownerId, 35, "Stormfront Pegasus", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{1}{W}"); + this.expansionSetCode = "M10"; + this.subtype.add("Pegasus"); + this.color.setWhite(true); + this.power = new MageInt(2); + this.toughness = new MageInt(1); - this.addAbility(FlyingAbility.getInstance()); - } + this.addAbility(FlyingAbility.getInstance()); + } - public StormfrontPegasus(final StormfrontPegasus card) { - super(card); - } + public StormfrontPegasus(final StormfrontPegasus card) { + super(card); + } - @Override - public StormfrontPegasus copy() { - return new StormfrontPegasus(this); - } + @Override + public StormfrontPegasus copy() { + return new StormfrontPegasus(this); + } } diff --git a/Mage.Sets/src/mage/sets/magic2010/SunpetalGrove.java b/Mage.Sets/src/mage/sets/magic2010/SunpetalGrove.java index ad60b4cc4d..d70ca1e04b 100644 --- a/Mage.Sets/src/mage/sets/magic2010/SunpetalGrove.java +++ b/Mage.Sets/src/mage/sets/magic2010/SunpetalGrove.java @@ -49,32 +49,32 @@ import mage.filter.common.FilterLandPermanent; */ public class SunpetalGrove extends CardImpl { - private static final FilterLandPermanent filter = new FilterLandPermanent(); + private static final FilterLandPermanent filter = new FilterLandPermanent(); - static { - filter.getSubtype().add("Forest"); - filter.getSubtype().add("Plains"); - filter.setScopeSubtype(ComparisonScope.Any); - filter.setMessage("Forest or a Plains"); - } + static { + filter.getSubtype().add("Forest"); + filter.getSubtype().add("Plains"); + filter.setScopeSubtype(ComparisonScope.Any); + filter.setMessage("Forest or a Plains"); + } - public SunpetalGrove(UUID ownerId) { - super(ownerId, 228, "Sunpetal Grove", Rarity.RARE, new CardType[]{CardType.LAND}, null); - this.expansionSetCode = "M10"; + public SunpetalGrove(UUID ownerId) { + super(ownerId, 228, "Sunpetal Grove", Rarity.RARE, new CardType[]{CardType.LAND}, null); + this.expansionSetCode = "M10"; - Condition controls = new UnlessCondition(new ControlsPermanentCondition(filter, ControlsPermanentCondition.CountType.MORE_THAN, 0)); - String abilityText = "tap it unless you control a " + filter.getMessage(); - this.addAbility(new EntersBattlefieldAbility(new ConditionalOneShotEffect(new TapSourceEffect(), controls, abilityText), abilityText)); - this.addAbility(new GreenManaAbility()); - this.addAbility(new WhiteManaAbility()); - } + Condition controls = new UnlessCondition(new ControlsPermanentCondition(filter, ControlsPermanentCondition.CountType.MORE_THAN, 0)); + String abilityText = "tap it unless you control a " + filter.getMessage(); + this.addAbility(new EntersBattlefieldAbility(new ConditionalOneShotEffect(new TapSourceEffect(), controls, abilityText), abilityText)); + this.addAbility(new GreenManaAbility()); + this.addAbility(new WhiteManaAbility()); + } - public SunpetalGrove(final SunpetalGrove card) { - super(card); - } + public SunpetalGrove(final SunpetalGrove card) { + super(card); + } - @Override - public SunpetalGrove copy() { - return new SunpetalGrove(this); - } + @Override + public SunpetalGrove copy() { + return new SunpetalGrove(this); + } } diff --git a/Mage.Sets/src/mage/sets/magic2010/Swamp1.java b/Mage.Sets/src/mage/sets/magic2010/Swamp1.java index e0219bd9cf..dac51602ec 100644 --- a/Mage.Sets/src/mage/sets/magic2010/Swamp1.java +++ b/Mage.Sets/src/mage/sets/magic2010/Swamp1.java @@ -36,18 +36,18 @@ import java.util.UUID; */ public class Swamp1 extends mage.cards.basiclands.Swamp { - public Swamp1(UUID ownerId) { - super(ownerId, 238); - this.expansionSetCode = "M10"; - } + public Swamp1(UUID ownerId) { + super(ownerId, 238); + this.expansionSetCode = "M10"; + } - public Swamp1(final Swamp1 card) { - super(card); - } + public Swamp1(final Swamp1 card) { + super(card); + } - @Override - public Swamp1 copy() { - return new Swamp1(this); - } + @Override + public Swamp1 copy() { + return new Swamp1(this); + } } diff --git a/Mage.Sets/src/mage/sets/magic2010/Swamp2.java b/Mage.Sets/src/mage/sets/magic2010/Swamp2.java index 9c5e77afc8..314bdd5d7f 100644 --- a/Mage.Sets/src/mage/sets/magic2010/Swamp2.java +++ b/Mage.Sets/src/mage/sets/magic2010/Swamp2.java @@ -36,18 +36,18 @@ import java.util.UUID; */ public class Swamp2 extends mage.cards.basiclands.Swamp { - public Swamp2(UUID ownerId) { - super(ownerId, 239); - this.expansionSetCode = "M10"; - } + public Swamp2(UUID ownerId) { + super(ownerId, 239); + this.expansionSetCode = "M10"; + } - public Swamp2(final Swamp2 card) { - super(card); - } + public Swamp2(final Swamp2 card) { + super(card); + } - @Override - public Swamp2 copy() { - return new Swamp2(this); - } + @Override + public Swamp2 copy() { + return new Swamp2(this); + } } diff --git a/Mage.Sets/src/mage/sets/magic2010/Swamp3.java b/Mage.Sets/src/mage/sets/magic2010/Swamp3.java index 7d38f2cbaa..22823f11d4 100644 --- a/Mage.Sets/src/mage/sets/magic2010/Swamp3.java +++ b/Mage.Sets/src/mage/sets/magic2010/Swamp3.java @@ -36,18 +36,18 @@ import java.util.UUID; */ public class Swamp3 extends mage.cards.basiclands.Swamp { - public Swamp3(UUID ownerId) { - super(ownerId, 240); - this.expansionSetCode = "M10"; - } + public Swamp3(UUID ownerId) { + super(ownerId, 240); + this.expansionSetCode = "M10"; + } - public Swamp3(final Swamp3 card) { - super(card); - } + public Swamp3(final Swamp3 card) { + super(card); + } - @Override - public Swamp3 copy() { - return new Swamp3(this); - } + @Override + public Swamp3 copy() { + return new Swamp3(this); + } } diff --git a/Mage.Sets/src/mage/sets/magic2010/Swamp4.java b/Mage.Sets/src/mage/sets/magic2010/Swamp4.java index 21b3f0956a..69d0876213 100644 --- a/Mage.Sets/src/mage/sets/magic2010/Swamp4.java +++ b/Mage.Sets/src/mage/sets/magic2010/Swamp4.java @@ -36,18 +36,18 @@ import java.util.UUID; */ public class Swamp4 extends mage.cards.basiclands.Swamp { - public Swamp4(UUID ownerId) { - super(ownerId, 241); - this.expansionSetCode = "M10"; - } + public Swamp4(UUID ownerId) { + super(ownerId, 241); + this.expansionSetCode = "M10"; + } - public Swamp4(final Swamp4 card) { - super(card); - } + public Swamp4(final Swamp4 card) { + super(card); + } - @Override - public Swamp4 copy() { - return new Swamp4(this); - } + @Override + public Swamp4 copy() { + return new Swamp4(this); + } } diff --git a/Mage.Sets/src/mage/sets/magic2010/TerramorphicExpanse.java b/Mage.Sets/src/mage/sets/magic2010/TerramorphicExpanse.java index f8ee04a921..bf9038431a 100644 --- a/Mage.Sets/src/mage/sets/magic2010/TerramorphicExpanse.java +++ b/Mage.Sets/src/mage/sets/magic2010/TerramorphicExpanse.java @@ -36,19 +36,19 @@ import java.util.UUID; */ public class TerramorphicExpanse extends mage.sets.tenth.TerramorphicExpanse { - public TerramorphicExpanse(UUID ownerId) { - super(ownerId); - this.cardNumber = 229; - this.expansionSetCode = "M10"; - } + public TerramorphicExpanse(UUID ownerId) { + super(ownerId); + this.cardNumber = 229; + this.expansionSetCode = "M10"; + } - public TerramorphicExpanse(final TerramorphicExpanse card) { - super(card); - } + public TerramorphicExpanse(final TerramorphicExpanse card) { + super(card); + } - @Override - public TerramorphicExpanse copy() { - return new TerramorphicExpanse(this); - } + @Override + public TerramorphicExpanse copy() { + return new TerramorphicExpanse(this); + } } \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/magic2010/TimeWarp.java b/Mage.Sets/src/mage/sets/magic2010/TimeWarp.java index 3b3fffe9c7..7b97261d48 100644 --- a/Mage.Sets/src/mage/sets/magic2010/TimeWarp.java +++ b/Mage.Sets/src/mage/sets/magic2010/TimeWarp.java @@ -45,45 +45,45 @@ import mage.target.TargetPlayer; */ public class TimeWarp extends CardImpl { - public TimeWarp(UUID ownerId) { - super(ownerId, 75, "Time Warp", Rarity.MYTHIC, new CardType[]{CardType.SORCERY}, "{3}{U}{U}"); - this.expansionSetCode = "M10"; - this.color.setBlue(true); - this.getSpellAbility().addTarget(new TargetPlayer()); - this.getSpellAbility().addEffect(new TimeWarpEffect()); - } + public TimeWarp(UUID ownerId) { + super(ownerId, 75, "Time Warp", Rarity.MYTHIC, new CardType[]{CardType.SORCERY}, "{3}{U}{U}"); + this.expansionSetCode = "M10"; + this.color.setBlue(true); + this.getSpellAbility().addTarget(new TargetPlayer()); + this.getSpellAbility().addEffect(new TimeWarpEffect()); + } - public TimeWarp(final TimeWarp card) { - super(card); - } + public TimeWarp(final TimeWarp card) { + super(card); + } - @Override - public TimeWarp copy() { - return new TimeWarp(this); - } + @Override + public TimeWarp copy() { + return new TimeWarp(this); + } } class TimeWarpEffect extends OneShotEffect { - public TimeWarpEffect() { - super(Outcome.ExtraTurn); - staticText = "Target player takes an extra turn after this one"; - } + public TimeWarpEffect() { + super(Outcome.ExtraTurn); + staticText = "Target player takes an extra turn after this one"; + } - public TimeWarpEffect(final TimeWarpEffect effect) { - super(effect); - } + public TimeWarpEffect(final TimeWarpEffect effect) { + super(effect); + } - @Override - public TimeWarpEffect copy() { - return new TimeWarpEffect(this); - } + @Override + public TimeWarpEffect copy() { + return new TimeWarpEffect(this); + } - @Override - public boolean apply(Game game, Ability source) { - game.getState().getTurnMods().add(new TurnMod(source.getFirstTarget(), false)); - return true; - } + @Override + public boolean apply(Game game, Ability source) { + game.getState().getTurnMods().add(new TurnMod(source.getFirstTarget(), false)); + return true; + } } \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/magic2010/TomeScour.java b/Mage.Sets/src/mage/sets/magic2010/TomeScour.java index 098303271e..0de939e860 100644 --- a/Mage.Sets/src/mage/sets/magic2010/TomeScour.java +++ b/Mage.Sets/src/mage/sets/magic2010/TomeScour.java @@ -41,20 +41,20 @@ import mage.target.TargetPlayer; */ public class TomeScour extends CardImpl { - public TomeScour(UUID ownerId) { - super(ownerId, 76, "Tome Scour", Rarity.COMMON, new CardType[]{CardType.SORCERY}, "{U}"); - this.expansionSetCode = "M10"; - this.color.setBlue(true); - this.getSpellAbility().addTarget(new TargetPlayer()); - this.getSpellAbility().addEffect(new PutLibraryIntoGraveTargetEffect(5)); - } + public TomeScour(UUID ownerId) { + super(ownerId, 76, "Tome Scour", Rarity.COMMON, new CardType[]{CardType.SORCERY}, "{U}"); + this.expansionSetCode = "M10"; + this.color.setBlue(true); + this.getSpellAbility().addTarget(new TargetPlayer()); + this.getSpellAbility().addEffect(new PutLibraryIntoGraveTargetEffect(5)); + } - public TomeScour(final TomeScour card) { - super(card); - } + public TomeScour(final TomeScour card) { + super(card); + } - @Override - public TomeScour copy() { - return new TomeScour(this); - } + @Override + public TomeScour copy() { + return new TomeScour(this); + } } diff --git a/Mage.Sets/src/mage/sets/magic2010/Traumatize.java b/Mage.Sets/src/mage/sets/magic2010/Traumatize.java index 56f8ba5fdf..41f2b6fe3c 100644 --- a/Mage.Sets/src/mage/sets/magic2010/Traumatize.java +++ b/Mage.Sets/src/mage/sets/magic2010/Traumatize.java @@ -36,19 +36,19 @@ import java.util.UUID; */ public class Traumatize extends mage.sets.tenth.Traumatize { - public Traumatize(UUID ownerId) { - super(ownerId); - this.cardNumber = 77; - this.expansionSetCode = "M10"; - } + public Traumatize(UUID ownerId) { + super(ownerId); + this.cardNumber = 77; + this.expansionSetCode = "M10"; + } - public Traumatize(final Traumatize card) { - super(card); - } + public Traumatize(final Traumatize card) { + super(card); + } - @Override - public Traumatize copy() { - return new Traumatize(this); - } + @Override + public Traumatize copy() { + return new Traumatize(this); + } } \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/magic2010/UnholyStrength.java b/Mage.Sets/src/mage/sets/magic2010/UnholyStrength.java index 4eca9ec2ff..e78866ae63 100644 --- a/Mage.Sets/src/mage/sets/magic2010/UnholyStrength.java +++ b/Mage.Sets/src/mage/sets/magic2010/UnholyStrength.java @@ -36,19 +36,19 @@ import java.util.UUID; */ public class UnholyStrength extends mage.sets.tenth.UnholyStrength { - public UnholyStrength(UUID ownerId) { - super(ownerId); - this.cardNumber = 116; - this.expansionSetCode = "M10"; - } + public UnholyStrength(UUID ownerId) { + super(ownerId); + this.cardNumber = 116; + this.expansionSetCode = "M10"; + } - public UnholyStrength(final UnholyStrength card) { - super(card); - } + public UnholyStrength(final UnholyStrength card) { + super(card); + } - @Override - public UnholyStrength copy() { - return new UnholyStrength(this); - } + @Override + public UnholyStrength copy() { + return new UnholyStrength(this); + } } \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/magic2010/Unsummon.java b/Mage.Sets/src/mage/sets/magic2010/Unsummon.java index 566dc14278..d204a0722d 100644 --- a/Mage.Sets/src/mage/sets/magic2010/Unsummon.java +++ b/Mage.Sets/src/mage/sets/magic2010/Unsummon.java @@ -36,19 +36,19 @@ import java.util.UUID; */ public class Unsummon extends mage.sets.conflux.Unsummon { - public Unsummon(UUID ownerId) { - super(ownerId); - this.cardNumber = 79; - this.expansionSetCode = "M10"; - } + public Unsummon(UUID ownerId) { + super(ownerId); + this.cardNumber = 79; + this.expansionSetCode = "M10"; + } - public Unsummon(final Unsummon card) { - super(card); - } + public Unsummon(final Unsummon card) { + super(card); + } - @Override - public Unsummon copy() { - return new Unsummon(this); - } + @Override + public Unsummon copy() { + return new Unsummon(this); + } } \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/magic2010/WallOfFaith.java b/Mage.Sets/src/mage/sets/magic2010/WallOfFaith.java index dd60808943..1aa890dacd 100644 --- a/Mage.Sets/src/mage/sets/magic2010/WallOfFaith.java +++ b/Mage.Sets/src/mage/sets/magic2010/WallOfFaith.java @@ -52,7 +52,7 @@ public class WallOfFaith extends CardImpl { this.color.setWhite(true); this.subtype.add("Wall"); this.power = new MageInt(0); - this.toughness = new MageInt(5); + this.toughness = new MageInt(5); this.addAbility(DefenderAbility.getInstance()); this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new BoostSourceEffect(0, 1, Duration.EndOfTurn), new ManaCostsImpl("{W}"))); diff --git a/Mage.Sets/src/mage/sets/magic2010/Weakness.java b/Mage.Sets/src/mage/sets/magic2010/Weakness.java index 3e1d90d896..f868cce0f8 100644 --- a/Mage.Sets/src/mage/sets/magic2010/Weakness.java +++ b/Mage.Sets/src/mage/sets/magic2010/Weakness.java @@ -59,11 +59,11 @@ public class Weakness extends CardImpl { this.color.setBlack(true); this.subtype.add("Aura"); TargetPermanent auraTarget = new TargetCreaturePermanent(); - this.getSpellAbility().addTarget(auraTarget); - this.getSpellAbility().addEffect(new AttachEffect(Outcome.UnboostCreature)); + this.getSpellAbility().addTarget(auraTarget); + this.getSpellAbility().addEffect(new AttachEffect(Outcome.UnboostCreature)); Ability ability = new EnchantAbility(auraTarget.getTargetName()); - this.addAbility(ability); - this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new WeaknessEffect())); + this.addAbility(ability); + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new WeaknessEffect())); } public Weakness(final Weakness card) { @@ -80,7 +80,7 @@ class WeaknessEffect extends ContinuousEffectImpl { public WeaknessEffect() { super(Duration.WhileOnBattlefield, Outcome.UnboostCreature); - staticText = "Enchanted creature gets -2/-1"; + staticText = "Enchanted creature gets -2/-1"; } public WeaknessEffect(final WeaknessEffect effect) { @@ -90,21 +90,21 @@ class WeaknessEffect extends ContinuousEffectImpl { @Override public boolean apply(Layer layer, SubLayer sublayer, Ability source, Game game) { Permanent enchantment = game.getPermanent(source.getSourceId()); - if (enchantment != null && enchantment.getAttachedTo() != null) { - Permanent creature = game.getPermanent(enchantment.getAttachedTo()); - if (creature != null) { - switch (layer) { - case PTChangingEffects_7: - if (sublayer == SubLayer.ModifyPT_7c) { - creature.addPower(-2); - creature.addToughness(-1); - } - break; - } - return true; - } - } - return false; + if (enchantment != null && enchantment.getAttachedTo() != null) { + Permanent creature = game.getPermanent(enchantment.getAttachedTo()); + if (creature != null) { + switch (layer) { + case PTChangingEffects_7: + if (sublayer == SubLayer.ModifyPT_7c) { + creature.addPower(-2); + creature.addToughness(-1); + } + break; + } + return true; + } + } + return false; } @Override @@ -114,7 +114,7 @@ class WeaknessEffect extends ContinuousEffectImpl { @Override public boolean hasLayer(Layer layer) { - return layer == Layer.PTChangingEffects_7; + return layer == Layer.PTChangingEffects_7; } @Override diff --git a/Mage.Sets/src/mage/sets/magic2010/WhispersilkCloak.java b/Mage.Sets/src/mage/sets/magic2010/WhispersilkCloak.java index 56ee7d2c67..96ef43d648 100644 --- a/Mage.Sets/src/mage/sets/magic2010/WhispersilkCloak.java +++ b/Mage.Sets/src/mage/sets/magic2010/WhispersilkCloak.java @@ -36,19 +36,19 @@ import java.util.UUID; */ public class WhispersilkCloak extends mage.sets.tenth.WhispersilkCloak { - public WhispersilkCloak(UUID ownerId) { - super(ownerId); - this.cardNumber = 221; - this.expansionSetCode = "M10"; - } + public WhispersilkCloak(UUID ownerId) { + super(ownerId); + this.cardNumber = 221; + this.expansionSetCode = "M10"; + } - public WhispersilkCloak(final WhispersilkCloak card) { - super(card); - } + public WhispersilkCloak(final WhispersilkCloak card) { + super(card); + } - @Override - public WhispersilkCloak copy() { - return new WhispersilkCloak(this); - } + @Override + public WhispersilkCloak copy() { + return new WhispersilkCloak(this); + } } \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/magic2010/WhiteKnight.java b/Mage.Sets/src/mage/sets/magic2010/WhiteKnight.java index 2edd640ffc..a067c49120 100644 --- a/Mage.Sets/src/mage/sets/magic2010/WhiteKnight.java +++ b/Mage.Sets/src/mage/sets/magic2010/WhiteKnight.java @@ -44,34 +44,34 @@ import mage.filter.FilterCard; */ public class WhiteKnight extends CardImpl { - private static final FilterCard filter = new FilterCard("Black"); + private static final FilterCard filter = new FilterCard("Black"); - static { - filter.setUseColor(true); - filter.getColor().setBlack(true); - filter.setScopeColor(ComparisonScope.Any); - } + static { + filter.setUseColor(true); + filter.getColor().setBlack(true); + filter.setScopeColor(ComparisonScope.Any); + } - public WhiteKnight(UUID ownerId) { - super(ownerId, 41, "White Knight", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{W}{W}"); - this.expansionSetCode = "M10"; - this.subtype.add("Human"); - this.subtype.add("Knight"); - this.color.setWhite(true); - this.power = new MageInt(2); - this.toughness = new MageInt(2); + public WhiteKnight(UUID ownerId) { + super(ownerId, 41, "White Knight", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{W}{W}"); + this.expansionSetCode = "M10"; + this.subtype.add("Human"); + this.subtype.add("Knight"); + this.color.setWhite(true); + this.power = new MageInt(2); + this.toughness = new MageInt(2); - this.addAbility(FirstStrikeAbility.getInstance()); - this.addAbility(new ProtectionAbility(filter)); - } + this.addAbility(FirstStrikeAbility.getInstance()); + this.addAbility(new ProtectionAbility(filter)); + } - public WhiteKnight(final WhiteKnight card) { - super(card); - } + public WhiteKnight(final WhiteKnight card) { + super(card); + } - @Override - public WhiteKnight copy() { - return new WhiteKnight(this); - } + @Override + public WhiteKnight copy() { + return new WhiteKnight(this); + } } diff --git a/Mage.Sets/src/mage/sets/magic2010/WurmsTooth.java b/Mage.Sets/src/mage/sets/magic2010/WurmsTooth.java index 18af0cbf12..d9e0ed3ac5 100644 --- a/Mage.Sets/src/mage/sets/magic2010/WurmsTooth.java +++ b/Mage.Sets/src/mage/sets/magic2010/WurmsTooth.java @@ -36,19 +36,19 @@ import java.util.UUID; */ public class WurmsTooth extends mage.sets.tenth.WurmsTooth { - public WurmsTooth(UUID ownerId) { - super(ownerId); - this.cardNumber = 222; - this.expansionSetCode = "M10"; - } + public WurmsTooth(UUID ownerId) { + super(ownerId); + this.cardNumber = 222; + this.expansionSetCode = "M10"; + } - public WurmsTooth(final WurmsTooth card) { - super(card); - } + public WurmsTooth(final WurmsTooth card) { + super(card); + } - @Override - public WurmsTooth copy() { - return new WurmsTooth(this); - } + @Override + public WurmsTooth copy() { + return new WurmsTooth(this); + } } \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/magic2011/AcidicSlime.java b/Mage.Sets/src/mage/sets/magic2011/AcidicSlime.java index acc1851cec..96afdd7321 100644 --- a/Mage.Sets/src/mage/sets/magic2011/AcidicSlime.java +++ b/Mage.Sets/src/mage/sets/magic2011/AcidicSlime.java @@ -36,19 +36,19 @@ import java.util.UUID; */ public class AcidicSlime extends mage.sets.magic2010.AcidicSlime { - public AcidicSlime(UUID ownerId) { - super(ownerId); - this.cardNumber = 161; - this.expansionSetCode = "M11"; - } + public AcidicSlime(UUID ownerId) { + super(ownerId); + this.cardNumber = 161; + this.expansionSetCode = "M11"; + } - public AcidicSlime(final AcidicSlime card) { - super(card); - } + public AcidicSlime(final AcidicSlime card) { + super(card); + } - @Override - public AcidicSlime copy() { - return new AcidicSlime(this); - } + @Override + public AcidicSlime copy() { + return new AcidicSlime(this); + } } diff --git a/Mage.Sets/src/mage/sets/magic2011/ActOfTreason.java b/Mage.Sets/src/mage/sets/magic2011/ActOfTreason.java index f6d8745e12..f5a4c758d9 100644 --- a/Mage.Sets/src/mage/sets/magic2011/ActOfTreason.java +++ b/Mage.Sets/src/mage/sets/magic2011/ActOfTreason.java @@ -37,19 +37,19 @@ import mage.Constants.Rarity; */ public class ActOfTreason extends mage.sets.magic2010.ActOfTreason { - public ActOfTreason(UUID ownerId) { - super(ownerId);this.cardNumber = 121; - this.expansionSetCode = "M11"; + public ActOfTreason(UUID ownerId) { + super(ownerId);this.cardNumber = 121; + this.expansionSetCode = "M11"; this.rarity = Rarity.COMMON; - } + } - public ActOfTreason(final ActOfTreason card) { - super(card); - } + public ActOfTreason(final ActOfTreason card) { + super(card); + } - @Override - public ActOfTreason copy() { - return new ActOfTreason(this); - } + @Override + public ActOfTreason copy() { + return new ActOfTreason(this); + } } diff --git a/Mage.Sets/src/mage/sets/magic2011/AetherAdept.java b/Mage.Sets/src/mage/sets/magic2011/AetherAdept.java index 1581c2d2a4..0b834fadb1 100644 --- a/Mage.Sets/src/mage/sets/magic2011/AetherAdept.java +++ b/Mage.Sets/src/mage/sets/magic2011/AetherAdept.java @@ -54,9 +54,9 @@ public class AetherAdept extends CardImpl { this.toughness = new MageInt(2); // When AEther Adept enters the battlefield, return target creature to its owner's hand. - Ability ability = new EntersBattlefieldTriggeredAbility(new ReturnToHandTargetEffect()); - ability.addTarget(new TargetCreaturePermanent()); - this.addAbility(ability); + Ability ability = new EntersBattlefieldTriggeredAbility(new ReturnToHandTargetEffect()); + ability.addTarget(new TargetCreaturePermanent()); + this.addAbility(ability); } public AetherAdept(final AetherAdept card) { diff --git a/Mage.Sets/src/mage/sets/magic2011/AirServant.java b/Mage.Sets/src/mage/sets/magic2011/AirServant.java index 7fe124eeab..8fcf1fcc2d 100644 --- a/Mage.Sets/src/mage/sets/magic2011/AirServant.java +++ b/Mage.Sets/src/mage/sets/magic2011/AirServant.java @@ -48,32 +48,32 @@ import mage.target.common.TargetCreaturePermanent; */ public class AirServant extends CardImpl { - private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("creature with flying"); + private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("creature with flying"); - static { - filter.getAbilities().add(FlyingAbility.getInstance()); - } + static { + filter.getAbilities().add(FlyingAbility.getInstance()); + } - public AirServant(UUID ownerId) { - super(ownerId, 42, "Air Servant", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{4}{U}"); - this.expansionSetCode = "M11"; - this.color.setBlue(true); - this.subtype.add("Elemental"); - this.power = new MageInt(4); - this.toughness = new MageInt(3); - this.addAbility(FlyingAbility.getInstance()); - Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new TapTargetEffect(), new ManaCostsImpl("{2}{U}")); - ability.addTarget(new TargetCreaturePermanent(filter)); - this.addAbility(ability); - } + public AirServant(UUID ownerId) { + super(ownerId, 42, "Air Servant", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{4}{U}"); + this.expansionSetCode = "M11"; + this.color.setBlue(true); + this.subtype.add("Elemental"); + this.power = new MageInt(4); + this.toughness = new MageInt(3); + this.addAbility(FlyingAbility.getInstance()); + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new TapTargetEffect(), new ManaCostsImpl("{2}{U}")); + ability.addTarget(new TargetCreaturePermanent(filter)); + this.addAbility(ability); + } - public AirServant(final AirServant card) { - super(card); - } + public AirServant(final AirServant card) { + super(card); + } - @Override - public AirServant copy() { - return new AirServant(this); - } + @Override + public AirServant copy() { + return new AirServant(this); + } } diff --git a/Mage.Sets/src/mage/sets/magic2011/AjaniGoldmane.java b/Mage.Sets/src/mage/sets/magic2011/AjaniGoldmane.java index 399077515d..e079a5febf 100644 --- a/Mage.Sets/src/mage/sets/magic2011/AjaniGoldmane.java +++ b/Mage.Sets/src/mage/sets/magic2011/AjaniGoldmane.java @@ -36,19 +36,19 @@ import java.util.UUID; */ public class AjaniGoldmane extends mage.sets.magic2010.AjaniGoldmane { - public AjaniGoldmane(UUID ownerId) { - super(ownerId); - this.cardNumber = 1; - this.expansionSetCode = "M11"; - } + public AjaniGoldmane(UUID ownerId) { + super(ownerId); + this.cardNumber = 1; + this.expansionSetCode = "M11"; + } - public AjaniGoldmane(final AjaniGoldmane card) { - super(card); - } + public AjaniGoldmane(final AjaniGoldmane card) { + super(card); + } - @Override - public AjaniGoldmane copy() { - return new AjaniGoldmane(this); - } + @Override + public AjaniGoldmane copy() { + return new AjaniGoldmane(this); + } } diff --git a/Mage.Sets/src/mage/sets/magic2011/AjanisMantra.java b/Mage.Sets/src/mage/sets/magic2011/AjanisMantra.java index 3eba216fa2..0ea9ffa263 100644 --- a/Mage.Sets/src/mage/sets/magic2011/AjanisMantra.java +++ b/Mage.Sets/src/mage/sets/magic2011/AjanisMantra.java @@ -42,20 +42,20 @@ import mage.game.events.GameEvent.EventType; */ public class AjanisMantra extends CardImpl { - public AjanisMantra(UUID ownerId) { - super(ownerId, 2, "Ajani's Mantra", Rarity.COMMON, new CardType[]{CardType.ENCHANTMENT}, "{1}{W}"); - this.expansionSetCode = "M11"; - this.getColor().setWhite(true); - this.addAbility(new OnEventTriggeredAbility(EventType.UPKEEP_STEP_PRE, "beginning of your upkeep", new GainLifeEffect(1), true)); - } + public AjanisMantra(UUID ownerId) { + super(ownerId, 2, "Ajani's Mantra", Rarity.COMMON, new CardType[]{CardType.ENCHANTMENT}, "{1}{W}"); + this.expansionSetCode = "M11"; + this.getColor().setWhite(true); + this.addAbility(new OnEventTriggeredAbility(EventType.UPKEEP_STEP_PRE, "beginning of your upkeep", new GainLifeEffect(1), true)); + } - public AjanisMantra(final AjanisMantra card) { - super(card); - } + public AjanisMantra(final AjanisMantra card) { + super(card); + } - @Override - public AjanisMantra copy() { - return new AjanisMantra(this); - } + @Override + public AjanisMantra copy() { + return new AjanisMantra(this); + } } diff --git a/Mage.Sets/src/mage/sets/magic2011/AjanisPridemate.java b/Mage.Sets/src/mage/sets/magic2011/AjanisPridemate.java index 637b2c669d..ab998ebe3d 100644 --- a/Mage.Sets/src/mage/sets/magic2011/AjanisPridemate.java +++ b/Mage.Sets/src/mage/sets/magic2011/AjanisPridemate.java @@ -47,55 +47,55 @@ import mage.game.events.GameEvent.EventType; */ public class AjanisPridemate extends CardImpl { - public AjanisPridemate(UUID ownerId) { - super(ownerId, 3, "Ajani's Pridemate", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "1}{W}"); - this.expansionSetCode = "M11"; - this.subtype.add("Cat"); - this.subtype.add("Soldier"); - this.color.setWhite(true); - this.power = new MageInt(2); - this.toughness = new MageInt(2); + public AjanisPridemate(UUID ownerId) { + super(ownerId, 3, "Ajani's Pridemate", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "1}{W}"); + this.expansionSetCode = "M11"; + this.subtype.add("Cat"); + this.subtype.add("Soldier"); + this.color.setWhite(true); + this.power = new MageInt(2); + this.toughness = new MageInt(2); - this.addAbility(new AjanisPridemateAbility()); - } + this.addAbility(new AjanisPridemateAbility()); + } - public AjanisPridemate(final AjanisPridemate card) { - super(card); - } + public AjanisPridemate(final AjanisPridemate card) { + super(card); + } - @Override - public AjanisPridemate copy() { - return new AjanisPridemate(this); - } + @Override + public AjanisPridemate copy() { + return new AjanisPridemate(this); + } } class AjanisPridemateAbility extends TriggeredAbilityImpl { - public AjanisPridemateAbility() { - super(Zone.BATTLEFIELD, new AddCountersSourceEffect(CounterType.P1P1.createInstance()), true); - } + public AjanisPridemateAbility() { + super(Zone.BATTLEFIELD, new AddCountersSourceEffect(CounterType.P1P1.createInstance()), true); + } - public AjanisPridemateAbility(final AjanisPridemateAbility ability) { - super(ability); - } + public AjanisPridemateAbility(final AjanisPridemateAbility ability) { + super(ability); + } - @Override - public AjanisPridemateAbility copy() { - return new AjanisPridemateAbility(this); - } + @Override + public AjanisPridemateAbility copy() { + return new AjanisPridemateAbility(this); + } - @Override - public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == EventType.GAINED_LIFE && event.getPlayerId().equals(controllerId)) { - return true; - } - return false; - } + @Override + public boolean checkTrigger(GameEvent event, Game game) { + if (event.getType() == EventType.GAINED_LIFE && event.getPlayerId().equals(controllerId)) { + return true; + } + return false; + } - @Override - public String getRule() { - return "Whenever you gain life, you may put a +1/+1 counter on {this}."; - } + @Override + public String getRule() { + return "Whenever you gain life, you may put a +1/+1 counter on {this}."; + } } \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/magic2011/AlluringSiren.java b/Mage.Sets/src/mage/sets/magic2011/AlluringSiren.java index 9cf6756b03..e68e339a19 100644 --- a/Mage.Sets/src/mage/sets/magic2011/AlluringSiren.java +++ b/Mage.Sets/src/mage/sets/magic2011/AlluringSiren.java @@ -36,19 +36,19 @@ import java.util.UUID; */ public class AlluringSiren extends mage.sets.magic2010.AlluringSiren { - public AlluringSiren(UUID ownerId) { - super(ownerId); - this.cardNumber = 43; - this.expansionSetCode = "M11"; - } + public AlluringSiren(UUID ownerId) { + super(ownerId); + this.cardNumber = 43; + this.expansionSetCode = "M11"; + } - public AlluringSiren(final AlluringSiren card) { - super(card); - } + public AlluringSiren(final AlluringSiren card) { + super(card); + } - @Override - public AlluringSiren copy() { - return new AlluringSiren(this); - } + @Override + public AlluringSiren copy() { + return new AlluringSiren(this); + } } diff --git a/Mage.Sets/src/mage/sets/magic2011/AncientHellkite.java b/Mage.Sets/src/mage/sets/magic2011/AncientHellkite.java index 21188d8807..2c6197324f 100644 --- a/Mage.Sets/src/mage/sets/magic2011/AncientHellkite.java +++ b/Mage.Sets/src/mage/sets/magic2011/AncientHellkite.java @@ -52,94 +52,94 @@ import mage.target.common.TargetCreaturePermanent; */ public class AncientHellkite extends CardImpl { - public AncientHellkite(UUID ownerId) { - super(ownerId, 122, "Ancient Hellkite", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{4}{R}{R}{R}"); - this.expansionSetCode = "M11"; - this.subtype.add("Dragon"); - this.color.setRed(true); - this.power = new MageInt(6); - this.toughness = new MageInt(6); + public AncientHellkite(UUID ownerId) { + super(ownerId, 122, "Ancient Hellkite", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{4}{R}{R}{R}"); + this.expansionSetCode = "M11"; + this.subtype.add("Dragon"); + this.color.setRed(true); + this.power = new MageInt(6); + this.toughness = new MageInt(6); - this.addAbility(FlyingAbility.getInstance()); - this.addAbility(new AncientHellkiteAbility()); - } + this.addAbility(FlyingAbility.getInstance()); + this.addAbility(new AncientHellkiteAbility()); + } - public AncientHellkite(final AncientHellkite card) { - super(card); - } + public AncientHellkite(final AncientHellkite card) { + super(card); + } - @Override - public AncientHellkite copy() { - return new AncientHellkite(this); - } + @Override + public AncientHellkite copy() { + return new AncientHellkite(this); + } } class AncientHellkiteAbility extends ActivatedAbilityImpl { - private FilterCreaturePermanent filter = new FilterCreaturePermanent("creature defending player controls"); + private FilterCreaturePermanent filter = new FilterCreaturePermanent("creature defending player controls"); - public AncientHellkiteAbility() { - super(Zone.BATTLEFIELD, new DamageTargetEffect(1)); - addCost(new AncientHellkiteCost()); - addTarget(new TargetCreaturePermanent(filter)); - addManaCost(new ColoredManaCost(ColoredManaSymbol.R)); - } + public AncientHellkiteAbility() { + super(Zone.BATTLEFIELD, new DamageTargetEffect(1)); + addCost(new AncientHellkiteCost()); + addTarget(new TargetCreaturePermanent(filter)); + addManaCost(new ColoredManaCost(ColoredManaSymbol.R)); + } - public AncientHellkiteAbility(final AncientHellkiteAbility ability) { - super(ability); - this.filter = ability.filter; - } + public AncientHellkiteAbility(final AncientHellkiteAbility ability) { + super(ability); + this.filter = ability.filter; + } - @Override - public AncientHellkiteAbility copy() { - return new AncientHellkiteAbility(this); - } + @Override + public AncientHellkiteAbility copy() { + return new AncientHellkiteAbility(this); + } - @Override - public boolean activate(Game game, boolean noMana) { - UUID defenderId = game.getCombat().getDefendingPlayer(sourceId); - if (defenderId != null) { + @Override + public boolean activate(Game game, boolean noMana) { + UUID defenderId = game.getCombat().getDefendingPlayer(sourceId); + if (defenderId != null) { getTargets().clear(); FilterCreaturePermanent filter = new FilterCreaturePermanent("creature defending player controls"); filter.getControllerId().add(defenderId); TargetCreaturePermanent target = new TargetCreaturePermanent(filter); target.setRequired(true); this.addTarget(target); - return super.activate(game, noMana); - } - return false; - } + return super.activate(game, noMana); + } + return false; + } } class AncientHellkiteCost extends CostImpl { - public AncientHellkiteCost() { - this.text = "Activate this ability only if Ancient Hellkite is attacking"; - } + public AncientHellkiteCost() { + this.text = "Activate this ability only if Ancient Hellkite is attacking"; + } - public AncientHellkiteCost(final AncientHellkiteCost cost) { - super(cost); - } + public AncientHellkiteCost(final AncientHellkiteCost cost) { + super(cost); + } - @Override - public AncientHellkiteCost copy() { - return new AncientHellkiteCost(this); - } + @Override + public AncientHellkiteCost copy() { + return new AncientHellkiteCost(this); + } - @Override - public boolean canPay(UUID sourceId, UUID controllerId, Game game) { - Permanent permanent = game.getPermanent(sourceId); - if (permanent != null && permanent.isAttacking()) { - return true; - } - return false; - } + @Override + public boolean canPay(UUID sourceId, UUID controllerId, Game game) { + Permanent permanent = game.getPermanent(sourceId); + if (permanent != null && permanent.isAttacking()) { + return true; + } + return false; + } - @Override - public boolean pay(Ability ability, Game game, UUID sourceId, UUID controllerId, boolean noMana) { - this.paid = true; - return paid; - } + @Override + public boolean pay(Ability ability, Game game, UUID sourceId, UUID controllerId, boolean noMana) { + this.paid = true; + return paid; + } } \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/magic2011/AngelicArbiter.java b/Mage.Sets/src/mage/sets/magic2011/AngelicArbiter.java index 7cae2993a0..60c4001d68 100644 --- a/Mage.Sets/src/mage/sets/magic2011/AngelicArbiter.java +++ b/Mage.Sets/src/mage/sets/magic2011/AngelicArbiter.java @@ -53,152 +53,152 @@ import mage.watchers.WatcherImpl; */ public class AngelicArbiter extends CardImpl { - public AngelicArbiter(UUID ownerId) { - super(ownerId, 4, "Angelic Arbiter", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{5}{W}{W}"); - this.expansionSetCode = "M11"; - this.subtype.add("Angel"); - this.color.setWhite(true); - this.power = new MageInt(5); - this.toughness = new MageInt(6); + public AngelicArbiter(UUID ownerId) { + super(ownerId, 4, "Angelic Arbiter", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{5}{W}{W}"); + this.expansionSetCode = "M11"; + this.subtype.add("Angel"); + this.color.setWhite(true); + this.power = new MageInt(5); + this.toughness = new MageInt(6); - this.addAbility(FlyingAbility.getInstance()); - this.addWatcher(new AngelicArbiterWatcher1()); - this.addWatcher(new AngelicArbiterWatcher2()); - this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new AngelicArbiterEffect1())); - this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new AngelicArbiterEffect2())); - } + this.addAbility(FlyingAbility.getInstance()); + this.addWatcher(new AngelicArbiterWatcher1()); + this.addWatcher(new AngelicArbiterWatcher2()); + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new AngelicArbiterEffect1())); + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new AngelicArbiterEffect2())); + } - public AngelicArbiter(final AngelicArbiter card) { - super(card); - } + public AngelicArbiter(final AngelicArbiter card) { + super(card); + } - @Override - public AngelicArbiter copy() { - return new AngelicArbiter(this); - } + @Override + public AngelicArbiter copy() { + return new AngelicArbiter(this); + } } class AngelicArbiterWatcher1 extends WatcherImpl { - public AngelicArbiterWatcher1() { - super("OpponentCastSpell", WatcherScope.PLAYER); - } + public AngelicArbiterWatcher1() { + super("OpponentCastSpell", WatcherScope.PLAYER); + } - public AngelicArbiterWatcher1(final AngelicArbiterWatcher1 watcher) { - super(watcher); - } + public AngelicArbiterWatcher1(final AngelicArbiterWatcher1 watcher) { + super(watcher); + } - @Override - public AngelicArbiterWatcher1 copy() { - return new AngelicArbiterWatcher1(this); - } + @Override + public AngelicArbiterWatcher1 copy() { + return new AngelicArbiterWatcher1(this); + } - @Override - public void watch(GameEvent event, Game game) { + @Override + public void watch(GameEvent event, Game game) { if (condition == true) //no need to check - condition has already occured return; - if (event.getType() == EventType.SPELL_CAST && game.getActivePlayerId().equals(event.getPlayerId()) && game.getOpponents(controllerId).contains(event.getPlayerId())) - condition = true; - } + if (event.getType() == EventType.SPELL_CAST && game.getActivePlayerId().equals(event.getPlayerId()) && game.getOpponents(controllerId).contains(event.getPlayerId())) + condition = true; + } } class AngelicArbiterWatcher2 extends WatcherImpl { - public AngelicArbiterWatcher2() { - super("OpponentAttacked", WatcherScope.PLAYER); - } + public AngelicArbiterWatcher2() { + super("OpponentAttacked", WatcherScope.PLAYER); + } - public AngelicArbiterWatcher2(final AngelicArbiterWatcher2 watcher) { - super(watcher); - } + public AngelicArbiterWatcher2(final AngelicArbiterWatcher2 watcher) { + super(watcher); + } - @Override - public AngelicArbiterWatcher2 copy() { - return new AngelicArbiterWatcher2(this); - } + @Override + public AngelicArbiterWatcher2 copy() { + return new AngelicArbiterWatcher2(this); + } - @Override - public void watch(GameEvent event, Game game) { - if (event.getType() == EventType.DECLARED_ATTACKERS && game.getActivePlayerId().equals(event.getPlayerId()) && game.getOpponents(controllerId).contains(event.getPlayerId())) - condition = true; - } + @Override + public void watch(GameEvent event, Game game) { + if (event.getType() == EventType.DECLARED_ATTACKERS && game.getActivePlayerId().equals(event.getPlayerId()) && game.getOpponents(controllerId).contains(event.getPlayerId())) + condition = true; + } } class AngelicArbiterEffect1 extends ReplacementEffectImpl { - public AngelicArbiterEffect1() { - super(Duration.WhileOnBattlefield, Outcome.Benefit); - } + public AngelicArbiterEffect1() { + super(Duration.WhileOnBattlefield, Outcome.Benefit); + } - public AngelicArbiterEffect1(final AngelicArbiterEffect1 effect) { - super(effect); - staticText = "Each opponent who cast a spell this turn can't attack with creatures"; - } + public AngelicArbiterEffect1(final AngelicArbiterEffect1 effect) { + super(effect); + staticText = "Each opponent who cast a spell this turn can't attack with creatures"; + } - @Override - public AngelicArbiterEffect1 copy() { - return new AngelicArbiterEffect1(this); - } + @Override + public AngelicArbiterEffect1 copy() { + return new AngelicArbiterEffect1(this); + } - @Override - public boolean apply(Game game, Ability source) { - return true; - } + @Override + public boolean apply(Game game, Ability source) { + return true; + } - @Override - public boolean replaceEvent(GameEvent event, Ability source, Game game) { - return true; - } + @Override + public boolean replaceEvent(GameEvent event, Ability source, Game game) { + return true; + } - @Override - public boolean applies(GameEvent event, Ability source, Game game) { - if (event.getType() == EventType.DECLARE_ATTACKER && game.getActivePlayerId().equals(event.getPlayerId()) && game.getOpponents(source.getControllerId()).contains(event.getPlayerId())) { + @Override + public boolean applies(GameEvent event, Ability source, Game game) { + if (event.getType() == EventType.DECLARE_ATTACKER && game.getActivePlayerId().equals(event.getPlayerId()) && game.getOpponents(source.getControllerId()).contains(event.getPlayerId())) { Watcher watcher = game.getState().getWatchers().get("OpponentCastSpell", source.getControllerId()); if (watcher != null && watcher.conditionMet()) return true; - } - return false; - } + } + return false; + } } class AngelicArbiterEffect2 extends ReplacementEffectImpl { - public AngelicArbiterEffect2() { - super(Duration.WhileOnBattlefield, Outcome.Benefit); - staticText = "Each opponent who attacked with a creature this turn can't cast spells"; - } + public AngelicArbiterEffect2() { + super(Duration.WhileOnBattlefield, Outcome.Benefit); + staticText = "Each opponent who attacked with a creature this turn can't cast spells"; + } - public AngelicArbiterEffect2(final AngelicArbiterEffect2 effect) { - super(effect); - } + public AngelicArbiterEffect2(final AngelicArbiterEffect2 effect) { + super(effect); + } - @Override - public AngelicArbiterEffect2 copy() { - return new AngelicArbiterEffect2(this); - } + @Override + public AngelicArbiterEffect2 copy() { + return new AngelicArbiterEffect2(this); + } - @Override - public boolean apply(Game game, Ability source) { - return true; - } + @Override + public boolean apply(Game game, Ability source) { + return true; + } - @Override - public boolean replaceEvent(GameEvent event, Ability source, Game game) { - return true; - } + @Override + public boolean replaceEvent(GameEvent event, Ability source, Game game) { + return true; + } - @Override - public boolean applies(GameEvent event, Ability source, Game game) { - if (event.getType() == EventType.CAST_SPELL && game.getActivePlayerId().equals(event.getPlayerId()) && game.getOpponents(source.getControllerId()).contains(event.getPlayerId())) { + @Override + public boolean applies(GameEvent event, Ability source, Game game) { + if (event.getType() == EventType.CAST_SPELL && game.getActivePlayerId().equals(event.getPlayerId()) && game.getOpponents(source.getControllerId()).contains(event.getPlayerId())) { Watcher watcher = game.getState().getWatchers().get("OpponentAttacked", source.getControllerId()); if (watcher != null && watcher.conditionMet()) return true; - } - return false; - } + } + return false; + } } diff --git a/Mage.Sets/src/mage/sets/magic2011/AngelsFeather.java b/Mage.Sets/src/mage/sets/magic2011/AngelsFeather.java index f1c9388d95..79a81b530f 100644 --- a/Mage.Sets/src/mage/sets/magic2011/AngelsFeather.java +++ b/Mage.Sets/src/mage/sets/magic2011/AngelsFeather.java @@ -36,19 +36,19 @@ import java.util.UUID; */ public class AngelsFeather extends mage.sets.tenth.AngelsFeather { - public AngelsFeather(UUID ownerId) { - super(ownerId); - this.cardNumber = 201; - this.expansionSetCode = "M11"; - } + public AngelsFeather(UUID ownerId) { + super(ownerId); + this.cardNumber = 201; + this.expansionSetCode = "M11"; + } - public AngelsFeather(final AngelsFeather card) { - super(card); - } + public AngelsFeather(final AngelsFeather card) { + super(card); + } - @Override - public AngelsFeather copy() { - return new AngelsFeather(this); - } + @Override + public AngelsFeather copy() { + return new AngelsFeather(this); + } } diff --git a/Mage.Sets/src/mage/sets/magic2011/ArcRunner.java b/Mage.Sets/src/mage/sets/magic2011/ArcRunner.java index 6559da8e39..02cac4ae0a 100644 --- a/Mage.Sets/src/mage/sets/magic2011/ArcRunner.java +++ b/Mage.Sets/src/mage/sets/magic2011/ArcRunner.java @@ -44,26 +44,26 @@ import mage.game.events.GameEvent.EventType; */ public class ArcRunner extends CardImpl { - public ArcRunner(UUID ownerId) { - super(ownerId, 123, "Arc Runner", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{2}{R}"); - this.expansionSetCode = "M11"; - this.subtype.add("Elemental"); - this.subtype.add("Ox"); - this.color.setRed(true); - this.power = new MageInt(5); - this.toughness = new MageInt(1); + public ArcRunner(UUID ownerId) { + super(ownerId, 123, "Arc Runner", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{2}{R}"); + this.expansionSetCode = "M11"; + this.subtype.add("Elemental"); + this.subtype.add("Ox"); + this.color.setRed(true); + this.power = new MageInt(5); + this.toughness = new MageInt(1); - this.addAbility(HasteAbility.getInstance()); - this.addAbility(new OnEventTriggeredAbility(EventType.END_TURN_STEP_PRE, "beginning of the end step", true, new SacrificeSourceEffect())); - } + this.addAbility(HasteAbility.getInstance()); + this.addAbility(new OnEventTriggeredAbility(EventType.END_TURN_STEP_PRE, "beginning of the end step", true, new SacrificeSourceEffect())); + } - public ArcRunner(final ArcRunner card) { - super(card); - } + public ArcRunner(final ArcRunner card) { + super(card); + } - @Override - public ArcRunner copy() { - return new ArcRunner(this); - } + @Override + public ArcRunner copy() { + return new ArcRunner(this); + } } diff --git a/Mage.Sets/src/mage/sets/magic2011/ArmoredAscension.java b/Mage.Sets/src/mage/sets/magic2011/ArmoredAscension.java index 359eba31a7..27e4074dc2 100644 --- a/Mage.Sets/src/mage/sets/magic2011/ArmoredAscension.java +++ b/Mage.Sets/src/mage/sets/magic2011/ArmoredAscension.java @@ -36,19 +36,19 @@ import java.util.UUID; */ public class ArmoredAscension extends mage.sets.magic2010.ArmoredAscension { - public ArmoredAscension(UUID ownerId) { - super(ownerId); - this.cardNumber = 5; - this.expansionSetCode = "M11"; - } + public ArmoredAscension(UUID ownerId) { + super(ownerId); + this.cardNumber = 5; + this.expansionSetCode = "M11"; + } - public ArmoredAscension(final ArmoredAscension card) { - super(card); - } + public ArmoredAscension(final ArmoredAscension card) { + super(card); + } - @Override - public ArmoredAscension copy() { - return new ArmoredAscension(this); - } + @Override + public ArmoredAscension copy() { + return new ArmoredAscension(this); + } } diff --git a/Mage.Sets/src/mage/sets/magic2011/ArmoredCancrix.java b/Mage.Sets/src/mage/sets/magic2011/ArmoredCancrix.java index 5d917382b5..fdef1e7f1f 100644 --- a/Mage.Sets/src/mage/sets/magic2011/ArmoredCancrix.java +++ b/Mage.Sets/src/mage/sets/magic2011/ArmoredCancrix.java @@ -40,22 +40,22 @@ import mage.cards.CardImpl; */ public class ArmoredCancrix extends CardImpl { - public ArmoredCancrix(UUID ownerId) { - super(ownerId, 44, "Armored Cancrix", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{4}{U}"); - this.expansionSetCode = "M11"; - this.color.setBlue(true); - this.subtype.add("Crab"); - this.power = new MageInt(2); - this.toughness = new MageInt(5); - } + public ArmoredCancrix(UUID ownerId) { + super(ownerId, 44, "Armored Cancrix", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{4}{U}"); + this.expansionSetCode = "M11"; + this.color.setBlue(true); + this.subtype.add("Crab"); + this.power = new MageInt(2); + this.toughness = new MageInt(5); + } - public ArmoredCancrix(final ArmoredCancrix card) { - super(card); - } + public ArmoredCancrix(final ArmoredCancrix card) { + super(card); + } - @Override - public ArmoredCancrix copy() { - return new ArmoredCancrix(this); - } + @Override + public ArmoredCancrix copy() { + return new ArmoredCancrix(this); + } } diff --git a/Mage.Sets/src/mage/sets/magic2011/Assassinate.java b/Mage.Sets/src/mage/sets/magic2011/Assassinate.java index a49f66441e..6d75485aba 100644 --- a/Mage.Sets/src/mage/sets/magic2011/Assassinate.java +++ b/Mage.Sets/src/mage/sets/magic2011/Assassinate.java @@ -36,19 +36,19 @@ import java.util.UUID; */ public class Assassinate extends mage.sets.tenth.Assassinate { - public Assassinate(UUID ownerId) { - super(ownerId); - this.cardNumber = 81; - this.expansionSetCode = "M11"; - } + public Assassinate(UUID ownerId) { + super(ownerId); + this.cardNumber = 81; + this.expansionSetCode = "M11"; + } - public Assassinate(final Assassinate card) { - super(card); - } + public Assassinate(final Assassinate card) { + super(card); + } - @Override - public Assassinate copy() { - return new Assassinate(this); - } + @Override + public Assassinate copy() { + return new Assassinate(this); + } } diff --git a/Mage.Sets/src/mage/sets/magic2011/AssaultGriffin.java b/Mage.Sets/src/mage/sets/magic2011/AssaultGriffin.java index edbefc2fcc..64cdb6f1b2 100644 --- a/Mage.Sets/src/mage/sets/magic2011/AssaultGriffin.java +++ b/Mage.Sets/src/mage/sets/magic2011/AssaultGriffin.java @@ -41,25 +41,25 @@ import mage.cards.CardImpl; */ public class AssaultGriffin extends CardImpl { - public AssaultGriffin(UUID ownerId) { - super(ownerId, 6, "Assault Griffin", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{3}{W}"); - this.expansionSetCode = "M11"; - this.color.setWhite(true); - this.subtype.add("Griffin"); - this.power = new MageInt(3); - this.toughness = new MageInt(2); + public AssaultGriffin(UUID ownerId) { + super(ownerId, 6, "Assault Griffin", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{3}{W}"); + this.expansionSetCode = "M11"; + this.color.setWhite(true); + this.subtype.add("Griffin"); + this.power = new MageInt(3); + this.toughness = new MageInt(2); - this.addAbility(FlyingAbility.getInstance()); - } + this.addAbility(FlyingAbility.getInstance()); + } - public AssaultGriffin(final AssaultGriffin card) { - super(card); - } + public AssaultGriffin(final AssaultGriffin card) { + super(card); + } - @Override - public AssaultGriffin copy() { - return new AssaultGriffin(this); - } + @Override + public AssaultGriffin copy() { + return new AssaultGriffin(this); + } } diff --git a/Mage.Sets/src/mage/sets/magic2011/AuguryOwl.java b/Mage.Sets/src/mage/sets/magic2011/AuguryOwl.java index 077a6c2d76..baf0d33e0c 100644 --- a/Mage.Sets/src/mage/sets/magic2011/AuguryOwl.java +++ b/Mage.Sets/src/mage/sets/magic2011/AuguryOwl.java @@ -43,25 +43,25 @@ import mage.cards.CardImpl; */ public class AuguryOwl extends CardImpl { - public AuguryOwl(UUID ownerId) { - super(ownerId, 45, "Augury Owl", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{1}{U}"); - this.expansionSetCode = "M11"; - this.subtype.add("Bird"); - this.color.setBlue(true); - this.power = new MageInt(1); - this.toughness = new MageInt(1); + public AuguryOwl(UUID ownerId) { + super(ownerId, 45, "Augury Owl", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{1}{U}"); + this.expansionSetCode = "M11"; + this.subtype.add("Bird"); + this.color.setBlue(true); + this.power = new MageInt(1); + this.toughness = new MageInt(1); - this.addAbility(FlyingAbility.getInstance()); - this.addAbility(new EntersBattlefieldTriggeredAbility(new ScryEffect(3))); - } + this.addAbility(FlyingAbility.getInstance()); + this.addAbility(new EntersBattlefieldTriggeredAbility(new ScryEffect(3))); + } - public AuguryOwl(final AuguryOwl card) { - super(card); - } + public AuguryOwl(final AuguryOwl card) { + super(card); + } - @Override - public AuguryOwl copy() { - return new AuguryOwl(this); - } + @Override + public AuguryOwl copy() { + return new AuguryOwl(this); + } } diff --git a/Mage.Sets/src/mage/sets/magic2011/AutumnsVeil.java b/Mage.Sets/src/mage/sets/magic2011/AutumnsVeil.java index dc0c95508f..90ecf57766 100644 --- a/Mage.Sets/src/mage/sets/magic2011/AutumnsVeil.java +++ b/Mage.Sets/src/mage/sets/magic2011/AutumnsVeil.java @@ -46,32 +46,32 @@ import mage.filter.common.FilterCreaturePermanent; */ public class AutumnsVeil extends CardImpl { - private static final FilterSpell filterTarget1 = new FilterSpell("spells you control"); - private static final FilterCreaturePermanent filterTarget2 = new FilterCreaturePermanent(); - private static final FilterStackObject filterSource = new FilterStackObject("blue or black spells"); + private static final FilterSpell filterTarget1 = new FilterSpell("spells you control"); + private static final FilterCreaturePermanent filterTarget2 = new FilterCreaturePermanent(); + private static final FilterStackObject filterSource = new FilterStackObject("blue or black spells"); - static { - filterSource.getColor().setBlue(true); - filterSource.getColor().setBlack(true); - filterSource.setScopeColor(ComparisonScope.Any); - } + static { + filterSource.getColor().setBlue(true); + filterSource.getColor().setBlack(true); + filterSource.setScopeColor(ComparisonScope.Any); + } - public AutumnsVeil(UUID ownerId) { - super(ownerId, 162, "Autumn's Veil", Rarity.UNCOMMON, new CardType[]{CardType.INSTANT}, "{G}"); - this.expansionSetCode = "M11"; - this.color.setGreen(true); - this.getSpellAbility().addEffect(new CantCounterControlledEffect(filterTarget1, filterSource, Duration.EndOfTurn)); - this.getSpellAbility().addEffect(new CantTargetControlledEffect(filterTarget2, filterSource, Duration.EndOfTurn)); - } + public AutumnsVeil(UUID ownerId) { + super(ownerId, 162, "Autumn's Veil", Rarity.UNCOMMON, new CardType[]{CardType.INSTANT}, "{G}"); + this.expansionSetCode = "M11"; + this.color.setGreen(true); + this.getSpellAbility().addEffect(new CantCounterControlledEffect(filterTarget1, filterSource, Duration.EndOfTurn)); + this.getSpellAbility().addEffect(new CantTargetControlledEffect(filterTarget2, filterSource, Duration.EndOfTurn)); + } - public AutumnsVeil(final AutumnsVeil card) { - super(card); - } + public AutumnsVeil(final AutumnsVeil card) { + super(card); + } - @Override - public AutumnsVeil copy() { - return new AutumnsVeil(this); - } + @Override + public AutumnsVeil copy() { + return new AutumnsVeil(this); + } } diff --git a/Mage.Sets/src/mage/sets/magic2011/AwakenerDruid.java b/Mage.Sets/src/mage/sets/magic2011/AwakenerDruid.java index 6d0f5c9697..ea7f18d008 100644 --- a/Mage.Sets/src/mage/sets/magic2011/AwakenerDruid.java +++ b/Mage.Sets/src/mage/sets/magic2011/AwakenerDruid.java @@ -36,19 +36,19 @@ import java.util.UUID; */ public class AwakenerDruid extends mage.sets.magic2010.AwakenerDruid { - public AwakenerDruid(UUID ownerId) { - super(ownerId); - this.cardNumber = 163; - this.expansionSetCode = "M11"; - } + public AwakenerDruid(UUID ownerId) { + super(ownerId); + this.cardNumber = 163; + this.expansionSetCode = "M11"; + } - public AwakenerDruid(final AwakenerDruid card) { - super(card); - } + public AwakenerDruid(final AwakenerDruid card) { + super(card); + } - @Override - public AwakenerDruid copy() { - return new AwakenerDruid(this); - } + @Override + public AwakenerDruid copy() { + return new AwakenerDruid(this); + } } diff --git a/Mage.Sets/src/mage/sets/magic2011/AzureDrake.java b/Mage.Sets/src/mage/sets/magic2011/AzureDrake.java index d86f06352d..3c5cb6ed1a 100644 --- a/Mage.Sets/src/mage/sets/magic2011/AzureDrake.java +++ b/Mage.Sets/src/mage/sets/magic2011/AzureDrake.java @@ -41,24 +41,24 @@ import mage.cards.CardImpl; */ public class AzureDrake extends CardImpl { - public AzureDrake(UUID ownerId) { - super(ownerId, 46, "Azure Drake", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{3}{U}"); - this.expansionSetCode = "M11"; - this.color.setBlue(true); - this.subtype.add("Drake"); - this.power = new MageInt(2); - this.toughness = new MageInt(4); + public AzureDrake(UUID ownerId) { + super(ownerId, 46, "Azure Drake", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{3}{U}"); + this.expansionSetCode = "M11"; + this.color.setBlue(true); + this.subtype.add("Drake"); + this.power = new MageInt(2); + this.toughness = new MageInt(4); - this.addAbility(FlyingAbility.getInstance()); - } + this.addAbility(FlyingAbility.getInstance()); + } - public AzureDrake(final AzureDrake card) { - super(card); - } + public AzureDrake(final AzureDrake card) { + super(card); + } - @Override - public AzureDrake copy() { - return new AzureDrake(this); - } + @Override + public AzureDrake copy() { + return new AzureDrake(this); + } } diff --git a/Mage.Sets/src/mage/sets/magic2011/BackToNature.java b/Mage.Sets/src/mage/sets/magic2011/BackToNature.java index b203d19e3a..ddd32fc82e 100644 --- a/Mage.Sets/src/mage/sets/magic2011/BackToNature.java +++ b/Mage.Sets/src/mage/sets/magic2011/BackToNature.java @@ -41,26 +41,26 @@ import mage.filter.FilterPermanent; */ public class BackToNature extends CardImpl { - private static final FilterPermanent filter = new FilterPermanent("enchantments"); + private static final FilterPermanent filter = new FilterPermanent("enchantments"); - static { - filter.getCardType().add(CardType.ENCHANTMENT); - } + static { + filter.getCardType().add(CardType.ENCHANTMENT); + } - public BackToNature(UUID ownerId) { - super(ownerId, 164, "Back to Nature", Rarity.UNCOMMON, new CardType[]{CardType.INSTANT}, "{1}{G}"); - this.expansionSetCode = "M11"; - this.color.setGreen(true); - this.getSpellAbility().addEffect(new DestroyAllEffect(filter)); - } + public BackToNature(UUID ownerId) { + super(ownerId, 164, "Back to Nature", Rarity.UNCOMMON, new CardType[]{CardType.INSTANT}, "{1}{G}"); + this.expansionSetCode = "M11"; + this.color.setGreen(true); + this.getSpellAbility().addEffect(new DestroyAllEffect(filter)); + } - public BackToNature(final BackToNature card) { - super(card); - } + public BackToNature(final BackToNature card) { + super(card); + } - @Override - public BackToNature copy() { - return new BackToNature(this); - } + @Override + public BackToNature copy() { + return new BackToNature(this); + } } diff --git a/Mage.Sets/src/mage/sets/magic2011/BaneslayerAngel.java b/Mage.Sets/src/mage/sets/magic2011/BaneslayerAngel.java index efeb8331ef..1cce5c2537 100644 --- a/Mage.Sets/src/mage/sets/magic2011/BaneslayerAngel.java +++ b/Mage.Sets/src/mage/sets/magic2011/BaneslayerAngel.java @@ -36,19 +36,19 @@ import java.util.UUID; */ public class BaneslayerAngel extends mage.sets.magic2010.BaneslayerAngel { - public BaneslayerAngel(UUID ownerId) { - super(ownerId); - this.cardNumber = 7; - this.expansionSetCode = "M11"; - } + public BaneslayerAngel(UUID ownerId) { + super(ownerId); + this.cardNumber = 7; + this.expansionSetCode = "M11"; + } - public BaneslayerAngel(final BaneslayerAngel card) { - super(card); - } + public BaneslayerAngel(final BaneslayerAngel card) { + super(card); + } - @Override - public BaneslayerAngel copy() { - return new BaneslayerAngel(this); - } + @Override + public BaneslayerAngel copy() { + return new BaneslayerAngel(this); + } } \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/magic2011/BaronyVampire.java b/Mage.Sets/src/mage/sets/magic2011/BaronyVampire.java index 9588c98794..1a51ecaf06 100644 --- a/Mage.Sets/src/mage/sets/magic2011/BaronyVampire.java +++ b/Mage.Sets/src/mage/sets/magic2011/BaronyVampire.java @@ -40,22 +40,22 @@ import mage.cards.CardImpl; */ public class BaronyVampire extends CardImpl { - public BaronyVampire(UUID ownerId) { - super(ownerId, 82, "Barony Vampire", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{2}{B}"); - this.expansionSetCode = "M11"; - this.color.setBlack(true); - this.subtype.add("Vampire"); - this.power = new MageInt(3); - this.toughness = new MageInt(2); - } + public BaronyVampire(UUID ownerId) { + super(ownerId, 82, "Barony Vampire", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{2}{B}"); + this.expansionSetCode = "M11"; + this.color.setBlack(true); + this.subtype.add("Vampire"); + this.power = new MageInt(3); + this.toughness = new MageInt(2); + } - public BaronyVampire(final BaronyVampire card) { - super(card); - } + public BaronyVampire(final BaronyVampire card) { + super(card); + } - @Override - public BaronyVampire copy() { - return new BaronyVampire(this); - } + @Override + public BaronyVampire copy() { + return new BaronyVampire(this); + } } diff --git a/Mage.Sets/src/mage/sets/magic2011/BerserkersOfBloodRidge.java b/Mage.Sets/src/mage/sets/magic2011/BerserkersOfBloodRidge.java index 84946ddd97..c498499ee1 100644 --- a/Mage.Sets/src/mage/sets/magic2011/BerserkersOfBloodRidge.java +++ b/Mage.Sets/src/mage/sets/magic2011/BerserkersOfBloodRidge.java @@ -36,19 +36,19 @@ import java.util.UUID; */ public class BerserkersOfBloodRidge extends mage.sets.magic2010.BerserkersOfBloodRidge { - public BerserkersOfBloodRidge(UUID ownerId) { - super(ownerId); - this.cardNumber = 124; - this.expansionSetCode = "M11"; - } + public BerserkersOfBloodRidge(UUID ownerId) { + super(ownerId); + this.cardNumber = 124; + this.expansionSetCode = "M11"; + } - public BerserkersOfBloodRidge(final BerserkersOfBloodRidge card) { - super(card); - } + public BerserkersOfBloodRidge(final BerserkersOfBloodRidge card) { + super(card); + } - @Override - public BerserkersOfBloodRidge copy() { - return new BerserkersOfBloodRidge(this); - } + @Override + public BerserkersOfBloodRidge copy() { + return new BerserkersOfBloodRidge(this); + } } \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/magic2011/BirdsOfParadise.java b/Mage.Sets/src/mage/sets/magic2011/BirdsOfParadise.java index 4999ce980c..dfd175e284 100644 --- a/Mage.Sets/src/mage/sets/magic2011/BirdsOfParadise.java +++ b/Mage.Sets/src/mage/sets/magic2011/BirdsOfParadise.java @@ -36,19 +36,19 @@ import java.util.UUID; */ public class BirdsOfParadise extends mage.sets.tenth.BirdsOfParadise { - public BirdsOfParadise(UUID ownerId) { - super(ownerId); - this.cardNumber = 165; - this.expansionSetCode = "M11"; - } + public BirdsOfParadise(UUID ownerId) { + super(ownerId); + this.cardNumber = 165; + this.expansionSetCode = "M11"; + } - public BirdsOfParadise(final BirdsOfParadise card) { - super(card); - } + public BirdsOfParadise(final BirdsOfParadise card) { + super(card); + } - @Override - public BirdsOfParadise copy() { - return new BirdsOfParadise(this); - } + @Override + public BirdsOfParadise copy() { + return new BirdsOfParadise(this); + } } diff --git a/Mage.Sets/src/mage/sets/magic2011/BlackKnight.java b/Mage.Sets/src/mage/sets/magic2011/BlackKnight.java index b586761c64..d8385d1ea7 100644 --- a/Mage.Sets/src/mage/sets/magic2011/BlackKnight.java +++ b/Mage.Sets/src/mage/sets/magic2011/BlackKnight.java @@ -36,19 +36,19 @@ import java.util.UUID; */ public class BlackKnight extends mage.sets.magic2010.BlackKnight { - public BlackKnight(UUID ownerId) { - super(ownerId); - this.cardNumber = 83; - this.expansionSetCode = "M11"; - } + public BlackKnight(UUID ownerId) { + super(ownerId); + this.cardNumber = 83; + this.expansionSetCode = "M11"; + } - public BlackKnight(final BlackKnight card) { - super(card); - } + public BlackKnight(final BlackKnight card) { + super(card); + } - @Override - public BlackKnight copy() { - return new BlackKnight(this); - } + @Override + public BlackKnight copy() { + return new BlackKnight(this); + } } diff --git a/Mage.Sets/src/mage/sets/magic2011/BlindingMage.java b/Mage.Sets/src/mage/sets/magic2011/BlindingMage.java index 5c88af3824..708ba6fc41 100644 --- a/Mage.Sets/src/mage/sets/magic2011/BlindingMage.java +++ b/Mage.Sets/src/mage/sets/magic2011/BlindingMage.java @@ -36,19 +36,19 @@ import java.util.UUID; */ public class BlindingMage extends mage.sets.magic2010.BlindingMage { - public BlindingMage(UUID ownerId) { - super(ownerId); - this.cardNumber = 8; - this.expansionSetCode = "M11"; - } + public BlindingMage(UUID ownerId) { + super(ownerId); + this.cardNumber = 8; + this.expansionSetCode = "M11"; + } - public BlindingMage(final BlindingMage card) { - super(card); - } + public BlindingMage(final BlindingMage card) { + super(card); + } - @Override - public BlindingMage copy() { - return new BlindingMage(this); - } + @Override + public BlindingMage copy() { + return new BlindingMage(this); + } } diff --git a/Mage.Sets/src/mage/sets/magic2011/BloodTithe.java b/Mage.Sets/src/mage/sets/magic2011/BloodTithe.java index 217f879ffd..d98c0b1953 100644 --- a/Mage.Sets/src/mage/sets/magic2011/BloodTithe.java +++ b/Mage.Sets/src/mage/sets/magic2011/BloodTithe.java @@ -43,49 +43,49 @@ import mage.game.Game; */ public class BloodTithe extends CardImpl { - public BloodTithe(UUID ownerId) { - super(ownerId, 84, "Blood Tithe", Rarity.COMMON, new CardType[]{CardType.SORCERY}, "{3}{B}"); - this.expansionSetCode = "M11"; - this.getColor().setBlack(true); + public BloodTithe(UUID ownerId) { + super(ownerId, 84, "Blood Tithe", Rarity.COMMON, new CardType[]{CardType.SORCERY}, "{3}{B}"); + this.expansionSetCode = "M11"; + this.getColor().setBlack(true); - this.getSpellAbility().addEffect(new BloodTitheEffect()); - } + this.getSpellAbility().addEffect(new BloodTitheEffect()); + } - public BloodTithe(final BloodTithe card) { - super(card); - } + public BloodTithe(final BloodTithe card) { + super(card); + } - @Override - public BloodTithe copy() { - return new BloodTithe(this); - } + @Override + public BloodTithe copy() { + return new BloodTithe(this); + } } class BloodTitheEffect extends OneShotEffect { - public BloodTitheEffect() { - super(Outcome.Damage); - staticText = "Each opponent loses 3 life. You gain life equal to the life lost this way"; - } + public BloodTitheEffect() { + super(Outcome.Damage); + staticText = "Each opponent loses 3 life. You gain life equal to the life lost this way"; + } - public BloodTitheEffect(final BloodTitheEffect effect) { - super(effect); - } + public BloodTitheEffect(final BloodTitheEffect effect) { + super(effect); + } - @Override - public boolean apply(Game game, Ability source) { - int damage = 0; - for (UUID opponentId: game.getOpponents(source.getControllerId())) { - damage += game.getPlayer(opponentId).damage(3, source.getSourceId(), game, false, true); - } - game.getPlayer(source.getControllerId()).gainLife(damage, game); - return true; - } + @Override + public boolean apply(Game game, Ability source) { + int damage = 0; + for (UUID opponentId: game.getOpponents(source.getControllerId())) { + damage += game.getPlayer(opponentId).damage(3, source.getSourceId(), game, false, true); + } + game.getPlayer(source.getControllerId()).gainLife(damage, game); + return true; + } - @Override - public BloodTitheEffect copy() { - return new BloodTitheEffect(this); - } + @Override + public BloodTitheEffect copy() { + return new BloodTitheEffect(this); + } } \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/magic2011/BloodcrazedGoblin.java b/Mage.Sets/src/mage/sets/magic2011/BloodcrazedGoblin.java index 28145ada0d..fd623342b1 100644 --- a/Mage.Sets/src/mage/sets/magic2011/BloodcrazedGoblin.java +++ b/Mage.Sets/src/mage/sets/magic2011/BloodcrazedGoblin.java @@ -49,26 +49,26 @@ import mage.watchers.common.BloodthirstWatcher; */ public class BloodcrazedGoblin extends CardImpl { - public BloodcrazedGoblin(UUID ownerId) { - super(ownerId, 125, "Bloodcrazed Goblin", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{R}"); - this.expansionSetCode = "M11"; - this.subtype.add("Goblin"); - this.subtype.add("Berserker"); - this.color.setRed(true); - this.power = new MageInt(2); - this.toughness = new MageInt(2); + public BloodcrazedGoblin(UUID ownerId) { + super(ownerId, 125, "Bloodcrazed Goblin", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{R}"); + this.expansionSetCode = "M11"; + this.subtype.add("Goblin"); + this.subtype.add("Berserker"); + this.color.setRed(true); + this.power = new MageInt(2); + this.toughness = new MageInt(2); - this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BloodcrazedGoblinEffect())); - } + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BloodcrazedGoblinEffect())); + } - public BloodcrazedGoblin(final BloodcrazedGoblin card) { - super(card); - } + public BloodcrazedGoblin(final BloodcrazedGoblin card) { + super(card); + } - @Override - public BloodcrazedGoblin copy() { - return new BloodcrazedGoblin(this); - } + @Override + public BloodcrazedGoblin copy() { + return new BloodcrazedGoblin(this); + } } diff --git a/Mage.Sets/src/mage/sets/magic2011/BloodthroneVampire.java b/Mage.Sets/src/mage/sets/magic2011/BloodthroneVampire.java index 2890866f92..277a995730 100644 --- a/Mage.Sets/src/mage/sets/magic2011/BloodthroneVampire.java +++ b/Mage.Sets/src/mage/sets/magic2011/BloodthroneVampire.java @@ -36,19 +36,19 @@ import java.util.UUID; */ public class BloodthroneVampire extends mage.sets.riseoftheeldrazi.BloodthroneVampire { - public BloodthroneVampire(UUID ownerId) { - super(ownerId); - this.cardNumber = 85; - this.expansionSetCode = "M11"; - } + public BloodthroneVampire(UUID ownerId) { + super(ownerId); + this.cardNumber = 85; + this.expansionSetCode = "M11"; + } - public BloodthroneVampire(final BloodthroneVampire card) { - super(card); - } + public BloodthroneVampire(final BloodthroneVampire card) { + super(card); + } - @Override - public BloodthroneVampire copy() { - return new BloodthroneVampire(this); - } + @Override + public BloodthroneVampire copy() { + return new BloodthroneVampire(this); + } } \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/magic2011/BogRaiders.java b/Mage.Sets/src/mage/sets/magic2011/BogRaiders.java index f56f8f959c..e51ab73ec2 100644 --- a/Mage.Sets/src/mage/sets/magic2011/BogRaiders.java +++ b/Mage.Sets/src/mage/sets/magic2011/BogRaiders.java @@ -41,23 +41,23 @@ import mage.cards.CardImpl; */ public class BogRaiders extends CardImpl { - public BogRaiders(UUID ownerId) { - super(ownerId, 86, "Bog Raiders", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{2}{B}"); - this.expansionSetCode = "M11"; - this.color.setBlack(true); - this.subtype.add("Zombie"); - this.power = new MageInt(2); - this.toughness = new MageInt(2); - this.addAbility(new SwampwalkAbility()); - } + public BogRaiders(UUID ownerId) { + super(ownerId, 86, "Bog Raiders", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{2}{B}"); + this.expansionSetCode = "M11"; + this.color.setBlack(true); + this.subtype.add("Zombie"); + this.power = new MageInt(2); + this.toughness = new MageInt(2); + this.addAbility(new SwampwalkAbility()); + } - public BogRaiders(final BogRaiders card) { - super(card); - } + public BogRaiders(final BogRaiders card) { + super(card); + } - @Override - public BogRaiders copy() { - return new BogRaiders(this); - } + @Override + public BogRaiders copy() { + return new BogRaiders(this); + } } diff --git a/Mage.Sets/src/mage/sets/magic2011/BrindleBoar.java b/Mage.Sets/src/mage/sets/magic2011/BrindleBoar.java index 046ca874db..818e44597d 100644 --- a/Mage.Sets/src/mage/sets/magic2011/BrindleBoar.java +++ b/Mage.Sets/src/mage/sets/magic2011/BrindleBoar.java @@ -44,24 +44,24 @@ import mage.cards.CardImpl; */ public class BrindleBoar extends CardImpl { - public BrindleBoar(UUID ownerId) { - super(ownerId, 166, "Brindle Boar", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{2}{G}"); - this.expansionSetCode = "M11"; - this.color.setGreen(true); - this.subtype.add("Boar"); - this.power = new MageInt(2); - this.toughness = new MageInt(2); + public BrindleBoar(UUID ownerId) { + super(ownerId, 166, "Brindle Boar", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{2}{G}"); + this.expansionSetCode = "M11"; + this.color.setGreen(true); + this.subtype.add("Boar"); + this.power = new MageInt(2); + this.toughness = new MageInt(2); - this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new GainLifeEffect(4), new SacrificeSourceCost())); - } + this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new GainLifeEffect(4), new SacrificeSourceCost())); + } - public BrindleBoar(final BrindleBoar card) { - super(card); - } + public BrindleBoar(final BrindleBoar card) { + super(card); + } - @Override - public BrindleBoar copy() { - return new BrindleBoar(this); - } + @Override + public BrindleBoar copy() { + return new BrindleBoar(this); + } } diff --git a/Mage.Sets/src/mage/sets/magic2011/BrittleEffigy.java b/Mage.Sets/src/mage/sets/magic2011/BrittleEffigy.java index 3dc7d2189a..b33ffb33db 100644 --- a/Mage.Sets/src/mage/sets/magic2011/BrittleEffigy.java +++ b/Mage.Sets/src/mage/sets/magic2011/BrittleEffigy.java @@ -49,25 +49,25 @@ import mage.target.common.TargetCreaturePermanent; */ public class BrittleEffigy extends CardImpl { - public BrittleEffigy(UUID ownerId) { - super(ownerId, 202, "Brittle Effigy", Rarity.RARE, new CardType[]{CardType.ARTIFACT}, "{1}"); - this.expansionSetCode = "M11"; - Costs costs = new CostsImpl(); - costs.add(new TapSourceCost()); - costs.add(new ExileSourceCost()); - Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new ExileTargetEffect(), costs); + public BrittleEffigy(UUID ownerId) { + super(ownerId, 202, "Brittle Effigy", Rarity.RARE, new CardType[]{CardType.ARTIFACT}, "{1}"); + this.expansionSetCode = "M11"; + Costs costs = new CostsImpl(); + costs.add(new TapSourceCost()); + costs.add(new ExileSourceCost()); + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new ExileTargetEffect(), costs); ability.addManaCost(new GenericManaCost(4)); - ability.addTarget(new TargetCreaturePermanent()); - this.addAbility(ability); - } + ability.addTarget(new TargetCreaturePermanent()); + this.addAbility(ability); + } - public BrittleEffigy(final BrittleEffigy card) { - super(card); - } + public BrittleEffigy(final BrittleEffigy card) { + super(card); + } - @Override - public BrittleEffigy copy() { - return new BrittleEffigy(this); - } + @Override + public BrittleEffigy copy() { + return new BrittleEffigy(this); + } } diff --git a/Mage.Sets/src/mage/sets/magic2011/CallToMind.java b/Mage.Sets/src/mage/sets/magic2011/CallToMind.java index 7c5b339723..d6b37ece79 100644 --- a/Mage.Sets/src/mage/sets/magic2011/CallToMind.java +++ b/Mage.Sets/src/mage/sets/magic2011/CallToMind.java @@ -43,30 +43,30 @@ import mage.target.common.TargetCardInYourGraveyard; */ public class CallToMind extends CardImpl { - private static final FilterCard filter = new FilterCard("instant or sorcery card from your graveyard"); + private static final FilterCard filter = new FilterCard("instant or sorcery card from your graveyard"); - static { - filter.getCardType().add(CardType.INSTANT); - filter.getCardType().add(CardType.SORCERY); - filter.setScopeCardType(ComparisonScope.Any); - } + static { + filter.getCardType().add(CardType.INSTANT); + filter.getCardType().add(CardType.SORCERY); + filter.setScopeCardType(ComparisonScope.Any); + } - public CallToMind(UUID ownerId) { - super(ownerId, 47, "Call to Mind", Rarity.UNCOMMON, new CardType[]{CardType.SORCERY}, "{2}{U}"); - this.expansionSetCode = "M11"; - this.color.setBlue(true); + public CallToMind(UUID ownerId) { + super(ownerId, 47, "Call to Mind", Rarity.UNCOMMON, new CardType[]{CardType.SORCERY}, "{2}{U}"); + this.expansionSetCode = "M11"; + this.color.setBlue(true); - this.getSpellAbility().addEffect(new ReturnToHandTargetEffect()); - this.getSpellAbility().addTarget(new TargetCardInYourGraveyard(filter)); - } + this.getSpellAbility().addEffect(new ReturnToHandTargetEffect()); + this.getSpellAbility().addTarget(new TargetCardInYourGraveyard(filter)); + } - public CallToMind(final CallToMind card) { - super(card); - } + public CallToMind(final CallToMind card) { + super(card); + } - @Override - public CallToMind copy() { - return new CallToMind(this); - } + @Override + public CallToMind copy() { + return new CallToMind(this); + } } diff --git a/Mage.Sets/src/mage/sets/magic2011/Cancel.java b/Mage.Sets/src/mage/sets/magic2011/Cancel.java index 7700828003..744e116896 100644 --- a/Mage.Sets/src/mage/sets/magic2011/Cancel.java +++ b/Mage.Sets/src/mage/sets/magic2011/Cancel.java @@ -36,19 +36,19 @@ import java.util.UUID; */ public class Cancel extends mage.sets.tenth.Cancel { - public Cancel(UUID ownerId) { - super(ownerId); - this.cardNumber = 48; - this.expansionSetCode = "M11"; - } + public Cancel(UUID ownerId) { + super(ownerId); + this.cardNumber = 48; + this.expansionSetCode = "M11"; + } - public Cancel(final Cancel card) { - super(card); - } + public Cancel(final Cancel card) { + super(card); + } - @Override - public Cancel copy() { - return new Cancel(this); - } + @Override + public Cancel copy() { + return new Cancel(this); + } } diff --git a/Mage.Sets/src/mage/sets/magic2011/CanyonMinotaur.java b/Mage.Sets/src/mage/sets/magic2011/CanyonMinotaur.java index 22c37dcb51..067f9989ed 100644 --- a/Mage.Sets/src/mage/sets/magic2011/CanyonMinotaur.java +++ b/Mage.Sets/src/mage/sets/magic2011/CanyonMinotaur.java @@ -36,19 +36,19 @@ import java.util.UUID; */ public class CanyonMinotaur extends mage.sets.conflux.CanyonMinotaur { - public CanyonMinotaur(UUID ownerId) { - super(ownerId); - this.cardNumber = 126; - this.expansionSetCode = "M11"; - } + public CanyonMinotaur(UUID ownerId) { + super(ownerId); + this.cardNumber = 126; + this.expansionSetCode = "M11"; + } - public CanyonMinotaur(final CanyonMinotaur card) { - super(card); - } + public CanyonMinotaur(final CanyonMinotaur card) { + super(card); + } - @Override - public CanyonMinotaur copy() { - return new CanyonMinotaur(this); - } + @Override + public CanyonMinotaur copy() { + return new CanyonMinotaur(this); + } } diff --git a/Mage.Sets/src/mage/sets/magic2011/CaptivatingVampire.java b/Mage.Sets/src/mage/sets/magic2011/CaptivatingVampire.java index e3bd9ebb91..55a593ad8d 100644 --- a/Mage.Sets/src/mage/sets/magic2011/CaptivatingVampire.java +++ b/Mage.Sets/src/mage/sets/magic2011/CaptivatingVampire.java @@ -57,86 +57,86 @@ import mage.target.common.TargetCreaturePermanent; */ public class CaptivatingVampire extends CardImpl { - private static final FilterCreaturePermanent filter1 = new FilterCreaturePermanent("Vampire creatures"); - private static final FilterControlledCreaturePermanent filter2 = new FilterControlledCreaturePermanent("untapped Vampires you control"); + private static final FilterCreaturePermanent filter1 = new FilterCreaturePermanent("Vampire creatures"); + private static final FilterControlledCreaturePermanent filter2 = new FilterControlledCreaturePermanent("untapped Vampires you control"); - static { - filter1.getSubtype().add("Vampire"); - filter2.getSubtype().add("Vampire"); - filter2.setTapped(false); - filter2.setUseTapped(true); - } + static { + filter1.getSubtype().add("Vampire"); + filter2.getSubtype().add("Vampire"); + filter2.setTapped(false); + filter2.setUseTapped(true); + } - public CaptivatingVampire(UUID ownerId) { - super(ownerId, 87, "Captivating Vampire", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{1}{B}{B}"); - this.expansionSetCode = "M11"; - this.color.setBlack(true); - this.subtype.add("Vampire"); - this.power = new MageInt(2); - this.toughness = new MageInt(2); + public CaptivatingVampire(UUID ownerId) { + super(ownerId, 87, "Captivating Vampire", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{1}{B}{B}"); + this.expansionSetCode = "M11"; + this.color.setBlack(true); + this.subtype.add("Vampire"); + this.power = new MageInt(2); + this.toughness = new MageInt(2); - this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostControlledEffect(1, 1, Duration.WhileOnBattlefield, filter1, true))); - Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new CaptivatingVampireEffect(), new TapTargetCost(new TargetControlledCreaturePermanent(5, 5, filter2, true))); - ability.addTarget(new TargetCreaturePermanent()); - this.addAbility(ability); - } + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostControlledEffect(1, 1, Duration.WhileOnBattlefield, filter1, true))); + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new CaptivatingVampireEffect(), new TapTargetCost(new TargetControlledCreaturePermanent(5, 5, filter2, true))); + ability.addTarget(new TargetCreaturePermanent()); + this.addAbility(ability); + } - public CaptivatingVampire(final CaptivatingVampire card) { - super(card); - } + public CaptivatingVampire(final CaptivatingVampire card) { + super(card); + } - @Override - public CaptivatingVampire copy() { - return new CaptivatingVampire(this); - } + @Override + public CaptivatingVampire copy() { + return new CaptivatingVampire(this); + } } class CaptivatingVampireEffect extends ContinuousEffectImpl { - public CaptivatingVampireEffect() { - super(Duration.WhileOnBattlefield, Outcome.Detriment); - staticText = "Gain control of target creature. It becomes a Vampire in addition to its other types"; - } + public CaptivatingVampireEffect() { + super(Duration.WhileOnBattlefield, Outcome.Detriment); + staticText = "Gain control of target creature. It becomes a Vampire in addition to its other types"; + } - public CaptivatingVampireEffect(final CaptivatingVampireEffect effect) { - super(effect); - } + public CaptivatingVampireEffect(final CaptivatingVampireEffect effect) { + super(effect); + } - @Override - public CaptivatingVampireEffect copy() { - return new CaptivatingVampireEffect(this); - } + @Override + public CaptivatingVampireEffect copy() { + return new CaptivatingVampireEffect(this); + } - @Override - public boolean apply(Layer layer, SubLayer sublayer, Ability source, Game game) { - Permanent permanent = game.getPermanent(source.getFirstTarget()); - if (permanent != null) { - switch (layer) { - case ControlChangingEffects_2: - if (sublayer == SubLayer.NA) { - permanent.changeControllerId(source.getControllerId(), game); - } - break; - case TypeChangingEffects_4: - if (sublayer == SubLayer.NA) { - permanent.getSubtype().add("Vampire"); - } - break; - } - return true; - } - return false; - } + @Override + public boolean apply(Layer layer, SubLayer sublayer, Ability source, Game game) { + Permanent permanent = game.getPermanent(source.getFirstTarget()); + if (permanent != null) { + switch (layer) { + case ControlChangingEffects_2: + if (sublayer == SubLayer.NA) { + permanent.changeControllerId(source.getControllerId(), game); + } + break; + case TypeChangingEffects_4: + if (sublayer == SubLayer.NA) { + permanent.getSubtype().add("Vampire"); + } + break; + } + return true; + } + return false; + } - @Override - public boolean apply(Game game, Ability source) { - return false; - } + @Override + public boolean apply(Game game, Ability source) { + return false; + } - @Override - public boolean hasLayer(Layer layer) { - return layer == Layer.ControlChangingEffects_2 || layer == layer.TypeChangingEffects_4; - } + @Override + public boolean hasLayer(Layer layer) { + return layer == Layer.ControlChangingEffects_2 || layer == layer.TypeChangingEffects_4; + } } \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/magic2011/CelestialPurge.java b/Mage.Sets/src/mage/sets/magic2011/CelestialPurge.java index 08af68d6de..18b36b5db9 100644 --- a/Mage.Sets/src/mage/sets/magic2011/CelestialPurge.java +++ b/Mage.Sets/src/mage/sets/magic2011/CelestialPurge.java @@ -36,19 +36,19 @@ import java.util.UUID; */ public class CelestialPurge extends mage.sets.conflux.CelestialPurge { - public CelestialPurge(UUID ownerId) { - super(ownerId); - this.cardNumber = 9; - this.expansionSetCode = "M11"; - } + public CelestialPurge(UUID ownerId) { + super(ownerId); + this.cardNumber = 9; + this.expansionSetCode = "M11"; + } - public CelestialPurge(final CelestialPurge card) { - super(card); - } + public CelestialPurge(final CelestialPurge card) { + super(card); + } - @Override - public CelestialPurge copy() { - return new CelestialPurge(this); - } + @Override + public CelestialPurge copy() { + return new CelestialPurge(this); + } } diff --git a/Mage.Sets/src/mage/sets/magic2011/ChandraNalaar.java b/Mage.Sets/src/mage/sets/magic2011/ChandraNalaar.java index 9f3c4bbc7e..c2b7a23d3c 100644 --- a/Mage.Sets/src/mage/sets/magic2011/ChandraNalaar.java +++ b/Mage.Sets/src/mage/sets/magic2011/ChandraNalaar.java @@ -36,19 +36,19 @@ import java.util.UUID; */ public class ChandraNalaar extends mage.sets.magic2010.ChandraNalaar { - public ChandraNalaar(UUID ownerId) { - super(ownerId); - this.cardNumber = 127; - this.expansionSetCode = "M11"; - } + public ChandraNalaar(UUID ownerId) { + super(ownerId); + this.cardNumber = 127; + this.expansionSetCode = "M11"; + } - public ChandraNalaar(final ChandraNalaar card) { - super(card); - } + public ChandraNalaar(final ChandraNalaar card) { + super(card); + } - @Override - public ChandraNalaar copy() { - return new ChandraNalaar(this); - } + @Override + public ChandraNalaar copy() { + return new ChandraNalaar(this); + } } diff --git a/Mage.Sets/src/mage/sets/magic2011/ChandrasOutrage.java b/Mage.Sets/src/mage/sets/magic2011/ChandrasOutrage.java index f4a71eef9d..200cfcbd07 100644 --- a/Mage.Sets/src/mage/sets/magic2011/ChandrasOutrage.java +++ b/Mage.Sets/src/mage/sets/magic2011/ChandrasOutrage.java @@ -46,53 +46,53 @@ import mage.target.common.TargetCreaturePermanent; */ public class ChandrasOutrage extends CardImpl { - public ChandrasOutrage(UUID ownerId) { - super(ownerId, 128, "Chandra's Outrage", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{2}{R}{R}"); - this.expansionSetCode = "M11"; - this.color.setRed(true); - this.getSpellAbility().addEffect(new ChandrasOutrageEffect()); - this.getSpellAbility().addTarget(new TargetCreaturePermanent()); - } + public ChandrasOutrage(UUID ownerId) { + super(ownerId, 128, "Chandra's Outrage", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{2}{R}{R}"); + this.expansionSetCode = "M11"; + this.color.setRed(true); + this.getSpellAbility().addEffect(new ChandrasOutrageEffect()); + this.getSpellAbility().addTarget(new TargetCreaturePermanent()); + } - public ChandrasOutrage(final ChandrasOutrage card) { - super(card); - } + public ChandrasOutrage(final ChandrasOutrage card) { + super(card); + } - @Override - public ChandrasOutrage copy() { - return new ChandrasOutrage(this); - } + @Override + public ChandrasOutrage copy() { + return new ChandrasOutrage(this); + } } class ChandrasOutrageEffect extends OneShotEffect { - public ChandrasOutrageEffect() { - super(Outcome.Damage); - staticText = "{this} deals 4 damage to target creature and 2 damage to that creature's controller"; - } + public ChandrasOutrageEffect() { + super(Outcome.Damage); + staticText = "{this} deals 4 damage to target creature and 2 damage to that creature's controller"; + } - public ChandrasOutrageEffect(final ChandrasOutrageEffect effect) { - super(effect); - } - - @Override - public boolean apply(Game game, Ability source) { - Permanent permanent = game.getPermanent(source.getFirstTarget()); - if (permanent != null) { - Player player = game.getPlayer(permanent.getControllerId()); - if (player != null) { - permanent.damage(4, source.getSourceId(), game, true, false); - player.damage(2, source.getSourceId(), game, false, true); - return true; - } - } - return false; - } + public ChandrasOutrageEffect(final ChandrasOutrageEffect effect) { + super(effect); + } - @Override - public ChandrasOutrageEffect copy() { - return new ChandrasOutrageEffect(this); - } + @Override + public boolean apply(Game game, Ability source) { + Permanent permanent = game.getPermanent(source.getFirstTarget()); + if (permanent != null) { + Player player = game.getPlayer(permanent.getControllerId()); + if (player != null) { + permanent.damage(4, source.getSourceId(), game, true, false); + player.damage(2, source.getSourceId(), game, false, true); + return true; + } + } + return false; + } + + @Override + public ChandrasOutrageEffect copy() { + return new ChandrasOutrageEffect(this); + } } \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/magic2011/ChandrasSpitfire.java b/Mage.Sets/src/mage/sets/magic2011/ChandrasSpitfire.java index 3d053581f8..fa17e84da9 100644 --- a/Mage.Sets/src/mage/sets/magic2011/ChandrasSpitfire.java +++ b/Mage.Sets/src/mage/sets/magic2011/ChandrasSpitfire.java @@ -48,58 +48,58 @@ import mage.game.events.GameEvent; */ public class ChandrasSpitfire extends CardImpl { - public ChandrasSpitfire(UUID ownerId) { - super(ownerId, 129, "Chandra's Spitfire", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{2}{R}"); - this.expansionSetCode = "M11"; - this.subtype.add("Elemental"); - this.color.setRed(true); - this.power = new MageInt(1); - this.toughness = new MageInt(3); + public ChandrasSpitfire(UUID ownerId) { + super(ownerId, 129, "Chandra's Spitfire", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{2}{R}"); + this.expansionSetCode = "M11"; + this.subtype.add("Elemental"); + this.color.setRed(true); + this.power = new MageInt(1); + this.toughness = new MageInt(3); - this.addAbility(FlyingAbility.getInstance()); - this.addAbility(new ChandrasSpitfireAbility()); - } + this.addAbility(FlyingAbility.getInstance()); + this.addAbility(new ChandrasSpitfireAbility()); + } - public ChandrasSpitfire(final ChandrasSpitfire card) { - super(card); - } + public ChandrasSpitfire(final ChandrasSpitfire card) { + super(card); + } - @Override - public ChandrasSpitfire copy() { - return new ChandrasSpitfire(this); - } + @Override + public ChandrasSpitfire copy() { + return new ChandrasSpitfire(this); + } } class ChandrasSpitfireAbility extends TriggeredAbilityImpl { - public ChandrasSpitfireAbility() { - super(Zone.BATTLEFIELD, new BoostSourceEffect(3, 0, Duration.EndOfTurn), false); - } + public ChandrasSpitfireAbility() { + super(Zone.BATTLEFIELD, new BoostSourceEffect(3, 0, Duration.EndOfTurn), false); + } - public ChandrasSpitfireAbility(final ChandrasSpitfireAbility ability) { - super(ability); - } + public ChandrasSpitfireAbility(final ChandrasSpitfireAbility ability) { + super(ability); + } - @Override - public boolean checkTrigger(GameEvent event, Game game) { - if (event instanceof DamagedPlayerEvent) { - DamagedPlayerEvent damageEvent = (DamagedPlayerEvent)event; - if (!damageEvent.isCombatDamage() && game.getOpponents(controllerId).contains(event.getTargetId())) { - return true; - } - } - return false; - } + @Override + public boolean checkTrigger(GameEvent event, Game game) { + if (event instanceof DamagedPlayerEvent) { + DamagedPlayerEvent damageEvent = (DamagedPlayerEvent)event; + if (!damageEvent.isCombatDamage() && game.getOpponents(controllerId).contains(event.getTargetId())) { + return true; + } + } + return false; + } - @Override - public String getRule() { - return "Whenever an opponent is dealt noncombat damage, {this} gets +3/+0 until end of turn."; - } + @Override + public String getRule() { + return "Whenever an opponent is dealt noncombat damage, {this} gets +3/+0 until end of turn."; + } - @Override - public ChandrasSpitfireAbility copy() { - return new ChandrasSpitfireAbility(this); - } + @Override + public ChandrasSpitfireAbility copy() { + return new ChandrasSpitfireAbility(this); + } } diff --git a/Mage.Sets/src/mage/sets/magic2011/ChildOfNight.java b/Mage.Sets/src/mage/sets/magic2011/ChildOfNight.java index 7764cdcbcd..ca2e4cc419 100644 --- a/Mage.Sets/src/mage/sets/magic2011/ChildOfNight.java +++ b/Mage.Sets/src/mage/sets/magic2011/ChildOfNight.java @@ -36,19 +36,19 @@ import java.util.UUID; */ public class ChildOfNight extends mage.sets.magic2010.ChildOfNight { - public ChildOfNight(UUID ownerId) { - super(ownerId); - this.cardNumber = 88; - this.expansionSetCode = "M11"; - } + public ChildOfNight(UUID ownerId) { + super(ownerId); + this.cardNumber = 88; + this.expansionSetCode = "M11"; + } - public ChildOfNight(final ChildOfNight card) { - super(card); - } + public ChildOfNight(final ChildOfNight card) { + super(card); + } - @Override - public ChildOfNight copy() { - return new ChildOfNight(this); - } + @Override + public ChildOfNight copy() { + return new ChildOfNight(this); + } } diff --git a/Mage.Sets/src/mage/sets/magic2011/Clone.java b/Mage.Sets/src/mage/sets/magic2011/Clone.java index 7754043566..d2d8834e58 100644 --- a/Mage.Sets/src/mage/sets/magic2011/Clone.java +++ b/Mage.Sets/src/mage/sets/magic2011/Clone.java @@ -36,19 +36,19 @@ import java.util.UUID; */ public class Clone extends mage.sets.tenth.Clone { - public Clone(UUID ownerId) { - super(ownerId); - this.cardNumber = 49; - this.expansionSetCode = "M11"; - } + public Clone(UUID ownerId) { + super(ownerId); + this.cardNumber = 49; + this.expansionSetCode = "M11"; + } - public Clone(final Clone card) { - super(card); - } + public Clone(final Clone card) { + super(card); + } - @Override - public Clone copy() { - return new Clone(this); - } + @Override + public Clone copy() { + return new Clone(this); + } } \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/magic2011/CloudCrusader.java b/Mage.Sets/src/mage/sets/magic2011/CloudCrusader.java index afb488d55d..01ff0d9b23 100644 --- a/Mage.Sets/src/mage/sets/magic2011/CloudCrusader.java +++ b/Mage.Sets/src/mage/sets/magic2011/CloudCrusader.java @@ -42,26 +42,26 @@ import mage.cards.CardImpl; */ public class CloudCrusader extends CardImpl { - public CloudCrusader(UUID ownerId) { - super(ownerId, 10, "Cloud Crusader", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{2}{W}{W}"); - this.expansionSetCode = "M11"; - this.subtype.add("Human"); - this.subtype.add("Knight"); - this.color.setWhite(true); - this.power = new MageInt(2); - this.toughness = new MageInt(3); + public CloudCrusader(UUID ownerId) { + super(ownerId, 10, "Cloud Crusader", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{2}{W}{W}"); + this.expansionSetCode = "M11"; + this.subtype.add("Human"); + this.subtype.add("Knight"); + this.color.setWhite(true); + this.power = new MageInt(2); + this.toughness = new MageInt(3); - this.addAbility(FlyingAbility.getInstance()); - this.addAbility(FirstStrikeAbility.getInstance()); - } + this.addAbility(FlyingAbility.getInstance()); + this.addAbility(FirstStrikeAbility.getInstance()); + } - public CloudCrusader(final CloudCrusader card) { - super(card); - } + public CloudCrusader(final CloudCrusader card) { + super(card); + } - @Override - public CloudCrusader copy() { - return new CloudCrusader(this); - } + @Override + public CloudCrusader copy() { + return new CloudCrusader(this); + } } diff --git a/Mage.Sets/src/mage/sets/magic2011/CloudElemental.java b/Mage.Sets/src/mage/sets/magic2011/CloudElemental.java index 8cacdbfb53..774a064d7c 100644 --- a/Mage.Sets/src/mage/sets/magic2011/CloudElemental.java +++ b/Mage.Sets/src/mage/sets/magic2011/CloudElemental.java @@ -36,19 +36,19 @@ import java.util.UUID; */ public class CloudElemental extends mage.sets.tenth.CloudElemental { - public CloudElemental(UUID ownerId) { - super(ownerId); - this.cardNumber = 50; - this.expansionSetCode = "M11"; - } + public CloudElemental(UUID ownerId) { + super(ownerId); + this.cardNumber = 50; + this.expansionSetCode = "M11"; + } - public CloudElemental(final CloudElemental card) { - super(card); - } + public CloudElemental(final CloudElemental card) { + super(card); + } - @Override - public CloudElemental copy() { - return new CloudElemental(this); - } + @Override + public CloudElemental copy() { + return new CloudElemental(this); + } } \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/magic2011/Combust.java b/Mage.Sets/src/mage/sets/magic2011/Combust.java index bbe51db99a..36dbc01936 100644 --- a/Mage.Sets/src/mage/sets/magic2011/Combust.java +++ b/Mage.Sets/src/mage/sets/magic2011/Combust.java @@ -46,31 +46,31 @@ import mage.target.common.TargetCreaturePermanent; */ public class Combust extends CardImpl { - private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("white or blue creature"); + private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("white or blue creature"); - static { - filter.getColor().setWhite(true); - filter.getColor().setBlue(true); - filter.setUseColor(true); - filter.setScopeColor(ComparisonScope.Any); - } + static { + filter.getColor().setWhite(true); + filter.getColor().setBlue(true); + filter.setUseColor(true); + filter.setScopeColor(ComparisonScope.Any); + } - public Combust(UUID ownerId) { - super(ownerId, 130, "Combust", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{1}{R}"); - this.expansionSetCode = "M11"; - this.color.setRed(true); - this.getSpellAbility().addEffect(new DamageTargetEffect(5, false)); - this.getSpellAbility().addTarget(new TargetCreaturePermanent(filter)); - this.addAbility(new SimpleStaticAbility(Zone.STACK, new CantCounterSourceEffect())); - } + public Combust(UUID ownerId) { + super(ownerId, 130, "Combust", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{1}{R}"); + this.expansionSetCode = "M11"; + this.color.setRed(true); + this.getSpellAbility().addEffect(new DamageTargetEffect(5, false)); + this.getSpellAbility().addTarget(new TargetCreaturePermanent(filter)); + this.addAbility(new SimpleStaticAbility(Zone.STACK, new CantCounterSourceEffect())); + } - public Combust(final Combust card) { - super(card); - } + public Combust(final Combust card) { + super(card); + } - @Override - public Combust copy() { - return new Combust(this); - } + @Override + public Combust copy() { + return new Combust(this); + } } \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/magic2011/Condemn.java b/Mage.Sets/src/mage/sets/magic2011/Condemn.java index 46f553f360..1542f8f798 100644 --- a/Mage.Sets/src/mage/sets/magic2011/Condemn.java +++ b/Mage.Sets/src/mage/sets/magic2011/Condemn.java @@ -36,19 +36,19 @@ import java.util.UUID; */ public class Condemn extends mage.sets.tenth.Condemn { - public Condemn(UUID ownerId) { - super(ownerId); - this.cardNumber = 11; - this.expansionSetCode = "M11"; - } + public Condemn(UUID ownerId) { + super(ownerId); + this.cardNumber = 11; + this.expansionSetCode = "M11"; + } - public Condemn(final Condemn card) { - super(card); - } + public Condemn(final Condemn card) { + super(card); + } - @Override - public Condemn copy() { - return new Condemn(this); - } + @Override + public Condemn copy() { + return new Condemn(this); + } } diff --git a/Mage.Sets/src/mage/sets/magic2011/ConundrumSphinx.java b/Mage.Sets/src/mage/sets/magic2011/ConundrumSphinx.java index ed787d39b4..4af7682eac 100644 --- a/Mage.Sets/src/mage/sets/magic2011/ConundrumSphinx.java +++ b/Mage.Sets/src/mage/sets/magic2011/ConundrumSphinx.java @@ -54,70 +54,70 @@ import mage.sets.Sets; */ public class ConundrumSphinx extends CardImpl { - public ConundrumSphinx(UUID ownerId) { - super(ownerId, 51, "Conundrum Sphinx", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{2}{U}{U}"); - this.expansionSetCode = "M11"; - this.subtype.add("Sphinx"); - this.color.setBlue(true); - this.power = new MageInt(4); - this.toughness = new MageInt(4); + public ConundrumSphinx(UUID ownerId) { + super(ownerId, 51, "Conundrum Sphinx", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{2}{U}{U}"); + this.expansionSetCode = "M11"; + this.subtype.add("Sphinx"); + this.color.setBlue(true); + this.power = new MageInt(4); + this.toughness = new MageInt(4); - this.addAbility(FlyingAbility.getInstance()); - this.addAbility(new AttacksTriggeredAbility(new ConundrumSphinxEffect(), false)); - } + this.addAbility(FlyingAbility.getInstance()); + this.addAbility(new AttacksTriggeredAbility(new ConundrumSphinxEffect(), false)); + } - public ConundrumSphinx(final ConundrumSphinx card) { - super(card); - } + public ConundrumSphinx(final ConundrumSphinx card) { + super(card); + } - @Override - public ConundrumSphinx copy() { - return new ConundrumSphinx(this); - } + @Override + public ConundrumSphinx copy() { + return new ConundrumSphinx(this); + } } class ConundrumSphinxEffect extends OneShotEffect { - public ConundrumSphinxEffect() { - super(Outcome.DrawCard); - staticText = "each player names a card. Then each player reveals the top card of his or her library. If the card a player revealed is the card he or she named, that player puts it into his or her hand. If it's not, that player puts it on the bottom of his or her library"; - } + public ConundrumSphinxEffect() { + super(Outcome.DrawCard); + staticText = "each player names a card. Then each player reveals the top card of his or her library. If the card a player revealed is the card he or she named, that player puts it into his or her hand. If it's not, that player puts it on the bottom of his or her library"; + } - public ConundrumSphinxEffect(final ConundrumSphinxEffect effect) { - super(effect); - } + public ConundrumSphinxEffect(final ConundrumSphinxEffect effect) { + super(effect); + } - @Override - public boolean apply(Game game, Ability source) { - Choice cardChoice = new ChoiceImpl(); - cardChoice.setChoices(Sets.getCardNames()); - for (Player player: game.getPlayers().values()) { - if(player.getLibrary().size() > 0){ - cardChoice.clearChoice(); - while (!player.choose(Outcome.DrawCard, cardChoice, game)) { + @Override + public boolean apply(Game game, Ability source) { + Choice cardChoice = new ChoiceImpl(); + cardChoice.setChoices(Sets.getCardNames()); + for (Player player: game.getPlayers().values()) { + if(player.getLibrary().size() > 0){ + cardChoice.clearChoice(); + while (!player.choose(Outcome.DrawCard, cardChoice, game)) { game.debugMessage("player canceled choosing name. retrying."); } String cardName = cardChoice.getChoice(); game.informPlayers("Conundrum Sphinx, player: " + player.getName() + ", named card: [" + cardName + "]"); - Card card = player.getLibrary().removeFromTop(game); - Cards cards = new CardsImpl(); - cards.add(card); - player.revealCards("Conundrum Sphinx", cards, game); - if (card.getName().equals(cardName)) { - card.moveToZone(Zone.HAND, source.getId(), game, true); - } - else { - card.moveToZone(Zone.LIBRARY, source.getId(), game, false); - } - } - } - return true; - } + Card card = player.getLibrary().removeFromTop(game); + Cards cards = new CardsImpl(); + cards.add(card); + player.revealCards("Conundrum Sphinx", cards, game); + if (card.getName().equals(cardName)) { + card.moveToZone(Zone.HAND, source.getId(), game, true); + } + else { + card.moveToZone(Zone.LIBRARY, source.getId(), game, false); + } + } + } + return true; + } - @Override - public ConundrumSphinxEffect copy() { - return new ConundrumSphinxEffect(this); - } + @Override + public ConundrumSphinxEffect copy() { + return new ConundrumSphinxEffect(this); + } } \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/magic2011/Corrupt.java b/Mage.Sets/src/mage/sets/magic2011/Corrupt.java index 6e4dde54e5..6606250b64 100644 --- a/Mage.Sets/src/mage/sets/magic2011/Corrupt.java +++ b/Mage.Sets/src/mage/sets/magic2011/Corrupt.java @@ -49,73 +49,73 @@ import mage.target.common.TargetCreatureOrPlayer; */ public class Corrupt extends CardImpl { - public Corrupt(UUID ownerId) { - super(ownerId, 89, "Corrupt", Rarity.UNCOMMON, new CardType[]{CardType.SORCERY}, "{5}{B}"); - this.expansionSetCode = "M11"; - this.color.setBlack(true); - this.getSpellAbility().addTarget(new TargetCreatureOrPlayer()); - this.getSpellAbility().addEffect(new CorruptEffect()); - } + public Corrupt(UUID ownerId) { + super(ownerId, 89, "Corrupt", Rarity.UNCOMMON, new CardType[]{CardType.SORCERY}, "{5}{B}"); + this.expansionSetCode = "M11"; + this.color.setBlack(true); + this.getSpellAbility().addTarget(new TargetCreatureOrPlayer()); + this.getSpellAbility().addEffect(new CorruptEffect()); + } - public Corrupt(final Corrupt card) { - super(card); - } + public Corrupt(final Corrupt card) { + super(card); + } - @Override - public Corrupt copy() { - return new Corrupt(this); - } + @Override + public Corrupt copy() { + return new Corrupt(this); + } } class CorruptEffect extends OneShotEffect { - private static final FilterLandPermanent filter = new FilterLandPermanent("Swamps"); + private static final FilterLandPermanent filter = new FilterLandPermanent("Swamps"); - static { - filter.getSubtype().add("Swamp"); - filter.setScopeSubtype(ComparisonScope.Any); - filter.setTargetController(TargetController.YOU); - } + static { + filter.getSubtype().add("Swamp"); + filter.setScopeSubtype(ComparisonScope.Any); + filter.setTargetController(TargetController.YOU); + } - public CorruptEffect() { - super(Outcome.Damage); - staticText = "{this} deals damage equal to the number of Swamps you control to target creature or player. You gain life equal to the damage dealt this way"; - } + public CorruptEffect() { + super(Outcome.Damage); + staticText = "{this} deals damage equal to the number of Swamps you control to target creature or player. You gain life equal to the damage dealt this way"; + } - public CorruptEffect(final CorruptEffect effect) { - super(effect); - } + public CorruptEffect(final CorruptEffect effect) { + super(effect); + } - @Override - public boolean apply(Game game, Ability source) { - int amount = game.getBattlefield().count(filter, source.getControllerId(), game); - if (amount > 0) { - int damageDealt = amount; - Permanent permanent = game.getPermanent(source.getFirstTarget()); - if (permanent != null) { - damageDealt = permanent.damage(amount, source.getSourceId(), game, true, false); - } - else { - Player player = game.getPlayer(source.getFirstTarget()); - if (player != null) { - damageDealt = player.damage(amount, source.getSourceId(), game, false, true); - } - else - return false; - } - Player you = game.getPlayer(source.getControllerId()); - if (you != null) { - you.gainLife(damageDealt, game); - return true; - } - } - return false; - } + @Override + public boolean apply(Game game, Ability source) { + int amount = game.getBattlefield().count(filter, source.getControllerId(), game); + if (amount > 0) { + int damageDealt = amount; + Permanent permanent = game.getPermanent(source.getFirstTarget()); + if (permanent != null) { + damageDealt = permanent.damage(amount, source.getSourceId(), game, true, false); + } + else { + Player player = game.getPlayer(source.getFirstTarget()); + if (player != null) { + damageDealt = player.damage(amount, source.getSourceId(), game, false, true); + } + else + return false; + } + Player you = game.getPlayer(source.getControllerId()); + if (you != null) { + you.gainLife(damageDealt, game); + return true; + } + } + return false; + } - @Override - public CorruptEffect copy() { - return new CorruptEffect(this); - } + @Override + public CorruptEffect copy() { + return new CorruptEffect(this); + } } \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/magic2011/CrystalBall.java b/Mage.Sets/src/mage/sets/magic2011/CrystalBall.java index e9abcd1be5..ac2f4eb677 100644 --- a/Mage.Sets/src/mage/sets/magic2011/CrystalBall.java +++ b/Mage.Sets/src/mage/sets/magic2011/CrystalBall.java @@ -45,22 +45,22 @@ import mage.cards.CardImpl; */ public class CrystalBall extends CardImpl { - public CrystalBall(UUID ownerId) { - super(ownerId, 203, "Crystal Ball", Rarity.UNCOMMON, new CardType[]{CardType.ARTIFACT}, "{3}"); - this.expansionSetCode = "M11"; + public CrystalBall(UUID ownerId) { + super(ownerId, 203, "Crystal Ball", Rarity.UNCOMMON, new CardType[]{CardType.ARTIFACT}, "{3}"); + this.expansionSetCode = "M11"; Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new ScryEffect(2), new TapSourceCost()); ability.addManaCost(new GenericManaCost(1)); - this.addAbility(ability); - } + this.addAbility(ability); + } - public CrystalBall(final CrystalBall card) { - super(card); - } + public CrystalBall(final CrystalBall card) { + super(card); + } - @Override - public CrystalBall copy() { - return new CrystalBall(this); - } + @Override + public CrystalBall copy() { + return new CrystalBall(this); + } } diff --git a/Mage.Sets/src/mage/sets/magic2011/CudgelTroll.java b/Mage.Sets/src/mage/sets/magic2011/CudgelTroll.java index 82f942d6ce..c57f3d2745 100644 --- a/Mage.Sets/src/mage/sets/magic2011/CudgelTroll.java +++ b/Mage.Sets/src/mage/sets/magic2011/CudgelTroll.java @@ -36,19 +36,19 @@ import java.util.UUID; */ public class CudgelTroll extends mage.sets.magic2010.CudgelTroll { - public CudgelTroll(UUID ownerId) { - super(ownerId); - this.cardNumber = 167; - this.expansionSetCode = "M11"; - } + public CudgelTroll(UUID ownerId) { + super(ownerId); + this.cardNumber = 167; + this.expansionSetCode = "M11"; + } - public CudgelTroll(final CudgelTroll card) { - super(card); - } + public CudgelTroll(final CudgelTroll card) { + super(card); + } - @Override - public CudgelTroll copy() { - return new CudgelTroll(this); - } + @Override + public CudgelTroll copy() { + return new CudgelTroll(this); + } } \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/magic2011/Cultivate.java b/Mage.Sets/src/mage/sets/magic2011/Cultivate.java index 38d2fa0a71..492c99664a 100644 --- a/Mage.Sets/src/mage/sets/magic2011/Cultivate.java +++ b/Mage.Sets/src/mage/sets/magic2011/Cultivate.java @@ -54,48 +54,48 @@ import mage.target.common.TargetCardInLibrary; */ public class Cultivate extends CardImpl { - public Cultivate(UUID ownerId) { - super(ownerId, 168, "Cultivate", Rarity.COMMON, new CardType[]{CardType.SORCERY}, "{2}{G}"); - this.expansionSetCode = "M11"; - this.color.setGreen(true); - this.getSpellAbility().addEffect(new CultivateEffect()); + public Cultivate(UUID ownerId) { + super(ownerId, 168, "Cultivate", Rarity.COMMON, new CardType[]{CardType.SORCERY}, "{2}{G}"); + this.expansionSetCode = "M11"; + this.color.setGreen(true); + this.getSpellAbility().addEffect(new CultivateEffect()); - } + } - public Cultivate(final Cultivate card) { - super(card); - } + public Cultivate(final Cultivate card) { + super(card); + } - @Override - public Cultivate copy() { - return new Cultivate(this); - } + @Override + public Cultivate copy() { + return new Cultivate(this); + } } class CultivateEffect extends OneShotEffect { - protected static final FilterCard filter = new FilterCard("card to put on the battlefield tapped"); + protected static final FilterCard filter = new FilterCard("card to put on the battlefield tapped"); - public CultivateEffect() { - super(Outcome.PutLandInPlay); - staticText = "Search your library for up to two basic land cards, reveal those cards, and put one onto the battlefield tapped and the other into your hand. Then shuffle your library"; - } + public CultivateEffect() { + super(Outcome.PutLandInPlay); + staticText = "Search your library for up to two basic land cards, reveal those cards, and put one onto the battlefield tapped and the other into your hand. Then shuffle your library"; + } - public CultivateEffect(final CultivateEffect effect) { - super(effect); - } + public CultivateEffect(final CultivateEffect effect) { + super(effect); + } - @Override - public CultivateEffect copy() { - return new CultivateEffect(this); - } + @Override + public CultivateEffect copy() { + return new CultivateEffect(this); + } - @Override - public boolean apply(Game game, Ability source) { - TargetCardInLibrary target = new TargetCardInLibrary(0, 2, new FilterBasicLandCard()); - Player player = game.getPlayer(source.getControllerId()); - if (player.searchLibrary(target, game)) { + @Override + public boolean apply(Game game, Ability source) { + TargetCardInLibrary target = new TargetCardInLibrary(0, 2, new FilterBasicLandCard()); + Player player = game.getPlayer(source.getControllerId()); + if (player.searchLibrary(target, game)) { if (target.getTargets().size() > 0) { Cards revealed = new CardsImpl(); for (UUID cardId: (List)target.getTargets()) { @@ -131,6 +131,6 @@ class CultivateEffect extends OneShotEffect { player.shuffleLibrary(game); return false; - } + } } diff --git a/Mage.Sets/src/mage/sets/magic2011/CyclopsGladiator.java b/Mage.Sets/src/mage/sets/magic2011/CyclopsGladiator.java index f451bbef7f..2ea23356d6 100644 --- a/Mage.Sets/src/mage/sets/magic2011/CyclopsGladiator.java +++ b/Mage.Sets/src/mage/sets/magic2011/CyclopsGladiator.java @@ -49,49 +49,49 @@ import mage.target.common.TargetCreaturePermanent; */ public class CyclopsGladiator extends CardImpl { - public CyclopsGladiator(UUID ownerId) { - super(ownerId, 131, "Cyclops Gladiator", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{1}{R}{R}{R}"); - this.expansionSetCode = "M11"; - this.subtype.add("Cyclops"); - this.subtype.add("Warrior"); - this.color.setRed(true); - this.power = new MageInt(4); - this.toughness = new MageInt(4); + public CyclopsGladiator(UUID ownerId) { + super(ownerId, 131, "Cyclops Gladiator", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{1}{R}{R}{R}"); + this.expansionSetCode = "M11"; + this.subtype.add("Cyclops"); + this.subtype.add("Warrior"); + this.color.setRed(true); + this.power = new MageInt(4); + this.toughness = new MageInt(4); - Ability ability = new AttacksTriggeredAbility(new CyclopsGladiatorEffect(), true); - this.addAbility(ability); - } + Ability ability = new AttacksTriggeredAbility(new CyclopsGladiatorEffect(), true); + this.addAbility(ability); + } - public CyclopsGladiator(final CyclopsGladiator card) { - super(card); - } + public CyclopsGladiator(final CyclopsGladiator card) { + super(card); + } - @Override - public CyclopsGladiator copy() { - return new CyclopsGladiator(this); - } + @Override + public CyclopsGladiator copy() { + return new CyclopsGladiator(this); + } } class CyclopsGladiatorEffect extends OneShotEffect { - public CyclopsGladiatorEffect() { - super(Outcome.Damage); - staticText = "you may have it deal damage equal to its power to target creature defending player controls. If you do, that creature deals damage equal to its power to {this}"; - } + public CyclopsGladiatorEffect() { + super(Outcome.Damage); + staticText = "you may have it deal damage equal to its power to target creature defending player controls. If you do, that creature deals damage equal to its power to {this}"; + } - public CyclopsGladiatorEffect(final CyclopsGladiatorEffect effect) { - super(effect); - } + public CyclopsGladiatorEffect(final CyclopsGladiatorEffect effect) { + super(effect); + } - @Override - public boolean apply(Game game, Ability source) { - UUID defenderId = game.getCombat().getDefendingPlayer(source.getSourceId()); - if (defenderId != null) { - FilterCreaturePermanent filter = new FilterCreaturePermanent("creature defending player controls"); - filter.getControllerId().add(defenderId); - TargetCreaturePermanent target = new TargetCreaturePermanent(filter); - Player player = game.getPlayer(source.getControllerId()); + @Override + public boolean apply(Game game, Ability source) { + UUID defenderId = game.getCombat().getDefendingPlayer(source.getSourceId()); + if (defenderId != null) { + FilterCreaturePermanent filter = new FilterCreaturePermanent("creature defending player controls"); + filter.getControllerId().add(defenderId); + TargetCreaturePermanent target = new TargetCreaturePermanent(filter); + Player player = game.getPlayer(source.getControllerId()); if (target.canChoose(source.getSourceId(), source.getControllerId(), game)) { if (player.chooseTarget(Outcome.Detriment, target, source, game)) { Permanent permanent = game.getPermanent(target.getFirstTarget()); @@ -103,13 +103,13 @@ class CyclopsGladiatorEffect extends OneShotEffect { } } } - } - return false; - } + } + return false; + } - @Override - public CyclopsGladiatorEffect copy() { - return new CyclopsGladiatorEffect(this); - } + @Override + public CyclopsGladiatorEffect copy() { + return new CyclopsGladiatorEffect(this); + } } diff --git a/Mage.Sets/src/mage/sets/magic2011/DarkTutelage.java b/Mage.Sets/src/mage/sets/magic2011/DarkTutelage.java index c9c23fa9c2..aef56e4b9a 100644 --- a/Mage.Sets/src/mage/sets/magic2011/DarkTutelage.java +++ b/Mage.Sets/src/mage/sets/magic2011/DarkTutelage.java @@ -50,34 +50,34 @@ import mage.players.Player; */ public class DarkTutelage extends CardImpl { - public DarkTutelage(UUID ownerId) { - super(ownerId, 90, "Dark Tutelage", Rarity.RARE, new CardType[]{CardType.ENCHANTMENT}, "{2}{B}"); - this.expansionSetCode = "M11"; - this.getColor().setBlack(true); - this.addAbility(new OnEventTriggeredAbility(EventType.UPKEEP_STEP_PRE, "beginning of your upkeep", new DarkTutelageEffect(), false)); - } + public DarkTutelage(UUID ownerId) { + super(ownerId, 90, "Dark Tutelage", Rarity.RARE, new CardType[]{CardType.ENCHANTMENT}, "{2}{B}"); + this.expansionSetCode = "M11"; + this.getColor().setBlack(true); + this.addAbility(new OnEventTriggeredAbility(EventType.UPKEEP_STEP_PRE, "beginning of your upkeep", new DarkTutelageEffect(), false)); + } - public DarkTutelage(final DarkTutelage card) { - super(card); - } + public DarkTutelage(final DarkTutelage card) { + super(card); + } - @Override - public DarkTutelage copy() { - return new DarkTutelage(this); - } + @Override + public DarkTutelage copy() { + return new DarkTutelage(this); + } } class DarkTutelageEffect extends OneShotEffect { - public DarkTutelageEffect() { - super(Outcome.DrawCard); - staticText = "reveal the top card of your library and put that card into your hand. You lose life equal to its converted mana cost"; - } + public DarkTutelageEffect() { + super(Outcome.DrawCard); + staticText = "reveal the top card of your library and put that card into your hand. You lose life equal to its converted mana cost"; + } - public DarkTutelageEffect(final DarkTutelageEffect effect) { - super(effect); - } + public DarkTutelageEffect(final DarkTutelageEffect effect) { + super(effect); + } @Override public boolean apply(Game game, Ability source) { @@ -96,9 +96,9 @@ class DarkTutelageEffect extends OneShotEffect { return false; } - @Override - public DarkTutelageEffect copy() { - return new DarkTutelageEffect(this); - } + @Override + public DarkTutelageEffect copy() { + return new DarkTutelageEffect(this); + } } diff --git a/Mage.Sets/src/mage/sets/magic2011/DayOfJudgment.java b/Mage.Sets/src/mage/sets/magic2011/DayOfJudgment.java index db73178d22..f508b85638 100644 --- a/Mage.Sets/src/mage/sets/magic2011/DayOfJudgment.java +++ b/Mage.Sets/src/mage/sets/magic2011/DayOfJudgment.java @@ -36,19 +36,19 @@ import java.util.UUID; */ public class DayOfJudgment extends mage.sets.zendikar.DayOfJudgment { - public DayOfJudgment(UUID ownerId) { - super(ownerId); - this.cardNumber = 12; - this.expansionSetCode = "M11"; - } + public DayOfJudgment(UUID ownerId) { + super(ownerId); + this.cardNumber = 12; + this.expansionSetCode = "M11"; + } - public DayOfJudgment(final DayOfJudgment card) { - super(card); - } + public DayOfJudgment(final DayOfJudgment card) { + super(card); + } - @Override - public DayOfJudgment copy() { - return new DayOfJudgment(this); - } + @Override + public DayOfJudgment copy() { + return new DayOfJudgment(this); + } } \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/magic2011/Deathmark.java b/Mage.Sets/src/mage/sets/magic2011/Deathmark.java index 2f3376b79a..6b82bc7c4e 100644 --- a/Mage.Sets/src/mage/sets/magic2011/Deathmark.java +++ b/Mage.Sets/src/mage/sets/magic2011/Deathmark.java @@ -36,19 +36,19 @@ import java.util.UUID; */ public class Deathmark extends mage.sets.magic2010.Deathmark { - public Deathmark(UUID ownerId) { - super(ownerId); - this.cardNumber = 91; - this.expansionSetCode = "M11"; - } + public Deathmark(UUID ownerId) { + super(ownerId); + this.cardNumber = 91; + this.expansionSetCode = "M11"; + } - public Deathmark(final Deathmark card) { - super(card); - } + public Deathmark(final Deathmark card) { + super(card); + } - @Override - public Deathmark copy() { - return new Deathmark(this); - } + @Override + public Deathmark copy() { + return new Deathmark(this); + } } \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/magic2011/Demolish.java b/Mage.Sets/src/mage/sets/magic2011/Demolish.java index 6735a805d2..cd2a05ff8a 100644 --- a/Mage.Sets/src/mage/sets/magic2011/Demolish.java +++ b/Mage.Sets/src/mage/sets/magic2011/Demolish.java @@ -36,19 +36,19 @@ import java.util.UUID; */ public class Demolish extends mage.sets.zendikar.Demolish { - public Demolish(UUID ownerId) { - super(ownerId); - this.cardNumber = 132; - this.expansionSetCode = "M11"; - } + public Demolish(UUID ownerId) { + super(ownerId); + this.cardNumber = 132; + this.expansionSetCode = "M11"; + } - public Demolish(final Demolish card) { - super(card); - } + public Demolish(final Demolish card) { + super(card); + } - @Override - public Demolish copy() { - return new Demolish(this); - } + @Override + public Demolish copy() { + return new Demolish(this); + } } \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/magic2011/DemonOfDeathsGate.java b/Mage.Sets/src/mage/sets/magic2011/DemonOfDeathsGate.java index 7600bffb7f..f5d9fdf329 100644 --- a/Mage.Sets/src/mage/sets/magic2011/DemonOfDeathsGate.java +++ b/Mage.Sets/src/mage/sets/magic2011/DemonOfDeathsGate.java @@ -48,56 +48,56 @@ import java.util.UUID; */ public class DemonOfDeathsGate extends CardImpl { - public DemonOfDeathsGate(UUID ownerId) { - super(ownerId, 92, "Demon of Death's Gate", Rarity.MYTHIC, new CardType[]{CardType.CREATURE}, "{6}{B}{B}{B}"); - this.expansionSetCode = "M11"; - this.subtype.add("Demon"); - this.color.setBlack(true); - this.power = new MageInt(9); - this.toughness = new MageInt(9); - this.getSpellAbility().addAlternativeCost(new DemonOfDeathsGateAlternativeCost()); + public DemonOfDeathsGate(UUID ownerId) { + super(ownerId, 92, "Demon of Death's Gate", Rarity.MYTHIC, new CardType[]{CardType.CREATURE}, "{6}{B}{B}{B}"); + this.expansionSetCode = "M11"; + this.subtype.add("Demon"); + this.color.setBlack(true); + this.power = new MageInt(9); + this.toughness = new MageInt(9); + this.getSpellAbility().addAlternativeCost(new DemonOfDeathsGateAlternativeCost()); - this.addAbility(FlyingAbility.getInstance()); - this.addAbility(TrampleAbility.getInstance()); - } + this.addAbility(FlyingAbility.getInstance()); + this.addAbility(TrampleAbility.getInstance()); + } - public DemonOfDeathsGate(final DemonOfDeathsGate card) { - super(card); - } + public DemonOfDeathsGate(final DemonOfDeathsGate card) { + super(card); + } - @Override - public DemonOfDeathsGate copy() { - return new DemonOfDeathsGate(this); - } + @Override + public DemonOfDeathsGate copy() { + return new DemonOfDeathsGate(this); + } } class DemonOfDeathsGateAlternativeCost extends AlternativeCostImpl { - private static final FilterControlledCreaturePermanent filter = new FilterControlledCreaturePermanent("black creature"); + private static final FilterControlledCreaturePermanent filter = new FilterControlledCreaturePermanent("black creature"); - static { - filter.getColor().setBlack(true); - filter.setUseColor(true); - } + static { + filter.getColor().setBlack(true); + filter.setUseColor(true); + } - public DemonOfDeathsGateAlternativeCost() { - super("pay 6 life and sacrifice three black creatures"); - this.add(new PayLifeCost(6)); - this.add(new SacrificeTargetCost(new TargetControlledPermanent(3, 3, filter, false))); - } + public DemonOfDeathsGateAlternativeCost() { + super("pay 6 life and sacrifice three black creatures"); + this.add(new PayLifeCost(6)); + this.add(new SacrificeTargetCost(new TargetControlledPermanent(3, 3, filter, false))); + } - public DemonOfDeathsGateAlternativeCost(final DemonOfDeathsGateAlternativeCost cost) { - super(cost); - } + public DemonOfDeathsGateAlternativeCost(final DemonOfDeathsGateAlternativeCost cost) { + super(cost); + } - @Override - public DemonOfDeathsGateAlternativeCost copy() { - return new DemonOfDeathsGateAlternativeCost(this); - } + @Override + public DemonOfDeathsGateAlternativeCost copy() { + return new DemonOfDeathsGateAlternativeCost(this); + } - @Override - public String getText() { - return "You may pay 6 life and sacrifice three black creatures rather than pay Demon of Death's Gate's mana cost"; - } + @Override + public String getText() { + return "You may pay 6 life and sacrifice three black creatures rather than pay Demon of Death's Gate's mana cost"; + } } \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/magic2011/DemonsHorn.java b/Mage.Sets/src/mage/sets/magic2011/DemonsHorn.java index 7c032e277b..4854dc3f91 100644 --- a/Mage.Sets/src/mage/sets/magic2011/DemonsHorn.java +++ b/Mage.Sets/src/mage/sets/magic2011/DemonsHorn.java @@ -36,19 +36,19 @@ import java.util.UUID; */ public class DemonsHorn extends mage.sets.tenth.DemonsHorn { - public DemonsHorn(UUID ownerId) { - super(ownerId); - this.cardNumber = 204; - this.expansionSetCode = "M11"; - } + public DemonsHorn(UUID ownerId) { + super(ownerId); + this.cardNumber = 204; + this.expansionSetCode = "M11"; + } - public DemonsHorn(final DemonsHorn card) { - super(card); - } + public DemonsHorn(final DemonsHorn card) { + super(card); + } - @Override - public DemonsHorn copy() { - return new DemonsHorn(this); - } + @Override + public DemonsHorn copy() { + return new DemonsHorn(this); + } } diff --git a/Mage.Sets/src/mage/sets/magic2011/DestructiveForce.java b/Mage.Sets/src/mage/sets/magic2011/DestructiveForce.java index 983a0b86fa..f26bb946af 100644 --- a/Mage.Sets/src/mage/sets/magic2011/DestructiveForce.java +++ b/Mage.Sets/src/mage/sets/magic2011/DestructiveForce.java @@ -43,27 +43,27 @@ import mage.filter.common.FilterCreaturePermanent; */ public class DestructiveForce extends CardImpl { - private static final FilterControlledPermanent filter = new FilterControlledPermanent("land"); + private static final FilterControlledPermanent filter = new FilterControlledPermanent("land"); - static { - filter.getCardType().add(CardType.LAND); - } + static { + filter.getCardType().add(CardType.LAND); + } - public DestructiveForce(UUID ownerId) { - super(ownerId, 133, "Destructive Force", Rarity.RARE, new CardType[]{CardType.SORCERY}, "{5}{R}{R}"); - this.expansionSetCode = "M11"; - this.color.setRed(true); - this.getSpellAbility().addEffect(new SacrificeAllEffect(5, filter)); - this.getSpellAbility().addEffect(new DamageAllEffect(5, new FilterCreaturePermanent())); - } + public DestructiveForce(UUID ownerId) { + super(ownerId, 133, "Destructive Force", Rarity.RARE, new CardType[]{CardType.SORCERY}, "{5}{R}{R}"); + this.expansionSetCode = "M11"; + this.color.setRed(true); + this.getSpellAbility().addEffect(new SacrificeAllEffect(5, filter)); + this.getSpellAbility().addEffect(new DamageAllEffect(5, new FilterCreaturePermanent())); + } - public DestructiveForce(final DestructiveForce card) { - super(card); - } + public DestructiveForce(final DestructiveForce card) { + super(card); + } - @Override - public DestructiveForce copy() { - return new DestructiveForce(this); - } + @Override + public DestructiveForce copy() { + return new DestructiveForce(this); + } } diff --git a/Mage.Sets/src/mage/sets/magic2011/DiabolicTutor.java b/Mage.Sets/src/mage/sets/magic2011/DiabolicTutor.java index fb5e2aca98..1e015abfef 100644 --- a/Mage.Sets/src/mage/sets/magic2011/DiabolicTutor.java +++ b/Mage.Sets/src/mage/sets/magic2011/DiabolicTutor.java @@ -36,19 +36,19 @@ import java.util.UUID; */ public class DiabolicTutor extends mage.sets.tenth.DiabolicTutor { - public DiabolicTutor(UUID ownerId) { - super(ownerId); - this.cardNumber = 93; - this.expansionSetCode = "M11"; - } + public DiabolicTutor(UUID ownerId) { + super(ownerId); + this.cardNumber = 93; + this.expansionSetCode = "M11"; + } - public DiabolicTutor(final DiabolicTutor card) { - super(card); - } + public DiabolicTutor(final DiabolicTutor card) { + super(card); + } - @Override - public DiabolicTutor copy() { - return new DiabolicTutor(this); - } + @Override + public DiabolicTutor copy() { + return new DiabolicTutor(this); + } } diff --git a/Mage.Sets/src/mage/sets/magic2011/Diminish.java b/Mage.Sets/src/mage/sets/magic2011/Diminish.java index 4bcd040f0d..1250971c3a 100644 --- a/Mage.Sets/src/mage/sets/magic2011/Diminish.java +++ b/Mage.Sets/src/mage/sets/magic2011/Diminish.java @@ -42,21 +42,21 @@ import mage.target.common.TargetCreaturePermanent; */ public class Diminish extends CardImpl { - public Diminish(UUID ownerId) { - super(ownerId, 52, "Diminish", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{U}"); - this.expansionSetCode = "M11"; - this.color.setBlue(true); - this.getSpellAbility().addTarget(new TargetCreaturePermanent()); - this.getSpellAbility().addEffect(new SetPowerToughnessTargetEffect(1, 1, Duration.EndOfTurn)); - } + public Diminish(UUID ownerId) { + super(ownerId, 52, "Diminish", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{U}"); + this.expansionSetCode = "M11"; + this.color.setBlue(true); + this.getSpellAbility().addTarget(new TargetCreaturePermanent()); + this.getSpellAbility().addEffect(new SetPowerToughnessTargetEffect(1, 1, Duration.EndOfTurn)); + } - public Diminish(final Diminish card) { - super(card); - } + public Diminish(final Diminish card) { + super(card); + } - @Override - public Diminish copy() { - return new Diminish(this); - } + @Override + public Diminish copy() { + return new Diminish(this); + } } diff --git a/Mage.Sets/src/mage/sets/magic2011/Disentomb.java b/Mage.Sets/src/mage/sets/magic2011/Disentomb.java index 1436706fcc..65271ed9f7 100644 --- a/Mage.Sets/src/mage/sets/magic2011/Disentomb.java +++ b/Mage.Sets/src/mage/sets/magic2011/Disentomb.java @@ -36,19 +36,19 @@ import java.util.UUID; */ public class Disentomb extends mage.sets.magic2010.Disentomb { - public Disentomb(UUID ownerId) { - super(ownerId); - this.cardNumber = 94; - this.expansionSetCode = "M11"; - } + public Disentomb(UUID ownerId) { + super(ownerId); + this.cardNumber = 94; + this.expansionSetCode = "M11"; + } - public Disentomb(final Disentomb card) { - super(card); - } + public Disentomb(final Disentomb card) { + super(card); + } - @Override - public Disentomb copy() { - return new Disentomb(this); - } + @Override + public Disentomb copy() { + return new Disentomb(this); + } } diff --git a/Mage.Sets/src/mage/sets/magic2011/DoomBlade.java b/Mage.Sets/src/mage/sets/magic2011/DoomBlade.java index c80c2d7fbb..d3731c0940 100644 --- a/Mage.Sets/src/mage/sets/magic2011/DoomBlade.java +++ b/Mage.Sets/src/mage/sets/magic2011/DoomBlade.java @@ -36,19 +36,19 @@ import java.util.UUID; */ public class DoomBlade extends mage.sets.magic2010.DoomBlade { - public DoomBlade(UUID ownerId) { - super(ownerId); - this.cardNumber = 95; - this.expansionSetCode = "M11"; - } + public DoomBlade(UUID ownerId) { + super(ownerId); + this.cardNumber = 95; + this.expansionSetCode = "M11"; + } - public DoomBlade(final DoomBlade card) { - super(card); - } + public DoomBlade(final DoomBlade card) { + super(card); + } - @Override - public DoomBlade copy() { - return new DoomBlade(this); - } + @Override + public DoomBlade copy() { + return new DoomBlade(this); + } } diff --git a/Mage.Sets/src/mage/sets/magic2011/DragonsClaw.java b/Mage.Sets/src/mage/sets/magic2011/DragonsClaw.java index e16a157dea..7674aa969a 100644 --- a/Mage.Sets/src/mage/sets/magic2011/DragonsClaw.java +++ b/Mage.Sets/src/mage/sets/magic2011/DragonsClaw.java @@ -36,19 +36,19 @@ import java.util.UUID; */ public class DragonsClaw extends mage.sets.tenth.DragonsClaw { - public DragonsClaw(UUID ownerId) { - super(ownerId); - this.cardNumber = 205; - this.expansionSetCode = "M11"; - } + public DragonsClaw(UUID ownerId) { + super(ownerId); + this.cardNumber = 205; + this.expansionSetCode = "M11"; + } - public DragonsClaw(final DragonsClaw card) { - super(card); - } + public DragonsClaw(final DragonsClaw card) { + super(card); + } - @Override - public DragonsClaw copy() { - return new DragonsClaw(this); - } + @Override + public DragonsClaw copy() { + return new DragonsClaw(this); + } } diff --git a/Mage.Sets/src/mage/sets/magic2011/DragonskullSummit.java b/Mage.Sets/src/mage/sets/magic2011/DragonskullSummit.java index c5607decb0..18ba747e27 100644 --- a/Mage.Sets/src/mage/sets/magic2011/DragonskullSummit.java +++ b/Mage.Sets/src/mage/sets/magic2011/DragonskullSummit.java @@ -36,19 +36,19 @@ import java.util.UUID; */ public class DragonskullSummit extends mage.sets.magic2010.DragonskullSummit { - public DragonskullSummit(UUID ownerId) { - super(ownerId); - this.cardNumber = 223; - this.expansionSetCode = "M11"; - } + public DragonskullSummit(UUID ownerId) { + super(ownerId); + this.cardNumber = 223; + this.expansionSetCode = "M11"; + } - public DragonskullSummit(final DragonskullSummit card) { - super(card); - } + public DragonskullSummit(final DragonskullSummit card) { + super(card); + } - @Override - public DragonskullSummit copy() { - return new DragonskullSummit(this); - } + @Override + public DragonskullSummit copy() { + return new DragonskullSummit(this); + } } diff --git a/Mage.Sets/src/mage/sets/magic2011/DrownedCatacomb.java b/Mage.Sets/src/mage/sets/magic2011/DrownedCatacomb.java index 41b21d3726..71ecce6ff0 100644 --- a/Mage.Sets/src/mage/sets/magic2011/DrownedCatacomb.java +++ b/Mage.Sets/src/mage/sets/magic2011/DrownedCatacomb.java @@ -36,19 +36,19 @@ import java.util.UUID; */ public class DrownedCatacomb extends mage.sets.magic2010.DrownedCatacomb { - public DrownedCatacomb(UUID ownerId) { - super(ownerId); - this.cardNumber = 224; - this.expansionSetCode = "M11"; - } + public DrownedCatacomb(UUID ownerId) { + super(ownerId); + this.cardNumber = 224; + this.expansionSetCode = "M11"; + } - public DrownedCatacomb(final DrownedCatacomb card) { - super(card); - } + public DrownedCatacomb(final DrownedCatacomb card) { + super(card); + } - @Override - public DrownedCatacomb copy() { - return new DrownedCatacomb(this); - } + @Override + public DrownedCatacomb copy() { + return new DrownedCatacomb(this); + } } \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/magic2011/DryadsFavor.java b/Mage.Sets/src/mage/sets/magic2011/DryadsFavor.java index c82268a779..2359405b0b 100644 --- a/Mage.Sets/src/mage/sets/magic2011/DryadsFavor.java +++ b/Mage.Sets/src/mage/sets/magic2011/DryadsFavor.java @@ -54,74 +54,74 @@ import mage.target.common.TargetCreaturePermanent; */ public class DryadsFavor extends CardImpl { - public DryadsFavor(UUID ownerId) { - super(ownerId, 169, "Dryad's Favor", Rarity.COMMON, new CardType[]{CardType.ENCHANTMENT}, "{G}"); - this.expansionSetCode = "M11"; - this.color.setGreen(true); - this.subtype.add("Aura"); + public DryadsFavor(UUID ownerId) { + super(ownerId, 169, "Dryad's Favor", Rarity.COMMON, new CardType[]{CardType.ENCHANTMENT}, "{G}"); + this.expansionSetCode = "M11"; + this.color.setGreen(true); + this.subtype.add("Aura"); - TargetPermanent auraTarget = new TargetCreaturePermanent(); - this.getSpellAbility().addTarget(auraTarget); - this.getSpellAbility().addEffect(new AttachEffect(Outcome.Benefit)); - Ability ability = new EnchantAbility(auraTarget.getTargetName()); - this.addAbility(ability); - this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new DryadsFavorEffect())); + TargetPermanent auraTarget = new TargetCreaturePermanent(); + this.getSpellAbility().addTarget(auraTarget); + this.getSpellAbility().addEffect(new AttachEffect(Outcome.Benefit)); + Ability ability = new EnchantAbility(auraTarget.getTargetName()); + this.addAbility(ability); + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new DryadsFavorEffect())); - } + } - public DryadsFavor(final DryadsFavor card) { - super(card); - } + public DryadsFavor(final DryadsFavor card) { + super(card); + } - @Override - public DryadsFavor copy() { - return new DryadsFavor(this); - } + @Override + public DryadsFavor copy() { + return new DryadsFavor(this); + } } class DryadsFavorEffect extends ContinuousEffectImpl { - public DryadsFavorEffect() { - super(Duration.WhileOnBattlefield, Outcome.Detriment); - staticText = "Enchanted creature has forestwalk"; - } + public DryadsFavorEffect() { + super(Duration.WhileOnBattlefield, Outcome.Detriment); + staticText = "Enchanted creature has forestwalk"; + } - public DryadsFavorEffect(final DryadsFavorEffect effect) { - super(effect); - } + public DryadsFavorEffect(final DryadsFavorEffect effect) { + super(effect); + } - @Override - public DryadsFavorEffect copy() { - return new DryadsFavorEffect(this); - } + @Override + public DryadsFavorEffect copy() { + return new DryadsFavorEffect(this); + } - @Override - public boolean apply(Layer layer, SubLayer sublayer, Ability source, Game game) { - Permanent enchantment = game.getPermanent(source.getSourceId()); - if (enchantment != null && enchantment.getAttachedTo() != null) { - Permanent creature = game.getPermanent(enchantment.getAttachedTo()); - if (creature != null) { - switch (layer) { - case AbilityAddingRemovingEffects_6: - if (sublayer == SubLayer.NA) { - creature.addAbility(new ForestwalkAbility(), game); - } - break; - } - return true; - } - } - return false; - } + @Override + public boolean apply(Layer layer, SubLayer sublayer, Ability source, Game game) { + Permanent enchantment = game.getPermanent(source.getSourceId()); + if (enchantment != null && enchantment.getAttachedTo() != null) { + Permanent creature = game.getPermanent(enchantment.getAttachedTo()); + if (creature != null) { + switch (layer) { + case AbilityAddingRemovingEffects_6: + if (sublayer == SubLayer.NA) { + creature.addAbility(new ForestwalkAbility(), game); + } + break; + } + return true; + } + } + return false; + } - @Override - public boolean apply(Game game, Ability source) { - return false; - } + @Override + public boolean apply(Game game, Ability source) { + return false; + } - @Override - public boolean hasLayer(Layer layer) { - return layer == Layer.AbilityAddingRemovingEffects_6; - } + @Override + public boolean hasLayer(Layer layer) { + return layer == Layer.AbilityAddingRemovingEffects_6; + } } \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/magic2011/Duress.java b/Mage.Sets/src/mage/sets/magic2011/Duress.java index 7cdbe9cffe..54780fe5f1 100644 --- a/Mage.Sets/src/mage/sets/magic2011/Duress.java +++ b/Mage.Sets/src/mage/sets/magic2011/Duress.java @@ -36,19 +36,19 @@ import java.util.UUID; */ public class Duress extends mage.sets.magic2010.Duress { - public Duress(UUID ownerId) { - super(ownerId); - this.cardNumber = 96; - this.expansionSetCode = "M11"; - } + public Duress(UUID ownerId) { + super(ownerId); + this.cardNumber = 96; + this.expansionSetCode = "M11"; + } - public Duress(final Duress card) { - super(card); - } + public Duress(final Duress card) { + super(card); + } - @Override - public Duress copy() { - return new Duress(this); - } + @Override + public Duress copy() { + return new Duress(this); + } } diff --git a/Mage.Sets/src/mage/sets/magic2011/DuskdaleWurm.java b/Mage.Sets/src/mage/sets/magic2011/DuskdaleWurm.java index fb08bffa6e..2f5ce518c0 100644 --- a/Mage.Sets/src/mage/sets/magic2011/DuskdaleWurm.java +++ b/Mage.Sets/src/mage/sets/magic2011/DuskdaleWurm.java @@ -41,25 +41,25 @@ import mage.cards.CardImpl; */ public class DuskdaleWurm extends CardImpl { - public DuskdaleWurm(UUID ownerId) { - super(ownerId, 170, "Duskdale Wurm", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{5}{G}{G}"); - this.expansionSetCode = "M11"; - this.subtype.add("Wurm"); - this.color.setGreen(true); - this.power = new MageInt(7); - this.toughness = new MageInt(7); + public DuskdaleWurm(UUID ownerId) { + super(ownerId, 170, "Duskdale Wurm", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{5}{G}{G}"); + this.expansionSetCode = "M11"; + this.subtype.add("Wurm"); + this.color.setGreen(true); + this.power = new MageInt(7); + this.toughness = new MageInt(7); - this.addAbility(TrampleAbility.getInstance()); - } + this.addAbility(TrampleAbility.getInstance()); + } - public DuskdaleWurm(final DuskdaleWurm card) { - super(card); - } + public DuskdaleWurm(final DuskdaleWurm card) { + super(card); + } - @Override - public DuskdaleWurm copy() { - return new DuskdaleWurm(this); - } + @Override + public DuskdaleWurm copy() { + return new DuskdaleWurm(this); + } } diff --git a/Mage.Sets/src/mage/sets/magic2011/EarthServant.java b/Mage.Sets/src/mage/sets/magic2011/EarthServant.java index 94323a63b5..a86565b6bf 100644 --- a/Mage.Sets/src/mage/sets/magic2011/EarthServant.java +++ b/Mage.Sets/src/mage/sets/magic2011/EarthServant.java @@ -49,32 +49,32 @@ public class EarthServant extends CardImpl { private static final FilterLandPermanent filter = new FilterLandPermanent("Mountain you control"); - static { - filter.getSubtype().add("Mountain"); + static { + filter.getSubtype().add("Mountain"); filter.setTargetController(TargetController.YOU); - } + } - public EarthServant(UUID ownerId) { - super(ownerId, 134, "Earth Servant", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{5}{R}"); - this.expansionSetCode = "M11"; - this.subtype.add("Elemental"); + public EarthServant(UUID ownerId) { + super(ownerId, 134, "Earth Servant", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{5}{R}"); + this.expansionSetCode = "M11"; + this.subtype.add("Elemental"); - this.color.setRed(true); - this.power = new MageInt(4); - this.toughness = new MageInt(4); + this.color.setRed(true); + this.power = new MageInt(4); + this.toughness = new MageInt(4); - this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostSourceEffect(new PermanentsOnBattlefieldCount(filter, 0), + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostSourceEffect(new PermanentsOnBattlefieldCount(filter, 0), new PermanentsOnBattlefieldCount(filter, 1), Duration.WhileOnBattlefield))); - } + } - public EarthServant(final EarthServant card) { - super(card); - } + public EarthServant(final EarthServant card) { + super(card); + } - @Override - public EarthServant copy() { - return new EarthServant(this); - } + @Override + public EarthServant copy() { + return new EarthServant(this); + } } diff --git a/Mage.Sets/src/mage/sets/magic2011/EliteVanguard.java b/Mage.Sets/src/mage/sets/magic2011/EliteVanguard.java index d1085a743b..801bd0de39 100644 --- a/Mage.Sets/src/mage/sets/magic2011/EliteVanguard.java +++ b/Mage.Sets/src/mage/sets/magic2011/EliteVanguard.java @@ -36,19 +36,19 @@ import java.util.UUID; */ public class EliteVanguard extends mage.sets.magic2010.EliteVanguard { - public EliteVanguard(UUID ownerId) { - super(ownerId); - this.cardNumber = 13; - this.expansionSetCode = "M11"; - } + public EliteVanguard(UUID ownerId) { + super(ownerId); + this.cardNumber = 13; + this.expansionSetCode = "M11"; + } - public EliteVanguard(final EliteVanguard card) { - super(card); - } + public EliteVanguard(final EliteVanguard card) { + super(card); + } - @Override - public EliteVanguard copy() { - return new EliteVanguard(this); - } + @Override + public EliteVanguard copy() { + return new EliteVanguard(this); + } } diff --git a/Mage.Sets/src/mage/sets/magic2011/ElixirOfImmortality.java b/Mage.Sets/src/mage/sets/magic2011/ElixirOfImmortality.java index 7b18c0f428..b751b58e0c 100644 --- a/Mage.Sets/src/mage/sets/magic2011/ElixirOfImmortality.java +++ b/Mage.Sets/src/mage/sets/magic2011/ElixirOfImmortality.java @@ -49,56 +49,56 @@ import mage.players.Player; */ public class ElixirOfImmortality extends CardImpl { - public ElixirOfImmortality(UUID ownerId) { - super(ownerId, 206, "Elixir of Immortality", Rarity.UNCOMMON, new CardType[]{CardType.ARTIFACT}, "{1}"); - this.expansionSetCode = "M11"; - Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new ElixerOfImmortalityEffect(), new TapSourceCost()); + public ElixirOfImmortality(UUID ownerId) { + super(ownerId, 206, "Elixir of Immortality", Rarity.UNCOMMON, new CardType[]{CardType.ARTIFACT}, "{1}"); + this.expansionSetCode = "M11"; + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new ElixerOfImmortalityEffect(), new TapSourceCost()); ability.addManaCost(new GenericManaCost(2)); - this.addAbility(ability); - } + this.addAbility(ability); + } - public ElixirOfImmortality(final ElixirOfImmortality card) { - super(card); - } + public ElixirOfImmortality(final ElixirOfImmortality card) { + super(card); + } - @Override - public ElixirOfImmortality copy() { - return new ElixirOfImmortality(this); - } + @Override + public ElixirOfImmortality copy() { + return new ElixirOfImmortality(this); + } } class ElixerOfImmortalityEffect extends OneShotEffect { - public ElixerOfImmortalityEffect() { - super(Outcome.GainLife); - staticText = "Shuffle {this} and your graveyard into your library"; - } + public ElixerOfImmortalityEffect() { + super(Outcome.GainLife); + staticText = "Shuffle {this} and your graveyard into your library"; + } - public ElixerOfImmortalityEffect(final ElixerOfImmortalityEffect effect) { - super(effect); - } + public ElixerOfImmortalityEffect(final ElixerOfImmortalityEffect effect) { + super(effect); + } - @Override - public boolean apply(Game game, Ability source) { - Player player = game.getPlayer(source.getControllerId()); - Permanent permanent = game.getPermanent(source.getSourceId()); - if (player != null) { - player.gainLife(5, game); - if (permanent != null) { - permanent.moveToZone(Zone.LIBRARY, source.getId(), game, true); - } - player.getLibrary().addAll(player.getGraveyard().getCards(game), game); - player.getGraveyard().clear(); - player.shuffleLibrary(game); - return true; - } - return false; - } + @Override + public boolean apply(Game game, Ability source) { + Player player = game.getPlayer(source.getControllerId()); + Permanent permanent = game.getPermanent(source.getSourceId()); + if (player != null) { + player.gainLife(5, game); + if (permanent != null) { + permanent.moveToZone(Zone.LIBRARY, source.getId(), game, true); + } + player.getLibrary().addAll(player.getGraveyard().getCards(game), game); + player.getGraveyard().clear(); + player.shuffleLibrary(game); + return true; + } + return false; + } - @Override - public ElixerOfImmortalityEffect copy() { - return new ElixerOfImmortalityEffect(this); - } + @Override + public ElixerOfImmortalityEffect copy() { + return new ElixerOfImmortalityEffect(this); + } } \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/magic2011/ElvishArchdruid.java b/Mage.Sets/src/mage/sets/magic2011/ElvishArchdruid.java index f604cd5302..e1bdf8d8a8 100644 --- a/Mage.Sets/src/mage/sets/magic2011/ElvishArchdruid.java +++ b/Mage.Sets/src/mage/sets/magic2011/ElvishArchdruid.java @@ -36,19 +36,19 @@ import java.util.UUID; */ public class ElvishArchdruid extends mage.sets.magic2010.ElvishArchdruid { - public ElvishArchdruid(UUID ownerId) { - super(ownerId); - this.cardNumber = 171; - this.expansionSetCode = "M11"; - } + public ElvishArchdruid(UUID ownerId) { + super(ownerId); + this.cardNumber = 171; + this.expansionSetCode = "M11"; + } - public ElvishArchdruid(final ElvishArchdruid card) { - super(card); - } + public ElvishArchdruid(final ElvishArchdruid card) { + super(card); + } - @Override - public ElvishArchdruid copy() { - return new ElvishArchdruid(this); - } + @Override + public ElvishArchdruid copy() { + return new ElvishArchdruid(this); + } } diff --git a/Mage.Sets/src/mage/sets/magic2011/EmberHauler.java b/Mage.Sets/src/mage/sets/magic2011/EmberHauler.java index 5aaf0694e9..633e0d711d 100644 --- a/Mage.Sets/src/mage/sets/magic2011/EmberHauler.java +++ b/Mage.Sets/src/mage/sets/magic2011/EmberHauler.java @@ -47,27 +47,27 @@ import mage.target.common.TargetCreatureOrPlayer; */ public class EmberHauler extends CardImpl { - public EmberHauler(UUID ownerId) { - super(ownerId, 135, "Ember Hauler", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{R}{R}"); - this.expansionSetCode = "M11"; - this.subtype.add("Goblin"); - this.color.setRed(true); - this.power = new MageInt(2); - this.toughness = new MageInt(2); + public EmberHauler(UUID ownerId) { + super(ownerId, 135, "Ember Hauler", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{R}{R}"); + this.expansionSetCode = "M11"; + this.subtype.add("Goblin"); + this.color.setRed(true); + this.power = new MageInt(2); + this.toughness = new MageInt(2); - Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DamageTargetEffect(2), new SacrificeSourceCost()); + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DamageTargetEffect(2), new SacrificeSourceCost()); ability.addManaCost(new GenericManaCost(1)); - ability.addTarget(new TargetCreatureOrPlayer()); - this.addAbility(ability); - } + ability.addTarget(new TargetCreatureOrPlayer()); + this.addAbility(ability); + } - public EmberHauler(final EmberHauler card) { - super(card); - } + public EmberHauler(final EmberHauler card) { + super(card); + } - @Override - public EmberHauler copy() { - return new EmberHauler(this); - } + @Override + public EmberHauler copy() { + return new EmberHauler(this); + } } diff --git a/Mage.Sets/src/mage/sets/magic2011/Excommunicate.java b/Mage.Sets/src/mage/sets/magic2011/Excommunicate.java index bc31bd190f..77bb9039ea 100644 --- a/Mage.Sets/src/mage/sets/magic2011/Excommunicate.java +++ b/Mage.Sets/src/mage/sets/magic2011/Excommunicate.java @@ -36,19 +36,19 @@ import java.util.UUID; */ public class Excommunicate extends mage.sets.shardsofalara.Excommunicate { - public Excommunicate(UUID ownerId) { - super(ownerId); - this.cardNumber = 14; - this.expansionSetCode = "M11"; - } + public Excommunicate(UUID ownerId) { + super(ownerId); + this.cardNumber = 14; + this.expansionSetCode = "M11"; + } - public Excommunicate(final Excommunicate card) { - super(card); - } + public Excommunicate(final Excommunicate card) { + super(card); + } - @Override - public Excommunicate copy() { - return new Excommunicate(this); - } + @Override + public Excommunicate copy() { + return new Excommunicate(this); + } } diff --git a/Mage.Sets/src/mage/sets/magic2011/FaunaShaman.java b/Mage.Sets/src/mage/sets/magic2011/FaunaShaman.java index 18aea9faed..e77516e6b3 100644 --- a/Mage.Sets/src/mage/sets/magic2011/FaunaShaman.java +++ b/Mage.Sets/src/mage/sets/magic2011/FaunaShaman.java @@ -54,30 +54,30 @@ import mage.target.common.TargetCardInLibrary; */ public class FaunaShaman extends CardImpl { - public FaunaShaman(UUID ownerId) { - super(ownerId, 172, "Fauna Shaman", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{1}{G}"); - this.expansionSetCode = "M11"; - this.subtype.add("Elf"); - this.subtype.add("Shaman"); - this.color.setGreen(true); - this.power = new MageInt(2); - this.toughness = new MageInt(2); + public FaunaShaman(UUID ownerId) { + super(ownerId, 172, "Fauna Shaman", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{1}{G}"); + this.expansionSetCode = "M11"; + this.subtype.add("Elf"); + this.subtype.add("Shaman"); + this.color.setGreen(true); + this.power = new MageInt(2); + this.toughness = new MageInt(2); - Costs costs = new CostsImpl(); - costs.add(new TapSourceCost()); - costs.add(new DiscardTargetCost(new TargetCardInHand(new FilterCreatureCard()))); - Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new SearchLibraryRevealPutInHandEffect(new TargetCardInLibrary(new FilterCreatureCard())), costs); + Costs costs = new CostsImpl(); + costs.add(new TapSourceCost()); + costs.add(new DiscardTargetCost(new TargetCardInHand(new FilterCreatureCard()))); + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new SearchLibraryRevealPutInHandEffect(new TargetCardInLibrary(new FilterCreatureCard())), costs); ability.addManaCost(new ColoredManaCost(ColoredManaSymbol.G)); - this.addAbility(ability); - } + this.addAbility(ability); + } - public FaunaShaman(final FaunaShaman card) { - super(card); - } + public FaunaShaman(final FaunaShaman card) { + super(card); + } - @Override - public FaunaShaman copy() { - return new FaunaShaman(this); - } + @Override + public FaunaShaman copy() { + return new FaunaShaman(this); + } } diff --git a/Mage.Sets/src/mage/sets/magic2011/FieryHellhound.java b/Mage.Sets/src/mage/sets/magic2011/FieryHellhound.java index 6543b90348..6bc9a0b99a 100644 --- a/Mage.Sets/src/mage/sets/magic2011/FieryHellhound.java +++ b/Mage.Sets/src/mage/sets/magic2011/FieryHellhound.java @@ -36,19 +36,19 @@ import java.util.UUID; */ public class FieryHellhound extends mage.sets.magic2010.FieryHellhound { - public FieryHellhound(UUID ownerId) { - super(ownerId); - this.cardNumber = 136; - this.expansionSetCode = "M11"; - } + public FieryHellhound(UUID ownerId) { + super(ownerId); + this.cardNumber = 136; + this.expansionSetCode = "M11"; + } - public FieryHellhound(final FieryHellhound card) { - super(card); - } + public FieryHellhound(final FieryHellhound card) { + super(card); + } - @Override - public FieryHellhound copy() { - return new FieryHellhound(this); - } + @Override + public FieryHellhound copy() { + return new FieryHellhound(this); + } } diff --git a/Mage.Sets/src/mage/sets/magic2011/FireServant.java b/Mage.Sets/src/mage/sets/magic2011/FireServant.java index 43a2f50f28..5e50ba5b70 100644 --- a/Mage.Sets/src/mage/sets/magic2011/FireServant.java +++ b/Mage.Sets/src/mage/sets/magic2011/FireServant.java @@ -49,67 +49,67 @@ import mage.game.stack.StackObject; */ public class FireServant extends CardImpl { - public FireServant(UUID ownerId) { - super(ownerId, 137, "Fire Servant", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{3}{R}{R}"); - this.expansionSetCode = "M11"; - this.subtype.add("Elemental"); - this.color.setRed(true); - this.power = new MageInt(4); - this.toughness = new MageInt(3); + public FireServant(UUID ownerId) { + super(ownerId, 137, "Fire Servant", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{3}{R}{R}"); + this.expansionSetCode = "M11"; + this.subtype.add("Elemental"); + this.color.setRed(true); + this.power = new MageInt(4); + this.toughness = new MageInt(3); - this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new FireServantEffect())); - } + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new FireServantEffect())); + } - public FireServant(final FireServant card) { - super(card); - } + public FireServant(final FireServant card) { + super(card); + } - @Override - public FireServant copy() { - return new FireServant(this); - } + @Override + public FireServant copy() { + return new FireServant(this); + } } class FireServantEffect extends ReplacementEffectImpl { - public FireServantEffect() { - super(Duration.WhileOnBattlefield, Outcome.Damage); - staticText = "If a red instant or sorcery spell you control would deal damage, it deals double that damage instead"; - } + public FireServantEffect() { + super(Duration.WhileOnBattlefield, Outcome.Damage); + staticText = "If a red instant or sorcery spell you control would deal damage, it deals double that damage instead"; + } - public FireServantEffect(final FireServantEffect effect) { - super(effect); - } + public FireServantEffect(final FireServantEffect effect) { + super(effect); + } - @Override - public FireServantEffect copy() { - return new FireServantEffect(this); - } + @Override + public FireServantEffect copy() { + return new FireServantEffect(this); + } - @Override - public boolean applies(GameEvent event, Ability source, Game game) { - switch (event.getType()) { - case DAMAGE_CREATURE: - case DAMAGE_PLAYER: - case DAMAGE_PLANESWALKER: - StackObject spell = game.getStack().getStackObject(event.getSourceId()); - if (spell != null && spell.getControllerId().equals(source.getControllerId()) && spell.getColor().isRed() && - (spell.getCardType().contains(CardType.INSTANT) || spell.getCardType().contains(CardType.SORCERY))) { - event.setAmount(event.getAmount() * 2); - } - } - return false; - } + @Override + public boolean applies(GameEvent event, Ability source, Game game) { + switch (event.getType()) { + case DAMAGE_CREATURE: + case DAMAGE_PLAYER: + case DAMAGE_PLANESWALKER: + StackObject spell = game.getStack().getStackObject(event.getSourceId()); + if (spell != null && spell.getControllerId().equals(source.getControllerId()) && spell.getColor().isRed() && + (spell.getCardType().contains(CardType.INSTANT) || spell.getCardType().contains(CardType.SORCERY))) { + event.setAmount(event.getAmount() * 2); + } + } + return false; + } - @Override - public boolean apply(Game game, Ability source) { - return true; - } + @Override + public boolean apply(Game game, Ability source) { + return true; + } - @Override - public boolean replaceEvent(GameEvent event, Ability source, Game game) { - return apply(game, source); - } + @Override + public boolean replaceEvent(GameEvent event, Ability source, Game game) { + return apply(game, source); + } } \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/magic2011/Fireball.java b/Mage.Sets/src/mage/sets/magic2011/Fireball.java index e0d699b010..b2536d29bc 100644 --- a/Mage.Sets/src/mage/sets/magic2011/Fireball.java +++ b/Mage.Sets/src/mage/sets/magic2011/Fireball.java @@ -36,19 +36,19 @@ import java.util.UUID; */ public class Fireball extends mage.sets.magic2010.Fireball { - public Fireball(UUID ownerId) { - super(ownerId); - this.cardNumber = 138; - this.expansionSetCode = "M11"; - } + public Fireball(UUID ownerId) { + super(ownerId); + this.cardNumber = 138; + this.expansionSetCode = "M11"; + } - public Fireball(final Fireball card) { - super(card); - } + public Fireball(final Fireball card) { + super(card); + } - @Override - public Fireball copy() { - return new Fireball(this); - } + @Override + public Fireball copy() { + return new Fireball(this); + } } diff --git a/Mage.Sets/src/mage/sets/magic2011/Flashfreeze.java b/Mage.Sets/src/mage/sets/magic2011/Flashfreeze.java index 09a1450fb1..fe7faa2eb4 100644 --- a/Mage.Sets/src/mage/sets/magic2011/Flashfreeze.java +++ b/Mage.Sets/src/mage/sets/magic2011/Flashfreeze.java @@ -36,19 +36,19 @@ import java.util.UUID; */ public class Flashfreeze extends mage.sets.tenth.Flashfreeze { - public Flashfreeze(UUID ownerId) { - super(ownerId); - this.cardNumber = 53; - this.expansionSetCode = "M11"; - } + public Flashfreeze(UUID ownerId) { + super(ownerId); + this.cardNumber = 53; + this.expansionSetCode = "M11"; + } - public Flashfreeze(final Flashfreeze card) { - super(card); - } + public Flashfreeze(final Flashfreeze card) { + super(card); + } - @Override - public Flashfreeze copy() { - return new Flashfreeze(this); - } + @Override + public Flashfreeze copy() { + return new Flashfreeze(this); + } } diff --git a/Mage.Sets/src/mage/sets/magic2011/Fling.java b/Mage.Sets/src/mage/sets/magic2011/Fling.java index 84ffa06e6d..332cecc889 100644 --- a/Mage.Sets/src/mage/sets/magic2011/Fling.java +++ b/Mage.Sets/src/mage/sets/magic2011/Fling.java @@ -49,63 +49,63 @@ import mage.target.common.TargetCreatureOrPlayer; */ public class Fling extends CardImpl { - public Fling(UUID ownerId) { - super(ownerId, 139, "Fling", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{1}{R}"); - this.expansionSetCode = "M11"; - this.color.setRed(true); - this.getSpellAbility().addCost(new SacrificeTargetCost(new TargetControlledCreaturePermanent())); - this.getSpellAbility().addTarget(new TargetCreatureOrPlayer()); - this.getSpellAbility().addEffect(new FlingEffect()); - } + public Fling(UUID ownerId) { + super(ownerId, 139, "Fling", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{1}{R}"); + this.expansionSetCode = "M11"; + this.color.setRed(true); + this.getSpellAbility().addCost(new SacrificeTargetCost(new TargetControlledCreaturePermanent())); + this.getSpellAbility().addTarget(new TargetCreatureOrPlayer()); + this.getSpellAbility().addEffect(new FlingEffect()); + } - public Fling(final Fling card) { - super(card); - } + public Fling(final Fling card) { + super(card); + } - @Override - public Fling copy() { - return new Fling(this); - } + @Override + public Fling copy() { + return new Fling(this); + } } class FlingEffect extends OneShotEffect { - public FlingEffect() { - super(Outcome.Damage); - staticText = "{this} deals damage equal to the sacrificed creature's power to target creature or player"; - } + public FlingEffect() { + super(Outcome.Damage); + staticText = "{this} deals damage equal to the sacrificed creature's power to target creature or player"; + } - public FlingEffect(final FlingEffect effect) { - super(effect); - } + public FlingEffect(final FlingEffect effect) { + super(effect); + } - @Override - public boolean apply(Game game, Ability source) { - int amount = 0; - for (Cost cost: source.getCosts()) { - if (cost instanceof SacrificeTargetCost && ((SacrificeTargetCost)cost).getPermanents().size() > 0) { - amount = ((SacrificeTargetCost)cost).getPermanents().get(0).getPower().getValue(); - break; - } - } - if (amount > 0) { - Permanent permanent = game.getPermanent(source.getFirstTarget()); - if (permanent != null) { - permanent.damage(amount, source.getSourceId(), game, true, false); - return true; - } - Player player = game.getPlayer(source.getFirstTarget()); - if (player != null) { - player.damage(amount, source.getSourceId(), game, false, true); - return true; - } - } - return false; - } + @Override + public boolean apply(Game game, Ability source) { + int amount = 0; + for (Cost cost: source.getCosts()) { + if (cost instanceof SacrificeTargetCost && ((SacrificeTargetCost)cost).getPermanents().size() > 0) { + amount = ((SacrificeTargetCost)cost).getPermanents().get(0).getPower().getValue(); + break; + } + } + if (amount > 0) { + Permanent permanent = game.getPermanent(source.getFirstTarget()); + if (permanent != null) { + permanent.damage(amount, source.getSourceId(), game, true, false); + return true; + } + Player player = game.getPlayer(source.getFirstTarget()); + if (player != null) { + player.damage(amount, source.getSourceId(), game, false, true); + return true; + } + } + return false; + } - @Override - public FlingEffect copy() { - return new FlingEffect(this); - } + @Override + public FlingEffect copy() { + return new FlingEffect(this); + } } \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/magic2011/Fog.java b/Mage.Sets/src/mage/sets/magic2011/Fog.java index 4a5d8f51aa..5686871e2f 100644 --- a/Mage.Sets/src/mage/sets/magic2011/Fog.java +++ b/Mage.Sets/src/mage/sets/magic2011/Fog.java @@ -36,19 +36,19 @@ import java.util.UUID; */ public class Fog extends mage.sets.magic2010.Fog { - public Fog(UUID ownerId) { - super(ownerId); - this.cardNumber = 173; - this.expansionSetCode = "M11"; - } + public Fog(UUID ownerId) { + super(ownerId); + this.cardNumber = 173; + this.expansionSetCode = "M11"; + } - public Fog(final Fog card) { - super(card); - } + public Fog(final Fog card) { + super(card); + } - @Override - public Fog copy() { - return new Fog(this); - } + @Override + public Fog copy() { + return new Fog(this); + } } diff --git a/Mage.Sets/src/mage/sets/magic2011/Foresee.java b/Mage.Sets/src/mage/sets/magic2011/Foresee.java index ce458e34a2..0de14fbafd 100644 --- a/Mage.Sets/src/mage/sets/magic2011/Foresee.java +++ b/Mage.Sets/src/mage/sets/magic2011/Foresee.java @@ -41,20 +41,20 @@ import mage.cards.CardImpl; */ public class Foresee extends CardImpl { - public Foresee(UUID ownerId) { - super(ownerId, 54, "Foresee", Rarity.COMMON, new CardType[]{CardType.SORCERY}, "{3}{U}"); - this.expansionSetCode = "M11"; - this.color.setBlue(true); - this.getSpellAbility().addEffect(new ScryEffect(4)); - this.getSpellAbility().addEffect(new DrawCardControllerEffect(2)); - } + public Foresee(UUID ownerId) { + super(ownerId, 54, "Foresee", Rarity.COMMON, new CardType[]{CardType.SORCERY}, "{3}{U}"); + this.expansionSetCode = "M11"; + this.color.setBlue(true); + this.getSpellAbility().addEffect(new ScryEffect(4)); + this.getSpellAbility().addEffect(new DrawCardControllerEffect(2)); + } - public Foresee(final Foresee card) { - super(card); - } + public Foresee(final Foresee card) { + super(card); + } - @Override - public Foresee copy() { - return new Foresee(this); - } + @Override + public Foresee copy() { + return new Foresee(this); + } } diff --git a/Mage.Sets/src/mage/sets/magic2011/Forest1.java b/Mage.Sets/src/mage/sets/magic2011/Forest1.java index 829f6f28da..9926b3d39e 100644 --- a/Mage.Sets/src/mage/sets/magic2011/Forest1.java +++ b/Mage.Sets/src/mage/sets/magic2011/Forest1.java @@ -36,18 +36,18 @@ import java.util.UUID; */ public class Forest1 extends mage.cards.basiclands.Forest { - public Forest1(UUID ownerId) { - super(ownerId, 246); - this.expansionSetCode = "M11"; - } + public Forest1(UUID ownerId) { + super(ownerId, 246); + this.expansionSetCode = "M11"; + } - public Forest1(final Forest1 card) { - super(card); - } + public Forest1(final Forest1 card) { + super(card); + } - @Override - public Forest1 copy() { - return new Forest1(this); - } + @Override + public Forest1 copy() { + return new Forest1(this); + } } diff --git a/Mage.Sets/src/mage/sets/magic2011/Forest2.java b/Mage.Sets/src/mage/sets/magic2011/Forest2.java index 7297a3604c..46b2fcba25 100644 --- a/Mage.Sets/src/mage/sets/magic2011/Forest2.java +++ b/Mage.Sets/src/mage/sets/magic2011/Forest2.java @@ -36,18 +36,18 @@ import java.util.UUID; */ public class Forest2 extends mage.cards.basiclands.Forest { - public Forest2(UUID ownerId) { - super(ownerId, 247); - this.expansionSetCode = "M11"; - } + public Forest2(UUID ownerId) { + super(ownerId, 247); + this.expansionSetCode = "M11"; + } - public Forest2(final Forest2 card) { - super(card); - } + public Forest2(final Forest2 card) { + super(card); + } - @Override - public Forest2 copy() { - return new Forest2(this); - } + @Override + public Forest2 copy() { + return new Forest2(this); + } } diff --git a/Mage.Sets/src/mage/sets/magic2011/Forest3.java b/Mage.Sets/src/mage/sets/magic2011/Forest3.java index 0109197972..6a9f9b6248 100644 --- a/Mage.Sets/src/mage/sets/magic2011/Forest3.java +++ b/Mage.Sets/src/mage/sets/magic2011/Forest3.java @@ -36,18 +36,18 @@ import java.util.UUID; */ public class Forest3 extends mage.cards.basiclands.Forest { - public Forest3(UUID ownerId) { - super(ownerId, 248); - this.expansionSetCode = "M11"; - } + public Forest3(UUID ownerId) { + super(ownerId, 248); + this.expansionSetCode = "M11"; + } - public Forest3(final Forest3 card) { - super(card); - } + public Forest3(final Forest3 card) { + super(card); + } - @Override - public Forest3 copy() { - return new Forest3(this); - } + @Override + public Forest3 copy() { + return new Forest3(this); + } } diff --git a/Mage.Sets/src/mage/sets/magic2011/Forest4.java b/Mage.Sets/src/mage/sets/magic2011/Forest4.java index a136b30c49..ac6afff96a 100644 --- a/Mage.Sets/src/mage/sets/magic2011/Forest4.java +++ b/Mage.Sets/src/mage/sets/magic2011/Forest4.java @@ -36,18 +36,18 @@ import java.util.UUID; */ public class Forest4 extends mage.cards.basiclands.Forest { - public Forest4(UUID ownerId) { - super(ownerId, 249); - this.expansionSetCode = "M11"; - } + public Forest4(UUID ownerId) { + super(ownerId, 249); + this.expansionSetCode = "M11"; + } - public Forest4(final Forest4 card) { - super(card); - } + public Forest4(final Forest4 card) { + super(card); + } - @Override - public Forest4 copy() { - return new Forest4(this); - } + @Override + public Forest4 copy() { + return new Forest4(this); + } } diff --git a/Mage.Sets/src/mage/sets/magic2011/FrostTitan.java b/Mage.Sets/src/mage/sets/magic2011/FrostTitan.java index 4cc8a9484a..105fd9fd81 100644 --- a/Mage.Sets/src/mage/sets/magic2011/FrostTitan.java +++ b/Mage.Sets/src/mage/sets/magic2011/FrostTitan.java @@ -52,97 +52,97 @@ import mage.target.TargetStackObject; */ public class FrostTitan extends CardImpl { - public FrostTitan(UUID ownerId) { - super(ownerId, 55, "Frost Titan", Rarity.MYTHIC, new CardType[]{CardType.CREATURE}, "{4}{U}{U}"); - this.expansionSetCode = "M11"; - this.subtype.add("Giant"); - this.color.setBlue(true); - this.power = new MageInt(6); - this.toughness = new MageInt(6); + public FrostTitan(UUID ownerId) { + super(ownerId, 55, "Frost Titan", Rarity.MYTHIC, new CardType[]{CardType.CREATURE}, "{4}{U}{U}"); + this.expansionSetCode = "M11"; + this.subtype.add("Giant"); + this.color.setBlue(true); + this.power = new MageInt(6); + this.toughness = new MageInt(6); - this.addAbility(new FrostTitanAbility1()); - this.addAbility(new FrostTitanAbility2()); - } + this.addAbility(new FrostTitanAbility1()); + this.addAbility(new FrostTitanAbility2()); + } - public FrostTitan(final FrostTitan card) { - super(card); - } + public FrostTitan(final FrostTitan card) { + super(card); + } - @Override - public FrostTitan copy() { - return new FrostTitan(this); - } + @Override + public FrostTitan copy() { + return new FrostTitan(this); + } } class FrostTitanAbility1 extends TriggeredAbilityImpl { - public FrostTitanAbility1() { - super(Zone.BATTLEFIELD, new CounterUnlessPaysEffect(new GenericManaCost(2)), false); - } + public FrostTitanAbility1() { + super(Zone.BATTLEFIELD, new CounterUnlessPaysEffect(new GenericManaCost(2)), false); + } - public FrostTitanAbility1(final FrostTitanAbility1 ability) { - super(ability); - } + public FrostTitanAbility1(final FrostTitanAbility1 ability) { + super(ability); + } - @Override - public FrostTitanAbility1 copy() { - return new FrostTitanAbility1(this); - } + @Override + public FrostTitanAbility1 copy() { + return new FrostTitanAbility1(this); + } - @Override - public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == EventType.TARGETED && event.getTargetId().equals(this.getSourceId()) && game.getOpponents(this.controllerId).contains(event.getPlayerId())) { - this.getTargets().clear(); - TargetStackObject target = new TargetStackObject(); - target.add(event.getSourceId(), game); - this.addTarget(target); - return true; - } - return false; - } + @Override + public boolean checkTrigger(GameEvent event, Game game) { + if (event.getType() == EventType.TARGETED && event.getTargetId().equals(this.getSourceId()) && game.getOpponents(this.controllerId).contains(event.getPlayerId())) { + this.getTargets().clear(); + TargetStackObject target = new TargetStackObject(); + target.add(event.getSourceId(), game); + this.addTarget(target); + return true; + } + return false; + } - @Override - public String getRule() { - return "Whenever {this} becomes the target of a spell or ability an opponent controls, counter that spell or ability unless its controller pays {2}"; - } + @Override + public String getRule() { + return "Whenever {this} becomes the target of a spell or ability an opponent controls, counter that spell or ability unless its controller pays {2}"; + } } class FrostTitanAbility2 extends TriggeredAbilityImpl { - public FrostTitanAbility2() { - super(Zone.BATTLEFIELD, new TapTargetEffect(), false); - this.addEffect(new SkipNextUntapTargetEffect()); - this.addTarget(new TargetPermanent()); - } + public FrostTitanAbility2() { + super(Zone.BATTLEFIELD, new TapTargetEffect(), false); + this.addEffect(new SkipNextUntapTargetEffect()); + this.addTarget(new TargetPermanent()); + } - public FrostTitanAbility2(final FrostTitanAbility2 ability) { - super(ability); - } + public FrostTitanAbility2(final FrostTitanAbility2 ability) { + super(ability); + } - @Override - public FrostTitanAbility2 copy() { - return new FrostTitanAbility2(this); - } + @Override + public FrostTitanAbility2 copy() { + return new FrostTitanAbility2(this); + } - @Override - public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == EventType.ATTACKER_DECLARED && event.getSourceId().equals(this.getSourceId())) { - return true; - } - if (event.getType() == EventType.ZONE_CHANGE && event.getTargetId().equals(this.getSourceId()) ) { - ZoneChangeEvent zEvent = (ZoneChangeEvent)event; - if (zEvent.getToZone() == Zone.BATTLEFIELD) { - return true; - } - } - return false; - } + @Override + public boolean checkTrigger(GameEvent event, Game game) { + if (event.getType() == EventType.ATTACKER_DECLARED && event.getSourceId().equals(this.getSourceId())) { + return true; + } + if (event.getType() == EventType.ZONE_CHANGE && event.getTargetId().equals(this.getSourceId()) ) { + ZoneChangeEvent zEvent = (ZoneChangeEvent)event; + if (zEvent.getToZone() == Zone.BATTLEFIELD) { + return true; + } + } + return false; + } - @Override - public String getRule() { - return "Whenever {this} enters the battlefield or attacks, tap target permanent. It doesn't untap during its controller's next untap step"; - } + @Override + public String getRule() { + return "Whenever {this} enters the battlefield or attacks, tap target permanent. It doesn't untap during its controller's next untap step"; + } } diff --git a/Mage.Sets/src/mage/sets/magic2011/GaeasRevenge.java b/Mage.Sets/src/mage/sets/magic2011/GaeasRevenge.java index 01d70704a2..322e6e6ac0 100644 --- a/Mage.Sets/src/mage/sets/magic2011/GaeasRevenge.java +++ b/Mage.Sets/src/mage/sets/magic2011/GaeasRevenge.java @@ -47,35 +47,35 @@ import mage.filter.FilterStackObject; */ public class GaeasRevenge extends CardImpl { - private static final FilterStackObject filter = new FilterStackObject("nongreen spells or abilities from nongreen sources"); + private static final FilterStackObject filter = new FilterStackObject("nongreen spells or abilities from nongreen sources"); - static { - filter.getColor().setGreen(true); - filter.setNotColor(true); - filter.setUseColor(true); - } + static { + filter.getColor().setGreen(true); + filter.setNotColor(true); + filter.setUseColor(true); + } - public GaeasRevenge(UUID ownerId) { - super(ownerId, 174, "Gaea's Revenge", Rarity.MYTHIC, new CardType[]{CardType.CREATURE}, "{5}{G}{G}"); - this.expansionSetCode = "M11"; - this.subtype.add("Elemental"); - this.color.setGreen(true); - this.power = new MageInt(8); - this.toughness = new MageInt(5); + public GaeasRevenge(UUID ownerId) { + super(ownerId, 174, "Gaea's Revenge", Rarity.MYTHIC, new CardType[]{CardType.CREATURE}, "{5}{G}{G}"); + this.expansionSetCode = "M11"; + this.subtype.add("Elemental"); + this.color.setGreen(true); + this.power = new MageInt(8); + this.toughness = new MageInt(5); - this.addAbility(new SimpleStaticAbility(Zone.STACK, new CantCounterSourceEffect())); - this.addAbility(HasteAbility.getInstance()); - this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new CantTargetSourceEffect(filter, Duration.WhileOnBattlefield))); + this.addAbility(new SimpleStaticAbility(Zone.STACK, new CantCounterSourceEffect())); + this.addAbility(HasteAbility.getInstance()); + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new CantTargetSourceEffect(filter, Duration.WhileOnBattlefield))); - } + } - public GaeasRevenge(final GaeasRevenge card) { - super(card); - } + public GaeasRevenge(final GaeasRevenge card) { + super(card); + } - @Override - public GaeasRevenge copy() { - return new GaeasRevenge(this); - } + @Override + public GaeasRevenge copy() { + return new GaeasRevenge(this); + } } diff --git a/Mage.Sets/src/mage/sets/magic2011/GargoyleSentinel.java b/Mage.Sets/src/mage/sets/magic2011/GargoyleSentinel.java index 09be6114a6..2fdbfba0a0 100644 --- a/Mage.Sets/src/mage/sets/magic2011/GargoyleSentinel.java +++ b/Mage.Sets/src/mage/sets/magic2011/GargoyleSentinel.java @@ -54,73 +54,73 @@ import mage.game.permanent.Permanent; */ public class GargoyleSentinel extends CardImpl { - public GargoyleSentinel(UUID ownerId) { - super(ownerId, 207, "Gargoyle Sentinel", Rarity.UNCOMMON, new CardType[]{CardType.ARTIFACT, CardType.CREATURE}, "{3}"); - this.expansionSetCode = "M11"; - this.subtype.add("Gargoyle"); - this.power = new MageInt(3); - this.toughness = new MageInt(3); + public GargoyleSentinel(UUID ownerId) { + super(ownerId, 207, "Gargoyle Sentinel", Rarity.UNCOMMON, new CardType[]{CardType.ARTIFACT, CardType.CREATURE}, "{3}"); + this.expansionSetCode = "M11"; + this.subtype.add("Gargoyle"); + this.power = new MageInt(3); + this.toughness = new MageInt(3); - this.addAbility(DefenderAbility.getInstance()); - this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new GargoyleSentinelEffect(), new ManaCostsImpl("{3}"))); - } + this.addAbility(DefenderAbility.getInstance()); + this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new GargoyleSentinelEffect(), new ManaCostsImpl("{3}"))); + } - public GargoyleSentinel(final GargoyleSentinel card) { - super(card); - } + public GargoyleSentinel(final GargoyleSentinel card) { + super(card); + } - @Override - public GargoyleSentinel copy() { - return new GargoyleSentinel(this); - } + @Override + public GargoyleSentinel copy() { + return new GargoyleSentinel(this); + } } class GargoyleSentinelEffect extends ContinuousEffectImpl { - public GargoyleSentinelEffect() { - super(Duration.EndOfTurn, Outcome.AddAbility); - staticText = "Until end of turn, {this} loses defender and gains flying"; - } + public GargoyleSentinelEffect() { + super(Duration.EndOfTurn, Outcome.AddAbility); + staticText = "Until end of turn, {this} loses defender and gains flying"; + } - public GargoyleSentinelEffect(final GargoyleSentinelEffect effect) { - super(effect); - } + public GargoyleSentinelEffect(final GargoyleSentinelEffect effect) { + super(effect); + } - @Override - public GargoyleSentinelEffect copy() { - return new GargoyleSentinelEffect(this); - } + @Override + public GargoyleSentinelEffect copy() { + return new GargoyleSentinelEffect(this); + } - @Override - public boolean apply(Layer layer, SubLayer sublayer, Ability source, Game game) { - Permanent permanent = game.getPermanent(source.getSourceId()); - if (permanent != null) { - switch (layer) { - case AbilityAddingRemovingEffects_6: - if (sublayer == SubLayer.NA) { - for (Iterator i = permanent.getAbilities().iterator(); i.hasNext();) { - Ability entry = i.next(); - if (entry.getId().equals(DefenderAbility.getInstance().getId())) - i.remove(); - } - permanent.getAbilities().add(FlyingAbility.getInstance()); - } - break; - } - return true; - } - return false; - } + @Override + public boolean apply(Layer layer, SubLayer sublayer, Ability source, Game game) { + Permanent permanent = game.getPermanent(source.getSourceId()); + if (permanent != null) { + switch (layer) { + case AbilityAddingRemovingEffects_6: + if (sublayer == SubLayer.NA) { + for (Iterator i = permanent.getAbilities().iterator(); i.hasNext();) { + Ability entry = i.next(); + if (entry.getId().equals(DefenderAbility.getInstance().getId())) + i.remove(); + } + permanent.getAbilities().add(FlyingAbility.getInstance()); + } + break; + } + return true; + } + return false; + } - @Override - public boolean apply(Game game, Ability source) { - return false; - } + @Override + public boolean apply(Game game, Ability source) { + return false; + } - @Override - public boolean hasLayer(Layer layer) { - return layer == Layer.AbilityAddingRemovingEffects_6; - } + @Override + public boolean hasLayer(Layer layer) { + return layer == Layer.AbilityAddingRemovingEffects_6; + } } diff --git a/Mage.Sets/src/mage/sets/magic2011/GarrukWildspeaker.java b/Mage.Sets/src/mage/sets/magic2011/GarrukWildspeaker.java index 7ddf2489a2..bc3fe61f1b 100644 --- a/Mage.Sets/src/mage/sets/magic2011/GarrukWildspeaker.java +++ b/Mage.Sets/src/mage/sets/magic2011/GarrukWildspeaker.java @@ -36,19 +36,19 @@ import java.util.UUID; */ public class GarrukWildspeaker extends mage.sets.magic2010.GarrukWildspeaker { - public GarrukWildspeaker(UUID ownerId) { - super(ownerId); - this.cardNumber = 175; - this.expansionSetCode = "M11"; - } + public GarrukWildspeaker(UUID ownerId) { + super(ownerId); + this.cardNumber = 175; + this.expansionSetCode = "M11"; + } - public GarrukWildspeaker(final GarrukWildspeaker card) { - super(card); - } + public GarrukWildspeaker(final GarrukWildspeaker card) { + super(card); + } - @Override - public GarrukWildspeaker copy() { - return new GarrukWildspeaker(this); - } + @Override + public GarrukWildspeaker copy() { + return new GarrukWildspeaker(this); + } } diff --git a/Mage.Sets/src/mage/sets/magic2011/GarruksCompanion.java b/Mage.Sets/src/mage/sets/magic2011/GarruksCompanion.java index 47e8d29585..b9eabc0595 100644 --- a/Mage.Sets/src/mage/sets/magic2011/GarruksCompanion.java +++ b/Mage.Sets/src/mage/sets/magic2011/GarruksCompanion.java @@ -41,24 +41,24 @@ import mage.cards.CardImpl; */ public class GarruksCompanion extends CardImpl { - public GarruksCompanion(UUID ownerId) { - super(ownerId, 176, "Garruk's Companion", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{G}{G}"); - this.expansionSetCode = "M11"; - this.subtype.add("Beast"); - this.color.setGreen(true); - this.power = new MageInt(3); - this.toughness = new MageInt(2); + public GarruksCompanion(UUID ownerId) { + super(ownerId, 176, "Garruk's Companion", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{G}{G}"); + this.expansionSetCode = "M11"; + this.subtype.add("Beast"); + this.color.setGreen(true); + this.power = new MageInt(3); + this.toughness = new MageInt(2); - this.addAbility(TrampleAbility.getInstance()); - } + this.addAbility(TrampleAbility.getInstance()); + } - public GarruksCompanion(final GarruksCompanion card) { - super(card); - } + public GarruksCompanion(final GarruksCompanion card) { + super(card); + } - @Override - public GarruksCompanion copy() { - return new GarruksCompanion(this); - } + @Override + public GarruksCompanion copy() { + return new GarruksCompanion(this); + } } diff --git a/Mage.Sets/src/mage/sets/magic2011/GarruksPackleader.java b/Mage.Sets/src/mage/sets/magic2011/GarruksPackleader.java index 1715e7daa2..67e6bc5b01 100644 --- a/Mage.Sets/src/mage/sets/magic2011/GarruksPackleader.java +++ b/Mage.Sets/src/mage/sets/magic2011/GarruksPackleader.java @@ -48,60 +48,60 @@ import mage.game.permanent.Permanent; */ public class GarruksPackleader extends CardImpl { - public GarruksPackleader(UUID ownerId) { - super(ownerId, 177, "Garruk's Packleader", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{4}{G}"); - this.expansionSetCode = "M11"; - this.subtype.add("Beast"); - this.color.setGreen(true); - this.power = new MageInt(4); - this.toughness = new MageInt(4); + public GarruksPackleader(UUID ownerId) { + super(ownerId, 177, "Garruk's Packleader", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{4}{G}"); + this.expansionSetCode = "M11"; + this.subtype.add("Beast"); + this.color.setGreen(true); + this.power = new MageInt(4); + this.toughness = new MageInt(4); - this.addAbility(new GarruksPackleaderAbility()); - } + this.addAbility(new GarruksPackleaderAbility()); + } - public GarruksPackleader(final GarruksPackleader card) { - super(card); - } + public GarruksPackleader(final GarruksPackleader card) { + super(card); + } - @Override - public GarruksPackleader copy() { - return new GarruksPackleader(this); - } + @Override + public GarruksPackleader copy() { + return new GarruksPackleader(this); + } } class GarruksPackleaderAbility extends TriggeredAbilityImpl { - public GarruksPackleaderAbility() { - super(Zone.BATTLEFIELD, new DrawCardControllerEffect(1), true); - } + public GarruksPackleaderAbility() { + super(Zone.BATTLEFIELD, new DrawCardControllerEffect(1), true); + } - public GarruksPackleaderAbility(final GarruksPackleaderAbility ability) { - super(ability); - } + public GarruksPackleaderAbility(final GarruksPackleaderAbility ability) { + super(ability); + } - @Override - public GarruksPackleaderAbility copy() { - return new GarruksPackleaderAbility(this); - } + @Override + public GarruksPackleaderAbility copy() { + return new GarruksPackleaderAbility(this); + } - @Override - public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == EventType.ZONE_CHANGE && !event.getTargetId().equals(this.getSourceId())) { - ZoneChangeEvent zEvent = (ZoneChangeEvent)event; - if (zEvent.getToZone() == Zone.BATTLEFIELD) { - Permanent permanent = game.getPermanent(event.getTargetId()); - if (permanent != null && permanent.getCardType().contains(CardType.CREATURE) && permanent.getControllerId().equals(this.getControllerId()) && permanent.getPower().getValue() > 2) { - return true; - } - } - } - return false; - } + @Override + public boolean checkTrigger(GameEvent event, Game game) { + if (event.getType() == EventType.ZONE_CHANGE && !event.getTargetId().equals(this.getSourceId())) { + ZoneChangeEvent zEvent = (ZoneChangeEvent)event; + if (zEvent.getToZone() == Zone.BATTLEFIELD) { + Permanent permanent = game.getPermanent(event.getTargetId()); + if (permanent != null && permanent.getCardType().contains(CardType.CREATURE) && permanent.getControllerId().equals(this.getControllerId()) && permanent.getPower().getValue() > 2) { + return true; + } + } + } + return false; + } - @Override - public String getRule() { - return "Whenever another creature with power 3 or greater enters the battlefield under your control, you may draw a card"; - } + @Override + public String getRule() { + return "Whenever another creature with power 3 or greater enters the battlefield under your control, you may draw a card"; + } } diff --git a/Mage.Sets/src/mage/sets/magic2011/GiantGrowth.java b/Mage.Sets/src/mage/sets/magic2011/GiantGrowth.java index 187a33da29..8b30aaea33 100644 --- a/Mage.Sets/src/mage/sets/magic2011/GiantGrowth.java +++ b/Mage.Sets/src/mage/sets/magic2011/GiantGrowth.java @@ -36,19 +36,19 @@ import java.util.UUID; */ public class GiantGrowth extends mage.sets.tenth.GiantGrowth { - public GiantGrowth(UUID ownerId) { - super(ownerId); - this.cardNumber = 178; - this.expansionSetCode = "M11"; - } + public GiantGrowth(UUID ownerId) { + super(ownerId); + this.cardNumber = 178; + this.expansionSetCode = "M11"; + } - public GiantGrowth(final GiantGrowth card) { - super(card); - } + public GiantGrowth(final GiantGrowth card) { + super(card); + } - @Override - public GiantGrowth copy() { - return new GiantGrowth(this); - } + @Override + public GiantGrowth copy() { + return new GiantGrowth(this); + } } diff --git a/Mage.Sets/src/mage/sets/magic2011/GiantSpider.java b/Mage.Sets/src/mage/sets/magic2011/GiantSpider.java index 6942349c09..f3fcf178ce 100644 --- a/Mage.Sets/src/mage/sets/magic2011/GiantSpider.java +++ b/Mage.Sets/src/mage/sets/magic2011/GiantSpider.java @@ -36,20 +36,20 @@ import java.util.UUID; */ public class GiantSpider extends mage.sets.tenth.GiantSpider { - public GiantSpider(UUID ownerId) { - super(ownerId); - this.cardNumber = 179; - this.expansionSetCode = "M11"; - } + public GiantSpider(UUID ownerId) { + super(ownerId); + this.cardNumber = 179; + this.expansionSetCode = "M11"; + } - public GiantSpider(final GiantSpider card) { - super(card); - } + public GiantSpider(final GiantSpider card) { + super(card); + } - @Override - public GiantSpider copy() { - return new GiantSpider(this); - } + @Override + public GiantSpider copy() { + return new GiantSpider(this); + } } diff --git a/Mage.Sets/src/mage/sets/magic2011/GlacialFortress.java b/Mage.Sets/src/mage/sets/magic2011/GlacialFortress.java index 10e4082bb2..4cf8a059cf 100644 --- a/Mage.Sets/src/mage/sets/magic2011/GlacialFortress.java +++ b/Mage.Sets/src/mage/sets/magic2011/GlacialFortress.java @@ -36,19 +36,19 @@ import java.util.UUID; */ public class GlacialFortress extends mage.sets.magic2010.GlacialFortress { - public GlacialFortress(UUID ownerId) { - super(ownerId); - this.cardNumber = 225; - this.expansionSetCode = "M11"; - } + public GlacialFortress(UUID ownerId) { + super(ownerId); + this.cardNumber = 225; + this.expansionSetCode = "M11"; + } - public GlacialFortress(final GlacialFortress card) { - super(card); - } + public GlacialFortress(final GlacialFortress card) { + super(card); + } - @Override - public GlacialFortress copy() { - return new GlacialFortress(this); - } + @Override + public GlacialFortress copy() { + return new GlacialFortress(this); + } } diff --git a/Mage.Sets/src/mage/sets/magic2011/GoblinBalloonBrigade.java b/Mage.Sets/src/mage/sets/magic2011/GoblinBalloonBrigade.java index 888095655c..eb8b628063 100644 --- a/Mage.Sets/src/mage/sets/magic2011/GoblinBalloonBrigade.java +++ b/Mage.Sets/src/mage/sets/magic2011/GoblinBalloonBrigade.java @@ -46,25 +46,25 @@ import mage.cards.CardImpl; */ public class GoblinBalloonBrigade extends CardImpl { - public GoblinBalloonBrigade(UUID ownerId) { - super(ownerId, 140, "Goblin Balloon Brigade", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{R}"); - this.expansionSetCode = "M11"; - this.subtype.add("Goblin"); - this.subtype.add("Warrior"); - this.color.setRed(true); - this.power = new MageInt(1); - this.toughness = new MageInt(1); + public GoblinBalloonBrigade(UUID ownerId) { + super(ownerId, 140, "Goblin Balloon Brigade", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{R}"); + this.expansionSetCode = "M11"; + this.subtype.add("Goblin"); + this.subtype.add("Warrior"); + this.color.setRed(true); + this.power = new MageInt(1); + this.toughness = new MageInt(1); - this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new GainAbilitySourceEffect(FlyingAbility.getInstance(), Duration.EndOfTurn), new ManaCostsImpl("{R}"))); - } + this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new GainAbilitySourceEffect(FlyingAbility.getInstance(), Duration.EndOfTurn), new ManaCostsImpl("{R}"))); + } - public GoblinBalloonBrigade(final GoblinBalloonBrigade card) { - super(card); - } + public GoblinBalloonBrigade(final GoblinBalloonBrigade card) { + super(card); + } - @Override - public GoblinBalloonBrigade copy() { - return new GoblinBalloonBrigade(this); - } + @Override + public GoblinBalloonBrigade copy() { + return new GoblinBalloonBrigade(this); + } } diff --git a/Mage.Sets/src/mage/sets/magic2011/GoblinChieftain.java b/Mage.Sets/src/mage/sets/magic2011/GoblinChieftain.java index 6db3ba87d4..5dd0afae2a 100644 --- a/Mage.Sets/src/mage/sets/magic2011/GoblinChieftain.java +++ b/Mage.Sets/src/mage/sets/magic2011/GoblinChieftain.java @@ -36,19 +36,19 @@ import java.util.UUID; */ public class GoblinChieftain extends mage.sets.magic2010.GoblinChieftain { - public GoblinChieftain(UUID ownerId) { - super(ownerId); - this.cardNumber = 141; - this.expansionSetCode = "M11"; - } + public GoblinChieftain(UUID ownerId) { + super(ownerId); + this.cardNumber = 141; + this.expansionSetCode = "M11"; + } - public GoblinChieftain(final GoblinChieftain card) { - super(card); - } + public GoblinChieftain(final GoblinChieftain card) { + super(card); + } - @Override - public GoblinChieftain copy() { - return new GoblinChieftain(this); - } + @Override + public GoblinChieftain copy() { + return new GoblinChieftain(this); + } } diff --git a/Mage.Sets/src/mage/sets/magic2011/GoblinPiker.java b/Mage.Sets/src/mage/sets/magic2011/GoblinPiker.java index 04b3e5e7e1..6bc80908d6 100644 --- a/Mage.Sets/src/mage/sets/magic2011/GoblinPiker.java +++ b/Mage.Sets/src/mage/sets/magic2011/GoblinPiker.java @@ -36,19 +36,19 @@ import java.util.UUID; */ public class GoblinPiker extends mage.sets.tenth.GoblinPiker { - public GoblinPiker(UUID ownerId) { - super(ownerId); - this.cardNumber = 142; - this.expansionSetCode = "M11"; - } + public GoblinPiker(UUID ownerId) { + super(ownerId); + this.cardNumber = 142; + this.expansionSetCode = "M11"; + } - public GoblinPiker(final GoblinPiker card) { - super(card); - } + public GoblinPiker(final GoblinPiker card) { + super(card); + } - @Override - public GoblinPiker copy() { - return new GoblinPiker(this); - } + @Override + public GoblinPiker copy() { + return new GoblinPiker(this); + } } diff --git a/Mage.Sets/src/mage/sets/magic2011/GoblinTunneler.java b/Mage.Sets/src/mage/sets/magic2011/GoblinTunneler.java index 4cad553b47..165fde60de 100644 --- a/Mage.Sets/src/mage/sets/magic2011/GoblinTunneler.java +++ b/Mage.Sets/src/mage/sets/magic2011/GoblinTunneler.java @@ -36,19 +36,19 @@ import java.util.UUID; */ public class GoblinTunneler extends mage.sets.riseoftheeldrazi.GoblinTunneler { - public GoblinTunneler(UUID ownerId) { - super(ownerId); - this.cardNumber = 143; - this.expansionSetCode = "M11"; - } + public GoblinTunneler(UUID ownerId) { + super(ownerId); + this.cardNumber = 143; + this.expansionSetCode = "M11"; + } - public GoblinTunneler(final GoblinTunneler card) { - super(card); - } + public GoblinTunneler(final GoblinTunneler card) { + super(card); + } - @Override - public GoblinTunneler copy() { - return new GoblinTunneler(this); - } + @Override + public GoblinTunneler copy() { + return new GoblinTunneler(this); + } } diff --git a/Mage.Sets/src/mage/sets/magic2011/GoldenglowMoth.java b/Mage.Sets/src/mage/sets/magic2011/GoldenglowMoth.java index f56e9abfd1..c0992e3f38 100644 --- a/Mage.Sets/src/mage/sets/magic2011/GoldenglowMoth.java +++ b/Mage.Sets/src/mage/sets/magic2011/GoldenglowMoth.java @@ -43,27 +43,27 @@ import mage.cards.CardImpl; */ public class GoldenglowMoth extends CardImpl { - public GoldenglowMoth(UUID ownerId) { - super(ownerId, 15, "Goldenglow Moth", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{W}"); - this.expansionSetCode = "M11"; - this.subtype.add("Insect"); - - this.color.setWhite(true); - this.power = new MageInt(0); - this.toughness = new MageInt(1); + public GoldenglowMoth(UUID ownerId) { + super(ownerId, 15, "Goldenglow Moth", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{W}"); + this.expansionSetCode = "M11"; + this.subtype.add("Insect"); - this.addAbility(FlyingAbility.getInstance()); - this.addAbility(new BlocksTriggeredAbility(new GainLifeEffect(4), true)); + this.color.setWhite(true); + this.power = new MageInt(0); + this.toughness = new MageInt(1); - } + this.addAbility(FlyingAbility.getInstance()); + this.addAbility(new BlocksTriggeredAbility(new GainLifeEffect(4), true)); - public GoldenglowMoth(final GoldenglowMoth card) { - super(card); - } + } - @Override - public GoldenglowMoth copy() { - return new GoldenglowMoth(this); - } + public GoldenglowMoth(final GoldenglowMoth card) { + super(card); + } + + @Override + public GoldenglowMoth copy() { + return new GoldenglowMoth(this); + } } diff --git a/Mage.Sets/src/mage/sets/magic2011/GraveTitan.java b/Mage.Sets/src/mage/sets/magic2011/GraveTitan.java index c749da5ae1..5d16fd1a5d 100644 --- a/Mage.Sets/src/mage/sets/magic2011/GraveTitan.java +++ b/Mage.Sets/src/mage/sets/magic2011/GraveTitan.java @@ -49,61 +49,61 @@ import mage.game.permanent.token.ZombieToken; */ public class GraveTitan extends CardImpl { - public GraveTitan(UUID ownerId) { - super(ownerId, 97, "Grave Titan", Rarity.MYTHIC, new CardType[]{CardType.CREATURE}, "{4}{B}{B}"); - this.expansionSetCode = "M11"; - this.subtype.add("Giant"); - this.color.setBlack(true); - this.power = new MageInt(6); - this.toughness = new MageInt(6); + public GraveTitan(UUID ownerId) { + super(ownerId, 97, "Grave Titan", Rarity.MYTHIC, new CardType[]{CardType.CREATURE}, "{4}{B}{B}"); + this.expansionSetCode = "M11"; + this.subtype.add("Giant"); + this.color.setBlack(true); + this.power = new MageInt(6); + this.toughness = new MageInt(6); - this.addAbility(DeathtouchAbility.getInstance()); - this.addAbility(new GraveTitanAbility()); - } + this.addAbility(DeathtouchAbility.getInstance()); + this.addAbility(new GraveTitanAbility()); + } - public GraveTitan(final GraveTitan card) { - super(card); - } + public GraveTitan(final GraveTitan card) { + super(card); + } - @Override - public GraveTitan copy() { - return new GraveTitan(this); - } + @Override + public GraveTitan copy() { + return new GraveTitan(this); + } } class GraveTitanAbility extends TriggeredAbilityImpl { - public GraveTitanAbility() { - super(Zone.BATTLEFIELD, new CreateTokenEffect(new ZombieToken(), 2), false); - } + public GraveTitanAbility() { + super(Zone.BATTLEFIELD, new CreateTokenEffect(new ZombieToken(), 2), false); + } - public GraveTitanAbility(final GraveTitanAbility ability) { - super(ability); - } + public GraveTitanAbility(final GraveTitanAbility ability) { + super(ability); + } - @Override - public GraveTitanAbility copy() { - return new GraveTitanAbility(this); - } + @Override + public GraveTitanAbility copy() { + return new GraveTitanAbility(this); + } - @Override - public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == EventType.ATTACKER_DECLARED && event.getSourceId().equals(this.getSourceId())) { - return true; - } - if (event.getType() == EventType.ZONE_CHANGE && event.getTargetId().equals(this.getSourceId()) ) { - ZoneChangeEvent zEvent = (ZoneChangeEvent)event; - if (zEvent.getToZone() == Zone.BATTLEFIELD) { - return true; - } - } - return false; - } + @Override + public boolean checkTrigger(GameEvent event, Game game) { + if (event.getType() == EventType.ATTACKER_DECLARED && event.getSourceId().equals(this.getSourceId())) { + return true; + } + if (event.getType() == EventType.ZONE_CHANGE && event.getTargetId().equals(this.getSourceId()) ) { + ZoneChangeEvent zEvent = (ZoneChangeEvent)event; + if (zEvent.getToZone() == Zone.BATTLEFIELD) { + return true; + } + } + return false; + } - @Override - public String getRule() { - return "Whenever {this} enters the battlefield or attacks, put two 2/2 black Zombie creature tokens onto the battlefield"; - } + @Override + public String getRule() { + return "Whenever {this} enters the battlefield or attacks, put two 2/2 black Zombie creature tokens onto the battlefield"; + } } diff --git a/Mage.Sets/src/mage/sets/magic2011/Gravedigger.java b/Mage.Sets/src/mage/sets/magic2011/Gravedigger.java index f5d66e587b..4230b87cae 100644 --- a/Mage.Sets/src/mage/sets/magic2011/Gravedigger.java +++ b/Mage.Sets/src/mage/sets/magic2011/Gravedigger.java @@ -36,19 +36,19 @@ import java.util.UUID; */ public class Gravedigger extends mage.sets.tenth.Gravedigger { - public Gravedigger(UUID ownerId) { - super(ownerId); - this.cardNumber = 98; - this.expansionSetCode = "M11"; - } + public Gravedigger(UUID ownerId) { + super(ownerId); + this.cardNumber = 98; + this.expansionSetCode = "M11"; + } - public Gravedigger(final Gravedigger card) { - super(card); - } + public Gravedigger(final Gravedigger card) { + super(card); + } - @Override - public Gravedigger copy() { - return new Gravedigger(this); - } + @Override + public Gravedigger copy() { + return new Gravedigger(this); + } } diff --git a/Mage.Sets/src/mage/sets/magic2011/GreaterBasilisk.java b/Mage.Sets/src/mage/sets/magic2011/GreaterBasilisk.java index 3960fbf5d8..6f2ca005e6 100644 --- a/Mage.Sets/src/mage/sets/magic2011/GreaterBasilisk.java +++ b/Mage.Sets/src/mage/sets/magic2011/GreaterBasilisk.java @@ -41,24 +41,24 @@ import mage.cards.CardImpl; */ public class GreaterBasilisk extends CardImpl { - public GreaterBasilisk(UUID ownerId) { - super(ownerId, 180, "Greater Basilisk", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{3}{G}{G}"); - this.expansionSetCode = "M11"; - this.subtype.add("Basilisk"); - this.color.setGreen(true); - this.power = new MageInt(3); - this.toughness = new MageInt(5); + public GreaterBasilisk(UUID ownerId) { + super(ownerId, 180, "Greater Basilisk", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{3}{G}{G}"); + this.expansionSetCode = "M11"; + this.subtype.add("Basilisk"); + this.color.setGreen(true); + this.power = new MageInt(3); + this.toughness = new MageInt(5); - this.addAbility(DeathtouchAbility.getInstance()); - } + this.addAbility(DeathtouchAbility.getInstance()); + } - public GreaterBasilisk(final GreaterBasilisk card) { - super(card); - } + public GreaterBasilisk(final GreaterBasilisk card) { + super(card); + } - @Override - public GreaterBasilisk copy() { - return new GreaterBasilisk(this); - } + @Override + public GreaterBasilisk copy() { + return new GreaterBasilisk(this); + } } diff --git a/Mage.Sets/src/mage/sets/magic2011/HauntingEchoes.java b/Mage.Sets/src/mage/sets/magic2011/HauntingEchoes.java index 78f5212072..56b650297b 100644 --- a/Mage.Sets/src/mage/sets/magic2011/HauntingEchoes.java +++ b/Mage.Sets/src/mage/sets/magic2011/HauntingEchoes.java @@ -36,19 +36,19 @@ import java.util.UUID; */ public class HauntingEchoes extends mage.sets.magic2010.HauntingEchoes { - public HauntingEchoes(UUID ownerId) { - super(ownerId); - this.cardNumber = 99; - this.expansionSetCode = "M11"; - } + public HauntingEchoes(UUID ownerId) { + super(ownerId); + this.cardNumber = 99; + this.expansionSetCode = "M11"; + } - public HauntingEchoes(final HauntingEchoes card) { - super(card); - } + public HauntingEchoes(final HauntingEchoes card) { + super(card); + } - @Override - public HauntingEchoes copy() { - return new HauntingEchoes(this); - } + @Override + public HauntingEchoes copy() { + return new HauntingEchoes(this); + } } diff --git a/Mage.Sets/src/mage/sets/magic2011/HoardingDragon.java b/Mage.Sets/src/mage/sets/magic2011/HoardingDragon.java index d407484ecf..b85ebc22cf 100644 --- a/Mage.Sets/src/mage/sets/magic2011/HoardingDragon.java +++ b/Mage.Sets/src/mage/sets/magic2011/HoardingDragon.java @@ -53,57 +53,57 @@ import mage.target.common.TargetCardInLibrary; */ public class HoardingDragon extends CardImpl { - private static final FilterCard filter = new FilterCard(); + private static final FilterCard filter = new FilterCard(); - static { - filter.getCardType().add(CardType.ARTIFACT); - } + static { + filter.getCardType().add(CardType.ARTIFACT); + } - public HoardingDragon(UUID ownerId) { - super(ownerId, 144, "Hoarding Dragon", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{3}{R}{R}"); - this.expansionSetCode = "M11"; - this.subtype.add("Dragon"); - this.color.setRed(true); - this.power = new MageInt(4); - this.toughness = new MageInt(4); + public HoardingDragon(UUID ownerId) { + super(ownerId, 144, "Hoarding Dragon", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{3}{R}{R}"); + this.expansionSetCode = "M11"; + this.subtype.add("Dragon"); + this.color.setRed(true); + this.power = new MageInt(4); + this.toughness = new MageInt(4); - this.addAbility(FlyingAbility.getInstance()); - this.addAbility(new EntersBattlefieldTriggeredAbility(new HoardingDragonEffect(this.getId()), true)); - this.addAbility(new DiesTriggeredAbility(new ReturnFromExileEffect(this.getId(), Zone.BATTLEFIELD), false)); - } + this.addAbility(FlyingAbility.getInstance()); + this.addAbility(new EntersBattlefieldTriggeredAbility(new HoardingDragonEffect(this.getId()), true)); + this.addAbility(new DiesTriggeredAbility(new ReturnFromExileEffect(this.getId(), Zone.BATTLEFIELD), false)); + } - public HoardingDragon(final HoardingDragon card) { - super(card); - } + public HoardingDragon(final HoardingDragon card) { + super(card); + } - @Override - public HoardingDragon copy() { - return new HoardingDragon(this); - } + @Override + public HoardingDragon copy() { + return new HoardingDragon(this); + } } class HoardingDragonEffect extends OneShotEffect { - protected UUID exileId; - protected TargetCardInLibrary target; - - public HoardingDragonEffect(UUID exileId) { - super(Outcome.Exile); - this.exileId = exileId; - target = new TargetCardInLibrary(); - staticText = "When {this} enters the battlefield, you may search your library for an artifact card, exile it, then shuffle your library"; - } - - public HoardingDragonEffect(final HoardingDragonEffect effect) { - super(effect); - this.exileId = effect.exileId; - this.target = effect.target.copy(); - } - - @Override - public boolean apply(Game game, Ability source) { - Player player = game.getPlayer(source.getControllerId()); + protected UUID exileId; + protected TargetCardInLibrary target; + + public HoardingDragonEffect(UUID exileId) { + super(Outcome.Exile); + this.exileId = exileId; + target = new TargetCardInLibrary(); + staticText = "When {this} enters the battlefield, you may search your library for an artifact card, exile it, then shuffle your library"; + } + + public HoardingDragonEffect(final HoardingDragonEffect effect) { + super(effect); + this.exileId = effect.exileId; + this.target = effect.target.copy(); + } + + @Override + public boolean apply(Game game, Ability source) { + Player player = game.getPlayer(source.getControllerId()); if (player != null) { if (player.searchLibrary(target, game)) { if (target.getTargets().size() > 0) { @@ -116,12 +116,12 @@ class HoardingDragonEffect extends OneShotEffect { return true; } player.shuffleLibrary(game); - return false; - } + return false; + } - @Override - public HoardingDragonEffect copy() { - return new HoardingDragonEffect(this); - } + @Override + public HoardingDragonEffect copy() { + return new HoardingDragonEffect(this); + } } diff --git a/Mage.Sets/src/mage/sets/magic2011/HolyStrength.java b/Mage.Sets/src/mage/sets/magic2011/HolyStrength.java index b9cc50279d..0d5817b9f6 100644 --- a/Mage.Sets/src/mage/sets/magic2011/HolyStrength.java +++ b/Mage.Sets/src/mage/sets/magic2011/HolyStrength.java @@ -36,19 +36,19 @@ import java.util.UUID; */ public class HolyStrength extends mage.sets.tenth.HolyStrength { - public HolyStrength(UUID ownerId) { - super(ownerId); - this.cardNumber = 16; - this.expansionSetCode = "M11"; - } + public HolyStrength(UUID ownerId) { + super(ownerId); + this.cardNumber = 16; + this.expansionSetCode = "M11"; + } - public HolyStrength(final HolyStrength card) { - super(card); - } + public HolyStrength(final HolyStrength card) { + super(card); + } - @Override - public HolyStrength copy() { - return new HolyStrength(this); - } + @Override + public HolyStrength copy() { + return new HolyStrength(this); + } } diff --git a/Mage.Sets/src/mage/sets/magic2011/HonorOfThePure.java b/Mage.Sets/src/mage/sets/magic2011/HonorOfThePure.java index 3751bb1bdf..4cb256f8ce 100644 --- a/Mage.Sets/src/mage/sets/magic2011/HonorOfThePure.java +++ b/Mage.Sets/src/mage/sets/magic2011/HonorOfThePure.java @@ -36,19 +36,19 @@ import java.util.UUID; */ public class HonorOfThePure extends mage.sets.magic2010.HonorOfThePure { - public HonorOfThePure(UUID ownerId) { - super(ownerId); - this.cardNumber = 17; - this.expansionSetCode = "M11"; - } + public HonorOfThePure(UUID ownerId) { + super(ownerId); + this.cardNumber = 17; + this.expansionSetCode = "M11"; + } - public HonorOfThePure(final HonorOfThePure card) { - super(card); - } + public HonorOfThePure(final HonorOfThePure card) { + super(card); + } - @Override - public HonorOfThePure copy() { - return new HonorOfThePure(this); - } + @Override + public HonorOfThePure copy() { + return new HonorOfThePure(this); + } } diff --git a/Mage.Sets/src/mage/sets/magic2011/HornetSting.java b/Mage.Sets/src/mage/sets/magic2011/HornetSting.java index 2744deb9ab..8a4254a58a 100644 --- a/Mage.Sets/src/mage/sets/magic2011/HornetSting.java +++ b/Mage.Sets/src/mage/sets/magic2011/HornetSting.java @@ -41,20 +41,20 @@ import mage.target.common.TargetCreatureOrPlayer; */ public class HornetSting extends CardImpl { - public HornetSting(UUID ownerId) { - super(ownerId, 181, "Hornet Sting", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{G}"); - this.expansionSetCode = "M11"; - this.color.setGreen(true); - this.getSpellAbility().addTarget(new TargetCreatureOrPlayer()); - this.getSpellAbility().addEffect(new DamageTargetEffect(1)); - } + public HornetSting(UUID ownerId) { + super(ownerId, 181, "Hornet Sting", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{G}"); + this.expansionSetCode = "M11"; + this.color.setGreen(true); + this.getSpellAbility().addTarget(new TargetCreatureOrPlayer()); + this.getSpellAbility().addEffect(new DamageTargetEffect(1)); + } - public HornetSting(final HornetSting card) { - super(card); - } + public HornetSting(final HornetSting card) { + super(card); + } - @Override - public HornetSting copy() { - return new HornetSting(this); - } + @Override + public HornetSting copy() { + return new HornetSting(this); + } } diff --git a/Mage.Sets/src/mage/sets/magic2011/HowlingBanshee.java b/Mage.Sets/src/mage/sets/magic2011/HowlingBanshee.java index 7e4d10fdeb..506962ba4c 100644 --- a/Mage.Sets/src/mage/sets/magic2011/HowlingBanshee.java +++ b/Mage.Sets/src/mage/sets/magic2011/HowlingBanshee.java @@ -36,19 +36,19 @@ import java.util.UUID; */ public class HowlingBanshee extends mage.sets.magic2010.HowlingBanshee { - public HowlingBanshee(UUID ownerId) { - super(ownerId); - this.cardNumber = 100; - this.expansionSetCode = "M11"; - } + public HowlingBanshee(UUID ownerId) { + super(ownerId); + this.cardNumber = 100; + this.expansionSetCode = "M11"; + } - public HowlingBanshee(final HowlingBanshee card) { - super(card); - } + public HowlingBanshee(final HowlingBanshee card) { + super(card); + } - @Override - public HowlingBanshee copy() { - return new HowlingBanshee(this); - } + @Override + public HowlingBanshee copy() { + return new HowlingBanshee(this); + } } diff --git a/Mage.Sets/src/mage/sets/magic2011/HuntersFeast.java b/Mage.Sets/src/mage/sets/magic2011/HuntersFeast.java index d89671e97b..068616763d 100644 --- a/Mage.Sets/src/mage/sets/magic2011/HuntersFeast.java +++ b/Mage.Sets/src/mage/sets/magic2011/HuntersFeast.java @@ -41,20 +41,20 @@ import mage.target.TargetPlayer; */ public class HuntersFeast extends CardImpl { - public HuntersFeast(UUID ownerId) { - super(ownerId, 182, "Hunters' Feast", Rarity.COMMON, new CardType[]{CardType.SORCERY}, "{3}{G}"); - this.expansionSetCode = "M11"; - this.color.setGreen(true); - this.getSpellAbility().addTarget(new TargetPlayer(0, Integer.MAX_VALUE, false)); - this.getSpellAbility().addEffect(new GainLifeTargetEffect(6)); - } + public HuntersFeast(UUID ownerId) { + super(ownerId, 182, "Hunters' Feast", Rarity.COMMON, new CardType[]{CardType.SORCERY}, "{3}{G}"); + this.expansionSetCode = "M11"; + this.color.setGreen(true); + this.getSpellAbility().addTarget(new TargetPlayer(0, Integer.MAX_VALUE, false)); + this.getSpellAbility().addEffect(new GainLifeTargetEffect(6)); + } - public HuntersFeast(final HuntersFeast card) { - super(card); - } + public HuntersFeast(final HuntersFeast card) { + super(card); + } - @Override - public HuntersFeast copy() { - return new HuntersFeast(this); - } + @Override + public HuntersFeast copy() { + return new HuntersFeast(this); + } } diff --git a/Mage.Sets/src/mage/sets/magic2011/IceCage.java b/Mage.Sets/src/mage/sets/magic2011/IceCage.java index be90658c89..5c68c1f4eb 100644 --- a/Mage.Sets/src/mage/sets/magic2011/IceCage.java +++ b/Mage.Sets/src/mage/sets/magic2011/IceCage.java @@ -36,19 +36,19 @@ import java.util.UUID; */ public class IceCage extends mage.sets.magic2010.IceCage { - public IceCage(UUID ownerId) { - super(ownerId); - this.cardNumber = 57; - this.expansionSetCode = "M11"; - } + public IceCage(UUID ownerId) { + super(ownerId); + this.cardNumber = 57; + this.expansionSetCode = "M11"; + } - public IceCage(final IceCage card) { - super(card); - } + public IceCage(final IceCage card) { + super(card); + } - @Override - public IceCage copy() { - return new IceCage(this); - } + @Override + public IceCage copy() { + return new IceCage(this); + } } diff --git a/Mage.Sets/src/mage/sets/magic2011/Incite.java b/Mage.Sets/src/mage/sets/magic2011/Incite.java index e05572cb87..7c563d0ccc 100644 --- a/Mage.Sets/src/mage/sets/magic2011/Incite.java +++ b/Mage.Sets/src/mage/sets/magic2011/Incite.java @@ -45,55 +45,55 @@ import mage.target.common.TargetCreaturePermanent; */ public class Incite extends CardImpl { - public Incite(UUID ownerId) { - super(ownerId, 145, "Incite", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{R}"); - this.expansionSetCode = "M11"; - this.color.setRed(true); + public Incite(UUID ownerId) { + super(ownerId, 145, "Incite", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{R}"); + this.expansionSetCode = "M11"; + this.color.setRed(true); // Target creature becomes red until end of turn and attacks this turn if able. this.getSpellAbility().addTarget(new TargetCreaturePermanent()); -// this.getSpellAbility().addEffect(new InciteEffect()); +// this.getSpellAbility().addEffect(new InciteEffect()); this.getSpellAbility().addEffect(new SetCardColorTargetEffect(ObjectColor.RED, Constants.Duration.EndOfTurn, "Target creature becomes red until end of turn")); - this.getSpellAbility().addEffect(new AttacksIfAbleTargetEffect(Duration.EndOfTurn)); - } + this.getSpellAbility().addEffect(new AttacksIfAbleTargetEffect(Duration.EndOfTurn)); + } - public Incite(final Incite card) { - super(card); - } + public Incite(final Incite card) { + super(card); + } - @Override - public Incite copy() { - return new Incite(this); - } + @Override + public Incite copy() { + return new Incite(this); + } } //class InciteEffect extends ContinuousEffectImpl { // -// public InciteEffect() { -// super(Duration.EndOfTurn, Layer.ColorChangingEffects_5, SubLayer.NA, Outcome.Detriment); -// staticText = "Target creature becomes red until end of turn"; -// } +// public InciteEffect() { +// super(Duration.EndOfTurn, Layer.ColorChangingEffects_5, SubLayer.NA, Outcome.Detriment); +// staticText = "Target creature becomes red until end of turn"; +// } // -// public InciteEffect(final InciteEffect effect) { -// super(effect); -// } +// public InciteEffect(final InciteEffect effect) { +// super(effect); +// } // -// @Override -// public InciteEffect copy() { -// return new InciteEffect(this); -// } +// @Override +// public InciteEffect copy() { +// return new InciteEffect(this); +// } // -// @Override -// public boolean apply(Game game, Ability source) { -// Permanent permanent = game.getPermanent(source.getFirstTarget()); -// if (permanent != null) { -// permanent.getColor().setRed(true); -// permanent.getColor().setWhite(false); -// permanent.getColor().setGreen(false); -// permanent.getColor().setBlue(false); -// permanent.getColor().setBlack(false); -// return true; -// } -// return false; -// } +// @Override +// public boolean apply(Game game, Ability source) { +// Permanent permanent = game.getPermanent(source.getFirstTarget()); +// if (permanent != null) { +// permanent.getColor().setRed(true); +// permanent.getColor().setWhite(false); +// permanent.getColor().setGreen(false); +// permanent.getColor().setBlue(false); +// permanent.getColor().setBlack(false); +// return true; +// } +// return false; +// } // //} diff --git a/Mage.Sets/src/mage/sets/magic2011/InfantryVeteran.java b/Mage.Sets/src/mage/sets/magic2011/InfantryVeteran.java index e91236b5b4..e8e86b74f9 100644 --- a/Mage.Sets/src/mage/sets/magic2011/InfantryVeteran.java +++ b/Mage.Sets/src/mage/sets/magic2011/InfantryVeteran.java @@ -47,27 +47,27 @@ import mage.target.common.TargetAttackingCreature; */ public class InfantryVeteran extends CardImpl { - public InfantryVeteran(UUID ownerId) { - super(ownerId, 18, "Infantry Veteran", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{W}"); - this.expansionSetCode = "M11"; - this.subtype.add("Human"); - this.subtype.add("Soldier"); - this.color.setWhite(true); - this.power = new MageInt(1); - this.toughness = new MageInt(1); + public InfantryVeteran(UUID ownerId) { + super(ownerId, 18, "Infantry Veteran", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{W}"); + this.expansionSetCode = "M11"; + this.subtype.add("Human"); + this.subtype.add("Soldier"); + this.color.setWhite(true); + this.power = new MageInt(1); + this.toughness = new MageInt(1); - Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new BoostTargetEffect(1, 1, Duration.EndOfTurn), new TapSourceCost()); - ability.addTarget(new TargetAttackingCreature()); - this.addAbility(ability); - } + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new BoostTargetEffect(1, 1, Duration.EndOfTurn), new TapSourceCost()); + ability.addTarget(new TargetAttackingCreature()); + this.addAbility(ability); + } - public InfantryVeteran(final InfantryVeteran card) { - super(card); - } + public InfantryVeteran(final InfantryVeteran card) { + super(card); + } - @Override - public InfantryVeteran copy() { - return new InfantryVeteran(this); - } + @Override + public InfantryVeteran copy() { + return new InfantryVeteran(this); + } } diff --git a/Mage.Sets/src/mage/sets/magic2011/InfernoTitan.java b/Mage.Sets/src/mage/sets/magic2011/InfernoTitan.java index cd022a6195..6981868b04 100644 --- a/Mage.Sets/src/mage/sets/magic2011/InfernoTitan.java +++ b/Mage.Sets/src/mage/sets/magic2011/InfernoTitan.java @@ -52,62 +52,62 @@ import mage.target.common.TargetCreatureOrPlayerAmount; */ public class InfernoTitan extends CardImpl { - public InfernoTitan(UUID ownerId) { - super(ownerId, 146, "Inferno Titan", Rarity.MYTHIC, new CardType[]{CardType.CREATURE}, "{4}{R}{R}"); - this.expansionSetCode = "M11"; - this.subtype.add("Giant"); - this.color.setRed(true); - this.power = new MageInt(6); - this.toughness = new MageInt(6); + public InfernoTitan(UUID ownerId) { + super(ownerId, 146, "Inferno Titan", Rarity.MYTHIC, new CardType[]{CardType.CREATURE}, "{4}{R}{R}"); + this.expansionSetCode = "M11"; + this.subtype.add("Giant"); + this.color.setRed(true); + this.power = new MageInt(6); + this.toughness = new MageInt(6); - this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new BoostSourceEffect(1, 0, Duration.EndOfTurn), new ManaCostsImpl("{R}"))); - this.addAbility(new InfernoTitanAbility()); - } + this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new BoostSourceEffect(1, 0, Duration.EndOfTurn), new ManaCostsImpl("{R}"))); + this.addAbility(new InfernoTitanAbility()); + } - public InfernoTitan(final InfernoTitan card) { - super(card); - } + public InfernoTitan(final InfernoTitan card) { + super(card); + } - @Override - public InfernoTitan copy() { - return new InfernoTitan(this); - } + @Override + public InfernoTitan copy() { + return new InfernoTitan(this); + } } class InfernoTitanAbility extends TriggeredAbilityImpl { - public InfernoTitanAbility() { - super(Zone.BATTLEFIELD, new DamageMultiEffect(3), false); - this.addTarget(new TargetCreatureOrPlayerAmount(3)); - } + public InfernoTitanAbility() { + super(Zone.BATTLEFIELD, new DamageMultiEffect(3), false); + this.addTarget(new TargetCreatureOrPlayerAmount(3)); + } - public InfernoTitanAbility(final InfernoTitanAbility ability) { - super(ability); - } + public InfernoTitanAbility(final InfernoTitanAbility ability) { + super(ability); + } - @Override - public InfernoTitanAbility copy() { - return new InfernoTitanAbility(this); - } + @Override + public InfernoTitanAbility copy() { + return new InfernoTitanAbility(this); + } - @Override - public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == EventType.ATTACKER_DECLARED && event.getSourceId().equals(this.getSourceId())) { - return true; - } - if (event.getType() == EventType.ZONE_CHANGE && event.getTargetId().equals(this.getSourceId()) ) { - ZoneChangeEvent zEvent = (ZoneChangeEvent)event; - if (zEvent.getToZone() == Zone.BATTLEFIELD) { - return true; - } - } - return false; - } + @Override + public boolean checkTrigger(GameEvent event, Game game) { + if (event.getType() == EventType.ATTACKER_DECLARED && event.getSourceId().equals(this.getSourceId())) { + return true; + } + if (event.getType() == EventType.ZONE_CHANGE && event.getTargetId().equals(this.getSourceId()) ) { + ZoneChangeEvent zEvent = (ZoneChangeEvent)event; + if (zEvent.getToZone() == Zone.BATTLEFIELD) { + return true; + } + } + return false; + } - @Override - public String getRule() { - return "Whenever {this} enters the battlefield or attacks, it deals 3 damage divided as you choose among one, two, or three target creatures and/or players."; - } + @Override + public String getRule() { + return "Whenever {this} enters the battlefield or attacks, it deals 3 damage divided as you choose among one, two, or three target creatures and/or players."; + } } diff --git a/Mage.Sets/src/mage/sets/magic2011/InspiredCharge.java b/Mage.Sets/src/mage/sets/magic2011/InspiredCharge.java index 9d8ea9ac68..27d1ebc647 100644 --- a/Mage.Sets/src/mage/sets/magic2011/InspiredCharge.java +++ b/Mage.Sets/src/mage/sets/magic2011/InspiredCharge.java @@ -41,19 +41,19 @@ import mage.cards.CardImpl; */ public class InspiredCharge extends CardImpl { - public InspiredCharge(UUID ownerId) { - super(ownerId, 19, "Inspired Charge", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{2}{W}{W}"); - this.expansionSetCode = "M11"; - this.color.setWhite(true); - this.getSpellAbility().addEffect(new BoostControlledEffect(2, 1, Duration.EndOfTurn)); - } + public InspiredCharge(UUID ownerId) { + super(ownerId, 19, "Inspired Charge", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{2}{W}{W}"); + this.expansionSetCode = "M11"; + this.color.setWhite(true); + this.getSpellAbility().addEffect(new BoostControlledEffect(2, 1, Duration.EndOfTurn)); + } - public InspiredCharge(final InspiredCharge card) { - super(card); - } + public InspiredCharge(final InspiredCharge card) { + super(card); + } - @Override - public InspiredCharge copy() { - return new InspiredCharge(this); - } + @Override + public InspiredCharge copy() { + return new InspiredCharge(this); + } } diff --git a/Mage.Sets/src/mage/sets/magic2011/Island1.java b/Mage.Sets/src/mage/sets/magic2011/Island1.java index a13957819c..759384ec89 100644 --- a/Mage.Sets/src/mage/sets/magic2011/Island1.java +++ b/Mage.Sets/src/mage/sets/magic2011/Island1.java @@ -36,18 +36,18 @@ import java.util.UUID; */ public class Island1 extends mage.cards.basiclands.Island { - public Island1(UUID ownerId) { - super(ownerId, 234); - this.expansionSetCode = "M11"; - } + public Island1(UUID ownerId) { + super(ownerId, 234); + this.expansionSetCode = "M11"; + } - public Island1(final Island1 card) { - super(card); - } + public Island1(final Island1 card) { + super(card); + } - @Override - public Island1 copy() { - return new Island1(this); - } + @Override + public Island1 copy() { + return new Island1(this); + } } diff --git a/Mage.Sets/src/mage/sets/magic2011/Island2.java b/Mage.Sets/src/mage/sets/magic2011/Island2.java index 38a1c34389..a2b8d64a6b 100644 --- a/Mage.Sets/src/mage/sets/magic2011/Island2.java +++ b/Mage.Sets/src/mage/sets/magic2011/Island2.java @@ -36,18 +36,18 @@ import java.util.UUID; */ public class Island2 extends mage.cards.basiclands.Island { - public Island2(UUID ownerId) { - super(ownerId, 235); - this.expansionSetCode = "M11"; - } + public Island2(UUID ownerId) { + super(ownerId, 235); + this.expansionSetCode = "M11"; + } - public Island2(final Island2 card) { - super(card); - } + public Island2(final Island2 card) { + super(card); + } - @Override - public Island2 copy() { - return new Island2(this); - } + @Override + public Island2 copy() { + return new Island2(this); + } } diff --git a/Mage.Sets/src/mage/sets/magic2011/Island3.java b/Mage.Sets/src/mage/sets/magic2011/Island3.java index fbf418a35f..e5a55fa8cd 100644 --- a/Mage.Sets/src/mage/sets/magic2011/Island3.java +++ b/Mage.Sets/src/mage/sets/magic2011/Island3.java @@ -36,18 +36,18 @@ import java.util.UUID; */ public class Island3 extends mage.cards.basiclands.Island { - public Island3(UUID ownerId) { - super(ownerId, 236); - this.expansionSetCode = "M11"; - } + public Island3(UUID ownerId) { + super(ownerId, 236); + this.expansionSetCode = "M11"; + } - public Island3(final Island3 card) { - super(card); - } + public Island3(final Island3 card) { + super(card); + } - @Override - public Island3 copy() { - return new Island3(this); - } + @Override + public Island3 copy() { + return new Island3(this); + } } diff --git a/Mage.Sets/src/mage/sets/magic2011/Island4.java b/Mage.Sets/src/mage/sets/magic2011/Island4.java index b6203f438f..a44329a76e 100644 --- a/Mage.Sets/src/mage/sets/magic2011/Island4.java +++ b/Mage.Sets/src/mage/sets/magic2011/Island4.java @@ -36,18 +36,18 @@ import java.util.UUID; */ public class Island4 extends mage.cards.basiclands.Island { - public Island4(UUID ownerId) { - super(ownerId, 237); - this.expansionSetCode = "M11"; - } + public Island4(UUID ownerId) { + super(ownerId, 237); + this.expansionSetCode = "M11"; + } - public Island4(final Island4 card) { - super(card); - } + public Island4(final Island4 card) { + super(card); + } - @Override - public Island4 copy() { - return new Island4(this); - } + @Override + public Island4 copy() { + return new Island4(this); + } } diff --git a/Mage.Sets/src/mage/sets/magic2011/JaceBeleren.java b/Mage.Sets/src/mage/sets/magic2011/JaceBeleren.java index 9f8ea8f748..d433c52ce0 100644 --- a/Mage.Sets/src/mage/sets/magic2011/JaceBeleren.java +++ b/Mage.Sets/src/mage/sets/magic2011/JaceBeleren.java @@ -36,19 +36,19 @@ import java.util.UUID; */ public class JaceBeleren extends mage.sets.magic2010.JaceBeleren { - public JaceBeleren(UUID ownerId) { - super(ownerId); - this.cardNumber = 58; - this.expansionSetCode = "M11"; - } + public JaceBeleren(UUID ownerId) { + super(ownerId); + this.cardNumber = 58; + this.expansionSetCode = "M11"; + } - public JaceBeleren(final JaceBeleren card) { - super(card); - } + public JaceBeleren(final JaceBeleren card) { + super(card); + } - @Override - public JaceBeleren copy() { - return new JaceBeleren(this); - } + @Override + public JaceBeleren copy() { + return new JaceBeleren(this); + } } \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/magic2011/JacesErasure.java b/Mage.Sets/src/mage/sets/magic2011/JacesErasure.java index 262710132e..f809be585c 100644 --- a/Mage.Sets/src/mage/sets/magic2011/JacesErasure.java +++ b/Mage.Sets/src/mage/sets/magic2011/JacesErasure.java @@ -42,22 +42,22 @@ import mage.target.TargetPlayer; */ public class JacesErasure extends CardImpl { - public JacesErasure(UUID ownerId) { - super(ownerId, 59, "Jace's Erasure", Rarity.COMMON, new CardType[]{CardType.ENCHANTMENT}, "{1}{U}"); - this.expansionSetCode = "M11"; - this.color.setBlue(true); - + public JacesErasure(UUID ownerId) { + super(ownerId, 59, "Jace's Erasure", Rarity.COMMON, new CardType[]{CardType.ENCHANTMENT}, "{1}{U}"); + this.expansionSetCode = "M11"; + this.color.setBlue(true); + DrawCardTriggeredAbility ability = new DrawCardTriggeredAbility(new PutLibraryIntoGraveTargetEffect(1), true); ability.addTarget(new TargetPlayer()); this.addAbility(ability); - } + } - public JacesErasure(final JacesErasure card) { - super(card); - } + public JacesErasure(final JacesErasure card) { + super(card); + } - @Override - public JacesErasure copy() { - return new JacesErasure(this); - } + @Override + public JacesErasure copy() { + return new JacesErasure(this); + } } \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/magic2011/JacesIngenuity.java b/Mage.Sets/src/mage/sets/magic2011/JacesIngenuity.java index cac756efad..7e920fd70e 100644 --- a/Mage.Sets/src/mage/sets/magic2011/JacesIngenuity.java +++ b/Mage.Sets/src/mage/sets/magic2011/JacesIngenuity.java @@ -40,20 +40,20 @@ import mage.cards.CardImpl; */ public class JacesIngenuity extends CardImpl { - public JacesIngenuity(UUID ownerId) { - super(ownerId, 60, "Jace's Ingenuity", Rarity.UNCOMMON, new CardType[]{CardType.INSTANT}, "{3}{U}{U}"); - this.expansionSetCode = "M11"; - this.color.setBlue(true); - this.getSpellAbility().addEffect(new DrawCardControllerEffect(3)); - } + public JacesIngenuity(UUID ownerId) { + super(ownerId, 60, "Jace's Ingenuity", Rarity.UNCOMMON, new CardType[]{CardType.INSTANT}, "{3}{U}{U}"); + this.expansionSetCode = "M11"; + this.color.setBlue(true); + this.getSpellAbility().addEffect(new DrawCardControllerEffect(3)); + } - public JacesIngenuity(final JacesIngenuity card) { - super(card); - } + public JacesIngenuity(final JacesIngenuity card) { + super(card); + } - @Override - public JacesIngenuity copy() { - return new JacesIngenuity(this); - } + @Override + public JacesIngenuity copy() { + return new JacesIngenuity(this); + } } diff --git a/Mage.Sets/src/mage/sets/magic2011/JinxedIdol.java b/Mage.Sets/src/mage/sets/magic2011/JinxedIdol.java index 19f4415a0b..ff5b4c38f7 100644 --- a/Mage.Sets/src/mage/sets/magic2011/JinxedIdol.java +++ b/Mage.Sets/src/mage/sets/magic2011/JinxedIdol.java @@ -50,49 +50,49 @@ import java.util.UUID; */ public class JinxedIdol extends CardImpl { - public JinxedIdol(UUID ownerId) { - super(ownerId, 208, "Jinxed Idol", Rarity.RARE, new CardType[]{CardType.ARTIFACT}, "{2}"); - this.expansionSetCode = "M11"; - this.addAbility(new OnEventTriggeredAbility(EventType.UPKEEP_STEP_PRE, "beginning of your upkeep", new DamageControllerEffect(2))); - Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new JinxedIdolEffect(), new SacrificeTargetCost(new TargetControlledCreaturePermanent())); - ability.addTarget(new TargetOpponent()); - this.addAbility(ability); - } + public JinxedIdol(UUID ownerId) { + super(ownerId, 208, "Jinxed Idol", Rarity.RARE, new CardType[]{CardType.ARTIFACT}, "{2}"); + this.expansionSetCode = "M11"; + this.addAbility(new OnEventTriggeredAbility(EventType.UPKEEP_STEP_PRE, "beginning of your upkeep", new DamageControllerEffect(2))); + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new JinxedIdolEffect(), new SacrificeTargetCost(new TargetControlledCreaturePermanent())); + ability.addTarget(new TargetOpponent()); + this.addAbility(ability); + } - public JinxedIdol(final JinxedIdol card) { - super(card); - } + public JinxedIdol(final JinxedIdol card) { + super(card); + } - @Override - public JinxedIdol copy() { - return new JinxedIdol(this); - } + @Override + public JinxedIdol copy() { + return new JinxedIdol(this); + } } class JinxedIdolEffect extends ContinuousEffectImpl { - public JinxedIdolEffect() { - super(Duration.Custom, Layer.ControlChangingEffects_2, SubLayer.NA, Outcome.GainControl); - staticText = "Target opponent gains control of {this}"; - } + public JinxedIdolEffect() { + super(Duration.Custom, Layer.ControlChangingEffects_2, SubLayer.NA, Outcome.GainControl); + staticText = "Target opponent gains control of {this}"; + } - public JinxedIdolEffect(final JinxedIdolEffect effect) { - super(effect); - } + public JinxedIdolEffect(final JinxedIdolEffect effect) { + super(effect); + } - @Override - public JinxedIdolEffect copy() { - return new JinxedIdolEffect(this); - } + @Override + public JinxedIdolEffect copy() { + return new JinxedIdolEffect(this); + } - @Override - public boolean apply(Game game, Ability source) { - Permanent permanent = game.getPermanent(source.getSourceId()); - if (permanent != null) { - return permanent.changeControllerId(source.getFirstTarget(), game); - } - return false; - } + @Override + public boolean apply(Game game, Ability source) { + Permanent permanent = game.getPermanent(source.getSourceId()); + if (permanent != null) { + return permanent.changeControllerId(source.getFirstTarget(), game); + } + return false; + } } diff --git a/Mage.Sets/src/mage/sets/magic2011/Juggernaut.java b/Mage.Sets/src/mage/sets/magic2011/Juggernaut.java index 1b94cbabee..1d83a18222 100644 --- a/Mage.Sets/src/mage/sets/magic2011/Juggernaut.java +++ b/Mage.Sets/src/mage/sets/magic2011/Juggernaut.java @@ -36,19 +36,19 @@ import java.util.UUID; */ public class Juggernaut extends mage.sets.tenth.Juggernaut { - public Juggernaut(UUID ownerId) { - super(ownerId); - this.cardNumber = 209; - this.expansionSetCode = "M11"; - } + public Juggernaut(UUID ownerId) { + super(ownerId); + this.cardNumber = 209; + this.expansionSetCode = "M11"; + } - public Juggernaut(final Juggernaut card) { - super(card); - } + public Juggernaut(final Juggernaut card) { + super(card); + } - @Override - public Juggernaut copy() { - return new Juggernaut(this); - } + @Override + public Juggernaut copy() { + return new Juggernaut(this); + } } diff --git a/Mage.Sets/src/mage/sets/magic2011/KnightExemplar.java b/Mage.Sets/src/mage/sets/magic2011/KnightExemplar.java index f128622185..ea1f1a5a6d 100644 --- a/Mage.Sets/src/mage/sets/magic2011/KnightExemplar.java +++ b/Mage.Sets/src/mage/sets/magic2011/KnightExemplar.java @@ -48,33 +48,33 @@ import mage.filter.common.FilterCreaturePermanent; */ public class KnightExemplar extends CardImpl { - private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("Knight creatures"); + private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("Knight creatures"); - static { - filter.getSubtype().add("Knight"); - } + static { + filter.getSubtype().add("Knight"); + } - public KnightExemplar(UUID ownerId) { - super(ownerId, 20, "Knight Exemplar", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{1}{W}{W}"); - this.expansionSetCode = "M11"; - this.subtype.add("Human"); - this.subtype.add("Knight"); - this.color.setWhite(true); - this.power = new MageInt(2); - this.toughness = new MageInt(2); + public KnightExemplar(UUID ownerId) { + super(ownerId, 20, "Knight Exemplar", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{1}{W}{W}"); + this.expansionSetCode = "M11"; + this.subtype.add("Human"); + this.subtype.add("Knight"); + this.color.setWhite(true); + this.power = new MageInt(2); + this.toughness = new MageInt(2); - this.addAbility(FirstStrikeAbility.getInstance()); - this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostControlledEffect(1, 1, Duration.WhileOnBattlefield, filter, true))); - this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityControlledEffect(IndestructibleAbility.getInstance(), Duration.WhileOnBattlefield, filter, true))); - } + this.addAbility(FirstStrikeAbility.getInstance()); + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostControlledEffect(1, 1, Duration.WhileOnBattlefield, filter, true))); + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityControlledEffect(IndestructibleAbility.getInstance(), Duration.WhileOnBattlefield, filter, true))); + } - public KnightExemplar(final KnightExemplar card) { - super(card); - } + public KnightExemplar(final KnightExemplar card) { + super(card); + } - @Override - public KnightExemplar copy() { - return new KnightExemplar(this); - } + @Override + public KnightExemplar copy() { + return new KnightExemplar(this); + } } diff --git a/Mage.Sets/src/mage/sets/magic2011/KrakensEye.java b/Mage.Sets/src/mage/sets/magic2011/KrakensEye.java index 8f18a62f53..086c875086 100644 --- a/Mage.Sets/src/mage/sets/magic2011/KrakensEye.java +++ b/Mage.Sets/src/mage/sets/magic2011/KrakensEye.java @@ -36,19 +36,19 @@ import java.util.UUID; */ public class KrakensEye extends mage.sets.tenth.KrakensEye { - public KrakensEye(UUID ownerId) { - super(ownerId); - this.cardNumber = 210; - this.expansionSetCode = "M11"; - } + public KrakensEye(UUID ownerId) { + super(ownerId); + this.cardNumber = 210; + this.expansionSetCode = "M11"; + } - public KrakensEye(final KrakensEye card) { - super(card); - } + public KrakensEye(final KrakensEye card) { + super(card); + } - @Override - public KrakensEye copy() { - return new KrakensEye(this); - } + @Override + public KrakensEye copy() { + return new KrakensEye(this); + } } diff --git a/Mage.Sets/src/mage/sets/magic2011/LavaAxe.java b/Mage.Sets/src/mage/sets/magic2011/LavaAxe.java index b6bbba2af2..e25e3ed534 100644 --- a/Mage.Sets/src/mage/sets/magic2011/LavaAxe.java +++ b/Mage.Sets/src/mage/sets/magic2011/LavaAxe.java @@ -36,19 +36,19 @@ import java.util.UUID; */ public class LavaAxe extends mage.sets.tenth.LavaAxe { - public LavaAxe(UUID ownerId) { - super(ownerId); - this.cardNumber = 147; - this.expansionSetCode = "M11"; - } + public LavaAxe(UUID ownerId) { + super(ownerId); + this.cardNumber = 147; + this.expansionSetCode = "M11"; + } - public LavaAxe(final LavaAxe card) { - super(card); - } + public LavaAxe(final LavaAxe card) { + super(card); + } - @Override - public LavaAxe copy() { - return new LavaAxe(this); - } + @Override + public LavaAxe copy() { + return new LavaAxe(this); + } } diff --git a/Mage.Sets/src/mage/sets/magic2011/LeylineOfAnticipation.java b/Mage.Sets/src/mage/sets/magic2011/LeylineOfAnticipation.java index 890344ed10..ba4fbace24 100644 --- a/Mage.Sets/src/mage/sets/magic2011/LeylineOfAnticipation.java +++ b/Mage.Sets/src/mage/sets/magic2011/LeylineOfAnticipation.java @@ -49,55 +49,55 @@ import mage.game.Game; */ public class LeylineOfAnticipation extends CardImpl { - public LeylineOfAnticipation(UUID ownerId) { - super(ownerId, 61, "Leyline of Anticipation", Rarity.RARE, new CardType[]{CardType.ENCHANTMENT}, "{2}{U}{U}"); - this.expansionSetCode = "M11"; - this.color.setBlue(true); - this.addAbility(LeylineAbility.getInstance()); - this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new LeylineOfAnticipationEffect())); - } + public LeylineOfAnticipation(UUID ownerId) { + super(ownerId, 61, "Leyline of Anticipation", Rarity.RARE, new CardType[]{CardType.ENCHANTMENT}, "{2}{U}{U}"); + this.expansionSetCode = "M11"; + this.color.setBlue(true); + this.addAbility(LeylineAbility.getInstance()); + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new LeylineOfAnticipationEffect())); + } - public LeylineOfAnticipation(final LeylineOfAnticipation card) { - super(card); - } + public LeylineOfAnticipation(final LeylineOfAnticipation card) { + super(card); + } - @Override - public LeylineOfAnticipation copy() { - return new LeylineOfAnticipation(this); - } + @Override + public LeylineOfAnticipation copy() { + return new LeylineOfAnticipation(this); + } } class LeylineOfAnticipationEffect extends AsThoughEffectImpl { - public LeylineOfAnticipationEffect() { - super(AsThoughEffectType.CAST, Duration.WhileOnBattlefield, Outcome.Benefit); - staticText = "You may cast nonland cards as though they had flash"; - } + public LeylineOfAnticipationEffect() { + super(AsThoughEffectType.CAST, Duration.WhileOnBattlefield, Outcome.Benefit); + staticText = "You may cast nonland cards as though they had flash"; + } - public LeylineOfAnticipationEffect(final LeylineOfAnticipationEffect effect) { - super(effect); - } + public LeylineOfAnticipationEffect(final LeylineOfAnticipationEffect effect) { + super(effect); + } - @Override - public boolean apply(Game game, Ability source) { - return true; - } + @Override + public boolean apply(Game game, Ability source) { + return true; + } - @Override - public LeylineOfAnticipationEffect copy() { - return new LeylineOfAnticipationEffect(this); - } + @Override + public LeylineOfAnticipationEffect copy() { + return new LeylineOfAnticipationEffect(this); + } - @Override - public boolean applies(UUID sourceId, Ability source, Game game) { - Card card = game.getCard(sourceId); - if (card != null) { - if (!card.getCardType().contains(CardType.LAND) && card.getOwnerId().equals(source.getControllerId())) { - return true; - } - } - return false; - } + @Override + public boolean applies(UUID sourceId, Ability source, Game game) { + Card card = game.getCard(sourceId); + if (card != null) { + if (!card.getCardType().contains(CardType.LAND) && card.getOwnerId().equals(source.getControllerId())) { + return true; + } + } + return false; + } } \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/magic2011/LeylineOfPunishment.java b/Mage.Sets/src/mage/sets/magic2011/LeylineOfPunishment.java index 1f8cda1bfb..c3c3741082 100644 --- a/Mage.Sets/src/mage/sets/magic2011/LeylineOfPunishment.java +++ b/Mage.Sets/src/mage/sets/magic2011/LeylineOfPunishment.java @@ -53,44 +53,44 @@ import mage.players.Player; */ public class LeylineOfPunishment extends CardImpl { - public LeylineOfPunishment(UUID ownerId) { - super(ownerId, 148, "Leyline of Punishment", Rarity.RARE, new CardType[]{CardType.ENCHANTMENT}, "{2}{R}{R}"); - this.expansionSetCode = "M11"; - this.color.setRed(true); - this.addAbility(LeylineAbility.getInstance()); - this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new LeylineOfPunishmentEffect1())); - this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new LeylineOfPunishmentEffect2())); - } + public LeylineOfPunishment(UUID ownerId) { + super(ownerId, 148, "Leyline of Punishment", Rarity.RARE, new CardType[]{CardType.ENCHANTMENT}, "{2}{R}{R}"); + this.expansionSetCode = "M11"; + this.color.setRed(true); + this.addAbility(LeylineAbility.getInstance()); + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new LeylineOfPunishmentEffect1())); + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new LeylineOfPunishmentEffect2())); + } - public LeylineOfPunishment(final LeylineOfPunishment card) { - super(card); - } + public LeylineOfPunishment(final LeylineOfPunishment card) { + super(card); + } - @Override - public LeylineOfPunishment copy() { - return new LeylineOfPunishment(this); - } + @Override + public LeylineOfPunishment copy() { + return new LeylineOfPunishment(this); + } } class LeylineOfPunishmentEffect1 extends ContinuousEffectImpl { - public LeylineOfPunishmentEffect1() { - super(Duration.WhileOnBattlefield, Layer.PlayerEffects, SubLayer.NA, Outcome.Benefit); - staticText = "Players can't gain life"; - } + public LeylineOfPunishmentEffect1() { + super(Duration.WhileOnBattlefield, Layer.PlayerEffects, SubLayer.NA, Outcome.Benefit); + staticText = "Players can't gain life"; + } - public LeylineOfPunishmentEffect1(final LeylineOfPunishmentEffect1 effect) { - super(effect); - } + public LeylineOfPunishmentEffect1(final LeylineOfPunishmentEffect1 effect) { + super(effect); + } - @Override - public LeylineOfPunishmentEffect1 copy() { - return new LeylineOfPunishmentEffect1(this); - } + @Override + public LeylineOfPunishmentEffect1 copy() { + return new LeylineOfPunishmentEffect1(this); + } - @Override - public boolean apply(Game game, Ability source) { + @Override + public boolean apply(Game game, Ability source) { Player controller = game.getPlayer(source.getControllerId()); if (controller != null) { for (UUID playerId: controller.getInRange()) { @@ -100,43 +100,43 @@ class LeylineOfPunishmentEffect1 extends ContinuousEffectImpl { - public LeylineOfPunishmentEffect2() { - super(Duration.WhileOnBattlefield, Outcome.Benefit); - staticText = "Damage can't be prevented"; - } + public LeylineOfPunishmentEffect2() { + super(Duration.WhileOnBattlefield, Outcome.Benefit); + staticText = "Damage can't be prevented"; + } - public LeylineOfPunishmentEffect2(final LeylineOfPunishmentEffect2 effect) { - super(effect); - } + public LeylineOfPunishmentEffect2(final LeylineOfPunishmentEffect2 effect) { + super(effect); + } - @Override - public LeylineOfPunishmentEffect2 copy() { - return new LeylineOfPunishmentEffect2(this); - } + @Override + public LeylineOfPunishmentEffect2 copy() { + return new LeylineOfPunishmentEffect2(this); + } - @Override - public boolean apply(Game game, Ability source) { - return true; - } + @Override + public boolean apply(Game game, Ability source) { + return true; + } - @Override - public boolean replaceEvent(GameEvent event, Ability source, Game game) { - return true; - } + @Override + public boolean replaceEvent(GameEvent event, Ability source, Game game) { + return true; + } - @Override - public boolean applies(GameEvent event, Ability source, Game game) { - if (event.getType() == EventType.PREVENT_DAMAGE) { - return true; - } - return false; - } + @Override + public boolean applies(GameEvent event, Ability source, Game game) { + if (event.getType() == EventType.PREVENT_DAMAGE) { + return true; + } + return false; + } } diff --git a/Mage.Sets/src/mage/sets/magic2011/LeylineOfSanctity.java b/Mage.Sets/src/mage/sets/magic2011/LeylineOfSanctity.java index b1b5ab3e5c..7f59cb54f0 100644 --- a/Mage.Sets/src/mage/sets/magic2011/LeylineOfSanctity.java +++ b/Mage.Sets/src/mage/sets/magic2011/LeylineOfSanctity.java @@ -46,28 +46,28 @@ import mage.filter.FilterStackObject; */ public class LeylineOfSanctity extends CardImpl { - private static final FilterStackObject filter = new FilterStackObject("spells or abilities your opponents control"); + private static final FilterStackObject filter = new FilterStackObject("spells or abilities your opponents control"); - static { - filter.setTargetController(TargetController.OPPONENT); - } + static { + filter.setTargetController(TargetController.OPPONENT); + } - public LeylineOfSanctity(UUID ownerId) { - super(ownerId, 21, "Leyline of Sanctity", Rarity.RARE, new CardType[]{CardType.ENCHANTMENT}, "{2}{W}{W}"); - this.expansionSetCode = "M11"; - this.color.setWhite(true); - this.addAbility(LeylineAbility.getInstance()); + public LeylineOfSanctity(UUID ownerId) { + super(ownerId, 21, "Leyline of Sanctity", Rarity.RARE, new CardType[]{CardType.ENCHANTMENT}, "{2}{W}{W}"); + this.expansionSetCode = "M11"; + this.color.setWhite(true); + this.addAbility(LeylineAbility.getInstance()); this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityControllerEffect(HexproofAbility.getInstance()))); - } + } - public LeylineOfSanctity(final LeylineOfSanctity card) { - super(card); - } + public LeylineOfSanctity(final LeylineOfSanctity card) { + super(card); + } - @Override - public LeylineOfSanctity copy() { - return new LeylineOfSanctity(this); - } + @Override + public LeylineOfSanctity copy() { + return new LeylineOfSanctity(this); + } } diff --git a/Mage.Sets/src/mage/sets/magic2011/LeylineOfTheVoid.java b/Mage.Sets/src/mage/sets/magic2011/LeylineOfTheVoid.java index 705580a4a4..086c41c224 100644 --- a/Mage.Sets/src/mage/sets/magic2011/LeylineOfTheVoid.java +++ b/Mage.Sets/src/mage/sets/magic2011/LeylineOfTheVoid.java @@ -52,71 +52,71 @@ import mage.game.permanent.Permanent; */ public class LeylineOfTheVoid extends CardImpl { - public LeylineOfTheVoid(UUID ownerId) { - super(ownerId, 101, "Leyline of the Void", Rarity.RARE, new CardType[]{CardType.ENCHANTMENT}, "{2}{B}{B}"); - this.expansionSetCode = "M11"; - this.color.setBlack(true); - this.addAbility(LeylineAbility.getInstance()); - this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new LeylineOfTheVoidEffect())); - } + public LeylineOfTheVoid(UUID ownerId) { + super(ownerId, 101, "Leyline of the Void", Rarity.RARE, new CardType[]{CardType.ENCHANTMENT}, "{2}{B}{B}"); + this.expansionSetCode = "M11"; + this.color.setBlack(true); + this.addAbility(LeylineAbility.getInstance()); + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new LeylineOfTheVoidEffect())); + } - public LeylineOfTheVoid(final LeylineOfTheVoid card) { - super(card); - } + public LeylineOfTheVoid(final LeylineOfTheVoid card) { + super(card); + } - @Override - public LeylineOfTheVoid copy() { - return new LeylineOfTheVoid(this); - } + @Override + public LeylineOfTheVoid copy() { + return new LeylineOfTheVoid(this); + } } class LeylineOfTheVoidEffect extends ReplacementEffectImpl { - public LeylineOfTheVoidEffect() { - super(Duration.WhileOnBattlefield, Outcome.Benefit); - staticText = "If a card would be put into an opponent's graveyard from anywhere, exile it instead"; - } + public LeylineOfTheVoidEffect() { + super(Duration.WhileOnBattlefield, Outcome.Benefit); + staticText = "If a card would be put into an opponent's graveyard from anywhere, exile it instead"; + } - public LeylineOfTheVoidEffect(final LeylineOfTheVoidEffect effect) { - super(effect); - } + public LeylineOfTheVoidEffect(final LeylineOfTheVoidEffect effect) { + super(effect); + } - @Override - public LeylineOfTheVoidEffect copy() { - return new LeylineOfTheVoidEffect(this); - } + @Override + public LeylineOfTheVoidEffect copy() { + return new LeylineOfTheVoidEffect(this); + } - @Override - public boolean apply(Game game, Ability source) { - return true; - } + @Override + public boolean apply(Game game, Ability source) { + return true; + } - @Override - public boolean replaceEvent(GameEvent event, Ability source, Game game) { - if (((ZoneChangeEvent)event).getFromZone() == Zone.BATTLEFIELD) { - Permanent permanent = ((ZoneChangeEvent)event).getTarget(); - if (permanent != null) { - return permanent.moveToExile(null, "", source.getId(), game); - } - } - else { - Card card = game.getCard(event.getTargetId()); - if (card != null) { - return card.moveToExile(null, "", source.getId(), game); - } - } - return false; - } + @Override + public boolean replaceEvent(GameEvent event, Ability source, Game game) { + if (((ZoneChangeEvent)event).getFromZone() == Zone.BATTLEFIELD) { + Permanent permanent = ((ZoneChangeEvent)event).getTarget(); + if (permanent != null) { + return permanent.moveToExile(null, "", source.getId(), game); + } + } + else { + Card card = game.getCard(event.getTargetId()); + if (card != null) { + return card.moveToExile(null, "", source.getId(), game); + } + } + return false; + } - @Override - public boolean applies(GameEvent event, Ability source, Game game) { - if (event.getType() == EventType.ZONE_CHANGE && ((ZoneChangeEvent)event).getToZone() == Zone.GRAVEYARD) { - if (game.getOpponents(source.getControllerId()).contains(event.getPlayerId())) { - return true; - } - } - return false; - } + @Override + public boolean applies(GameEvent event, Ability source, Game game) { + if (event.getType() == EventType.ZONE_CHANGE && ((ZoneChangeEvent)event).getToZone() == Zone.GRAVEYARD) { + if (game.getOpponents(source.getControllerId()).contains(event.getPlayerId())) { + return true; + } + } + return false; + } } diff --git a/Mage.Sets/src/mage/sets/magic2011/LeylineOfVitality.java b/Mage.Sets/src/mage/sets/magic2011/LeylineOfVitality.java index 55adec99f8..e596b39b3c 100644 --- a/Mage.Sets/src/mage/sets/magic2011/LeylineOfVitality.java +++ b/Mage.Sets/src/mage/sets/magic2011/LeylineOfVitality.java @@ -47,23 +47,23 @@ import mage.filter.common.FilterCreaturePermanent; */ public class LeylineOfVitality extends CardImpl { - public LeylineOfVitality(UUID ownerId) { - super(ownerId, 183, "Leyline of Vitality", Rarity.RARE, new CardType[]{CardType.ENCHANTMENT}, "{2}{G}{G}"); - this.expansionSetCode = "M11"; - this.color.setGreen(true); - this.addAbility(LeylineAbility.getInstance()); - this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostControlledEffect(0, 1, Duration.WhileOnBattlefield, new FilterCreaturePermanent(), false))); - + public LeylineOfVitality(UUID ownerId) { + super(ownerId, 183, "Leyline of Vitality", Rarity.RARE, new CardType[]{CardType.ENCHANTMENT}, "{2}{G}{G}"); + this.expansionSetCode = "M11"; + this.color.setGreen(true); + this.addAbility(LeylineAbility.getInstance()); + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostControlledEffect(0, 1, Duration.WhileOnBattlefield, new FilterCreaturePermanent(), false))); + this.addAbility(new CreatureEntersBattlefieldTriggeredAbility(new GainLifeEffect(1), true)); - } + } - public LeylineOfVitality(final LeylineOfVitality card) { - super(card); - } + public LeylineOfVitality(final LeylineOfVitality card) { + super(card); + } - @Override - public LeylineOfVitality copy() { - return new LeylineOfVitality(this); - } + @Override + public LeylineOfVitality copy() { + return new LeylineOfVitality(this); + } } diff --git a/Mage.Sets/src/mage/sets/magic2011/LightningBolt.java b/Mage.Sets/src/mage/sets/magic2011/LightningBolt.java index 02645f15ef..be64580caf 100644 --- a/Mage.Sets/src/mage/sets/magic2011/LightningBolt.java +++ b/Mage.Sets/src/mage/sets/magic2011/LightningBolt.java @@ -36,19 +36,19 @@ import java.util.UUID; */ public class LightningBolt extends mage.sets.magic2010.LightningBolt { - public LightningBolt(UUID ownerId) { - super(ownerId); - this.cardNumber = 149; - this.expansionSetCode = "M11"; - } + public LightningBolt(UUID ownerId) { + super(ownerId); + this.cardNumber = 149; + this.expansionSetCode = "M11"; + } - public LightningBolt(final LightningBolt card) { - super(card); - } + public LightningBolt(final LightningBolt card) { + super(card); + } - @Override - public LightningBolt copy() { - return new LightningBolt(this); - } + @Override + public LightningBolt copy() { + return new LightningBolt(this); + } } \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/magic2011/LilianaVess.java b/Mage.Sets/src/mage/sets/magic2011/LilianaVess.java index b9cf8d34ee..891adf901c 100644 --- a/Mage.Sets/src/mage/sets/magic2011/LilianaVess.java +++ b/Mage.Sets/src/mage/sets/magic2011/LilianaVess.java @@ -36,18 +36,18 @@ import java.util.UUID; */ public class LilianaVess extends mage.sets.magic2010.LilianaVess { - public LilianaVess(UUID ownerId) { - super(ownerId);this.cardNumber = 102; - this.expansionSetCode = "M11"; - } + public LilianaVess(UUID ownerId) { + super(ownerId);this.cardNumber = 102; + this.expansionSetCode = "M11"; + } - public LilianaVess(final LilianaVess card) { - super(card); - } + public LilianaVess(final LilianaVess card) { + super(card); + } - @Override - public LilianaVess copy() { - return new LilianaVess(this); - } + @Override + public LilianaVess copy() { + return new LilianaVess(this); + } } diff --git a/Mage.Sets/src/mage/sets/magic2011/LilianasCaress.java b/Mage.Sets/src/mage/sets/magic2011/LilianasCaress.java index 77ad0d16b2..8bed1e41db 100644 --- a/Mage.Sets/src/mage/sets/magic2011/LilianasCaress.java +++ b/Mage.Sets/src/mage/sets/magic2011/LilianasCaress.java @@ -46,52 +46,52 @@ import mage.target.TargetPlayer; */ public class LilianasCaress extends CardImpl { - public LilianasCaress(UUID ownerId) { - super(ownerId, 103, "Liliana's Caress", Rarity.UNCOMMON, new CardType[]{CardType.ENCHANTMENT}, "{1}{B}"); - this.expansionSetCode = "M11"; - this.color.setBlack(true); - this.addAbility(new LilianasCaressAbility()); - } + public LilianasCaress(UUID ownerId) { + super(ownerId, 103, "Liliana's Caress", Rarity.UNCOMMON, new CardType[]{CardType.ENCHANTMENT}, "{1}{B}"); + this.expansionSetCode = "M11"; + this.color.setBlack(true); + this.addAbility(new LilianasCaressAbility()); + } - public LilianasCaress(final LilianasCaress card) { - super(card); - } + public LilianasCaress(final LilianasCaress card) { + super(card); + } - @Override - public LilianasCaress copy() { - return new LilianasCaress(this); - } + @Override + public LilianasCaress copy() { + return new LilianasCaress(this); + } } class LilianasCaressAbility extends TriggeredAbilityImpl { - public LilianasCaressAbility() { - super(Zone.BATTLEFIELD, new LoseLifeTargetEffect(2), false); - } + public LilianasCaressAbility() { + super(Zone.BATTLEFIELD, new LoseLifeTargetEffect(2), false); + } - public LilianasCaressAbility(final LilianasCaressAbility ability) { - super(ability); - } + public LilianasCaressAbility(final LilianasCaressAbility ability) { + super(ability); + } - @Override - public LilianasCaressAbility copy() { - return new LilianasCaressAbility(this); - } + @Override + public LilianasCaressAbility copy() { + return new LilianasCaressAbility(this); + } - @Override - public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == EventType.DISCARDED_CARD && game.getOpponents(controllerId).contains(event.getPlayerId())) { - this.addTarget(new TargetPlayer()); - getTargets().get(0).add(event.getPlayerId(), game); - return true; - } - return false; - } + @Override + public boolean checkTrigger(GameEvent event, Game game) { + if (event.getType() == EventType.DISCARDED_CARD && game.getOpponents(controllerId).contains(event.getPlayerId())) { + this.addTarget(new TargetPlayer()); + getTargets().get(0).add(event.getPlayerId(), game); + return true; + } + return false; + } - @Override - public String getRule() { - return "Whenever an opponent discards a card, that player loses 2 life."; - } + @Override + public String getRule() { + return "Whenever an opponent discards a card, that player loses 2 life."; + } } diff --git a/Mage.Sets/src/mage/sets/magic2011/LilianasSpecter.java b/Mage.Sets/src/mage/sets/magic2011/LilianasSpecter.java index 4f181d5180..8d0fa22b9e 100644 --- a/Mage.Sets/src/mage/sets/magic2011/LilianasSpecter.java +++ b/Mage.Sets/src/mage/sets/magic2011/LilianasSpecter.java @@ -47,52 +47,52 @@ import mage.players.Player; */ public class LilianasSpecter extends CardImpl { - public LilianasSpecter(UUID ownerId) { - super(ownerId, 104, "Liliana's Specter", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{1}{B}{B}"); - this.expansionSetCode = "M11"; - this.subtype.add("Specter"); - this.color.setBlack(true); - this.power = new MageInt(2); - this.toughness = new MageInt(1); + public LilianasSpecter(UUID ownerId) { + super(ownerId, 104, "Liliana's Specter", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{1}{B}{B}"); + this.expansionSetCode = "M11"; + this.subtype.add("Specter"); + this.color.setBlack(true); + this.power = new MageInt(2); + this.toughness = new MageInt(1); - this.addAbility(FlyingAbility.getInstance()); - this.addAbility(new EntersBattlefieldTriggeredAbility(new LilianasSpecterEffect(), false)); - } + this.addAbility(FlyingAbility.getInstance()); + this.addAbility(new EntersBattlefieldTriggeredAbility(new LilianasSpecterEffect(), false)); + } - public LilianasSpecter(final LilianasSpecter card) { - super(card); - } + public LilianasSpecter(final LilianasSpecter card) { + super(card); + } - @Override - public LilianasSpecter copy() { - return new LilianasSpecter(this); - } + @Override + public LilianasSpecter copy() { + return new LilianasSpecter(this); + } } class LilianasSpecterEffect extends OneShotEffect { - public LilianasSpecterEffect() { - super(Outcome.Discard); - staticText = "each opponent discards a card"; - } + public LilianasSpecterEffect() { + super(Outcome.Discard); + staticText = "each opponent discards a card"; + } - public LilianasSpecterEffect(final LilianasSpecterEffect effect) { - super(effect); - } + public LilianasSpecterEffect(final LilianasSpecterEffect effect) { + super(effect); + } - @Override - public boolean apply(Game game, Ability source) { - for (UUID playerId: game.getOpponents(source.getControllerId())) { - Player player = game.getPlayer(playerId); - player.discard(1, source, game); - } - return true; - } + @Override + public boolean apply(Game game, Ability source) { + for (UUID playerId: game.getOpponents(source.getControllerId())) { + Player player = game.getPlayer(playerId); + player.discard(1, source, game); + } + return true; + } - @Override - public LilianasSpecterEffect copy() { - return new LilianasSpecterEffect(this); - } + @Override + public LilianasSpecterEffect copy() { + return new LilianasSpecterEffect(this); + } } \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/magic2011/LlanowarElves.java b/Mage.Sets/src/mage/sets/magic2011/LlanowarElves.java index eea3859098..c12af21ee2 100644 --- a/Mage.Sets/src/mage/sets/magic2011/LlanowarElves.java +++ b/Mage.Sets/src/mage/sets/magic2011/LlanowarElves.java @@ -36,19 +36,19 @@ import java.util.UUID; */ public class LlanowarElves extends mage.sets.tenth.LlanowarElves { - public LlanowarElves(UUID ownerId) { - super(ownerId); - this.cardNumber = 184; - this.expansionSetCode = "M11"; - } + public LlanowarElves(UUID ownerId) { + super(ownerId); + this.cardNumber = 184; + this.expansionSetCode = "M11"; + } - public LlanowarElves(final LlanowarElves card) { - super(card); - } + public LlanowarElves(final LlanowarElves card) { + super(card); + } - @Override - public LlanowarElves copy() { - return new LlanowarElves(this); - } + @Override + public LlanowarElves copy() { + return new LlanowarElves(this); + } } diff --git a/Mage.Sets/src/mage/sets/magic2011/MagmaPhoenix.java b/Mage.Sets/src/mage/sets/magic2011/MagmaPhoenix.java index 7466a0f8bb..3afd60db57 100644 --- a/Mage.Sets/src/mage/sets/magic2011/MagmaPhoenix.java +++ b/Mage.Sets/src/mage/sets/magic2011/MagmaPhoenix.java @@ -36,19 +36,19 @@ import java.util.UUID; */ public class MagmaPhoenix extends mage.sets.magic2010.MagmaPhoenix { - public MagmaPhoenix(UUID ownerId) { - super(ownerId); - this.cardNumber = 150; - this.expansionSetCode = "M11"; - } + public MagmaPhoenix(UUID ownerId) { + super(ownerId); + this.cardNumber = 150; + this.expansionSetCode = "M11"; + } - public MagmaPhoenix(final MagmaPhoenix card) { - super(card); - } + public MagmaPhoenix(final MagmaPhoenix card) { + super(card); + } - @Override - public MagmaPhoenix copy() { - return new MagmaPhoenix(this); - } + @Override + public MagmaPhoenix copy() { + return new MagmaPhoenix(this); + } } \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/magic2011/ManaLeak.java b/Mage.Sets/src/mage/sets/magic2011/ManaLeak.java index fc018a0f86..ee2a9b3264 100644 --- a/Mage.Sets/src/mage/sets/magic2011/ManaLeak.java +++ b/Mage.Sets/src/mage/sets/magic2011/ManaLeak.java @@ -46,20 +46,20 @@ import mage.target.TargetSpell; */ public class ManaLeak extends CardImpl { - public ManaLeak(UUID ownerId) { - super(ownerId, 62, "Mana Leak", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{1}{U}"); - this.expansionSetCode = "M11"; - this.color.setBlue(true); - this.getSpellAbility().addTarget(new TargetSpell()); - this.getSpellAbility().addEffect(new CounterUnlessPaysEffect(new GenericManaCost(3))); - } + public ManaLeak(UUID ownerId) { + super(ownerId, 62, "Mana Leak", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{1}{U}"); + this.expansionSetCode = "M11"; + this.color.setBlue(true); + this.getSpellAbility().addTarget(new TargetSpell()); + this.getSpellAbility().addEffect(new CounterUnlessPaysEffect(new GenericManaCost(3))); + } - public ManaLeak(final ManaLeak card) { - super(card); - } + public ManaLeak(final ManaLeak card) { + super(card); + } - @Override - public ManaLeak copy() { - return new ManaLeak(this); - } + @Override + public ManaLeak copy() { + return new ManaLeak(this); + } } diff --git a/Mage.Sets/src/mage/sets/magic2011/ManicVandal.java b/Mage.Sets/src/mage/sets/magic2011/ManicVandal.java index aaf8643daf..5e2a5e8e59 100644 --- a/Mage.Sets/src/mage/sets/magic2011/ManicVandal.java +++ b/Mage.Sets/src/mage/sets/magic2011/ManicVandal.java @@ -47,36 +47,36 @@ import mage.target.TargetPermanent; */ public class ManicVandal extends CardImpl { - private static final FilterPermanent filter = new FilterPermanent("artifact"); + private static final FilterPermanent filter = new FilterPermanent("artifact"); - static { - filter.getCardType().add(CardType.ARTIFACT); - filter.setScopeCardType(ComparisonScope.Any); - } + static { + filter.getCardType().add(CardType.ARTIFACT); + filter.setScopeCardType(ComparisonScope.Any); + } - public ManicVandal(UUID ownerId) { - super(ownerId, 151, "Manic Vandal", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{2}{R}"); - this.expansionSetCode = "M11"; - this.subtype.add("Human"); - this.subtype.add("Warrior"); - this.color.setRed(true); - this.power = new MageInt(2); - this.toughness = new MageInt(2); + public ManicVandal(UUID ownerId) { + super(ownerId, 151, "Manic Vandal", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{2}{R}"); + this.expansionSetCode = "M11"; + this.subtype.add("Human"); + this.subtype.add("Warrior"); + this.color.setRed(true); + this.power = new MageInt(2); + this.toughness = new MageInt(2); - Ability ability = new EntersBattlefieldTriggeredAbility(new DestroyTargetEffect(), false); - Target target = new TargetPermanent(filter); - target.setRequired(true); - ability.addTarget(target); - this.addAbility(ability); - } + Ability ability = new EntersBattlefieldTriggeredAbility(new DestroyTargetEffect(), false); + Target target = new TargetPermanent(filter); + target.setRequired(true); + ability.addTarget(target); + this.addAbility(ability); + } - public ManicVandal(final ManicVandal card) { - super(card); - } + public ManicVandal(final ManicVandal card) { + super(card); + } - @Override - public ManicVandal copy() { - return new ManicVandal(this); - } + @Override + public ManicVandal copy() { + return new ManicVandal(this); + } } diff --git a/Mage.Sets/src/mage/sets/magic2011/MaritimeGuard.java b/Mage.Sets/src/mage/sets/magic2011/MaritimeGuard.java index 34fbce6502..0d59747d85 100644 --- a/Mage.Sets/src/mage/sets/magic2011/MaritimeGuard.java +++ b/Mage.Sets/src/mage/sets/magic2011/MaritimeGuard.java @@ -40,23 +40,23 @@ import mage.cards.CardImpl; */ public class MaritimeGuard extends CardImpl { - public MaritimeGuard(UUID ownerId) { - super(ownerId, 63, "Maritime Guard", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{1}{U}"); - this.expansionSetCode = "M11"; - this.color.setBlue(true); - this.subtype.add("Merfolk"); - this.subtype.add("Soldier"); - this.power = new MageInt(1); - this.toughness = new MageInt(3); - } + public MaritimeGuard(UUID ownerId) { + super(ownerId, 63, "Maritime Guard", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{1}{U}"); + this.expansionSetCode = "M11"; + this.color.setBlue(true); + this.subtype.add("Merfolk"); + this.subtype.add("Soldier"); + this.power = new MageInt(1); + this.toughness = new MageInt(3); + } - public MaritimeGuard(final MaritimeGuard card) { - super(card); - } + public MaritimeGuard(final MaritimeGuard card) { + super(card); + } - @Override - public MaritimeGuard copy() { - return new MaritimeGuard(this); - } + @Override + public MaritimeGuard copy() { + return new MaritimeGuard(this); + } } diff --git a/Mage.Sets/src/mage/sets/magic2011/MassPolymorph.java b/Mage.Sets/src/mage/sets/magic2011/MassPolymorph.java index 776a32678f..7b751d310e 100644 --- a/Mage.Sets/src/mage/sets/magic2011/MassPolymorph.java +++ b/Mage.Sets/src/mage/sets/magic2011/MassPolymorph.java @@ -52,66 +52,66 @@ import java.util.UUID; */ public class MassPolymorph extends CardImpl { - public MassPolymorph(UUID ownerId) { - super(ownerId, 64, "Mass Polymorph", Rarity.RARE, new CardType[]{CardType.SORCERY}, "{5}{U}"); - this.expansionSetCode = "M11"; - this.color.setBlue(true); - this.getSpellAbility().addEffect(new MassPolymorphEffect()); - } + public MassPolymorph(UUID ownerId) { + super(ownerId, 64, "Mass Polymorph", Rarity.RARE, new CardType[]{CardType.SORCERY}, "{5}{U}"); + this.expansionSetCode = "M11"; + this.color.setBlue(true); + this.getSpellAbility().addEffect(new MassPolymorphEffect()); + } - public MassPolymorph(final MassPolymorph card) { - super(card); - } + public MassPolymorph(final MassPolymorph card) { + super(card); + } - @Override - public MassPolymorph copy() { - return new MassPolymorph(this); - } + @Override + public MassPolymorph copy() { + return new MassPolymorph(this); + } } class MassPolymorphEffect extends OneShotEffect { - public MassPolymorphEffect() { - super(Outcome.PutCreatureInPlay); - staticText = "Exile all creatures you control, then reveal cards from the top of your library until you reveal that many creature cards. Put all creature cards revealed this way onto the battlefield, then shuffle the rest of the revealed cards into your library"; - } + public MassPolymorphEffect() { + super(Outcome.PutCreatureInPlay); + staticText = "Exile all creatures you control, then reveal cards from the top of your library until you reveal that many creature cards. Put all creature cards revealed this way onto the battlefield, then shuffle the rest of the revealed cards into your library"; + } - public MassPolymorphEffect(final MassPolymorphEffect effect) { - super(effect); - } + public MassPolymorphEffect(final MassPolymorphEffect effect) { + super(effect); + } - @Override - public boolean apply(Game game, Ability source) { - int count; - List creatures = game.getBattlefield().getAllActivePermanents(new FilterCreaturePermanent(), source.getControllerId(), game); - count = creatures.size(); - for (Permanent creature: creatures) { - creature.moveToExile(null, null, source.getId(), game); - } - Cards revealed = new CardsImpl(); - Cards creatureCards = new CardsImpl(); - Cards nonCreatureCards = new CardsImpl(); - Player player = game.getPlayer(source.getControllerId()); - while (creatureCards.size() < count && player.getLibrary().size() > 0) { - Card card = player.getLibrary().removeFromTop(game); - revealed.add(card); - if (card.getCardType().contains(CardType.CREATURE)) - creatureCards.add(card); - else - nonCreatureCards.add(card); - } - player.revealCards("Mass Polymorph", revealed, game); - for (Card creatureCard: creatureCards.getCards(game)) { - creatureCard.putOntoBattlefield(game, Zone.LIBRARY, source.getId(), source.getControllerId()); - } - player.getLibrary().addAll(nonCreatureCards.getCards(game), game); - player.shuffleLibrary(game); - return true; - } + @Override + public boolean apply(Game game, Ability source) { + int count; + List creatures = game.getBattlefield().getAllActivePermanents(new FilterCreaturePermanent(), source.getControllerId(), game); + count = creatures.size(); + for (Permanent creature: creatures) { + creature.moveToExile(null, null, source.getId(), game); + } + Cards revealed = new CardsImpl(); + Cards creatureCards = new CardsImpl(); + Cards nonCreatureCards = new CardsImpl(); + Player player = game.getPlayer(source.getControllerId()); + while (creatureCards.size() < count && player.getLibrary().size() > 0) { + Card card = player.getLibrary().removeFromTop(game); + revealed.add(card); + if (card.getCardType().contains(CardType.CREATURE)) + creatureCards.add(card); + else + nonCreatureCards.add(card); + } + player.revealCards("Mass Polymorph", revealed, game); + for (Card creatureCard: creatureCards.getCards(game)) { + creatureCard.putOntoBattlefield(game, Zone.LIBRARY, source.getId(), source.getControllerId()); + } + player.getLibrary().addAll(nonCreatureCards.getCards(game), game); + player.shuffleLibrary(game); + return true; + } - @Override - public MassPolymorphEffect copy() { - return new MassPolymorphEffect(this); - } + @Override + public MassPolymorphEffect copy() { + return new MassPolymorphEffect(this); + } } \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/magic2011/MerfolkSovereign.java b/Mage.Sets/src/mage/sets/magic2011/MerfolkSovereign.java index 6e0555a74f..e90746d512 100644 --- a/Mage.Sets/src/mage/sets/magic2011/MerfolkSovereign.java +++ b/Mage.Sets/src/mage/sets/magic2011/MerfolkSovereign.java @@ -36,19 +36,19 @@ import java.util.UUID; */ public class MerfolkSovereign extends mage.sets.magic2010.MerfolkSovereign { - public MerfolkSovereign(UUID ownerId) { - super(ownerId); - this.cardNumber = 65; - this.expansionSetCode = "M11"; - } + public MerfolkSovereign(UUID ownerId) { + super(ownerId); + this.cardNumber = 65; + this.expansionSetCode = "M11"; + } - public MerfolkSovereign(final MerfolkSovereign card) { - super(card); - } + public MerfolkSovereign(final MerfolkSovereign card) { + super(card); + } - @Override - public MerfolkSovereign copy() { - return new MerfolkSovereign(this); - } + @Override + public MerfolkSovereign copy() { + return new MerfolkSovereign(this); + } } \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/magic2011/MerfolkSpy.java b/Mage.Sets/src/mage/sets/magic2011/MerfolkSpy.java index a0394cbdb6..00eea2ca7c 100644 --- a/Mage.Sets/src/mage/sets/magic2011/MerfolkSpy.java +++ b/Mage.Sets/src/mage/sets/magic2011/MerfolkSpy.java @@ -50,56 +50,56 @@ import java.util.UUID; */ public class MerfolkSpy extends CardImpl { - public MerfolkSpy(UUID ownerId) { - super(ownerId, 66, "Merfolk Spy", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{U}"); - this.expansionSetCode = "M11"; - this.subtype.add("Merfolk"); - this.subtype.add("Rogue"); - this.color.setBlue(true); - this.power = new MageInt(1); - this.toughness = new MageInt(1); + public MerfolkSpy(UUID ownerId) { + super(ownerId, 66, "Merfolk Spy", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{U}"); + this.expansionSetCode = "M11"; + this.subtype.add("Merfolk"); + this.subtype.add("Rogue"); + this.color.setBlue(true); + this.power = new MageInt(1); + this.toughness = new MageInt(1); - this.addAbility(new IslandwalkAbility()); - this.addAbility(new DealsCombatDamageToAPlayerTriggeredAbility(new MerfolkSpyEffect(), false, true)); - } + this.addAbility(new IslandwalkAbility()); + this.addAbility(new DealsCombatDamageToAPlayerTriggeredAbility(new MerfolkSpyEffect(), false, true)); + } - public MerfolkSpy(final MerfolkSpy card) { - super(card); - } + public MerfolkSpy(final MerfolkSpy card) { + super(card); + } - @Override - public MerfolkSpy copy() { - return new MerfolkSpy(this); - } + @Override + public MerfolkSpy copy() { + return new MerfolkSpy(this); + } } class MerfolkSpyEffect extends OneShotEffect { - public MerfolkSpyEffect() { - super(Outcome.Detriment); - staticText = "that player reveals a card at random from his or her hand"; - } + public MerfolkSpyEffect() { + super(Outcome.Detriment); + staticText = "that player reveals a card at random from his or her hand"; + } - public MerfolkSpyEffect(final MerfolkSpyEffect effect) { - super(effect); - } + public MerfolkSpyEffect(final MerfolkSpyEffect effect) { + super(effect); + } - @Override - public boolean apply(Game game, Ability source) { - Player player = game.getPlayer(targetPointer.getFirst(game, source)); - if (player != null && player.getHand().size() > 0) { - Cards revealed = new CardsImpl(); - revealed.add(player.getHand().getRandom(game)); - player.revealCards("Merfolk Spy", revealed, game); - return true; - } - return false; - } + @Override + public boolean apply(Game game, Ability source) { + Player player = game.getPlayer(targetPointer.getFirst(game, source)); + if (player != null && player.getHand().size() > 0) { + Cards revealed = new CardsImpl(); + revealed.add(player.getHand().getRandom(game)); + player.revealCards("Merfolk Spy", revealed, game); + return true; + } + return false; + } - @Override - public MerfolkSpyEffect copy() { - return new MerfolkSpyEffect(this); - } + @Override + public MerfolkSpyEffect copy() { + return new MerfolkSpyEffect(this); + } } \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/magic2011/MightyLeap.java b/Mage.Sets/src/mage/sets/magic2011/MightyLeap.java index 4c91a55367..f0daacbc43 100644 --- a/Mage.Sets/src/mage/sets/magic2011/MightyLeap.java +++ b/Mage.Sets/src/mage/sets/magic2011/MightyLeap.java @@ -44,21 +44,21 @@ import mage.target.common.TargetCreaturePermanent; */ public class MightyLeap extends CardImpl { - public MightyLeap(UUID ownerId) { - super(ownerId, 22, "Mighty Leap", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{1}{W}"); - this.expansionSetCode = "M11"; - this.color.setWhite(true); - this.getSpellAbility().addTarget(new TargetCreaturePermanent()); - this.getSpellAbility().addEffect(new BoostTargetEffect(2, 2, Duration.EndOfTurn)); - this.getSpellAbility().addEffect(new GainAbilityTargetEffect(FlyingAbility.getInstance(), Duration.EndOfTurn)); - } + public MightyLeap(UUID ownerId) { + super(ownerId, 22, "Mighty Leap", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{1}{W}"); + this.expansionSetCode = "M11"; + this.color.setWhite(true); + this.getSpellAbility().addTarget(new TargetCreaturePermanent()); + this.getSpellAbility().addEffect(new BoostTargetEffect(2, 2, Duration.EndOfTurn)); + this.getSpellAbility().addEffect(new GainAbilityTargetEffect(FlyingAbility.getInstance(), Duration.EndOfTurn)); + } - public MightyLeap(final MightyLeap card) { - super(card); - } + public MightyLeap(final MightyLeap card) { + super(card); + } - @Override - public MightyLeap copy() { - return new MightyLeap(this); - } + @Override + public MightyLeap copy() { + return new MightyLeap(this); + } } diff --git a/Mage.Sets/src/mage/sets/magic2011/MindControl.java b/Mage.Sets/src/mage/sets/magic2011/MindControl.java index a089da51d2..89e1a37121 100644 --- a/Mage.Sets/src/mage/sets/magic2011/MindControl.java +++ b/Mage.Sets/src/mage/sets/magic2011/MindControl.java @@ -36,18 +36,18 @@ import java.util.UUID; */ public class MindControl extends mage.sets.magic2010.MindControl { - public MindControl(UUID ownerId) { - super(ownerId); - this.cardNumber = 67; - this.expansionSetCode = "M11"; - } + public MindControl(UUID ownerId) { + super(ownerId); + this.cardNumber = 67; + this.expansionSetCode = "M11"; + } - public MindControl(final MindControl card) { - super(card); - } + public MindControl(final MindControl card) { + super(card); + } - @Override - public MindControl copy() { - return new MindControl(this); - } + @Override + public MindControl copy() { + return new MindControl(this); + } } \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/magic2011/MindRot.java b/Mage.Sets/src/mage/sets/magic2011/MindRot.java index 0f3c6ea038..b3e716dfc1 100644 --- a/Mage.Sets/src/mage/sets/magic2011/MindRot.java +++ b/Mage.Sets/src/mage/sets/magic2011/MindRot.java @@ -36,19 +36,19 @@ import java.util.UUID; */ public class MindRot extends mage.sets.magic2010.MindRot { - public MindRot(UUID ownerId) { - super(ownerId); - this.cardNumber = 105; - this.expansionSetCode = "M11"; - } + public MindRot(UUID ownerId) { + super(ownerId); + this.cardNumber = 105; + this.expansionSetCode = "M11"; + } - public MindRot(final MindRot card) { - super(card); - } + public MindRot(final MindRot card) { + super(card); + } - @Override - public MindRot copy() { - return new MindRot(this); - } + @Override + public MindRot copy() { + return new MindRot(this); + } } \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/magic2011/MitoticSlime.java b/Mage.Sets/src/mage/sets/magic2011/MitoticSlime.java index 731f8d260e..2ce0a401cb 100644 --- a/Mage.Sets/src/mage/sets/magic2011/MitoticSlime.java +++ b/Mage.Sets/src/mage/sets/magic2011/MitoticSlime.java @@ -43,49 +43,49 @@ import mage.game.permanent.token.Token; */ public class MitoticSlime extends CardImpl { - public MitoticSlime(UUID ownerId) { - super(ownerId, 185, "Mitotic Slime", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{4}{G}"); - this.expansionSetCode = "M11"; - this.subtype.add("Ooze"); - this.color.setGreen(true); - this.power = new MageInt(4); - this.toughness = new MageInt(4); + public MitoticSlime(UUID ownerId) { + super(ownerId, 185, "Mitotic Slime", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{4}{G}"); + this.expansionSetCode = "M11"; + this.subtype.add("Ooze"); + this.color.setGreen(true); + this.power = new MageInt(4); + this.toughness = new MageInt(4); - this.addAbility(new DiesTriggeredAbility(new CreateTokenEffect(new Ooze2Token(), 2), false)); - } + this.addAbility(new DiesTriggeredAbility(new CreateTokenEffect(new Ooze2Token(), 2), false)); + } - public MitoticSlime(final MitoticSlime card) { - super(card); - } + public MitoticSlime(final MitoticSlime card) { + super(card); + } - @Override - public MitoticSlime copy() { - return new MitoticSlime(this); - } + @Override + public MitoticSlime copy() { + return new MitoticSlime(this); + } } class Ooze2Token extends Token { - public Ooze2Token() { - super("Ooze", "2/2 green Ooze creature tokens with \"When this creature is put into a graveyard, put two 1/1 green Ooze creature tokens onto the battlefield.\""); - cardType.add(CardType.CREATURE); - subtype.add("Ooze"); - color.setGreen(true); - power = new MageInt(2); - toughness = new MageInt(2); - this.addAbility(new DiesTriggeredAbility(new CreateTokenEffect(new Ooze1Token(), 2), false)); - } + public Ooze2Token() { + super("Ooze", "2/2 green Ooze creature tokens with \"When this creature is put into a graveyard, put two 1/1 green Ooze creature tokens onto the battlefield.\""); + cardType.add(CardType.CREATURE); + subtype.add("Ooze"); + color.setGreen(true); + power = new MageInt(2); + toughness = new MageInt(2); + this.addAbility(new DiesTriggeredAbility(new CreateTokenEffect(new Ooze1Token(), 2), false)); + } } class Ooze1Token extends Token { - public Ooze1Token() { - super("Ooze", "1/1 green Ooze creature tokens"); - cardType.add(CardType.CREATURE); - subtype.add("Ooze"); - color.setGreen(true); - power = new MageInt(1); - toughness = new MageInt(1); - } + public Ooze1Token() { + super("Ooze", "1/1 green Ooze creature tokens"); + cardType.add(CardType.CREATURE); + subtype.add("Ooze"); + color.setGreen(true); + power = new MageInt(1); + toughness = new MageInt(1); + } } diff --git a/Mage.Sets/src/mage/sets/magic2011/Mountain1.java b/Mage.Sets/src/mage/sets/magic2011/Mountain1.java index 38b0ad60bd..0aeadece23 100644 --- a/Mage.Sets/src/mage/sets/magic2011/Mountain1.java +++ b/Mage.Sets/src/mage/sets/magic2011/Mountain1.java @@ -36,18 +36,18 @@ import java.util.UUID; */ public class Mountain1 extends mage.cards.basiclands.Mountain { - public Mountain1(UUID ownerId) { - super(ownerId, 242); - this.expansionSetCode = "M11"; - } + public Mountain1(UUID ownerId) { + super(ownerId, 242); + this.expansionSetCode = "M11"; + } - public Mountain1(final Mountain1 card) { - super(card); - } + public Mountain1(final Mountain1 card) { + super(card); + } - @Override - public Mountain1 copy() { - return new Mountain1(this); - } + @Override + public Mountain1 copy() { + return new Mountain1(this); + } } diff --git a/Mage.Sets/src/mage/sets/magic2011/Mountain2.java b/Mage.Sets/src/mage/sets/magic2011/Mountain2.java index a27b28138f..70ec889cb6 100644 --- a/Mage.Sets/src/mage/sets/magic2011/Mountain2.java +++ b/Mage.Sets/src/mage/sets/magic2011/Mountain2.java @@ -36,18 +36,18 @@ import java.util.UUID; */ public class Mountain2 extends mage.cards.basiclands.Mountain { - public Mountain2(UUID ownerId) { - super(ownerId, 243); - this.expansionSetCode = "M11"; - } + public Mountain2(UUID ownerId) { + super(ownerId, 243); + this.expansionSetCode = "M11"; + } - public Mountain2(final Mountain2 card) { - super(card); - } + public Mountain2(final Mountain2 card) { + super(card); + } - @Override - public Mountain2 copy() { - return new Mountain2(this); - } + @Override + public Mountain2 copy() { + return new Mountain2(this); + } } diff --git a/Mage.Sets/src/mage/sets/magic2011/Mountain3.java b/Mage.Sets/src/mage/sets/magic2011/Mountain3.java index b7e91449fa..420948d9f6 100644 --- a/Mage.Sets/src/mage/sets/magic2011/Mountain3.java +++ b/Mage.Sets/src/mage/sets/magic2011/Mountain3.java @@ -36,19 +36,19 @@ import java.util.UUID; */ public class Mountain3 extends mage.cards.basiclands.Mountain { - public Mountain3(UUID ownerId) { - super(ownerId, 244); - this.expansionSetCode = "M11"; - } + public Mountain3(UUID ownerId) { + super(ownerId, 244); + this.expansionSetCode = "M11"; + } - public Mountain3(final Mountain3 card) { - super(card); - } + public Mountain3(final Mountain3 card) { + super(card); + } - @Override - public Mountain3 copy() { - return new Mountain3(this); - } + @Override + public Mountain3 copy() { + return new Mountain3(this); + } } diff --git a/Mage.Sets/src/mage/sets/magic2011/Mountain4.java b/Mage.Sets/src/mage/sets/magic2011/Mountain4.java index 729c2cc66a..9d69fd109a 100644 --- a/Mage.Sets/src/mage/sets/magic2011/Mountain4.java +++ b/Mage.Sets/src/mage/sets/magic2011/Mountain4.java @@ -36,18 +36,18 @@ import java.util.UUID; */ public class Mountain4 extends mage.cards.basiclands.Mountain { - public Mountain4(UUID ownerId) { - super(ownerId, 245); - this.expansionSetCode = "M11"; - } + public Mountain4(UUID ownerId) { + super(ownerId, 245); + this.expansionSetCode = "M11"; + } - public Mountain4(final Mountain4 card) { - super(card); - } + public Mountain4(final Mountain4 card) { + super(card); + } - @Override - public Mountain4 copy() { - return new Mountain4(this); - } + @Override + public Mountain4 copy() { + return new Mountain4(this); + } } diff --git a/Mage.Sets/src/mage/sets/magic2011/MystifyingMaze.java b/Mage.Sets/src/mage/sets/magic2011/MystifyingMaze.java index 4fab8a7099..cc97b4de36 100644 --- a/Mage.Sets/src/mage/sets/magic2011/MystifyingMaze.java +++ b/Mage.Sets/src/mage/sets/magic2011/MystifyingMaze.java @@ -54,61 +54,61 @@ import mage.target.common.TargetCreaturePermanent; */ public class MystifyingMaze extends CardImpl { - private static final FilterAttackingCreature filter = new FilterAttackingCreature("attacking creature an opponent controls"); + private static final FilterAttackingCreature filter = new FilterAttackingCreature("attacking creature an opponent controls"); - static { - filter.setTargetController(TargetController.OPPONENT); - } + static { + filter.setTargetController(TargetController.OPPONENT); + } - public MystifyingMaze(UUID ownerId) { - super(ownerId, 226, "Mystifying Maze", Rarity.RARE, new CardType[]{CardType.LAND}, null); - this.expansionSetCode = "M11"; - this.addAbility(new ColorlessManaAbility()); - Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new MystifyingMazeEffect(), new ManaCostsImpl("{4}")); - ability.addCost(new TapSourceCost()); - ability.addTarget(new TargetCreaturePermanent(filter)); - this.addAbility(ability); - } + public MystifyingMaze(UUID ownerId) { + super(ownerId, 226, "Mystifying Maze", Rarity.RARE, new CardType[]{CardType.LAND}, null); + this.expansionSetCode = "M11"; + this.addAbility(new ColorlessManaAbility()); + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new MystifyingMazeEffect(), new ManaCostsImpl("{4}")); + ability.addCost(new TapSourceCost()); + ability.addTarget(new TargetCreaturePermanent(filter)); + this.addAbility(ability); + } - public MystifyingMaze(final MystifyingMaze card) { - super(card); - } + public MystifyingMaze(final MystifyingMaze card) { + super(card); + } - @Override - public MystifyingMaze copy() { - return new MystifyingMaze(this); - } + @Override + public MystifyingMaze copy() { + return new MystifyingMaze(this); + } } class MystifyingMazeEffect extends OneShotEffect { - public MystifyingMazeEffect() { - super(Outcome.Detriment); - staticText = "Exile target attacking creature an opponent controls. At the beginning of the next end step, return it to the battlefield tapped under its owner's control"; - } + public MystifyingMazeEffect() { + super(Outcome.Detriment); + staticText = "Exile target attacking creature an opponent controls. At the beginning of the next end step, return it to the battlefield tapped under its owner's control"; + } - public MystifyingMazeEffect(final MystifyingMazeEffect effect) { - super(effect); - } + public MystifyingMazeEffect(final MystifyingMazeEffect effect) { + super(effect); + } - @Override - public boolean apply(Game game, Ability source) { - Permanent permanent = game.getPermanent(source.getFirstTarget()); - if (permanent != null) { - if (permanent.moveToExile(source.getSourceId(), "Mystifying Maze Exile", source.getId(), game)) { - //create delayed triggered ability - AtEndOfTurnDelayedTriggeredAbility delayedAbility = new AtEndOfTurnDelayedTriggeredAbility(new ReturnFromExileEffect(source.getSourceId(), Zone.BATTLEFIELD, true)); - delayedAbility.setSourceId(source.getSourceId()); - delayedAbility.setControllerId(source.getControllerId()); - game.addDelayedTriggeredAbility(delayedAbility); - return true; - } - } - return false; - } + @Override + public boolean apply(Game game, Ability source) { + Permanent permanent = game.getPermanent(source.getFirstTarget()); + if (permanent != null) { + if (permanent.moveToExile(source.getSourceId(), "Mystifying Maze Exile", source.getId(), game)) { + //create delayed triggered ability + AtEndOfTurnDelayedTriggeredAbility delayedAbility = new AtEndOfTurnDelayedTriggeredAbility(new ReturnFromExileEffect(source.getSourceId(), Zone.BATTLEFIELD, true)); + delayedAbility.setSourceId(source.getSourceId()); + delayedAbility.setControllerId(source.getControllerId()); + game.addDelayedTriggeredAbility(delayedAbility); + return true; + } + } + return false; + } - @Override - public MystifyingMazeEffect copy() { - return new MystifyingMazeEffect(this); - } + @Override + public MystifyingMazeEffect copy() { + return new MystifyingMazeEffect(this); + } } diff --git a/Mage.Sets/src/mage/sets/magic2011/NantukoShade.java b/Mage.Sets/src/mage/sets/magic2011/NantukoShade.java index 2629aab6d2..51210ca519 100644 --- a/Mage.Sets/src/mage/sets/magic2011/NantukoShade.java +++ b/Mage.Sets/src/mage/sets/magic2011/NantukoShade.java @@ -45,25 +45,25 @@ import mage.cards.CardImpl; */ public class NantukoShade extends CardImpl { - public NantukoShade(UUID ownerId) { - super(ownerId, 106, "Nantuko Shade", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{B}{B}"); - this.expansionSetCode = "M11"; - this.subtype.add("Insect"); - this.subtype.add("Shade"); - this.color.setBlack(true); - this.power = new MageInt(2); - this.toughness = new MageInt(1); + public NantukoShade(UUID ownerId) { + super(ownerId, 106, "Nantuko Shade", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{B}{B}"); + this.expansionSetCode = "M11"; + this.subtype.add("Insect"); + this.subtype.add("Shade"); + this.color.setBlack(true); + this.power = new MageInt(2); + this.toughness = new MageInt(1); - this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new BoostSourceEffect(1, 1, Duration.EndOfTurn), new ManaCostsImpl("{B}"))); - } + this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new BoostSourceEffect(1, 1, Duration.EndOfTurn), new ManaCostsImpl("{B}"))); + } - public NantukoShade(final NantukoShade card) { - super(card); - } + public NantukoShade(final NantukoShade card) { + super(card); + } - @Override - public NantukoShade copy() { - return new NantukoShade(this); - } + @Override + public NantukoShade copy() { + return new NantukoShade(this); + } } diff --git a/Mage.Sets/src/mage/sets/magic2011/Naturalize.java b/Mage.Sets/src/mage/sets/magic2011/Naturalize.java index c3b917ece6..5c9d9fdb64 100644 --- a/Mage.Sets/src/mage/sets/magic2011/Naturalize.java +++ b/Mage.Sets/src/mage/sets/magic2011/Naturalize.java @@ -36,19 +36,19 @@ import java.util.UUID; */ public class Naturalize extends mage.sets.tenth.Naturalize { - public Naturalize(UUID ownerId) { - super(ownerId); - this.cardNumber = 186; - this.expansionSetCode = "M11"; - } + public Naturalize(UUID ownerId) { + super(ownerId); + this.cardNumber = 186; + this.expansionSetCode = "M11"; + } - public Naturalize(final Naturalize card) { - super(card); - } + public Naturalize(final Naturalize card) { + super(card); + } - @Override - public Naturalize copy() { - return new Naturalize(this); - } + @Override + public Naturalize copy() { + return new Naturalize(this); + } } \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/magic2011/NaturesSpiral.java b/Mage.Sets/src/mage/sets/magic2011/NaturesSpiral.java index 3a573c7bee..d7fe09152a 100644 --- a/Mage.Sets/src/mage/sets/magic2011/NaturesSpiral.java +++ b/Mage.Sets/src/mage/sets/magic2011/NaturesSpiral.java @@ -36,19 +36,19 @@ import java.util.UUID; */ public class NaturesSpiral extends mage.sets.magic2010.NaturesSpiral { - public NaturesSpiral(UUID ownerId) { - super(ownerId); - this.cardNumber = 187; - this.expansionSetCode = "M11"; - } + public NaturesSpiral(UUID ownerId) { + super(ownerId); + this.cardNumber = 187; + this.expansionSetCode = "M11"; + } - public NaturesSpiral(final NaturesSpiral card) { - super(card); - } + public NaturesSpiral(final NaturesSpiral card) { + super(card); + } - @Override - public NaturesSpiral copy() { - return new NaturesSpiral(this); - } + @Override + public NaturesSpiral copy() { + return new NaturesSpiral(this); + } } \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/magic2011/NecroticPlague.java b/Mage.Sets/src/mage/sets/magic2011/NecroticPlague.java index a5cb97c268..a750322229 100644 --- a/Mage.Sets/src/mage/sets/magic2011/NecroticPlague.java +++ b/Mage.Sets/src/mage/sets/magic2011/NecroticPlague.java @@ -64,24 +64,24 @@ import mage.target.targetpointer.FixedTarget; */ public class NecroticPlague extends CardImpl { - public NecroticPlague(UUID ownerId) { - super(ownerId, 107, "Necrotic Plague", Rarity.RARE, new CardType[]{CardType.ENCHANTMENT}, "{2}{B}{B}"); - this.expansionSetCode = "M11"; - this.color.setBlack(true); - this.subtype.add("Aura"); + public NecroticPlague(UUID ownerId) { + super(ownerId, 107, "Necrotic Plague", Rarity.RARE, new CardType[]{CardType.ENCHANTMENT}, "{2}{B}{B}"); + this.expansionSetCode = "M11"; + this.color.setBlack(true); + this.subtype.add("Aura"); - TargetPermanent auraTarget = new TargetCreaturePermanent(); - this.getSpellAbility().addTarget(auraTarget); - this.getSpellAbility().addEffect(new AttachEffect(Outcome.Detriment)); - Ability ability = new EnchantAbility(auraTarget.getTargetName()); - this.addAbility(ability); - this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new NecroticPlagueEffect(this.objectId))); + TargetPermanent auraTarget = new TargetCreaturePermanent(); + this.getSpellAbility().addTarget(auraTarget); + this.getSpellAbility().addEffect(new AttachEffect(Outcome.Detriment)); + Ability ability = new EnchantAbility(auraTarget.getTargetName()); + this.addAbility(ability); + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new NecroticPlagueEffect(this.objectId))); - } + } - public NecroticPlague(final NecroticPlague card) { - super(card); - } + public NecroticPlague(final NecroticPlague card) { + super(card); + } @Override public void assignNewId() { @@ -89,11 +89,11 @@ public class NecroticPlague extends CardImpl { updateSource(); } - @Override - public NecroticPlague copy() { - return new NecroticPlague(this); - } - + @Override + public NecroticPlague copy() { + return new NecroticPlague(this); + } + private void updateSource() { for (Ability ability: abilities) { for (Effect effect: ability.getEffects()) { @@ -109,44 +109,44 @@ class NecroticPlagueEffect extends ContinuousEffectImpl { private Ability ability1; private Ability ability2; - - public NecroticPlagueEffect(UUID cardId) { - super(Duration.WhileOnBattlefield, Outcome.Detriment); + + public NecroticPlagueEffect(UUID cardId) { + super(Duration.WhileOnBattlefield, Outcome.Detriment); ability1 = new OnEventTriggeredAbility(EventType.UPKEEP_STEP_PRE, "beginning of your upkeep", new SacrificeSourceEffect()); ability2 = new DiesTriggeredAbility(new NecroticPlagueEffect2(cardId), false); - staticText = "Enchanted creature has \"At the beginning of your upkeep, sacrifice this creature.\" When enchanted creature is put into a graveyard, its controller chooses target creature one of his or her opponents controls. Return {this} from its owner's graveyard to the battlefield attached to that creature."; - } + staticText = "Enchanted creature has \"At the beginning of your upkeep, sacrifice this creature.\" When enchanted creature is put into a graveyard, its controller chooses target creature one of his or her opponents controls. Return {this} from its owner's graveyard to the battlefield attached to that creature."; + } - public NecroticPlagueEffect(final NecroticPlagueEffect effect) { - super(effect); + public NecroticPlagueEffect(final NecroticPlagueEffect effect) { + super(effect); this.ability1 = effect.ability1.copy(); this.ability2 = effect.ability2.copy(); - } + } - @Override - public NecroticPlagueEffect copy() { - return new NecroticPlagueEffect(this); - } + @Override + public NecroticPlagueEffect copy() { + return new NecroticPlagueEffect(this); + } - @Override - public boolean apply(Layer layer, SubLayer sublayer, Ability source, Game game) { - Permanent enchantment = game.getPermanent(source.getSourceId()); - if (enchantment != null && enchantment.getAttachedTo() != null) { - Permanent creature = game.getPermanent(enchantment.getAttachedTo()); - if (creature != null) { - switch (layer) { - case AbilityAddingRemovingEffects_6: - if (sublayer == SubLayer.NA) { - creature.addAbility(ability1, game); - creature.addAbility(ability2, game); - } - break; - } - return true; - } - } - return false; - } + @Override + public boolean apply(Layer layer, SubLayer sublayer, Ability source, Game game) { + Permanent enchantment = game.getPermanent(source.getSourceId()); + if (enchantment != null && enchantment.getAttachedTo() != null) { + Permanent creature = game.getPermanent(enchantment.getAttachedTo()); + if (creature != null) { + switch (layer) { + case AbilityAddingRemovingEffects_6: + if (sublayer == SubLayer.NA) { + creature.addAbility(ability1, game); + creature.addAbility(ability2, game); + } + break; + } + return true; + } + } + return false; + } public void updateSource(UUID id) { for (Effect effect: ability2.getEffects()) { @@ -155,45 +155,45 @@ class NecroticPlagueEffect extends ContinuousEffectImpl { } } } - - @Override - public boolean apply(Game game, Ability source) { - return false; - } - @Override - public boolean hasLayer(Layer layer) { - return layer == Layer.AbilityAddingRemovingEffects_6; - } + @Override + public boolean apply(Game game, Ability source) { + return false; + } + + @Override + public boolean hasLayer(Layer layer) { + return layer == Layer.AbilityAddingRemovingEffects_6; + } } class NecroticPlagueEffect2 extends OneShotEffect { private UUID cardId; - - private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("creature an opponent controls"); - static { - filter.setTargetController(TargetController.OPPONENT); - } + private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("creature an opponent controls"); - public NecroticPlagueEffect2(UUID cardId) { - super(Outcome.PutCardInPlay); - this.cardId = cardId; - staticText = "its controller chooses target creature one of his or her opponents controls. Return {this} from its owner's graveyard to the battlefield attached to that creature."; - } + static { + filter.setTargetController(TargetController.OPPONENT); + } - public NecroticPlagueEffect2(final NecroticPlagueEffect2 effect) { - super(effect); - this.cardId = effect.cardId; - } + public NecroticPlagueEffect2(UUID cardId) { + super(Outcome.PutCardInPlay); + this.cardId = cardId; + staticText = "its controller chooses target creature one of his or her opponents controls. Return {this} from its owner's graveyard to the battlefield attached to that creature."; + } - @Override - public boolean apply(Game game, Ability source) { - Player controller = game.getPlayer(source.getControllerId()); - if (controller != null) { - TargetCreaturePermanent target = new TargetCreaturePermanent(filter); + public NecroticPlagueEffect2(final NecroticPlagueEffect2 effect) { + super(effect); + this.cardId = effect.cardId; + } + + @Override + public boolean apply(Game game, Ability source) { + Player controller = game.getPlayer(source.getControllerId()); + if (controller != null) { + TargetCreaturePermanent target = new TargetCreaturePermanent(filter); if (target.canChoose(source.getSourceId(), source.getControllerId(), game)) { if (controller.chooseTarget(Outcome.Detriment, target, source, game)) { Card card = game.getCard(cardId); @@ -203,17 +203,17 @@ class NecroticPlagueEffect2 extends OneShotEffect { } } } - } - return false; - } + } + return false; + } public void updateSource(UUID id) { this.cardId = id; } - - @Override - public NecroticPlagueEffect2 copy() { - return new NecroticPlagueEffect2(this); - } + + @Override + public NecroticPlagueEffect2 copy() { + return new NecroticPlagueEffect2(this); + } } diff --git a/Mage.Sets/src/mage/sets/magic2011/Negate.java b/Mage.Sets/src/mage/sets/magic2011/Negate.java index 4f54664675..8b97c15552 100644 --- a/Mage.Sets/src/mage/sets/magic2011/Negate.java +++ b/Mage.Sets/src/mage/sets/magic2011/Negate.java @@ -36,19 +36,19 @@ import java.util.UUID; */ public class Negate extends mage.sets.magic2010.Negate { - public Negate(UUID ownerId) { - super(ownerId); - this.cardNumber = 68; - this.expansionSetCode = "M11"; - } + public Negate(UUID ownerId) { + super(ownerId); + this.cardNumber = 68; + this.expansionSetCode = "M11"; + } - public Negate(final Negate card) { - super(card); - } + public Negate(final Negate card) { + super(card); + } - @Override - public Negate copy() { - return new Negate(this); - } + @Override + public Negate copy() { + return new Negate(this); + } } \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/magic2011/NetherHorror.java b/Mage.Sets/src/mage/sets/magic2011/NetherHorror.java index 425fc25018..720cb92a39 100644 --- a/Mage.Sets/src/mage/sets/magic2011/NetherHorror.java +++ b/Mage.Sets/src/mage/sets/magic2011/NetherHorror.java @@ -40,23 +40,23 @@ import mage.cards.CardImpl; */ public class NetherHorror extends CardImpl { - public NetherHorror(UUID ownerId) { - super(ownerId, 108, "Nether Horror", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{3}{B}"); - this.expansionSetCode = "M11"; - this.subtype.add("Horror"); - this.color.setBlack(true); - this.power = new MageInt(4); - this.toughness = new MageInt(2); + public NetherHorror(UUID ownerId) { + super(ownerId, 108, "Nether Horror", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{3}{B}"); + this.expansionSetCode = "M11"; + this.subtype.add("Horror"); + this.color.setBlack(true); + this.power = new MageInt(4); + this.toughness = new MageInt(2); - } + } - public NetherHorror(final NetherHorror card) { - super(card); - } + public NetherHorror(final NetherHorror card) { + super(card); + } - @Override - public NetherHorror copy() { - return new NetherHorror(this); - } + @Override + public NetherHorror copy() { + return new NetherHorror(this); + } } diff --git a/Mage.Sets/src/mage/sets/magic2011/NightwingShade.java b/Mage.Sets/src/mage/sets/magic2011/NightwingShade.java index e67bb635fc..e2b19ea02e 100644 --- a/Mage.Sets/src/mage/sets/magic2011/NightwingShade.java +++ b/Mage.Sets/src/mage/sets/magic2011/NightwingShade.java @@ -46,25 +46,25 @@ import mage.cards.CardImpl; */ public class NightwingShade extends CardImpl { - public NightwingShade(UUID ownerId) { - super(ownerId, 109, "Nightwing Shade", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{4}{B}"); - this.expansionSetCode = "M11"; - this.subtype.add("Shade"); - this.color.setBlack(true); - this.power = new MageInt(2); - this.toughness = new MageInt(2); + public NightwingShade(UUID ownerId) { + super(ownerId, 109, "Nightwing Shade", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{4}{B}"); + this.expansionSetCode = "M11"; + this.subtype.add("Shade"); + this.color.setBlack(true); + this.power = new MageInt(2); + this.toughness = new MageInt(2); - this.addAbility(FlyingAbility.getInstance()); - this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new BoostSourceEffect(1, 1, Duration.EndOfTurn), new ManaCostsImpl("{1}{B}"))); - } + this.addAbility(FlyingAbility.getInstance()); + this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new BoostSourceEffect(1, 1, Duration.EndOfTurn), new ManaCostsImpl("{1}{B}"))); + } - public NightwingShade(final NightwingShade card) { - super(card); - } + public NightwingShade(final NightwingShade card) { + super(card); + } - @Override - public NightwingShade copy() { - return new NightwingShade(this); - } + @Override + public NightwingShade copy() { + return new NightwingShade(this); + } } diff --git a/Mage.Sets/src/mage/sets/magic2011/ObstinateBaloth.java b/Mage.Sets/src/mage/sets/magic2011/ObstinateBaloth.java index f50df9f66a..d368c57e40 100644 --- a/Mage.Sets/src/mage/sets/magic2011/ObstinateBaloth.java +++ b/Mage.Sets/src/mage/sets/magic2011/ObstinateBaloth.java @@ -55,77 +55,77 @@ import mage.players.Player; */ public class ObstinateBaloth extends CardImpl { - public ObstinateBaloth(UUID ownerId) { - super(ownerId, 188, "Obstinate Baloth", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{2}{G}{G}"); - this.expansionSetCode = "M11"; - this.subtype.add("Beast"); - this.color.setGreen(true); - this.power = new MageInt(4); - this.toughness = new MageInt(4); + public ObstinateBaloth(UUID ownerId) { + super(ownerId, 188, "Obstinate Baloth", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{2}{G}{G}"); + this.expansionSetCode = "M11"; + this.subtype.add("Beast"); + this.color.setGreen(true); + this.power = new MageInt(4); + this.toughness = new MageInt(4); - this.addAbility(new EntersBattlefieldTriggeredAbility(new GainLifeEffect(4), false)); - this.addAbility(new SimpleStaticAbility(Zone.HAND, new ObstinateBalothEffect())); - } + this.addAbility(new EntersBattlefieldTriggeredAbility(new GainLifeEffect(4), false)); + this.addAbility(new SimpleStaticAbility(Zone.HAND, new ObstinateBalothEffect())); + } - public ObstinateBaloth(final ObstinateBaloth card) { - super(card); - } + public ObstinateBaloth(final ObstinateBaloth card) { + super(card); + } - @Override - public ObstinateBaloth copy() { - return new ObstinateBaloth(this); - } + @Override + public ObstinateBaloth copy() { + return new ObstinateBaloth(this); + } } class ObstinateBalothEffect extends ReplacementEffectImpl { - public ObstinateBalothEffect() { - super(Duration.EndOfGame, Outcome.PutCardInPlay); - staticText = "If a spell or ability an opponent controls causes you to discard {this}, put it onto the battlefield instead of putting it into your graveyard"; - } + public ObstinateBalothEffect() { + super(Duration.EndOfGame, Outcome.PutCardInPlay); + staticText = "If a spell or ability an opponent controls causes you to discard {this}, put it onto the battlefield instead of putting it into your graveyard"; + } - public ObstinateBalothEffect(final ObstinateBalothEffect effect) { - super(effect); - } + public ObstinateBalothEffect(final ObstinateBalothEffect effect) { + super(effect); + } - @Override - public ObstinateBalothEffect copy() { - return new ObstinateBalothEffect(this); - } + @Override + public ObstinateBalothEffect copy() { + return new ObstinateBalothEffect(this); + } - @Override - public boolean applies(GameEvent event, Ability source, Game game) { - if (event.getType() == EventType.ZONE_CHANGE && event.getTargetId().equals(source.getSourceId())) { - ZoneChangeEvent zcEvent = (ZoneChangeEvent) event; - if (zcEvent.getFromZone() == Zone.HAND && zcEvent.getToZone() == Zone.GRAVEYARD) { - StackObject spell = game.getStack().getStackObject(event.getSourceId()); - if (spell != null && game.getOpponents(source.getControllerId()).contains(spell.getControllerId())) { - return true; - } - } - } - return false; - } + @Override + public boolean applies(GameEvent event, Ability source, Game game) { + if (event.getType() == EventType.ZONE_CHANGE && event.getTargetId().equals(source.getSourceId())) { + ZoneChangeEvent zcEvent = (ZoneChangeEvent) event; + if (zcEvent.getFromZone() == Zone.HAND && zcEvent.getToZone() == Zone.GRAVEYARD) { + StackObject spell = game.getStack().getStackObject(event.getSourceId()); + if (spell != null && game.getOpponents(source.getControllerId()).contains(spell.getControllerId())) { + return true; + } + } + } + return false; + } - @Override - public boolean apply(Game game, Ability source) { - Card card = game.getCard(source.getSourceId()); - if (card != null) { - Player player = game.getPlayer(card.getOwnerId()); - if (player != null) { - if (card.putOntoBattlefield(game, Zone.HAND, source.getId(), player.getId())) { - game.fireEvent(GameEvent.getEvent(GameEvent.EventType.DISCARDED_CARD, card.getId(), source.getId(), player.getId())); - return true; - } - } - } - return false; - } + @Override + public boolean apply(Game game, Ability source) { + Card card = game.getCard(source.getSourceId()); + if (card != null) { + Player player = game.getPlayer(card.getOwnerId()); + if (player != null) { + if (card.putOntoBattlefield(game, Zone.HAND, source.getId(), player.getId())) { + game.fireEvent(GameEvent.getEvent(GameEvent.EventType.DISCARDED_CARD, card.getId(), source.getId(), player.getId())); + return true; + } + } + } + return false; + } - @Override - public boolean replaceEvent(GameEvent event, Ability source, Game game) { - return apply(game, source); - } + @Override + public boolean replaceEvent(GameEvent event, Ability source, Game game) { + return apply(game, source); + } } \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/magic2011/Ornithopter.java b/Mage.Sets/src/mage/sets/magic2011/Ornithopter.java index 10778cc7de..42ceee617c 100644 --- a/Mage.Sets/src/mage/sets/magic2011/Ornithopter.java +++ b/Mage.Sets/src/mage/sets/magic2011/Ornithopter.java @@ -36,19 +36,19 @@ import java.util.UUID; */ public class Ornithopter extends mage.sets.magic2010.Ornithopter { - public Ornithopter(UUID ownerId) { - super(ownerId); - this.cardNumber = 211; - this.expansionSetCode = "M11"; - } + public Ornithopter(UUID ownerId) { + super(ownerId); + this.cardNumber = 211; + this.expansionSetCode = "M11"; + } - public Ornithopter(final Ornithopter card) { - super(card); - } + public Ornithopter(final Ornithopter card) { + super(card); + } - @Override - public Ornithopter copy() { - return new Ornithopter(this); - } + @Override + public Ornithopter copy() { + return new Ornithopter(this); + } } \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/magic2011/OverwhelmingStampede.java b/Mage.Sets/src/mage/sets/magic2011/OverwhelmingStampede.java index 2881c02b57..565acd7d62 100644 --- a/Mage.Sets/src/mage/sets/magic2011/OverwhelmingStampede.java +++ b/Mage.Sets/src/mage/sets/magic2011/OverwhelmingStampede.java @@ -45,72 +45,72 @@ import java.util.UUID; */ public class OverwhelmingStampede extends CardImpl { - public OverwhelmingStampede(UUID ownerId) { - super(ownerId, 189, "Overwhelming Stampede", Rarity.RARE, new CardType[]{CardType.SORCERY}, "{3}{G}{G}"); - this.expansionSetCode = "M11"; - this.color.setGreen(true); - this.getSpellAbility().addEffect(new OverwhelmingStampedeEffect()); - } + public OverwhelmingStampede(UUID ownerId) { + super(ownerId, 189, "Overwhelming Stampede", Rarity.RARE, new CardType[]{CardType.SORCERY}, "{3}{G}{G}"); + this.expansionSetCode = "M11"; + this.color.setGreen(true); + this.getSpellAbility().addEffect(new OverwhelmingStampedeEffect()); + } - public OverwhelmingStampede(final OverwhelmingStampede card) { - super(card); - } + public OverwhelmingStampede(final OverwhelmingStampede card) { + super(card); + } - @Override - public OverwhelmingStampede copy() { - return new OverwhelmingStampede(this); - } + @Override + public OverwhelmingStampede copy() { + return new OverwhelmingStampede(this); + } } class OverwhelmingStampedeEffect extends ContinuousEffectImpl { - public OverwhelmingStampedeEffect() { - super(Duration.EndOfTurn, Outcome.AddAbility); - staticText = "Until end of turn, creatures you control gain trample and get +X/+X, where X is the greatest power among creatures you control."; - } + public OverwhelmingStampedeEffect() { + super(Duration.EndOfTurn, Outcome.AddAbility); + staticText = "Until end of turn, creatures you control gain trample and get +X/+X, where X is the greatest power among creatures you control."; + } - public OverwhelmingStampedeEffect(final OverwhelmingStampedeEffect effect) { - super(effect); - } + public OverwhelmingStampedeEffect(final OverwhelmingStampedeEffect effect) { + super(effect); + } - @Override - public OverwhelmingStampedeEffect copy() { - return new OverwhelmingStampedeEffect(this); - } + @Override + public OverwhelmingStampedeEffect copy() { + return new OverwhelmingStampedeEffect(this); + } - @Override - public boolean apply(Layer layer, SubLayer sublayer, Ability source, Game game) { - int maxPower = 0; - for (Permanent perm: game.getBattlefield().getAllActivePermanents(new FilterCreaturePermanent(), source.getControllerId(), game)) { - if (perm.getPower().getValue() > maxPower) - maxPower = perm.getPower().getValue(); - } - for (Permanent perm: game.getBattlefield().getAllActivePermanents(new FilterCreaturePermanent(), source.getControllerId(), game)) { - switch (layer) { - case PTChangingEffects_7: - if (sublayer == SubLayer.ModifyPT_7c) { - perm.addPower(maxPower); - perm.addToughness(maxPower); - } - break; - case AbilityAddingRemovingEffects_6: - if (sublayer == SubLayer.NA) { - perm.addAbility(TrampleAbility.getInstance(), game); - } - break; - } - } - return true; - } + @Override + public boolean apply(Layer layer, SubLayer sublayer, Ability source, Game game) { + int maxPower = 0; + for (Permanent perm: game.getBattlefield().getAllActivePermanents(new FilterCreaturePermanent(), source.getControllerId(), game)) { + if (perm.getPower().getValue() > maxPower) + maxPower = perm.getPower().getValue(); + } + for (Permanent perm: game.getBattlefield().getAllActivePermanents(new FilterCreaturePermanent(), source.getControllerId(), game)) { + switch (layer) { + case PTChangingEffects_7: + if (sublayer == SubLayer.ModifyPT_7c) { + perm.addPower(maxPower); + perm.addToughness(maxPower); + } + break; + case AbilityAddingRemovingEffects_6: + if (sublayer == SubLayer.NA) { + perm.addAbility(TrampleAbility.getInstance(), game); + } + break; + } + } + return true; + } - @Override - public boolean apply(Game game, Ability source) { - return false; - } + @Override + public boolean apply(Game game, Ability source) { + return false; + } - @Override - public boolean hasLayer(Layer layer) { - return layer == Layer.AbilityAddingRemovingEffects_6 || layer == Layer.PTChangingEffects_7; - } + @Override + public boolean hasLayer(Layer layer) { + return layer == Layer.AbilityAddingRemovingEffects_6 || layer == Layer.PTChangingEffects_7; + } } \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/magic2011/Pacifism.java b/Mage.Sets/src/mage/sets/magic2011/Pacifism.java index b0352d2acf..ca325d15b0 100644 --- a/Mage.Sets/src/mage/sets/magic2011/Pacifism.java +++ b/Mage.Sets/src/mage/sets/magic2011/Pacifism.java @@ -36,19 +36,19 @@ import java.util.UUID; */ public class Pacifism extends mage.sets.tenth.Pacifism { - public Pacifism(UUID ownerId) { - super(ownerId); - this.cardNumber = 23; - this.expansionSetCode = "M11"; - } + public Pacifism(UUID ownerId) { + super(ownerId); + this.cardNumber = 23; + this.expansionSetCode = "M11"; + } - public Pacifism(final Pacifism card) { - super(card); - } + public Pacifism(final Pacifism card) { + super(card); + } - @Override - public Pacifism copy() { - return new Pacifism(this); - } + @Override + public Pacifism copy() { + return new Pacifism(this); + } } \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/magic2011/PalaceGuard.java b/Mage.Sets/src/mage/sets/magic2011/PalaceGuard.java index b22d63021d..017541a54d 100644 --- a/Mage.Sets/src/mage/sets/magic2011/PalaceGuard.java +++ b/Mage.Sets/src/mage/sets/magic2011/PalaceGuard.java @@ -36,19 +36,19 @@ import java.util.UUID; */ public class PalaceGuard extends mage.sets.magic2010.PalaceGuard { - public PalaceGuard(UUID ownerId) { - super(ownerId); - this.cardNumber = 24; - this.expansionSetCode = "M11"; - } + public PalaceGuard(UUID ownerId) { + super(ownerId); + this.cardNumber = 24; + this.expansionSetCode = "M11"; + } - public PalaceGuard(final PalaceGuard card) { - super(card); - } + public PalaceGuard(final PalaceGuard card) { + super(card); + } - @Override - public PalaceGuard copy() { - return new PalaceGuard(this); - } + @Override + public PalaceGuard copy() { + return new PalaceGuard(this); + } } \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/magic2011/PhantomBeast.java b/Mage.Sets/src/mage/sets/magic2011/PhantomBeast.java index c27e54ea30..c170bc47e0 100644 --- a/Mage.Sets/src/mage/sets/magic2011/PhantomBeast.java +++ b/Mage.Sets/src/mage/sets/magic2011/PhantomBeast.java @@ -43,25 +43,25 @@ import mage.cards.CardImpl; */ public class PhantomBeast extends CardImpl { - public PhantomBeast(UUID ownerId) { - super(ownerId, 69, "Phantom Beast", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{3}{U}"); - this.expansionSetCode = "M11"; - this.subtype.add("Illusion"); - this.subtype.add("Beast"); - - this.color.setBlue(true); - this.power = new MageInt(4); - this.toughness = new MageInt(5); + public PhantomBeast(UUID ownerId) { + super(ownerId, 69, "Phantom Beast", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{3}{U}"); + this.expansionSetCode = "M11"; + this.subtype.add("Illusion"); + this.subtype.add("Beast"); - this.addAbility(new BecomesTargetTriggeredAbility(new SacrificeSourceEffect())); - } + this.color.setBlue(true); + this.power = new MageInt(4); + this.toughness = new MageInt(5); - public PhantomBeast(final PhantomBeast card) { - super(card); - } + this.addAbility(new BecomesTargetTriggeredAbility(new SacrificeSourceEffect())); + } - @Override - public PhantomBeast copy() { - return new PhantomBeast(this); - } + public PhantomBeast(final PhantomBeast card) { + super(card); + } + + @Override + public PhantomBeast copy() { + return new PhantomBeast(this); + } } diff --git a/Mage.Sets/src/mage/sets/magic2011/PhylacteryLich.java b/Mage.Sets/src/mage/sets/magic2011/PhylacteryLich.java index 342586c07c..cde67c089f 100644 --- a/Mage.Sets/src/mage/sets/magic2011/PhylacteryLich.java +++ b/Mage.Sets/src/mage/sets/magic2011/PhylacteryLich.java @@ -56,100 +56,100 @@ import mage.target.common.TargetControlledPermanent; */ public class PhylacteryLich extends CardImpl { - public PhylacteryLich(UUID ownerId) { - super(ownerId, 110, "Phylactery Lich", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{B}{B}{B}"); - this.expansionSetCode = "M11"; - this.subtype.add("Zombie"); - this.color.setBlack(true); - this.power = new MageInt(5); - this.toughness = new MageInt(5); + public PhylacteryLich(UUID ownerId) { + super(ownerId, 110, "Phylactery Lich", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{B}{B}{B}"); + this.expansionSetCode = "M11"; + this.subtype.add("Zombie"); + this.color.setBlack(true); + this.power = new MageInt(5); + this.toughness = new MageInt(5); - this.addAbility(new EntersBattlefieldAbility(new PhylacteryLichEffect(), "put a phylactery counter on an artifact you control")); - this.addAbility(IndestructibleAbility.getInstance()); - this.addAbility(new PhylacteryLichAbility()); - } + this.addAbility(new EntersBattlefieldAbility(new PhylacteryLichEffect(), "put a phylactery counter on an artifact you control")); + this.addAbility(IndestructibleAbility.getInstance()); + this.addAbility(new PhylacteryLichAbility()); + } - public PhylacteryLich(final PhylacteryLich card) { - super(card); - } + public PhylacteryLich(final PhylacteryLich card) { + super(card); + } - @Override - public PhylacteryLich copy() { - return new PhylacteryLich(this); - } + @Override + public PhylacteryLich copy() { + return new PhylacteryLich(this); + } - class PhylacteryLichAbility extends StateTriggeredAbility { + class PhylacteryLichAbility extends StateTriggeredAbility { - public PhylacteryLichAbility() { - super(Zone.BATTLEFIELD, new SacrificeSourceEffect()); - } + public PhylacteryLichAbility() { + super(Zone.BATTLEFIELD, new SacrificeSourceEffect()); + } - public PhylacteryLichAbility(final PhylacteryLichAbility ability) { - super(ability); - } + public PhylacteryLichAbility(final PhylacteryLichAbility ability) { + super(ability); + } - @Override - public PhylacteryLichAbility copy() { - return new PhylacteryLichAbility(this); - } + @Override + public PhylacteryLichAbility copy() { + return new PhylacteryLichAbility(this); + } - @Override - public boolean checkTrigger(GameEvent event, Game game) { - for (Permanent perm: game.getBattlefield().getAllActivePermanents(controllerId)) { - if (perm.getCounters().getCount("phylactery") > 0) - return false; - } - return true; - } - - @Override - public String getRule() { - return "When you control no permanents with phylactery counters on them, sacrifice {this}."; - } + @Override + public boolean checkTrigger(GameEvent event, Game game) { + for (Permanent perm: game.getBattlefield().getAllActivePermanents(controllerId)) { + if (perm.getCounters().getCount("phylactery") > 0) + return false; + } + return true; + } - } + @Override + public String getRule() { + return "When you control no permanents with phylactery counters on them, sacrifice {this}."; + } + + } } class PhylacteryLichEffect extends OneShotEffect { - private static final FilterControlledPermanent filter = new FilterControlledPermanent("artifact"); + private static final FilterControlledPermanent filter = new FilterControlledPermanent("artifact"); - static { - filter.getCardType().add(CardType.ARTIFACT); - filter.setScopeCardType(ComparisonScope.Any); - } + static { + filter.getCardType().add(CardType.ARTIFACT); + filter.setScopeCardType(ComparisonScope.Any); + } - public PhylacteryLichEffect() { - super(Outcome.Neutral); - staticText = "put a phylactery counter on an artifact you control"; - } + public PhylacteryLichEffect() { + super(Outcome.Neutral); + staticText = "put a phylactery counter on an artifact you control"; + } - public PhylacteryLichEffect(final PhylacteryLichEffect effect) { - super(effect); - } + public PhylacteryLichEffect(final PhylacteryLichEffect effect) { + super(effect); + } - @Override - public boolean apply(Game game, Ability source) { - Player player = game.getPlayer(source.getControllerId()); - if (player != null) { - TargetControlledPermanent target = new TargetControlledPermanent(filter); - if (target.canChoose(source.getControllerId(), game)) { - target.setRequired(true); - if (player.choose(Outcome.Neutral, target, source.getSourceId(), game)) { - Permanent permanent = game.getPermanent(target.getFirstTarget()); - if (permanent != null) { - permanent.addCounters(new Counter("phylactery"), game); - } - } - } - } - return false; - } + @Override + public boolean apply(Game game, Ability source) { + Player player = game.getPlayer(source.getControllerId()); + if (player != null) { + TargetControlledPermanent target = new TargetControlledPermanent(filter); + if (target.canChoose(source.getControllerId(), game)) { + target.setRequired(true); + if (player.choose(Outcome.Neutral, target, source.getSourceId(), game)) { + Permanent permanent = game.getPermanent(target.getFirstTarget()); + if (permanent != null) { + permanent.addCounters(new Counter("phylactery"), game); + } + } + } + } + return false; + } - @Override - public PhylacteryLichEffect copy() { - return new PhylacteryLichEffect(this); - } + @Override + public PhylacteryLichEffect copy() { + return new PhylacteryLichEffect(this); + } } \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/magic2011/Plains1.java b/Mage.Sets/src/mage/sets/magic2011/Plains1.java index 195febc7b8..a5c900b45e 100644 --- a/Mage.Sets/src/mage/sets/magic2011/Plains1.java +++ b/Mage.Sets/src/mage/sets/magic2011/Plains1.java @@ -36,18 +36,18 @@ import java.util.UUID; */ public class Plains1 extends mage.cards.basiclands.Plains { - public Plains1(UUID ownerId) { - super(ownerId, 230); - this.expansionSetCode = "M11"; - } + public Plains1(UUID ownerId) { + super(ownerId, 230); + this.expansionSetCode = "M11"; + } - public Plains1(final Plains1 card) { - super(card); - } + public Plains1(final Plains1 card) { + super(card); + } - @Override - public Plains1 copy() { - return new Plains1(this); - } + @Override + public Plains1 copy() { + return new Plains1(this); + } } diff --git a/Mage.Sets/src/mage/sets/magic2011/Plains2.java b/Mage.Sets/src/mage/sets/magic2011/Plains2.java index e85be3c6c2..8cc725b688 100644 --- a/Mage.Sets/src/mage/sets/magic2011/Plains2.java +++ b/Mage.Sets/src/mage/sets/magic2011/Plains2.java @@ -36,18 +36,18 @@ import java.util.UUID; */ public class Plains2 extends mage.cards.basiclands.Plains { - public Plains2(UUID ownerId) { - super(ownerId, 231); - this.expansionSetCode = "M11"; - } + public Plains2(UUID ownerId) { + super(ownerId, 231); + this.expansionSetCode = "M11"; + } - public Plains2(final Plains2 card) { - super(card); - } + public Plains2(final Plains2 card) { + super(card); + } - @Override - public Plains2 copy() { - return new Plains2(this); - } + @Override + public Plains2 copy() { + return new Plains2(this); + } } diff --git a/Mage.Sets/src/mage/sets/magic2011/Plains3.java b/Mage.Sets/src/mage/sets/magic2011/Plains3.java index cbcdef3660..e3b4b800be 100644 --- a/Mage.Sets/src/mage/sets/magic2011/Plains3.java +++ b/Mage.Sets/src/mage/sets/magic2011/Plains3.java @@ -36,18 +36,18 @@ import java.util.UUID; */ public class Plains3 extends mage.cards.basiclands.Plains { - public Plains3(UUID ownerId) { - super(ownerId, 232); - this.expansionSetCode = "M11"; - } + public Plains3(UUID ownerId) { + super(ownerId, 232); + this.expansionSetCode = "M11"; + } - public Plains3(final Plains3 card) { - super(card); - } + public Plains3(final Plains3 card) { + super(card); + } - @Override - public Plains3 copy() { - return new Plains3(this); - } + @Override + public Plains3 copy() { + return new Plains3(this); + } } diff --git a/Mage.Sets/src/mage/sets/magic2011/Plains4.java b/Mage.Sets/src/mage/sets/magic2011/Plains4.java index 261a236815..faf6075d24 100644 --- a/Mage.Sets/src/mage/sets/magic2011/Plains4.java +++ b/Mage.Sets/src/mage/sets/magic2011/Plains4.java @@ -36,18 +36,18 @@ import java.util.UUID; */ public class Plains4 extends mage.cards.basiclands.Plains { - public Plains4(UUID ownerId) { - super(ownerId, 233); - this.expansionSetCode = "M11"; - } + public Plains4(UUID ownerId) { + super(ownerId, 233); + this.expansionSetCode = "M11"; + } - public Plains4(final Plains4 card) { - super(card); - } + public Plains4(final Plains4 card) { + super(card); + } - @Override - public Plains4 copy() { - return new Plains4(this); - } + @Override + public Plains4 copy() { + return new Plains4(this); + } } diff --git a/Mage.Sets/src/mage/sets/magic2011/PlatinumAngel.java b/Mage.Sets/src/mage/sets/magic2011/PlatinumAngel.java index 1bfdfd8865..c4e325b1f7 100644 --- a/Mage.Sets/src/mage/sets/magic2011/PlatinumAngel.java +++ b/Mage.Sets/src/mage/sets/magic2011/PlatinumAngel.java @@ -37,20 +37,20 @@ import mage.Constants.Rarity; */ public class PlatinumAngel extends mage.sets.magic2010.PlatinumAngel { - public PlatinumAngel(UUID ownerId) { - super(ownerId); - this.cardNumber = 212; - this.expansionSetCode = "M11"; + public PlatinumAngel(UUID ownerId) { + super(ownerId); + this.cardNumber = 212; + this.expansionSetCode = "M11"; this.rarity = Rarity.MYTHIC; - } + } - public PlatinumAngel(final PlatinumAngel card) { - super(card); - } + public PlatinumAngel(final PlatinumAngel card) { + super(card); + } - @Override - public PlatinumAngel copy() { - return new PlatinumAngel(this); - } + @Override + public PlatinumAngel copy() { + return new PlatinumAngel(this); + } } \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/magic2011/Plummet.java b/Mage.Sets/src/mage/sets/magic2011/Plummet.java index 9ea2c900ac..6cfaa70d4d 100644 --- a/Mage.Sets/src/mage/sets/magic2011/Plummet.java +++ b/Mage.Sets/src/mage/sets/magic2011/Plummet.java @@ -44,26 +44,26 @@ import mage.target.common.TargetCreaturePermanent; */ public class Plummet extends CardImpl { - private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("creature with flying"); + private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("creature with flying"); - static { - filter.getAbilities().add(FlyingAbility.getInstance()); - } + static { + filter.getAbilities().add(FlyingAbility.getInstance()); + } - public Plummet(UUID ownerId) { - super(ownerId, 190, "Plummet", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{1}{G}"); - this.expansionSetCode = "M11"; - this.color.setGreen(true); - this.getSpellAbility().addTarget(new TargetCreaturePermanent(filter)); - this.getSpellAbility().addEffect(new DestroyTargetEffect()); - } + public Plummet(UUID ownerId) { + super(ownerId, 190, "Plummet", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{1}{G}"); + this.expansionSetCode = "M11"; + this.color.setGreen(true); + this.getSpellAbility().addTarget(new TargetCreaturePermanent(filter)); + this.getSpellAbility().addEffect(new DestroyTargetEffect()); + } - public Plummet(final Plummet card) { - super(card); - } + public Plummet(final Plummet card) { + super(card); + } - @Override - public Plummet copy() { - return new Plummet(this); - } + @Override + public Plummet copy() { + return new Plummet(this); + } } diff --git a/Mage.Sets/src/mage/sets/magic2011/Preordain.java b/Mage.Sets/src/mage/sets/magic2011/Preordain.java index 23f93c9704..5575e4eaf6 100644 --- a/Mage.Sets/src/mage/sets/magic2011/Preordain.java +++ b/Mage.Sets/src/mage/sets/magic2011/Preordain.java @@ -41,20 +41,20 @@ import mage.cards.CardImpl; */ public class Preordain extends CardImpl { - public Preordain(UUID ownerId) { - super(ownerId, 70, "Preordain", Rarity.COMMON, new CardType[]{CardType.SORCERY}, "{U}"); - this.expansionSetCode = "M11"; - this.color.setBlue(true); - this.getSpellAbility().addEffect(new ScryEffect(2)); - this.getSpellAbility().addEffect(new DrawCardControllerEffect(1)); - } + public Preordain(UUID ownerId) { + super(ownerId, 70, "Preordain", Rarity.COMMON, new CardType[]{CardType.SORCERY}, "{U}"); + this.expansionSetCode = "M11"; + this.color.setBlue(true); + this.getSpellAbility().addEffect(new ScryEffect(2)); + this.getSpellAbility().addEffect(new DrawCardControllerEffect(1)); + } - public Preordain(final Preordain card) { - super(card); - } + public Preordain(final Preordain card) { + super(card); + } - @Override - public Preordain copy() { - return new Preordain(this); - } + @Override + public Preordain copy() { + return new Preordain(this); + } } diff --git a/Mage.Sets/src/mage/sets/magic2011/PrimalCocoon.java b/Mage.Sets/src/mage/sets/magic2011/PrimalCocoon.java index 4ca106b718..f1e0eeea94 100644 --- a/Mage.Sets/src/mage/sets/magic2011/PrimalCocoon.java +++ b/Mage.Sets/src/mage/sets/magic2011/PrimalCocoon.java @@ -53,90 +53,90 @@ import mage.target.common.TargetCreaturePermanent; */ public class PrimalCocoon extends CardImpl { - public PrimalCocoon(UUID ownerId) { - super(ownerId, 191, "Primal Cocoon", Rarity.COMMON, new CardType[]{CardType.ENCHANTMENT}, "{G}"); - this.expansionSetCode = "M11"; - this.color.setGreen(true); - this.subtype.add("Aura"); + public PrimalCocoon(UUID ownerId) { + super(ownerId, 191, "Primal Cocoon", Rarity.COMMON, new CardType[]{CardType.ENCHANTMENT}, "{G}"); + this.expansionSetCode = "M11"; + this.color.setGreen(true); + this.subtype.add("Aura"); - TargetPermanent auraTarget = new TargetCreaturePermanent(); - this.getSpellAbility().addTarget(auraTarget); - this.getSpellAbility().addEffect(new AttachEffect(Outcome.Benefit)); - Ability ability = new EnchantAbility(auraTarget.getTargetName()); - this.addAbility(ability); - this.addAbility(new PrimalCocoonAbility1()); - this.addAbility(new PrimalCocoonAbility2()); + TargetPermanent auraTarget = new TargetCreaturePermanent(); + this.getSpellAbility().addTarget(auraTarget); + this.getSpellAbility().addEffect(new AttachEffect(Outcome.Benefit)); + Ability ability = new EnchantAbility(auraTarget.getTargetName()); + this.addAbility(ability); + this.addAbility(new PrimalCocoonAbility1()); + this.addAbility(new PrimalCocoonAbility2()); - } + } - public PrimalCocoon(final PrimalCocoon card) { - super(card); - } + public PrimalCocoon(final PrimalCocoon card) { + super(card); + } - @Override - public PrimalCocoon copy() { - return new PrimalCocoon(this); - } + @Override + public PrimalCocoon copy() { + return new PrimalCocoon(this); + } } class PrimalCocoonAbility1 extends TriggeredAbilityImpl { - public PrimalCocoonAbility1() { - super(Zone.BATTLEFIELD, new AddPlusOneCountersAttachedEffect(1)); - } + public PrimalCocoonAbility1() { + super(Zone.BATTLEFIELD, new AddPlusOneCountersAttachedEffect(1)); + } - public PrimalCocoonAbility1(final PrimalCocoonAbility1 ability) { - super(ability); - } + public PrimalCocoonAbility1(final PrimalCocoonAbility1 ability) { + super(ability); + } - @Override - public PrimalCocoonAbility1 copy() { - return new PrimalCocoonAbility1(this); - } + @Override + public PrimalCocoonAbility1 copy() { + return new PrimalCocoonAbility1(this); + } - @Override - public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == EventType.UPKEEP_STEP_PRE && event.getPlayerId().equals(this.controllerId)) { - return true; - } - return false; - } + @Override + public boolean checkTrigger(GameEvent event, Game game) { + if (event.getType() == EventType.UPKEEP_STEP_PRE && event.getPlayerId().equals(this.controllerId)) { + return true; + } + return false; + } - @Override - public String getRule() { - return "At the beginning of your upkeep, put a +1/+1 counter on enchanted creature."; - } + @Override + public String getRule() { + return "At the beginning of your upkeep, put a +1/+1 counter on enchanted creature."; + } } class PrimalCocoonAbility2 extends TriggeredAbilityImpl { - public PrimalCocoonAbility2() { - super(Zone.BATTLEFIELD, new DestroySourceEffect()); - } + public PrimalCocoonAbility2() { + super(Zone.BATTLEFIELD, new DestroySourceEffect()); + } - public PrimalCocoonAbility2(final PrimalCocoonAbility2 ability) { - super(ability); - } + public PrimalCocoonAbility2(final PrimalCocoonAbility2 ability) { + super(ability); + } - @Override - public PrimalCocoonAbility2 copy() { - return new PrimalCocoonAbility2(this); - } + @Override + public PrimalCocoonAbility2 copy() { + return new PrimalCocoonAbility2(this); + } - @Override - public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == EventType.ATTACKER_DECLARED || event.getType() == EventType.BLOCKER_DECLARED) { - Permanent enchantment = game.getPermanent(sourceId); - if (enchantment != null && enchantment.getAttachedTo() != null && event.getSourceId() != null && event.getSourceId().equals(enchantment.getAttachedTo())) { - return true; - } - } - return false; - } + @Override + public boolean checkTrigger(GameEvent event, Game game) { + if (event.getType() == EventType.ATTACKER_DECLARED || event.getType() == EventType.BLOCKER_DECLARED) { + Permanent enchantment = game.getPermanent(sourceId); + if (enchantment != null && enchantment.getAttachedTo() != null && event.getSourceId() != null && event.getSourceId().equals(enchantment.getAttachedTo())) { + return true; + } + } + return false; + } - @Override - public String getRule() { - return "When enchanted creature attacks or blocks, sacrifice {this}."; - } + @Override + public String getRule() { + return "When enchanted creature attacks or blocks, sacrifice {this}."; + } } diff --git a/Mage.Sets/src/mage/sets/magic2011/PrimevalTitan.java b/Mage.Sets/src/mage/sets/magic2011/PrimevalTitan.java index a9a9c6932e..cd8808b46e 100644 --- a/Mage.Sets/src/mage/sets/magic2011/PrimevalTitan.java +++ b/Mage.Sets/src/mage/sets/magic2011/PrimevalTitan.java @@ -51,63 +51,63 @@ import mage.target.common.TargetCardInLibrary; */ public class PrimevalTitan extends CardImpl { - public PrimevalTitan(UUID ownerId) { - super(ownerId, 192, "Primeval Titan", Rarity.MYTHIC, new CardType[]{CardType.CREATURE}, "{4}{G}{G}"); - this.expansionSetCode = "M11"; - this.subtype.add("Giant"); - this.color.setGreen(true); - this.power = new MageInt(6); - this.toughness = new MageInt(6); + public PrimevalTitan(UUID ownerId) { + super(ownerId, 192, "Primeval Titan", Rarity.MYTHIC, new CardType[]{CardType.CREATURE}, "{4}{G}{G}"); + this.expansionSetCode = "M11"; + this.subtype.add("Giant"); + this.color.setGreen(true); + this.power = new MageInt(6); + this.toughness = new MageInt(6); - this.addAbility(TrampleAbility.getInstance()); - this.addAbility(new PrimevalTitanAbility()); - } + this.addAbility(TrampleAbility.getInstance()); + this.addAbility(new PrimevalTitanAbility()); + } - public PrimevalTitan(final PrimevalTitan card) { - super(card); - } + public PrimevalTitan(final PrimevalTitan card) { + super(card); + } - @Override - public PrimevalTitan copy() { - return new PrimevalTitan(this); - } + @Override + public PrimevalTitan copy() { + return new PrimevalTitan(this); + } } class PrimevalTitanAbility extends TriggeredAbilityImpl { - public PrimevalTitanAbility() { - super(Zone.BATTLEFIELD, null, true); - TargetCardInLibrary target = new TargetCardInLibrary(2, new FilterLandCard()); - this.addEffect(new SearchLibraryPutInPlayEffect(target, true, Outcome.PutLandInPlay)); - } + public PrimevalTitanAbility() { + super(Zone.BATTLEFIELD, null, true); + TargetCardInLibrary target = new TargetCardInLibrary(2, new FilterLandCard()); + this.addEffect(new SearchLibraryPutInPlayEffect(target, true, Outcome.PutLandInPlay)); + } - public PrimevalTitanAbility(final PrimevalTitanAbility ability) { - super(ability); - } + public PrimevalTitanAbility(final PrimevalTitanAbility ability) { + super(ability); + } - @Override - public PrimevalTitanAbility copy() { - return new PrimevalTitanAbility(this); - } + @Override + public PrimevalTitanAbility copy() { + return new PrimevalTitanAbility(this); + } - @Override - public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == EventType.ATTACKER_DECLARED && event.getSourceId().equals(this.getSourceId())) { - return true; - } - if (event.getType() == EventType.ZONE_CHANGE && event.getTargetId().equals(this.getSourceId()) ) { - ZoneChangeEvent zEvent = (ZoneChangeEvent)event; - if (zEvent.getToZone() == Zone.BATTLEFIELD) { - return true; - } - } - return false; - } + @Override + public boolean checkTrigger(GameEvent event, Game game) { + if (event.getType() == EventType.ATTACKER_DECLARED && event.getSourceId().equals(this.getSourceId())) { + return true; + } + if (event.getType() == EventType.ZONE_CHANGE && event.getTargetId().equals(this.getSourceId()) ) { + ZoneChangeEvent zEvent = (ZoneChangeEvent)event; + if (zEvent.getToZone() == Zone.BATTLEFIELD) { + return true; + } + } + return false; + } - @Override - public String getRule() { - return "Whenever {this} enters the battlefield or attacks, you may search your library for up to two land cards, put them onto the battlefield tapped, then shuffle your library."; - } + @Override + public String getRule() { + return "Whenever {this} enters the battlefield or attacks, you may search your library for up to two land cards, put them onto the battlefield tapped, then shuffle your library."; + } } diff --git a/Mage.Sets/src/mage/sets/magic2011/PrizedUnicorn.java b/Mage.Sets/src/mage/sets/magic2011/PrizedUnicorn.java index a11b34e985..7688b2ca58 100644 --- a/Mage.Sets/src/mage/sets/magic2011/PrizedUnicorn.java +++ b/Mage.Sets/src/mage/sets/magic2011/PrizedUnicorn.java @@ -36,19 +36,19 @@ import java.util.UUID; */ public class PrizedUnicorn extends mage.sets.magic2010.PrizedUnicorn { - public PrizedUnicorn(UUID ownerId) { - super(ownerId); - this.cardNumber = 193; - this.expansionSetCode = "M11"; - } + public PrizedUnicorn(UUID ownerId) { + super(ownerId); + this.cardNumber = 193; + this.expansionSetCode = "M11"; + } - public PrizedUnicorn(final PrizedUnicorn card) { - super(card); - } + public PrizedUnicorn(final PrizedUnicorn card) { + super(card); + } - @Override - public PrizedUnicorn copy() { - return new PrizedUnicorn(this); - } + @Override + public PrizedUnicorn copy() { + return new PrizedUnicorn(this); + } } \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/magic2011/ProdigalPyromancer.java b/Mage.Sets/src/mage/sets/magic2011/ProdigalPyromancer.java index 670c3b9e93..3f5b2865cb 100644 --- a/Mage.Sets/src/mage/sets/magic2011/ProdigalPyromancer.java +++ b/Mage.Sets/src/mage/sets/magic2011/ProdigalPyromancer.java @@ -37,20 +37,20 @@ import mage.Constants.Rarity; */ public class ProdigalPyromancer extends mage.sets.magic2010.ProdigalPyromancer { - public ProdigalPyromancer(UUID ownerId) { - super(ownerId); - this.cardNumber = 152; - this.expansionSetCode = "M11"; + public ProdigalPyromancer(UUID ownerId) { + super(ownerId); + this.cardNumber = 152; + this.expansionSetCode = "M11"; this.rarity = Rarity.UNCOMMON; - } + } - public ProdigalPyromancer(final ProdigalPyromancer card) { - super(card); - } + public ProdigalPyromancer(final ProdigalPyromancer card) { + super(card); + } - @Override - public ProdigalPyromancer copy() { - return new ProdigalPyromancer(this); - } + @Override + public ProdigalPyromancer copy() { + return new ProdigalPyromancer(this); + } } \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/magic2011/ProteanHydra.java b/Mage.Sets/src/mage/sets/magic2011/ProteanHydra.java index 17486328b6..d766da4cd4 100644 --- a/Mage.Sets/src/mage/sets/magic2011/ProteanHydra.java +++ b/Mage.Sets/src/mage/sets/magic2011/ProteanHydra.java @@ -37,20 +37,20 @@ import mage.Constants.Rarity; */ public class ProteanHydra extends mage.sets.magic2010.ProteanHydra { - public ProteanHydra(UUID ownerId) { - super(ownerId); - this.cardNumber = 194; - this.expansionSetCode = "M11"; - this.rarity = Rarity.RARE; - } + public ProteanHydra(UUID ownerId) { + super(ownerId); + this.cardNumber = 194; + this.expansionSetCode = "M11"; + this.rarity = Rarity.RARE; + } - public ProteanHydra(final ProteanHydra card) { - super(card); - } + public ProteanHydra(final ProteanHydra card) { + super(card); + } - @Override - public ProteanHydra copy() { - return new ProteanHydra(this); - } + @Override + public ProteanHydra copy() { + return new ProteanHydra(this); + } } \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/magic2011/PyreticRitual.java b/Mage.Sets/src/mage/sets/magic2011/PyreticRitual.java index e4ed43bef0..7de85ac91d 100644 --- a/Mage.Sets/src/mage/sets/magic2011/PyreticRitual.java +++ b/Mage.Sets/src/mage/sets/magic2011/PyreticRitual.java @@ -41,19 +41,19 @@ import mage.cards.CardImpl; */ public class PyreticRitual extends CardImpl { - public PyreticRitual(UUID ownerId) { - super(ownerId, 153, "Pyretic Ritual", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{1}{R}"); - this.expansionSetCode = "M11"; - this.color.setRed(true); - this.getSpellAbility().addEffect(new BasicManaEffect(Mana.RedMana(3))); - } + public PyreticRitual(UUID ownerId) { + super(ownerId, 153, "Pyretic Ritual", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{1}{R}"); + this.expansionSetCode = "M11"; + this.color.setRed(true); + this.getSpellAbility().addEffect(new BasicManaEffect(Mana.RedMana(3))); + } - public PyreticRitual(final PyreticRitual card) { - super(card); - } + public PyreticRitual(final PyreticRitual card) { + super(card); + } - @Override - public PyreticRitual copy() { - return new PyreticRitual(this); - } + @Override + public PyreticRitual copy() { + return new PyreticRitual(this); + } } diff --git a/Mage.Sets/src/mage/sets/magic2011/Pyroclasm.java b/Mage.Sets/src/mage/sets/magic2011/Pyroclasm.java index 1a72ea2875..2384cc2eb0 100644 --- a/Mage.Sets/src/mage/sets/magic2011/Pyroclasm.java +++ b/Mage.Sets/src/mage/sets/magic2011/Pyroclasm.java @@ -36,19 +36,19 @@ import java.util.UUID; */ public class Pyroclasm extends mage.sets.tenth.Pyroclasm { - public Pyroclasm(UUID ownerId) { - super(ownerId); - this.cardNumber = 154; - this.expansionSetCode = "M11"; - } + public Pyroclasm(UUID ownerId) { + super(ownerId); + this.cardNumber = 154; + this.expansionSetCode = "M11"; + } - public Pyroclasm(final Pyroclasm card) { - super(card); - } + public Pyroclasm(final Pyroclasm card) { + super(card); + } - @Override - public Pyroclasm copy() { - return new Pyroclasm(this); - } + @Override + public Pyroclasm copy() { + return new Pyroclasm(this); + } } \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/magic2011/QuagSickness.java b/Mage.Sets/src/mage/sets/magic2011/QuagSickness.java index 2154799007..2bf71153b9 100644 --- a/Mage.Sets/src/mage/sets/magic2011/QuagSickness.java +++ b/Mage.Sets/src/mage/sets/magic2011/QuagSickness.java @@ -58,28 +58,28 @@ public class QuagSickness extends CardImpl { filter.setTargetController(TargetController.YOU); } - public QuagSickness(UUID ownerId) { - super(ownerId, 111, "Quag Sickness", Rarity.COMMON, new CardType[]{CardType.ENCHANTMENT}, "{2}{B}"); - this.expansionSetCode = "M11"; - this.color.setBlack(true); - this.subtype.add("Aura"); + public QuagSickness(UUID ownerId) { + super(ownerId, 111, "Quag Sickness", Rarity.COMMON, new CardType[]{CardType.ENCHANTMENT}, "{2}{B}"); + this.expansionSetCode = "M11"; + this.color.setBlack(true); + this.subtype.add("Aura"); - TargetPermanent auraTarget = new TargetCreaturePermanent(); - this.getSpellAbility().addTarget(auraTarget); - this.getSpellAbility().addEffect(new AttachEffect(Outcome.Detriment)); - this.addAbility(new EnchantAbility(auraTarget.getTargetName())); + TargetPermanent auraTarget = new TargetCreaturePermanent(); + this.getSpellAbility().addTarget(auraTarget); + this.getSpellAbility().addEffect(new AttachEffect(Outcome.Detriment)); + this.addAbility(new EnchantAbility(auraTarget.getTargetName())); PermanentsOnBattlefieldCount amount = new PermanentsOnBattlefieldCount(filter, -1); - this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostEnchantedEffect(amount, amount, Duration.WhileOnBattlefield))); + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostEnchantedEffect(amount, amount, Duration.WhileOnBattlefield))); - } + } - public QuagSickness(final QuagSickness card) { - super(card); - } + public QuagSickness(final QuagSickness card) { + super(card); + } - @Override - public QuagSickness copy() { - return new QuagSickness(this); - } + @Override + public QuagSickness copy() { + return new QuagSickness(this); + } } diff --git a/Mage.Sets/src/mage/sets/magic2011/ReassemblingSkeleton.java b/Mage.Sets/src/mage/sets/magic2011/ReassemblingSkeleton.java index 7541e949cb..0de1be7fee 100644 --- a/Mage.Sets/src/mage/sets/magic2011/ReassemblingSkeleton.java +++ b/Mage.Sets/src/mage/sets/magic2011/ReassemblingSkeleton.java @@ -44,25 +44,25 @@ import mage.cards.CardImpl; */ public class ReassemblingSkeleton extends CardImpl { - public ReassemblingSkeleton(UUID ownerId) { - super(ownerId, 112, "Reassembling Skeleton", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{1}{B}"); - this.expansionSetCode = "M11"; - this.subtype.add("Skeleton"); - this.subtype.add("Warrior"); - this.color.setBlack(true); - this.power = new MageInt(1); - this.toughness = new MageInt(1); + public ReassemblingSkeleton(UUID ownerId) { + super(ownerId, 112, "Reassembling Skeleton", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{1}{B}"); + this.expansionSetCode = "M11"; + this.subtype.add("Skeleton"); + this.subtype.add("Warrior"); + this.color.setBlack(true); + this.power = new MageInt(1); + this.toughness = new MageInt(1); - this.addAbility(new SimpleActivatedAbility(Zone.GRAVEYARD, new ReturnSourceFromGraveyardToBattlefieldEffect(true), new ManaCostsImpl("{1}{B}"))); - } + this.addAbility(new SimpleActivatedAbility(Zone.GRAVEYARD, new ReturnSourceFromGraveyardToBattlefieldEffect(true), new ManaCostsImpl("{1}{B}"))); + } - public ReassemblingSkeleton(final ReassemblingSkeleton card) { - super(card); - } + public ReassemblingSkeleton(final ReassemblingSkeleton card) { + super(card); + } - @Override - public ReassemblingSkeleton copy() { - return new ReassemblingSkeleton(this); - } + @Override + public ReassemblingSkeleton copy() { + return new ReassemblingSkeleton(this); + } } diff --git a/Mage.Sets/src/mage/sets/magic2011/Redirect.java b/Mage.Sets/src/mage/sets/magic2011/Redirect.java index a087179c21..018e6ecaa0 100644 --- a/Mage.Sets/src/mage/sets/magic2011/Redirect.java +++ b/Mage.Sets/src/mage/sets/magic2011/Redirect.java @@ -41,20 +41,20 @@ import mage.target.TargetSpell; */ public class Redirect extends CardImpl { - public Redirect(UUID ownerId) { - super(ownerId, 71, "Redirect", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{U}{U}"); - this.expansionSetCode = "M11"; - this.color.setBlue(true); - this.getSpellAbility().addTarget(new TargetSpell()); - this.getSpellAbility().addEffect(new ChooseNewTargetsTargetEffect()); - } + public Redirect(UUID ownerId) { + super(ownerId, 71, "Redirect", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{U}{U}"); + this.expansionSetCode = "M11"; + this.color.setBlue(true); + this.getSpellAbility().addTarget(new TargetSpell()); + this.getSpellAbility().addEffect(new ChooseNewTargetsTargetEffect()); + } - public Redirect(final Redirect card) { - super(card); - } + public Redirect(final Redirect card) { + super(card); + } - @Override - public Redirect copy() { - return new Redirect(this); - } + @Override + public Redirect copy() { + return new Redirect(this); + } } diff --git a/Mage.Sets/src/mage/sets/magic2011/RelentlessRats.java b/Mage.Sets/src/mage/sets/magic2011/RelentlessRats.java index 6547bac7a1..1ca2b839b9 100644 --- a/Mage.Sets/src/mage/sets/magic2011/RelentlessRats.java +++ b/Mage.Sets/src/mage/sets/magic2011/RelentlessRats.java @@ -36,19 +36,19 @@ import java.util.UUID; */ public class RelentlessRats extends mage.sets.tenth.RelentlessRats { - public RelentlessRats(UUID ownerId) { - super(ownerId); - this.cardNumber = 113; - this.expansionSetCode = "M11"; - } + public RelentlessRats(UUID ownerId) { + super(ownerId); + this.cardNumber = 113; + this.expansionSetCode = "M11"; + } - public RelentlessRats(final RelentlessRats card) { - super(card); - } + public RelentlessRats(final RelentlessRats card) { + super(card); + } - @Override - public RelentlessRats copy() { - return new RelentlessRats(this); - } + @Override + public RelentlessRats copy() { + return new RelentlessRats(this); + } } \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/magic2011/Reverberate.java b/Mage.Sets/src/mage/sets/magic2011/Reverberate.java index 0f9c661621..2c4513b51d 100644 --- a/Mage.Sets/src/mage/sets/magic2011/Reverberate.java +++ b/Mage.Sets/src/mage/sets/magic2011/Reverberate.java @@ -42,29 +42,29 @@ import mage.target.TargetSpell; * @author BetaSteward_at_googlemail.com */ public class Reverberate extends CardImpl { - - private static final FilterSpell filter = new FilterSpell(); - - static { - filter.getCardType().add(CardType.INSTANT); - filter.getCardType().add(CardType.SORCERY); - filter.setScopeCardType(ComparisonScope.Any); - } - public Reverberate(UUID ownerId) { - super(ownerId, 155, "Reverberate", Rarity.RARE, new CardType[]{CardType.INSTANT}, "{R}{R}"); - this.expansionSetCode = "M11"; - this.color.setRed(true); - this.getSpellAbility().addTarget(new TargetSpell(filter)); - this.getSpellAbility().addEffect(new CopyTargetSpellEffect()); - } + private static final FilterSpell filter = new FilterSpell(); - public Reverberate(final Reverberate card) { - super(card); - } + static { + filter.getCardType().add(CardType.INSTANT); + filter.getCardType().add(CardType.SORCERY); + filter.setScopeCardType(ComparisonScope.Any); + } - @Override - public Reverberate copy() { - return new Reverberate(this); - } + public Reverberate(UUID ownerId) { + super(ownerId, 155, "Reverberate", Rarity.RARE, new CardType[]{CardType.INSTANT}, "{R}{R}"); + this.expansionSetCode = "M11"; + this.color.setRed(true); + this.getSpellAbility().addTarget(new TargetSpell(filter)); + this.getSpellAbility().addEffect(new CopyTargetSpellEffect()); + } + + public Reverberate(final Reverberate card) { + super(card); + } + + @Override + public Reverberate copy() { + return new Reverberate(this); + } } diff --git a/Mage.Sets/src/mage/sets/magic2011/RiseFromTheGrave.java b/Mage.Sets/src/mage/sets/magic2011/RiseFromTheGrave.java index 518dae8220..464483cc3e 100644 --- a/Mage.Sets/src/mage/sets/magic2011/RiseFromTheGrave.java +++ b/Mage.Sets/src/mage/sets/magic2011/RiseFromTheGrave.java @@ -36,19 +36,19 @@ import java.util.UUID; */ public class RiseFromTheGrave extends mage.sets.magic2010.RiseFromTheGrave { - public RiseFromTheGrave(UUID ownerId) { - super(ownerId); - this.cardNumber = 114; - this.expansionSetCode = "M11"; - } + public RiseFromTheGrave(UUID ownerId) { + super(ownerId); + this.cardNumber = 114; + this.expansionSetCode = "M11"; + } - public RiseFromTheGrave(final RiseFromTheGrave card) { - super(card); - } + public RiseFromTheGrave(final RiseFromTheGrave card) { + super(card); + } - @Override - public RiseFromTheGrave copy() { - return new RiseFromTheGrave(this); - } + @Override + public RiseFromTheGrave copy() { + return new RiseFromTheGrave(this); + } } \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/magic2011/RocEgg.java b/Mage.Sets/src/mage/sets/magic2011/RocEgg.java index a11030a9fc..5bb2478d86 100644 --- a/Mage.Sets/src/mage/sets/magic2011/RocEgg.java +++ b/Mage.Sets/src/mage/sets/magic2011/RocEgg.java @@ -45,39 +45,39 @@ import mage.game.permanent.token.Token; */ public class RocEgg extends CardImpl { - private static RocEggToken rocEggToken = new RocEggToken(); + private static RocEggToken rocEggToken = new RocEggToken(); - public RocEgg(UUID ownerId) { - super(ownerId, 25, "Roc Egg", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{2}{W}"); - this.expansionSetCode = "M11"; - this.subtype.add("Bird"); - this.color.setWhite(true); - this.power = new MageInt(0); - this.toughness = new MageInt(3); + public RocEgg(UUID ownerId) { + super(ownerId, 25, "Roc Egg", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{2}{W}"); + this.expansionSetCode = "M11"; + this.subtype.add("Bird"); + this.color.setWhite(true); + this.power = new MageInt(0); + this.toughness = new MageInt(3); - this.addAbility(DefenderAbility.getInstance()); - this.addAbility(new DiesTriggeredAbility(new CreateTokenEffect(rocEggToken, 1), false)); - } + this.addAbility(DefenderAbility.getInstance()); + this.addAbility(new DiesTriggeredAbility(new CreateTokenEffect(rocEggToken, 1), false)); + } - public RocEgg(final RocEgg card) { - super(card); - } + public RocEgg(final RocEgg card) { + super(card); + } - @Override - public RocEgg copy() { - return new RocEgg(this); - } + @Override + public RocEgg copy() { + return new RocEgg(this); + } } class RocEggToken extends Token { - public RocEggToken() { - super("Bird", "3/3 white Bird creature token with flying"); - cardType.add(CardType.CREATURE); - subtype.add("Bird"); - color.setWhite(true); - power = new MageInt(3); - toughness = new MageInt(3); - addAbility(FlyingAbility.getInstance()); - } + public RocEggToken() { + super("Bird", "3/3 white Bird creature token with flying"); + cardType.add(CardType.CREATURE); + subtype.add("Bird"); + color.setWhite(true); + power = new MageInt(3); + toughness = new MageInt(3); + addAbility(FlyingAbility.getInstance()); + } } diff --git a/Mage.Sets/src/mage/sets/magic2011/RootboundCrag.java b/Mage.Sets/src/mage/sets/magic2011/RootboundCrag.java index 116a0bde2f..109acd3671 100644 --- a/Mage.Sets/src/mage/sets/magic2011/RootboundCrag.java +++ b/Mage.Sets/src/mage/sets/magic2011/RootboundCrag.java @@ -36,19 +36,19 @@ import java.util.UUID; */ public class RootboundCrag extends mage.sets.magic2010.RootboundCrag { - public RootboundCrag(UUID ownerId) { - super(ownerId); - this.cardNumber = 227; - this.expansionSetCode = "M11"; - } + public RootboundCrag(UUID ownerId) { + super(ownerId); + this.cardNumber = 227; + this.expansionSetCode = "M11"; + } - public RootboundCrag(final RootboundCrag card) { - super(card); - } + public RootboundCrag(final RootboundCrag card) { + super(card); + } - @Override - public RootboundCrag copy() { - return new RootboundCrag(this); - } + @Override + public RootboundCrag copy() { + return new RootboundCrag(this); + } } \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/magic2011/RottingLegion.java b/Mage.Sets/src/mage/sets/magic2011/RottingLegion.java index 4d9b2d48e2..833c60e719 100644 --- a/Mage.Sets/src/mage/sets/magic2011/RottingLegion.java +++ b/Mage.Sets/src/mage/sets/magic2011/RottingLegion.java @@ -41,24 +41,24 @@ import mage.cards.CardImpl; */ public class RottingLegion extends CardImpl { - public RottingLegion(UUID ownerId) { - super(ownerId, 115, "Rotting Legion", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{4}{B}"); - this.expansionSetCode = "M11"; - this.subtype.add("Zombie"); - this.color.setBlack(true); - this.power = new MageInt(4); - this.toughness = new MageInt(5); + public RottingLegion(UUID ownerId) { + super(ownerId, 115, "Rotting Legion", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{4}{B}"); + this.expansionSetCode = "M11"; + this.subtype.add("Zombie"); + this.color.setBlack(true); + this.power = new MageInt(4); + this.toughness = new MageInt(5); - this.addAbility(new EntersBattlefieldTappedAbility()); - } + this.addAbility(new EntersBattlefieldTappedAbility()); + } - public RottingLegion(final RottingLegion card) { - super(card); - } + public RottingLegion(final RottingLegion card) { + super(card); + } - @Override - public RottingLegion copy() { - return new RottingLegion(this); - } + @Override + public RottingLegion copy() { + return new RottingLegion(this); + } } diff --git a/Mage.Sets/src/mage/sets/magic2011/RoyalAssassin.java b/Mage.Sets/src/mage/sets/magic2011/RoyalAssassin.java index 16489fd146..c7204eba6d 100644 --- a/Mage.Sets/src/mage/sets/magic2011/RoyalAssassin.java +++ b/Mage.Sets/src/mage/sets/magic2011/RoyalAssassin.java @@ -36,19 +36,19 @@ import java.util.UUID; */ public class RoyalAssassin extends mage.sets.tenth.RoyalAssassin { - public RoyalAssassin(UUID ownerId) { - super(ownerId); - this.cardNumber = 116; - this.expansionSetCode = "M11"; - } + public RoyalAssassin(UUID ownerId) { + super(ownerId); + this.cardNumber = 116; + this.expansionSetCode = "M11"; + } - public RoyalAssassin(final RoyalAssassin card) { - super(card); - } + public RoyalAssassin(final RoyalAssassin card) { + super(card); + } - @Override - public RoyalAssassin copy() { - return new RoyalAssassin(this); - } + @Override + public RoyalAssassin copy() { + return new RoyalAssassin(this); + } } \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/magic2011/RuneclawBear.java b/Mage.Sets/src/mage/sets/magic2011/RuneclawBear.java index 69fd02161e..20acf986d5 100644 --- a/Mage.Sets/src/mage/sets/magic2011/RuneclawBear.java +++ b/Mage.Sets/src/mage/sets/magic2011/RuneclawBear.java @@ -36,19 +36,19 @@ import java.util.UUID; */ public class RuneclawBear extends mage.sets.magic2010.RuneclawBear { - public RuneclawBear(UUID ownerId) { - super(ownerId); - this.cardNumber = 195; - this.expansionSetCode = "M11"; - } + public RuneclawBear(UUID ownerId) { + super(ownerId); + this.cardNumber = 195; + this.expansionSetCode = "M11"; + } - public RuneclawBear(final RuneclawBear card) { - super(card); - } + public RuneclawBear(final RuneclawBear card) { + super(card); + } - @Override - public RuneclawBear copy() { - return new RuneclawBear(this); - } + @Override + public RuneclawBear copy() { + return new RuneclawBear(this); + } } \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/magic2011/SacredWolf.java b/Mage.Sets/src/mage/sets/magic2011/SacredWolf.java index fa23baa414..c6f3d17e68 100644 --- a/Mage.Sets/src/mage/sets/magic2011/SacredWolf.java +++ b/Mage.Sets/src/mage/sets/magic2011/SacredWolf.java @@ -40,24 +40,24 @@ import mage.cards.CardImpl; * @author BetaSteward_at_googlemail.com */ public class SacredWolf extends CardImpl { - public SacredWolf(UUID ownerId) { - super(ownerId, 196, "Sacred Wolf", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{2}{G}"); - this.expansionSetCode = "M11"; - this.subtype.add("Wolf"); - this.color.setGreen(true); - this.power = new MageInt(3); - this.toughness = new MageInt(1); - this.addAbility(HexproofAbility.getInstance()); - } + public SacredWolf(UUID ownerId) { + super(ownerId, 196, "Sacred Wolf", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{2}{G}"); + this.expansionSetCode = "M11"; + this.subtype.add("Wolf"); + this.color.setGreen(true); + this.power = new MageInt(3); + this.toughness = new MageInt(1); + this.addAbility(HexproofAbility.getInstance()); + } - public SacredWolf(final SacredWolf card) { - super(card); - } + public SacredWolf(final SacredWolf card) { + super(card); + } - @Override - public SacredWolf copy() { - return new SacredWolf(this); - } + @Override + public SacredWolf copy() { + return new SacredWolf(this); + } } diff --git a/Mage.Sets/src/mage/sets/magic2011/SafePassage.java b/Mage.Sets/src/mage/sets/magic2011/SafePassage.java index a9e7477993..a5a463d68f 100644 --- a/Mage.Sets/src/mage/sets/magic2011/SafePassage.java +++ b/Mage.Sets/src/mage/sets/magic2011/SafePassage.java @@ -36,19 +36,19 @@ import java.util.UUID; */ public class SafePassage extends mage.sets.magic2010.SafePassage { - public SafePassage(UUID ownerId) { - super(ownerId); - this.cardNumber = 26; - this.expansionSetCode = "M11"; - } + public SafePassage(UUID ownerId) { + super(ownerId); + this.cardNumber = 26; + this.expansionSetCode = "M11"; + } - public SafePassage(final SafePassage card) { - super(card); - } + public SafePassage(final SafePassage card) { + super(card); + } - @Override - public SafePassage copy() { - return new SafePassage(this); - } + @Override + public SafePassage copy() { + return new SafePassage(this); + } } \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/magic2011/ScrollThief.java b/Mage.Sets/src/mage/sets/magic2011/ScrollThief.java index 228bc54697..c0d4598e01 100644 --- a/Mage.Sets/src/mage/sets/magic2011/ScrollThief.java +++ b/Mage.Sets/src/mage/sets/magic2011/ScrollThief.java @@ -42,25 +42,25 @@ import mage.cards.CardImpl; */ public class ScrollThief extends CardImpl { - public ScrollThief(UUID ownerId) { - super(ownerId, 72, "Scroll Thief", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{2}{U}"); - this.expansionSetCode = "M11"; - this.subtype.add("Merfolk"); - this.subtype.add("Rogue"); - this.color.setBlue(true); - this.power = new MageInt(1); - this.toughness = new MageInt(3); + public ScrollThief(UUID ownerId) { + super(ownerId, 72, "Scroll Thief", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{2}{U}"); + this.expansionSetCode = "M11"; + this.subtype.add("Merfolk"); + this.subtype.add("Rogue"); + this.color.setBlue(true); + this.power = new MageInt(1); + this.toughness = new MageInt(3); - this.addAbility(new DealsCombatDamageToAPlayerTriggeredAbility(new DrawCardControllerEffect(1), false)); - } + this.addAbility(new DealsCombatDamageToAPlayerTriggeredAbility(new DrawCardControllerEffect(1), false)); + } - public ScrollThief(final ScrollThief card) { - super(card); - } + public ScrollThief(final ScrollThief card) { + super(card); + } - @Override - public ScrollThief copy() { - return new ScrollThief(this); - } + @Override + public ScrollThief copy() { + return new ScrollThief(this); + } } diff --git a/Mage.Sets/src/mage/sets/magic2011/SerraAngel.java b/Mage.Sets/src/mage/sets/magic2011/SerraAngel.java index 474ddd4515..db53146f71 100644 --- a/Mage.Sets/src/mage/sets/magic2011/SerraAngel.java +++ b/Mage.Sets/src/mage/sets/magic2011/SerraAngel.java @@ -38,20 +38,20 @@ import java.util.UUID; */ public class SerraAngel extends mage.sets.tenth.SerraAngel { - public SerraAngel(UUID ownerId) { - super(ownerId); - this.rarity = Constants.Rarity.UNCOMMON; - this.cardNumber = 27; - this.expansionSetCode = "M11"; - } + public SerraAngel(UUID ownerId) { + super(ownerId); + this.rarity = Constants.Rarity.UNCOMMON; + this.cardNumber = 27; + this.expansionSetCode = "M11"; + } - public SerraAngel(final SerraAngel card) { - super(card); - } + public SerraAngel(final SerraAngel card) { + super(card); + } - @Override - public SerraAngel copy() { - return new SerraAngel(this); - } + @Override + public SerraAngel copy() { + return new SerraAngel(this); + } } \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/magic2011/SerraAscendant.java b/Mage.Sets/src/mage/sets/magic2011/SerraAscendant.java index e5278ddaea..5b0c03b048 100644 --- a/Mage.Sets/src/mage/sets/magic2011/SerraAscendant.java +++ b/Mage.Sets/src/mage/sets/magic2011/SerraAscendant.java @@ -53,79 +53,79 @@ import mage.players.Player; */ public class SerraAscendant extends CardImpl { - public SerraAscendant(UUID ownerId) { - super(ownerId, 28, "Serra Ascendant", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{W}"); - this.expansionSetCode = "M11"; - this.subtype.add("Human"); - this.subtype.add("Monk"); - this.color.setWhite(true); - this.power = new MageInt(1); - this.toughness = new MageInt(1); + public SerraAscendant(UUID ownerId) { + super(ownerId, 28, "Serra Ascendant", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{W}"); + this.expansionSetCode = "M11"; + this.subtype.add("Human"); + this.subtype.add("Monk"); + this.color.setWhite(true); + this.power = new MageInt(1); + this.toughness = new MageInt(1); - this.addAbility(LifelinkAbility.getInstance()); - this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new SerraAscendantEffect())); - } + this.addAbility(LifelinkAbility.getInstance()); + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new SerraAscendantEffect())); + } - public SerraAscendant(final SerraAscendant card) { - super(card); - } + public SerraAscendant(final SerraAscendant card) { + super(card); + } - @Override - public SerraAscendant copy() { - return new SerraAscendant(this); - } + @Override + public SerraAscendant copy() { + return new SerraAscendant(this); + } } class SerraAscendantEffect extends ContinuousEffectImpl { - public SerraAscendantEffect() { - super(Duration.WhileOnBattlefield, Outcome.BoostCreature); - staticText = "As long as you have 30 or more life, {this} gets +5/+5 and has flying"; - } + public SerraAscendantEffect() { + super(Duration.WhileOnBattlefield, Outcome.BoostCreature); + staticText = "As long as you have 30 or more life, {this} gets +5/+5 and has flying"; + } - public SerraAscendantEffect(final SerraAscendantEffect effect) { - super(effect); - } + public SerraAscendantEffect(final SerraAscendantEffect effect) { + super(effect); + } - @Override - public SerraAscendantEffect copy() { - return new SerraAscendantEffect(this); - } + @Override + public SerraAscendantEffect copy() { + return new SerraAscendantEffect(this); + } - @Override - public boolean apply(Layer layer, SubLayer sublayer, Ability source, Game game) { - Permanent creature = game.getPermanent(source.getSourceId()); - if (creature != null) { - Player player = game.getPlayer(creature.getControllerId()); - if (player != null && player.getLife() >= 30) { - switch (layer) { - case PTChangingEffects_7: - if (sublayer == SubLayer.ModifyPT_7c) { - creature.addPower(5); - creature.addToughness(5); - } - break; - case AbilityAddingRemovingEffects_6: - if (sublayer == SubLayer.NA) { - creature.addAbility(FlyingAbility.getInstance(), game); - } - break; - } - return true; - } - } - return false; - } + @Override + public boolean apply(Layer layer, SubLayer sublayer, Ability source, Game game) { + Permanent creature = game.getPermanent(source.getSourceId()); + if (creature != null) { + Player player = game.getPlayer(creature.getControllerId()); + if (player != null && player.getLife() >= 30) { + switch (layer) { + case PTChangingEffects_7: + if (sublayer == SubLayer.ModifyPT_7c) { + creature.addPower(5); + creature.addToughness(5); + } + break; + case AbilityAddingRemovingEffects_6: + if (sublayer == SubLayer.NA) { + creature.addAbility(FlyingAbility.getInstance(), game); + } + break; + } + return true; + } + } + return false; + } - @Override - public boolean apply(Game game, Ability source) { - return false; - } + @Override + public boolean apply(Game game, Ability source) { + return false; + } - @Override - public boolean hasLayer(Layer layer) { - return layer == Layer.AbilityAddingRemovingEffects_6 || layer == layer.PTChangingEffects_7; - } + @Override + public boolean hasLayer(Layer layer) { + return layer == Layer.AbilityAddingRemovingEffects_6 || layer == layer.PTChangingEffects_7; + } } \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/magic2011/ShivsEmbrace.java b/Mage.Sets/src/mage/sets/magic2011/ShivsEmbrace.java index e17afd8956..ee18570549 100644 --- a/Mage.Sets/src/mage/sets/magic2011/ShivsEmbrace.java +++ b/Mage.Sets/src/mage/sets/magic2011/ShivsEmbrace.java @@ -57,81 +57,81 @@ import mage.target.common.TargetCreaturePermanent; */ public class ShivsEmbrace extends CardImpl { - public ShivsEmbrace(UUID ownerId) { - super(ownerId, 156, "Shiv's Embrace", Rarity.UNCOMMON, new CardType[]{CardType.ENCHANTMENT}, "{2}{R}{R}"); - this.expansionSetCode = "M11"; - this.color.setRed(true); - this.subtype.add("Aura"); + public ShivsEmbrace(UUID ownerId) { + super(ownerId, 156, "Shiv's Embrace", Rarity.UNCOMMON, new CardType[]{CardType.ENCHANTMENT}, "{2}{R}{R}"); + this.expansionSetCode = "M11"; + this.color.setRed(true); + this.subtype.add("Aura"); - TargetPermanent auraTarget = new TargetCreaturePermanent(); - this.getSpellAbility().addTarget(auraTarget); - this.getSpellAbility().addEffect(new AttachEffect(Outcome.Detriment)); - Ability ability = new EnchantAbility(auraTarget.getTargetName()); - this.addAbility(ability); - this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new ShivsEmbraceEffect())); - this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new BoostEnchantedEffect(1, 0, Duration.EndOfTurn), new ManaCostsImpl("{R}"))); + TargetPermanent auraTarget = new TargetCreaturePermanent(); + this.getSpellAbility().addTarget(auraTarget); + this.getSpellAbility().addEffect(new AttachEffect(Outcome.Detriment)); + Ability ability = new EnchantAbility(auraTarget.getTargetName()); + this.addAbility(ability); + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new ShivsEmbraceEffect())); + this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new BoostEnchantedEffect(1, 0, Duration.EndOfTurn), new ManaCostsImpl("{R}"))); - } + } - public ShivsEmbrace(final ShivsEmbrace card) { - super(card); - } + public ShivsEmbrace(final ShivsEmbrace card) { + super(card); + } - @Override - public ShivsEmbrace copy() { - return new ShivsEmbrace(this); - } + @Override + public ShivsEmbrace copy() { + return new ShivsEmbrace(this); + } } class ShivsEmbraceEffect extends ContinuousEffectImpl { - public ShivsEmbraceEffect() { - super(Duration.WhileOnBattlefield, Outcome.Detriment); - staticText = "Enchanted creature gets +2/+2 and has flying"; - } + public ShivsEmbraceEffect() { + super(Duration.WhileOnBattlefield, Outcome.Detriment); + staticText = "Enchanted creature gets +2/+2 and has flying"; + } - public ShivsEmbraceEffect(final ShivsEmbraceEffect effect) { - super(effect); - } + public ShivsEmbraceEffect(final ShivsEmbraceEffect effect) { + super(effect); + } - @Override - public ShivsEmbraceEffect copy() { - return new ShivsEmbraceEffect(this); - } + @Override + public ShivsEmbraceEffect copy() { + return new ShivsEmbraceEffect(this); + } - @Override - public boolean apply(Layer layer, SubLayer sublayer, Ability source, Game game) { - Permanent enchantment = game.getPermanent(source.getSourceId()); - if (enchantment != null && enchantment.getAttachedTo() != null) { - Permanent creature = game.getPermanent(enchantment.getAttachedTo()); - if (creature != null) { - switch (layer) { - case PTChangingEffects_7: - if (sublayer == SubLayer.ModifyPT_7c) { - creature.addPower(2); - creature.addToughness(2); - } - break; - case AbilityAddingRemovingEffects_6: - if (sublayer == SubLayer.NA) { - creature.addAbility(FlyingAbility.getInstance(), game); - } - break; - } - return true; - } - } - return false; - } + @Override + public boolean apply(Layer layer, SubLayer sublayer, Ability source, Game game) { + Permanent enchantment = game.getPermanent(source.getSourceId()); + if (enchantment != null && enchantment.getAttachedTo() != null) { + Permanent creature = game.getPermanent(enchantment.getAttachedTo()); + if (creature != null) { + switch (layer) { + case PTChangingEffects_7: + if (sublayer == SubLayer.ModifyPT_7c) { + creature.addPower(2); + creature.addToughness(2); + } + break; + case AbilityAddingRemovingEffects_6: + if (sublayer == SubLayer.NA) { + creature.addAbility(FlyingAbility.getInstance(), game); + } + break; + } + return true; + } + } + return false; + } - @Override - public boolean apply(Game game, Ability source) { - return false; - } + @Override + public boolean apply(Game game, Ability source) { + return false; + } - @Override - public boolean hasLayer(Layer layer) { - return layer == Layer.AbilityAddingRemovingEffects_6 || layer == layer.PTChangingEffects_7; - } + @Override + public boolean hasLayer(Layer layer) { + return layer == Layer.AbilityAddingRemovingEffects_6 || layer == layer.PTChangingEffects_7; + } } \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/magic2011/SiegeMastodon.java b/Mage.Sets/src/mage/sets/magic2011/SiegeMastodon.java index c1401269f0..0980dd9d20 100644 --- a/Mage.Sets/src/mage/sets/magic2011/SiegeMastodon.java +++ b/Mage.Sets/src/mage/sets/magic2011/SiegeMastodon.java @@ -36,19 +36,19 @@ import java.util.UUID; */ public class SiegeMastodon extends mage.sets.magic2010.SiegeMastodon { - public SiegeMastodon(UUID ownerId) { - super(ownerId); - this.cardNumber = 29; - this.expansionSetCode = "M11"; - } + public SiegeMastodon(UUID ownerId) { + super(ownerId); + this.cardNumber = 29; + this.expansionSetCode = "M11"; + } - public SiegeMastodon(final SiegeMastodon card) { - super(card); - } + public SiegeMastodon(final SiegeMastodon card) { + super(card); + } - @Override - public SiegeMastodon copy() { - return new SiegeMastodon(this); - } + @Override + public SiegeMastodon copy() { + return new SiegeMastodon(this); + } } \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/magic2011/SignInBlood.java b/Mage.Sets/src/mage/sets/magic2011/SignInBlood.java index 33aa28b72b..79922befdf 100644 --- a/Mage.Sets/src/mage/sets/magic2011/SignInBlood.java +++ b/Mage.Sets/src/mage/sets/magic2011/SignInBlood.java @@ -36,19 +36,19 @@ import java.util.UUID; */ public class SignInBlood extends mage.sets.magic2010.SignInBlood { - public SignInBlood(UUID ownerId) { - super(ownerId); - this.cardNumber = 117; - this.expansionSetCode = "M11"; - } + public SignInBlood(UUID ownerId) { + super(ownerId); + this.cardNumber = 117; + this.expansionSetCode = "M11"; + } - public SignInBlood(final SignInBlood card) { - super(card); - } + public SignInBlood(final SignInBlood card) { + super(card); + } - @Override - public SignInBlood copy() { - return new SignInBlood(this); - } + @Override + public SignInBlood copy() { + return new SignInBlood(this); + } } \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/magic2011/Silence.java b/Mage.Sets/src/mage/sets/magic2011/Silence.java index 01ffa617e0..cad960b991 100644 --- a/Mage.Sets/src/mage/sets/magic2011/Silence.java +++ b/Mage.Sets/src/mage/sets/magic2011/Silence.java @@ -36,19 +36,19 @@ import java.util.UUID; */ public class Silence extends mage.sets.magic2010.Silence { - public Silence(UUID ownerId) { - super(ownerId); - this.cardNumber = 30; - this.expansionSetCode = "M11"; - } + public Silence(UUID ownerId) { + super(ownerId); + this.cardNumber = 30; + this.expansionSetCode = "M11"; + } - public Silence(final Silence card) { - super(card); - } + public Silence(final Silence card) { + super(card); + } - @Override - public Silence copy() { - return new Silence(this); - } + @Override + public Silence copy() { + return new Silence(this); + } } \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/magic2011/SilvercoatLion.java b/Mage.Sets/src/mage/sets/magic2011/SilvercoatLion.java index 600b42ec71..22e86568d1 100644 --- a/Mage.Sets/src/mage/sets/magic2011/SilvercoatLion.java +++ b/Mage.Sets/src/mage/sets/magic2011/SilvercoatLion.java @@ -36,19 +36,19 @@ import java.util.UUID; */ public class SilvercoatLion extends mage.sets.magic2010.SilvercoatLion { - public SilvercoatLion(UUID ownerId) { - super(ownerId); - this.cardNumber = 31; - this.expansionSetCode = "M11"; - } + public SilvercoatLion(UUID ownerId) { + super(ownerId); + this.cardNumber = 31; + this.expansionSetCode = "M11"; + } - public SilvercoatLion(final SilvercoatLion card) { - super(card); - } + public SilvercoatLion(final SilvercoatLion card) { + super(card); + } - @Override - public SilvercoatLion copy() { - return new SilvercoatLion(this); - } + @Override + public SilvercoatLion copy() { + return new SilvercoatLion(this); + } } \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/magic2011/Sleep.java b/Mage.Sets/src/mage/sets/magic2011/Sleep.java index 0e2a0bf663..4f24f5e817 100644 --- a/Mage.Sets/src/mage/sets/magic2011/Sleep.java +++ b/Mage.Sets/src/mage/sets/magic2011/Sleep.java @@ -36,19 +36,19 @@ import java.util.UUID; */ public class Sleep extends mage.sets.magic2010.Sleep { - public Sleep(UUID ownerId) { - super(ownerId); - this.cardNumber = 73; - this.expansionSetCode = "M11"; - } + public Sleep(UUID ownerId) { + super(ownerId); + this.cardNumber = 73; + this.expansionSetCode = "M11"; + } - public Sleep(final Sleep card) { - super(card); - } + public Sleep(final Sleep card) { + super(card); + } - @Override - public Sleep copy() { - return new Sleep(this); - } + @Override + public Sleep copy() { + return new Sleep(this); + } } \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/magic2011/SolemnOffering.java b/Mage.Sets/src/mage/sets/magic2011/SolemnOffering.java index a4dda44249..e0c50e28b6 100644 --- a/Mage.Sets/src/mage/sets/magic2011/SolemnOffering.java +++ b/Mage.Sets/src/mage/sets/magic2011/SolemnOffering.java @@ -36,19 +36,19 @@ import java.util.UUID; */ public class SolemnOffering extends mage.sets.magic2010.SolemnOffering { - public SolemnOffering(UUID ownerId) { - super(ownerId); - this.cardNumber = 32; - this.expansionSetCode = "M11"; - } + public SolemnOffering(UUID ownerId) { + super(ownerId); + this.cardNumber = 32; + this.expansionSetCode = "M11"; + } - public SolemnOffering(final SolemnOffering card) { - super(card); - } + public SolemnOffering(final SolemnOffering card) { + super(card); + } - @Override - public SolemnOffering copy() { - return new SolemnOffering(this); - } + @Override + public SolemnOffering copy() { + return new SolemnOffering(this); + } } \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/magic2011/SorcerersStrongbox.java b/Mage.Sets/src/mage/sets/magic2011/SorcerersStrongbox.java index 0e669304fc..6b786b4478 100644 --- a/Mage.Sets/src/mage/sets/magic2011/SorcerersStrongbox.java +++ b/Mage.Sets/src/mage/sets/magic2011/SorcerersStrongbox.java @@ -49,55 +49,55 @@ import mage.players.Player; */ public class SorcerersStrongbox extends CardImpl { - public SorcerersStrongbox(UUID ownerId) { - super(ownerId, 213, "Sorcerer's Strongbox", Rarity.UNCOMMON, new CardType[]{CardType.ARTIFACT}, "{4}"); - this.expansionSetCode = "M11"; + public SorcerersStrongbox(UUID ownerId) { + super(ownerId, 213, "Sorcerer's Strongbox", Rarity.UNCOMMON, new CardType[]{CardType.ARTIFACT}, "{4}"); + this.expansionSetCode = "M11"; Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new SorcerersStrongboxEffect(), new TapSourceCost()); ability.addManaCost(new GenericManaCost(2)); - this.addAbility(ability); - } + this.addAbility(ability); + } - public SorcerersStrongbox(final SorcerersStrongbox card) { - super(card); - } + public SorcerersStrongbox(final SorcerersStrongbox card) { + super(card); + } - @Override - public SorcerersStrongbox copy() { - return new SorcerersStrongbox(this); - } + @Override + public SorcerersStrongbox copy() { + return new SorcerersStrongbox(this); + } } class SorcerersStrongboxEffect extends OneShotEffect { - public SorcerersStrongboxEffect() { - super(Outcome.DrawCard); - staticText = "Flip a coin. If you win the flip, sacrifice {this} and draw three cards"; - } + public SorcerersStrongboxEffect() { + super(Outcome.DrawCard); + staticText = "Flip a coin. If you win the flip, sacrifice {this} and draw three cards"; + } - public SorcerersStrongboxEffect(final SorcerersStrongboxEffect effect) { - super(effect); - } + public SorcerersStrongboxEffect(final SorcerersStrongboxEffect effect) { + super(effect); + } - @Override - public boolean apply(Game game, Ability source) { - Player player = game.getPlayer(source.getControllerId()); - if (player != null) { - if (player.flipCoin(game)) { - Permanent perm = game.getPermanent(source.getSourceId()); - if (perm != null) { - perm.sacrifice(source.getId(), game); - } - player.drawCards(3, game); - return true; - } - } - return false; - } + @Override + public boolean apply(Game game, Ability source) { + Player player = game.getPlayer(source.getControllerId()); + if (player != null) { + if (player.flipCoin(game)) { + Permanent perm = game.getPermanent(source.getSourceId()); + if (perm != null) { + perm.sacrifice(source.getId(), game); + } + player.drawCards(3, game); + return true; + } + } + return false; + } - @Override - public SorcerersStrongboxEffect copy() { - return new SorcerersStrongboxEffect(this); - } + @Override + public SorcerersStrongboxEffect copy() { + return new SorcerersStrongboxEffect(this); + } } \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/magic2011/SpinedWurm.java b/Mage.Sets/src/mage/sets/magic2011/SpinedWurm.java index a0ef196c6a..94767eed5d 100644 --- a/Mage.Sets/src/mage/sets/magic2011/SpinedWurm.java +++ b/Mage.Sets/src/mage/sets/magic2011/SpinedWurm.java @@ -36,19 +36,19 @@ import java.util.UUID; */ public class SpinedWurm extends mage.sets.tenth.SpinedWurm { - public SpinedWurm(UUID ownerId) { - super(ownerId); - this.cardNumber = 197; - this.expansionSetCode = "M11"; - } + public SpinedWurm(UUID ownerId) { + super(ownerId); + this.cardNumber = 197; + this.expansionSetCode = "M11"; + } - public SpinedWurm(final SpinedWurm card) { - super(card); - } + public SpinedWurm(final SpinedWurm card) { + super(card); + } - @Override - public SpinedWurm copy() { - return new SpinedWurm(this); - } + @Override + public SpinedWurm copy() { + return new SpinedWurm(this); + } } \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/magic2011/SquadronHawk.java b/Mage.Sets/src/mage/sets/magic2011/SquadronHawk.java index 81fc4ab5ce..a33c28313c 100644 --- a/Mage.Sets/src/mage/sets/magic2011/SquadronHawk.java +++ b/Mage.Sets/src/mage/sets/magic2011/SquadronHawk.java @@ -45,32 +45,32 @@ import mage.target.common.TargetCardInLibrary; */ public class SquadronHawk extends CardImpl { - private static final FilterCard filter = new FilterCard("cards named Squadron Hawk"); + private static final FilterCard filter = new FilterCard("cards named Squadron Hawk"); - static { - filter.getName().add("Squadron Hawk"); - } + static { + filter.getName().add("Squadron Hawk"); + } - public SquadronHawk(UUID ownerId) { - super(ownerId, 33, "Squadron Hawk", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{1}{W}"); - this.expansionSetCode = "M11"; - this.subtype.add("Bird"); - this.color.setWhite(true); - this.power = new MageInt(1); - this.toughness = new MageInt(1); + public SquadronHawk(UUID ownerId) { + super(ownerId, 33, "Squadron Hawk", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{1}{W}"); + this.expansionSetCode = "M11"; + this.subtype.add("Bird"); + this.color.setWhite(true); + this.power = new MageInt(1); + this.toughness = new MageInt(1); - this.addAbility(FlyingAbility.getInstance()); - TargetCardInLibrary target = new TargetCardInLibrary(0, 3, filter); - this.addAbility(new EntersBattlefieldTriggeredAbility(new SearchLibraryRevealPutInHandEffect(target), true)); - } + this.addAbility(FlyingAbility.getInstance()); + TargetCardInLibrary target = new TargetCardInLibrary(0, 3, filter); + this.addAbility(new EntersBattlefieldTriggeredAbility(new SearchLibraryRevealPutInHandEffect(target), true)); + } - public SquadronHawk(final SquadronHawk card) { - super(card); - } + public SquadronHawk(final SquadronHawk card) { + super(card); + } - @Override - public SquadronHawk copy() { - return new SquadronHawk(this); - } + @Override + public SquadronHawk copy() { + return new SquadronHawk(this); + } } diff --git a/Mage.Sets/src/mage/sets/magic2011/StabbingPain.java b/Mage.Sets/src/mage/sets/magic2011/StabbingPain.java index 2a83c223b3..da40738e66 100644 --- a/Mage.Sets/src/mage/sets/magic2011/StabbingPain.java +++ b/Mage.Sets/src/mage/sets/magic2011/StabbingPain.java @@ -43,21 +43,21 @@ import mage.target.common.TargetCreaturePermanent; */ public class StabbingPain extends CardImpl { - public StabbingPain(UUID ownerId) { - super(ownerId, 118, "Stabbing Pain", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{B}"); - this.expansionSetCode = "M11"; - this.color.setBlack(true); - this.getSpellAbility().addTarget(new TargetCreaturePermanent()); - this.getSpellAbility().addEffect(new BoostTargetEffect(-1, -1, Duration.EndOfTurn)); - this.getSpellAbility().addEffect(new TapTargetEffect()); - } + public StabbingPain(UUID ownerId) { + super(ownerId, 118, "Stabbing Pain", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{B}"); + this.expansionSetCode = "M11"; + this.color.setBlack(true); + this.getSpellAbility().addTarget(new TargetCreaturePermanent()); + this.getSpellAbility().addEffect(new BoostTargetEffect(-1, -1, Duration.EndOfTurn)); + this.getSpellAbility().addEffect(new TapTargetEffect()); + } - public StabbingPain(final StabbingPain card) { - super(card); - } + public StabbingPain(final StabbingPain card) { + super(card); + } - @Override - public StabbingPain copy() { - return new StabbingPain(this); - } + @Override + public StabbingPain copy() { + return new StabbingPain(this); + } } diff --git a/Mage.Sets/src/mage/sets/magic2011/SteelOverseer.java b/Mage.Sets/src/mage/sets/magic2011/SteelOverseer.java index f0d6f064d1..41e2a0df7e 100644 --- a/Mage.Sets/src/mage/sets/magic2011/SteelOverseer.java +++ b/Mage.Sets/src/mage/sets/magic2011/SteelOverseer.java @@ -48,32 +48,32 @@ import mage.filter.FilterPermanent; */ public class SteelOverseer extends CardImpl { - private static final FilterPermanent filter = new FilterPermanent("artifact creature you control"); + private static final FilterPermanent filter = new FilterPermanent("artifact creature you control"); - static { - filter.getCardType().add(CardType.ARTIFACT); - filter.getCardType().add(CardType.CREATURE); - filter.setScopeCardType(ComparisonScope.All); + static { + filter.getCardType().add(CardType.ARTIFACT); + filter.getCardType().add(CardType.CREATURE); + filter.setScopeCardType(ComparisonScope.All); filter.setTargetController(TargetController.YOU); - } + } - public SteelOverseer(UUID ownerId) { - super(ownerId, 214, "Steel Overseer", Rarity.RARE, new CardType[]{CardType.ARTIFACT, CardType.CREATURE}, "{2}"); - this.expansionSetCode = "M11"; - this.subtype.add("Construct"); - this.power = new MageInt(1); - this.toughness = new MageInt(1); + public SteelOverseer(UUID ownerId) { + super(ownerId, 214, "Steel Overseer", Rarity.RARE, new CardType[]{CardType.ARTIFACT, CardType.CREATURE}, "{2}"); + this.expansionSetCode = "M11"; + this.subtype.add("Construct"); + this.power = new MageInt(1); + this.toughness = new MageInt(1); - this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new AddCountersAllEffect(CounterType.P1P1.createInstance(), filter), new TapSourceCost())); - } + this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new AddCountersAllEffect(CounterType.P1P1.createInstance(), filter), new TapSourceCost())); + } - public SteelOverseer(final SteelOverseer card) { - super(card); - } + public SteelOverseer(final SteelOverseer card) { + super(card); + } - @Override - public SteelOverseer copy() { - return new SteelOverseer(this); - } + @Override + public SteelOverseer copy() { + return new SteelOverseer(this); + } } diff --git a/Mage.Sets/src/mage/sets/magic2011/StoneGolem.java b/Mage.Sets/src/mage/sets/magic2011/StoneGolem.java index 3b990292c4..cead9c1789 100644 --- a/Mage.Sets/src/mage/sets/magic2011/StoneGolem.java +++ b/Mage.Sets/src/mage/sets/magic2011/StoneGolem.java @@ -40,22 +40,22 @@ import mage.cards.CardImpl; */ public class StoneGolem extends CardImpl { - public StoneGolem(UUID ownerId) { - super(ownerId, 215, "Stone Golem", Rarity.UNCOMMON, new CardType[]{CardType.ARTIFACT, CardType.CREATURE}, "{5}"); - this.expansionSetCode = "M11"; - this.subtype.add("Golem"); - this.power = new MageInt(4); - this.toughness = new MageInt(4); + public StoneGolem(UUID ownerId) { + super(ownerId, 215, "Stone Golem", Rarity.UNCOMMON, new CardType[]{CardType.ARTIFACT, CardType.CREATURE}, "{5}"); + this.expansionSetCode = "M11"; + this.subtype.add("Golem"); + this.power = new MageInt(4); + this.toughness = new MageInt(4); - } + } - public StoneGolem(final StoneGolem card) { - super(card); - } + public StoneGolem(final StoneGolem card) { + super(card); + } - @Override - public StoneGolem copy() { - return new StoneGolem(this); - } + @Override + public StoneGolem copy() { + return new StoneGolem(this); + } } diff --git a/Mage.Sets/src/mage/sets/magic2011/StormfrontPegasus.java b/Mage.Sets/src/mage/sets/magic2011/StormfrontPegasus.java index cce400cd2b..e20bf2efde 100644 --- a/Mage.Sets/src/mage/sets/magic2011/StormfrontPegasus.java +++ b/Mage.Sets/src/mage/sets/magic2011/StormfrontPegasus.java @@ -36,19 +36,19 @@ import java.util.UUID; */ public class StormfrontPegasus extends mage.sets.magic2010.StormfrontPegasus { - public StormfrontPegasus(UUID ownerId) { - super(ownerId); - this.cardNumber = 34; - this.expansionSetCode = "M11"; - } + public StormfrontPegasus(UUID ownerId) { + super(ownerId); + this.cardNumber = 34; + this.expansionSetCode = "M11"; + } - public StormfrontPegasus(final StormfrontPegasus card) { - super(card); - } + public StormfrontPegasus(final StormfrontPegasus card) { + super(card); + } - @Override - public StormfrontPegasus copy() { - return new StormfrontPegasus(this); - } + @Override + public StormfrontPegasus copy() { + return new StormfrontPegasus(this); + } } \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/magic2011/StormtideLeviathan.java b/Mage.Sets/src/mage/sets/magic2011/StormtideLeviathan.java index af6976ab6c..980edd1e8f 100644 --- a/Mage.Sets/src/mage/sets/magic2011/StormtideLeviathan.java +++ b/Mage.Sets/src/mage/sets/magic2011/StormtideLeviathan.java @@ -57,100 +57,100 @@ import mage.players.Player; */ public class StormtideLeviathan extends CardImpl { - public StormtideLeviathan(UUID ownerId) { - super(ownerId, 74, "Stormtide Leviathan", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{5}{U}{U}{U}"); - this.expansionSetCode = "M11"; - this.subtype.add("Leviathan"); - this.color.setBlue(true); - this.power = new MageInt(8); - this.toughness = new MageInt(8); + public StormtideLeviathan(UUID ownerId) { + super(ownerId, 74, "Stormtide Leviathan", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{5}{U}{U}{U}"); + this.expansionSetCode = "M11"; + this.subtype.add("Leviathan"); + this.color.setBlue(true); + this.power = new MageInt(8); + this.toughness = new MageInt(8); - this.addAbility(new IslandwalkAbility()); - this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new StormtideLeviathanEffect())); - this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new StormtideLeviathanEffect2())); + this.addAbility(new IslandwalkAbility()); + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new StormtideLeviathanEffect())); + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new StormtideLeviathanEffect2())); - } + } - public StormtideLeviathan(final StormtideLeviathan card) { - super(card); - } + public StormtideLeviathan(final StormtideLeviathan card) { + super(card); + } - @Override - public StormtideLeviathan copy() { - return new StormtideLeviathan(this); - } + @Override + public StormtideLeviathan copy() { + return new StormtideLeviathan(this); + } } class StormtideLeviathanEffect extends ContinuousEffectImpl { - public StormtideLeviathanEffect() { - super(Duration.WhileOnBattlefield, Layer.TypeChangingEffects_4, SubLayer.NA, Outcome.Detriment); - staticText = "All lands are Islands in addition to their other types"; - } + public StormtideLeviathanEffect() { + super(Duration.WhileOnBattlefield, Layer.TypeChangingEffects_4, SubLayer.NA, Outcome.Detriment); + staticText = "All lands are Islands in addition to their other types"; + } - public StormtideLeviathanEffect(final StormtideLeviathanEffect effect) { - super(effect); - } + public StormtideLeviathanEffect(final StormtideLeviathanEffect effect) { + super(effect); + } - @Override - public StormtideLeviathanEffect copy() { - return new StormtideLeviathanEffect(this); - } + @Override + public StormtideLeviathanEffect copy() { + return new StormtideLeviathanEffect(this); + } - @Override - public boolean apply(Game game, Ability source) { - for (Permanent permanent: game.getBattlefield().getActivePermanents(new FilterLandPermanent(), source.getControllerId(), game)) { - if (!permanent.hasSubtype("Island")) - permanent.getSubtype().add("Island"); - } - return true; - } + @Override + public boolean apply(Game game, Ability source) { + for (Permanent permanent: game.getBattlefield().getActivePermanents(new FilterLandPermanent(), source.getControllerId(), game)) { + if (!permanent.hasSubtype("Island")) + permanent.getSubtype().add("Island"); + } + return true; + } } class StormtideLeviathanEffect2 extends ReplacementEffectImpl { - private static IslandwalkAbility islandwalk = new IslandwalkAbility(); + private static IslandwalkAbility islandwalk = new IslandwalkAbility(); - public StormtideLeviathanEffect2() { - super(Duration.WhileOnBattlefield, Outcome.Detriment); - staticText = "Creatures without flying or islandwalk can't attack"; - } + public StormtideLeviathanEffect2() { + super(Duration.WhileOnBattlefield, Outcome.Detriment); + staticText = "Creatures without flying or islandwalk can't attack"; + } - public StormtideLeviathanEffect2(final StormtideLeviathanEffect2 effect) { - super(effect); - } + public StormtideLeviathanEffect2(final StormtideLeviathanEffect2 effect) { + super(effect); + } - @Override - public boolean apply(Game game, Ability source) { - return true; - } + @Override + public boolean apply(Game game, Ability source) { + return true; + } - @Override - public StormtideLeviathanEffect2 copy() { - return new StormtideLeviathanEffect2(this); - } + @Override + public StormtideLeviathanEffect2 copy() { + return new StormtideLeviathanEffect2(this); + } - @Override - public boolean replaceEvent(GameEvent event, Ability source, Game game) { - return true; - } + @Override + public boolean replaceEvent(GameEvent event, Ability source, Game game) { + return true; + } - @Override - public boolean applies(GameEvent event, Ability source, Game game) { - if (event.getType() == EventType.DECLARE_ATTACKER) { - Permanent permanent = game.getPermanent(event.getSourceId()); - if (permanent != null) { - Player player = game.getPlayer(source.getControllerId()); - if (player.getInRange().contains(permanent.getControllerId())) { - if (!(permanent.getAbilities().containsKey(FlyingAbility.getInstance().getId()) || - permanent.getAbilities().contains(islandwalk))) - return true; - } - } - } - return false; - } + @Override + public boolean applies(GameEvent event, Ability source, Game game) { + if (event.getType() == EventType.DECLARE_ATTACKER) { + Permanent permanent = game.getPermanent(event.getSourceId()); + if (permanent != null) { + Player player = game.getPlayer(source.getControllerId()); + if (player.getInRange().contains(permanent.getControllerId())) { + if (!(permanent.getAbilities().containsKey(FlyingAbility.getInstance().getId()) || + permanent.getAbilities().contains(islandwalk))) + return true; + } + } + } + return false; + } } diff --git a/Mage.Sets/src/mage/sets/magic2011/SunTitan.java b/Mage.Sets/src/mage/sets/magic2011/SunTitan.java index c09ea60302..4923d404f0 100644 --- a/Mage.Sets/src/mage/sets/magic2011/SunTitan.java +++ b/Mage.Sets/src/mage/sets/magic2011/SunTitan.java @@ -52,76 +52,76 @@ import mage.target.common.TargetCardInYourGraveyard; */ public class SunTitan extends CardImpl { - public SunTitan(UUID ownerId) { - super(ownerId, 35, "Sun Titan", Rarity.MYTHIC, new CardType[]{CardType.CREATURE}, "{4}{W}{W}"); - this.expansionSetCode = "M11"; - this.subtype.add("Giant"); - this.color.setWhite(true); - this.power = new MageInt(6); - this.toughness = new MageInt(6); + public SunTitan(UUID ownerId) { + super(ownerId, 35, "Sun Titan", Rarity.MYTHIC, new CardType[]{CardType.CREATURE}, "{4}{W}{W}"); + this.expansionSetCode = "M11"; + this.subtype.add("Giant"); + this.color.setWhite(true); + this.power = new MageInt(6); + this.toughness = new MageInt(6); - this.addAbility(VigilanceAbility.getInstance()); - this.addAbility(new SunTitanAbility()); - } + this.addAbility(VigilanceAbility.getInstance()); + this.addAbility(new SunTitanAbility()); + } - public SunTitan(final SunTitan card) { - super(card); - } + public SunTitan(final SunTitan card) { + super(card); + } - @Override - public SunTitan copy() { - return new SunTitan(this); - } + @Override + public SunTitan copy() { + return new SunTitan(this); + } } class SunTitanAbility extends TriggeredAbilityImpl { - private static final FilterCard filter = new FilterCard("permanent card with converted mana cost 3 or less from your graveyard"); + private static final FilterCard filter = new FilterCard("permanent card with converted mana cost 3 or less from your graveyard"); - static { - filter.getCardType().add(CardType.ARTIFACT); - filter.getCardType().add(CardType.CREATURE); - filter.getCardType().add(CardType.ENCHANTMENT); - filter.getCardType().add(CardType.LAND); - filter.getCardType().add(CardType.PLANESWALKER); - filter.setScopeCardType(ComparisonScope.Any); - filter.setConvertedManaCost(4); - filter.setConvertedManaCostComparison(ComparisonType.LessThan); - } + static { + filter.getCardType().add(CardType.ARTIFACT); + filter.getCardType().add(CardType.CREATURE); + filter.getCardType().add(CardType.ENCHANTMENT); + filter.getCardType().add(CardType.LAND); + filter.getCardType().add(CardType.PLANESWALKER); + filter.setScopeCardType(ComparisonScope.Any); + filter.setConvertedManaCost(4); + filter.setConvertedManaCostComparison(ComparisonType.LessThan); + } - public SunTitanAbility() { - super(Zone.BATTLEFIELD, null, true); - this.addTarget(new TargetCardInYourGraveyard(filter)); - this.addEffect(new ReturnFromGraveyardToBattlefieldTargetEffect()); - } + public SunTitanAbility() { + super(Zone.BATTLEFIELD, null, true); + this.addTarget(new TargetCardInYourGraveyard(filter)); + this.addEffect(new ReturnFromGraveyardToBattlefieldTargetEffect()); + } - public SunTitanAbility(final SunTitanAbility ability) { - super(ability); - } + public SunTitanAbility(final SunTitanAbility ability) { + super(ability); + } - @Override - public SunTitanAbility copy() { - return new SunTitanAbility(this); - } + @Override + public SunTitanAbility copy() { + return new SunTitanAbility(this); + } - @Override - public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == EventType.ATTACKER_DECLARED && event.getSourceId().equals(this.getSourceId())) { - return true; - } - if (event.getType() == EventType.ZONE_CHANGE && event.getTargetId().equals(this.getSourceId()) ) { - ZoneChangeEvent zEvent = (ZoneChangeEvent)event; - if (zEvent.getToZone() == Zone.BATTLEFIELD) { - return true; - } - } - return false; - } + @Override + public boolean checkTrigger(GameEvent event, Game game) { + if (event.getType() == EventType.ATTACKER_DECLARED && event.getSourceId().equals(this.getSourceId())) { + return true; + } + if (event.getType() == EventType.ZONE_CHANGE && event.getTargetId().equals(this.getSourceId()) ) { + ZoneChangeEvent zEvent = (ZoneChangeEvent)event; + if (zEvent.getToZone() == Zone.BATTLEFIELD) { + return true; + } + } + return false; + } - @Override - public String getRule() { - return "Whenever {this} enters the battlefield or attacks, you may return target permanent card with converted mana cost 3 or less from your graveyard to the battlefield."; - } + @Override + public String getRule() { + return "Whenever {this} enters the battlefield or attacks, you may return target permanent card with converted mana cost 3 or less from your graveyard to the battlefield."; + } } diff --git a/Mage.Sets/src/mage/sets/magic2011/SunpetalGrove.java b/Mage.Sets/src/mage/sets/magic2011/SunpetalGrove.java index 4820c009a6..ebafa61723 100644 --- a/Mage.Sets/src/mage/sets/magic2011/SunpetalGrove.java +++ b/Mage.Sets/src/mage/sets/magic2011/SunpetalGrove.java @@ -36,19 +36,19 @@ import java.util.UUID; */ public class SunpetalGrove extends mage.sets.magic2010.SunpetalGrove { - public SunpetalGrove(UUID ownerId) { - super(ownerId); - this.cardNumber = 228; - this.expansionSetCode = "M11"; - } + public SunpetalGrove(UUID ownerId) { + super(ownerId); + this.cardNumber = 228; + this.expansionSetCode = "M11"; + } - public SunpetalGrove(final SunpetalGrove card) { - super(card); - } + public SunpetalGrove(final SunpetalGrove card) { + super(card); + } - @Override - public SunpetalGrove copy() { - return new SunpetalGrove(this); - } + @Override + public SunpetalGrove copy() { + return new SunpetalGrove(this); + } } \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/magic2011/Swamp1.java b/Mage.Sets/src/mage/sets/magic2011/Swamp1.java index 8676bde5a6..c47fbee04b 100644 --- a/Mage.Sets/src/mage/sets/magic2011/Swamp1.java +++ b/Mage.Sets/src/mage/sets/magic2011/Swamp1.java @@ -36,18 +36,18 @@ import java.util.UUID; */ public class Swamp1 extends mage.cards.basiclands.Swamp { - public Swamp1(UUID ownerId) { - super(ownerId, 238); - this.expansionSetCode = "M11"; - } + public Swamp1(UUID ownerId) { + super(ownerId, 238); + this.expansionSetCode = "M11"; + } - public Swamp1(final Swamp1 card) { - super(card); - } + public Swamp1(final Swamp1 card) { + super(card); + } - @Override - public Swamp1 copy() { - return new Swamp1(this); - } + @Override + public Swamp1 copy() { + return new Swamp1(this); + } } \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/magic2011/Swamp2.java b/Mage.Sets/src/mage/sets/magic2011/Swamp2.java index 49600cce3b..771ffb21b1 100644 --- a/Mage.Sets/src/mage/sets/magic2011/Swamp2.java +++ b/Mage.Sets/src/mage/sets/magic2011/Swamp2.java @@ -36,18 +36,18 @@ import java.util.UUID; */ public class Swamp2 extends mage.cards.basiclands.Swamp { - public Swamp2(UUID ownerId) { - super(ownerId, 239); - this.expansionSetCode = "M11"; - } + public Swamp2(UUID ownerId) { + super(ownerId, 239); + this.expansionSetCode = "M11"; + } - public Swamp2(final Swamp2 card) { - super(card); - } + public Swamp2(final Swamp2 card) { + super(card); + } - @Override - public Swamp2 copy() { - return new Swamp2(this); - } + @Override + public Swamp2 copy() { + return new Swamp2(this); + } } \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/magic2011/Swamp3.java b/Mage.Sets/src/mage/sets/magic2011/Swamp3.java index 2e7339fc9c..e697477ed1 100644 --- a/Mage.Sets/src/mage/sets/magic2011/Swamp3.java +++ b/Mage.Sets/src/mage/sets/magic2011/Swamp3.java @@ -36,18 +36,18 @@ import java.util.UUID; */ public class Swamp3 extends mage.cards.basiclands.Swamp { - public Swamp3(UUID ownerId) { - super(ownerId, 240); - this.expansionSetCode = "M11"; - } + public Swamp3(UUID ownerId) { + super(ownerId, 240); + this.expansionSetCode = "M11"; + } - public Swamp3(final Swamp3 card) { - super(card); - } + public Swamp3(final Swamp3 card) { + super(card); + } - @Override - public Swamp3 copy() { - return new Swamp3(this); - } + @Override + public Swamp3 copy() { + return new Swamp3(this); + } } \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/magic2011/Swamp4.java b/Mage.Sets/src/mage/sets/magic2011/Swamp4.java index 392a5b71a6..30678227e3 100644 --- a/Mage.Sets/src/mage/sets/magic2011/Swamp4.java +++ b/Mage.Sets/src/mage/sets/magic2011/Swamp4.java @@ -36,18 +36,18 @@ import java.util.UUID; */ public class Swamp4 extends mage.cards.basiclands.Swamp { - public Swamp4(UUID ownerId) { - super(ownerId, 241); - this.expansionSetCode = "M11"; - } + public Swamp4(UUID ownerId) { + super(ownerId, 241); + this.expansionSetCode = "M11"; + } - public Swamp4(final Swamp4 card) { - super(card); - } + public Swamp4(final Swamp4 card) { + super(card); + } - @Override - public Swamp4 copy() { - return new Swamp4(this); - } + @Override + public Swamp4 copy() { + return new Swamp4(this); + } } diff --git a/Mage.Sets/src/mage/sets/magic2011/SwordOfVengeance.java b/Mage.Sets/src/mage/sets/magic2011/SwordOfVengeance.java index ff323a1aca..5980be634c 100644 --- a/Mage.Sets/src/mage/sets/magic2011/SwordOfVengeance.java +++ b/Mage.Sets/src/mage/sets/magic2011/SwordOfVengeance.java @@ -53,25 +53,25 @@ import mage.cards.CardImpl; */ public class SwordOfVengeance extends CardImpl { - public SwordOfVengeance(UUID ownerId) { - super(ownerId, 216, "Sword of Vengeance", Rarity.RARE, new CardType[]{CardType.ARTIFACT}, "{3}"); - this.expansionSetCode = "M11"; - this.subtype.add("Equipment"); - this.addAbility(new EquipAbility(Outcome.AddAbility, new GenericManaCost(3))); - this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityAttachedEffect(FirstStrikeAbility.getInstance(), AttachmentType.EQUIPMENT))); - this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityAttachedEffect(TrampleAbility.getInstance(), AttachmentType.EQUIPMENT))); - this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityAttachedEffect(VigilanceAbility.getInstance(), AttachmentType.EQUIPMENT))); - this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityAttachedEffect(HasteAbility.getInstance(), AttachmentType.EQUIPMENT))); - this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostEquippedEffect(2, 0))); - } + public SwordOfVengeance(UUID ownerId) { + super(ownerId, 216, "Sword of Vengeance", Rarity.RARE, new CardType[]{CardType.ARTIFACT}, "{3}"); + this.expansionSetCode = "M11"; + this.subtype.add("Equipment"); + this.addAbility(new EquipAbility(Outcome.AddAbility, new GenericManaCost(3))); + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityAttachedEffect(FirstStrikeAbility.getInstance(), AttachmentType.EQUIPMENT))); + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityAttachedEffect(TrampleAbility.getInstance(), AttachmentType.EQUIPMENT))); + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityAttachedEffect(VigilanceAbility.getInstance(), AttachmentType.EQUIPMENT))); + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityAttachedEffect(HasteAbility.getInstance(), AttachmentType.EQUIPMENT))); + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostEquippedEffect(2, 0))); + } - protected SwordOfVengeance(SwordOfVengeance me) { - super(me); - } + protected SwordOfVengeance(SwordOfVengeance me) { + super(me); + } - @Override - public SwordOfVengeance copy() { - return new SwordOfVengeance(this); - } + @Override + public SwordOfVengeance copy() { + return new SwordOfVengeance(this); + } } diff --git a/Mage.Sets/src/mage/sets/magic2011/SylvanRanger.java b/Mage.Sets/src/mage/sets/magic2011/SylvanRanger.java index 938962d61f..d8f6db1dd0 100644 --- a/Mage.Sets/src/mage/sets/magic2011/SylvanRanger.java +++ b/Mage.Sets/src/mage/sets/magic2011/SylvanRanger.java @@ -44,28 +44,28 @@ import mage.target.common.TargetCardInLibrary; */ public class SylvanRanger extends CardImpl { - private static final FilterBasicLandCard filter = new FilterBasicLandCard(); + private static final FilterBasicLandCard filter = new FilterBasicLandCard(); - public SylvanRanger(UUID ownerId) { - super(ownerId, 198, "Sylvan Ranger", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{1}{G}"); - this.expansionSetCode = "M11"; - this.subtype.add("Elf"); - this.subtype.add("Scout"); - this.color.setGreen(true); - this.power = new MageInt(1); - this.toughness = new MageInt(1); + public SylvanRanger(UUID ownerId) { + super(ownerId, 198, "Sylvan Ranger", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{1}{G}"); + this.expansionSetCode = "M11"; + this.subtype.add("Elf"); + this.subtype.add("Scout"); + this.color.setGreen(true); + this.power = new MageInt(1); + this.toughness = new MageInt(1); - TargetCardInLibrary target = new TargetCardInLibrary(filter); - this.addAbility(new EntersBattlefieldTriggeredAbility(new SearchLibraryRevealPutInHandEffect(target))); - } + TargetCardInLibrary target = new TargetCardInLibrary(filter); + this.addAbility(new EntersBattlefieldTriggeredAbility(new SearchLibraryRevealPutInHandEffect(target))); + } - public SylvanRanger(final SylvanRanger card) { - super(card); - } + public SylvanRanger(final SylvanRanger card) { + super(card); + } - @Override - public SylvanRanger copy() { - return new SylvanRanger(this); - } + @Override + public SylvanRanger copy() { + return new SylvanRanger(this); + } } diff --git a/Mage.Sets/src/mage/sets/magic2011/TempleBell.java b/Mage.Sets/src/mage/sets/magic2011/TempleBell.java index 4abe9ada3b..74e5741171 100644 --- a/Mage.Sets/src/mage/sets/magic2011/TempleBell.java +++ b/Mage.Sets/src/mage/sets/magic2011/TempleBell.java @@ -43,19 +43,19 @@ import mage.cards.CardImpl; */ public class TempleBell extends CardImpl { - public TempleBell(UUID ownerId) { - super(ownerId, 217, "Temple Bell", Rarity.RARE, new CardType[]{CardType.ARTIFACT}, "{3}"); - this.expansionSetCode = "M11"; - this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new DrawCardAllEffect(1), new TapSourceCost())); - } + public TempleBell(UUID ownerId) { + super(ownerId, 217, "Temple Bell", Rarity.RARE, new CardType[]{CardType.ARTIFACT}, "{3}"); + this.expansionSetCode = "M11"; + this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new DrawCardAllEffect(1), new TapSourceCost())); + } - public TempleBell(final TempleBell card) { - super(card); - } + public TempleBell(final TempleBell card) { + super(card); + } - @Override - public TempleBell copy() { - return new TempleBell(this); - } + @Override + public TempleBell copy() { + return new TempleBell(this); + } } diff --git a/Mage.Sets/src/mage/sets/magic2011/TerramorphicExpanse.java b/Mage.Sets/src/mage/sets/magic2011/TerramorphicExpanse.java index 949cad1bb8..3f6c0f0c9d 100644 --- a/Mage.Sets/src/mage/sets/magic2011/TerramorphicExpanse.java +++ b/Mage.Sets/src/mage/sets/magic2011/TerramorphicExpanse.java @@ -36,19 +36,19 @@ import java.util.UUID; */ public class TerramorphicExpanse extends mage.sets.tenth.TerramorphicExpanse { - public TerramorphicExpanse(UUID ownerId) { - super(ownerId); - this.cardNumber = 229; - this.expansionSetCode = "M11"; - } + public TerramorphicExpanse(UUID ownerId) { + super(ownerId); + this.cardNumber = 229; + this.expansionSetCode = "M11"; + } - public TerramorphicExpanse(final TerramorphicExpanse card) { - super(card); - } + public TerramorphicExpanse(final TerramorphicExpanse card) { + super(card); + } - @Override - public TerramorphicExpanse copy() { - return new TerramorphicExpanse(this); - } + @Override + public TerramorphicExpanse copy() { + return new TerramorphicExpanse(this); + } } diff --git a/Mage.Sets/src/mage/sets/magic2011/ThunderStrike.java b/Mage.Sets/src/mage/sets/magic2011/ThunderStrike.java index be48f2122a..eebc2dcfff 100644 --- a/Mage.Sets/src/mage/sets/magic2011/ThunderStrike.java +++ b/Mage.Sets/src/mage/sets/magic2011/ThunderStrike.java @@ -44,21 +44,21 @@ import mage.target.common.TargetCreaturePermanent; */ public class ThunderStrike extends CardImpl { - public ThunderStrike(UUID ownerId) { - super(ownerId, 157, "Thunder Strike", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{1}{R}"); - this.expansionSetCode = "M11"; - this.color.setRed(true); - this.getSpellAbility().addTarget(new TargetCreaturePermanent()); - this.getSpellAbility().addEffect(new BoostTargetEffect(2, 0, Duration.EndOfTurn)); - this.getSpellAbility().addEffect(new GainAbilityTargetEffect(FirstStrikeAbility.getInstance(), Duration.EndOfTurn)); - } + public ThunderStrike(UUID ownerId) { + super(ownerId, 157, "Thunder Strike", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{1}{R}"); + this.expansionSetCode = "M11"; + this.color.setRed(true); + this.getSpellAbility().addTarget(new TargetCreaturePermanent()); + this.getSpellAbility().addEffect(new BoostTargetEffect(2, 0, Duration.EndOfTurn)); + this.getSpellAbility().addEffect(new GainAbilityTargetEffect(FirstStrikeAbility.getInstance(), Duration.EndOfTurn)); + } - public ThunderStrike(final ThunderStrike card) { - super(card); - } + public ThunderStrike(final ThunderStrike card) { + super(card); + } - @Override - public ThunderStrike copy() { - return new ThunderStrike(this); - } + @Override + public ThunderStrike copy() { + return new ThunderStrike(this); + } } diff --git a/Mage.Sets/src/mage/sets/magic2011/TimeReversal.java b/Mage.Sets/src/mage/sets/magic2011/TimeReversal.java index cc67637668..47cea3e4c1 100644 --- a/Mage.Sets/src/mage/sets/magic2011/TimeReversal.java +++ b/Mage.Sets/src/mage/sets/magic2011/TimeReversal.java @@ -45,55 +45,55 @@ import mage.players.Player; */ public class TimeReversal extends CardImpl { - public TimeReversal(UUID ownerId) { - super(ownerId, 75, "Time Reversal", Rarity.MYTHIC, new CardType[]{CardType.SORCERY}, "{3}{U}{U}"); - this.expansionSetCode = "M11"; - this.color.setBlue(true); - this.getSpellAbility().addEffect(new TimeReversalEffect()); - this.getSpellAbility().addEffect(ExileSpellEffect.getInstance()); - } + public TimeReversal(UUID ownerId) { + super(ownerId, 75, "Time Reversal", Rarity.MYTHIC, new CardType[]{CardType.SORCERY}, "{3}{U}{U}"); + this.expansionSetCode = "M11"; + this.color.setBlue(true); + this.getSpellAbility().addEffect(new TimeReversalEffect()); + this.getSpellAbility().addEffect(ExileSpellEffect.getInstance()); + } - public TimeReversal(final TimeReversal card) { - super(card); - } + public TimeReversal(final TimeReversal card) { + super(card); + } - @Override - public TimeReversal copy() { - return new TimeReversal(this); - } + @Override + public TimeReversal copy() { + return new TimeReversal(this); + } } class TimeReversalEffect extends OneShotEffect { - public TimeReversalEffect() { - super(Outcome.Neutral); - staticText = "Each player shuffles his or her hand and graveyard into his or her library, then draws seven cards"; - } + public TimeReversalEffect() { + super(Outcome.Neutral); + staticText = "Each player shuffles his or her hand and graveyard into his or her library, then draws seven cards"; + } - public TimeReversalEffect(final TimeReversalEffect effect) { - super(effect); - } - - @Override - public boolean apply(Game game, Ability source) { - Player sourcePlayer = game.getPlayer(source.getControllerId()); - for (UUID playerId: sourcePlayer.getInRange()) { - Player player = game.getPlayer(playerId); - if (player != null) { - player.getLibrary().addAll(player.getHand().getCards(game), game); - player.getLibrary().addAll(player.getGraveyard().getCards(game), game); - player.shuffleLibrary(game); - player.getHand().clear(); - player.getGraveyard().clear(); - player.drawCards(7, game); - } - } - return true; - } + public TimeReversalEffect(final TimeReversalEffect effect) { + super(effect); + } - @Override - public TimeReversalEffect copy() { - return new TimeReversalEffect(this); - } + @Override + public boolean apply(Game game, Ability source) { + Player sourcePlayer = game.getPlayer(source.getControllerId()); + for (UUID playerId: sourcePlayer.getInRange()) { + Player player = game.getPlayer(playerId); + if (player != null) { + player.getLibrary().addAll(player.getHand().getCards(game), game); + player.getLibrary().addAll(player.getGraveyard().getCards(game), game); + player.shuffleLibrary(game); + player.getHand().clear(); + player.getGraveyard().clear(); + player.drawCards(7, game); + } + } + return true; + } + + @Override + public TimeReversalEffect copy() { + return new TimeReversalEffect(this); + } } \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/magic2011/TirelessMissionaries.java b/Mage.Sets/src/mage/sets/magic2011/TirelessMissionaries.java index 6af4ce5cc1..231b4e7f5e 100644 --- a/Mage.Sets/src/mage/sets/magic2011/TirelessMissionaries.java +++ b/Mage.Sets/src/mage/sets/magic2011/TirelessMissionaries.java @@ -42,25 +42,25 @@ import mage.cards.CardImpl; */ public class TirelessMissionaries extends CardImpl { - public TirelessMissionaries(UUID ownerId) { - super(ownerId, 36, "Tireless Missionaries", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{4}{W}"); - this.expansionSetCode = "M11"; - this.subtype.add("Human"); - this.subtype.add("Cleric"); - this.color.setWhite(true); - this.power = new MageInt(2); - this.toughness = new MageInt(3); + public TirelessMissionaries(UUID ownerId) { + super(ownerId, 36, "Tireless Missionaries", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{4}{W}"); + this.expansionSetCode = "M11"; + this.subtype.add("Human"); + this.subtype.add("Cleric"); + this.color.setWhite(true); + this.power = new MageInt(2); + this.toughness = new MageInt(3); - this.addAbility(new EntersBattlefieldTriggeredAbility(new GainLifeEffect(3))); - } + this.addAbility(new EntersBattlefieldTriggeredAbility(new GainLifeEffect(3))); + } - public TirelessMissionaries(final TirelessMissionaries card) { - super(card); - } + public TirelessMissionaries(final TirelessMissionaries card) { + super(card); + } - @Override - public TirelessMissionaries copy() { - return new TirelessMissionaries(this); - } + @Override + public TirelessMissionaries copy() { + return new TirelessMissionaries(this); + } } diff --git a/Mage.Sets/src/mage/sets/magic2011/TomeScour.java b/Mage.Sets/src/mage/sets/magic2011/TomeScour.java index 4f9fc26eab..337b178271 100644 --- a/Mage.Sets/src/mage/sets/magic2011/TomeScour.java +++ b/Mage.Sets/src/mage/sets/magic2011/TomeScour.java @@ -36,19 +36,19 @@ import java.util.UUID; */ public class TomeScour extends mage.sets.magic2010.TomeScour { - public TomeScour(UUID ownerId) { - super(ownerId); - this.cardNumber = 76; - this.expansionSetCode = "M11"; - } + public TomeScour(UUID ownerId) { + super(ownerId); + this.cardNumber = 76; + this.expansionSetCode = "M11"; + } - public TomeScour(final TomeScour card) { - super(card); - } + public TomeScour(final TomeScour card) { + super(card); + } - @Override - public TomeScour copy() { - return new TomeScour(this); - } + @Override + public TomeScour copy() { + return new TomeScour(this); + } } \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/magic2011/Traumatize.java b/Mage.Sets/src/mage/sets/magic2011/Traumatize.java index 4bb43c8465..e316962b73 100644 --- a/Mage.Sets/src/mage/sets/magic2011/Traumatize.java +++ b/Mage.Sets/src/mage/sets/magic2011/Traumatize.java @@ -36,19 +36,19 @@ import java.util.UUID; */ public class Traumatize extends mage.sets.tenth.Traumatize { - public Traumatize(UUID ownerId) { - super(ownerId); - this.cardNumber = 77; - this.expansionSetCode = "M11"; - } + public Traumatize(UUID ownerId) { + super(ownerId); + this.cardNumber = 77; + this.expansionSetCode = "M11"; + } - public Traumatize(final Traumatize card) { - super(card); - } + public Traumatize(final Traumatize card) { + super(card); + } - @Override - public Traumatize copy() { - return new Traumatize(this); - } + @Override + public Traumatize copy() { + return new Traumatize(this); + } } \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/magic2011/Triskelion.java b/Mage.Sets/src/mage/sets/magic2011/Triskelion.java index 4147b813ca..faac17f54e 100644 --- a/Mage.Sets/src/mage/sets/magic2011/Triskelion.java +++ b/Mage.Sets/src/mage/sets/magic2011/Triskelion.java @@ -49,26 +49,26 @@ import mage.target.common.TargetCreatureOrPlayer; */ public class Triskelion extends CardImpl { - public Triskelion(UUID ownerId) { - super(ownerId, 218, "Triskelion", Rarity.RARE, new CardType[]{CardType.ARTIFACT, CardType.CREATURE}, "{6}"); - this.expansionSetCode = "M11"; - this.subtype.add("Construct"); - this.power = new MageInt(1); - this.toughness = new MageInt(1); + public Triskelion(UUID ownerId) { + super(ownerId, 218, "Triskelion", Rarity.RARE, new CardType[]{CardType.ARTIFACT, CardType.CREATURE}, "{6}"); + this.expansionSetCode = "M11"; + this.subtype.add("Construct"); + this.power = new MageInt(1); + this.toughness = new MageInt(1); - this.addAbility(new EntersBattlefieldAbility(new AddCountersSourceEffect(CounterType.P1P1.createInstance(3)), "with three +1/+1 counters on it")); - Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DamageTargetEffect(1), new RemoveCountersSourceCost(CounterType.P1P1.createInstance())); - ability.addTarget(new TargetCreatureOrPlayer()); - this.addAbility(ability); - } + this.addAbility(new EntersBattlefieldAbility(new AddCountersSourceEffect(CounterType.P1P1.createInstance(3)), "with three +1/+1 counters on it")); + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DamageTargetEffect(1), new RemoveCountersSourceCost(CounterType.P1P1.createInstance())); + ability.addTarget(new TargetCreatureOrPlayer()); + this.addAbility(ability); + } - public Triskelion(final Triskelion card) { - super(card); - } + public Triskelion(final Triskelion card) { + super(card); + } - @Override - public Triskelion copy() { - return new Triskelion(this); - } + @Override + public Triskelion copy() { + return new Triskelion(this); + } } diff --git a/Mage.Sets/src/mage/sets/magic2011/UnholyStrength.java b/Mage.Sets/src/mage/sets/magic2011/UnholyStrength.java index e71f368b9f..a5e768b842 100644 --- a/Mage.Sets/src/mage/sets/magic2011/UnholyStrength.java +++ b/Mage.Sets/src/mage/sets/magic2011/UnholyStrength.java @@ -36,19 +36,19 @@ import java.util.UUID; */ public class UnholyStrength extends mage.sets.tenth.UnholyStrength { - public UnholyStrength(UUID ownerId) { - super(ownerId); - this.cardNumber = 119; - this.expansionSetCode = "M11"; - } + public UnholyStrength(UUID ownerId) { + super(ownerId); + this.cardNumber = 119; + this.expansionSetCode = "M11"; + } - public UnholyStrength(final UnholyStrength card) { - super(card); - } + public UnholyStrength(final UnholyStrength card) { + super(card); + } - @Override - public UnholyStrength copy() { - return new UnholyStrength(this); - } + @Override + public UnholyStrength copy() { + return new UnholyStrength(this); + } } \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/magic2011/Unsummon.java b/Mage.Sets/src/mage/sets/magic2011/Unsummon.java index a36669f0fb..78600fc597 100644 --- a/Mage.Sets/src/mage/sets/magic2011/Unsummon.java +++ b/Mage.Sets/src/mage/sets/magic2011/Unsummon.java @@ -36,19 +36,19 @@ import java.util.UUID; */ public class Unsummon extends mage.sets.conflux.Unsummon { - public Unsummon(UUID ownerId) { - super(ownerId); - this.cardNumber = 78; - this.expansionSetCode = "M11"; - } + public Unsummon(UUID ownerId) { + super(ownerId); + this.cardNumber = 78; + this.expansionSetCode = "M11"; + } - public Unsummon(final Unsummon card) { - super(card); - } + public Unsummon(final Unsummon card) { + super(card); + } - @Override - public Unsummon copy() { - return new Unsummon(this); - } + @Override + public Unsummon copy() { + return new Unsummon(this); + } } \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/magic2011/VengefulArchon.java b/Mage.Sets/src/mage/sets/magic2011/VengefulArchon.java index 9a17e62673..a3bda75a3a 100644 --- a/Mage.Sets/src/mage/sets/magic2011/VengefulArchon.java +++ b/Mage.Sets/src/mage/sets/magic2011/VengefulArchon.java @@ -51,91 +51,91 @@ import mage.target.TargetPlayer; */ public class VengefulArchon extends CardImpl { - public VengefulArchon(UUID ownerId) { - super(ownerId, 37, "Vengeful Archon", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{4}{W}{W}{W}"); - this.expansionSetCode = "M11"; - this.subtype.add("Archon"); - this.color.setWhite(true); - this.power = new MageInt(7); - this.toughness = new MageInt(7); + public VengefulArchon(UUID ownerId) { + super(ownerId, 37, "Vengeful Archon", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{4}{W}{W}{W}"); + this.expansionSetCode = "M11"; + this.subtype.add("Archon"); + this.color.setWhite(true); + this.power = new MageInt(7); + this.toughness = new MageInt(7); - this.addAbility(FlyingAbility.getInstance()); - Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new VengefulArchonEffect(), new ManaCostsImpl("{X}")); - ability.addTarget(new TargetPlayer()); - this.addAbility(ability); - } + this.addAbility(FlyingAbility.getInstance()); + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new VengefulArchonEffect(), new ManaCostsImpl("{X}")); + ability.addTarget(new TargetPlayer()); + this.addAbility(ability); + } - public VengefulArchon(final VengefulArchon card) { - super(card); - } + public VengefulArchon(final VengefulArchon card) { + super(card); + } - @Override - public VengefulArchon copy() { - return new VengefulArchon(this); - } + @Override + public VengefulArchon copy() { + return new VengefulArchon(this); + } } class VengefulArchonEffect extends PreventionEffectImpl { - protected int amount = 0; + protected int amount = 0; - public VengefulArchonEffect() { - super(Duration.EndOfTurn); - staticText = "Prevent the next X damage that would be dealt to you this turn. If damage is prevented this way, {this} deals that much damage to target player"; - } + public VengefulArchonEffect() { + super(Duration.EndOfTurn); + staticText = "Prevent the next X damage that would be dealt to you this turn. If damage is prevented this way, {this} deals that much damage to target player"; + } - public VengefulArchonEffect(final VengefulArchonEffect effect) { - super(effect); - this.amount = effect.amount; - } + public VengefulArchonEffect(final VengefulArchonEffect effect) { + super(effect); + this.amount = effect.amount; + } - @Override - public VengefulArchonEffect copy() { - return new VengefulArchonEffect(this); - } + @Override + public VengefulArchonEffect copy() { + return new VengefulArchonEffect(this); + } - @Override - public void init(Ability source, Game game) { - super.init(source, game); - amount = source.getManaCostsToPay().getX(); - } + @Override + public void init(Ability source, Game game) { + super.init(source, game); + amount = source.getManaCostsToPay().getX(); + } - @Override - public boolean apply(Game game, Ability source) { - return true; - } + @Override + public boolean apply(Game game, Ability source) { + return true; + } - @Override - public boolean replaceEvent(GameEvent event, Ability source, Game game) { - GameEvent preventEvent = new GameEvent(GameEvent.EventType.PREVENT_DAMAGE, source.getControllerId(), source.getId(), source.getControllerId(), event.getAmount(), false); - if (!game.replaceEvent(preventEvent)) { - Player player = game.getPlayer(source.getFirstTarget()); - if (player != null) { - if (event.getAmount() >= this.amount) { - int damage = event.getAmount(); - event.setAmount(event.getAmount() - amount); - player.damage(amount, source.getSourceId(), game, false, true); - this.used = true; - game.fireEvent(GameEvent.getEvent(GameEvent.EventType.PREVENTED_DAMAGE, source.getControllerId(), source.getId(), source.getControllerId(), damage)); - } else { - int damage = event.getAmount(); - event.setAmount(0); - amount -= damage; - player.damage(damage, source.getSourceId(), game, false, true); - game.fireEvent(GameEvent.getEvent(GameEvent.EventType.PREVENTED_DAMAGE, source.getControllerId(), source.getId(), source.getControllerId(), damage)); - } - } - } - return false; - } + @Override + public boolean replaceEvent(GameEvent event, Ability source, Game game) { + GameEvent preventEvent = new GameEvent(GameEvent.EventType.PREVENT_DAMAGE, source.getControllerId(), source.getId(), source.getControllerId(), event.getAmount(), false); + if (!game.replaceEvent(preventEvent)) { + Player player = game.getPlayer(source.getFirstTarget()); + if (player != null) { + if (event.getAmount() >= this.amount) { + int damage = event.getAmount(); + event.setAmount(event.getAmount() - amount); + player.damage(amount, source.getSourceId(), game, false, true); + this.used = true; + game.fireEvent(GameEvent.getEvent(GameEvent.EventType.PREVENTED_DAMAGE, source.getControllerId(), source.getId(), source.getControllerId(), damage)); + } else { + int damage = event.getAmount(); + event.setAmount(0); + amount -= damage; + player.damage(damage, source.getSourceId(), game, false, true); + game.fireEvent(GameEvent.getEvent(GameEvent.EventType.PREVENTED_DAMAGE, source.getControllerId(), source.getId(), source.getControllerId(), damage)); + } + } + } + return false; + } - @Override - public boolean applies(GameEvent event, Ability source, Game game) { - if (!this.used && super.applies(event, source, game) && event.getTargetId().equals(source.getControllerId())) { - return true; - } - return false; - } + @Override + public boolean applies(GameEvent event, Ability source, Game game) { + if (!this.used && super.applies(event, source, game) && event.getTargetId().equals(source.getControllerId())) { + return true; + } + return false; + } } diff --git a/Mage.Sets/src/mage/sets/magic2011/VisceraSeer.java b/Mage.Sets/src/mage/sets/magic2011/VisceraSeer.java index 3cc7d11e05..f55f04be5c 100644 --- a/Mage.Sets/src/mage/sets/magic2011/VisceraSeer.java +++ b/Mage.Sets/src/mage/sets/magic2011/VisceraSeer.java @@ -45,25 +45,25 @@ import mage.target.common.TargetControlledCreaturePermanent; */ public class VisceraSeer extends CardImpl { - public VisceraSeer(UUID ownerId) { - super(ownerId, 120, "Viscera Seer", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{B}"); - this.expansionSetCode = "M11"; - this.subtype.add("Vampire"); - this.subtype.add("Wizard"); - this.color.setBlack(true); - this.power = new MageInt(1); - this.toughness = new MageInt(1); + public VisceraSeer(UUID ownerId) { + super(ownerId, 120, "Viscera Seer", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{B}"); + this.expansionSetCode = "M11"; + this.subtype.add("Vampire"); + this.subtype.add("Wizard"); + this.color.setBlack(true); + this.power = new MageInt(1); + this.toughness = new MageInt(1); - this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new ScryEffect(1), new SacrificeTargetCost(new TargetControlledCreaturePermanent()))); - } + this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new ScryEffect(1), new SacrificeTargetCost(new TargetControlledCreaturePermanent()))); + } - public VisceraSeer(final VisceraSeer card) { - super(card); - } + public VisceraSeer(final VisceraSeer card) { + super(card); + } - @Override - public VisceraSeer copy() { - return new VisceraSeer(this); - } + @Override + public VisceraSeer copy() { + return new VisceraSeer(this); + } } diff --git a/Mage.Sets/src/mage/sets/magic2011/VolcanicStrength.java b/Mage.Sets/src/mage/sets/magic2011/VolcanicStrength.java index 3c5871ad99..42a95b7628 100644 --- a/Mage.Sets/src/mage/sets/magic2011/VolcanicStrength.java +++ b/Mage.Sets/src/mage/sets/magic2011/VolcanicStrength.java @@ -54,80 +54,80 @@ import mage.target.common.TargetCreaturePermanent; */ public class VolcanicStrength extends CardImpl { - public VolcanicStrength(UUID ownerId) { - super(ownerId, 158, "Volcanic Strength", Rarity.COMMON, new CardType[]{CardType.ENCHANTMENT}, "{1}{R}"); - this.expansionSetCode = "M11"; - this.color.setRed(true); - this.subtype.add("Aura"); + public VolcanicStrength(UUID ownerId) { + super(ownerId, 158, "Volcanic Strength", Rarity.COMMON, new CardType[]{CardType.ENCHANTMENT}, "{1}{R}"); + this.expansionSetCode = "M11"; + this.color.setRed(true); + this.subtype.add("Aura"); - TargetPermanent auraTarget = new TargetCreaturePermanent(); - this.getSpellAbility().addTarget(auraTarget); - this.getSpellAbility().addEffect(new AttachEffect(Outcome.BoostCreature)); - Ability ability = new EnchantAbility(auraTarget.getTargetName()); - this.addAbility(ability); - this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new VolcanicStrengthEffect())); + TargetPermanent auraTarget = new TargetCreaturePermanent(); + this.getSpellAbility().addTarget(auraTarget); + this.getSpellAbility().addEffect(new AttachEffect(Outcome.BoostCreature)); + Ability ability = new EnchantAbility(auraTarget.getTargetName()); + this.addAbility(ability); + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new VolcanicStrengthEffect())); - } + } - public VolcanicStrength(final VolcanicStrength card) { - super(card); - } + public VolcanicStrength(final VolcanicStrength card) { + super(card); + } - @Override - public VolcanicStrength copy() { - return new VolcanicStrength(this); - } + @Override + public VolcanicStrength copy() { + return new VolcanicStrength(this); + } } class VolcanicStrengthEffect extends ContinuousEffectImpl { - public VolcanicStrengthEffect() { - super(Duration.WhileOnBattlefield, Outcome.BoostCreature); - staticText = "Enchanted creature gets +2/+2 and has mountainwalk"; - } + public VolcanicStrengthEffect() { + super(Duration.WhileOnBattlefield, Outcome.BoostCreature); + staticText = "Enchanted creature gets +2/+2 and has mountainwalk"; + } - public VolcanicStrengthEffect(final VolcanicStrengthEffect effect) { - super(effect); - } + public VolcanicStrengthEffect(final VolcanicStrengthEffect effect) { + super(effect); + } - @Override - public VolcanicStrengthEffect copy() { - return new VolcanicStrengthEffect(this); - } + @Override + public VolcanicStrengthEffect copy() { + return new VolcanicStrengthEffect(this); + } - @Override - public boolean apply(Layer layer, SubLayer sublayer, Ability source, Game game) { - Permanent enchantment = game.getPermanent(source.getSourceId()); - if (enchantment != null && enchantment.getAttachedTo() != null) { - Permanent creature = game.getPermanent(enchantment.getAttachedTo()); - if (creature != null) { - switch (layer) { - case PTChangingEffects_7: - if (sublayer == SubLayer.ModifyPT_7c) { - creature.addPower(2); - creature.addToughness(2); - } - break; - case AbilityAddingRemovingEffects_6: - if (sublayer == SubLayer.NA) { - creature.addAbility(new MountainwalkAbility(), game); - } - break; - } - return true; - } - } - return false; - } + @Override + public boolean apply(Layer layer, SubLayer sublayer, Ability source, Game game) { + Permanent enchantment = game.getPermanent(source.getSourceId()); + if (enchantment != null && enchantment.getAttachedTo() != null) { + Permanent creature = game.getPermanent(enchantment.getAttachedTo()); + if (creature != null) { + switch (layer) { + case PTChangingEffects_7: + if (sublayer == SubLayer.ModifyPT_7c) { + creature.addPower(2); + creature.addToughness(2); + } + break; + case AbilityAddingRemovingEffects_6: + if (sublayer == SubLayer.NA) { + creature.addAbility(new MountainwalkAbility(), game); + } + break; + } + return true; + } + } + return false; + } - @Override - public boolean apply(Game game, Ability source) { - return false; - } + @Override + public boolean apply(Game game, Ability source) { + return false; + } - @Override - public boolean hasLayer(Layer layer) { - return layer == Layer.AbilityAddingRemovingEffects_6 || layer == layer.PTChangingEffects_7; - } + @Override + public boolean hasLayer(Layer layer) { + return layer == Layer.AbilityAddingRemovingEffects_6 || layer == layer.PTChangingEffects_7; + } } \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/magic2011/VoltaicKey.java b/Mage.Sets/src/mage/sets/magic2011/VoltaicKey.java index 4efe3a71df..d757ed1476 100644 --- a/Mage.Sets/src/mage/sets/magic2011/VoltaicKey.java +++ b/Mage.Sets/src/mage/sets/magic2011/VoltaicKey.java @@ -48,29 +48,29 @@ import mage.target.TargetPermanent; */ public class VoltaicKey extends CardImpl { - private static final FilterPermanent filter = new FilterPermanent("artifact"); + private static final FilterPermanent filter = new FilterPermanent("artifact"); - static { - filter.getCardType().add(CardType.ARTIFACT); - filter.setScopeCardType(ComparisonScope.Any); - } + static { + filter.getCardType().add(CardType.ARTIFACT); + filter.setScopeCardType(ComparisonScope.Any); + } - public VoltaicKey(UUID ownerId) { - super(ownerId, 219, "Voltaic Key", Rarity.UNCOMMON, new CardType[]{CardType.ARTIFACT}, "{1}"); - this.expansionSetCode = "M11"; - Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new UntapTargetEffect(), new TapSourceCost()); + public VoltaicKey(UUID ownerId) { + super(ownerId, 219, "Voltaic Key", Rarity.UNCOMMON, new CardType[]{CardType.ARTIFACT}, "{1}"); + this.expansionSetCode = "M11"; + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new UntapTargetEffect(), new TapSourceCost()); ability.addManaCost(new GenericManaCost(1)); - ability.addTarget(new TargetPermanent(filter)); - this.addAbility(ability); - } + ability.addTarget(new TargetPermanent(filter)); + this.addAbility(ability); + } - public VoltaicKey(final VoltaicKey card) { - super(card); - } + public VoltaicKey(final VoltaicKey card) { + super(card); + } - @Override - public VoltaicKey copy() { - return new VoltaicKey(this); - } + @Override + public VoltaicKey copy() { + return new VoltaicKey(this); + } } diff --git a/Mage.Sets/src/mage/sets/magic2011/VulshokBerserker.java b/Mage.Sets/src/mage/sets/magic2011/VulshokBerserker.java index 8ce8ec9a87..decd31ed30 100644 --- a/Mage.Sets/src/mage/sets/magic2011/VulshokBerserker.java +++ b/Mage.Sets/src/mage/sets/magic2011/VulshokBerserker.java @@ -41,25 +41,25 @@ import mage.cards.CardImpl; */ public class VulshokBerserker extends CardImpl { - public VulshokBerserker(UUID ownerId) { - super(ownerId, 159, "Vulshok Berserker", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{3}{R}"); - this.expansionSetCode = "M11"; - this.subtype.add("Human"); - this.subtype.add("Berserker"); - this.color.setRed(true); - this.power = new MageInt(3); - this.toughness = new MageInt(2); + public VulshokBerserker(UUID ownerId) { + super(ownerId, 159, "Vulshok Berserker", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{3}{R}"); + this.expansionSetCode = "M11"; + this.subtype.add("Human"); + this.subtype.add("Berserker"); + this.color.setRed(true); + this.power = new MageInt(3); + this.toughness = new MageInt(2); - this.addAbility(HasteAbility.getInstance()); - } + this.addAbility(HasteAbility.getInstance()); + } - public VulshokBerserker(final VulshokBerserker card) { - super(card); - } + public VulshokBerserker(final VulshokBerserker card) { + super(card); + } - @Override - public VulshokBerserker copy() { - return new VulshokBerserker(this); - } + @Override + public VulshokBerserker copy() { + return new VulshokBerserker(this); + } } diff --git a/Mage.Sets/src/mage/sets/magic2011/WallOfFrost.java b/Mage.Sets/src/mage/sets/magic2011/WallOfFrost.java index 6bcd06b9f4..897789eaa7 100644 --- a/Mage.Sets/src/mage/sets/magic2011/WallOfFrost.java +++ b/Mage.Sets/src/mage/sets/magic2011/WallOfFrost.java @@ -36,19 +36,19 @@ import java.util.UUID; */ public class WallOfFrost extends mage.sets.magic2010.WallOfFrost { - public WallOfFrost(UUID ownerId) { - super(ownerId); - this.cardNumber = 79; - this.expansionSetCode = "M11"; - } + public WallOfFrost(UUID ownerId) { + super(ownerId); + this.cardNumber = 79; + this.expansionSetCode = "M11"; + } - public WallOfFrost(final WallOfFrost card) { - super(card); - } + public WallOfFrost(final WallOfFrost card) { + super(card); + } - @Override - public WallOfFrost copy() { - return new WallOfFrost(this); - } + @Override + public WallOfFrost copy() { + return new WallOfFrost(this); + } } \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/magic2011/WallOfVines.java b/Mage.Sets/src/mage/sets/magic2011/WallOfVines.java index 115f6f7c33..e56d35e67a 100644 --- a/Mage.Sets/src/mage/sets/magic2011/WallOfVines.java +++ b/Mage.Sets/src/mage/sets/magic2011/WallOfVines.java @@ -42,26 +42,26 @@ import mage.cards.CardImpl; */ public class WallOfVines extends CardImpl { - public WallOfVines(UUID ownerId) { - super(ownerId, 199, "Wall of Vines", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{G}"); - this.expansionSetCode = "M11"; - this.subtype.add("Plant"); - this.subtype.add("Wall"); - this.color.setGreen(true); - this.power = new MageInt(0); - this.toughness = new MageInt(3); + public WallOfVines(UUID ownerId) { + super(ownerId, 199, "Wall of Vines", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{G}"); + this.expansionSetCode = "M11"; + this.subtype.add("Plant"); + this.subtype.add("Wall"); + this.color.setGreen(true); + this.power = new MageInt(0); + this.toughness = new MageInt(3); - this.addAbility(DefenderAbility.getInstance()); - this.addAbility(ReachAbility.getInstance()); - } + this.addAbility(DefenderAbility.getInstance()); + this.addAbility(ReachAbility.getInstance()); + } - public WallOfVines(final WallOfVines card) { - super(card); - } + public WallOfVines(final WallOfVines card) { + super(card); + } - @Override - public WallOfVines copy() { - return new WallOfVines(this); - } + @Override + public WallOfVines copy() { + return new WallOfVines(this); + } } diff --git a/Mage.Sets/src/mage/sets/magic2011/WarPriestOfThune.java b/Mage.Sets/src/mage/sets/magic2011/WarPriestOfThune.java index 70eb60fc44..e2da3b5b53 100644 --- a/Mage.Sets/src/mage/sets/magic2011/WarPriestOfThune.java +++ b/Mage.Sets/src/mage/sets/magic2011/WarPriestOfThune.java @@ -47,36 +47,36 @@ import mage.target.TargetPermanent; */ public class WarPriestOfThune extends CardImpl { - private static final FilterPermanent filter = new FilterPermanent("enchantment"); + private static final FilterPermanent filter = new FilterPermanent("enchantment"); - static { - filter.getCardType().add(CardType.ENCHANTMENT); - filter.setScopeCardType(ComparisonScope.Any); - } + static { + filter.getCardType().add(CardType.ENCHANTMENT); + filter.setScopeCardType(ComparisonScope.Any); + } - public WarPriestOfThune(UUID ownerId) { - super(ownerId, 38, "War Priest of Thune", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{1}{W}"); - this.expansionSetCode = "M11"; - this.subtype.add("Human"); - this.subtype.add("Cleric"); - this.color.setWhite(true); - this.power = new MageInt(2); - this.toughness = new MageInt(2); + public WarPriestOfThune(UUID ownerId) { + super(ownerId, 38, "War Priest of Thune", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{1}{W}"); + this.expansionSetCode = "M11"; + this.subtype.add("Human"); + this.subtype.add("Cleric"); + this.color.setWhite(true); + this.power = new MageInt(2); + this.toughness = new MageInt(2); - Ability ability = new EntersBattlefieldTriggeredAbility(new DestroyTargetEffect(), false); - Target target = new TargetPermanent(filter); - target.setRequired(true); - ability.addTarget(target); - this.addAbility(ability); - } + Ability ability = new EntersBattlefieldTriggeredAbility(new DestroyTargetEffect(), false); + Target target = new TargetPermanent(filter); + target.setRequired(true); + ability.addTarget(target); + this.addAbility(ability); + } - public WarPriestOfThune(final WarPriestOfThune card) { - super(card); - } + public WarPriestOfThune(final WarPriestOfThune card) { + super(card); + } - @Override - public WarPriestOfThune copy() { - return new WarPriestOfThune(this); - } + @Override + public WarPriestOfThune copy() { + return new WarPriestOfThune(this); + } } diff --git a/Mage.Sets/src/mage/sets/magic2011/WarlordsAxe.java b/Mage.Sets/src/mage/sets/magic2011/WarlordsAxe.java index 211e2c3710..4e8844c0c7 100644 --- a/Mage.Sets/src/mage/sets/magic2011/WarlordsAxe.java +++ b/Mage.Sets/src/mage/sets/magic2011/WarlordsAxe.java @@ -46,22 +46,22 @@ import mage.cards.CardImpl; */ public class WarlordsAxe extends CardImpl { - public WarlordsAxe(UUID ownerId) { - super(ownerId, 220, "Warlord's Axe", Rarity.UNCOMMON, new CardType[]{CardType.ARTIFACT}, "{3}"); - this.expansionSetCode = "M11"; - this.subtype.add("Equipment"); - this.addAbility(new EquipAbility(Outcome.AddAbility, new GenericManaCost(4))); - this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostEquippedEffect(3, 1))); - } + public WarlordsAxe(UUID ownerId) { + super(ownerId, 220, "Warlord's Axe", Rarity.UNCOMMON, new CardType[]{CardType.ARTIFACT}, "{3}"); + this.expansionSetCode = "M11"; + this.subtype.add("Equipment"); + this.addAbility(new EquipAbility(Outcome.AddAbility, new GenericManaCost(4))); + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostEquippedEffect(3, 1))); + } - protected WarlordsAxe(WarlordsAxe me) { - super(me); - } + protected WarlordsAxe(WarlordsAxe me) { + super(me); + } - @Override - public WarlordsAxe copy() { - return new WarlordsAxe(this); - } + @Override + public WarlordsAxe copy() { + return new WarlordsAxe(this); + } } diff --git a/Mage.Sets/src/mage/sets/magic2011/WaterServant.java b/Mage.Sets/src/mage/sets/magic2011/WaterServant.java index c6dd6fce81..1cec097f3c 100644 --- a/Mage.Sets/src/mage/sets/magic2011/WaterServant.java +++ b/Mage.Sets/src/mage/sets/magic2011/WaterServant.java @@ -45,25 +45,25 @@ import mage.cards.CardImpl; */ public class WaterServant extends CardImpl { - public WaterServant(UUID ownerId) { - super(ownerId, 80, "Water Servant", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{2}{U}{U}"); - this.expansionSetCode = "M11"; - this.subtype.add("Elemental"); - this.color.setBlue(true); - this.power = new MageInt(3); - this.toughness = new MageInt(4); + public WaterServant(UUID ownerId) { + super(ownerId, 80, "Water Servant", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{2}{U}{U}"); + this.expansionSetCode = "M11"; + this.subtype.add("Elemental"); + this.color.setBlue(true); + this.power = new MageInt(3); + this.toughness = new MageInt(4); - this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new BoostSourceEffect(1, -1, Duration.EndOfTurn), new ManaCostsImpl("{U}"))); - this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new BoostSourceEffect(-1, 1, Duration.EndOfTurn), new ManaCostsImpl("{U}"))); - } + this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new BoostSourceEffect(1, -1, Duration.EndOfTurn), new ManaCostsImpl("{U}"))); + this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new BoostSourceEffect(-1, 1, Duration.EndOfTurn), new ManaCostsImpl("{U}"))); + } - public WaterServant(final WaterServant card) { - super(card); - } + public WaterServant(final WaterServant card) { + super(card); + } - @Override - public WaterServant copy() { - return new WaterServant(this); - } + @Override + public WaterServant copy() { + return new WaterServant(this); + } } diff --git a/Mage.Sets/src/mage/sets/magic2011/WhispersilkCloak.java b/Mage.Sets/src/mage/sets/magic2011/WhispersilkCloak.java index 6deec58fb4..1acaf89a06 100644 --- a/Mage.Sets/src/mage/sets/magic2011/WhispersilkCloak.java +++ b/Mage.Sets/src/mage/sets/magic2011/WhispersilkCloak.java @@ -36,19 +36,19 @@ import java.util.UUID; */ public class WhispersilkCloak extends mage.sets.magic2010.WhispersilkCloak { - public WhispersilkCloak(UUID ownerId) { - super(ownerId); - this.cardNumber = 221; - this.expansionSetCode = "M11"; - } + public WhispersilkCloak(UUID ownerId) { + super(ownerId); + this.cardNumber = 221; + this.expansionSetCode = "M11"; + } - public WhispersilkCloak(final WhispersilkCloak card) { - super(card); - } + public WhispersilkCloak(final WhispersilkCloak card) { + super(card); + } - @Override - public WhispersilkCloak copy() { - return new WhispersilkCloak(this); - } + @Override + public WhispersilkCloak copy() { + return new WhispersilkCloak(this); + } } \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/magic2011/WhiteKnight.java b/Mage.Sets/src/mage/sets/magic2011/WhiteKnight.java index 8457eb4027..cde6595823 100644 --- a/Mage.Sets/src/mage/sets/magic2011/WhiteKnight.java +++ b/Mage.Sets/src/mage/sets/magic2011/WhiteKnight.java @@ -36,19 +36,19 @@ import java.util.UUID; */ public class WhiteKnight extends mage.sets.magic2010.WhiteKnight { - public WhiteKnight(UUID ownerId) { - super(ownerId); - this.cardNumber = 39; - this.expansionSetCode = "M11"; - } + public WhiteKnight(UUID ownerId) { + super(ownerId); + this.cardNumber = 39; + this.expansionSetCode = "M11"; + } - public WhiteKnight(final WhiteKnight card) { - super(card); - } + public WhiteKnight(final WhiteKnight card) { + super(card); + } - @Override - public WhiteKnight copy() { - return new WhiteKnight(this); - } + @Override + public WhiteKnight copy() { + return new WhiteKnight(this); + } } \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/magic2011/WildEvocation.java b/Mage.Sets/src/mage/sets/magic2011/WildEvocation.java index 514169446c..34cf1fea84 100644 --- a/Mage.Sets/src/mage/sets/magic2011/WildEvocation.java +++ b/Mage.Sets/src/mage/sets/magic2011/WildEvocation.java @@ -50,59 +50,59 @@ import mage.players.Player; */ public class WildEvocation extends CardImpl { - public WildEvocation(UUID ownerId) { - super(ownerId, 160, "Wild Evocation", Rarity.RARE, new CardType[]{CardType.ENCHANTMENT}, "{5}{R}"); - this.expansionSetCode = "M11"; - this.color.setRed(true); - + public WildEvocation(UUID ownerId) { + super(ownerId, 160, "Wild Evocation", Rarity.RARE, new CardType[]{CardType.ENCHANTMENT}, "{5}{R}"); + this.expansionSetCode = "M11"; + this.color.setRed(true); + //At the beginning of each player's upkeep, that player reveals a card at random from his or her hand. If it's a land card, the player puts it onto the battlefield. Otherwise, the player casts it without paying its mana cost if able. - this.addAbility(new BeginningOfUpkeepTriggeredAbility(Constants.Zone.BATTLEFIELD, new WildEvocationEffect(), Constants.TargetController.ANY, false)); - } + this.addAbility(new BeginningOfUpkeepTriggeredAbility(Constants.Zone.BATTLEFIELD, new WildEvocationEffect(), Constants.TargetController.ANY, false)); + } - public WildEvocation(final WildEvocation card) { - super(card); - } + public WildEvocation(final WildEvocation card) { + super(card); + } - @Override - public WildEvocation copy() { - return new WildEvocation(this); - } + @Override + public WildEvocation copy() { + return new WildEvocation(this); + } } class WildEvocationEffect extends OneShotEffect { - public WildEvocationEffect() { - super(Outcome.PutCardInPlay); + public WildEvocationEffect() { + super(Outcome.PutCardInPlay); staticText = "that player reveals a card at random from his or her hand. If it's a land card, that player puts it onto the battlefield. Otherwise, the player casts it without paying its mana cost if able"; - } + } - public WildEvocationEffect(final WildEvocationEffect effect) { - super(effect); - } + public WildEvocationEffect(final WildEvocationEffect effect) { + super(effect); + } - @Override - public boolean apply(Game game, Ability source) { - Player player = game.getPlayer(targetPointer.getFirst(game, source)); - if (player != null && player.getHand().size() > 0) { - Card card = player.getHand().getRandom(game); - Cards cards = new CardsImpl(); - cards.add(card); - player.revealCards("Wild Evocation", cards, game); - if (card.getCardType().contains(CardType.LAND)) { - card.putOntoBattlefield(game, Zone.HAND, source.getId(), player.getId()); - } - else { - player.cast(card.getSpellAbility(), game, true); - } - return true; - } - return false; - } + @Override + public boolean apply(Game game, Ability source) { + Player player = game.getPlayer(targetPointer.getFirst(game, source)); + if (player != null && player.getHand().size() > 0) { + Card card = player.getHand().getRandom(game); + Cards cards = new CardsImpl(); + cards.add(card); + player.revealCards("Wild Evocation", cards, game); + if (card.getCardType().contains(CardType.LAND)) { + card.putOntoBattlefield(game, Zone.HAND, source.getId(), player.getId()); + } + else { + player.cast(card.getSpellAbility(), game, true); + } + return true; + } + return false; + } - @Override - public WildEvocationEffect copy() { - return new WildEvocationEffect(this); - } + @Override + public WildEvocationEffect copy() { + return new WildEvocationEffect(this); + } } \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/magic2011/WildGriffin.java b/Mage.Sets/src/mage/sets/magic2011/WildGriffin.java index b822ca1d06..1a47abc834 100644 --- a/Mage.Sets/src/mage/sets/magic2011/WildGriffin.java +++ b/Mage.Sets/src/mage/sets/magic2011/WildGriffin.java @@ -36,19 +36,19 @@ import java.util.UUID; */ public class WildGriffin extends mage.sets.tenth.WildGriffin { - public WildGriffin(UUID ownerId) { - super(ownerId); - this.cardNumber = 40; - this.expansionSetCode = "M11"; - } + public WildGriffin(UUID ownerId) { + super(ownerId); + this.cardNumber = 40; + this.expansionSetCode = "M11"; + } - public WildGriffin(final WildGriffin card) { - super(card); - } + public WildGriffin(final WildGriffin card) { + super(card); + } - @Override - public WildGriffin copy() { - return new WildGriffin(this); - } + @Override + public WildGriffin copy() { + return new WildGriffin(this); + } } \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/magic2011/WurmsTooth.java b/Mage.Sets/src/mage/sets/magic2011/WurmsTooth.java index 44be104316..78a3334638 100644 --- a/Mage.Sets/src/mage/sets/magic2011/WurmsTooth.java +++ b/Mage.Sets/src/mage/sets/magic2011/WurmsTooth.java @@ -36,19 +36,19 @@ import java.util.UUID; */ public class WurmsTooth extends mage.sets.tenth.WurmsTooth { - public WurmsTooth(UUID ownerId) { - super(ownerId); - this.cardNumber = 222; - this.expansionSetCode = "M11"; - } + public WurmsTooth(UUID ownerId) { + super(ownerId); + this.cardNumber = 222; + this.expansionSetCode = "M11"; + } - public WurmsTooth(final WurmsTooth card) { - super(card); - } + public WurmsTooth(final WurmsTooth card) { + super(card); + } - @Override - public WurmsTooth copy() { - return new WurmsTooth(this); - } + @Override + public WurmsTooth copy() { + return new WurmsTooth(this); + } } \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/magic2011/YavimayaWurm.java b/Mage.Sets/src/mage/sets/magic2011/YavimayaWurm.java index 82c0cdb049..ea2ab6b872 100644 --- a/Mage.Sets/src/mage/sets/magic2011/YavimayaWurm.java +++ b/Mage.Sets/src/mage/sets/magic2011/YavimayaWurm.java @@ -41,24 +41,24 @@ import mage.cards.CardImpl; */ public class YavimayaWurm extends CardImpl { - public YavimayaWurm(UUID ownerId) { - super(ownerId, 200, "Yavimaya Wurm", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{4}{G}{G}"); - this.expansionSetCode = "M11"; - this.subtype.add("Wurm"); - this.color.setGreen(true); - this.power = new MageInt(6); - this.toughness = new MageInt(4); + public YavimayaWurm(UUID ownerId) { + super(ownerId, 200, "Yavimaya Wurm", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{4}{G}{G}"); + this.expansionSetCode = "M11"; + this.subtype.add("Wurm"); + this.color.setGreen(true); + this.power = new MageInt(6); + this.toughness = new MageInt(4); - this.addAbility(TrampleAbility.getInstance()); - } + this.addAbility(TrampleAbility.getInstance()); + } - public YavimayaWurm(final YavimayaWurm card) { - super(card); - } + public YavimayaWurm(final YavimayaWurm card) { + super(card); + } - @Override - public YavimayaWurm copy() { - return new YavimayaWurm(this); - } + @Override + public YavimayaWurm copy() { + return new YavimayaWurm(this); + } } diff --git a/Mage.Sets/src/mage/sets/magic2012/AdaptiveAutomaton.java b/Mage.Sets/src/mage/sets/magic2012/AdaptiveAutomaton.java index f2b529d160..ffef208fff 100644 --- a/Mage.Sets/src/mage/sets/magic2012/AdaptiveAutomaton.java +++ b/Mage.Sets/src/mage/sets/magic2012/AdaptiveAutomaton.java @@ -53,127 +53,127 @@ import java.util.UUID; */ public class AdaptiveAutomaton extends CardImpl { - public AdaptiveAutomaton(UUID ownerId) { - super(ownerId, 201, "Adaptive Automaton", Rarity.RARE, new CardType[]{CardType.ARTIFACT, CardType.CREATURE}, "{3}"); - this.expansionSetCode = "M12"; - this.subtype.add("Construct"); + public AdaptiveAutomaton(UUID ownerId) { + super(ownerId, 201, "Adaptive Automaton", Rarity.RARE, new CardType[]{CardType.ARTIFACT, CardType.CREATURE}, "{3}"); + this.expansionSetCode = "M12"; + this.subtype.add("Construct"); - this.power = new MageInt(2); - this.toughness = new MageInt(2); + this.power = new MageInt(2); + this.toughness = new MageInt(2); - // As Adaptive Automaton enters the battlefield, choose a creature type. - this.addAbility(new EntersBattlefieldAbility(new AdaptiveAutomatonEffect())); - // Adaptive Automaton is the chosen type in addition to its other types. - this.addAbility(new SimpleStaticAbility(Constants.Zone.BATTLEFIELD, new AdaptiveAutomatonAddSubtypeEffect())); - // Other creatures you control of the chosen type get +1/+1. - this.addAbility(new SimpleStaticAbility(Constants.Zone.BATTLEFIELD, new AdaptiveAutomatonBoostControlledEffect())); - } + // As Adaptive Automaton enters the battlefield, choose a creature type. + this.addAbility(new EntersBattlefieldAbility(new AdaptiveAutomatonEffect())); + // Adaptive Automaton is the chosen type in addition to its other types. + this.addAbility(new SimpleStaticAbility(Constants.Zone.BATTLEFIELD, new AdaptiveAutomatonAddSubtypeEffect())); + // Other creatures you control of the chosen type get +1/+1. + this.addAbility(new SimpleStaticAbility(Constants.Zone.BATTLEFIELD, new AdaptiveAutomatonBoostControlledEffect())); + } - public AdaptiveAutomaton(final AdaptiveAutomaton card) { - super(card); - } + public AdaptiveAutomaton(final AdaptiveAutomaton card) { + super(card); + } - @Override - public AdaptiveAutomaton copy() { - return new AdaptiveAutomaton(this); - } + @Override + public AdaptiveAutomaton copy() { + return new AdaptiveAutomaton(this); + } } class AdaptiveAutomatonEffect extends OneShotEffect { - public AdaptiveAutomatonEffect() { - super(Constants.Outcome.BoostCreature); - staticText = "As {this} enters the battlefield, choose a creature type"; - } + public AdaptiveAutomatonEffect() { + super(Constants.Outcome.BoostCreature); + staticText = "As {this} enters the battlefield, choose a creature type"; + } - public AdaptiveAutomatonEffect(final AdaptiveAutomatonEffect effect) { - super(effect); - } + public AdaptiveAutomatonEffect(final AdaptiveAutomatonEffect effect) { + super(effect); + } - @Override - public boolean apply(Game game, Ability source) { - Player player = game.getPlayer(source.getControllerId()); - Permanent permanent = game.getPermanent(source.getSourceId()); - if (player != null && permanent != null) { - Choice typeChoice = new ChoiceImpl(true); - typeChoice.setChoices(Sets.getCreatureTypes()); - while (!player.choose(Constants.Outcome.BoostCreature, typeChoice, game)) { + @Override + public boolean apply(Game game, Ability source) { + Player player = game.getPlayer(source.getControllerId()); + Permanent permanent = game.getPermanent(source.getSourceId()); + if (player != null && permanent != null) { + Choice typeChoice = new ChoiceImpl(true); + typeChoice.setChoices(Sets.getCreatureTypes()); + while (!player.choose(Constants.Outcome.BoostCreature, typeChoice, game)) { game.debugMessage("player canceled choosing type. retrying."); } - game.informPlayers(permanent.getName() + ": " + player.getName() + " has chosen " + typeChoice.getChoice()); - game.getState().setValue(permanent.getId() + "_type", typeChoice.getChoice()); - } - return false; - } + game.informPlayers(permanent.getName() + ": " + player.getName() + " has chosen " + typeChoice.getChoice()); + game.getState().setValue(permanent.getId() + "_type", typeChoice.getChoice()); + } + return false; + } - @Override - public AdaptiveAutomatonEffect copy() { - return new AdaptiveAutomatonEffect(this); - } + @Override + public AdaptiveAutomatonEffect copy() { + return new AdaptiveAutomatonEffect(this); + } } class AdaptiveAutomatonAddSubtypeEffect extends ContinuousEffectImpl { - public AdaptiveAutomatonAddSubtypeEffect() { - super(Duration.WhileOnBattlefield, Constants.Layer.TypeChangingEffects_4, Constants.SubLayer.NA, Constants.Outcome.Benefit); - staticText = "{this} is the chosen type in addition to its other types"; - } + public AdaptiveAutomatonAddSubtypeEffect() { + super(Duration.WhileOnBattlefield, Constants.Layer.TypeChangingEffects_4, Constants.SubLayer.NA, Constants.Outcome.Benefit); + staticText = "{this} is the chosen type in addition to its other types"; + } - public AdaptiveAutomatonAddSubtypeEffect(final AdaptiveAutomatonAddSubtypeEffect effect) { - super(effect); - } + public AdaptiveAutomatonAddSubtypeEffect(final AdaptiveAutomatonAddSubtypeEffect effect) { + super(effect); + } - @Override - public boolean apply(Game game, Ability source) { - Permanent permanent = game.getPermanent(source.getSourceId()); - if (permanent != null) { - String subtype = (String) game.getState().getValue(permanent.getId() + "_type"); - if (subtype != null && !permanent.getSubtype().contains(subtype)) { - permanent.getSubtype().add(subtype); - } - } - return true; - } + @Override + public boolean apply(Game game, Ability source) { + Permanent permanent = game.getPermanent(source.getSourceId()); + if (permanent != null) { + String subtype = (String) game.getState().getValue(permanent.getId() + "_type"); + if (subtype != null && !permanent.getSubtype().contains(subtype)) { + permanent.getSubtype().add(subtype); + } + } + return true; + } - @Override - public AdaptiveAutomatonAddSubtypeEffect copy() { - return new AdaptiveAutomatonAddSubtypeEffect(this); - } + @Override + public AdaptiveAutomatonAddSubtypeEffect copy() { + return new AdaptiveAutomatonAddSubtypeEffect(this); + } } class AdaptiveAutomatonBoostControlledEffect extends ContinuousEffectImpl { - private static final FilterCreaturePermanent filter = new FilterCreaturePermanent(); + private static final FilterCreaturePermanent filter = new FilterCreaturePermanent(); - public AdaptiveAutomatonBoostControlledEffect() { - super(Duration.WhileOnBattlefield, Constants.Layer.PTChangingEffects_7, Constants.SubLayer.ModifyPT_7c, Constants.Outcome.BoostCreature); - staticText = "Other creatures you control of the chosen type get +1/+1"; - } + public AdaptiveAutomatonBoostControlledEffect() { + super(Duration.WhileOnBattlefield, Constants.Layer.PTChangingEffects_7, Constants.SubLayer.ModifyPT_7c, Constants.Outcome.BoostCreature); + staticText = "Other creatures you control of the chosen type get +1/+1"; + } - public AdaptiveAutomatonBoostControlledEffect(final AdaptiveAutomatonBoostControlledEffect effect) { - super(effect); - } + public AdaptiveAutomatonBoostControlledEffect(final AdaptiveAutomatonBoostControlledEffect effect) { + super(effect); + } - @Override - public AdaptiveAutomatonBoostControlledEffect copy() { - return new AdaptiveAutomatonBoostControlledEffect(this); - } + @Override + public AdaptiveAutomatonBoostControlledEffect copy() { + return new AdaptiveAutomatonBoostControlledEffect(this); + } - @Override - public boolean apply(Game game, Ability source) { - Permanent permanent = game.getPermanent(source.getSourceId()); - if (permanent != null) { - String subtype = (String) game.getState().getValue(permanent.getId() + "_type"); - if (subtype != null) { - for (Permanent perm: game.getBattlefield().getAllActivePermanents(filter, source.getControllerId(), game)) { - if (!perm.getId().equals(source.getSourceId()) && perm.hasSubtype(subtype)) { - perm.addPower(1); - perm.addToughness(1); - } - } - } - } - return true; - } + @Override + public boolean apply(Game game, Ability source) { + Permanent permanent = game.getPermanent(source.getSourceId()); + if (permanent != null) { + String subtype = (String) game.getState().getValue(permanent.getId() + "_type"); + if (subtype != null) { + for (Permanent perm: game.getBattlefield().getAllActivePermanents(filter, source.getControllerId(), game)) { + if (!perm.getId().equals(source.getSourceId()) && perm.hasSubtype(subtype)) { + perm.addPower(1); + perm.addToughness(1); + } + } + } + } + return true; + } } diff --git a/Mage.Sets/src/mage/sets/magic2012/AngelicDestiny.java b/Mage.Sets/src/mage/sets/magic2012/AngelicDestiny.java index 4baf379284..c1fbf91887 100644 --- a/Mage.Sets/src/mage/sets/magic2012/AngelicDestiny.java +++ b/Mage.Sets/src/mage/sets/magic2012/AngelicDestiny.java @@ -61,10 +61,10 @@ public class AngelicDestiny extends CardImpl { this.color.setWhite(true); TargetPermanent auraTarget = new TargetCreaturePermanent(); - this.getSpellAbility().addTarget(auraTarget); - this.getSpellAbility().addEffect(new AttachEffect(Constants.Outcome.BoostCreature)); - Ability ability = new EnchantAbility(auraTarget.getTargetName()); - this.addAbility(ability); + this.getSpellAbility().addTarget(auraTarget); + this.getSpellAbility().addEffect(new AttachEffect(Constants.Outcome.BoostCreature)); + Ability ability = new EnchantAbility(auraTarget.getTargetName()); + this.addAbility(ability); this.addAbility(new SimpleStaticAbility(Constants.Zone.BATTLEFIELD, new BoostEnchantedEffect(4, 4, Constants.Duration.WhileOnBattlefield))); this.addAbility(new SimpleStaticAbility(Constants.Zone.BATTLEFIELD, new GainAbilityAttachedEffect(FlyingAbility.getInstance(), Constants.AttachmentType.AURA))); diff --git a/Mage.Sets/src/mage/sets/magic2012/AngelsFeather.java b/Mage.Sets/src/mage/sets/magic2012/AngelsFeather.java index 266a5860ea..c30f2fb432 100644 --- a/Mage.Sets/src/mage/sets/magic2012/AngelsFeather.java +++ b/Mage.Sets/src/mage/sets/magic2012/AngelsFeather.java @@ -38,19 +38,19 @@ import java.util.UUID; public class AngelsFeather extends mage.sets.tenth.AngelsFeather { - public AngelsFeather(UUID ownerId) { - super(ownerId); + public AngelsFeather(UUID ownerId) { + super(ownerId); this.cardNumber = 202; - this.expansionSetCode = "M12"; - } + this.expansionSetCode = "M12"; + } - public AngelsFeather(final AngelsFeather card) { - super(card); - } + public AngelsFeather(final AngelsFeather card) { + super(card); + } - @Override - public AngelsFeather copy() { - return new AngelsFeather(this); - } + @Override + public AngelsFeather copy() { + return new AngelsFeather(this); + } } diff --git a/Mage.Sets/src/mage/sets/magic2012/ArbalestElite.java b/Mage.Sets/src/mage/sets/magic2012/ArbalestElite.java index 00068a2a1e..3879e4f69b 100644 --- a/Mage.Sets/src/mage/sets/magic2012/ArbalestElite.java +++ b/Mage.Sets/src/mage/sets/magic2012/ArbalestElite.java @@ -59,12 +59,12 @@ public class ArbalestElite extends CardImpl { this.toughness = new MageInt(3); // {2}{W}, {tap}: Arbalest Elite deals 3 damage to target attacking or blocking creature. Arbalest Elite doesn't untap during your next untap step. - Ability ability = new SimpleActivatedAbility(Constants.Zone.BATTLEFIELD, new DamageTargetEffect(3), new ManaCostsImpl("{2}{W}")); - ability.addCost(new TapSourceCost()); - ability.addTarget(new TargetAttackingOrBlockingCreature()); - ability.addEffect(new SkipNextUntapSourceEffect()); - this.addAbility(ability); - } + Ability ability = new SimpleActivatedAbility(Constants.Zone.BATTLEFIELD, new DamageTargetEffect(3), new ManaCostsImpl("{2}{W}")); + ability.addCost(new TapSourceCost()); + ability.addTarget(new TargetAttackingOrBlockingCreature()); + ability.addEffect(new SkipNextUntapSourceEffect()); + this.addAbility(ability); + } public ArbalestElite(final ArbalestElite card) { super(card); diff --git a/Mage.Sets/src/mage/sets/magic2012/BloodlordOfVaasgoth.java b/Mage.Sets/src/mage/sets/magic2012/BloodlordOfVaasgoth.java index 9c1c0d0688..6ed92cf2e5 100644 --- a/Mage.Sets/src/mage/sets/magic2012/BloodlordOfVaasgoth.java +++ b/Mage.Sets/src/mage/sets/magic2012/BloodlordOfVaasgoth.java @@ -49,76 +49,76 @@ import mage.game.stack.Spell; */ public class BloodlordOfVaasgoth extends CardImpl { - private static final FilterSpell filter = new FilterSpell("a Vampire creature spell"); + private static final FilterSpell filter = new FilterSpell("a Vampire creature spell"); - static { - filter.getCardType().add(CardType.CREATURE); - filter.setScopeCardType(Filter.ComparisonScope.Any); - filter.getSubtype().add("Vampire"); - filter.setScopeSubtype(Filter.ComparisonScope.Any); - } + static { + filter.getCardType().add(CardType.CREATURE); + filter.setScopeCardType(Filter.ComparisonScope.Any); + filter.getSubtype().add("Vampire"); + filter.setScopeSubtype(Filter.ComparisonScope.Any); + } - public BloodlordOfVaasgoth(UUID ownerId) { - super(ownerId, 82, "Bloodlord of Vaasgoth", Rarity.MYTHIC, new CardType[]{CardType.CREATURE}, "{3}{B}{B}"); - this.expansionSetCode = "M12"; - this.subtype.add("Vampire"); - this.subtype.add("Warrior"); + public BloodlordOfVaasgoth(UUID ownerId) { + super(ownerId, 82, "Bloodlord of Vaasgoth", Rarity.MYTHIC, new CardType[]{CardType.CREATURE}, "{3}{B}{B}"); + this.expansionSetCode = "M12"; + this.subtype.add("Vampire"); + this.subtype.add("Warrior"); - this.color.setBlack(true); - this.power = new MageInt(3); - this.toughness = new MageInt(3); + this.color.setBlack(true); + this.power = new MageInt(3); + this.toughness = new MageInt(3); - // Bloodthirst 3 - this.addAbility(new BloodthirstAbility(3)); + // Bloodthirst 3 + this.addAbility(new BloodthirstAbility(3)); - this.addAbility(FlyingAbility.getInstance()); + this.addAbility(FlyingAbility.getInstance()); - // Whenever you cast a Vampire creature spell, it gains bloodthirst 3. - this.addAbility(new SpellCastTriggeredAbility(new BloodlordOfVaasgothEffect(), filter, false, true)); - } + // Whenever you cast a Vampire creature spell, it gains bloodthirst 3. + this.addAbility(new SpellCastTriggeredAbility(new BloodlordOfVaasgothEffect(), filter, false, true)); + } - public BloodlordOfVaasgoth(final BloodlordOfVaasgoth card) { - super(card); - } + public BloodlordOfVaasgoth(final BloodlordOfVaasgoth card) { + super(card); + } - @Override - public BloodlordOfVaasgoth copy() { - return new BloodlordOfVaasgoth(this); - } + @Override + public BloodlordOfVaasgoth copy() { + return new BloodlordOfVaasgoth(this); + } } class BloodlordOfVaasgothEffect extends ContinuousEffectImpl { - private Ability ability = new BloodthirstAbility(3); + private Ability ability = new BloodthirstAbility(3); - public BloodlordOfVaasgothEffect() { - super(Constants.Duration.OneUse, Constants.Layer.AbilityAddingRemovingEffects_6, Constants.SubLayer.NA, Constants.Outcome.AddAbility); - staticText = "it gains bloodthirst 3"; - } + public BloodlordOfVaasgothEffect() { + super(Constants.Duration.OneUse, Constants.Layer.AbilityAddingRemovingEffects_6, Constants.SubLayer.NA, Constants.Outcome.AddAbility); + staticText = "it gains bloodthirst 3"; + } - public BloodlordOfVaasgothEffect(final BloodlordOfVaasgothEffect effect) { - super(effect); + public BloodlordOfVaasgothEffect(final BloodlordOfVaasgothEffect effect) { + super(effect); this.ability = effect.ability.copy(); - } + } - @Override - public BloodlordOfVaasgothEffect copy() { - return new BloodlordOfVaasgothEffect(this); - } + @Override + public BloodlordOfVaasgothEffect copy() { + return new BloodlordOfVaasgothEffect(this); + } - @Override - public boolean apply(Game game, Ability source) { - Spell object = game.getStack().getSpell(targetPointer.getFirst(game, source)); - if (object != null) { - Permanent permanent = game.getPermanent(object.getSourceId()); - if (permanent != null) { - permanent.addAbility(ability, game); - return true; - } - } else { - used = true; - } - return false; - } + @Override + public boolean apply(Game game, Ability source) { + Spell object = game.getStack().getSpell(targetPointer.getFirst(game, source)); + if (object != null) { + Permanent permanent = game.getPermanent(object.getSourceId()); + if (permanent != null) { + permanent.addAbility(ability, game); + return true; + } + } else { + used = true; + } + return false; + } } diff --git a/Mage.Sets/src/mage/sets/magic2012/CallToTheGrave.java b/Mage.Sets/src/mage/sets/magic2012/CallToTheGrave.java index 1209501052..1464234739 100644 --- a/Mage.Sets/src/mage/sets/magic2012/CallToTheGrave.java +++ b/Mage.Sets/src/mage/sets/magic2012/CallToTheGrave.java @@ -50,13 +50,13 @@ import mage.game.events.GameEvent; */ public class CallToTheGrave extends CardImpl { - private static final String ruleText = "At the beginning of the end step, if no creatures are on the battlefield, sacrifice Call to the Grave."; - private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("a non-Zombie creature"); + private static final String ruleText = "At the beginning of the end step, if no creatures are on the battlefield, sacrifice Call to the Grave."; + private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("a non-Zombie creature"); - static { - filter.getSubtype().add("Zombie"); - filter.setNotSubtype(true); - } + static { + filter.getSubtype().add("Zombie"); + filter.setNotSubtype(true); + } public CallToTheGrave(UUID ownerId) { super(ownerId, 85, "Call to the Grave", Rarity.RARE, new CardType[]{CardType.ENCHANTMENT}, "{4}{B}"); @@ -68,9 +68,9 @@ public class CallToTheGrave extends CardImpl { Ability ability = new BeginningOfUpkeepTriggeredAbility(new SacrificeEffect(filter, 1, "that player "), Constants.TargetController.ANY, false); this.addAbility(ability); // At the beginning of the end step, if no creatures are on the battlefield, sacrifice Call to the Grave. - TriggeredAbility triggered = new OnEventTriggeredAbility(GameEvent.EventType.END_TURN_STEP_PRE, "beginning of the end step", true, new SacrificeSourceEffect()); - this.addAbility(new ConditionalTriggeredAbility(triggered, new NoCreatureCondition(), ruleText)); - } + TriggeredAbility triggered = new OnEventTriggeredAbility(GameEvent.EventType.END_TURN_STEP_PRE, "beginning of the end step", true, new SacrificeSourceEffect()); + this.addAbility(new ConditionalTriggeredAbility(triggered, new NoCreatureCondition(), ruleText)); + } public CallToTheGrave(final CallToTheGrave card) { super(card); diff --git a/Mage.Sets/src/mage/sets/magic2012/ChandraTheFirebrand.java b/Mage.Sets/src/mage/sets/magic2012/ChandraTheFirebrand.java index f02682eb63..4cdbcc219b 100644 --- a/Mage.Sets/src/mage/sets/magic2012/ChandraTheFirebrand.java +++ b/Mage.Sets/src/mage/sets/magic2012/ChandraTheFirebrand.java @@ -57,7 +57,7 @@ public class ChandraTheFirebrand extends CardImpl { super(ownerId, 124, "Chandra, the Firebrand", Rarity.MYTHIC, new CardType[]{CardType.PLANESWALKER}, "{3}{R}"); this.expansionSetCode = "M12"; this.subtype.add("Chandra"); - this.color.setRed(true); + this.color.setRed(true); this.addAbility(new EntersBattlefieldAbility(new AddCountersSourceEffect(CounterType.LOYALTY.createInstance(3)), "")); LoyaltyAbility ability1 = new LoyaltyAbility(new DamageTargetEffect(1), 1); diff --git a/Mage.Sets/src/mage/sets/magic2012/ChasmDrake.java b/Mage.Sets/src/mage/sets/magic2012/ChasmDrake.java index 3d7506b001..3e807e451e 100644 --- a/Mage.Sets/src/mage/sets/magic2012/ChasmDrake.java +++ b/Mage.Sets/src/mage/sets/magic2012/ChasmDrake.java @@ -55,7 +55,7 @@ public class ChasmDrake extends CardImpl { this.toughness = new MageInt(3); this.addAbility(FlyingAbility.getInstance()); Ability ability = new AttacksTriggeredAbility(new GainAbilityTargetEffect(FlyingAbility.getInstance(), Constants.Duration.EndOfTurn), false); - ability.addTarget(new TargetControlledCreaturePermanent(true)); + ability.addTarget(new TargetControlledCreaturePermanent(true)); this.addAbility(ability); } diff --git a/Mage.Sets/src/mage/sets/magic2012/CircleOfFlame.java b/Mage.Sets/src/mage/sets/magic2012/CircleOfFlame.java index 4900bc58ba..14c161ad33 100644 --- a/Mage.Sets/src/mage/sets/magic2012/CircleOfFlame.java +++ b/Mage.Sets/src/mage/sets/magic2012/CircleOfFlame.java @@ -55,7 +55,7 @@ public class CircleOfFlame extends CardImpl { this.color.setRed(true); // Whenever a creature without flying attacks you or a planeswalker you control, Circle of Flame deals 1 damage to that creature. - this.addAbility(new CircleOfFlameTriggeredAbility()); + this.addAbility(new CircleOfFlameTriggeredAbility()); } public CircleOfFlame(final CircleOfFlame card) { @@ -70,7 +70,7 @@ public class CircleOfFlame extends CardImpl { class CircleOfFlameTriggeredAbility extends TriggeredAbilityImpl { - public CircleOfFlameTriggeredAbility() { + public CircleOfFlameTriggeredAbility() { super(Constants.Zone.BATTLEFIELD, new DamageTargetEffect(1)); } @@ -87,31 +87,31 @@ class CircleOfFlameTriggeredAbility extends TriggeredAbilityImpl { - public CrownOfEmpires(UUID ownerId) { - super(ownerId, 203, "Crown of Empires", Rarity.UNCOMMON, new CardType[]{CardType.ARTIFACT}, "{2}"); - this.expansionSetCode = "M12"; + public CrownOfEmpires(UUID ownerId) { + super(ownerId, 203, "Crown of Empires", Rarity.UNCOMMON, new CardType[]{CardType.ARTIFACT}, "{2}"); + this.expansionSetCode = "M12"; - // {3}, {tap}: Tap target creature. Gain control of that creature instead if you control artifacts named Scepter of Empires and Throne of Empires. - Ability ability = new SimpleActivatedAbility(Constants.Zone.BATTLEFIELD, new CrownOfEmpiresEffect(), new GenericManaCost(3)); - ability.addTarget(new TargetCreaturePermanent()); - ability.addCost(new TapSourceCost()); - this.addAbility(ability); - } + // {3}, {tap}: Tap target creature. Gain control of that creature instead if you control artifacts named Scepter of Empires and Throne of Empires. + Ability ability = new SimpleActivatedAbility(Constants.Zone.BATTLEFIELD, new CrownOfEmpiresEffect(), new GenericManaCost(3)); + ability.addTarget(new TargetCreaturePermanent()); + ability.addCost(new TapSourceCost()); + this.addAbility(ability); + } - public CrownOfEmpires(final CrownOfEmpires card) { - super(card); - } + public CrownOfEmpires(final CrownOfEmpires card) { + super(card); + } - @Override - public CrownOfEmpires copy() { - return new CrownOfEmpires(this); - } + @Override + public CrownOfEmpires copy() { + return new CrownOfEmpires(this); + } } class CrownOfEmpiresEffect extends OneShotEffect { - public CrownOfEmpiresEffect() { - super(Constants.Outcome.Tap); - staticText = "Tap target creature. Gain control of that creature instead if you control artifacts named Scepter of Empires and Throne of Empires"; - } + public CrownOfEmpiresEffect() { + super(Constants.Outcome.Tap); + staticText = "Tap target creature. Gain control of that creature instead if you control artifacts named Scepter of Empires and Throne of Empires"; + } - public CrownOfEmpiresEffect(CrownOfEmpiresEffect effect) { - super(effect); - } + public CrownOfEmpiresEffect(CrownOfEmpiresEffect effect) { + super(effect); + } - @Override - public boolean apply(Game game, Ability source) { - Permanent target = game.getPermanent(targetPointer.getFirst(game, source)); - boolean scepter = false; - boolean throne = false; - for (Permanent permanent : game.getBattlefield().getAllActivePermanents(source.getControllerId())) { - if (permanent.getName().equals("Scepter of Empires")) { - scepter = true; - } else if (permanent.getName().equals("Throne of Empires")) { - throne = true; - } - if (scepter && throne) break; - } - if (scepter && throne) { - ContinuousEffect effect = new CrownOfEmpiresControlEffect(); - effect.setTargetPointer(new FixedTarget(target.getId())); - game.getState().setValue(source.getSourceId().toString(), source.getControllerId()); - game.addEffect(effect, source); - } else { - target.tap(game); - } - return false; - } + @Override + public boolean apply(Game game, Ability source) { + Permanent target = game.getPermanent(targetPointer.getFirst(game, source)); + boolean scepter = false; + boolean throne = false; + for (Permanent permanent : game.getBattlefield().getAllActivePermanents(source.getControllerId())) { + if (permanent.getName().equals("Scepter of Empires")) { + scepter = true; + } else if (permanent.getName().equals("Throne of Empires")) { + throne = true; + } + if (scepter && throne) break; + } + if (scepter && throne) { + ContinuousEffect effect = new CrownOfEmpiresControlEffect(); + effect.setTargetPointer(new FixedTarget(target.getId())); + game.getState().setValue(source.getSourceId().toString(), source.getControllerId()); + game.addEffect(effect, source); + } else { + target.tap(game); + } + return false; + } - @Override - public CrownOfEmpiresEffect copy() { - return new CrownOfEmpiresEffect(this); - } + @Override + public CrownOfEmpiresEffect copy() { + return new CrownOfEmpiresEffect(this); + } } class CrownOfEmpiresControlEffect extends ContinuousEffectImpl { - public CrownOfEmpiresControlEffect() { - super(Constants.Duration.EndOfGame, Constants.Layer.ControlChangingEffects_2, Constants.SubLayer.NA, Constants.Outcome.GainControl); - } + public CrownOfEmpiresControlEffect() { + super(Constants.Duration.EndOfGame, Constants.Layer.ControlChangingEffects_2, Constants.SubLayer.NA, Constants.Outcome.GainControl); + } - public CrownOfEmpiresControlEffect(final CrownOfEmpiresControlEffect effect) { - super(effect); - } + public CrownOfEmpiresControlEffect(final CrownOfEmpiresControlEffect effect) { + super(effect); + } - @Override - public CrownOfEmpiresControlEffect copy() { - return new CrownOfEmpiresControlEffect(this); - } + @Override + public CrownOfEmpiresControlEffect copy() { + return new CrownOfEmpiresControlEffect(this); + } - @Override - public boolean apply(Game game, Ability source) { - Permanent permanent = game.getPermanent(targetPointer.getFirst(game, source)); - UUID controllerId = (UUID) game.getState().getValue(source.getSourceId().toString()); - if (permanent != null && controllerId != null) { - return permanent.changeControllerId(controllerId, game); - } - return false; - } + @Override + public boolean apply(Game game, Ability source) { + Permanent permanent = game.getPermanent(targetPointer.getFirst(game, source)); + UUID controllerId = (UUID) game.getState().getValue(source.getSourceId().toString()); + if (permanent != null && controllerId != null) { + return permanent.changeControllerId(controllerId, game); + } + return false; + } - @Override - public String getText(Mode mode) { - return "Gain control of {this}"; - } + @Override + public String getText(Mode mode) { + return "Gain control of {this}"; + } } diff --git a/Mage.Sets/src/mage/sets/magic2012/DarkFavor.java b/Mage.Sets/src/mage/sets/magic2012/DarkFavor.java index f804c09d44..b124eabd00 100644 --- a/Mage.Sets/src/mage/sets/magic2012/DarkFavor.java +++ b/Mage.Sets/src/mage/sets/magic2012/DarkFavor.java @@ -55,11 +55,11 @@ public class DarkFavor extends CardImpl { this.subtype.add("Aura"); this.color.setBlack(true); TargetPermanent auraTarget = new TargetCreaturePermanent(); - this.getSpellAbility().addTarget(auraTarget); - this.getSpellAbility().addEffect(new AttachEffect(Constants.Outcome.BoostCreature)); - Ability ability = new EnchantAbility(auraTarget.getTargetName()); - this.addAbility(ability); - this.addAbility(new EntersBattlefieldTriggeredAbility(new LoseLifeSourceEffect(1), false)); + this.getSpellAbility().addTarget(auraTarget); + this.getSpellAbility().addEffect(new AttachEffect(Constants.Outcome.BoostCreature)); + Ability ability = new EnchantAbility(auraTarget.getTargetName()); + this.addAbility(ability); + this.addAbility(new EntersBattlefieldTriggeredAbility(new LoseLifeSourceEffect(1), false)); this.addAbility(new SimpleStaticAbility(Constants.Zone.BATTLEFIELD, new BoostEnchantedEffect(3, 1, Constants.Duration.WhileOnBattlefield))); } diff --git a/Mage.Sets/src/mage/sets/magic2012/Divination.java b/Mage.Sets/src/mage/sets/magic2012/Divination.java index f9f84ebd3c..862c2468ac 100644 --- a/Mage.Sets/src/mage/sets/magic2012/Divination.java +++ b/Mage.Sets/src/mage/sets/magic2012/Divination.java @@ -43,7 +43,7 @@ public class Divination extends CardImpl { public Divination (UUID ownerId) { super(ownerId, 50, "Divination", Rarity.COMMON, new CardType[]{CardType.SORCERY}, "{2}{U}"); this.expansionSetCode = "M12"; - this.color.setBlue(true); + this.color.setBlue(true); this.getSpellAbility().addEffect(new DrawCardControllerEffect(2)); } diff --git a/Mage.Sets/src/mage/sets/magic2012/DungroveElder.java b/Mage.Sets/src/mage/sets/magic2012/DungroveElder.java index 2120535a61..aa3305c358 100644 --- a/Mage.Sets/src/mage/sets/magic2012/DungroveElder.java +++ b/Mage.Sets/src/mage/sets/magic2012/DungroveElder.java @@ -59,7 +59,7 @@ public class DungroveElder extends CardImpl { this.expansionSetCode = "M12"; this.subtype.add("Treefolk"); - this.color.setGreen(true); + this.color.setGreen(true); this.power = new MageInt(0); this.toughness = new MageInt(0); diff --git a/Mage.Sets/src/mage/sets/magic2012/Firebreathing.java b/Mage.Sets/src/mage/sets/magic2012/Firebreathing.java index b6bf3fec2b..c74385a3b8 100644 --- a/Mage.Sets/src/mage/sets/magic2012/Firebreathing.java +++ b/Mage.Sets/src/mage/sets/magic2012/Firebreathing.java @@ -53,12 +53,12 @@ public class Firebreathing extends CardImpl { super(ownerId, 132, "Firebreathing", Rarity.COMMON, new CardType[]{CardType.ENCHANTMENT}, "{R}"); this.expansionSetCode = "M12"; this.subtype.add("Aura"); - this.color.setRed(true); + this.color.setRed(true); TargetPermanent auraTarget = new TargetCreaturePermanent(); - this.getSpellAbility().addTarget(auraTarget); - this.getSpellAbility().addEffect(new AttachEffect(Constants.Outcome.AddAbility)); - Ability ability = new EnchantAbility(auraTarget.getTargetName()); - this.addAbility(ability); + this.getSpellAbility().addTarget(auraTarget); + this.getSpellAbility().addEffect(new AttachEffect(Constants.Outcome.AddAbility)); + Ability ability = new EnchantAbility(auraTarget.getTargetName()); + this.addAbility(ability); this.addAbility(new SimpleActivatedAbility(Constants.Zone.BATTLEFIELD, new BoostEnchantedEffect(1, 0, Constants.Duration.EndOfTurn), new ColoredManaCost(Constants.ColoredManaSymbol.R))); } diff --git a/Mage.Sets/src/mage/sets/magic2012/Flight.java b/Mage.Sets/src/mage/sets/magic2012/Flight.java index 6e0271fa78..38458e7cb4 100644 --- a/Mage.Sets/src/mage/sets/magic2012/Flight.java +++ b/Mage.Sets/src/mage/sets/magic2012/Flight.java @@ -53,12 +53,12 @@ public class Flight extends CardImpl { super(ownerId, 53, "Flight", Rarity.COMMON, new CardType[]{CardType.ENCHANTMENT}, "{U}"); this.expansionSetCode = "M12"; this.subtype.add("Aura"); - this.color.setBlue(true); + this.color.setBlue(true); TargetPermanent auraTarget = new TargetCreaturePermanent(); - this.getSpellAbility().addTarget(auraTarget); - this.getSpellAbility().addEffect(new AttachEffect(Constants.Outcome.AddAbility)); - Ability ability = new EnchantAbility(auraTarget.getTargetName()); - this.addAbility(ability); + this.getSpellAbility().addTarget(auraTarget); + this.getSpellAbility().addEffect(new AttachEffect(Constants.Outcome.AddAbility)); + Ability ability = new EnchantAbility(auraTarget.getTargetName()); + this.addAbility(ability); this.addAbility(new SimpleStaticAbility(Constants.Zone.BATTLEFIELD, new GainAbilityAttachedEffect(FlyingAbility.getInstance(), Constants.AttachmentType.AURA))); } diff --git a/Mage.Sets/src/mage/sets/magic2012/FrostBreath.java b/Mage.Sets/src/mage/sets/magic2012/FrostBreath.java index 3aadb750e0..e415cd0e79 100644 --- a/Mage.Sets/src/mage/sets/magic2012/FrostBreath.java +++ b/Mage.Sets/src/mage/sets/magic2012/FrostBreath.java @@ -48,9 +48,9 @@ public class FrostBreath extends CardImpl { this.color.setBlue(true); // Tap up to two target creatures. Those creatures don't untap during their controller's next untap step. - this.getSpellAbility().addEffect(new TapTargetEffect()); - this.getSpellAbility().addTarget(new TargetCreaturePermanent(0, 2)); - this.getSpellAbility().addEffect(new SkipNextUntapTargetEffect()); + this.getSpellAbility().addEffect(new TapTargetEffect()); + this.getSpellAbility().addTarget(new TargetCreaturePermanent(0, 2)); + this.getSpellAbility().addEffect(new SkipNextUntapTargetEffect()); } public FrostBreath(final FrostBreath card) { diff --git a/Mage.Sets/src/mage/sets/magic2012/GarrukPrimalHunter.java b/Mage.Sets/src/mage/sets/magic2012/GarrukPrimalHunter.java index 0175538cb7..a5d0a9e866 100644 --- a/Mage.Sets/src/mage/sets/magic2012/GarrukPrimalHunter.java +++ b/Mage.Sets/src/mage/sets/magic2012/GarrukPrimalHunter.java @@ -70,7 +70,7 @@ public class GarrukPrimalHunter extends CardImpl { super(ownerId, 174, "Garruk, Primal Hunter", Rarity.MYTHIC, new CardType[]{CardType.PLANESWALKER}, "{2}{G}{G}{G}"); this.expansionSetCode = "M12"; this.subtype.add("Garruk"); - this.color.setGreen(true); + this.color.setGreen(true); this.addAbility(new EntersBattlefieldAbility(new AddCountersSourceEffect(CounterType.LOYALTY.createInstance(3)), "")); this.addAbility(new LoyaltyAbility(new CreateTokenEffect(new BeastToken()), 1)); this.addAbility(new LoyaltyAbility(new GarrukPrimalHunterEffect(), -3)); @@ -122,13 +122,13 @@ class GarrukPrimalHunterEffect extends OneShotEffect { class WurmToken extends Token { - public WurmToken() { - super("Wurm", "a 6/6 green Wurm creature token"); - cardType.add(CardType.CREATURE); - color = ObjectColor.GREEN; - subtype.add("Wurm"); - power = new MageInt(6); - toughness = new MageInt(6); - } + public WurmToken() { + super("Wurm", "a 6/6 green Wurm creature token"); + cardType.add(CardType.CREATURE); + color = ObjectColor.GREEN; + subtype.add("Wurm"); + power = new MageInt(6); + toughness = new MageInt(6); + } } \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/magic2012/GarruksHorde.java b/Mage.Sets/src/mage/sets/magic2012/GarruksHorde.java index c314187da9..c1806bdce2 100644 --- a/Mage.Sets/src/mage/sets/magic2012/GarruksHorde.java +++ b/Mage.Sets/src/mage/sets/magic2012/GarruksHorde.java @@ -45,28 +45,28 @@ import java.util.UUID; */ public class GarruksHorde extends CardImpl { - public GarruksHorde(UUID ownerId) { - super(ownerId, 176, "Garruk's Horde", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{5}{G}{G}"); - this.expansionSetCode = "M12"; - this.subtype.add("Beast"); + public GarruksHorde(UUID ownerId) { + super(ownerId, 176, "Garruk's Horde", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{5}{G}{G}"); + this.expansionSetCode = "M12"; + this.subtype.add("Beast"); - this.color.setGreen(true); - this.power = new MageInt(7); - this.toughness = new MageInt(7); + this.color.setGreen(true); + this.power = new MageInt(7); + this.toughness = new MageInt(7); - this.addAbility(TrampleAbility.getInstance()); - // Play with the top card of your library revealed. - this.addAbility(new SimpleStaticAbility(Constants.Zone.BATTLEFIELD, new PlayWithTheTopCardRevealedEffect())); - // You may cast the top card of your library if it's a creature card. - this.addAbility(new SimpleStaticAbility(Constants.Zone.BATTLEFIELD, new PlayTheTopCardEffect(new FilterCreatureCard()))); - } + this.addAbility(TrampleAbility.getInstance()); + // Play with the top card of your library revealed. + this.addAbility(new SimpleStaticAbility(Constants.Zone.BATTLEFIELD, new PlayWithTheTopCardRevealedEffect())); + // You may cast the top card of your library if it's a creature card. + this.addAbility(new SimpleStaticAbility(Constants.Zone.BATTLEFIELD, new PlayTheTopCardEffect(new FilterCreatureCard()))); + } - public GarruksHorde(final GarruksHorde card) { - super(card); - } + public GarruksHorde(final GarruksHorde card) { + super(card); + } - @Override - public GarruksHorde copy() { - return new GarruksHorde(this); - } + @Override + public GarruksHorde copy() { + return new GarruksHorde(this); + } } diff --git a/Mage.Sets/src/mage/sets/magic2012/GoblinBangchuckers.java b/Mage.Sets/src/mage/sets/magic2012/GoblinBangchuckers.java index fe5fbf3ee3..d7dd3d96cc 100644 --- a/Mage.Sets/src/mage/sets/magic2012/GoblinBangchuckers.java +++ b/Mage.Sets/src/mage/sets/magic2012/GoblinBangchuckers.java @@ -60,9 +60,9 @@ public class GoblinBangchuckers extends CardImpl { this.toughness = new MageInt(2); // {tap}: Flip a coin. If you win the flip, Goblin Bangchuckers deals 2 damage to target creature or player. If you lose the flip, Goblin Bangchuckers deals 2 damage to itself. - Ability ability = new SimpleActivatedAbility(Constants.Zone.BATTLEFIELD, new GoblinBangchuckersEffect(), new TapSourceCost()); - ability.addTarget(new TargetCreatureOrPlayer()); - this.addAbility(ability); + Ability ability = new SimpleActivatedAbility(Constants.Zone.BATTLEFIELD, new GoblinBangchuckersEffect(), new TapSourceCost()); + ability.addTarget(new TargetCreatureOrPlayer()); + this.addAbility(ability); } public GoblinBangchuckers(final GoblinBangchuckers card) { @@ -77,43 +77,43 @@ public class GoblinBangchuckers extends CardImpl { class GoblinBangchuckersEffect extends OneShotEffect { - public GoblinBangchuckersEffect() { - super(Constants.Outcome.Damage); - staticText = "{tap}: Flip a coin. If you win the flip, Goblin Bangchuckers deals 2 damage to target creature or player. If you lose the flip, Goblin Bangchuckers deals 2 damage to itself"; - } + public GoblinBangchuckersEffect() { + super(Constants.Outcome.Damage); + staticText = "{tap}: Flip a coin. If you win the flip, Goblin Bangchuckers deals 2 damage to target creature or player. If you lose the flip, Goblin Bangchuckers deals 2 damage to itself"; + } - public GoblinBangchuckersEffect(GoblinBangchuckersEffect effect) { - super(effect); - } + public GoblinBangchuckersEffect(GoblinBangchuckersEffect effect) { + super(effect); + } - @Override - public boolean apply(Game game, Ability source) { - Player controller = game.getPlayer(source.getControllerId()); - if (controller != null) { - if (controller.flipCoin(game)) { - Permanent permanent = game.getPermanent(targetPointer.getFirst(game, source)); - if (permanent != null) { - permanent.damage(2, source.getSourceId(), game, true, false); - return true; - } - Player player = game.getPlayer(targetPointer.getFirst(game, source)); - if (player != null) { - player.damage(2, source.getSourceId(), game, false, true); - return true; - } - } else { - Permanent permanent = game.getPermanent(source.getSourceId()); - if (permanent != null) { - permanent.damage(2, source.getSourceId(), game, true, false); - return true; - } - } - } - return false; - } + @Override + public boolean apply(Game game, Ability source) { + Player controller = game.getPlayer(source.getControllerId()); + if (controller != null) { + if (controller.flipCoin(game)) { + Permanent permanent = game.getPermanent(targetPointer.getFirst(game, source)); + if (permanent != null) { + permanent.damage(2, source.getSourceId(), game, true, false); + return true; + } + Player player = game.getPlayer(targetPointer.getFirst(game, source)); + if (player != null) { + player.damage(2, source.getSourceId(), game, false, true); + return true; + } + } else { + Permanent permanent = game.getPermanent(source.getSourceId()); + if (permanent != null) { + permanent.damage(2, source.getSourceId(), game, true, false); + return true; + } + } + } + return false; + } - @Override - public GoblinBangchuckersEffect copy() { - return new GoblinBangchuckersEffect(this); - } + @Override + public GoblinBangchuckersEffect copy() { + return new GoblinBangchuckersEffect(this); + } } diff --git a/Mage.Sets/src/mage/sets/magic2012/GrandAbolisher.java b/Mage.Sets/src/mage/sets/magic2012/GrandAbolisher.java index b743d4b137..5fcbc67f36 100644 --- a/Mage.Sets/src/mage/sets/magic2012/GrandAbolisher.java +++ b/Mage.Sets/src/mage/sets/magic2012/GrandAbolisher.java @@ -48,81 +48,81 @@ import java.util.UUID; */ public class GrandAbolisher extends CardImpl { - public GrandAbolisher(UUID ownerId) { - super(ownerId, 19, "Grand Abolisher", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{W}{W}"); - this.expansionSetCode = "M12"; - this.subtype.add("Human"); - this.subtype.add("Cleric"); + public GrandAbolisher(UUID ownerId) { + super(ownerId, 19, "Grand Abolisher", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{W}{W}"); + this.expansionSetCode = "M12"; + this.subtype.add("Human"); + this.subtype.add("Cleric"); - this.color.setWhite(true); - this.power = new MageInt(2); - this.toughness = new MageInt(2); + this.color.setWhite(true); + this.power = new MageInt(2); + this.toughness = new MageInt(2); - // During your turn, your opponents can't cast spells or activate abilities of artifacts, creatures, or enchantments. - this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GrandAbolisherEffect())); - } + // During your turn, your opponents can't cast spells or activate abilities of artifacts, creatures, or enchantments. + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GrandAbolisherEffect())); + } - public GrandAbolisher(final GrandAbolisher card) { - super(card); - } + public GrandAbolisher(final GrandAbolisher card) { + super(card); + } - @Override - public GrandAbolisher copy() { - return new GrandAbolisher(this); - } + @Override + public GrandAbolisher copy() { + return new GrandAbolisher(this); + } } class GrandAbolisherEffect extends ReplacementEffectImpl { - public GrandAbolisherEffect() { - super(Constants.Duration.WhileOnBattlefield, Constants.Outcome.Benefit); - } + public GrandAbolisherEffect() { + super(Constants.Duration.WhileOnBattlefield, Constants.Outcome.Benefit); + } - public GrandAbolisherEffect(final GrandAbolisherEffect effect) { - super(effect); - staticText = "During your turn, your opponents can't cast spells or activate abilities of artifacts, creatures, or enchantments"; - } + public GrandAbolisherEffect(final GrandAbolisherEffect effect) { + super(effect); + staticText = "During your turn, your opponents can't cast spells or activate abilities of artifacts, creatures, or enchantments"; + } - @Override - public GrandAbolisherEffect copy() { - return new GrandAbolisherEffect(this); - } + @Override + public GrandAbolisherEffect copy() { + return new GrandAbolisherEffect(this); + } - @Override - public boolean apply(Game game, Ability source) { - return true; - } + @Override + public boolean apply(Game game, Ability source) { + return true; + } - @Override - public boolean replaceEvent(GameEvent event, Ability source, Game game) { - return true; - } + @Override + public boolean replaceEvent(GameEvent event, Ability source, Game game) { + return true; + } - @Override - public boolean applies(GameEvent event, Ability source, Game game) { - boolean spell = event.getType() == GameEvent.EventType.CAST_SPELL; - boolean activated = event.getType() == GameEvent.EventType.ACTIVATE_ABILITY; - if ((spell || activated) && game.getActivePlayerId().equals(source.getControllerId()) && game.getOpponents(source.getControllerId()).contains(event.getPlayerId())) { + @Override + public boolean applies(GameEvent event, Ability source, Game game) { + boolean spell = event.getType() == GameEvent.EventType.CAST_SPELL; + boolean activated = event.getType() == GameEvent.EventType.ACTIVATE_ABILITY; + if ((spell || activated) && game.getActivePlayerId().equals(source.getControllerId()) && game.getOpponents(source.getControllerId()).contains(event.getPlayerId())) { - if (spell) { - return true; - } + if (spell) { + return true; + } - // check source of activated ability - Permanent permanent = game.getPermanent(event.getSourceId()); - if (permanent != null) { - return permanent.getCardType().contains(CardType.ARTIFACT) || permanent.getCardType().contains(CardType.CREATURE) - || permanent.getCardType().contains(CardType.ENCHANTMENT); - } else { - MageObject object = game.getObject(event.getSourceId()); - if (object != null) { - return object.getCardType().contains(CardType.ARTIFACT) || object.getCardType().contains(CardType.CREATURE) - || object.getCardType().contains(CardType.ENCHANTMENT); - } - } - } + // check source of activated ability + Permanent permanent = game.getPermanent(event.getSourceId()); + if (permanent != null) { + return permanent.getCardType().contains(CardType.ARTIFACT) || permanent.getCardType().contains(CardType.CREATURE) + || permanent.getCardType().contains(CardType.ENCHANTMENT); + } else { + MageObject object = game.getObject(event.getSourceId()); + if (object != null) { + return object.getCardType().contains(CardType.ARTIFACT) || object.getCardType().contains(CardType.CREATURE) + || object.getCardType().contains(CardType.ENCHANTMENT); + } + } + } - return false; - } + return false; + } } diff --git a/Mage.Sets/src/mage/sets/magic2012/GuardiansPledge.java b/Mage.Sets/src/mage/sets/magic2012/GuardiansPledge.java index bb4745a682..2f38ea6fbf 100644 --- a/Mage.Sets/src/mage/sets/magic2012/GuardiansPledge.java +++ b/Mage.Sets/src/mage/sets/magic2012/GuardiansPledge.java @@ -53,7 +53,7 @@ public class GuardiansPledge extends CardImpl { public GuardiansPledge (UUID ownerId) { super(ownerId, 22, "Guardians' Pledge", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{1}{W}{W}"); this.expansionSetCode = "M12"; - this.color.setWhite(true); + this.color.setWhite(true); this.getSpellAbility().addEffect(new BoostControlledEffect(2, 2, Constants.Duration.EndOfTurn, filter, false)); } diff --git a/Mage.Sets/src/mage/sets/magic2012/JaceMemoryAdept.java b/Mage.Sets/src/mage/sets/magic2012/JaceMemoryAdept.java index 61e236fdd9..afdf6760a7 100644 --- a/Mage.Sets/src/mage/sets/magic2012/JaceMemoryAdept.java +++ b/Mage.Sets/src/mage/sets/magic2012/JaceMemoryAdept.java @@ -50,72 +50,72 @@ import java.util.UUID; */ public class JaceMemoryAdept extends CardImpl { - public JaceMemoryAdept(UUID ownerId) { - super(ownerId, 58, "Jace, Memory Adept", Rarity.MYTHIC, new CardType[]{CardType.PLANESWALKER}, "{3}{U}{U}"); - this.expansionSetCode = "M12"; - this.subtype.add("Jace"); + public JaceMemoryAdept(UUID ownerId) { + super(ownerId, 58, "Jace, Memory Adept", Rarity.MYTHIC, new CardType[]{CardType.PLANESWALKER}, "{3}{U}{U}"); + this.expansionSetCode = "M12"; + this.subtype.add("Jace"); - this.color.setBlue(true); + this.color.setBlue(true); - this.addAbility(new EntersBattlefieldAbility(new AddCountersSourceEffect(CounterType.LOYALTY.createInstance(4)))); + this.addAbility(new EntersBattlefieldAbility(new AddCountersSourceEffect(CounterType.LOYALTY.createInstance(4)))); - // +1: Draw a card. Target player puts the top card of his or her library into his or her graveyard. - LoyaltyAbility ability1 = new LoyaltyAbility(new DrawCardControllerEffect(1), 1); - ability1.addEffect(new PutLibraryIntoGraveTargetEffect(1)); - ability1.addTarget(new TargetPlayer()); - this.addAbility(ability1); + // +1: Draw a card. Target player puts the top card of his or her library into his or her graveyard. + LoyaltyAbility ability1 = new LoyaltyAbility(new DrawCardControllerEffect(1), 1); + ability1.addEffect(new PutLibraryIntoGraveTargetEffect(1)); + ability1.addTarget(new TargetPlayer()); + this.addAbility(ability1); - // 0: Target player puts the top ten cards of his or her library into his or her graveyard. - LoyaltyAbility ability2 = new LoyaltyAbility(new PutLibraryIntoGraveTargetEffect(10), 0); - ability2.addTarget(new TargetPlayer()); - this.addAbility(ability2); + // 0: Target player puts the top ten cards of his or her library into his or her graveyard. + LoyaltyAbility ability2 = new LoyaltyAbility(new PutLibraryIntoGraveTargetEffect(10), 0); + ability2.addTarget(new TargetPlayer()); + this.addAbility(ability2); - // -7: Any number of target players each draw twenty cards. - LoyaltyAbility ability3 = new LoyaltyAbility(new JaceMemoryAdeptEffect(20), -7); - ability3.addTarget(new TargetPlayer(0, Integer.MAX_VALUE, false)); //any number - this.addAbility(ability3); - } + // -7: Any number of target players each draw twenty cards. + LoyaltyAbility ability3 = new LoyaltyAbility(new JaceMemoryAdeptEffect(20), -7); + ability3.addTarget(new TargetPlayer(0, Integer.MAX_VALUE, false)); //any number + this.addAbility(ability3); + } - public JaceMemoryAdept(final JaceMemoryAdept card) { - super(card); - } + public JaceMemoryAdept(final JaceMemoryAdept card) { + super(card); + } - @Override - public JaceMemoryAdept copy() { - return new JaceMemoryAdept(this); - } + @Override + public JaceMemoryAdept copy() { + return new JaceMemoryAdept(this); + } } class JaceMemoryAdeptEffect extends DrawCardTargetEffect { - public JaceMemoryAdeptEffect(int amount) { - super(amount); - staticText = "Any number of target players each draw twenty cards"; - } + public JaceMemoryAdeptEffect(int amount) { + super(amount); + staticText = "Any number of target players each draw twenty cards"; + } - public JaceMemoryAdeptEffect(final DrawCardTargetEffect effect) { - super(effect); - } + public JaceMemoryAdeptEffect(final DrawCardTargetEffect effect) { + super(effect); + } - @Override - public boolean apply(Game game, Ability source) { - for (UUID target : targetPointer.getTargets(game, source)) { - Player player = game.getPlayer(target); - if (player != null) { - player.drawCards(amount.calculate(game, source), game); - } - } - return true; - } + @Override + public boolean apply(Game game, Ability source) { + for (UUID target : targetPointer.getTargets(game, source)) { + Player player = game.getPlayer(target); + if (player != null) { + player.drawCards(amount.calculate(game, source), game); + } + } + return true; + } - @Override - public String getText(Mode mode) { - return staticText; - } + @Override + public String getText(Mode mode) { + return staticText; + } - public JaceMemoryAdeptEffect copy() { - return new JaceMemoryAdeptEffect(this); - } + public JaceMemoryAdeptEffect copy() { + return new JaceMemoryAdeptEffect(this); + } } diff --git a/Mage.Sets/src/mage/sets/magic2012/KiteShield.java b/Mage.Sets/src/mage/sets/magic2012/KiteShield.java index c3753613d6..c91a103dee 100644 --- a/Mage.Sets/src/mage/sets/magic2012/KiteShield.java +++ b/Mage.Sets/src/mage/sets/magic2012/KiteShield.java @@ -51,7 +51,7 @@ public class KiteShield extends CardImpl { this.subtype.add("Equipment"); this.addAbility(new SimpleStaticAbility(Constants.Zone.BATTLEFIELD, new BoostEquippedEffect(0, 3))); this.addAbility(new EquipAbility(Constants.Outcome.AddAbility, new GenericManaCost(3))); - + } public KiteShield (final KiteShield card) { diff --git a/Mage.Sets/src/mage/sets/magic2012/Levitation.java b/Mage.Sets/src/mage/sets/magic2012/Levitation.java index a465c6d72b..e163ab34d8 100644 --- a/Mage.Sets/src/mage/sets/magic2012/Levitation.java +++ b/Mage.Sets/src/mage/sets/magic2012/Levitation.java @@ -54,7 +54,7 @@ public class Levitation extends CardImpl { public Levitation (UUID ownerId) { super(ownerId, 61, "Levitation", Rarity.UNCOMMON, new CardType[]{CardType.ENCHANTMENT}, "{2}{U}{U}"); this.expansionSetCode = "M12"; - this.color.setBlue(true); + this.color.setBlue(true); this.addAbility(new SimpleStaticAbility(Constants.Zone.BATTLEFIELD, new GainAbilityControlledEffect(FlyingAbility.getInstance(), Constants.Duration.WhileOnBattlefield, filter, false))); } diff --git a/Mage.Sets/src/mage/sets/magic2012/Lifelink.java b/Mage.Sets/src/mage/sets/magic2012/Lifelink.java index 7130d08da0..5a1c3788a9 100644 --- a/Mage.Sets/src/mage/sets/magic2012/Lifelink.java +++ b/Mage.Sets/src/mage/sets/magic2012/Lifelink.java @@ -53,13 +53,13 @@ public class Lifelink extends CardImpl { super(ownerId, 24, "Lifelink", Rarity.COMMON, new CardType[]{CardType.ENCHANTMENT}, "{W}"); this.expansionSetCode = "M12"; this.subtype.add("Aura"); - this.color.setWhite(true); + this.color.setWhite(true); TargetPermanent auraTarget = new TargetCreaturePermanent(); - this.getSpellAbility().addTarget(auraTarget); - this.getSpellAbility().addEffect(new AttachEffect(Constants.Outcome.AddAbility)); - Ability ability = new EnchantAbility(auraTarget.getTargetName()); - this.addAbility(ability); - this.addAbility(new SimpleStaticAbility(Constants.Zone.BATTLEFIELD, new GainAbilityAttachedEffect(LifelinkAbility.getInstance(), Constants.AttachmentType.AURA))); + this.getSpellAbility().addTarget(auraTarget); + this.getSpellAbility().addEffect(new AttachEffect(Constants.Outcome.AddAbility)); + Ability ability = new EnchantAbility(auraTarget.getTargetName()); + this.addAbility(ability); + this.addAbility(new SimpleStaticAbility(Constants.Zone.BATTLEFIELD, new GainAbilityAttachedEffect(LifelinkAbility.getInstance(), Constants.AttachmentType.AURA))); } public Lifelink (final Lifelink card) { diff --git a/Mage.Sets/src/mage/sets/magic2012/Monomania.java b/Mage.Sets/src/mage/sets/magic2012/Monomania.java index 534536805e..2fc7814875 100644 --- a/Mage.Sets/src/mage/sets/magic2012/Monomania.java +++ b/Mage.Sets/src/mage/sets/magic2012/Monomania.java @@ -55,8 +55,8 @@ public class Monomania extends CardImpl { this.color.setBlack(true); // Target player chooses a card in his or her hand and discards the rest. - this.getSpellAbility().addEffect(new MonomaniaEffect()); - this.getSpellAbility().addTarget(new TargetPlayer()); + this.getSpellAbility().addEffect(new MonomaniaEffect()); + this.getSpellAbility().addTarget(new TargetPlayer()); } public Monomania(final Monomania card) { @@ -71,44 +71,44 @@ public class Monomania extends CardImpl { class MonomaniaEffect extends OneShotEffect { - private static final FilterCard filter = new FilterCard("a card"); + private static final FilterCard filter = new FilterCard("a card"); - public MonomaniaEffect() { - super(Constants.Outcome.Discard); - staticText = "Target player chooses a card in his or her hand and discards the rest"; - } + public MonomaniaEffect() { + super(Constants.Outcome.Discard); + staticText = "Target player chooses a card in his or her hand and discards the rest"; + } - public MonomaniaEffect(final MonomaniaEffect effect) { - super(effect); - } + public MonomaniaEffect(final MonomaniaEffect effect) { + super(effect); + } - @Override - public boolean apply(Game game, Ability source) { - Player player = game.getPlayer(source.getFirstTarget()); - if (player != null) { - TargetCard target = new TargetCard(Constants.Zone.PICK, filter); - target.setRequired(true); - if (player.choose(Constants.Outcome.Detriment, player.getHand(), target, game)) { - while (player.getHand().size() > 1) { - for (UUID uuid : player.getHand()) { - if (!uuid.equals(target.getFirstTarget())) { - Card card = player.getHand().get(uuid, game); - if (card != null) { - player.discard(card, source, game); - break; - } - } - } - } - return true; - } - } - return false; - } + @Override + public boolean apply(Game game, Ability source) { + Player player = game.getPlayer(source.getFirstTarget()); + if (player != null) { + TargetCard target = new TargetCard(Constants.Zone.PICK, filter); + target.setRequired(true); + if (player.choose(Constants.Outcome.Detriment, player.getHand(), target, game)) { + while (player.getHand().size() > 1) { + for (UUID uuid : player.getHand()) { + if (!uuid.equals(target.getFirstTarget())) { + Card card = player.getHand().get(uuid, game); + if (card != null) { + player.discard(card, source, game); + break; + } + } + } + } + return true; + } + } + return false; + } - @Override - public MonomaniaEffect copy() { - return new MonomaniaEffect(this); - } + @Override + public MonomaniaEffect copy() { + return new MonomaniaEffect(this); + } } diff --git a/Mage.Sets/src/mage/sets/magic2012/PersonalSanctuary.java b/Mage.Sets/src/mage/sets/magic2012/PersonalSanctuary.java index 640e5f39e3..e9232b6120 100644 --- a/Mage.Sets/src/mage/sets/magic2012/PersonalSanctuary.java +++ b/Mage.Sets/src/mage/sets/magic2012/PersonalSanctuary.java @@ -52,7 +52,7 @@ public class PersonalSanctuary extends CardImpl { this.color.setWhite(true); // During your turn, prevent all damage that would be dealt to you. - this.addAbility(new SimpleStaticAbility(Constants.Zone.BATTLEFIELD, new PersonalSanctuaryEffect())); + this.addAbility(new SimpleStaticAbility(Constants.Zone.BATTLEFIELD, new PersonalSanctuaryEffect())); } public PersonalSanctuary(final PersonalSanctuary card) { @@ -67,43 +67,43 @@ public class PersonalSanctuary extends CardImpl { class PersonalSanctuaryEffect extends PreventionEffectImpl { - public PersonalSanctuaryEffect() { - super(Constants.Duration.WhileOnBattlefield); - staticText = "During your turn, prevent all damage that would be dealt to you"; - } + public PersonalSanctuaryEffect() { + super(Constants.Duration.WhileOnBattlefield); + staticText = "During your turn, prevent all damage that would be dealt to you"; + } - public PersonalSanctuaryEffect(PersonalSanctuaryEffect effect) { - super(effect); - } + public PersonalSanctuaryEffect(PersonalSanctuaryEffect effect) { + super(effect); + } - @Override - public boolean replaceEvent(GameEvent event, Ability source, Game game) { - GameEvent preventEvent = new GameEvent(GameEvent.EventType.PREVENT_DAMAGE, source.getFirstTarget(), source.getId(), source.getControllerId(), event.getAmount(), false); - if (!game.replaceEvent(preventEvent)) { - int damage = event.getAmount(); - event.setAmount(0); - game.informPlayers("Damage has been prevented: " + damage); - game.fireEvent(GameEvent.getEvent(GameEvent.EventType.PREVENTED_DAMAGE, source.getFirstTarget(), source.getId(), source.getControllerId(), damage)); - } - return false; - } + @Override + public boolean replaceEvent(GameEvent event, Ability source, Game game) { + GameEvent preventEvent = new GameEvent(GameEvent.EventType.PREVENT_DAMAGE, source.getFirstTarget(), source.getId(), source.getControllerId(), event.getAmount(), false); + if (!game.replaceEvent(preventEvent)) { + int damage = event.getAmount(); + event.setAmount(0); + game.informPlayers("Damage has been prevented: " + damage); + game.fireEvent(GameEvent.getEvent(GameEvent.EventType.PREVENTED_DAMAGE, source.getFirstTarget(), source.getId(), source.getControllerId(), damage)); + } + return false; + } - @Override - public boolean apply(Game game, Ability source) { - return true; - } + @Override + public boolean apply(Game game, Ability source) { + return true; + } - @Override - public boolean applies(GameEvent event, Ability source, Game game) { - if (event.getType().equals(GameEvent.EventType.DAMAGE_PLAYER)) { - if (event.getTargetId().equals(source.getControllerId()) && game.getActivePlayerId().equals(source.getControllerId())) - return super.applies(event, source, game); - } - return false; - } + @Override + public boolean applies(GameEvent event, Ability source, Game game) { + if (event.getType().equals(GameEvent.EventType.DAMAGE_PLAYER)) { + if (event.getTargetId().equals(source.getControllerId()) && game.getActivePlayerId().equals(source.getControllerId())) + return super.applies(event, source, game); + } + return false; + } - @Override - public PersonalSanctuaryEffect copy() { - return new PersonalSanctuaryEffect(this); - } + @Override + public PersonalSanctuaryEffect copy() { + return new PersonalSanctuaryEffect(this); + } } diff --git a/Mage.Sets/src/mage/sets/magic2012/PhantasmalImage.java b/Mage.Sets/src/mage/sets/magic2012/PhantasmalImage.java index 81fcf0e71f..84f2d6b1c2 100644 --- a/Mage.Sets/src/mage/sets/magic2012/PhantasmalImage.java +++ b/Mage.Sets/src/mage/sets/magic2012/PhantasmalImage.java @@ -66,7 +66,7 @@ public class PhantasmalImage extends CardImpl { this.toughness = new MageInt(0); Ability ability = new EntersBattlefieldAbility(new EntersBattlefieldEffect(new PhantasmalImageCopyEffect(), abilityText)); - this.addAbility(ability); + this.addAbility(ability); } public PhantasmalImage(final PhantasmalImage card) { @@ -82,7 +82,7 @@ public class PhantasmalImage extends CardImpl { class PhantasmalImageCopyEffect extends OneShotEffect { public PhantasmalImageCopyEffect() { - super(Outcome.Copy); + super(Outcome.Copy); } public PhantasmalImageCopyEffect(final PhantasmalImageCopyEffect effect) { @@ -91,10 +91,10 @@ class PhantasmalImageCopyEffect extends OneShotEffect @Override public boolean apply(Game game, Ability source) { - Player player = game.getPlayer(source.getControllerId()); + Player player = game.getPlayer(source.getControllerId()); Permanent sourcePermanent = game.getPermanent(source.getSourceId()); if (player != null && sourcePermanent != null) { - Target target = new TargetPermanent(new FilterCreaturePermanent()); + Target target = new TargetPermanent(new FilterCreaturePermanent()); if (target.canChoose(source.getControllerId(), game)) { target.setRequired(true); target.setNotTarget(true); @@ -111,11 +111,11 @@ class PhantasmalImageCopyEffect extends OneShotEffect } }); - return true; + return true; } } - } - return false; + } + return false; } @Override diff --git a/Mage.Sets/src/mage/sets/magic2012/PrimordialHydra.java b/Mage.Sets/src/mage/sets/magic2012/PrimordialHydra.java index 0baa19f026..4df0515033 100644 --- a/Mage.Sets/src/mage/sets/magic2012/PrimordialHydra.java +++ b/Mage.Sets/src/mage/sets/magic2012/PrimordialHydra.java @@ -56,7 +56,7 @@ import java.util.UUID; */ public class PrimordialHydra extends CardImpl { - private final static String staticText = "{this} has trample as long as it has ten or more +1/+1 counters on it"; + private final static String staticText = "{this} has trample as long as it has ten or more +1/+1 counters on it"; public PrimordialHydra(UUID ownerId) { super(ownerId, 189, "Primordial Hydra", Rarity.MYTHIC, new CardType[]{CardType.CREATURE}, "{X}{G}{G}"); @@ -72,7 +72,7 @@ public class PrimordialHydra extends CardImpl { ConditionalContinousEffect effect = new ConditionalContinousEffect(new GainAbilitySourceEffect(TrampleAbility.getInstance()), new HasCounterCondition(CounterType.P1P1, 10), staticText); this.addAbility(new SimpleStaticAbility(Constants.Zone.BATTLEFIELD, effect)); - } + } public PrimordialHydra(final PrimordialHydra card) { super(card); diff --git a/Mage.Sets/src/mage/sets/magic2012/RitesOfFlourishing.java b/Mage.Sets/src/mage/sets/magic2012/RitesOfFlourishing.java index 332ee00c35..1f31fe0d56 100644 --- a/Mage.Sets/src/mage/sets/magic2012/RitesOfFlourishing.java +++ b/Mage.Sets/src/mage/sets/magic2012/RitesOfFlourishing.java @@ -45,61 +45,61 @@ import mage.target.targetpointer.FixedTarget; */ public class RitesOfFlourishing extends CardImpl { - public RitesOfFlourishing(UUID ownerId) { - super(ownerId, 192, "Rites of Flourishing", Rarity.RARE, new CardType[]{CardType.ENCHANTMENT}, "{2}{G}"); - this.expansionSetCode = "M12"; + public RitesOfFlourishing(UUID ownerId) { + super(ownerId, 192, "Rites of Flourishing", Rarity.RARE, new CardType[]{CardType.ENCHANTMENT}, "{2}{G}"); + this.expansionSetCode = "M12"; - this.color.setGreen(true); + this.color.setGreen(true); - // At the beginning of each player's draw step, that player draws an additional card. - this.addAbility(new RitesOfFlourishingAbility()); + // At the beginning of each player's draw step, that player draws an additional card. + this.addAbility(new RitesOfFlourishingAbility()); - // Each player may play an additional land on each of his or her turns. - this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new PlayAdditionalLandsAllEffect())); - } + // Each player may play an additional land on each of his or her turns. + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new PlayAdditionalLandsAllEffect())); + } - public RitesOfFlourishing(final RitesOfFlourishing card) { - super(card); - } + public RitesOfFlourishing(final RitesOfFlourishing card) { + super(card); + } - @Override - public RitesOfFlourishing copy() { - return new RitesOfFlourishing(this); - } + @Override + public RitesOfFlourishing copy() { + return new RitesOfFlourishing(this); + } } class RitesOfFlourishingAbility extends TriggeredAbilityImpl { - public RitesOfFlourishingAbility() { - super(Zone.BATTLEFIELD, new DrawCardTargetEffect(1)); - } + public RitesOfFlourishingAbility() { + super(Zone.BATTLEFIELD, new DrawCardTargetEffect(1)); + } - public RitesOfFlourishingAbility(final RitesOfFlourishingAbility ability) { - super(ability); - } + public RitesOfFlourishingAbility(final RitesOfFlourishingAbility ability) { + super(ability); + } - @Override - public RitesOfFlourishingAbility copy() { - return new RitesOfFlourishingAbility(this); - } + @Override + public RitesOfFlourishingAbility copy() { + return new RitesOfFlourishingAbility(this); + } - @Override - public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == GameEvent.EventType.DRAW_STEP_PRE) { - this.getEffects().get(0).setTargetPointer(new FixedTarget(event.getPlayerId())); - return true; - } - return false; - } + @Override + public boolean checkTrigger(GameEvent event, Game game) { + if (event.getType() == GameEvent.EventType.DRAW_STEP_PRE) { + this.getEffects().get(0).setTargetPointer(new FixedTarget(event.getPlayerId())); + return true; + } + return false; + } - @Override - public boolean checkInterveningIfClause(Game game) { - return !game.getPermanent(this.sourceId).isTapped(); - } + @Override + public boolean checkInterveningIfClause(Game game) { + return !game.getPermanent(this.sourceId).isTapped(); + } - @Override - public String getRule() { - return "At the beginning of each player's draw step, that player draws an additional card."; - } + @Override + public String getRule() { + return "At the beginning of each player's draw step, that player draws an additional card."; + } } diff --git a/Mage.Sets/src/mage/sets/magic2012/RuneScarredDemon.java b/Mage.Sets/src/mage/sets/magic2012/RuneScarredDemon.java index faf26a2a25..341a4f5a01 100644 --- a/Mage.Sets/src/mage/sets/magic2012/RuneScarredDemon.java +++ b/Mage.Sets/src/mage/sets/magic2012/RuneScarredDemon.java @@ -49,8 +49,8 @@ public class RuneScarredDemon extends CardImpl { super(ownerId, 106, "Rune-Scarred Demon", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{5}{B}{B}"); this.expansionSetCode = "M12"; this.subtype.add("Demon"); - this.color.setBlack(true); - this.color.setBlack(true); + this.color.setBlack(true); + this.color.setBlack(true); this.power = new MageInt(6 ); this.toughness = new MageInt( 6); this.addAbility(FlyingAbility.getInstance()); diff --git a/Mage.Sets/src/mage/sets/magic2012/ScepterOfEmpires.java b/Mage.Sets/src/mage/sets/magic2012/ScepterOfEmpires.java index e86b58e9da..7549cb2cf5 100644 --- a/Mage.Sets/src/mage/sets/magic2012/ScepterOfEmpires.java +++ b/Mage.Sets/src/mage/sets/magic2012/ScepterOfEmpires.java @@ -48,63 +48,63 @@ import java.util.UUID; */ public class ScepterOfEmpires extends CardImpl { - public ScepterOfEmpires(UUID ownerId) { - super(ownerId, 216, "Scepter of Empires", Rarity.UNCOMMON, new CardType[]{CardType.ARTIFACT}, "{3}"); - this.expansionSetCode = "M12"; + public ScepterOfEmpires(UUID ownerId) { + super(ownerId, 216, "Scepter of Empires", Rarity.UNCOMMON, new CardType[]{CardType.ARTIFACT}, "{3}"); + this.expansionSetCode = "M12"; - // {tap}: Scepter of Empires deals 1 damage to target player. It deals 3 damage to that player instead if you control artifacts named Crown of Empires and Throne of Empires. - Ability ability = new SimpleActivatedAbility(Constants.Zone.BATTLEFIELD, new ScepterOfEmpiresEffect(), new GenericManaCost(0)); - ability.addCost(new TapSourceCost()); - ability.addTarget(new TargetPlayer()); - this.addAbility(ability); - } + // {tap}: Scepter of Empires deals 1 damage to target player. It deals 3 damage to that player instead if you control artifacts named Crown of Empires and Throne of Empires. + Ability ability = new SimpleActivatedAbility(Constants.Zone.BATTLEFIELD, new ScepterOfEmpiresEffect(), new GenericManaCost(0)); + ability.addCost(new TapSourceCost()); + ability.addTarget(new TargetPlayer()); + this.addAbility(ability); + } - public ScepterOfEmpires(final ScepterOfEmpires card) { - super(card); - } + public ScepterOfEmpires(final ScepterOfEmpires card) { + super(card); + } - @Override - public ScepterOfEmpires copy() { - return new ScepterOfEmpires(this); - } + @Override + public ScepterOfEmpires copy() { + return new ScepterOfEmpires(this); + } } class ScepterOfEmpiresEffect extends OneShotEffect { - public ScepterOfEmpiresEffect() { - super(Constants.Outcome.PutCreatureInPlay); - staticText = "Scepter of Empires deals 1 damage to target player. It deals 3 damage to that player instead if you control artifacts named Crown of Empires and Throne of Empires"; - } + public ScepterOfEmpiresEffect() { + super(Constants.Outcome.PutCreatureInPlay); + staticText = "Scepter of Empires deals 1 damage to target player. It deals 3 damage to that player instead if you control artifacts named Crown of Empires and Throne of Empires"; + } - public ScepterOfEmpiresEffect(ScepterOfEmpiresEffect effect) { - super(effect); - } + public ScepterOfEmpiresEffect(ScepterOfEmpiresEffect effect) { + super(effect); + } - @Override - public boolean apply(Game game, Ability source) { - boolean throne = false; - boolean crown = false; - for (Permanent permanent : game.getBattlefield().getAllActivePermanents(source.getControllerId())) { - if (permanent.getName().equals("Throne of Empires")) { - throne = true; - } else if (permanent.getName().equals("Crown of Empires")) { - crown = true; - } - if (throne && crown) break; - } + @Override + public boolean apply(Game game, Ability source) { + boolean throne = false; + boolean crown = false; + for (Permanent permanent : game.getBattlefield().getAllActivePermanents(source.getControllerId())) { + if (permanent.getName().equals("Throne of Empires")) { + throne = true; + } else if (permanent.getName().equals("Crown of Empires")) { + crown = true; + } + if (throne && crown) break; + } - int amount = throne && crown ? 3 : 1; + int amount = throne && crown ? 3 : 1; - Player player = game.getPlayer(targetPointer.getFirst(game, source)); - if (player != null) { - player.damage(amount, source.getSourceId(), game, false, true); - return true; - } - return false; - } + Player player = game.getPlayer(targetPointer.getFirst(game, source)); + if (player != null) { + player.damage(amount, source.getSourceId(), game, false, true); + return true; + } + return false; + } - @Override - public ScepterOfEmpiresEffect copy() { - return new ScepterOfEmpiresEffect(this); - } + @Override + public ScepterOfEmpiresEffect copy() { + return new ScepterOfEmpiresEffect(this); + } } diff --git a/Mage.Sets/src/mage/sets/magic2012/Scrambleverse.java b/Mage.Sets/src/mage/sets/magic2012/Scrambleverse.java index 613d2a2149..b64563c7df 100644 --- a/Mage.Sets/src/mage/sets/magic2012/Scrambleverse.java +++ b/Mage.Sets/src/mage/sets/magic2012/Scrambleverse.java @@ -58,7 +58,7 @@ public class Scrambleverse extends CardImpl { this.color.setRed(true); // For each nonland permanent, choose a player at random. Then each player gains control of each permanent for which he or she was chosen. Untap those permanents. - this.getSpellAbility().addEffect(new ScrambleverseEffect()); + this.getSpellAbility().addEffect(new ScrambleverseEffect()); } public Scrambleverse(final Scrambleverse card) { @@ -73,67 +73,67 @@ public class Scrambleverse extends CardImpl { class ScrambleverseEffect extends OneShotEffect { - public ScrambleverseEffect() { - super(Constants.Outcome.Damage); - staticText = "For each nonland permanent, choose a player at random. Then each player gains control of each permanent for which he or she was chosen. Untap those permanents"; - } + public ScrambleverseEffect() { + super(Constants.Outcome.Damage); + staticText = "For each nonland permanent, choose a player at random. Then each player gains control of each permanent for which he or she was chosen. Untap those permanents"; + } - public ScrambleverseEffect(ScrambleverseEffect effect) { - super(effect); - } + public ScrambleverseEffect(ScrambleverseEffect effect) { + super(effect); + } - @Override - public boolean apply(Game game, Ability source) { - Random random = new Random(); - PlayerList players = game.getPlayerList(); - int count = players.size(); - if (count > 1) { - FilterNonlandPermanent nonLand = new FilterNonlandPermanent(); - for (Permanent permanent : game.getBattlefield().getAllActivePermanents(nonLand, game)) { - ContinuousEffect effect = new ScrambleverseControlEffect(players.get(random.nextInt(count))); - effect.setTargetPointer(new FixedTarget(permanent.getId())); - game.addEffect(effect, source); - } - } - return true; - } + @Override + public boolean apply(Game game, Ability source) { + Random random = new Random(); + PlayerList players = game.getPlayerList(); + int count = players.size(); + if (count > 1) { + FilterNonlandPermanent nonLand = new FilterNonlandPermanent(); + for (Permanent permanent : game.getBattlefield().getAllActivePermanents(nonLand, game)) { + ContinuousEffect effect = new ScrambleverseControlEffect(players.get(random.nextInt(count))); + effect.setTargetPointer(new FixedTarget(permanent.getId())); + game.addEffect(effect, source); + } + } + return true; + } - @Override - public ScrambleverseEffect copy() { - return new ScrambleverseEffect(this); - } + @Override + public ScrambleverseEffect copy() { + return new ScrambleverseEffect(this); + } } class ScrambleverseControlEffect extends ContinuousEffectImpl { - private UUID controllerId; + private UUID controllerId; - public ScrambleverseControlEffect(UUID controllerId) { - super(Constants.Duration.EndOfGame, Constants.Layer.ControlChangingEffects_2, Constants.SubLayer.NA, Constants.Outcome.GainControl); - this.controllerId = controllerId; - } + public ScrambleverseControlEffect(UUID controllerId) { + super(Constants.Duration.EndOfGame, Constants.Layer.ControlChangingEffects_2, Constants.SubLayer.NA, Constants.Outcome.GainControl); + this.controllerId = controllerId; + } - public ScrambleverseControlEffect(final ScrambleverseControlEffect effect) { - super(effect); - this.controllerId = effect.controllerId; - } + public ScrambleverseControlEffect(final ScrambleverseControlEffect effect) { + super(effect); + this.controllerId = effect.controllerId; + } - @Override - public ScrambleverseControlEffect copy() { - return new ScrambleverseControlEffect(this); - } + @Override + public ScrambleverseControlEffect copy() { + return new ScrambleverseControlEffect(this); + } - @Override - public boolean apply(Game game, Ability source) { - Permanent permanent = game.getPermanent(targetPointer.getFirst(game, source)); - if (permanent != null && controllerId != null) { - return permanent.changeControllerId(controllerId, game); - } - return false; - } + @Override + public boolean apply(Game game, Ability source) { + Permanent permanent = game.getPermanent(targetPointer.getFirst(game, source)); + if (permanent != null && controllerId != null) { + return permanent.changeControllerId(controllerId, game); + } + return false; + } - @Override - public String getText(Mode mode) { - return "Gain control of {this}"; - } + @Override + public String getText(Mode mode) { + return "Gain control of {this}"; + } } diff --git a/Mage.Sets/src/mage/sets/magic2012/Smallpox.java b/Mage.Sets/src/mage/sets/magic2012/Smallpox.java index 22cf48aa20..e370a9b8ef 100644 --- a/Mage.Sets/src/mage/sets/magic2012/Smallpox.java +++ b/Mage.Sets/src/mage/sets/magic2012/Smallpox.java @@ -56,7 +56,7 @@ public class Smallpox extends CardImpl { this.color.setBlack(true); // Each player loses 1 life, discards a card, sacrifices a creature, then sacrifices a land. - this.getSpellAbility().addEffect(new SmallpoxEffect()); + this.getSpellAbility().addEffect(new SmallpoxEffect()); } public Smallpox(final Smallpox card) { @@ -71,17 +71,17 @@ public class Smallpox extends CardImpl { class SmallpoxEffect extends OneShotEffect { - private static FilterPermanent filterCreature = new FilterPermanent("a creature you control"); - private static FilterPermanent filterLand = new FilterPermanent("a land you control"); + private static FilterPermanent filterCreature = new FilterPermanent("a creature you control"); + private static FilterPermanent filterLand = new FilterPermanent("a land you control"); - static { - filterCreature.getCardType().add(CardType.CREATURE); - filterCreature.setScopeCardType(Filter.ComparisonScope.Any); - filterCreature.setTargetController(Constants.TargetController.YOU); - filterLand.getCardType().add(CardType.LAND); - filterLand.setScopeCardType(Filter.ComparisonScope.Any); - filterLand.setTargetController(Constants.TargetController.YOU); - } + static { + filterCreature.getCardType().add(CardType.CREATURE); + filterCreature.setScopeCardType(Filter.ComparisonScope.Any); + filterCreature.setTargetController(Constants.TargetController.YOU); + filterLand.getCardType().add(CardType.LAND); + filterLand.setScopeCardType(Filter.ComparisonScope.Any); + filterLand.setTargetController(Constants.TargetController.YOU); + } SmallpoxEffect() { super(Constants.Outcome.DestroyPermanent); @@ -97,11 +97,11 @@ class SmallpoxEffect extends OneShotEffect { for (UUID playerId : game.getPlayerList()) { Player player = game.getPlayer(playerId); if (player != null) { - player.loseLife(1, game); + player.loseLife(1, game); } } - for (UUID playerId : game.getPlayerList()) { + for (UUID playerId : game.getPlayerList()) { Player player = game.getPlayer(playerId); if (player != null) { player.discard(1, source, game); @@ -109,17 +109,17 @@ class SmallpoxEffect extends OneShotEffect { } - for (UUID playerId : game.getPlayerList()) { + for (UUID playerId : game.getPlayerList()) { Player player = game.getPlayer(playerId); if (player != null) { - sacrifice(game, source, player, filterCreature); + sacrifice(game, source, player, filterCreature); } } - for (UUID playerId : game.getPlayerList()) { + for (UUID playerId : game.getPlayerList()) { Player player = game.getPlayer(playerId); if (player != null) { - sacrifice(game, source, player, filterLand); + sacrifice(game, source, player, filterLand); } } @@ -131,21 +131,21 @@ class SmallpoxEffect extends OneShotEffect { return new SmallpoxEffect(this); } - private void sacrifice(Game game, Ability source, Player player, FilterPermanent filter) { - Target target = new TargetControlledPermanent(1, 1, filter, false); - if (target.canChoose(player.getId(), game)) { - while (!target.isChosen() && target.canChoose(player.getId(), game)) { - player.choose(Constants.Outcome.Sacrifice, target, source.getSourceId(), game); - } + private void sacrifice(Game game, Ability source, Player player, FilterPermanent filter) { + Target target = new TargetControlledPermanent(1, 1, filter, false); + if (target.canChoose(player.getId(), game)) { + while (!target.isChosen() && target.canChoose(player.getId(), game)) { + player.choose(Constants.Outcome.Sacrifice, target, source.getSourceId(), game); + } - for ( int idx = 0; idx < target.getTargets().size(); idx++) { - Permanent permanent = game.getPermanent((UUID)target.getTargets().get(idx)); + for ( int idx = 0; idx < target.getTargets().size(); idx++) { + Permanent permanent = game.getPermanent((UUID)target.getTargets().get(idx)); - if ( permanent != null ) { - permanent.sacrifice(source.getSourceId(), game); - } - } - } - } + if ( permanent != null ) { + permanent.sacrifice(source.getSourceId(), game); + } + } + } + } } diff --git a/Mage.Sets/src/mage/sets/magic2012/SorinsThirst.java b/Mage.Sets/src/mage/sets/magic2012/SorinsThirst.java index a919a45def..5f45401c6f 100644 --- a/Mage.Sets/src/mage/sets/magic2012/SorinsThirst.java +++ b/Mage.Sets/src/mage/sets/magic2012/SorinsThirst.java @@ -45,7 +45,7 @@ public class SorinsThirst extends CardImpl { public SorinsThirst (UUID ownerId) { super(ownerId, 110, "Sorin's Thirst", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{B}{B}"); this.expansionSetCode = "M12"; - this.color.setBlack(true); + this.color.setBlack(true); this.getSpellAbility().addEffect(new DamageTargetEffect(2)); this.getSpellAbility().addEffect(new GainLifeEffect(2)); this.getSpellAbility().addTarget(new TargetCreaturePermanent()); diff --git a/Mage.Sets/src/mage/sets/magic2012/SorinsVengeance.java b/Mage.Sets/src/mage/sets/magic2012/SorinsVengeance.java index bdc069fbce..e5936b3ff1 100644 --- a/Mage.Sets/src/mage/sets/magic2012/SorinsVengeance.java +++ b/Mage.Sets/src/mage/sets/magic2012/SorinsVengeance.java @@ -45,7 +45,7 @@ public class SorinsVengeance extends CardImpl { public SorinsVengeance (UUID ownerId) { super(ownerId, 111, "Sorin's Vengeance", Rarity.RARE, new CardType[]{CardType.SORCERY}, "{4}{B}{B}{B}"); this.expansionSetCode = "M12"; - this.color.setBlack(true); + this.color.setBlack(true); this.getSpellAbility().addEffect(new DamageTargetEffect(10)); this.getSpellAbility().addEffect(new GainLifeEffect(10)); this.getSpellAbility().addTarget(new TargetPlayer()); diff --git a/Mage.Sets/src/mage/sets/magic2012/SpiritMantle.java b/Mage.Sets/src/mage/sets/magic2012/SpiritMantle.java index 691e7eb7b1..26e63201be 100644 --- a/Mage.Sets/src/mage/sets/magic2012/SpiritMantle.java +++ b/Mage.Sets/src/mage/sets/magic2012/SpiritMantle.java @@ -49,31 +49,31 @@ import java.util.UUID; */ public class SpiritMantle extends CardImpl { - public SpiritMantle(UUID ownerId) { - super(ownerId, 35, "Spirit Mantle", Rarity.UNCOMMON, new CardType[]{CardType.ENCHANTMENT}, "{1}{W}"); - this.expansionSetCode = "M12"; - this.subtype.add("Aura"); + public SpiritMantle(UUID ownerId) { + super(ownerId, 35, "Spirit Mantle", Rarity.UNCOMMON, new CardType[]{CardType.ENCHANTMENT}, "{1}{W}"); + this.expansionSetCode = "M12"; + this.subtype.add("Aura"); - this.color.setWhite(true); + this.color.setWhite(true); - // Enchant creature - TargetPermanent auraTarget = new TargetCreaturePermanent(); - this.getSpellAbility().addTarget(auraTarget); - this.getSpellAbility().addEffect(new AttachEffect(Constants.Outcome.AddAbility)); - Ability ability = new EnchantAbility(auraTarget.getTargetName()); - this.addAbility(ability); + // Enchant creature + TargetPermanent auraTarget = new TargetCreaturePermanent(); + this.getSpellAbility().addTarget(auraTarget); + this.getSpellAbility().addEffect(new AttachEffect(Constants.Outcome.AddAbility)); + Ability ability = new EnchantAbility(auraTarget.getTargetName()); + this.addAbility(ability); - // Enchanted creature gets +1/+1 and has protection from creatures. - this.addAbility(new SimpleStaticAbility(Constants.Zone.BATTLEFIELD, new BoostEnchantedEffect(1, 1, Constants.Duration.WhileOnBattlefield))); - this.addAbility(new SimpleStaticAbility(Constants.Zone.BATTLEFIELD, new GainAbilityAttachedEffect(new ProtectionAbility(new FilterCreatureCard("creatures")), Constants.AttachmentType.AURA))); - } + // Enchanted creature gets +1/+1 and has protection from creatures. + this.addAbility(new SimpleStaticAbility(Constants.Zone.BATTLEFIELD, new BoostEnchantedEffect(1, 1, Constants.Duration.WhileOnBattlefield))); + this.addAbility(new SimpleStaticAbility(Constants.Zone.BATTLEFIELD, new GainAbilityAttachedEffect(new ProtectionAbility(new FilterCreatureCard("creatures")), Constants.AttachmentType.AURA))); + } - public SpiritMantle(final SpiritMantle card) { - super(card); - } + public SpiritMantle(final SpiritMantle card) { + super(card); + } - @Override - public SpiritMantle copy() { - return new SpiritMantle(this); - } + @Override + public SpiritMantle copy() { + return new SpiritMantle(this); + } } diff --git a/Mage.Sets/src/mage/sets/magic2012/StonehornDignitary.java b/Mage.Sets/src/mage/sets/magic2012/StonehornDignitary.java index b8a14a02f0..55767c3878 100644 --- a/Mage.Sets/src/mage/sets/magic2012/StonehornDignitary.java +++ b/Mage.Sets/src/mage/sets/magic2012/StonehornDignitary.java @@ -59,11 +59,11 @@ public class StonehornDignitary extends CardImpl { this.toughness = new MageInt(4); // When Stonehorn Dignitary enters the battlefield, target opponent skips his or her next combat phase. - Ability ability = new EntersBattlefieldTriggeredAbility(new SkipNextCombatEffect()); - Target target = new TargetOpponent(); - target.setRequired(true); - ability.addTarget(target); - this.addAbility(ability); + Ability ability = new EntersBattlefieldTriggeredAbility(new SkipNextCombatEffect()); + Target target = new TargetOpponent(); + target.setRequired(true); + ability.addTarget(target); + this.addAbility(ability); } public StonehornDignitary(final StonehornDignitary card) { @@ -78,27 +78,27 @@ public class StonehornDignitary extends CardImpl { class SkipNextCombatEffect extends OneShotEffect { - public SkipNextCombatEffect() { - super(Constants.Outcome.Detriment); - staticText = "target opponent skips his or her next combat phase"; - } + public SkipNextCombatEffect() { + super(Constants.Outcome.Detriment); + staticText = "target opponent skips his or her next combat phase"; + } - public SkipNextCombatEffect(SkipNextCombatEffect effect) { - super(effect); - } + public SkipNextCombatEffect(SkipNextCombatEffect effect) { + super(effect); + } - @Override - public boolean apply(Game game, Ability source) { - UUID targetId = source.getFirstTarget(); - if (targetId != null) { - game.getState().getTurnMods().add(new TurnMod(targetId, Constants.TurnPhase.COMBAT, null, true)); - return true; - } - return false; - } + @Override + public boolean apply(Game game, Ability source) { + UUID targetId = source.getFirstTarget(); + if (targetId != null) { + game.getState().getTurnMods().add(new TurnMod(targetId, Constants.TurnPhase.COMBAT, null, true)); + return true; + } + return false; + } - @Override - public SkipNextCombatEffect copy() { - return new SkipNextCombatEffect(); - } + @Override + public SkipNextCombatEffect copy() { + return new SkipNextCombatEffect(); + } } diff --git a/Mage.Sets/src/mage/sets/magic2012/SundialOfTheInfinite.java b/Mage.Sets/src/mage/sets/magic2012/SundialOfTheInfinite.java index ecc75dcb4d..18aec8aa30 100644 --- a/Mage.Sets/src/mage/sets/magic2012/SundialOfTheInfinite.java +++ b/Mage.Sets/src/mage/sets/magic2012/SundialOfTheInfinite.java @@ -54,10 +54,10 @@ public class SundialOfTheInfinite extends CardImpl { this.expansionSetCode = "M12"; // {1}, {tap}: End the turn. Activate this ability only during your turn. - Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new SundialOfTheInfiniteEffect(), new GenericManaCost(1)); - ability.addCost(new TapSourceCost()); - ability.addCost(new OnlyDuringYourTurnCost()); - this.addAbility(ability); + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new SundialOfTheInfiniteEffect(), new GenericManaCost(1)); + ability.addCost(new TapSourceCost()); + ability.addCost(new OnlyDuringYourTurnCost()); + this.addAbility(ability); } public SundialOfTheInfinite(final SundialOfTheInfinite card) { @@ -72,22 +72,22 @@ public class SundialOfTheInfinite extends CardImpl { class SundialOfTheInfiniteEffect extends OneShotEffect { - public SundialOfTheInfiniteEffect() { - super(Outcome.Detriment); - staticText = "End the turn (Exile all spells and abilities on the stack. Discard down to your maximum hand size. Damage wears off, and \"this turn\" and \"until end of turn\" effects end.)"; - } + public SundialOfTheInfiniteEffect() { + super(Outcome.Detriment); + staticText = "End the turn (Exile all spells and abilities on the stack. Discard down to your maximum hand size. Damage wears off, and \"this turn\" and \"until end of turn\" effects end.)"; + } - public SundialOfTheInfiniteEffect(SundialOfTheInfiniteEffect effect) { - super(effect); - } + public SundialOfTheInfiniteEffect(SundialOfTheInfiniteEffect effect) { + super(effect); + } - @Override - public boolean apply(Game game, Ability source) { - return game.endTurn(source.getControllerId()); - } + @Override + public boolean apply(Game game, Ability source) { + return game.endTurn(source.getControllerId()); + } - @Override - public SundialOfTheInfiniteEffect copy() { - return new SundialOfTheInfiniteEffect(this); - } + @Override + public SundialOfTheInfiniteEffect copy() { + return new SundialOfTheInfiniteEffect(this); + } } diff --git a/Mage.Sets/src/mage/sets/magic2012/SuturedGhoul.java b/Mage.Sets/src/mage/sets/magic2012/SuturedGhoul.java index e6d7e61d4d..16fdf3be67 100644 --- a/Mage.Sets/src/mage/sets/magic2012/SuturedGhoul.java +++ b/Mage.Sets/src/mage/sets/magic2012/SuturedGhoul.java @@ -53,37 +53,37 @@ import java.util.UUID; */ public class SuturedGhoul extends CardImpl { - private static final String staticText = "exile any number of creature cards from your graveyard"; - private static final String staticText2 = "Sutured Ghoul's power is equal to the total power of the exiled cards and its toughness is equal to their total toughness"; + private static final String staticText = "exile any number of creature cards from your graveyard"; + private static final String staticText2 = "Sutured Ghoul's power is equal to the total power of the exiled cards and its toughness is equal to their total toughness"; - public SuturedGhoul(UUID ownerId) { - super(ownerId, 112, "Sutured Ghoul", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{4}{B}{B}{B}"); - this.expansionSetCode = "M12"; - this.subtype.add("Zombie"); + public SuturedGhoul(UUID ownerId) { + super(ownerId, 112, "Sutured Ghoul", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{4}{B}{B}{B}"); + this.expansionSetCode = "M12"; + this.subtype.add("Zombie"); - this.color.setBlack(true); - this.power = new MageInt(0); - this.toughness = new MageInt(0); + this.color.setBlack(true); + this.power = new MageInt(0); + this.toughness = new MageInt(0); - this.addAbility(TrampleAbility.getInstance()); + this.addAbility(TrampleAbility.getInstance()); - // As Sutured Ghoul enters the battlefield, exile any number of creature cards from your graveyard. - this.addAbility(new EntersBattlefieldAbility(new SuturedGhoulEffect(), staticText)); + // As Sutured Ghoul enters the battlefield, exile any number of creature cards from your graveyard. + this.addAbility(new EntersBattlefieldAbility(new SuturedGhoulEffect(), staticText)); - // Sutured Ghoul's power is equal to the total power of the exiled cards and its toughness is equal to their total toughness. - BoostSourceEffect effect = new BoostSourceEffect(new SuturedGhoulPowerCount(), new SuturedGhoulToughnessCount(), Constants.Duration.WhileOnBattlefield); - effect.setRule(staticText2); - this.addAbility(new SimpleStaticAbility(Constants.Zone.BATTLEFIELD, effect)); - } + // Sutured Ghoul's power is equal to the total power of the exiled cards and its toughness is equal to their total toughness. + BoostSourceEffect effect = new BoostSourceEffect(new SuturedGhoulPowerCount(), new SuturedGhoulToughnessCount(), Constants.Duration.WhileOnBattlefield); + effect.setRule(staticText2); + this.addAbility(new SimpleStaticAbility(Constants.Zone.BATTLEFIELD, effect)); + } - public SuturedGhoul(final SuturedGhoul card) { - super(card); - } + public SuturedGhoul(final SuturedGhoul card) { + super(card); + } - @Override - public SuturedGhoul copy() { - return new SuturedGhoul(this); - } + @Override + public SuturedGhoul copy() { + return new SuturedGhoul(this); + } } class SuturedGhoulEffect extends OneShotEffect { @@ -148,14 +148,14 @@ class SuturedGhoulPowerCount implements DynamicValue { public int calculate(Game game, Ability sourceAbility) { int amount = 0; Permanent permanent = game.getPermanent(sourceAbility.getSourceId()); - if (permanent != null) { - for (UUID uuid: permanent.getImprinted()) { - Card card = game.getCard(uuid); - if (card != null) { - amount += card.getPower().getValue(); - } - } - } + if (permanent != null) { + for (UUID uuid: permanent.getImprinted()) { + Card card = game.getCard(uuid); + if (card != null) { + amount += card.getPower().getValue(); + } + } + } return amount; } @@ -190,14 +190,14 @@ class SuturedGhoulToughnessCount implements DynamicValue { public int calculate(Game game, Ability sourceAbility) { int amount = 0; Permanent permanent = game.getPermanent(sourceAbility.getSourceId()); - if (permanent != null) { - for (UUID uuid: permanent.getImprinted()) { - Card card = game.getCard(uuid); - if (card != null) { - amount += card.getToughness().getValue(); - } - } - } + if (permanent != null) { + for (UUID uuid: permanent.getImprinted()) { + Card card = game.getCard(uuid); + if (card != null) { + amount += card.getToughness().getValue(); + } + } + } return amount; } diff --git a/Mage.Sets/src/mage/sets/magic2012/SwiftfootBoots.java b/Mage.Sets/src/mage/sets/magic2012/SwiftfootBoots.java index 0195532df7..eca4cd17b2 100644 --- a/Mage.Sets/src/mage/sets/magic2012/SwiftfootBoots.java +++ b/Mage.Sets/src/mage/sets/magic2012/SwiftfootBoots.java @@ -54,7 +54,7 @@ public class SwiftfootBoots extends CardImpl { this.addAbility(new SimpleStaticAbility(Constants.Zone.BATTLEFIELD, new GainAbilityAttachedEffect(HexproofAbility.getInstance(), Constants.AttachmentType.EQUIPMENT))); this.addAbility(new SimpleStaticAbility(Constants.Zone.BATTLEFIELD, new GainAbilityAttachedEffect(HasteAbility.getInstance(), Constants.AttachmentType.EQUIPMENT))); this.addAbility(new EquipAbility(Constants.Outcome.AddAbility, new GenericManaCost(1))); - + } public SwiftfootBoots (final SwiftfootBoots card) { diff --git a/Mage.Sets/src/mage/sets/magic2012/TasteOfBlood.java b/Mage.Sets/src/mage/sets/magic2012/TasteOfBlood.java index fd24bfd4a7..40f1001505 100644 --- a/Mage.Sets/src/mage/sets/magic2012/TasteOfBlood.java +++ b/Mage.Sets/src/mage/sets/magic2012/TasteOfBlood.java @@ -45,7 +45,7 @@ public class TasteOfBlood extends CardImpl { public TasteOfBlood (UUID ownerId) { super(ownerId, 113, "Taste of Blood", Rarity.COMMON, new CardType[]{CardType.SORCERY}, "{B}"); this.expansionSetCode = "M12"; - this.color.setBlack(true); + this.color.setBlack(true); this.getSpellAbility().addEffect(new DamageTargetEffect(1)); this.getSpellAbility().addEffect(new GainLifeEffect(1)); this.getSpellAbility().addTarget(new TargetPlayer()); diff --git a/Mage.Sets/src/mage/sets/magic2012/ThranGolem.java b/Mage.Sets/src/mage/sets/magic2012/ThranGolem.java index 333c655714..3ec7647ded 100644 --- a/Mage.Sets/src/mage/sets/magic2012/ThranGolem.java +++ b/Mage.Sets/src/mage/sets/magic2012/ThranGolem.java @@ -61,7 +61,7 @@ public class ThranGolem extends CardImpl { this.power = new MageInt(3); this.toughness = new MageInt(3); - + ConditionalContinousEffect effect1 = new ConditionalContinousEffect(new BoostSourceEffect(2, 2, Duration.WhileOnBattlefield), EnchantedCondition.getInstance(), rule1); this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, effect1)); ConditionalContinousEffect effect2 = new ConditionalContinousEffect(new GainAbilitySourceEffect(FlyingAbility.getInstance()), EnchantedCondition.getInstance(), rule2); diff --git a/Mage.Sets/src/mage/sets/magic2012/ThroneOfEmpires.java b/Mage.Sets/src/mage/sets/magic2012/ThroneOfEmpires.java index a8de58d9cd..5ec7b7f59d 100644 --- a/Mage.Sets/src/mage/sets/magic2012/ThroneOfEmpires.java +++ b/Mage.Sets/src/mage/sets/magic2012/ThroneOfEmpires.java @@ -48,57 +48,57 @@ import java.util.UUID; */ public class ThroneOfEmpires extends CardImpl { - public ThroneOfEmpires(UUID ownerId) { - super(ownerId, 221, "Throne of Empires", Rarity.RARE, new CardType[]{CardType.ARTIFACT}, "{4}"); - this.expansionSetCode = "M12"; + public ThroneOfEmpires(UUID ownerId) { + super(ownerId, 221, "Throne of Empires", Rarity.RARE, new CardType[]{CardType.ARTIFACT}, "{4}"); + this.expansionSetCode = "M12"; - // {1}, {tap}: Put a 1/1 white Soldier creature token onto the battlefield. Put five of those tokens onto the battlefield instead if you control artifacts named Crown of Empires and Scepter of Empires. - Ability ability = new SimpleActivatedAbility(Constants.Zone.BATTLEFIELD, new ThroneOfEmpiresEffect(), new GenericManaCost(1)); - ability.addCost(new TapSourceCost()); - this.addAbility(ability); - } + // {1}, {tap}: Put a 1/1 white Soldier creature token onto the battlefield. Put five of those tokens onto the battlefield instead if you control artifacts named Crown of Empires and Scepter of Empires. + Ability ability = new SimpleActivatedAbility(Constants.Zone.BATTLEFIELD, new ThroneOfEmpiresEffect(), new GenericManaCost(1)); + ability.addCost(new TapSourceCost()); + this.addAbility(ability); + } - public ThroneOfEmpires(final ThroneOfEmpires card) { - super(card); - } + public ThroneOfEmpires(final ThroneOfEmpires card) { + super(card); + } - @Override - public ThroneOfEmpires copy() { - return new ThroneOfEmpires(this); - } + @Override + public ThroneOfEmpires copy() { + return new ThroneOfEmpires(this); + } } class ThroneOfEmpiresEffect extends OneShotEffect { - public ThroneOfEmpiresEffect() { - super(Constants.Outcome.PutCreatureInPlay); - staticText = "Put a 1/1 white Soldier creature token onto the battlefield. Put five of those tokens onto the battlefield instead if you control artifacts named Crown of Empires and Scepter of Empires"; - } + public ThroneOfEmpiresEffect() { + super(Constants.Outcome.PutCreatureInPlay); + staticText = "Put a 1/1 white Soldier creature token onto the battlefield. Put five of those tokens onto the battlefield instead if you control artifacts named Crown of Empires and Scepter of Empires"; + } - public ThroneOfEmpiresEffect(ThroneOfEmpiresEffect effect) { - super(effect); - } + public ThroneOfEmpiresEffect(ThroneOfEmpiresEffect effect) { + super(effect); + } - @Override - public boolean apply(Game game, Ability source) { - boolean scepter = false; - boolean crown = false; - for (Permanent permanent : game.getBattlefield().getAllActivePermanents(source.getControllerId())) { - if (permanent.getName().equals("Scepter of Empires")) { - scepter = true; - } else if (permanent.getName().equals("Crown of Empires")) { - crown = true; - } - if (scepter && crown) break; - } - Token soldier = new SoldierToken(); - int count = scepter && crown ? 5 : 1; - soldier.putOntoBattlefield(count, game, source.getSourceId(), source.getControllerId()); - return false; - } + @Override + public boolean apply(Game game, Ability source) { + boolean scepter = false; + boolean crown = false; + for (Permanent permanent : game.getBattlefield().getAllActivePermanents(source.getControllerId())) { + if (permanent.getName().equals("Scepter of Empires")) { + scepter = true; + } else if (permanent.getName().equals("Crown of Empires")) { + crown = true; + } + if (scepter && crown) break; + } + Token soldier = new SoldierToken(); + int count = scepter && crown ? 5 : 1; + soldier.putOntoBattlefield(count, game, source.getSourceId(), source.getControllerId()); + return false; + } - @Override - public ThroneOfEmpiresEffect copy() { - return new ThroneOfEmpiresEffect(this); - } + @Override + public ThroneOfEmpiresEffect copy() { + return new ThroneOfEmpiresEffect(this); + } } diff --git a/Mage.Sets/src/mage/sets/magic2012/TimelyReinforcements.java b/Mage.Sets/src/mage/sets/magic2012/TimelyReinforcements.java index 188f3792ce..ff4ab88807 100644 --- a/Mage.Sets/src/mage/sets/magic2012/TimelyReinforcements.java +++ b/Mage.Sets/src/mage/sets/magic2012/TimelyReinforcements.java @@ -48,72 +48,72 @@ import java.util.UUID; */ public class TimelyReinforcements extends CardImpl { - public TimelyReinforcements(UUID ownerId) { - super(ownerId, 40, "Timely Reinforcements", Rarity.UNCOMMON, new CardType[]{CardType.SORCERY}, "{2}{W}"); - this.expansionSetCode = "M12"; - this.color.setWhite(true); + public TimelyReinforcements(UUID ownerId) { + super(ownerId, 40, "Timely Reinforcements", Rarity.UNCOMMON, new CardType[]{CardType.SORCERY}, "{2}{W}"); + this.expansionSetCode = "M12"; + this.color.setWhite(true); - // If you have less life than an opponent, you gain 6 life. If you control fewer creatures than an opponent, put three 1/1 white Soldier creature tokens onto the battlefield. - this.getSpellAbility().addEffect(new TimelyReinforcementsEffect()); - } + // If you have less life than an opponent, you gain 6 life. If you control fewer creatures than an opponent, put three 1/1 white Soldier creature tokens onto the battlefield. + this.getSpellAbility().addEffect(new TimelyReinforcementsEffect()); + } - public TimelyReinforcements(final TimelyReinforcements card) { - super(card); - } + public TimelyReinforcements(final TimelyReinforcements card) { + super(card); + } - @Override - public TimelyReinforcements copy() { - return new TimelyReinforcements(this); - } + @Override + public TimelyReinforcements copy() { + return new TimelyReinforcements(this); + } } class TimelyReinforcementsEffect extends OneShotEffect { - public TimelyReinforcementsEffect() { - super(Constants.Outcome.Benefit); - staticText = "If you have less life than an opponent, you gain 6 life. If you control fewer creatures than an opponent, put three 1/1 white Soldier creature tokens onto the battlefield"; - } + public TimelyReinforcementsEffect() { + super(Constants.Outcome.Benefit); + staticText = "If you have less life than an opponent, you gain 6 life. If you control fewer creatures than an opponent, put three 1/1 white Soldier creature tokens onto the battlefield"; + } - public TimelyReinforcementsEffect(TimelyReinforcementsEffect effect) { - super(effect); - } + public TimelyReinforcementsEffect(TimelyReinforcementsEffect effect) { + super(effect); + } - @Override - public boolean apply(Game game, Ability source) { - Player controller = game.getPlayer(source.getControllerId()); - if (controller != null) { - boolean lessCreatures = false; - boolean lessLife = false; - FilterPermanent filter= new FilterCreaturePermanent(); - int count = game.getBattlefield().countAll(filter, controller.getId(), game); - for (UUID uuid : game.getOpponents(controller.getId())) { - Player opponent = game.getPlayer(uuid); - if (opponent != null) { - if (opponent.getLife() > controller.getLife()) { - lessLife = true; - } - if (game.getBattlefield().countAll(filter, uuid, game) > count) { - lessCreatures = true; - } - } - if ( lessLife && lessCreatures) { // no need to search further - break; - } - } - if (lessLife) { - controller.gainLife(6, game); - } - if (lessCreatures) { - Effect effect = new CreateTokenEffect(new SoldierToken(), 3); - effect.apply(game, source); - } - return true; - } - return false; - } + @Override + public boolean apply(Game game, Ability source) { + Player controller = game.getPlayer(source.getControllerId()); + if (controller != null) { + boolean lessCreatures = false; + boolean lessLife = false; + FilterPermanent filter= new FilterCreaturePermanent(); + int count = game.getBattlefield().countAll(filter, controller.getId(), game); + for (UUID uuid : game.getOpponents(controller.getId())) { + Player opponent = game.getPlayer(uuid); + if (opponent != null) { + if (opponent.getLife() > controller.getLife()) { + lessLife = true; + } + if (game.getBattlefield().countAll(filter, uuid, game) > count) { + lessCreatures = true; + } + } + if ( lessLife && lessCreatures) { // no need to search further + break; + } + } + if (lessLife) { + controller.gainLife(6, game); + } + if (lessCreatures) { + Effect effect = new CreateTokenEffect(new SoldierToken(), 3); + effect.apply(game, source); + } + return true; + } + return false; + } - @Override - public TimelyReinforcementsEffect copy() { - return new TimelyReinforcementsEffect(this); - } + @Override + public TimelyReinforcementsEffect copy() { + return new TimelyReinforcementsEffect(this); + } } diff --git a/Mage.Sets/src/mage/sets/magic2012/Trollhide.java b/Mage.Sets/src/mage/sets/magic2012/Trollhide.java index 6ef7362c73..42ddab608d 100644 --- a/Mage.Sets/src/mage/sets/magic2012/Trollhide.java +++ b/Mage.Sets/src/mage/sets/magic2012/Trollhide.java @@ -56,13 +56,13 @@ public class Trollhide extends CardImpl { super(ownerId, 199, "Trollhide", Rarity.COMMON, new CardType[]{CardType.ENCHANTMENT}, "{2}{G}"); this.expansionSetCode = "M12"; this.subtype.add("Aura"); - this.color.setGreen(true); + this.color.setGreen(true); TargetPermanent auraTarget = new TargetCreaturePermanent(); - this.getSpellAbility().addTarget(auraTarget); - this.getSpellAbility().addEffect(new AttachEffect(Constants.Outcome.BoostCreature)); - Ability ability = new EnchantAbility(auraTarget.getTargetName()); - this.addAbility(ability); - this.addAbility(new SimpleStaticAbility(Constants.Zone.BATTLEFIELD, new BoostEnchantedEffect(2, 2, Constants.Duration.WhileOnBattlefield))); + this.getSpellAbility().addTarget(auraTarget); + this.getSpellAbility().addEffect(new AttachEffect(Constants.Outcome.BoostCreature)); + Ability ability = new EnchantAbility(auraTarget.getTargetName()); + this.addAbility(ability); + this.addAbility(new SimpleStaticAbility(Constants.Zone.BATTLEFIELD, new BoostEnchantedEffect(2, 2, Constants.Duration.WhileOnBattlefield))); this.addAbility(new SimpleStaticAbility(Constants.Zone.BATTLEFIELD, new GainAbilityAttachedEffect(new SimpleActivatedAbility(Constants.Zone.BATTLEFIELD, new RegenerateSourceEffect(), new ManaCostsImpl("{1}{G}")), Constants.AttachmentType.AURA))); } diff --git a/Mage.Sets/src/mage/sets/magic2012/TurnToFrog.java b/Mage.Sets/src/mage/sets/magic2012/TurnToFrog.java index 3c935f7cdf..7a3319c7c8 100644 --- a/Mage.Sets/src/mage/sets/magic2012/TurnToFrog.java +++ b/Mage.Sets/src/mage/sets/magic2012/TurnToFrog.java @@ -50,9 +50,9 @@ public class TurnToFrog extends CardImpl { this.color.setBlue(true); // Target creature loses all abilities and becomes a 1/1 blue Frog until end of turn. - this.getSpellAbility().addEffect(new LoseAllAbilitiesTargetEffect(Duration.EndOfTurn)); - this.getSpellAbility().addEffect(new BecomesCreatureTargetEffect(new FrogToken(), null, Duration.EndOfTurn)); - this.getSpellAbility().addTarget(new TargetCreaturePermanent()); + this.getSpellAbility().addEffect(new LoseAllAbilitiesTargetEffect(Duration.EndOfTurn)); + this.getSpellAbility().addEffect(new BecomesCreatureTargetEffect(new FrogToken(), null, Duration.EndOfTurn)); + this.getSpellAbility().addTarget(new TargetCreaturePermanent()); } public TurnToFrog(final TurnToFrog card) { diff --git a/Mage.Sets/src/mage/sets/magic2012/VisionsOfBeyond.java b/Mage.Sets/src/mage/sets/magic2012/VisionsOfBeyond.java index 33450059b4..aabb665d51 100644 --- a/Mage.Sets/src/mage/sets/magic2012/VisionsOfBeyond.java +++ b/Mage.Sets/src/mage/sets/magic2012/VisionsOfBeyond.java @@ -51,7 +51,7 @@ public class VisionsOfBeyond extends CardImpl { this.color.setBlue(true); // Draw a card. If a graveyard has twenty or more cards in it, draw three cards instead. - this.getSpellAbility().addEffect(new VisionsOfBeyondEffect()); + this.getSpellAbility().addEffect(new VisionsOfBeyondEffect()); } public VisionsOfBeyond(final VisionsOfBeyond card) { @@ -66,34 +66,34 @@ public class VisionsOfBeyond extends CardImpl { class VisionsOfBeyondEffect extends OneShotEffect { - public VisionsOfBeyondEffect() { - super(Constants.Outcome.DrawCard); - staticText = "Draw a card. If a graveyard has twenty or more cards in it, draw three cards instead"; - } + public VisionsOfBeyondEffect() { + super(Constants.Outcome.DrawCard); + staticText = "Draw a card. If a graveyard has twenty or more cards in it, draw three cards instead"; + } - public VisionsOfBeyondEffect(VisionsOfBeyondEffect effect) { - super(effect); - } + public VisionsOfBeyondEffect(VisionsOfBeyondEffect effect) { + super(effect); + } - @Override - public boolean apply(Game game, Ability source) { - Player sourcePlayer = game.getPlayer(source.getControllerId()); - int count = 1; - for (UUID playerId: sourcePlayer.getInRange()) { - Player player = game.getPlayer(playerId); - if (player != null) { - if (player.getGraveyard().size() >= 20) { - count = 3; - break; - } - } - } - sourcePlayer.drawCards(count, game); - return true; - } + @Override + public boolean apply(Game game, Ability source) { + Player sourcePlayer = game.getPlayer(source.getControllerId()); + int count = 1; + for (UUID playerId: sourcePlayer.getInRange()) { + Player player = game.getPlayer(playerId); + if (player != null) { + if (player.getGraveyard().size() >= 20) { + count = 3; + break; + } + } + } + sourcePlayer.drawCards(count, game); + return true; + } - @Override - public VisionsOfBeyondEffect copy() { - return new VisionsOfBeyondEffect(this); - } + @Override + public VisionsOfBeyondEffect copy() { + return new VisionsOfBeyondEffect(this); + } } diff --git a/Mage.Sets/src/mage/sets/magic2012/WarstormSurge.java b/Mage.Sets/src/mage/sets/magic2012/WarstormSurge.java index 0676c67489..4ba516f8da 100644 --- a/Mage.Sets/src/mage/sets/magic2012/WarstormSurge.java +++ b/Mage.Sets/src/mage/sets/magic2012/WarstormSurge.java @@ -89,8 +89,8 @@ class WarstormSurgeTriggeredAbility extends TriggeredAbilityImpl { super(ownerId, 2, "Arrest", Rarity.COMMON, new CardType[]{CardType.ENCHANTMENT}, "{2}{W}"); this.expansionSetCode = "MRD"; this.subtype.add("Aura"); - this.color.setWhite(true); + this.color.setWhite(true); TargetPermanent auraTarget = new TargetCreaturePermanent(); - this.getSpellAbility().addTarget(auraTarget); - this.getSpellAbility().addEffect(new AttachEffect(Constants.Outcome.Detriment)); - Ability ability = new EnchantAbility(auraTarget.getTargetName()); - this.addAbility(ability); - this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new ArrestEffect())); + this.getSpellAbility().addTarget(auraTarget); + this.getSpellAbility().addEffect(new AttachEffect(Constants.Outcome.Detriment)); + Ability ability = new EnchantAbility(auraTarget.getTargetName()); + this.addAbility(ability); + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new ArrestEffect())); } public Arrest (final Arrest card) { @@ -80,32 +80,32 @@ public class Arrest extends CardImpl { class ArrestEffect extends ReplacementEffectImpl { - public ArrestEffect() { - super(Duration.WhileOnBattlefield, Constants.Outcome.Detriment); - staticText = "Enchanted creature can't attack or block, and its activated abilities can't be activated"; - } + public ArrestEffect() { + super(Duration.WhileOnBattlefield, Constants.Outcome.Detriment); + staticText = "Enchanted creature can't attack or block, and its activated abilities can't be activated"; + } - public ArrestEffect(final ArrestEffect effect) { - super(effect); - } + public ArrestEffect(final ArrestEffect effect) { + super(effect); + } - @Override - public ArrestEffect copy() { - return new ArrestEffect(this); - } + @Override + public ArrestEffect copy() { + return new ArrestEffect(this); + } - @Override - public boolean apply(Game game, Ability source) { - return true; - } + @Override + public boolean apply(Game game, Ability source) { + return true; + } - @Override - public boolean replaceEvent(GameEvent event, Ability source, Game game) { - return true; - } + @Override + public boolean replaceEvent(GameEvent event, Ability source, Game game) { + return true; + } - @Override - public boolean applies(GameEvent event, Ability source, Game game) { + @Override + public boolean applies(GameEvent event, Ability source, Game game) { if (event.getType() == EventType.DECLARE_ATTACKER || event.getType() == EventType.DECLARE_BLOCKER || event.getType() == EventType.ACTIVATE_ABILITY) { Permanent enchantment = game.getPermanent(source.getSourceId()); if (enchantment != null && enchantment.getAttachedTo() != null) { @@ -115,6 +115,6 @@ class ArrestEffect extends ReplacementEffectImpl { } } return false; - } + } } diff --git a/Mage.Sets/src/mage/sets/mirrodin/ClockworkCondor.java b/Mage.Sets/src/mage/sets/mirrodin/ClockworkCondor.java index 16315eccb7..ffe66f221c 100644 --- a/Mage.Sets/src/mage/sets/mirrodin/ClockworkCondor.java +++ b/Mage.Sets/src/mage/sets/mirrodin/ClockworkCondor.java @@ -90,8 +90,8 @@ class ClockworkCondorEffect extends OneShotEffect { if (p != null) { AtTheEndOfCombatDelayedTriggeredAbility ability = new AtTheEndOfCombatDelayedTriggeredAbility(new RemoveCounterSourceEffect(CounterType.P1P1.createInstance())); ability.setSourceId(source.getSourceId()); - ability.setControllerId(source.getControllerId()); - game.addDelayedTriggeredAbility(ability); + ability.setControllerId(source.getControllerId()); + game.addDelayedTriggeredAbility(ability); } return false; } diff --git a/Mage.Sets/src/mage/sets/mirrodin/ClockworkDragon.java b/Mage.Sets/src/mage/sets/mirrodin/ClockworkDragon.java index 513e177b38..85a79de50d 100644 --- a/Mage.Sets/src/mage/sets/mirrodin/ClockworkDragon.java +++ b/Mage.Sets/src/mage/sets/mirrodin/ClockworkDragon.java @@ -94,8 +94,8 @@ class ClockworkDragonEffect extends OneShotEffect { if (p != null) { AtTheEndOfCombatDelayedTriggeredAbility ability = new AtTheEndOfCombatDelayedTriggeredAbility(new RemoveCounterSourceEffect(CounterType.P1P1.createInstance())); ability.setSourceId(source.getSourceId()); - ability.setControllerId(source.getControllerId()); - game.addDelayedTriggeredAbility(ability); + ability.setControllerId(source.getControllerId()); + game.addDelayedTriggeredAbility(ability); } return false; } diff --git a/Mage.Sets/src/mage/sets/mirrodin/ClockworkVorrac.java b/Mage.Sets/src/mage/sets/mirrodin/ClockworkVorrac.java index c59a486b26..3fcac22b85 100644 --- a/Mage.Sets/src/mage/sets/mirrodin/ClockworkVorrac.java +++ b/Mage.Sets/src/mage/sets/mirrodin/ClockworkVorrac.java @@ -93,8 +93,8 @@ class ClockworkVorracEffect extends OneShotEffect { if (p != null) { AtTheEndOfCombatDelayedTriggeredAbility ability = new AtTheEndOfCombatDelayedTriggeredAbility(new RemoveCounterSourceEffect(CounterType.P1P1.createInstance())); ability.setSourceId(source.getSourceId()); - ability.setControllerId(source.getControllerId()); - game.addDelayedTriggeredAbility(ability); + ability.setControllerId(source.getControllerId()); + game.addDelayedTriggeredAbility(ability); } return false; } diff --git a/Mage.Sets/src/mage/sets/mirrodin/Forest1.java b/Mage.Sets/src/mage/sets/mirrodin/Forest1.java index 5dc72986a5..d3c05ea5c4 100644 --- a/Mage.Sets/src/mage/sets/mirrodin/Forest1.java +++ b/Mage.Sets/src/mage/sets/mirrodin/Forest1.java @@ -36,16 +36,16 @@ import java.util.UUID; public class Forest1 extends mage.cards.basiclands.Forest { public Forest1(UUID ownerId) { - super(ownerId, 303); - this.expansionSetCode = "MRD"; - } + super(ownerId, 303); + this.expansionSetCode = "MRD"; + } - public Forest1(final Forest1 card) { - super(card); - } + public Forest1(final Forest1 card) { + super(card); + } - @Override - public Forest1 copy() { - return new Forest1(this); - } + @Override + public Forest1 copy() { + return new Forest1(this); + } } diff --git a/Mage.Sets/src/mage/sets/mirrodin/Forest2.java b/Mage.Sets/src/mage/sets/mirrodin/Forest2.java index 2971487a9d..ff6380dca7 100644 --- a/Mage.Sets/src/mage/sets/mirrodin/Forest2.java +++ b/Mage.Sets/src/mage/sets/mirrodin/Forest2.java @@ -36,16 +36,16 @@ import java.util.UUID; public class Forest2 extends mage.cards.basiclands.Forest { public Forest2(UUID ownerId) { - super(ownerId, 304); - this.expansionSetCode = "MRD"; - } + super(ownerId, 304); + this.expansionSetCode = "MRD"; + } - public Forest2(final Forest2 card) { - super(card); - } + public Forest2(final Forest2 card) { + super(card); + } - @Override - public Forest2 copy() { - return new Forest2(this); - } + @Override + public Forest2 copy() { + return new Forest2(this); + } } diff --git a/Mage.Sets/src/mage/sets/mirrodin/Forest3.java b/Mage.Sets/src/mage/sets/mirrodin/Forest3.java index a670bba44e..3b443dff6e 100644 --- a/Mage.Sets/src/mage/sets/mirrodin/Forest3.java +++ b/Mage.Sets/src/mage/sets/mirrodin/Forest3.java @@ -36,16 +36,16 @@ import java.util.UUID; public class Forest3 extends mage.cards.basiclands.Forest { public Forest3(UUID ownerId) { - super(ownerId, 305); - this.expansionSetCode = "MRD"; - } + super(ownerId, 305); + this.expansionSetCode = "MRD"; + } - public Forest3(final Forest3 card) { - super(card); - } + public Forest3(final Forest3 card) { + super(card); + } - @Override - public Forest3 copy() { - return new Forest3(this); - } + @Override + public Forest3 copy() { + return new Forest3(this); + } } diff --git a/Mage.Sets/src/mage/sets/mirrodin/Forest4.java b/Mage.Sets/src/mage/sets/mirrodin/Forest4.java index faf62c32aa..676ccafb7c 100644 --- a/Mage.Sets/src/mage/sets/mirrodin/Forest4.java +++ b/Mage.Sets/src/mage/sets/mirrodin/Forest4.java @@ -36,16 +36,16 @@ import java.util.UUID; public class Forest4 extends mage.cards.basiclands.Forest { public Forest4(UUID ownerId) { - super(ownerId, 306); - this.expansionSetCode = "MRD"; - } + super(ownerId, 306); + this.expansionSetCode = "MRD"; + } - public Forest4(final Forest4 card) { - super(card); - } + public Forest4(final Forest4 card) { + super(card); + } - @Override - public Forest4 copy() { - return new Forest4(this); - } + @Override + public Forest4 copy() { + return new Forest4(this); + } } diff --git a/Mage.Sets/src/mage/sets/mirrodin/Island1.java b/Mage.Sets/src/mage/sets/mirrodin/Island1.java index 7551f3cdac..40c253b9aa 100644 --- a/Mage.Sets/src/mage/sets/mirrodin/Island1.java +++ b/Mage.Sets/src/mage/sets/mirrodin/Island1.java @@ -36,18 +36,18 @@ import java.util.UUID; */ public class Island1 extends mage.cards.basiclands.Island { - public Island1(UUID ownerId) { - super(ownerId, 291); - this.expansionSetCode = "MRD"; - } + public Island1(UUID ownerId) { + super(ownerId, 291); + this.expansionSetCode = "MRD"; + } - public Island1(final Island1 card) { - super(card); - } + public Island1(final Island1 card) { + super(card); + } - @Override - public Island1 copy() { - return new Island1(this); - } + @Override + public Island1 copy() { + return new Island1(this); + } } diff --git a/Mage.Sets/src/mage/sets/mirrodin/Island2.java b/Mage.Sets/src/mage/sets/mirrodin/Island2.java index 785c97344a..c4493783a8 100644 --- a/Mage.Sets/src/mage/sets/mirrodin/Island2.java +++ b/Mage.Sets/src/mage/sets/mirrodin/Island2.java @@ -36,18 +36,18 @@ import java.util.UUID; */ public class Island2 extends mage.cards.basiclands.Island { - public Island2(UUID ownerId) { - super(ownerId, 292); - this.expansionSetCode = "MRD"; - } + public Island2(UUID ownerId) { + super(ownerId, 292); + this.expansionSetCode = "MRD"; + } - public Island2(final Island2 card) { - super(card); - } + public Island2(final Island2 card) { + super(card); + } - @Override - public Island2 copy() { - return new Island2(this); - } + @Override + public Island2 copy() { + return new Island2(this); + } } diff --git a/Mage.Sets/src/mage/sets/mirrodin/Island3.java b/Mage.Sets/src/mage/sets/mirrodin/Island3.java index 770c2cb5ad..09a395efda 100644 --- a/Mage.Sets/src/mage/sets/mirrodin/Island3.java +++ b/Mage.Sets/src/mage/sets/mirrodin/Island3.java @@ -36,18 +36,18 @@ import java.util.UUID; */ public class Island3 extends mage.cards.basiclands.Island { - public Island3(UUID ownerId) { - super(ownerId, 293); - this.expansionSetCode = "MRD"; - } + public Island3(UUID ownerId) { + super(ownerId, 293); + this.expansionSetCode = "MRD"; + } - public Island3(final Island3 card) { - super(card); - } + public Island3(final Island3 card) { + super(card); + } - @Override - public Island3 copy() { - return new Island3(this); - } + @Override + public Island3 copy() { + return new Island3(this); + } } diff --git a/Mage.Sets/src/mage/sets/mirrodin/Island4.java b/Mage.Sets/src/mage/sets/mirrodin/Island4.java index 505da40c17..2a43af0bf7 100644 --- a/Mage.Sets/src/mage/sets/mirrodin/Island4.java +++ b/Mage.Sets/src/mage/sets/mirrodin/Island4.java @@ -36,18 +36,18 @@ import java.util.UUID; */ public class Island4 extends mage.cards.basiclands.Island { - public Island4(UUID ownerId) { - super(ownerId, 294); - this.expansionSetCode = "MRD"; - } + public Island4(UUID ownerId) { + super(ownerId, 294); + this.expansionSetCode = "MRD"; + } - public Island4(final Island4 card) { - super(card); - } + public Island4(final Island4 card) { + super(card); + } - @Override - public Island4 copy() { - return new Island4(this); - } + @Override + public Island4 copy() { + return new Island4(this); + } } diff --git a/Mage.Sets/src/mage/sets/mirrodin/LeoninSkyhunter.java b/Mage.Sets/src/mage/sets/mirrodin/LeoninSkyhunter.java index 32a3c7bc8e..e234ce726b 100644 --- a/Mage.Sets/src/mage/sets/mirrodin/LeoninSkyhunter.java +++ b/Mage.Sets/src/mage/sets/mirrodin/LeoninSkyhunter.java @@ -47,7 +47,7 @@ public class LeoninSkyhunter extends CardImpl { this.subtype.add("Cat"); this.subtype.add("Knight"); - this.color.setWhite(true); + this.color.setWhite(true); this.power = new MageInt(2); this.toughness = new MageInt(2); this.addAbility(FlyingAbility.getInstance()); diff --git a/Mage.Sets/src/mage/sets/mirrodin/LifesparkSpellbomb.java b/Mage.Sets/src/mage/sets/mirrodin/LifesparkSpellbomb.java index 6a84a5f5b8..d03b5b3df7 100644 --- a/Mage.Sets/src/mage/sets/mirrodin/LifesparkSpellbomb.java +++ b/Mage.Sets/src/mage/sets/mirrodin/LifesparkSpellbomb.java @@ -76,11 +76,11 @@ public class LifesparkSpellbomb extends CardImpl { class LifesparkSpellbombToken extends Token { - public LifesparkSpellbombToken() { - super("", "3/3"); - this.cardType.add(CardType.CREATURE); + public LifesparkSpellbombToken() { + super("", "3/3"); + this.cardType.add(CardType.CREATURE); - this.power = new MageInt(3); - this.toughness = new MageInt(3); - } + this.power = new MageInt(3); + this.toughness = new MageInt(3); + } } diff --git a/Mage.Sets/src/mage/sets/mirrodin/Mountain1.java b/Mage.Sets/src/mage/sets/mirrodin/Mountain1.java index db513c2ded..0679b2a11a 100644 --- a/Mage.Sets/src/mage/sets/mirrodin/Mountain1.java +++ b/Mage.Sets/src/mage/sets/mirrodin/Mountain1.java @@ -36,19 +36,19 @@ import java.util.UUID; */ public class Mountain1 extends mage.cards.basiclands.Mountain { - public Mountain1(UUID ownerId) { - super(ownerId, 299); - this.expansionSetCode = "MRD"; - } + public Mountain1(UUID ownerId) { + super(ownerId, 299); + this.expansionSetCode = "MRD"; + } - public Mountain1(final Mountain1 card) { - super(card); - } + public Mountain1(final Mountain1 card) { + super(card); + } - @Override - public Mountain1 copy() { - return new Mountain1(this); - } + @Override + public Mountain1 copy() { + return new Mountain1(this); + } } diff --git a/Mage.Sets/src/mage/sets/mirrodin/Mountain2.java b/Mage.Sets/src/mage/sets/mirrodin/Mountain2.java index ea1195d763..ea38142bd3 100644 --- a/Mage.Sets/src/mage/sets/mirrodin/Mountain2.java +++ b/Mage.Sets/src/mage/sets/mirrodin/Mountain2.java @@ -36,18 +36,18 @@ import java.util.UUID; */ public class Mountain2 extends mage.cards.basiclands.Mountain { - public Mountain2(UUID ownerId) { - super(ownerId, 300); - this.expansionSetCode = "MRD"; - } + public Mountain2(UUID ownerId) { + super(ownerId, 300); + this.expansionSetCode = "MRD"; + } - public Mountain2(final Mountain2 card) { - super(card); - } + public Mountain2(final Mountain2 card) { + super(card); + } - @Override - public Mountain2 copy() { - return new Mountain2(this); - } + @Override + public Mountain2 copy() { + return new Mountain2(this); + } } diff --git a/Mage.Sets/src/mage/sets/mirrodin/Mountain3.java b/Mage.Sets/src/mage/sets/mirrodin/Mountain3.java index fb1aa2a73d..3d4a0dd4bb 100644 --- a/Mage.Sets/src/mage/sets/mirrodin/Mountain3.java +++ b/Mage.Sets/src/mage/sets/mirrodin/Mountain3.java @@ -36,18 +36,18 @@ import java.util.UUID; */ public class Mountain3 extends mage.cards.basiclands.Mountain { - public Mountain3(UUID ownerId) { - super(ownerId, 301); - this.expansionSetCode = "MRD"; - } + public Mountain3(UUID ownerId) { + super(ownerId, 301); + this.expansionSetCode = "MRD"; + } - public Mountain3(final Mountain3 card) { - super(card); - } + public Mountain3(final Mountain3 card) { + super(card); + } - @Override - public Mountain3 copy() { - return new Mountain3(this); - } + @Override + public Mountain3 copy() { + return new Mountain3(this); + } } diff --git a/Mage.Sets/src/mage/sets/mirrodin/Mountain4.java b/Mage.Sets/src/mage/sets/mirrodin/Mountain4.java index 3478454edb..7c8639020a 100644 --- a/Mage.Sets/src/mage/sets/mirrodin/Mountain4.java +++ b/Mage.Sets/src/mage/sets/mirrodin/Mountain4.java @@ -36,18 +36,18 @@ import java.util.UUID; */ public class Mountain4 extends mage.cards.basiclands.Mountain { - public Mountain4(UUID ownerId) { - super(ownerId, 302); - this.expansionSetCode = "MRD"; - } + public Mountain4(UUID ownerId) { + super(ownerId, 302); + this.expansionSetCode = "MRD"; + } - public Mountain4(final Mountain4 card) { - super(card); - } + public Mountain4(final Mountain4 card) { + super(card); + } - @Override - public Mountain4 copy() { - return new Mountain4(this); - } + @Override + public Mountain4 copy() { + return new Mountain4(this); + } } diff --git a/Mage.Sets/src/mage/sets/mirrodin/Plains1.java b/Mage.Sets/src/mage/sets/mirrodin/Plains1.java index c3d0fb84e2..10604274df 100644 --- a/Mage.Sets/src/mage/sets/mirrodin/Plains1.java +++ b/Mage.Sets/src/mage/sets/mirrodin/Plains1.java @@ -36,18 +36,18 @@ import java.util.UUID; */ public class Plains1 extends mage.cards.basiclands.Plains { - public Plains1(UUID ownerId) { - super(ownerId, 287); - this.expansionSetCode = "MRD"; - } + public Plains1(UUID ownerId) { + super(ownerId, 287); + this.expansionSetCode = "MRD"; + } - public Plains1(final Plains1 card) { - super(card); - } + public Plains1(final Plains1 card) { + super(card); + } - @Override - public Plains1 copy() { - return new Plains1(this); - } + @Override + public Plains1 copy() { + return new Plains1(this); + } } diff --git a/Mage.Sets/src/mage/sets/mirrodin/Plains2.java b/Mage.Sets/src/mage/sets/mirrodin/Plains2.java index cfbd9edfde..6a498371eb 100644 --- a/Mage.Sets/src/mage/sets/mirrodin/Plains2.java +++ b/Mage.Sets/src/mage/sets/mirrodin/Plains2.java @@ -36,18 +36,18 @@ import java.util.UUID; */ public class Plains2 extends mage.cards.basiclands.Plains { - public Plains2(UUID ownerId) { - super(ownerId, 288); - this.expansionSetCode = "MRD"; - } + public Plains2(UUID ownerId) { + super(ownerId, 288); + this.expansionSetCode = "MRD"; + } - public Plains2(final Plains2 card) { - super(card); - } + public Plains2(final Plains2 card) { + super(card); + } - @Override - public Plains2 copy() { - return new Plains2(this); - } + @Override + public Plains2 copy() { + return new Plains2(this); + } } diff --git a/Mage.Sets/src/mage/sets/mirrodin/Plains3.java b/Mage.Sets/src/mage/sets/mirrodin/Plains3.java index 35ae0b2aab..99c444dcc5 100644 --- a/Mage.Sets/src/mage/sets/mirrodin/Plains3.java +++ b/Mage.Sets/src/mage/sets/mirrodin/Plains3.java @@ -36,18 +36,18 @@ import java.util.UUID; */ public class Plains3 extends mage.cards.basiclands.Plains { - public Plains3(UUID ownerId) { - super(ownerId, 289); - this.expansionSetCode = "MRD"; - } + public Plains3(UUID ownerId) { + super(ownerId, 289); + this.expansionSetCode = "MRD"; + } - public Plains3(final Plains3 card) { - super(card); - } + public Plains3(final Plains3 card) { + super(card); + } - @Override - public Plains3 copy() { - return new Plains3(this); - } + @Override + public Plains3 copy() { + return new Plains3(this); + } } diff --git a/Mage.Sets/src/mage/sets/mirrodin/Plains4.java b/Mage.Sets/src/mage/sets/mirrodin/Plains4.java index bd4195eff4..ed626f5590 100644 --- a/Mage.Sets/src/mage/sets/mirrodin/Plains4.java +++ b/Mage.Sets/src/mage/sets/mirrodin/Plains4.java @@ -36,18 +36,18 @@ import java.util.UUID; */ public class Plains4 extends mage.cards.basiclands.Plains { - public Plains4(UUID ownerId) { - super(ownerId, 290); - this.expansionSetCode = "MRD"; - } + public Plains4(UUID ownerId) { + super(ownerId, 290); + this.expansionSetCode = "MRD"; + } - public Plains4(final Plains4 card) { - super(card); - } + public Plains4(final Plains4 card) { + super(card); + } - @Override - public Plains4 copy() { - return new Plains4(this); - } + @Override + public Plains4 copy() { + return new Plains4(this); + } } diff --git a/Mage.Sets/src/mage/sets/mirrodin/RaiseTheAlarm.java b/Mage.Sets/src/mage/sets/mirrodin/RaiseTheAlarm.java index ea7092d2fe..1b4e4cffc0 100644 --- a/Mage.Sets/src/mage/sets/mirrodin/RaiseTheAlarm.java +++ b/Mage.Sets/src/mage/sets/mirrodin/RaiseTheAlarm.java @@ -44,7 +44,7 @@ public class RaiseTheAlarm extends CardImpl { public RaiseTheAlarm (UUID ownerId) { super(ownerId, 16, "Raise the Alarm", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{1}{W}"); this.expansionSetCode = "MRD"; - this.color.setWhite(true); + this.color.setWhite(true); this.getSpellAbility().addEffect(new CreateTokenEffect(new SoldierToken(), 2)); } diff --git a/Mage.Sets/src/mage/sets/mirrodin/Regress.java b/Mage.Sets/src/mage/sets/mirrodin/Regress.java index 9b30171621..96ad10703c 100644 --- a/Mage.Sets/src/mage/sets/mirrodin/Regress.java +++ b/Mage.Sets/src/mage/sets/mirrodin/Regress.java @@ -44,7 +44,7 @@ public class Regress extends CardImpl { public Regress (UUID ownerId) { super(ownerId, 48, "Regress", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{2}{U}"); this.expansionSetCode = "MRD"; - this.color.setBlue(true); + this.color.setBlue(true); this.getSpellAbility().addEffect(new ReturnToHandTargetEffect()); this.getSpellAbility().addTarget(new TargetPermanent()); } diff --git a/Mage.Sets/src/mage/sets/mirrodin/Shatter.java b/Mage.Sets/src/mage/sets/mirrodin/Shatter.java index 8649f8b193..94dc639287 100644 --- a/Mage.Sets/src/mage/sets/mirrodin/Shatter.java +++ b/Mage.Sets/src/mage/sets/mirrodin/Shatter.java @@ -52,7 +52,7 @@ public class Shatter extends CardImpl { public Shatter (UUID ownerId) { super(ownerId, 105, "Shatter", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{1}{R}"); this.expansionSetCode = "MRD"; - this.color.setRed(true); + this.color.setRed(true); this.getSpellAbility().addEffect(new DestroyTargetEffect()); this.getSpellAbility().addTarget(new TargetPermanent(filter)); } diff --git a/Mage.Sets/src/mage/sets/mirrodin/SpikeshotGoblin.java b/Mage.Sets/src/mage/sets/mirrodin/SpikeshotGoblin.java index 8a1281ab03..4a676f82d8 100644 --- a/Mage.Sets/src/mage/sets/mirrodin/SpikeshotGoblin.java +++ b/Mage.Sets/src/mage/sets/mirrodin/SpikeshotGoblin.java @@ -94,16 +94,16 @@ class SpikeshotGoblinEffect extends OneShotEffect { if (sourcePermanent == null) { sourcePermanent = (Permanent) game.getLastKnownInformation(source.getSourceId(), Constants.Zone.BATTLEFIELD); } - if (sourcePermanent != null && permanent != null) { - permanent.damage(sourcePermanent.getPower().getValue(), source.getId(), game, true, false); - return true; - } - Player player = game.getPlayer(source.getFirstTarget()); - if (sourcePermanent != null && player != null) { - player.damage(sourcePermanent.getPower().getValue(), source.getSourceId(), game, false, true); - return true; - } - return false; + if (sourcePermanent != null && permanent != null) { + permanent.damage(sourcePermanent.getPower().getValue(), source.getId(), game, true, false); + return true; + } + Player player = game.getPlayer(source.getFirstTarget()); + if (sourcePermanent != null && player != null) { + player.damage(sourcePermanent.getPower().getValue(), source.getSourceId(), game, false, true); + return true; + } + return false; } @Override diff --git a/Mage.Sets/src/mage/sets/mirrodin/Swamp1.java b/Mage.Sets/src/mage/sets/mirrodin/Swamp1.java index 3eac8d5142..d854d42af6 100644 --- a/Mage.Sets/src/mage/sets/mirrodin/Swamp1.java +++ b/Mage.Sets/src/mage/sets/mirrodin/Swamp1.java @@ -36,18 +36,18 @@ import java.util.UUID; */ public class Swamp1 extends mage.cards.basiclands.Swamp { - public Swamp1(UUID ownerId) { - super(ownerId, 295); - this.expansionSetCode = "MRD"; - } + public Swamp1(UUID ownerId) { + super(ownerId, 295); + this.expansionSetCode = "MRD"; + } - public Swamp1(final Swamp1 card) { - super(card); - } + public Swamp1(final Swamp1 card) { + super(card); + } - @Override - public Swamp1 copy() { - return new Swamp1(this); - } + @Override + public Swamp1 copy() { + return new Swamp1(this); + } } diff --git a/Mage.Sets/src/mage/sets/mirrodin/Swamp2.java b/Mage.Sets/src/mage/sets/mirrodin/Swamp2.java index 5920b5fbd8..7bd942df3f 100644 --- a/Mage.Sets/src/mage/sets/mirrodin/Swamp2.java +++ b/Mage.Sets/src/mage/sets/mirrodin/Swamp2.java @@ -36,18 +36,18 @@ import java.util.UUID; */ public class Swamp2 extends mage.cards.basiclands.Swamp { - public Swamp2(UUID ownerId) { - super(ownerId, 296); - this.expansionSetCode = "MRD"; - } + public Swamp2(UUID ownerId) { + super(ownerId, 296); + this.expansionSetCode = "MRD"; + } - public Swamp2(final Swamp2 card) { - super(card); - } + public Swamp2(final Swamp2 card) { + super(card); + } - @Override - public Swamp2 copy() { - return new Swamp2(this); - } + @Override + public Swamp2 copy() { + return new Swamp2(this); + } } diff --git a/Mage.Sets/src/mage/sets/mirrodin/Swamp3.java b/Mage.Sets/src/mage/sets/mirrodin/Swamp3.java index b065c2f8bc..43839ceed3 100644 --- a/Mage.Sets/src/mage/sets/mirrodin/Swamp3.java +++ b/Mage.Sets/src/mage/sets/mirrodin/Swamp3.java @@ -36,18 +36,18 @@ import java.util.UUID; */ public class Swamp3 extends mage.cards.basiclands.Swamp { - public Swamp3(UUID ownerId) { - super(ownerId, 297); - this.expansionSetCode = "MRD"; - } + public Swamp3(UUID ownerId) { + super(ownerId, 297); + this.expansionSetCode = "MRD"; + } - public Swamp3(final Swamp3 card) { - super(card); - } + public Swamp3(final Swamp3 card) { + super(card); + } - @Override - public Swamp3 copy() { - return new Swamp3(this); - } + @Override + public Swamp3 copy() { + return new Swamp3(this); + } } diff --git a/Mage.Sets/src/mage/sets/mirrodin/Swamp4.java b/Mage.Sets/src/mage/sets/mirrodin/Swamp4.java index c32a120018..cd33dd5855 100644 --- a/Mage.Sets/src/mage/sets/mirrodin/Swamp4.java +++ b/Mage.Sets/src/mage/sets/mirrodin/Swamp4.java @@ -36,18 +36,18 @@ import java.util.UUID; */ public class Swamp4 extends mage.cards.basiclands.Swamp { - public Swamp4(UUID ownerId) { - super(ownerId, 298); - this.expansionSetCode = "MRD"; - } + public Swamp4(UUID ownerId) { + super(ownerId, 298); + this.expansionSetCode = "MRD"; + } - public Swamp4(final Swamp4 card) { - super(card); - } + public Swamp4(final Swamp4 card) { + super(card); + } - @Override - public Swamp4 copy() { - return new Swamp4(this); - } + @Override + public Swamp4 copy() { + return new Swamp4(this); + } } diff --git a/Mage.Sets/src/mage/sets/mirrodin/TowerOfChampions.java b/Mage.Sets/src/mage/sets/mirrodin/TowerOfChampions.java index 9e4d63e510..7603673ec5 100644 --- a/Mage.Sets/src/mage/sets/mirrodin/TowerOfChampions.java +++ b/Mage.Sets/src/mage/sets/mirrodin/TowerOfChampions.java @@ -50,10 +50,10 @@ public class TowerOfChampions extends CardImpl { public TowerOfChampions (UUID ownerId) { super(ownerId, 265, "Tower of Champions", Rarity.RARE, new CardType[]{CardType.ARTIFACT}, "{4}"); this.expansionSetCode = "MRD"; - Ability ability = new SimpleActivatedAbility(Constants.Zone.BATTLEFIELD, new BoostTargetEffect(6, 6, Constants.Duration.EndOfTurn), new GenericManaCost(8)); - ability.addCost(new TapSourceCost()); - ability.addTarget(new TargetCreaturePermanent()); - this.addAbility(ability); + Ability ability = new SimpleActivatedAbility(Constants.Zone.BATTLEFIELD, new BoostTargetEffect(6, 6, Constants.Duration.EndOfTurn), new GenericManaCost(8)); + ability.addCost(new TapSourceCost()); + ability.addTarget(new TargetCreaturePermanent()); + this.addAbility(ability); } public TowerOfChampions (final TowerOfChampions card) { diff --git a/Mage.Sets/src/mage/sets/mirrodin/TowerOfEons.java b/Mage.Sets/src/mage/sets/mirrodin/TowerOfEons.java index bcfb3d9186..4b781f26cc 100644 --- a/Mage.Sets/src/mage/sets/mirrodin/TowerOfEons.java +++ b/Mage.Sets/src/mage/sets/mirrodin/TowerOfEons.java @@ -49,8 +49,8 @@ public class TowerOfEons extends CardImpl { public TowerOfEons (UUID ownerId) { super(ownerId, 266, "Tower of Eons", Rarity.RARE, new CardType[]{CardType.ARTIFACT}, "{4}"); this.expansionSetCode = "MRD"; - Ability ability = new SimpleActivatedAbility(Constants.Zone.BATTLEFIELD, new GainLifeEffect(10), new GenericManaCost(8)); - ability.addCost(new TapSourceCost()); + Ability ability = new SimpleActivatedAbility(Constants.Zone.BATTLEFIELD, new GainLifeEffect(10), new GenericManaCost(8)); + ability.addCost(new TapSourceCost()); this.addAbility(ability); } diff --git a/Mage.Sets/src/mage/sets/mirrodin/TowerOfFortunes.java b/Mage.Sets/src/mage/sets/mirrodin/TowerOfFortunes.java index 39d85157de..689ec12dba 100644 --- a/Mage.Sets/src/mage/sets/mirrodin/TowerOfFortunes.java +++ b/Mage.Sets/src/mage/sets/mirrodin/TowerOfFortunes.java @@ -49,8 +49,8 @@ public class TowerOfFortunes extends CardImpl { public TowerOfFortunes (UUID ownerId) { super(ownerId, 267, "Tower of Fortunes", Rarity.RARE, new CardType[]{CardType.ARTIFACT}, "{4}"); this.expansionSetCode = "MRD"; - Ability ability = new SimpleActivatedAbility(Constants.Zone.BATTLEFIELD, new DrawCardControllerEffect(4), new GenericManaCost(8)); - ability.addCost(new TapSourceCost()); + Ability ability = new SimpleActivatedAbility(Constants.Zone.BATTLEFIELD, new DrawCardControllerEffect(4), new GenericManaCost(8)); + ability.addCost(new TapSourceCost()); this.addAbility(ability); } diff --git a/Mage.Sets/src/mage/sets/mirrodin/TowerOfMurmurs.java b/Mage.Sets/src/mage/sets/mirrodin/TowerOfMurmurs.java index 3d154b7677..83954ce47c 100644 --- a/Mage.Sets/src/mage/sets/mirrodin/TowerOfMurmurs.java +++ b/Mage.Sets/src/mage/sets/mirrodin/TowerOfMurmurs.java @@ -50,9 +50,9 @@ public class TowerOfMurmurs extends CardImpl { public TowerOfMurmurs (UUID ownerId) { super(ownerId, 268, "Tower of Murmurs", Rarity.RARE, new CardType[]{CardType.ARTIFACT}, "{4}"); this.expansionSetCode = "MRD"; - Ability ability = new SimpleActivatedAbility(Constants.Zone.BATTLEFIELD, new PutLibraryIntoGraveTargetEffect(8), new GenericManaCost(8)); - ability.addCost(new TapSourceCost()); - ability.addTarget(new TargetPlayer()); + Ability ability = new SimpleActivatedAbility(Constants.Zone.BATTLEFIELD, new PutLibraryIntoGraveTargetEffect(8), new GenericManaCost(8)); + ability.addCost(new TapSourceCost()); + ability.addTarget(new TargetPlayer()); this.addAbility(ability); } diff --git a/Mage.Sets/src/mage/sets/mirrodin/TrollAscetic.java b/Mage.Sets/src/mage/sets/mirrodin/TrollAscetic.java index 092d54a4de..ce5c133f59 100644 --- a/Mage.Sets/src/mage/sets/mirrodin/TrollAscetic.java +++ b/Mage.Sets/src/mage/sets/mirrodin/TrollAscetic.java @@ -50,11 +50,11 @@ public class TrollAscetic extends CardImpl { this.expansionSetCode = "MRD"; this.subtype.add("Troll"); this.subtype.add("Shaman"); - this.color.setGreen(true); + this.color.setGreen(true); this.power = new MageInt(3); this.toughness = new MageInt(2); - this.addAbility(HexproofAbility.getInstance()); - this.addAbility(new SimpleActivatedAbility(Constants.Zone.BATTLEFIELD, new RegenerateSourceEffect(), new ManaCostsImpl("{1}{G}"))); + this.addAbility(HexproofAbility.getInstance()); + this.addAbility(new SimpleActivatedAbility(Constants.Zone.BATTLEFIELD, new RegenerateSourceEffect(), new ManaCostsImpl("{1}{G}"))); } public TrollAscetic (final TrollAscetic card) { diff --git a/Mage.Sets/src/mage/sets/mirrodin/VulshokBattlegear.java b/Mage.Sets/src/mage/sets/mirrodin/VulshokBattlegear.java index 202bd58d1d..50966443b8 100644 --- a/Mage.Sets/src/mage/sets/mirrodin/VulshokBattlegear.java +++ b/Mage.Sets/src/mage/sets/mirrodin/VulshokBattlegear.java @@ -50,7 +50,7 @@ public class VulshokBattlegear extends CardImpl { this.expansionSetCode = "MRD"; this.subtype.add("Equipment"); this.addAbility(new EquipAbility(Constants.Outcome.BoostCreature, new GenericManaCost(3))); - this.addAbility(new SimpleStaticAbility(Constants.Zone.BATTLEFIELD, new BoostEquippedEffect(3, 3))); + this.addAbility(new SimpleStaticAbility(Constants.Zone.BATTLEFIELD, new BoostEquippedEffect(3, 3))); } public VulshokBattlegear (final VulshokBattlegear card) { diff --git a/Mage.Sets/src/mage/sets/mirrodinbesieged/AccorderPaladin.java b/Mage.Sets/src/mage/sets/mirrodinbesieged/AccorderPaladin.java index 609c65055d..d0ea98e920 100644 --- a/Mage.Sets/src/mage/sets/mirrodinbesieged/AccorderPaladin.java +++ b/Mage.Sets/src/mage/sets/mirrodinbesieged/AccorderPaladin.java @@ -46,7 +46,7 @@ public class AccorderPaladin extends CardImpl { this.expansionSetCode = "MBS"; this.subtype.add("Human"); this.subtype.add("Knight"); - this.color.setWhite(true); + this.color.setWhite(true); this.power = new MageInt(3); this.toughness = new MageInt(1); this.addAbility(new BattleCryAbility()); diff --git a/Mage.Sets/src/mage/sets/mirrodinbesieged/BanishmentDecree.java b/Mage.Sets/src/mage/sets/mirrodinbesieged/BanishmentDecree.java index 87b540e3c2..fb62622dcf 100644 --- a/Mage.Sets/src/mage/sets/mirrodinbesieged/BanishmentDecree.java +++ b/Mage.Sets/src/mage/sets/mirrodinbesieged/BanishmentDecree.java @@ -54,7 +54,7 @@ public class BanishmentDecree extends CardImpl { public BanishmentDecree (UUID ownerId) { super(ownerId, 3, "Banishment Decree", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{3}{W}{W}"); this.expansionSetCode = "MBS"; - this.color.setWhite(true); + this.color.setWhite(true); this.getSpellAbility().addEffect(new PutOnLibraryTargetEffect(true)); this.getSpellAbility().addTarget(new TargetPermanent(filter)); } diff --git a/Mage.Sets/src/mage/sets/mirrodinbesieged/BlackSunsZenith.java b/Mage.Sets/src/mage/sets/mirrodinbesieged/BlackSunsZenith.java index 020d9762f6..c9a2dcf9fe 100644 --- a/Mage.Sets/src/mage/sets/mirrodinbesieged/BlackSunsZenith.java +++ b/Mage.Sets/src/mage/sets/mirrodinbesieged/BlackSunsZenith.java @@ -50,7 +50,7 @@ public class BlackSunsZenith extends CardImpl { public BlackSunsZenith (UUID ownerId) { super(ownerId, 39, "Black Sun's Zenith", Rarity.RARE, new CardType[]{CardType.SORCERY}, "{X}{B}{B}"); this.expansionSetCode = "MBS"; - this.color.setBlack(true); + this.color.setBlack(true); this.getSpellAbility().addEffect(new BlackSunsZenithEffect()); this.getSpellAbility().addEffect(ShuffleSpellEffect.getInstance()); } diff --git a/Mage.Sets/src/mage/sets/mirrodinbesieged/Blightwidow.java b/Mage.Sets/src/mage/sets/mirrodinbesieged/Blightwidow.java index 15734640c9..f5bfd7ad58 100644 --- a/Mage.Sets/src/mage/sets/mirrodinbesieged/Blightwidow.java +++ b/Mage.Sets/src/mage/sets/mirrodinbesieged/Blightwidow.java @@ -46,7 +46,7 @@ public class Blightwidow extends CardImpl { super(ownerId, 77, "Blightwidow", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{3}{G}"); this.expansionSetCode = "MBS"; this.subtype.add("Spider"); - this.color.setGreen(true); + this.color.setGreen(true); this.power = new MageInt(2); this.toughness = new MageInt(4); this.addAbility(ReachAbility.getInstance()); diff --git a/Mage.Sets/src/mage/sets/mirrodinbesieged/BlisterstickShaman.java b/Mage.Sets/src/mage/sets/mirrodinbesieged/BlisterstickShaman.java index 7738238614..e5dbaed59f 100644 --- a/Mage.Sets/src/mage/sets/mirrodinbesieged/BlisterstickShaman.java +++ b/Mage.Sets/src/mage/sets/mirrodinbesieged/BlisterstickShaman.java @@ -49,7 +49,7 @@ public class BlisterstickShaman extends CardImpl { this.expansionSetCode = "MBS"; this.subtype.add("Goblin"); this.subtype.add("Shaman"); - this.color.setRed(true); + this.color.setRed(true); this.power = new MageInt(2); this.toughness = new MageInt(1); Ability ability = new EntersBattlefieldTriggeredAbility(new DamageTargetEffect(1)); diff --git a/Mage.Sets/src/mage/sets/mirrodinbesieged/BlueSunsZenith.java b/Mage.Sets/src/mage/sets/mirrodinbesieged/BlueSunsZenith.java index d74cdf71d5..5b81349d39 100644 --- a/Mage.Sets/src/mage/sets/mirrodinbesieged/BlueSunsZenith.java +++ b/Mage.Sets/src/mage/sets/mirrodinbesieged/BlueSunsZenith.java @@ -46,7 +46,7 @@ public class BlueSunsZenith extends CardImpl { public BlueSunsZenith (UUID ownerId) { super(ownerId, 20, "Blue Sun's Zenith", Rarity.RARE, new CardType[]{CardType.INSTANT}, "{X}{U}{U}{U}"); this.expansionSetCode = "MBS"; - this.color.setBlue(true); + this.color.setBlue(true); this.getSpellAbility().addEffect(new DrawCardTargetEffect(new ManacostVariableValue())); this.getSpellAbility().addEffect(ShuffleSpellEffect.getInstance()); this.getSpellAbility().addTarget(new TargetPlayer()); diff --git a/Mage.Sets/src/mage/sets/mirrodinbesieged/BurntheImpure.java b/Mage.Sets/src/mage/sets/mirrodinbesieged/BurntheImpure.java index 1e520ebe2b..89d606de6d 100644 --- a/Mage.Sets/src/mage/sets/mirrodinbesieged/BurntheImpure.java +++ b/Mage.Sets/src/mage/sets/mirrodinbesieged/BurntheImpure.java @@ -51,9 +51,9 @@ public class BurntheImpure extends CardImpl { public BurntheImpure (UUID ownerId) { super(ownerId, 59, "Burn the Impure", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{1}{R}"); this.expansionSetCode = "MBS"; - this.color.setRed(true); - this.getSpellAbility().addTarget(new TargetCreaturePermanent()); - this.getSpellAbility().addEffect(new BurntheImpureEffect(3)); + this.color.setRed(true); + this.getSpellAbility().addTarget(new TargetCreaturePermanent()); + this.getSpellAbility().addEffect(new BurntheImpureEffect(3)); } public BurntheImpure (final BurntheImpure card) { @@ -65,45 +65,45 @@ public class BurntheImpure extends CardImpl { return new BurntheImpure(this); } - public class BurntheImpureEffect extends OneShotEffect { + public class BurntheImpureEffect extends OneShotEffect { - protected int amount; + protected int amount; - public BurntheImpureEffect(int amount) { - super(Constants.Outcome.Damage); - this.amount = amount; - staticText = "{this} deals 3 damage to target creature. If that creature has infect, {this} deals 3 damage to that creature's controller."; - } + public BurntheImpureEffect(int amount) { + super(Constants.Outcome.Damage); + this.amount = amount; + staticText = "{this} deals 3 damage to target creature. If that creature has infect, {this} deals 3 damage to that creature's controller."; + } - public int getAmount() { - return amount; - } + public int getAmount() { + return amount; + } - public BurntheImpureEffect(final BurntheImpureEffect effect) { - super(effect); - this.amount = effect.amount; - } + public BurntheImpureEffect(final BurntheImpureEffect effect) { + super(effect); + this.amount = effect.amount; + } - @Override - public BurntheImpureEffect copy() { - return new BurntheImpureEffect(this); - } + @Override + public BurntheImpureEffect copy() { + return new BurntheImpureEffect(this); + } - @Override - public boolean apply(Game game, Ability source) { - Permanent permanent = game.getPermanent(source.getFirstTarget()); - if (permanent != null) { - permanent.damage(amount, source.getId(), game, true, false); - if (permanent.getAbilities().contains(InfectAbility.getInstance())) { - Player controller = game.getPlayer(permanent.getControllerId()); - if (controller != null) { - controller.damage(amount, source.getSourceId(), game, true, false); - } - } - return true; - } - return false; - } + @Override + public boolean apply(Game game, Ability source) { + Permanent permanent = game.getPermanent(source.getFirstTarget()); + if (permanent != null) { + permanent.damage(amount, source.getId(), game, true, false); + if (permanent.getAbilities().contains(InfectAbility.getInstance())) { + Player controller = game.getPlayer(permanent.getControllerId()); + if (controller != null) { + controller.damage(amount, source.getSourceId(), game, true, false); + } + } + return true; + } + return false; + } } diff --git a/Mage.Sets/src/mage/sets/mirrodinbesieged/CausticHound.java b/Mage.Sets/src/mage/sets/mirrodinbesieged/CausticHound.java index b8433d0b2e..29fd04738e 100644 --- a/Mage.Sets/src/mage/sets/mirrodinbesieged/CausticHound.java +++ b/Mage.Sets/src/mage/sets/mirrodinbesieged/CausticHound.java @@ -47,10 +47,10 @@ public class CausticHound extends CardImpl { super(ownerId, 40, "Caustic Hound", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{5}{B}"); this.expansionSetCode = "MBS"; this.subtype.add("Hound"); - this.color.setBlack(true); + this.color.setBlack(true); this.power = new MageInt(4); this.toughness = new MageInt(4); - this.addAbility(new DiesTriggeredAbility(new LoseLifePlayersEffect(4))); + this.addAbility(new DiesTriggeredAbility(new LoseLifePlayersEffect(4))); } public CausticHound (final CausticHound card) { diff --git a/Mage.Sets/src/mage/sets/mirrodinbesieged/ConsecratedSphinx.java b/Mage.Sets/src/mage/sets/mirrodinbesieged/ConsecratedSphinx.java index 1ef96213ec..d29a1a7952 100644 --- a/Mage.Sets/src/mage/sets/mirrodinbesieged/ConsecratedSphinx.java +++ b/Mage.Sets/src/mage/sets/mirrodinbesieged/ConsecratedSphinx.java @@ -51,11 +51,11 @@ public class ConsecratedSphinx extends CardImpl { super(ownerId, 21, "Consecrated Sphinx", Rarity.MYTHIC, new CardType[]{CardType.CREATURE}, "{4}{U}{U}"); this.expansionSetCode = "MBS"; this.subtype.add("Sphinx"); - this.color.setBlue(true); + this.color.setBlue(true); this.power = new MageInt(4); this.toughness = new MageInt(6); - this.addAbility(FlyingAbility.getInstance()); - this.addAbility(new ConsecratedSphinxTriggeredAbility()); + this.addAbility(FlyingAbility.getInstance()); + this.addAbility(new ConsecratedSphinxTriggeredAbility()); } public ConsecratedSphinx (final ConsecratedSphinx card) { @@ -70,29 +70,29 @@ public class ConsecratedSphinx extends CardImpl { } class ConsecratedSphinxTriggeredAbility extends TriggeredAbilityImpl { - ConsecratedSphinxTriggeredAbility() { - super(Constants.Zone.BATTLEFIELD, new DrawCardControllerEffect(2), true); - } + ConsecratedSphinxTriggeredAbility() { + super(Constants.Zone.BATTLEFIELD, new DrawCardControllerEffect(2), true); + } - ConsecratedSphinxTriggeredAbility(final ConsecratedSphinxTriggeredAbility ability) { - super(ability); - } + ConsecratedSphinxTriggeredAbility(final ConsecratedSphinxTriggeredAbility ability) { + super(ability); + } - @Override - public ConsecratedSphinxTriggeredAbility copy() { - return new ConsecratedSphinxTriggeredAbility(this); - } + @Override + public ConsecratedSphinxTriggeredAbility copy() { + return new ConsecratedSphinxTriggeredAbility(this); + } - @Override - public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == GameEvent.EventType.DREW_CARD && game.getOpponents(this.getControllerId()).contains(event.getPlayerId())) { - return true; - } - return false; - } + @Override + public boolean checkTrigger(GameEvent event, Game game) { + if (event.getType() == GameEvent.EventType.DREW_CARD && game.getOpponents(this.getControllerId()).contains(event.getPlayerId())) { + return true; + } + return false; + } - @Override - public String getRule() { - return "Whenever an opponent draws a card, you may draw two cards"; - } + @Override + public String getRule() { + return "Whenever an opponent draws a card, you may draw two cards"; + } } \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/mirrodinbesieged/ContestedWarZone.java b/Mage.Sets/src/mage/sets/mirrodinbesieged/ContestedWarZone.java index f6269ec205..ccacdfd2e9 100644 --- a/Mage.Sets/src/mage/sets/mirrodinbesieged/ContestedWarZone.java +++ b/Mage.Sets/src/mage/sets/mirrodinbesieged/ContestedWarZone.java @@ -58,26 +58,26 @@ import mage.game.permanent.Permanent; */ public class ContestedWarZone extends CardImpl { - private static final FilterAttackingCreature filter = new FilterAttackingCreature("Attacking creatures"); + private static final FilterAttackingCreature filter = new FilterAttackingCreature("Attacking creatures"); - public ContestedWarZone(UUID ownerId) { - super(ownerId, 144, "Contested War Zone", Rarity.RARE, new CardType[]{CardType.LAND}, null); - this.expansionSetCode = "MBS"; - this.addAbility(new ColorlessManaAbility()); - Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new BoostAllEffect(1, 0, Duration.EndOfTurn, filter, false), new ManaCostsImpl("{1}")); - ability.addCost(new TapSourceCost()); - this.addAbility(ability); - this.addAbility(new ContestedWarZoneAbility()); - } + public ContestedWarZone(UUID ownerId) { + super(ownerId, 144, "Contested War Zone", Rarity.RARE, new CardType[]{CardType.LAND}, null); + this.expansionSetCode = "MBS"; + this.addAbility(new ColorlessManaAbility()); + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new BoostAllEffect(1, 0, Duration.EndOfTurn, filter, false), new ManaCostsImpl("{1}")); + ability.addCost(new TapSourceCost()); + this.addAbility(ability); + this.addAbility(new ContestedWarZoneAbility()); + } - public ContestedWarZone(final ContestedWarZone card) { - super(card); - } + public ContestedWarZone(final ContestedWarZone card) { + super(card); + } - @Override - public ContestedWarZone copy() { - return new ContestedWarZone(this); - } + @Override + public ContestedWarZone copy() { + return new ContestedWarZone(this); + } } @@ -102,8 +102,8 @@ class ContestedWarZoneAbility extends TriggeredAbilityImpl { - public ContestedWarZoneEffect() { - super(Duration.EndOfGame, Layer.ControlChangingEffects_2, SubLayer.NA, Outcome.GainControl); - } + public ContestedWarZoneEffect() { + super(Duration.EndOfGame, Layer.ControlChangingEffects_2, SubLayer.NA, Outcome.GainControl); + } - public ContestedWarZoneEffect(final ContestedWarZoneEffect effect) { - super(effect); - } + public ContestedWarZoneEffect(final ContestedWarZoneEffect effect) { + super(effect); + } - @Override - public ContestedWarZoneEffect copy() { - return new ContestedWarZoneEffect(this); - } + @Override + public ContestedWarZoneEffect copy() { + return new ContestedWarZoneEffect(this); + } - @Override - public boolean apply(Game game, Ability source) { - Permanent permanent = game.getPermanent(source.getSourceId()); - UUID controllerId = (UUID) game.getState().getValue(source.getSourceId().toString()); - if (permanent != null && controllerId != null) { - return permanent.changeControllerId(controllerId, game); - } - return false; - } + @Override + public boolean apply(Game game, Ability source) { + Permanent permanent = game.getPermanent(source.getSourceId()); + UUID controllerId = (UUID) game.getState().getValue(source.getSourceId().toString()); + if (permanent != null && controllerId != null) { + return permanent.changeControllerId(controllerId, game); + } + return false; + } - @Override - public String getText(Mode mode) { - return "Gain control of {this}"; - } + @Override + public String getText(Mode mode) { + return "Gain control of {this}"; + } } diff --git a/Mage.Sets/src/mage/sets/mirrodinbesieged/CoreProwler.java b/Mage.Sets/src/mage/sets/mirrodinbesieged/CoreProwler.java index c1a6dd5055..ae43c565c6 100644 --- a/Mage.Sets/src/mage/sets/mirrodinbesieged/CoreProwler.java +++ b/Mage.Sets/src/mage/sets/mirrodinbesieged/CoreProwler.java @@ -49,8 +49,8 @@ public class CoreProwler extends CardImpl { this.subtype.add("Horror"); this.power = new MageInt(2); this.toughness = new MageInt(2); - this.addAbility(InfectAbility.getInstance()); - this.addAbility(new DiesTriggeredAbility(new ProliferateEffect())); + this.addAbility(InfectAbility.getInstance()); + this.addAbility(new DiesTriggeredAbility(new ProliferateEffect())); } public CoreProwler (final CoreProwler card) { diff --git a/Mage.Sets/src/mage/sets/mirrodinbesieged/CorruptedConscience.java b/Mage.Sets/src/mage/sets/mirrodinbesieged/CorruptedConscience.java index 484c84bc14..d0c7d3b6bb 100644 --- a/Mage.Sets/src/mage/sets/mirrodinbesieged/CorruptedConscience.java +++ b/Mage.Sets/src/mage/sets/mirrodinbesieged/CorruptedConscience.java @@ -54,7 +54,7 @@ public class CorruptedConscience extends CardImpl { super(ownerId, 22, "Corrupted Conscience", Rarity.UNCOMMON, new CardType[]{CardType.ENCHANTMENT}, "{3}{U}{U}"); this.expansionSetCode = "MBS"; this.subtype.add("Aura"); - this.color.setBlue(true); + this.color.setBlue(true); TargetPermanent auraTarget = new TargetCreaturePermanent(); this.getSpellAbility().addTarget(auraTarget); this.getSpellAbility().addEffect(new AttachEffect(Constants.Outcome.AddAbility)); diff --git a/Mage.Sets/src/mage/sets/mirrodinbesieged/CreepingCorrosion.java b/Mage.Sets/src/mage/sets/mirrodinbesieged/CreepingCorrosion.java index ae523d3d70..50300221aa 100644 --- a/Mage.Sets/src/mage/sets/mirrodinbesieged/CreepingCorrosion.java +++ b/Mage.Sets/src/mage/sets/mirrodinbesieged/CreepingCorrosion.java @@ -41,20 +41,20 @@ import mage.filter.common.FilterArtifactPermanent; */ public class CreepingCorrosion extends CardImpl { - public CreepingCorrosion(UUID ownerId) { - super(ownerId, 78, "Creeping Corrosion", Rarity.RARE, new CardType[]{CardType.SORCERY}, "{2}{G}{G}"); - this.expansionSetCode = "MBS"; - this.color.setGreen(true); - this.getSpellAbility().addEffect(new DestroyAllEffect(new FilterArtifactPermanent())); - } + public CreepingCorrosion(UUID ownerId) { + super(ownerId, 78, "Creeping Corrosion", Rarity.RARE, new CardType[]{CardType.SORCERY}, "{2}{G}{G}"); + this.expansionSetCode = "MBS"; + this.color.setGreen(true); + this.getSpellAbility().addEffect(new DestroyAllEffect(new FilterArtifactPermanent())); + } - public CreepingCorrosion(final CreepingCorrosion card) { - super(card); - } + public CreepingCorrosion(final CreepingCorrosion card) { + super(card); + } - @Override - public CreepingCorrosion copy() { - return new CreepingCorrosion(this); - } + @Override + public CreepingCorrosion copy() { + return new CreepingCorrosion(this); + } } diff --git a/Mage.Sets/src/mage/sets/mirrodinbesieged/Cryptoplasm.java b/Mage.Sets/src/mage/sets/mirrodinbesieged/Cryptoplasm.java index 1fc018b9fe..9d5f80466f 100644 --- a/Mage.Sets/src/mage/sets/mirrodinbesieged/Cryptoplasm.java +++ b/Mage.Sets/src/mage/sets/mirrodinbesieged/Cryptoplasm.java @@ -97,9 +97,9 @@ class CryptoplasmTransformEffect extends ContinuousEffectImpl { StringBuilder sb = new StringBuilder(); sb.append("Have ").append(player.getName()).append(" put ").append(card.getName()); sb.append(" in his hand? If none of his opponents says yes, he'll draw three cards."); - + boolean putInHand = false; Set opponents = game.getOpponents(source.getControllerId()); for (UUID opponentUuid : opponents) { diff --git a/Mage.Sets/src/mage/sets/mirrodinbesieged/Flensermite.java b/Mage.Sets/src/mage/sets/mirrodinbesieged/Flensermite.java index 0a1f845207..8a8825afed 100644 --- a/Mage.Sets/src/mage/sets/mirrodinbesieged/Flensermite.java +++ b/Mage.Sets/src/mage/sets/mirrodinbesieged/Flensermite.java @@ -46,11 +46,11 @@ public class Flensermite extends CardImpl { super(ownerId, 41, "Flensermite", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{1}{B}"); this.expansionSetCode = "MBS"; this.subtype.add("Gremlin"); - this.color.setBlack(true); + this.color.setBlack(true); this.power = new MageInt(1); this.toughness = new MageInt(1); - this.addAbility(InfectAbility.getInstance()); - this.addAbility(LifelinkAbility.getInstance()); + this.addAbility(InfectAbility.getInstance()); + this.addAbility(LifelinkAbility.getInstance()); } public Flensermite (final Flensermite card) { diff --git a/Mage.Sets/src/mage/sets/mirrodinbesieged/FleshEaterImp.java b/Mage.Sets/src/mage/sets/mirrodinbesieged/FleshEaterImp.java index e569b8e7ab..dcd046a9f9 100644 --- a/Mage.Sets/src/mage/sets/mirrodinbesieged/FleshEaterImp.java +++ b/Mage.Sets/src/mage/sets/mirrodinbesieged/FleshEaterImp.java @@ -55,9 +55,9 @@ public class FleshEaterImp extends CardImpl { this.color.setBlack(true); this.power = new MageInt(2); this.toughness = new MageInt(2); - this.addAbility(FlyingAbility.getInstance()); - this.addAbility(InfectAbility.getInstance()); - this.addAbility(new SimpleActivatedAbility(Constants.Zone.BATTLEFIELD, new BoostSourceEffect(1, 1, Constants.Duration.EndOfTurn), new SacrificeTargetCost(new TargetControlledCreaturePermanent()))); + this.addAbility(FlyingAbility.getInstance()); + this.addAbility(InfectAbility.getInstance()); + this.addAbility(new SimpleActivatedAbility(Constants.Zone.BATTLEFIELD, new BoostSourceEffect(1, 1, Constants.Duration.EndOfTurn), new SacrificeTargetCost(new TargetControlledCreaturePermanent()))); } public FleshEaterImp (final FleshEaterImp card) { diff --git a/Mage.Sets/src/mage/sets/mirrodinbesieged/Forest1.java b/Mage.Sets/src/mage/sets/mirrodinbesieged/Forest1.java index c5a2e1bfbb..b756eabf96 100644 --- a/Mage.Sets/src/mage/sets/mirrodinbesieged/Forest1.java +++ b/Mage.Sets/src/mage/sets/mirrodinbesieged/Forest1.java @@ -36,16 +36,16 @@ import java.util.UUID; public class Forest1 extends mage.cards.basiclands.Forest { public Forest1(UUID ownerId) { - super(ownerId, 154); - this.expansionSetCode = "MBS"; - } + super(ownerId, 154); + this.expansionSetCode = "MBS"; + } - public Forest1(final Forest1 card) { - super(card); - } + public Forest1(final Forest1 card) { + super(card); + } - @Override - public Forest1 copy() { - return new Forest1(this); - } + @Override + public Forest1 copy() { + return new Forest1(this); + } } diff --git a/Mage.Sets/src/mage/sets/mirrodinbesieged/Forest2.java b/Mage.Sets/src/mage/sets/mirrodinbesieged/Forest2.java index 697a4198f8..dd3b232b0a 100644 --- a/Mage.Sets/src/mage/sets/mirrodinbesieged/Forest2.java +++ b/Mage.Sets/src/mage/sets/mirrodinbesieged/Forest2.java @@ -36,16 +36,16 @@ import java.util.UUID; public class Forest2 extends mage.cards.basiclands.Forest { public Forest2(UUID ownerId) { - super(ownerId, 155); - this.expansionSetCode = "MBS"; - } + super(ownerId, 155); + this.expansionSetCode = "MBS"; + } - public Forest2(final Forest2 card) { - super(card); - } + public Forest2(final Forest2 card) { + super(card); + } - @Override - public Forest2 copy() { - return new Forest2(this); - } + @Override + public Forest2 copy() { + return new Forest2(this); + } } diff --git a/Mage.Sets/src/mage/sets/mirrodinbesieged/FuelForTheCause.java b/Mage.Sets/src/mage/sets/mirrodinbesieged/FuelForTheCause.java index 70fabae082..dd07020ab2 100644 --- a/Mage.Sets/src/mage/sets/mirrodinbesieged/FuelForTheCause.java +++ b/Mage.Sets/src/mage/sets/mirrodinbesieged/FuelForTheCause.java @@ -45,9 +45,9 @@ public class FuelForTheCause extends CardImpl { public FuelForTheCause (UUID ownerId) { super(ownerId, 25, "Fuel for the Cause", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{2}{U}{U}"); this.expansionSetCode = "MBS"; - this.color.setBlue(true); + this.color.setBlue(true); this.getSpellAbility().addTarget(new TargetSpell()); - this.getSpellAbility().addEffect(new CounterTargetEffect()); + this.getSpellAbility().addEffect(new CounterTargetEffect()); this.getSpellAbility().addEffect(new ProliferateEffect()); } diff --git a/Mage.Sets/src/mage/sets/mirrodinbesieged/GlissaTheTraitor.java b/Mage.Sets/src/mage/sets/mirrodinbesieged/GlissaTheTraitor.java index daed28e5c6..c2dd81f8f0 100644 --- a/Mage.Sets/src/mage/sets/mirrodinbesieged/GlissaTheTraitor.java +++ b/Mage.Sets/src/mage/sets/mirrodinbesieged/GlissaTheTraitor.java @@ -58,8 +58,8 @@ public class GlissaTheTraitor extends CardImpl { this.supertype.add("Legendary"); this.subtype.add("Zombie"); this.subtype.add("Elf"); - this.color.setBlack(true); - this.color.setGreen(true); + this.color.setBlack(true); + this.color.setGreen(true); this.power = new MageInt(3); this.toughness = new MageInt(3); // First strike, diff --git a/Mage.Sets/src/mage/sets/mirrodinbesieged/GlissasCourier.java b/Mage.Sets/src/mage/sets/mirrodinbesieged/GlissasCourier.java index accd509d77..79793ad7f3 100644 --- a/Mage.Sets/src/mage/sets/mirrodinbesieged/GlissasCourier.java +++ b/Mage.Sets/src/mage/sets/mirrodinbesieged/GlissasCourier.java @@ -45,7 +45,7 @@ public class GlissasCourier extends CardImpl { super(ownerId, 80, "Glissa's Courier", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{1}{G}{G}"); this.expansionSetCode = "MBS"; this.subtype.add("Horror"); - this.color.setGreen(true); + this.color.setGreen(true); this.power = new MageInt(2); this.toughness = new MageInt(3); this.addAbility(new MountainwalkAbility()); diff --git a/Mage.Sets/src/mage/sets/mirrodinbesieged/GoblinWardriver.java b/Mage.Sets/src/mage/sets/mirrodinbesieged/GoblinWardriver.java index d203d7c8b4..72634e91f5 100644 --- a/Mage.Sets/src/mage/sets/mirrodinbesieged/GoblinWardriver.java +++ b/Mage.Sets/src/mage/sets/mirrodinbesieged/GoblinWardriver.java @@ -46,7 +46,7 @@ public class GoblinWardriver extends CardImpl { this.expansionSetCode = "MBS"; this.subtype.add("Goblin"); this.subtype.add("Warrior"); - this.color.setRed(true); + this.color.setRed(true); this.power = new MageInt(2); this.toughness = new MageInt(2); this.addAbility(new BattleCryAbility()); diff --git a/Mage.Sets/src/mage/sets/mirrodinbesieged/GreenSunsZenith.java b/Mage.Sets/src/mage/sets/mirrodinbesieged/GreenSunsZenith.java index 31547fbf57..5aaccf6ffe 100644 --- a/Mage.Sets/src/mage/sets/mirrodinbesieged/GreenSunsZenith.java +++ b/Mage.Sets/src/mage/sets/mirrodinbesieged/GreenSunsZenith.java @@ -50,65 +50,65 @@ import mage.filter.Filter.ComparisonType; */ public class GreenSunsZenith extends CardImpl { - public GreenSunsZenith(UUID ownerId) { - super(ownerId, 81, "Green Sun's Zenith", Rarity.RARE, new CardType[]{CardType.SORCERY}, "{X}{G}"); - this.expansionSetCode = "MBS"; - this.color.setGreen(true); - this.getSpellAbility().addEffect(new GreenSunsZenithSearchEffect()); - this.getSpellAbility().addEffect(ShuffleSpellEffect.getInstance()); - } + public GreenSunsZenith(UUID ownerId) { + super(ownerId, 81, "Green Sun's Zenith", Rarity.RARE, new CardType[]{CardType.SORCERY}, "{X}{G}"); + this.expansionSetCode = "MBS"; + this.color.setGreen(true); + this.getSpellAbility().addEffect(new GreenSunsZenithSearchEffect()); + this.getSpellAbility().addEffect(ShuffleSpellEffect.getInstance()); + } - public GreenSunsZenith(final GreenSunsZenith card) { - super(card); - } + public GreenSunsZenith(final GreenSunsZenith card) { + super(card); + } - @Override - public GreenSunsZenith copy() { - return new GreenSunsZenith(this); - } + @Override + public GreenSunsZenith copy() { + return new GreenSunsZenith(this); + } } class GreenSunsZenithSearchEffect extends OneShotEffect { - GreenSunsZenithSearchEffect() { - super(Constants.Outcome.PutCreatureInPlay); - staticText = "Search your library for a green creature card with converted mana cost X or less, put it onto the battlefield, then shuffle your library"; - } + GreenSunsZenithSearchEffect() { + super(Constants.Outcome.PutCreatureInPlay); + staticText = "Search your library for a green creature card with converted mana cost X or less, put it onto the battlefield, then shuffle your library"; + } - GreenSunsZenithSearchEffect(final GreenSunsZenithSearchEffect effect) { - super(effect); - } + GreenSunsZenithSearchEffect(final GreenSunsZenithSearchEffect effect) { + super(effect); + } - @Override - public boolean apply(Game game, Ability source) { - Player player = game.getPlayer(source.getControllerId()); + @Override + public boolean apply(Game game, Ability source) { + Player player = game.getPlayer(source.getControllerId()); if (player == null) return false; - FilterCard filter = new FilterCard("green creature card with converted mana cost X or less"); - filter.getColor().setGreen(true); - filter.setUseColor(true); - filter.getCardType().add(CardType.CREATURE); + FilterCard filter = new FilterCard("green creature card with converted mana cost X or less"); + filter.getColor().setGreen(true); + filter.setUseColor(true); + filter.getCardType().add(CardType.CREATURE); filter.setScopeCardType(Filter.ComparisonScope.Any); - //Set the mana cost one higher to 'emulate' a less than or equal to comparison. - filter.setConvertedManaCost(source.getManaCostsToPay().getX() + 1); - filter.setConvertedManaCostComparison(ComparisonType.LessThan); - TargetCardInLibrary target = new TargetCardInLibrary(filter); - if (player.searchLibrary(target, game)) { - if (target.getTargets().size() > 0) { + //Set the mana cost one higher to 'emulate' a less than or equal to comparison. + filter.setConvertedManaCost(source.getManaCostsToPay().getX() + 1); + filter.setConvertedManaCostComparison(ComparisonType.LessThan); + TargetCardInLibrary target = new TargetCardInLibrary(filter); + if (player.searchLibrary(target, game)) { + if (target.getTargets().size() > 0) { Card card = player.getLibrary().getCard(target.getFirstTarget(), game); if (card != null) card.putOntoBattlefield(game, Constants.Zone.HAND, source.getId(), source.getControllerId()); - } + } player.shuffleLibrary(game); return true; - } + } player.shuffleLibrary(game); - return false; - } + return false; + } - @Override - public GreenSunsZenithSearchEffect copy() { - return new GreenSunsZenithSearchEffect(this); - } + @Override + public GreenSunsZenithSearchEffect copy() { + return new GreenSunsZenithSearchEffect(this); + } } \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/mirrodinbesieged/HellkiteIgniter.java b/Mage.Sets/src/mage/sets/mirrodinbesieged/HellkiteIgniter.java index 4318d45bdc..d3a1084778 100644 --- a/Mage.Sets/src/mage/sets/mirrodinbesieged/HellkiteIgniter.java +++ b/Mage.Sets/src/mage/sets/mirrodinbesieged/HellkiteIgniter.java @@ -54,7 +54,7 @@ public class HellkiteIgniter extends CardImpl { super(ownerId, 65, "Hellkite Igniter", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{5}{R}{R}"); this.expansionSetCode = "MBS"; this.subtype.add("Dragon"); - this.color.setRed(true); + this.color.setRed(true); this.power = new MageInt(5); this.toughness = new MageInt(5); this.addAbility(FlyingAbility.getInstance()); diff --git a/Mage.Sets/src/mage/sets/mirrodinbesieged/HeroOfOxidRidge.java b/Mage.Sets/src/mage/sets/mirrodinbesieged/HeroOfOxidRidge.java index 8e46b5acb3..14ab0cd513 100644 --- a/Mage.Sets/src/mage/sets/mirrodinbesieged/HeroOfOxidRidge.java +++ b/Mage.Sets/src/mage/sets/mirrodinbesieged/HeroOfOxidRidge.java @@ -48,28 +48,28 @@ import mage.game.permanent.Permanent; */ public class HeroOfOxidRidge extends CardImpl { - public HeroOfOxidRidge(UUID ownerId) { - super(ownerId, 66, "Hero of Oxid Ridge", Rarity.MYTHIC, new CardType[]{CardType.CREATURE}, "{2}{R}{R}"); - this.expansionSetCode = "MBS"; - this.subtype.add("Human"); - this.subtype.add("Knight"); - this.color.setRed(true); - this.power = new MageInt(4); - this.toughness = new MageInt(2); + public HeroOfOxidRidge(UUID ownerId) { + super(ownerId, 66, "Hero of Oxid Ridge", Rarity.MYTHIC, new CardType[]{CardType.CREATURE}, "{2}{R}{R}"); + this.expansionSetCode = "MBS"; + this.subtype.add("Human"); + this.subtype.add("Knight"); + this.color.setRed(true); + this.power = new MageInt(4); + this.toughness = new MageInt(2); - this.addAbility(HasteAbility.getInstance()); - this.addAbility(new BattleCryAbility()); + this.addAbility(HasteAbility.getInstance()); + this.addAbility(new BattleCryAbility()); this.addAbility(new AttacksTriggeredAbility(new HeroOfOxidRidgeEffect(), false)); - } + } - public HeroOfOxidRidge(final HeroOfOxidRidge card) { - super(card); - } + public HeroOfOxidRidge(final HeroOfOxidRidge card) { + super(card); + } - @Override - public HeroOfOxidRidge copy() { - return new HeroOfOxidRidge(this); - } + @Override + public HeroOfOxidRidge copy() { + return new HeroOfOxidRidge(this); + } } @@ -79,11 +79,11 @@ class HeroOfOxidRidgeEffect extends RestrictionEffect { super(Duration.EndOfTurn); staticText = "creatures with power 1 or less can't block this turn"; } - + public HeroOfOxidRidgeEffect(final HeroOfOxidRidgeEffect effect) { super(effect); } - + @Override public HeroOfOxidRidgeEffect copy() { return new HeroOfOxidRidgeEffect(this); @@ -97,8 +97,8 @@ class HeroOfOxidRidgeEffect extends RestrictionEffect { } @Override - public boolean canBlock(Permanent attacker, Permanent blocker, Ability source, Game game) { - return false; - } + public boolean canBlock(Permanent attacker, Permanent blocker, Ability source, Game game) { + return false; + } } diff --git a/Mage.Sets/src/mage/sets/mirrodinbesieged/HorrifyingRevelation.java b/Mage.Sets/src/mage/sets/mirrodinbesieged/HorrifyingRevelation.java index a6b5304738..5b9b1aef6d 100644 --- a/Mage.Sets/src/mage/sets/mirrodinbesieged/HorrifyingRevelation.java +++ b/Mage.Sets/src/mage/sets/mirrodinbesieged/HorrifyingRevelation.java @@ -45,7 +45,7 @@ public class HorrifyingRevelation extends CardImpl { super(ownerId, 45, "Horrifying Revelation", Rarity.COMMON, new CardType[]{CardType.SORCERY}, "{B}"); this.expansionSetCode = "MBS"; this.color.setBlack(true); - + this.getSpellAbility().addTarget(new TargetPlayer()); this.getSpellAbility().addEffect(new DiscardTargetEffect(1)); this.getSpellAbility().addEffect(new PutLibraryIntoGraveTargetEffect(1)); diff --git a/Mage.Sets/src/mage/sets/mirrodinbesieged/IchorWellspring.java b/Mage.Sets/src/mage/sets/mirrodinbesieged/IchorWellspring.java index 45188cbf26..9a1b854cf3 100644 --- a/Mage.Sets/src/mage/sets/mirrodinbesieged/IchorWellspring.java +++ b/Mage.Sets/src/mage/sets/mirrodinbesieged/IchorWellspring.java @@ -42,20 +42,20 @@ import java.util.UUID; */ public class IchorWellspring extends CardImpl { - public IchorWellspring(UUID ownerId) { - super(ownerId, 110, "Ichor Wellspring", Rarity.COMMON, new CardType[]{CardType.ARTIFACT}, "{2}"); - this.expansionSetCode = "MBS"; - this.addAbility(new EntersBattlefieldTriggeredAbility(new DrawCardControllerEffect(1))); - this.addAbility(new DiesTriggeredAbility(new DrawCardControllerEffect(1))); - } + public IchorWellspring(UUID ownerId) { + super(ownerId, 110, "Ichor Wellspring", Rarity.COMMON, new CardType[]{CardType.ARTIFACT}, "{2}"); + this.expansionSetCode = "MBS"; + this.addAbility(new EntersBattlefieldTriggeredAbility(new DrawCardControllerEffect(1))); + this.addAbility(new DiesTriggeredAbility(new DrawCardControllerEffect(1))); + } - public IchorWellspring(final IchorWellspring card) { - super(card); - } + public IchorWellspring(final IchorWellspring card) { + super(card); + } - @Override - public IchorWellspring copy() { - return new IchorWellspring(this); - } + @Override + public IchorWellspring copy() { + return new IchorWellspring(this); + } } diff --git a/Mage.Sets/src/mage/sets/mirrodinbesieged/InkmothNexus.java b/Mage.Sets/src/mage/sets/mirrodinbesieged/InkmothNexus.java index 9ece2fb7da..e66053d427 100644 --- a/Mage.Sets/src/mage/sets/mirrodinbesieged/InkmothNexus.java +++ b/Mage.Sets/src/mage/sets/mirrodinbesieged/InkmothNexus.java @@ -73,7 +73,7 @@ class InkmothNexusToken extends Token { cardType.add(CardType.CREATURE); this.subtype.add("Blinkmoth"); power = new MageInt(1); - toughness = new MageInt(1); + toughness = new MageInt(1); this.addAbility(FlyingAbility.getInstance()); this.addAbility(InfectAbility.getInstance()); } diff --git a/Mage.Sets/src/mage/sets/mirrodinbesieged/Island1.java b/Mage.Sets/src/mage/sets/mirrodinbesieged/Island1.java index 505a78775c..ebc401bc9e 100644 --- a/Mage.Sets/src/mage/sets/mirrodinbesieged/Island1.java +++ b/Mage.Sets/src/mage/sets/mirrodinbesieged/Island1.java @@ -36,18 +36,18 @@ import java.util.UUID; */ public class Island1 extends mage.cards.basiclands.Island { - public Island1(UUID ownerId) { - super(ownerId, 148); - this.expansionSetCode = "MBS"; - } + public Island1(UUID ownerId) { + super(ownerId, 148); + this.expansionSetCode = "MBS"; + } - public Island1(final Island1 card) { - super(card); - } + public Island1(final Island1 card) { + super(card); + } - @Override - public Island1 copy() { - return new Island1(this); - } + @Override + public Island1 copy() { + return new Island1(this); + } } diff --git a/Mage.Sets/src/mage/sets/mirrodinbesieged/Island2.java b/Mage.Sets/src/mage/sets/mirrodinbesieged/Island2.java index 2026725ba8..eba34b6eb6 100644 --- a/Mage.Sets/src/mage/sets/mirrodinbesieged/Island2.java +++ b/Mage.Sets/src/mage/sets/mirrodinbesieged/Island2.java @@ -36,18 +36,18 @@ import java.util.UUID; */ public class Island2 extends mage.cards.basiclands.Island { - public Island2(UUID ownerId) { - super(ownerId, 149); - this.expansionSetCode = "MBS"; - } + public Island2(UUID ownerId) { + super(ownerId, 149); + this.expansionSetCode = "MBS"; + } - public Island2(final Island2 card) { - super(card); - } + public Island2(final Island2 card) { + super(card); + } - @Override - public Island2 copy() { - return new Island2(this); - } + @Override + public Island2 copy() { + return new Island2(this); + } } diff --git a/Mage.Sets/src/mage/sets/mirrodinbesieged/KnowledgePool.java b/Mage.Sets/src/mage/sets/mirrodinbesieged/KnowledgePool.java index e93e19c759..c8b143c1d5 100644 --- a/Mage.Sets/src/mage/sets/mirrodinbesieged/KnowledgePool.java +++ b/Mage.Sets/src/mage/sets/mirrodinbesieged/KnowledgePool.java @@ -54,23 +54,23 @@ import mage.target.targetpointer.FixedTarget; */ public class KnowledgePool extends CardImpl { - public KnowledgePool(UUID ownerId) { - super(ownerId, 111, "Knowledge Pool", Rarity.RARE, new CardType[]{CardType.ARTIFACT}, "{6}"); - this.expansionSetCode = "MBS"; - // Imprint - When Knowledge Pool enters the battlefield, each player exiles the top three cards of his or her library - this.addAbility(new EntersBattlefieldTriggeredAbility(new KnowledgePoolEffect1(), false)); + public KnowledgePool(UUID ownerId) { + super(ownerId, 111, "Knowledge Pool", Rarity.RARE, new CardType[]{CardType.ARTIFACT}, "{6}"); + this.expansionSetCode = "MBS"; + // Imprint - When Knowledge Pool enters the battlefield, each player exiles the top three cards of his or her library + this.addAbility(new EntersBattlefieldTriggeredAbility(new KnowledgePoolEffect1(), false)); // Whenever a player casts a spell from his or her hand, that player exiles it. If the player does, he or she may cast another nonland card exiled with Knowledge Pool without paying that card's mana cost. - this.addAbility(new KnowledgePoolAbility()); - } + this.addAbility(new KnowledgePoolAbility()); + } - public KnowledgePool(final KnowledgePool card) { - super(card); - } + public KnowledgePool(final KnowledgePool card) { + super(card); + } - @Override - public KnowledgePool copy() { - return new KnowledgePool(this); - } + @Override + public KnowledgePool copy() { + return new KnowledgePool(this); + } } @@ -80,17 +80,17 @@ class KnowledgePoolEffect1 extends OneShotEffect { super(Outcome.Neutral); staticText = "each player exiles the top three cards of his or her library"; } - + public KnowledgePoolEffect1(final KnowledgePoolEffect1 effect) { super(effect); } - + @Override public boolean apply(Game game, Ability source) { - Player sourcePlayer = game.getPlayer(source.getControllerId()); - for (UUID playerId: sourcePlayer.getInRange()) { - Player player = game.getPlayer(playerId); - if (player != null) { + Player sourcePlayer = game.getPlayer(source.getControllerId()); + for (UUID playerId: sourcePlayer.getInRange()) { + Player player = game.getPlayer(playerId); + if (player != null) { int amount = Math.min(3, player.getLibrary().size()); for (int i = 0; i < amount; i++) { player.getLibrary().removeFromTop(game).moveToExile(source.getSourceId(), "Knowledge Pool Exile", source.getId(), game); @@ -104,53 +104,53 @@ class KnowledgePoolEffect1 extends OneShotEffect { public KnowledgePoolEffect1 copy() { return new KnowledgePoolEffect1(this); } - + } class KnowledgePoolAbility extends TriggeredAbilityImpl { - public KnowledgePoolAbility() { - super(Zone.BATTLEFIELD, new KnowledgePoolEffect2(), false); - } + public KnowledgePoolAbility() { + super(Zone.BATTLEFIELD, new KnowledgePoolEffect2(), false); + } - public KnowledgePoolAbility(final KnowledgePoolAbility ability) { - super(ability); - } + public KnowledgePoolAbility(final KnowledgePoolAbility ability) { + super(ability); + } - @Override - public KnowledgePoolAbility copy() { - return new KnowledgePoolAbility(this); - } + @Override + public KnowledgePoolAbility copy() { + return new KnowledgePoolAbility(this); + } - @Override - public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == EventType.SPELL_CAST && event.getZone() == Zone.HAND) { - Spell spell = game.getStack().getSpell(event.getTargetId()); + @Override + public boolean checkTrigger(GameEvent event, Game game) { + if (event.getType() == EventType.SPELL_CAST && event.getZone() == Zone.HAND) { + Spell spell = game.getStack().getSpell(event.getTargetId()); if (spell != null) { for (Effect effect : this.getEffects()) { effect.setTargetPointer(new FixedTarget(event.getTargetId())); } return true; } - } - return false; - } + } + return false; + } } class KnowledgePoolEffect2 extends OneShotEffect { private static FilterNonlandCard filter = new FilterNonlandCard("nonland card exiled with Knowledge Pool"); - + public KnowledgePoolEffect2() { super(Outcome.Neutral); staticText = "Whenever a player casts a spell from his or her hand, that player exiles it. If the player does, he or she may cast another nonland card exiled with {this} without paying that card's mana cost"; } - + public KnowledgePoolEffect2(final KnowledgePoolEffect2 effect) { super(effect); } - + @Override public boolean apply(Game game, Ability source) { Spell spell = game.getStack().getSpell(targetPointer.getFirst(game, source)); @@ -178,5 +178,5 @@ class KnowledgePoolEffect2 extends OneShotEffect { public KnowledgePoolEffect2 copy() { return new KnowledgePoolEffect2(this); } - + } \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/mirrodinbesieged/KothsCourier.java b/Mage.Sets/src/mage/sets/mirrodinbesieged/KothsCourier.java index 37716a09fa..440eb53500 100644 --- a/Mage.Sets/src/mage/sets/mirrodinbesieged/KothsCourier.java +++ b/Mage.Sets/src/mage/sets/mirrodinbesieged/KothsCourier.java @@ -46,7 +46,7 @@ public class KothsCourier extends CardImpl { this.expansionSetCode = "MBS"; this.subtype.add("Human"); this.subtype.add("Rogue"); - this.color.setRed(true); + this.color.setRed(true); this.power = new MageInt(2); this.toughness = new MageInt(3); this.addAbility(new ForestwalkAbility()); diff --git a/Mage.Sets/src/mage/sets/mirrodinbesieged/KuldothaRingleader.java b/Mage.Sets/src/mage/sets/mirrodinbesieged/KuldothaRingleader.java index d00e54788b..0dc847707b 100644 --- a/Mage.Sets/src/mage/sets/mirrodinbesieged/KuldothaRingleader.java +++ b/Mage.Sets/src/mage/sets/mirrodinbesieged/KuldothaRingleader.java @@ -47,11 +47,11 @@ public class KuldothaRingleader extends CardImpl { this.expansionSetCode = "MBS"; this.subtype.add("Giant"); this.subtype.add("Berserker"); - this.color.setRed(true); + this.color.setRed(true); this.power = new MageInt(4); this.toughness = new MageInt(4); - this.addAbility(new BattleCryAbility()); - this.addAbility(new AttacksEachTurnStaticAbility()); + this.addAbility(new BattleCryAbility()); + this.addAbility(new AttacksEachTurnStaticAbility()); } public KuldothaRingleader (final KuldothaRingleader card) { diff --git a/Mage.Sets/src/mage/sets/mirrodinbesieged/LeoninRelicWarder.java b/Mage.Sets/src/mage/sets/mirrodinbesieged/LeoninRelicWarder.java index e3224f925b..d88b27f459 100644 --- a/Mage.Sets/src/mage/sets/mirrodinbesieged/LeoninRelicWarder.java +++ b/Mage.Sets/src/mage/sets/mirrodinbesieged/LeoninRelicWarder.java @@ -63,7 +63,7 @@ public class LeoninRelicWarder extends CardImpl { this.expansionSetCode = "MBS"; this.subtype.add("Cat"); this.subtype.add("Cleric"); - this.color.setWhite(true); + this.color.setWhite(true); this.power = new MageInt(2); this.toughness = new MageInt(2); diff --git a/Mage.Sets/src/mage/sets/mirrodinbesieged/LoxodonPartisan.java b/Mage.Sets/src/mage/sets/mirrodinbesieged/LoxodonPartisan.java index 91a4865bf0..5da9ab583e 100644 --- a/Mage.Sets/src/mage/sets/mirrodinbesieged/LoxodonPartisan.java +++ b/Mage.Sets/src/mage/sets/mirrodinbesieged/LoxodonPartisan.java @@ -46,7 +46,7 @@ public class LoxodonPartisan extends CardImpl { this.expansionSetCode = "MBS"; this.subtype.add("Elephant"); this.subtype.add("Soldier"); - this.color.setWhite(true); + this.color.setWhite(true); this.power = new MageInt(3); this.toughness = new MageInt(4); this.addAbility(new BattleCryAbility()); diff --git a/Mage.Sets/src/mage/sets/mirrodinbesieged/MassacreWurm.java b/Mage.Sets/src/mage/sets/mirrodinbesieged/MassacreWurm.java index 8b0f7377a6..e9e94fa0fb 100644 --- a/Mage.Sets/src/mage/sets/mirrodinbesieged/MassacreWurm.java +++ b/Mage.Sets/src/mage/sets/mirrodinbesieged/MassacreWurm.java @@ -56,7 +56,7 @@ public class MassacreWurm extends CardImpl { super(ownerId, 46, "Massacre Wurm", Rarity.MYTHIC, new CardType[]{CardType.CREATURE}, "{3}{B}{B}{B}"); this.expansionSetCode = "MBS"; this.subtype.add("Wurm"); - this.color.setBlack(true); + this.color.setBlack(true); this.power = new MageInt(6); this.toughness = new MageInt(5); this.addAbility(new EntersBattlefieldTriggeredAbility(new BoostOpponentsEffect(-2, -2, Constants.Duration.EndOfTurn))); diff --git a/Mage.Sets/src/mage/sets/mirrodinbesieged/MastersCall.java b/Mage.Sets/src/mage/sets/mirrodinbesieged/MastersCall.java index 58ad19bbda..37124686a4 100644 --- a/Mage.Sets/src/mage/sets/mirrodinbesieged/MastersCall.java +++ b/Mage.Sets/src/mage/sets/mirrodinbesieged/MastersCall.java @@ -44,7 +44,7 @@ public class MastersCall extends CardImpl { public MastersCall (UUID ownerId) { super(ownerId, 13, "Master's Call", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{2}{W}"); this.expansionSetCode = "MBS"; - this.color.setWhite(true); + this.color.setWhite(true); this.getSpellAbility().addEffect(new CreateTokenEffect(new MyrToken(), 2)); } diff --git a/Mage.Sets/src/mage/sets/mirrodinbesieged/MelirasKeepers.java b/Mage.Sets/src/mage/sets/mirrodinbesieged/MelirasKeepers.java index fffa53caa3..de90f73007 100644 --- a/Mage.Sets/src/mage/sets/mirrodinbesieged/MelirasKeepers.java +++ b/Mage.Sets/src/mage/sets/mirrodinbesieged/MelirasKeepers.java @@ -48,26 +48,26 @@ import mage.game.events.GameEvent.EventType; */ public class MelirasKeepers extends CardImpl { - public MelirasKeepers(UUID ownerId) { - super(ownerId, 83, "Melira's Keepers", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{4}{G}"); - this.expansionSetCode = "MBS"; - this.subtype.add("Human"); - this.subtype.add("Warrior"); - this.color.setGreen(true); - this.power = new MageInt(4); - this.toughness = new MageInt(4); + public MelirasKeepers(UUID ownerId) { + super(ownerId, 83, "Melira's Keepers", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{4}{G}"); + this.expansionSetCode = "MBS"; + this.subtype.add("Human"); + this.subtype.add("Warrior"); + this.color.setGreen(true); + this.power = new MageInt(4); + this.toughness = new MageInt(4); this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new MelirasKeepersEffect())); - } + } - public MelirasKeepers(final MelirasKeepers card) { - super(card); - } + public MelirasKeepers(final MelirasKeepers card) { + super(card); + } - @Override - public MelirasKeepers copy() { - return new MelirasKeepers(this); - } + @Override + public MelirasKeepers copy() { + return new MelirasKeepers(this); + } } @@ -77,11 +77,11 @@ class MelirasKeepersEffect extends ReplacementEffectImpl { super(Duration.WhileOnBattlefield, Outcome.PreventDamage); staticText = "{this} can't have counters placed on it"; } - + public MelirasKeepersEffect(final MelirasKeepersEffect effect) { super(effect); } - + @Override public boolean apply(Game game, Ability source) { return true; @@ -104,5 +104,5 @@ class MelirasKeepersEffect extends ReplacementEffectImpl { } return false; } - + } diff --git a/Mage.Sets/src/mage/sets/mirrodinbesieged/MirranCrusader.java b/Mage.Sets/src/mage/sets/mirrodinbesieged/MirranCrusader.java index 1d14efcb37..df952e83a3 100644 --- a/Mage.Sets/src/mage/sets/mirrodinbesieged/MirranCrusader.java +++ b/Mage.Sets/src/mage/sets/mirrodinbesieged/MirranCrusader.java @@ -43,30 +43,30 @@ import mage.filter.FilterCard; * @author ayratn */ public class MirranCrusader extends CardImpl { - private static FilterCard filter = new FilterCard("Black"); - private static FilterCard filter2 = new FilterCard("Green"); + private static FilterCard filter = new FilterCard("Black"); + private static FilterCard filter2 = new FilterCard("Green"); - static { - filter.setUseColor(true); - filter.getColor().setBlack(true); - filter.setScopeColor(ComparisonScope.Any); + static { + filter.setUseColor(true); + filter.getColor().setBlack(true); + filter.setScopeColor(ComparisonScope.Any); - filter2.setUseColor(true); - filter2.getColor().setGreen(true); - filter2.setScopeColor(ComparisonScope.Any); - } + filter2.setUseColor(true); + filter2.getColor().setGreen(true); + filter2.setScopeColor(ComparisonScope.Any); + } public MirranCrusader (UUID ownerId) { super(ownerId, 14, "Mirran Crusader", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{1}{W}{W}"); this.expansionSetCode = "MBS"; this.subtype.add("Human"); this.subtype.add("Knight"); - this.color.setWhite(true); - this.power = new MageInt(2); + this.color.setWhite(true); + this.power = new MageInt(2); this.toughness = new MageInt(2); - this.addAbility(DoubleStrikeAbility.getInstance()); - this.addAbility(new ProtectionAbility(filter)); - this.addAbility(new ProtectionAbility(filter2)); + this.addAbility(DoubleStrikeAbility.getInstance()); + this.addAbility(new ProtectionAbility(filter)); + this.addAbility(new ProtectionAbility(filter2)); } public MirranCrusader (final MirranCrusader card) { diff --git a/Mage.Sets/src/mage/sets/mirrodinbesieged/MirranMettle.java b/Mage.Sets/src/mage/sets/mirrodinbesieged/MirranMettle.java index e26441eb8d..7cb6f7314b 100644 --- a/Mage.Sets/src/mage/sets/mirrodinbesieged/MirranMettle.java +++ b/Mage.Sets/src/mage/sets/mirrodinbesieged/MirranMettle.java @@ -49,10 +49,10 @@ public class MirranMettle extends CardImpl { super(ownerId, 84, "Mirran Mettle", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{G}"); this.expansionSetCode = "MBS"; this.color.setGreen(true); - + this.getSpellAbility().addTarget(new TargetCreaturePermanent()); this.getSpellAbility().addEffect(new BoostTargetEffect(2, 2, Duration.EndOfTurn)); - + this.getSpellAbility().addEffect(new ConditionalContinousEffect(new BoostTargetEffect(2, 2, Duration.EndOfTurn), MetalcraftCondition.getInstance(), effectText)); } diff --git a/Mage.Sets/src/mage/sets/mirrodinbesieged/Mirrorworks.java b/Mage.Sets/src/mage/sets/mirrodinbesieged/Mirrorworks.java index 385cc66fd8..2112c65770 100644 --- a/Mage.Sets/src/mage/sets/mirrodinbesieged/Mirrorworks.java +++ b/Mage.Sets/src/mage/sets/mirrodinbesieged/Mirrorworks.java @@ -54,20 +54,20 @@ import mage.util.CardUtil; */ public class Mirrorworks extends CardImpl { - public Mirrorworks(UUID ownerId) { - super(ownerId, 114, "Mirrorworks", Rarity.RARE, new CardType[]{CardType.ARTIFACT}, "{5}"); - this.expansionSetCode = "MBS"; - this.addAbility(new MirrorworksAbility()); - } + public Mirrorworks(UUID ownerId) { + super(ownerId, 114, "Mirrorworks", Rarity.RARE, new CardType[]{CardType.ARTIFACT}, "{5}"); + this.expansionSetCode = "MBS"; + this.addAbility(new MirrorworksAbility()); + } - public Mirrorworks(final Mirrorworks card) { - super(card); - } + public Mirrorworks(final Mirrorworks card) { + super(card); + } - @Override - public Mirrorworks copy() { - return new Mirrorworks(this); - } + @Override + public Mirrorworks copy() { + return new Mirrorworks(this); + } } @@ -89,64 +89,64 @@ class MirrorworksAbility extends TriggeredAbilityImpl { @Override public boolean checkTrigger(GameEvent event, Game game) { if (event.getType() == GameEvent.EventType.ZONE_CHANGE && !event.getTargetId().equals(this.getSourceId())) { - ZoneChangeEvent zEvent = (ZoneChangeEvent)event; - if (zEvent.getToZone() == Constants.Zone.BATTLEFIELD) { - Permanent permanent = game.getPermanent(event.getTargetId()); - if (permanent != null && !(permanent instanceof PermanentToken) && permanent.getCardType().contains(CardType.ARTIFACT)) { - getEffects().get(0).setTargetPointer(new FixedTarget(permanent.getId())); - return true; - } - } - } - return false; + ZoneChangeEvent zEvent = (ZoneChangeEvent)event; + if (zEvent.getToZone() == Constants.Zone.BATTLEFIELD) { + Permanent permanent = game.getPermanent(event.getTargetId()); + if (permanent != null && !(permanent instanceof PermanentToken) && permanent.getCardType().contains(CardType.ARTIFACT)) { + getEffects().get(0).setTargetPointer(new FixedTarget(permanent.getId())); + return true; + } + } + } + return false; } @Override public String getRule() { return "Whenever another nontoken artifact enters the battlefield under your control, you may pay {2}. If you do, put a token that's a copy of that artifact onto the battlefield"; } - + } class MirrorworksEffect extends OneShotEffect { - public MirrorworksEffect() { - super(Constants.Outcome.PutCreatureInPlay); - this.staticText = "put a token that's a copy of that artifact onto the battlefield"; - } + public MirrorworksEffect() { + super(Constants.Outcome.PutCreatureInPlay); + this.staticText = "put a token that's a copy of that artifact onto the battlefield"; + } - public MirrorworksEffect(final MirrorworksEffect effect) { - super(effect); - } + public MirrorworksEffect(final MirrorworksEffect effect) { + super(effect); + } - @Override - public MirrorworksEffect copy() { - return new MirrorworksEffect(this); - } + @Override + public MirrorworksEffect copy() { + return new MirrorworksEffect(this); + } - @Override - public boolean apply(Game game, Ability source) { + @Override + public boolean apply(Game game, Ability source) { Player player = game.getPlayer(source.getControllerId()); - if (player != null) { - Cost cost = new ManaCostsImpl("{2}"); - if (player.chooseUse(outcome, "Pay " + cost.getText() + " and " + staticText, game)) { - cost.clearPaid(); - if (cost.pay(source, game, source.getId(), source.getControllerId(), false)) { - UUID targetId = targetPointer.getFirst(game, source); - if (targetId != null) { - MageObject target = game.getLastKnownInformation(targetId, Constants.Zone.BATTLEFIELD); - if (target != null && target instanceof Permanent) { - EmptyToken token = new EmptyToken(); - CardUtil.copyTo(token).from((Permanent)target); - token.putOntoBattlefield(1, game, source.getSourceId(), source.getControllerId()); - return true; - } - } - } - } - } - return false; - } + if (player != null) { + Cost cost = new ManaCostsImpl("{2}"); + if (player.chooseUse(outcome, "Pay " + cost.getText() + " and " + staticText, game)) { + cost.clearPaid(); + if (cost.pay(source, game, source.getId(), source.getControllerId(), false)) { + UUID targetId = targetPointer.getFirst(game, source); + if (targetId != null) { + MageObject target = game.getLastKnownInformation(targetId, Constants.Zone.BATTLEFIELD); + if (target != null && target instanceof Permanent) { + EmptyToken token = new EmptyToken(); + CardUtil.copyTo(token).from((Permanent)target); + token.putOntoBattlefield(1, game, source.getSourceId(), source.getControllerId()); + return true; + } + } + } + } + } + return false; + } } diff --git a/Mage.Sets/src/mage/sets/mirrodinbesieged/Mountain1.java b/Mage.Sets/src/mage/sets/mirrodinbesieged/Mountain1.java index 04fd32894a..73c72691a4 100644 --- a/Mage.Sets/src/mage/sets/mirrodinbesieged/Mountain1.java +++ b/Mage.Sets/src/mage/sets/mirrodinbesieged/Mountain1.java @@ -36,19 +36,19 @@ import java.util.UUID; */ public class Mountain1 extends mage.cards.basiclands.Mountain { - public Mountain1(UUID ownerId) { - super(ownerId, 152); - this.expansionSetCode = "MBS"; - } + public Mountain1(UUID ownerId) { + super(ownerId, 152); + this.expansionSetCode = "MBS"; + } - public Mountain1(final Mountain1 card) { - super(card); - } + public Mountain1(final Mountain1 card) { + super(card); + } - @Override - public Mountain1 copy() { - return new Mountain1(this); - } + @Override + public Mountain1 copy() { + return new Mountain1(this); + } } diff --git a/Mage.Sets/src/mage/sets/mirrodinbesieged/Mountain2.java b/Mage.Sets/src/mage/sets/mirrodinbesieged/Mountain2.java index efc7126b07..dfe982657a 100644 --- a/Mage.Sets/src/mage/sets/mirrodinbesieged/Mountain2.java +++ b/Mage.Sets/src/mage/sets/mirrodinbesieged/Mountain2.java @@ -36,18 +36,18 @@ import java.util.UUID; */ public class Mountain2 extends mage.cards.basiclands.Mountain { - public Mountain2(UUID ownerId) { - super(ownerId, 153); - this.expansionSetCode = "MBS"; - } + public Mountain2(UUID ownerId) { + super(ownerId, 153); + this.expansionSetCode = "MBS"; + } - public Mountain2(final Mountain2 card) { - super(card); - } + public Mountain2(final Mountain2 card) { + super(card); + } - @Override - public Mountain2 copy() { - return new Mountain2(this); - } + @Override + public Mountain2 copy() { + return new Mountain2(this); + } } diff --git a/Mage.Sets/src/mage/sets/mirrodinbesieged/MyrWelder.java b/Mage.Sets/src/mage/sets/mirrodinbesieged/MyrWelder.java index bc05d4a216..94e703fee9 100644 --- a/Mage.Sets/src/mage/sets/mirrodinbesieged/MyrWelder.java +++ b/Mage.Sets/src/mage/sets/mirrodinbesieged/MyrWelder.java @@ -58,79 +58,79 @@ import mage.target.common.TargetCardInGraveyard; */ public class MyrWelder extends CardImpl { - public MyrWelder(UUID ownerId) { - super(ownerId, 118, "Myr Welder", Rarity.RARE, new CardType[]{CardType.ARTIFACT, CardType.CREATURE}, "{3}"); - this.expansionSetCode = "MBS"; - this.subtype.add("Myr"); - this.power = new MageInt(1); - this.toughness = new MageInt(4); + public MyrWelder(UUID ownerId) { + super(ownerId, 118, "Myr Welder", Rarity.RARE, new CardType[]{CardType.ARTIFACT, CardType.CREATURE}, "{3}"); + this.expansionSetCode = "MBS"; + this.subtype.add("Myr"); + this.power = new MageInt(1); + this.toughness = new MageInt(4); // Imprint - {tap}: Exile target artifact card from a graveyard SimpleActivatedAbility ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new MyrWelderEffect(), new TapSourceCost()); ability.addTarget(new TargetCardInGraveyard(new FilterArtifactCard("artifact card from a graveyard"))); this.addAbility(ability); - + // Myr Welder has all activated abilities of all cards exiled with it - this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new MyrWelderContinuousEffect())); - - } + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new MyrWelderContinuousEffect())); - public MyrWelder(final MyrWelder card) { - super(card); - } + } - @Override - public MyrWelder copy() { - return new MyrWelder(this); - } + public MyrWelder(final MyrWelder card) { + super(card); + } + + @Override + public MyrWelder copy() { + return new MyrWelder(this); + } } class MyrWelderEffect extends OneShotEffect { - public MyrWelderEffect() { - super(Constants.Outcome.Exile); - staticText = "Exile target artifact card from a graveyard"; - } + public MyrWelderEffect() { + super(Constants.Outcome.Exile); + staticText = "Exile target artifact card from a graveyard"; + } - public MyrWelderEffect(MyrWelderEffect effect) { - super(effect); - } + public MyrWelderEffect(MyrWelderEffect effect) { + super(effect); + } - @Override - public boolean apply(Game game, Ability source) { - Card card = game.getCard(source.getFirstTarget()); - Permanent permanent = game.getPermanent(source.getSourceId()); + @Override + public boolean apply(Game game, Ability source) { + Card card = game.getCard(source.getFirstTarget()); + Permanent permanent = game.getPermanent(source.getSourceId()); if (card != null && permanent != null) { card.moveToExile(getId(), "Myr Welder (Imprint)", source.getSourceId(), game); permanent.imprint(card.getId(), game); return true; } - return false; - } + return false; + } - @Override - public MyrWelderEffect copy() { - return new MyrWelderEffect(this); - } + @Override + public MyrWelderEffect copy() { + return new MyrWelderEffect(this); + } } class MyrWelderContinuousEffect extends ContinuousEffectImpl { - public MyrWelderContinuousEffect() { - super(Duration.WhileOnBattlefield, Layer.AbilityAddingRemovingEffects_6, SubLayer.NA, Outcome.AddAbility); - staticText = "{this} has all activated abilities of all cards exiled with it"; - } - - public MyrWelderContinuousEffect(final MyrWelderContinuousEffect effect) { - super(effect); - } - - @Override - public boolean apply(Game game, Ability source) { - Permanent perm = game.getPermanent(source.getSourceId()); - if (perm != null) { + public MyrWelderContinuousEffect() { + super(Duration.WhileOnBattlefield, Layer.AbilityAddingRemovingEffects_6, SubLayer.NA, Outcome.AddAbility); + staticText = "{this} has all activated abilities of all cards exiled with it"; + } + + public MyrWelderContinuousEffect(final MyrWelderContinuousEffect effect) { + super(effect); + } + + @Override + public boolean apply(Game game, Ability source) { + Permanent perm = game.getPermanent(source.getSourceId()); + if (perm != null) { for (UUID imprintedId: perm.getImprinted()) { Card card = game.getCard(imprintedId); if (card != null) { @@ -141,13 +141,13 @@ class MyrWelderContinuousEffect extends ContinuousEffectImpl { this.expansionSetCode = "MBS"; this.subtype.add("Zombie"); this.subtype.add("Warrior"); - this.color.setBlack(true); + this.color.setBlack(true); this.power = new MageInt(4); this.toughness = new MageInt(2); this.addAbility(new NestedGhoulTriggeredAbility()); diff --git a/Mage.Sets/src/mage/sets/mirrodinbesieged/Oculus.java b/Mage.Sets/src/mage/sets/mirrodinbesieged/Oculus.java index e9a8a4641f..89b7a7b9b3 100644 --- a/Mage.Sets/src/mage/sets/mirrodinbesieged/Oculus.java +++ b/Mage.Sets/src/mage/sets/mirrodinbesieged/Oculus.java @@ -46,7 +46,7 @@ public class Oculus extends CardImpl { super(ownerId, 29, "Oculus", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{1}{U}"); this.expansionSetCode = "MBS"; this.subtype.add("Homunculus"); - this.color.setBlue(true); + this.color.setBlue(true); this.power = new MageInt(1); this.toughness = new MageInt(1); this.addAbility(new DiesTriggeredAbility(new DrawCardControllerEffect(1), true)); diff --git a/Mage.Sets/src/mage/sets/mirrodinbesieged/OgreResister.java b/Mage.Sets/src/mage/sets/mirrodinbesieged/OgreResister.java index c78f4fe668..a261050557 100644 --- a/Mage.Sets/src/mage/sets/mirrodinbesieged/OgreResister.java +++ b/Mage.Sets/src/mage/sets/mirrodinbesieged/OgreResister.java @@ -44,7 +44,7 @@ public class OgreResister extends CardImpl { super(ownerId, 72, "Ogre Resister", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{2}{R}{R}"); this.expansionSetCode = "MBS"; this.subtype.add("Ogre"); - this.color.setRed(true); + this.color.setRed(true); this.power = new MageInt(4); this.toughness = new MageInt(3); } diff --git a/Mage.Sets/src/mage/sets/mirrodinbesieged/Phyresis.java b/Mage.Sets/src/mage/sets/mirrodinbesieged/Phyresis.java index 3df566de96..300907c238 100644 --- a/Mage.Sets/src/mage/sets/mirrodinbesieged/Phyresis.java +++ b/Mage.Sets/src/mage/sets/mirrodinbesieged/Phyresis.java @@ -54,13 +54,13 @@ public class Phyresis extends CardImpl { super(ownerId, 49, "Phyresis", Rarity.COMMON, new CardType[]{CardType.ENCHANTMENT}, "{1}{B}"); this.expansionSetCode = "MBS"; this.subtype.add("Aura"); - this.color.setBlack(true); + this.color.setBlack(true); TargetPermanent auraTarget = new TargetCreaturePermanent(); - this.getSpellAbility().addTarget(auraTarget); - this.getSpellAbility().addEffect(new AttachEffect(Constants.Outcome.BoostCreature)); - Ability ability = new EnchantAbility(auraTarget.getTargetName()); - this.addAbility(ability); + this.getSpellAbility().addTarget(auraTarget); + this.getSpellAbility().addEffect(new AttachEffect(Constants.Outcome.BoostCreature)); + Ability ability = new EnchantAbility(auraTarget.getTargetName()); + this.addAbility(ability); this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityAttachedEffect(InfectAbility.getInstance(), Constants.AttachmentType.AURA))); } diff --git a/Mage.Sets/src/mage/sets/mirrodinbesieged/PhyrexianCrusader.java b/Mage.Sets/src/mage/sets/mirrodinbesieged/PhyrexianCrusader.java index 869f786052..362ee145ce 100644 --- a/Mage.Sets/src/mage/sets/mirrodinbesieged/PhyrexianCrusader.java +++ b/Mage.Sets/src/mage/sets/mirrodinbesieged/PhyrexianCrusader.java @@ -44,17 +44,17 @@ import mage.filter.FilterCard; */ public class PhyrexianCrusader extends CardImpl { - private static final FilterCard filter = new FilterCard("Red"); - private static final FilterCard filter2 = new FilterCard("White"); + private static final FilterCard filter = new FilterCard("Red"); + private static final FilterCard filter2 = new FilterCard("White"); + + static { + filter.setUseColor(true); + filter.getColor().setRed(true); + + filter2.setUseColor(true); + filter2.getColor().setWhite(true); + } - static { - filter.setUseColor(true); - filter.getColor().setRed(true); - - filter2.setUseColor(true); - filter2.getColor().setWhite(true); - } - public PhyrexianCrusader (UUID ownerId) { super(ownerId, 50, "Phyrexian Crusader", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{1}{B}{B}"); this.expansionSetCode = "MBS"; diff --git a/Mage.Sets/src/mage/sets/mirrodinbesieged/PhyrexianHydra.java b/Mage.Sets/src/mage/sets/mirrodinbesieged/PhyrexianHydra.java index a8b275190d..2d3a5e590c 100644 --- a/Mage.Sets/src/mage/sets/mirrodinbesieged/PhyrexianHydra.java +++ b/Mage.Sets/src/mage/sets/mirrodinbesieged/PhyrexianHydra.java @@ -50,26 +50,26 @@ import mage.game.permanent.Permanent; */ public class PhyrexianHydra extends CardImpl { - public PhyrexianHydra(UUID ownerId) { - super(ownerId, 85, "Phyrexian Hydra", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{3}{G}{G}"); - this.expansionSetCode = "MBS"; - this.subtype.add("Hydra"); - this.color.setGreen(true); - this.power = new MageInt(7); - this.toughness = new MageInt(7); + public PhyrexianHydra(UUID ownerId) { + super(ownerId, 85, "Phyrexian Hydra", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{3}{G}{G}"); + this.expansionSetCode = "MBS"; + this.subtype.add("Hydra"); + this.color.setGreen(true); + this.power = new MageInt(7); + this.toughness = new MageInt(7); - this.addAbility(InfectAbility.getInstance()); - this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new PhyrexianHydraEffect())); - } + this.addAbility(InfectAbility.getInstance()); + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new PhyrexianHydraEffect())); + } - public PhyrexianHydra(final PhyrexianHydra card) { - super(card); - } + public PhyrexianHydra(final PhyrexianHydra card) { + super(card); + } - @Override - public PhyrexianHydra copy() { - return new PhyrexianHydra(this); - } + @Override + public PhyrexianHydra copy() { + return new PhyrexianHydra(this); + } } diff --git a/Mage.Sets/src/mage/sets/mirrodinbesieged/PhyrexianRebirth.java b/Mage.Sets/src/mage/sets/mirrodinbesieged/PhyrexianRebirth.java index 6545bbd118..2c611db840 100644 --- a/Mage.Sets/src/mage/sets/mirrodinbesieged/PhyrexianRebirth.java +++ b/Mage.Sets/src/mage/sets/mirrodinbesieged/PhyrexianRebirth.java @@ -52,7 +52,7 @@ public class PhyrexianRebirth extends CardImpl { super(ownerId, 15, "Phyrexian Rebirth", Rarity.RARE, new CardType[]{CardType.SORCERY}, "{4}{W}{W}"); this.expansionSetCode = "MBS"; this.color.setWhite(true); - this.getSpellAbility().addEffect(new PhyrexianRebirthEffect()); + this.getSpellAbility().addEffect(new PhyrexianRebirthEffect()); } public PhyrexianRebirth (final PhyrexianRebirth card) { @@ -64,34 +64,34 @@ public class PhyrexianRebirth extends CardImpl { return new PhyrexianRebirth(this); } - class PhyrexianRebirthEffect extends OneShotEffect { + class PhyrexianRebirthEffect extends OneShotEffect { - public PhyrexianRebirthEffect() { - super(Constants.Outcome.DestroyPermanent); + public PhyrexianRebirthEffect() { + super(Constants.Outcome.DestroyPermanent); staticText = "Destroy all creatures, then put an X/X colorless Horror artifact creature token onto the battlefield, where X is the number of creatures destroyed this way"; - } + } - public PhyrexianRebirthEffect(PhyrexianRebirthEffect ability) { - super(ability); - } + public PhyrexianRebirthEffect(PhyrexianRebirthEffect ability) { + super(ability); + } - @Override - public boolean apply(Game game, Ability source) { - int count = 0; - for (Permanent permanent: game.getBattlefield().getActivePermanents(new FilterCreaturePermanent(), source.getControllerId(), game)) { - count += permanent.destroy(source.getId(), game, false) ? 1 : 0; - } - HorrorToken horrorToken = new HorrorToken(); - horrorToken.getPower().setValue(count); - horrorToken.getToughness().setValue(count); - horrorToken.putOntoBattlefield(1, game, source.getId(), source.getControllerId()); - return true; - } + @Override + public boolean apply(Game game, Ability source) { + int count = 0; + for (Permanent permanent: game.getBattlefield().getActivePermanents(new FilterCreaturePermanent(), source.getControllerId(), game)) { + count += permanent.destroy(source.getId(), game, false) ? 1 : 0; + } + HorrorToken horrorToken = new HorrorToken(); + horrorToken.getPower().setValue(count); + horrorToken.getToughness().setValue(count); + horrorToken.putOntoBattlefield(1, game, source.getId(), source.getControllerId()); + return true; + } - @Override - public PhyrexianRebirthEffect copy() { - return new PhyrexianRebirthEffect(this); - } + @Override + public PhyrexianRebirthEffect copy() { + return new PhyrexianRebirthEffect(this); + } } @@ -99,8 +99,8 @@ class HorrorToken extends Token { public HorrorToken() { super("Horror", "X/X colorless Horror artifact creature token"); cardType.add(CardType.ARTIFACT); - cardType.add(CardType.CREATURE); - subtype.add("Horror"); + cardType.add(CardType.CREATURE); + subtype.add("Horror"); power = new MageInt(0); toughness = new MageInt(0); } diff --git a/Mage.Sets/src/mage/sets/mirrodinbesieged/PhyrexianRevoker.java b/Mage.Sets/src/mage/sets/mirrodinbesieged/PhyrexianRevoker.java index 7aeab3cf07..914c92bfd6 100644 --- a/Mage.Sets/src/mage/sets/mirrodinbesieged/PhyrexianRevoker.java +++ b/Mage.Sets/src/mage/sets/mirrodinbesieged/PhyrexianRevoker.java @@ -56,28 +56,28 @@ import mage.sets.Sets; */ public class PhyrexianRevoker extends CardImpl { - public PhyrexianRevoker(UUID ownerId) { - super(ownerId, 122, "Phyrexian Revoker", Rarity.RARE, new CardType[]{CardType.ARTIFACT, CardType.CREATURE}, "{2}"); - this.expansionSetCode = "MBS"; - this.subtype.add("Horror"); - this.power = new MageInt(2); - this.toughness = new MageInt(1); + public PhyrexianRevoker(UUID ownerId) { + super(ownerId, 122, "Phyrexian Revoker", Rarity.RARE, new CardType[]{CardType.ARTIFACT, CardType.CREATURE}, "{2}"); + this.expansionSetCode = "MBS"; + this.subtype.add("Horror"); + this.power = new MageInt(2); + this.toughness = new MageInt(1); // As Phyrexian Revoker enters the battlefield, name a nonland card. - this.addAbility(new EntersBattlefieldTriggeredAbility(new PhyrexianRevokerEffect1())); + this.addAbility(new EntersBattlefieldTriggeredAbility(new PhyrexianRevokerEffect1())); // Activated abilities of sources with the chosen name can't be activated. this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new PhyrexianRevokerEffect2())); - } + } - public PhyrexianRevoker(final PhyrexianRevoker card) { - super(card); - } + public PhyrexianRevoker(final PhyrexianRevoker card) { + super(card); + } - @Override - public PhyrexianRevoker copy() { - return new PhyrexianRevoker(this); - } + @Override + public PhyrexianRevoker copy() { + return new PhyrexianRevoker(this); + } } @@ -87,14 +87,14 @@ class PhyrexianRevokerEffect1 extends OneShotEffect { super(Outcome.Detriment); staticText = "name a nonland card"; } - + public PhyrexianRevokerEffect1(final PhyrexianRevokerEffect1 effect) { super(effect); } - + @Override public boolean apply(Game game, Ability source) { - Player controller = game.getPlayer(source.getControllerId()); + Player controller = game.getPlayer(source.getControllerId()); if (controller != null) { Choice cardChoice = new ChoiceImpl(); cardChoice.setChoices(Sets.getNonLandCardNames()); @@ -113,7 +113,7 @@ class PhyrexianRevokerEffect1 extends OneShotEffect { public PhyrexianRevokerEffect1 copy() { return new PhyrexianRevokerEffect1(this); } - + } class PhyrexianRevokerEffect2 extends ReplacementEffectImpl { @@ -122,11 +122,11 @@ class PhyrexianRevokerEffect2 extends ReplacementEffectImpl { class PoisonControllerEffect extends OneShotEffect { - public PoisonControllerEffect() { - super(Outcome.Damage); - staticText = "you get a poison counter"; + public PoisonControllerEffect() { + super(Outcome.Damage); + staticText = "you get a poison counter"; - } + } - public PoisonControllerEffect(final PoisonControllerEffect effect) { - super(effect); - } + public PoisonControllerEffect(final PoisonControllerEffect effect) { + super(effect); + } - @Override - public PoisonControllerEffect copy() { - return new PoisonControllerEffect(this); - } + @Override + public PoisonControllerEffect copy() { + return new PoisonControllerEffect(this); + } - @Override - public boolean apply(Game game, Ability source) { - Player player = game.getPlayer(source.getControllerId()); - if (player != null) { - player.addCounters(CounterType.POISON.createInstance(), game); - return true; - } - return false; - } + @Override + public boolean apply(Game game, Ability source) { + Player player = game.getPlayer(source.getControllerId()); + if (player != null) { + player.addCounters(CounterType.POISON.createInstance(), game); + return true; + } + return false; + } } diff --git a/Mage.Sets/src/mage/sets/mirrodinbesieged/PistonSledge.java b/Mage.Sets/src/mage/sets/mirrodinbesieged/PistonSledge.java index 5f8ecc1bd4..639ff6dd90 100644 --- a/Mage.Sets/src/mage/sets/mirrodinbesieged/PistonSledge.java +++ b/Mage.Sets/src/mage/sets/mirrodinbesieged/PistonSledge.java @@ -61,8 +61,8 @@ public class PistonSledge extends CardImpl { this.subtype.add("Equipment"); Ability ability = new EntersBattlefieldTriggeredAbility(new AttachEffect(Outcome.BoostCreature, "attach it to target creature you control"), false); - ability.addTarget(new TargetControlledCreaturePermanent()); - this.addAbility(ability); + ability.addTarget(new TargetControlledCreaturePermanent()); + this.addAbility(ability); this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostEquippedEffect(3, 1))); this.addAbility(new EquipAbility(Constants.Outcome.AddAbility, new SacrificeTargetCost(new TargetControlledPermanent(filter)))); } diff --git a/Mage.Sets/src/mage/sets/mirrodinbesieged/PistusStrike.java b/Mage.Sets/src/mage/sets/mirrodinbesieged/PistusStrike.java index 5fc268a331..def7eaa174 100644 --- a/Mage.Sets/src/mage/sets/mirrodinbesieged/PistusStrike.java +++ b/Mage.Sets/src/mage/sets/mirrodinbesieged/PistusStrike.java @@ -51,60 +51,60 @@ import mage.target.common.TargetCreaturePermanent; */ public class PistusStrike extends CardImpl { - private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("creature with flying"); + private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("creature with flying"); - static { - filter.getAbilities().add(FlyingAbility.getInstance()); - } + static { + filter.getAbilities().add(FlyingAbility.getInstance()); + } - public PistusStrike(UUID ownerId) { - super(ownerId, 86, "Pistus Strike", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{2}{G}"); - this.expansionSetCode = "MBS"; - this.color.setGreen(true); - - this.getSpellAbility().addTarget(new TargetCreaturePermanent(filter)); - this.getSpellAbility().addEffect(new DestroyTargetEffect()); - this.getSpellAbility().addEffect(new PoisonControllerTargetCreatureEffect()); - } + public PistusStrike(UUID ownerId) { + super(ownerId, 86, "Pistus Strike", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{2}{G}"); + this.expansionSetCode = "MBS"; + this.color.setGreen(true); - public PistusStrike(final PistusStrike card) { - super(card); - } + this.getSpellAbility().addTarget(new TargetCreaturePermanent(filter)); + this.getSpellAbility().addEffect(new DestroyTargetEffect()); + this.getSpellAbility().addEffect(new PoisonControllerTargetCreatureEffect()); + } - @Override - public PistusStrike copy() { - return new PistusStrike(this); - } + public PistusStrike(final PistusStrike card) { + super(card); + } + + @Override + public PistusStrike copy() { + return new PistusStrike(this); + } } class PoisonControllerTargetCreatureEffect extends OneShotEffect { - public PoisonControllerTargetCreatureEffect() { - super(Outcome.Damage); + public PoisonControllerTargetCreatureEffect() { + super(Outcome.Damage); staticText = "Its controller gets a poison counter"; - } + } - public PoisonControllerTargetCreatureEffect(final PoisonControllerTargetCreatureEffect effect) { - super(effect); - } + public PoisonControllerTargetCreatureEffect(final PoisonControllerTargetCreatureEffect effect) { + super(effect); + } - @Override - public PoisonControllerTargetCreatureEffect copy() { - return new PoisonControllerTargetCreatureEffect(this); - } + @Override + public PoisonControllerTargetCreatureEffect copy() { + return new PoisonControllerTargetCreatureEffect(this); + } - @Override - public boolean apply(Game game, Ability source) { - Permanent p = game.getBattlefield().getPermanent(source.getFirstTarget()); + @Override + public boolean apply(Game game, Ability source) { + Permanent p = game.getBattlefield().getPermanent(source.getFirstTarget()); if (p == null) { p = (Permanent) game.getLastKnownInformation(source.getFirstTarget(), Zone.BATTLEFIELD); } if (p != null) { Player player = game.getPlayer(p.getControllerId()); if (player != null) { - player.addCounters(CounterType.POISON.createInstance(), game); + player.addCounters(CounterType.POISON.createInstance(), game); } } - return false; - } + return false; + } } diff --git a/Mage.Sets/src/mage/sets/mirrodinbesieged/PlaguemawBeast.java b/Mage.Sets/src/mage/sets/mirrodinbesieged/PlaguemawBeast.java index 18c682e936..a3320a1dce 100644 --- a/Mage.Sets/src/mage/sets/mirrodinbesieged/PlaguemawBeast.java +++ b/Mage.Sets/src/mage/sets/mirrodinbesieged/PlaguemawBeast.java @@ -52,7 +52,7 @@ public class PlaguemawBeast extends CardImpl { super(ownerId, 87, "Plaguemaw Beast", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{3}{G}{G}"); this.expansionSetCode = "MBS"; this.subtype.add("Beast"); - this.color.setGreen(true); + this.color.setGreen(true); this.power = new MageInt(4); this.toughness = new MageInt(3); Ability ability = new SimpleActivatedAbility(Constants.Zone.BATTLEFIELD, new ProliferateEffect(), new TapSourceCost()); diff --git a/Mage.Sets/src/mage/sets/mirrodinbesieged/Plains1.java b/Mage.Sets/src/mage/sets/mirrodinbesieged/Plains1.java index 0d324ca02d..065a0fa2f7 100644 --- a/Mage.Sets/src/mage/sets/mirrodinbesieged/Plains1.java +++ b/Mage.Sets/src/mage/sets/mirrodinbesieged/Plains1.java @@ -36,18 +36,18 @@ import java.util.UUID; */ public class Plains1 extends mage.cards.basiclands.Plains { - public Plains1(UUID ownerId) { - super(ownerId, 146); - this.expansionSetCode = "MBS"; - } + public Plains1(UUID ownerId) { + super(ownerId, 146); + this.expansionSetCode = "MBS"; + } - public Plains1(final Plains1 card) { - super(card); - } + public Plains1(final Plains1 card) { + super(card); + } - @Override - public Plains1 copy() { - return new Plains1(this); - } + @Override + public Plains1 copy() { + return new Plains1(this); + } } diff --git a/Mage.Sets/src/mage/sets/mirrodinbesieged/Plains2.java b/Mage.Sets/src/mage/sets/mirrodinbesieged/Plains2.java index d05bed72af..b2e6dda94f 100644 --- a/Mage.Sets/src/mage/sets/mirrodinbesieged/Plains2.java +++ b/Mage.Sets/src/mage/sets/mirrodinbesieged/Plains2.java @@ -36,18 +36,18 @@ import java.util.UUID; */ public class Plains2 extends mage.cards.basiclands.Plains { - public Plains2(UUID ownerId) { - super(ownerId, 147); - this.expansionSetCode = "MBS"; - } + public Plains2(UUID ownerId) { + super(ownerId, 147); + this.expansionSetCode = "MBS"; + } - public Plains2(final Plains2 card) { - super(card); - } + public Plains2(final Plains2 card) { + super(card); + } - @Override - public Plains2 copy() { - return new Plains2(this); - } + @Override + public Plains2 copy() { + return new Plains2(this); + } } diff --git a/Mage.Sets/src/mage/sets/mirrodinbesieged/PraetorsCounsel.java b/Mage.Sets/src/mage/sets/mirrodinbesieged/PraetorsCounsel.java index 63a2364c9f..50fb6a0eeb 100644 --- a/Mage.Sets/src/mage/sets/mirrodinbesieged/PraetorsCounsel.java +++ b/Mage.Sets/src/mage/sets/mirrodinbesieged/PraetorsCounsel.java @@ -47,50 +47,50 @@ import mage.players.Player; */ public class PraetorsCounsel extends CardImpl { - public PraetorsCounsel(UUID ownerId) { - super(ownerId, 88, "Praetor's Counsel", Rarity.MYTHIC, new CardType[]{CardType.SORCERY}, "{5}{G}{G}{G}"); - this.expansionSetCode = "MBS"; - this.color.setGreen(true); - this.getSpellAbility().addEffect(new PraetorsCounselEffect()); - this.getSpellAbility().addEffect(ExileSpellEffect.getInstance()); - this.getSpellAbility().addEffect(new MaximumHandSizeControllerEffect(Integer.MAX_VALUE, Duration.EndOfGame, false)); - } + public PraetorsCounsel(UUID ownerId) { + super(ownerId, 88, "Praetor's Counsel", Rarity.MYTHIC, new CardType[]{CardType.SORCERY}, "{5}{G}{G}{G}"); + this.expansionSetCode = "MBS"; + this.color.setGreen(true); + this.getSpellAbility().addEffect(new PraetorsCounselEffect()); + this.getSpellAbility().addEffect(ExileSpellEffect.getInstance()); + this.getSpellAbility().addEffect(new MaximumHandSizeControllerEffect(Integer.MAX_VALUE, Duration.EndOfGame, false)); + } - public PraetorsCounsel(final PraetorsCounsel card) { - super(card); - } + public PraetorsCounsel(final PraetorsCounsel card) { + super(card); + } - @Override - public PraetorsCounsel copy() { - return new PraetorsCounsel(this); - } + @Override + public PraetorsCounsel copy() { + return new PraetorsCounsel(this); + } } class PraetorsCounselEffect extends OneShotEffect { - public PraetorsCounselEffect() { - super(Outcome.DrawCard); - this.staticText = "Return all cards from your graveyard to your hand"; - } + public PraetorsCounselEffect() { + super(Outcome.DrawCard); + this.staticText = "Return all cards from your graveyard to your hand"; + } - public PraetorsCounselEffect(final PraetorsCounselEffect effect) { - super(effect); - } + public PraetorsCounselEffect(final PraetorsCounselEffect effect) { + super(effect); + } - @Override - public PraetorsCounselEffect copy() { - return new PraetorsCounselEffect(this); - } + @Override + public PraetorsCounselEffect copy() { + return new PraetorsCounselEffect(this); + } - @Override - public boolean apply(Game game, Ability source) { - Player player = game.getPlayer(source.getControllerId()); - for (Card card: player.getGraveyard().getCards(game)) { - player.putInHand(card, game); - } - player.getGraveyard().clear(); - return false; - } + @Override + public boolean apply(Game game, Ability source) { + Player player = game.getPlayer(source.getControllerId()); + for (Card card: player.getGraveyard().getCards(game)) { + player.putInHand(card, game); + } + player.getGraveyard().clear(); + return false; + } } diff --git a/Mage.Sets/src/mage/sets/mirrodinbesieged/PriestsOfNorn.java b/Mage.Sets/src/mage/sets/mirrodinbesieged/PriestsOfNorn.java index fdffb0b307..a9737f6f76 100644 --- a/Mage.Sets/src/mage/sets/mirrodinbesieged/PriestsOfNorn.java +++ b/Mage.Sets/src/mage/sets/mirrodinbesieged/PriestsOfNorn.java @@ -46,11 +46,11 @@ public class PriestsOfNorn extends CardImpl { super(ownerId, 16, "Priests of Norn", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{2}{W}"); this.expansionSetCode = "MBS"; this.subtype.add("Cleric"); - this.color.setWhite(true); + this.color.setWhite(true); this.power = new MageInt(1); this.toughness = new MageInt(4); - this.addAbility(VigilanceAbility.getInstance()); - this.addAbility(InfectAbility.getInstance()); + this.addAbility(VigilanceAbility.getInstance()); + this.addAbility(InfectAbility.getInstance()); } public PriestsOfNorn (final PriestsOfNorn card) { diff --git a/Mage.Sets/src/mage/sets/mirrodinbesieged/QuilledSlagwurm.java b/Mage.Sets/src/mage/sets/mirrodinbesieged/QuilledSlagwurm.java index f708ff69e9..504536828f 100644 --- a/Mage.Sets/src/mage/sets/mirrodinbesieged/QuilledSlagwurm.java +++ b/Mage.Sets/src/mage/sets/mirrodinbesieged/QuilledSlagwurm.java @@ -44,7 +44,7 @@ public class QuilledSlagwurm extends CardImpl { super(ownerId, 89, "Quilled Slagwurm", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{4}{G}{G}{G}"); this.expansionSetCode = "MBS"; this.subtype.add("Wurm"); - this.color.setGreen(true); + this.color.setGreen(true); this.power = new MageInt(8); this.toughness = new MageInt(8); } diff --git a/Mage.Sets/src/mage/sets/mirrodinbesieged/RallyTheForces.java b/Mage.Sets/src/mage/sets/mirrodinbesieged/RallyTheForces.java index 293b52a090..35f7dd8e48 100644 --- a/Mage.Sets/src/mage/sets/mirrodinbesieged/RallyTheForces.java +++ b/Mage.Sets/src/mage/sets/mirrodinbesieged/RallyTheForces.java @@ -49,7 +49,7 @@ public class RallyTheForces extends CardImpl { public RallyTheForces (UUID ownerId) { super(ownerId, 73, "Rally the Forces", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{2}{R}"); this.expansionSetCode = "MBS"; - this.color.setRed(true); + this.color.setRed(true); this.getSpellAbility().addEffect(new BoostAllEffect(1, 1, Constants.Duration.EndOfTurn, filter, false)); this.getSpellAbility().addEffect(new GainAbilityAllEffect(FirstStrikeAbility.getInstance(), Constants.Duration.EndOfTurn, filter, false)); } diff --git a/Mage.Sets/src/mage/sets/mirrodinbesieged/RedSunsZenith.java b/Mage.Sets/src/mage/sets/mirrodinbesieged/RedSunsZenith.java index 07a3e104f0..2960805985 100644 --- a/Mage.Sets/src/mage/sets/mirrodinbesieged/RedSunsZenith.java +++ b/Mage.Sets/src/mage/sets/mirrodinbesieged/RedSunsZenith.java @@ -52,66 +52,66 @@ import mage.watchers.common.DamagedByWatcher; */ public class RedSunsZenith extends CardImpl { - public RedSunsZenith(UUID ownerId) { - super(ownerId, 74, "Red Sun's Zenith", Rarity.RARE, new CardType[]{CardType.SORCERY}, "{X}{R}"); - this.expansionSetCode = "MBS"; - this.color.setRed(true); - this.getSpellAbility().addTarget(new TargetCreatureOrPlayer()); - this.getSpellAbility().addEffect(new DamageTargetEffect(new ManacostVariableValue())); - this.getSpellAbility().addEffect(new RedSunsZenithEffect()); - this.getSpellAbility().addEffect(ShuffleSpellEffect.getInstance()); + public RedSunsZenith(UUID ownerId) { + super(ownerId, 74, "Red Sun's Zenith", Rarity.RARE, new CardType[]{CardType.SORCERY}, "{X}{R}"); + this.expansionSetCode = "MBS"; + this.color.setRed(true); + this.getSpellAbility().addTarget(new TargetCreatureOrPlayer()); + this.getSpellAbility().addEffect(new DamageTargetEffect(new ManacostVariableValue())); + this.getSpellAbility().addEffect(new RedSunsZenithEffect()); + this.getSpellAbility().addEffect(ShuffleSpellEffect.getInstance()); this.addWatcher(new DamagedByWatcher()); - } + } - public RedSunsZenith(final RedSunsZenith card) { - super(card); - } + public RedSunsZenith(final RedSunsZenith card) { + super(card); + } - @Override - public RedSunsZenith copy() { - return new RedSunsZenith(this); - } + @Override + public RedSunsZenith copy() { + return new RedSunsZenith(this); + } } class RedSunsZenithEffect extends ReplacementEffectImpl { - public RedSunsZenithEffect() { - super(Duration.EndOfTurn, Outcome.Exile); - staticText = "If a creature dealt damage this way would die this turn, exile it instead"; - } + public RedSunsZenithEffect() { + super(Duration.EndOfTurn, Outcome.Exile); + staticText = "If a creature dealt damage this way would die this turn, exile it instead"; + } - public RedSunsZenithEffect(final RedSunsZenithEffect effect) { - super(effect); - } + public RedSunsZenithEffect(final RedSunsZenithEffect effect) { + super(effect); + } - @Override - public RedSunsZenithEffect copy() { - return new RedSunsZenithEffect(this); - } + @Override + public RedSunsZenithEffect copy() { + return new RedSunsZenithEffect(this); + } - @Override - public boolean apply(Game game, Ability source) { - return true; - } + @Override + public boolean apply(Game game, Ability source) { + return true; + } - @Override - public boolean replaceEvent(GameEvent event, Ability source, Game game) { + @Override + public boolean replaceEvent(GameEvent event, Ability source, Game game) { Permanent permanent = ((ZoneChangeEvent)event).getTarget(); if (permanent != null) { return permanent.moveToExile(null, "", source.getId(), game); } - return false; - } + return false; + } - @Override - public boolean applies(GameEvent event, Ability source, Game game) { - if (event.getType() == EventType.ZONE_CHANGE && ((ZoneChangeEvent)event).isDiesEvent()) { + @Override + public boolean applies(GameEvent event, Ability source, Game game) { + if (event.getType() == EventType.ZONE_CHANGE && ((ZoneChangeEvent)event).isDiesEvent()) { DamagedByWatcher watcher = (DamagedByWatcher) game.getState().getWatchers().get("DamagedByWatcher", source.getSourceId()); if (watcher != null) return watcher.damagedCreatures.contains(event.getTargetId()); - } - return false; - } + } + return false; + } } diff --git a/Mage.Sets/src/mage/sets/mirrodinbesieged/Sangromancer.java b/Mage.Sets/src/mage/sets/mirrodinbesieged/Sangromancer.java index ce9d67b012..5c0e5d1acc 100644 --- a/Mage.Sets/src/mage/sets/mirrodinbesieged/Sangromancer.java +++ b/Mage.Sets/src/mage/sets/mirrodinbesieged/Sangromancer.java @@ -54,7 +54,7 @@ public class Sangromancer extends CardImpl { this.expansionSetCode = "MBS"; this.subtype.add("Vampire"); this.subtype.add("Shaman"); - this.color.setBlack(true); + this.color.setBlack(true); this.power = new MageInt(3); this.toughness = new MageInt(3); this.addAbility(FlyingAbility.getInstance()); diff --git a/Mage.Sets/src/mage/sets/mirrodinbesieged/ScourgeServant.java b/Mage.Sets/src/mage/sets/mirrodinbesieged/ScourgeServant.java index c6a1c96a19..4a9b10f87e 100644 --- a/Mage.Sets/src/mage/sets/mirrodinbesieged/ScourgeServant.java +++ b/Mage.Sets/src/mage/sets/mirrodinbesieged/ScourgeServant.java @@ -45,7 +45,7 @@ public class ScourgeServant extends CardImpl { super(ownerId, 54, "Scourge Servant", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{4}{B}"); this.expansionSetCode = "MBS"; this.subtype.add("Zombie"); - this.color.setBlack(true); + this.color.setBlack(true); this.power = new MageInt(3); this.toughness = new MageInt(3); this.addAbility(InfectAbility.getInstance()); diff --git a/Mage.Sets/src/mage/sets/mirrodinbesieged/SepticRats.java b/Mage.Sets/src/mage/sets/mirrodinbesieged/SepticRats.java index 4bba035952..bf65c771b7 100644 --- a/Mage.Sets/src/mage/sets/mirrodinbesieged/SepticRats.java +++ b/Mage.Sets/src/mage/sets/mirrodinbesieged/SepticRats.java @@ -92,7 +92,7 @@ class SepticRatsTriggeredAbility extends TriggeredAbilityImpl 0) return true; - } + } return false; } diff --git a/Mage.Sets/src/mage/sets/mirrodinbesieged/SerumRaker.java b/Mage.Sets/src/mage/sets/mirrodinbesieged/SerumRaker.java index 6593b3986d..642f648cd0 100644 --- a/Mage.Sets/src/mage/sets/mirrodinbesieged/SerumRaker.java +++ b/Mage.Sets/src/mage/sets/mirrodinbesieged/SerumRaker.java @@ -47,7 +47,7 @@ public class SerumRaker extends CardImpl { super(ownerId, 31, "Serum Raker", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{2}{U}{U}"); this.expansionSetCode = "MBS"; this.subtype.add("Drake"); - this.color.setBlue(true); + this.color.setBlue(true); this.power = new MageInt(3); this.toughness = new MageInt(2); this.addAbility(FlyingAbility.getInstance()); diff --git a/Mage.Sets/src/mage/sets/mirrodinbesieged/ShimmerMyr.java b/Mage.Sets/src/mage/sets/mirrodinbesieged/ShimmerMyr.java index 3d0af84df8..86f0b69894 100644 --- a/Mage.Sets/src/mage/sets/mirrodinbesieged/ShimmerMyr.java +++ b/Mage.Sets/src/mage/sets/mirrodinbesieged/ShimmerMyr.java @@ -71,34 +71,34 @@ public class ShimmerMyr extends CardImpl { class ShimmerMyrEffect extends AsThoughEffectImpl { - public ShimmerMyrEffect() { - super(Constants.AsThoughEffectType.CAST, Constants.Duration.WhileOnBattlefield, Constants.Outcome.Benefit); - staticText = "You may cast artifact cards as though they had flash"; - } + public ShimmerMyrEffect() { + super(Constants.AsThoughEffectType.CAST, Constants.Duration.WhileOnBattlefield, Constants.Outcome.Benefit); + staticText = "You may cast artifact cards as though they had flash"; + } - public ShimmerMyrEffect(final ShimmerMyrEffect effect) { - super(effect); - } + public ShimmerMyrEffect(final ShimmerMyrEffect effect) { + super(effect); + } - @Override - public boolean apply(Game game, Ability source) { - return true; - } + @Override + public boolean apply(Game game, Ability source) { + return true; + } - @Override - public ShimmerMyrEffect copy() { - return new ShimmerMyrEffect(this); - } + @Override + public ShimmerMyrEffect copy() { + return new ShimmerMyrEffect(this); + } - @Override - public boolean applies(UUID sourceId, Ability source, Game game) { - Card card = game.getCard(sourceId); - if (card != null) { - if (card.getCardType().contains(CardType.ARTIFACT) && card.getOwnerId().equals(source.getControllerId())) { - return true; - } - } - return false; - } + @Override + public boolean applies(UUID sourceId, Ability source, Game game) { + Card card = game.getCard(sourceId); + if (card != null) { + if (card.getCardType().contains(CardType.ARTIFACT) && card.getOwnerId().equals(source.getControllerId())) { + return true; + } + } + return false; + } } \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/mirrodinbesieged/Slagstorm.java b/Mage.Sets/src/mage/sets/mirrodinbesieged/Slagstorm.java index c1dddafc82..fbfe1f32c3 100644 --- a/Mage.Sets/src/mage/sets/mirrodinbesieged/Slagstorm.java +++ b/Mage.Sets/src/mage/sets/mirrodinbesieged/Slagstorm.java @@ -47,11 +47,11 @@ public class Slagstorm extends CardImpl { public Slagstorm (UUID ownerId) { super(ownerId, 75, "Slagstorm", Rarity.RARE, new CardType[]{CardType.SORCERY}, "{1}{R}{R}"); this.expansionSetCode = "MBS"; - this.color.setRed(true); + this.color.setRed(true); this.getSpellAbility().addEffect(new DamageAllEffect(3, new FilterCreaturePermanent())); - Mode mode = new Mode(); - mode.getEffects().add(new DamagePlayersEffect(3)); - this.getSpellAbility().addMode(mode); + Mode mode = new Mode(); + mode.getEffects().add(new DamagePlayersEffect(3)); + this.getSpellAbility().addMode(mode); } public Slagstorm (final Slagstorm card) { diff --git a/Mage.Sets/src/mage/sets/mirrodinbesieged/SpinEngine.java b/Mage.Sets/src/mage/sets/mirrodinbesieged/SpinEngine.java index c161b73caf..09e2a80331 100644 --- a/Mage.Sets/src/mage/sets/mirrodinbesieged/SpinEngine.java +++ b/Mage.Sets/src/mage/sets/mirrodinbesieged/SpinEngine.java @@ -48,60 +48,60 @@ import mage.target.common.TargetCreaturePermanent; */ public class SpinEngine extends CardImpl { - public SpinEngine(UUID ownerId) { - super(ownerId, 135, "Spin Engine", Rarity.COMMON, new CardType[]{CardType.ARTIFACT, CardType.CREATURE}, "{3}"); - this.expansionSetCode = "MBS"; - this.subtype.add("Construct"); - this.power = new MageInt(3); - this.toughness = new MageInt(1); + public SpinEngine(UUID ownerId) { + super(ownerId, 135, "Spin Engine", Rarity.COMMON, new CardType[]{CardType.ARTIFACT, CardType.CREATURE}, "{3}"); + this.expansionSetCode = "MBS"; + this.subtype.add("Construct"); + this.power = new MageInt(3); + this.toughness = new MageInt(1); // {R}: Target creature can't block Spin Engine this turn Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new SpinEngineEffect(), new ManaCostsImpl("{R}")); ability.addTarget(new TargetCreaturePermanent()); this.addAbility(ability); - } + } - public SpinEngine(final SpinEngine card) { - super(card); - } + public SpinEngine(final SpinEngine card) { + super(card); + } - @Override - public SpinEngine copy() { - return new SpinEngine(this); - } + @Override + public SpinEngine copy() { + return new SpinEngine(this); + } } class SpinEngineEffect extends RestrictionEffect { - public SpinEngineEffect() { - super(Duration.EndOfTurn); + public SpinEngineEffect() { + super(Duration.EndOfTurn); staticText = "Target creature can't block {this} this turn"; - } + } - public SpinEngineEffect(final SpinEngineEffect effect) { - super(effect); - } + public SpinEngineEffect(final SpinEngineEffect effect) { + super(effect); + } - @Override - public boolean applies(Permanent permanent, Ability source, Game game) { - if (permanent.getId().equals(source.getSourceId())) { - return true; - } - return false; - } + @Override + public boolean applies(Permanent permanent, Ability source, Game game) { + if (permanent.getId().equals(source.getSourceId())) { + return true; + } + return false; + } - @Override - public boolean canBeBlocked(Permanent attacker, Permanent blocker, Ability source, Game game) { - UUID targetId = source.getFirstTarget(); + @Override + public boolean canBeBlocked(Permanent attacker, Permanent blocker, Ability source, Game game) { + UUID targetId = source.getFirstTarget(); if (targetId != null && blocker.getId().equals(targetId)) return false; return true; - } + } - @Override - public SpinEngineEffect copy() { - return new SpinEngineEffect(this); - } + @Override + public SpinEngineEffect copy() { + return new SpinEngineEffect(this); + } } diff --git a/Mage.Sets/src/mage/sets/mirrodinbesieged/SpireSerpent.java b/Mage.Sets/src/mage/sets/mirrodinbesieged/SpireSerpent.java index d2ccda7916..f67c26b043 100644 --- a/Mage.Sets/src/mage/sets/mirrodinbesieged/SpireSerpent.java +++ b/Mage.Sets/src/mage/sets/mirrodinbesieged/SpireSerpent.java @@ -51,60 +51,60 @@ import mage.game.Game; public class SpireSerpent extends CardImpl { private static final String abilityText1 = "Metalcraft - As long as you control three or more artifacts, {this} gets +2/+2 and "; - - public SpireSerpent(UUID ownerId) { - super(ownerId, 32, "Spire Serpent", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{4}{U}"); - this.expansionSetCode = "MBS"; - this.subtype.add("Serpent"); - this.color.setBlue(true); - this.power = new MageInt(3); - this.toughness = new MageInt(5); - this.addAbility(DefenderAbility.getInstance()); + public SpireSerpent(UUID ownerId) { + super(ownerId, 32, "Spire Serpent", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{4}{U}"); + this.expansionSetCode = "MBS"; + this.subtype.add("Serpent"); + this.color.setBlue(true); + this.power = new MageInt(3); + this.toughness = new MageInt(5); + + this.addAbility(DefenderAbility.getInstance()); ConditionalContinousEffect effect1 = new ConditionalContinousEffect(new BoostSourceEffect(2, 2, Duration.WhileOnBattlefield), MetalcraftCondition.getInstance(), abilityText1); Ability ability = new SimpleStaticAbility(Zone.BATTLEFIELD, effect1); ability.addEffect(new SpireSerpentEffect()); this.addAbility(ability); - } + } - public SpireSerpent(final SpireSerpent card) { - super(card); - } + public SpireSerpent(final SpireSerpent card) { + super(card); + } - @Override - public SpireSerpent copy() { - return new SpireSerpent(this); - } + @Override + public SpireSerpent copy() { + return new SpireSerpent(this); + } } class SpireSerpentEffect extends AsThoughEffectImpl { - public SpireSerpentEffect() { - super(Constants.AsThoughEffectType.ATTACK, Constants.Duration.WhileOnBattlefield, Constants.Outcome.Benefit); - staticText = "{this} can attack as though it didn't have defender"; - } + public SpireSerpentEffect() { + super(Constants.AsThoughEffectType.ATTACK, Constants.Duration.WhileOnBattlefield, Constants.Outcome.Benefit); + staticText = "{this} can attack as though it didn't have defender"; + } - public SpireSerpentEffect(final SpireSerpentEffect effect) { - super(effect); - } + public SpireSerpentEffect(final SpireSerpentEffect effect) { + super(effect); + } - @Override - public boolean apply(Game game, Ability source) { - return true; - } + @Override + public boolean apply(Game game, Ability source) { + return true; + } - @Override - public SpireSerpentEffect copy() { - return new SpireSerpentEffect(this); - } + @Override + public SpireSerpentEffect copy() { + return new SpireSerpentEffect(this); + } - @Override - public boolean applies(UUID sourceId, Ability source, Game game) { + @Override + public boolean applies(UUID sourceId, Ability source, Game game) { if (sourceId.equals(source.getSourceId()) && MetalcraftCondition.getInstance().apply(game, source)) { return true; } - return false; - } + return false; + } } \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/mirrodinbesieged/SpreadTheSickness.java b/Mage.Sets/src/mage/sets/mirrodinbesieged/SpreadTheSickness.java index 9c56b79bdb..8bfe81e71d 100644 --- a/Mage.Sets/src/mage/sets/mirrodinbesieged/SpreadTheSickness.java +++ b/Mage.Sets/src/mage/sets/mirrodinbesieged/SpreadTheSickness.java @@ -45,7 +45,7 @@ public class SpreadTheSickness extends CardImpl { public SpreadTheSickness (UUID ownerId) { super(ownerId, 56, "Spread the Sickness", Rarity.COMMON, new CardType[]{CardType.SORCERY}, "{4}{B}"); this.expansionSetCode = "MBS"; - this.color.setBlack(true); + this.color.setBlack(true); this.getSpellAbility().addEffect(new DestroyTargetEffect()); this.getSpellAbility().addEffect(new ProliferateEffect()); this.getSpellAbility().addTarget(new TargetCreaturePermanent()); diff --git a/Mage.Sets/src/mage/sets/mirrodinbesieged/Swamp1.java b/Mage.Sets/src/mage/sets/mirrodinbesieged/Swamp1.java index 8eb1d42e4e..e31f449e0e 100644 --- a/Mage.Sets/src/mage/sets/mirrodinbesieged/Swamp1.java +++ b/Mage.Sets/src/mage/sets/mirrodinbesieged/Swamp1.java @@ -36,18 +36,18 @@ import java.util.UUID; */ public class Swamp1 extends mage.cards.basiclands.Swamp { - public Swamp1(UUID ownerId) { - super(ownerId, 150); - this.expansionSetCode = "MBS"; - } + public Swamp1(UUID ownerId) { + super(ownerId, 150); + this.expansionSetCode = "MBS"; + } - public Swamp1(final Swamp1 card) { - super(card); - } + public Swamp1(final Swamp1 card) { + super(card); + } - @Override - public Swamp1 copy() { - return new Swamp1(this); - } + @Override + public Swamp1 copy() { + return new Swamp1(this); + } } diff --git a/Mage.Sets/src/mage/sets/mirrodinbesieged/Swamp2.java b/Mage.Sets/src/mage/sets/mirrodinbesieged/Swamp2.java index a06710ef29..340c3a405c 100644 --- a/Mage.Sets/src/mage/sets/mirrodinbesieged/Swamp2.java +++ b/Mage.Sets/src/mage/sets/mirrodinbesieged/Swamp2.java @@ -36,18 +36,18 @@ import java.util.UUID; */ public class Swamp2 extends mage.cards.basiclands.Swamp { - public Swamp2(UUID ownerId) { - super(ownerId, 151); - this.expansionSetCode = "MBS"; - } + public Swamp2(UUID ownerId) { + super(ownerId, 151); + this.expansionSetCode = "MBS"; + } - public Swamp2(final Swamp2 card) { - super(card); - } + public Swamp2(final Swamp2 card) { + super(card); + } - @Override - public Swamp2 copy() { - return new Swamp2(this); - } + @Override + public Swamp2 copy() { + return new Swamp2(this); + } } diff --git a/Mage.Sets/src/mage/sets/mirrodinbesieged/SwordOfFeastAndFamine.java b/Mage.Sets/src/mage/sets/mirrodinbesieged/SwordOfFeastAndFamine.java index c23916d3ff..8a68328bbe 100644 --- a/Mage.Sets/src/mage/sets/mirrodinbesieged/SwordOfFeastAndFamine.java +++ b/Mage.Sets/src/mage/sets/mirrodinbesieged/SwordOfFeastAndFamine.java @@ -111,7 +111,7 @@ class SwordOfFeastAndFamineAbility extends TriggeredAbilityImpl { super(ownerId, 91, "Tangle Mantis", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{2}{G}{G}"); this.expansionSetCode = "MBS"; this.subtype.add("Insect"); - this.color.setGreen(true); + this.color.setGreen(true); this.power = new MageInt(3); this.toughness = new MageInt(4); this.addAbility(TrampleAbility.getInstance()); diff --git a/Mage.Sets/src/mage/sets/mirrodinbesieged/TezzeretAgentOfBolas.java b/Mage.Sets/src/mage/sets/mirrodinbesieged/TezzeretAgentOfBolas.java index d2b601b01c..216cf03f84 100644 --- a/Mage.Sets/src/mage/sets/mirrodinbesieged/TezzeretAgentOfBolas.java +++ b/Mage.Sets/src/mage/sets/mirrodinbesieged/TezzeretAgentOfBolas.java @@ -64,52 +64,52 @@ import mage.target.common.TargetArtifactPermanent; */ public class TezzeretAgentOfBolas extends CardImpl { - public TezzeretAgentOfBolas(UUID ownerId) { - super(ownerId, 97, "Tezzeret, Agent of Bolas", Rarity.MYTHIC, new CardType[]{CardType.PLANESWALKER}, "{2}{U}{B}"); - this.expansionSetCode = "MBS"; - this.subtype.add("Tezzeret"); - this.color.setBlue(true); - this.color.setBlack(true); - this.addAbility(new EntersBattlefieldAbility(new AddCountersSourceEffect(CounterType.LOYALTY.createInstance(3)), "")); + public TezzeretAgentOfBolas(UUID ownerId) { + super(ownerId, 97, "Tezzeret, Agent of Bolas", Rarity.MYTHIC, new CardType[]{CardType.PLANESWALKER}, "{2}{U}{B}"); + this.expansionSetCode = "MBS"; + this.subtype.add("Tezzeret"); + this.color.setBlue(true); + this.color.setBlack(true); + this.addAbility(new EntersBattlefieldAbility(new AddCountersSourceEffect(CounterType.LOYALTY.createInstance(3)), "")); - this.addAbility(new LoyaltyAbility(new TezzeretAgentOfBolasEffect1(), 1)); + this.addAbility(new LoyaltyAbility(new TezzeretAgentOfBolasEffect1(), 1)); - LoyaltyAbility ability1 = new LoyaltyAbility(new BecomesCreatureTargetEffect(new ArtifactCreatureToken(), "", Duration.EndOfGame), -1); - ability1.addTarget(new TargetArtifactPermanent()); - this.addAbility(ability1); + LoyaltyAbility ability1 = new LoyaltyAbility(new BecomesCreatureTargetEffect(new ArtifactCreatureToken(), "", Duration.EndOfGame), -1); + ability1.addTarget(new TargetArtifactPermanent()); + this.addAbility(ability1); - LoyaltyAbility ability2 = new LoyaltyAbility(new TezzeretAgentOfBolasEffect2(), -4); - ability2.addTarget(new TargetPlayer()); - this.addAbility(ability2); + LoyaltyAbility ability2 = new LoyaltyAbility(new TezzeretAgentOfBolasEffect2(), -4); + ability2.addTarget(new TargetPlayer()); + this.addAbility(ability2); - } + } - public TezzeretAgentOfBolas(final TezzeretAgentOfBolas card) { - super(card); - } + public TezzeretAgentOfBolas(final TezzeretAgentOfBolas card) { + super(card); + } - @Override - public TezzeretAgentOfBolas copy() { - return new TezzeretAgentOfBolas(this); - } + @Override + public TezzeretAgentOfBolas copy() { + return new TezzeretAgentOfBolas(this); + } } class TezzeretAgentOfBolasEffect1 extends OneShotEffect { - public TezzeretAgentOfBolasEffect1() { - super(Outcome.DrawCard); - staticText = "Look at the top five cards of your library. You may reveal an artifact card from among them and put it into your hand. Put the rest on the bottom of your library in any order"; - } + public TezzeretAgentOfBolasEffect1() { + super(Outcome.DrawCard); + staticText = "Look at the top five cards of your library. You may reveal an artifact card from among them and put it into your hand. Put the rest on the bottom of your library in any order"; + } - public TezzeretAgentOfBolasEffect1(final TezzeretAgentOfBolasEffect1 effect) { - super(effect); - } + public TezzeretAgentOfBolasEffect1(final TezzeretAgentOfBolasEffect1 effect) { + super(effect); + } - @Override - public TezzeretAgentOfBolasEffect1 copy() { - return new TezzeretAgentOfBolasEffect1(this); - } + @Override + public TezzeretAgentOfBolasEffect1 copy() { + return new TezzeretAgentOfBolasEffect1(this); + } @Override public boolean apply(Game game, Ability source) { @@ -163,20 +163,20 @@ class TezzeretAgentOfBolasEffect1 extends OneShotEffect { @@ -188,34 +188,34 @@ class TezzeretAgentOfBolasEffect2 extends OneShotEffect { super(ownerId, 17, "Tine Shrike", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{3}{W}"); this.expansionSetCode = "MBS"; this.subtype.add("Bird"); - this.color.setWhite(true); + this.color.setWhite(true); this.power = new MageInt(2); this.toughness = new MageInt(1); this.addAbility(FlyingAbility.getInstance()); diff --git a/Mage.Sets/src/mage/sets/mirrodinbesieged/TitanForge.java b/Mage.Sets/src/mage/sets/mirrodinbesieged/TitanForge.java index a0b923c080..dfcd37fcf5 100644 --- a/Mage.Sets/src/mage/sets/mirrodinbesieged/TitanForge.java +++ b/Mage.Sets/src/mage/sets/mirrodinbesieged/TitanForge.java @@ -82,6 +82,6 @@ class GolemToken extends Token { cardType.add(CardType.CREATURE); subtype.add("Golem"); power = new MageInt(9); - toughness = new MageInt(9); + toughness = new MageInt(9); } } \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/mirrodinbesieged/TrainingDrone.java b/Mage.Sets/src/mage/sets/mirrodinbesieged/TrainingDrone.java index fe72273eb8..74f0baa8b4 100644 --- a/Mage.Sets/src/mage/sets/mirrodinbesieged/TrainingDrone.java +++ b/Mage.Sets/src/mage/sets/mirrodinbesieged/TrainingDrone.java @@ -82,18 +82,18 @@ class TrainingDroneEffect extends RestrictionEffect { @Override public boolean applies(Permanent permanent, Ability source, Game game) { - if (permanent.getId().equals(source.getSourceId())) { - List attachments = permanent.getAttachments(); - for (UUID uuid : attachments) { - Permanent attached = game.getBattlefield().getPermanent(uuid); - if (attached.getSubtype().contains("Equipment")) { - return false; - } - } - return true; - } - // don't apply for all other creatures! - return false; + if (permanent.getId().equals(source.getSourceId())) { + List attachments = permanent.getAttachments(); + for (UUID uuid : attachments) { + Permanent attached = game.getBattlefield().getPermanent(uuid); + if (attached.getSubtype().contains("Equipment")) { + return false; + } + } + return true; + } + // don't apply for all other creatures! + return false; } @Override diff --git a/Mage.Sets/src/mage/sets/mirrodinbesieged/TreasureMage.java b/Mage.Sets/src/mage/sets/mirrodinbesieged/TreasureMage.java index ca19969675..a4e4c3f35d 100644 --- a/Mage.Sets/src/mage/sets/mirrodinbesieged/TreasureMage.java +++ b/Mage.Sets/src/mage/sets/mirrodinbesieged/TreasureMage.java @@ -48,23 +48,23 @@ public class TreasureMage extends CardImpl { private static FilterCard filter = new FilterCard("an artifact card with converted mana cost 6 or more"); - static { - filter.getCardType().add(CardType.ARTIFACT); - filter.setConvertedManaCost(5); - filter.setConvertedManaCostComparison(Filter.ComparisonType.GreaterThan); - } + static { + filter.getCardType().add(CardType.ARTIFACT); + filter.setConvertedManaCost(5); + filter.setConvertedManaCostComparison(Filter.ComparisonType.GreaterThan); + } public TreasureMage (UUID ownerId) { super(ownerId, 34, "Treasure Mage", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{2}{U}"); this.expansionSetCode = "MBS"; this.subtype.add("Human"); this.subtype.add("Wizard"); - this.color.setBlue(true); + this.color.setBlue(true); this.power = new MageInt(2); this.toughness = new MageInt(2); TargetCardInLibrary target = new TargetCardInLibrary(0, 1, filter); - SearchEffect effect = new SearchLibraryRevealPutInHandEffect(target, false); - this.addAbility(new EntersBattlefieldTriggeredAbility(effect, true)); + SearchEffect effect = new SearchLibraryRevealPutInHandEffect(target, false); + this.addAbility(new EntersBattlefieldTriggeredAbility(effect, true)); } public TreasureMage (final TreasureMage card) { diff --git a/Mage.Sets/src/mage/sets/mirrodinbesieged/TurnTheTide.java b/Mage.Sets/src/mage/sets/mirrodinbesieged/TurnTheTide.java index 562fc0da50..519a27626a 100644 --- a/Mage.Sets/src/mage/sets/mirrodinbesieged/TurnTheTide.java +++ b/Mage.Sets/src/mage/sets/mirrodinbesieged/TurnTheTide.java @@ -45,7 +45,7 @@ public class TurnTheTide extends CardImpl { public TurnTheTide (UUID ownerId) { super(ownerId, 35, "Turn the Tide", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{1}{U}"); this.expansionSetCode = "MBS"; - this.color.setBlue(true); + this.color.setBlue(true); this.getSpellAbility().addEffect(new BoostOpponentsEffect(-2, 0, Constants.Duration.EndOfTurn)); } diff --git a/Mage.Sets/src/mage/sets/mirrodinbesieged/UnnaturalPredation.java b/Mage.Sets/src/mage/sets/mirrodinbesieged/UnnaturalPredation.java index ac21be6e29..284fde4ab2 100644 --- a/Mage.Sets/src/mage/sets/mirrodinbesieged/UnnaturalPredation.java +++ b/Mage.Sets/src/mage/sets/mirrodinbesieged/UnnaturalPredation.java @@ -48,7 +48,7 @@ public class UnnaturalPredation extends CardImpl { public UnnaturalPredation (UUID ownerId) { super(ownerId, 93, "Unnatural Predation", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{G}"); this.expansionSetCode = "MBS"; - this.color.setGreen(true); + this.color.setGreen(true); this.getSpellAbility().addEffect(new BoostTargetEffect(1, 1, Constants.Duration.EndOfTurn)); this.getSpellAbility().addEffect(new GainAbilityTargetEffect(TrampleAbility.getInstance(), Constants.Duration.EndOfTurn)); this.getSpellAbility().addTarget(new TargetCreaturePermanent()); diff --git a/Mage.Sets/src/mage/sets/mirrodinbesieged/VedalkenInfuser.java b/Mage.Sets/src/mage/sets/mirrodinbesieged/VedalkenInfuser.java index a1b5076481..06b115e3f9 100644 --- a/Mage.Sets/src/mage/sets/mirrodinbesieged/VedalkenInfuser.java +++ b/Mage.Sets/src/mage/sets/mirrodinbesieged/VedalkenInfuser.java @@ -52,7 +52,7 @@ public class VedalkenInfuser extends CardImpl { this.expansionSetCode = "MBS"; this.subtype.add("Vedalken"); this.subtype.add("Wizard"); - this.color.setBlue(true); + this.color.setBlue(true); this.power = new MageInt(1); this.toughness = new MageInt(4); Ability ability = new BeginningOfUpkeepTriggeredAbility(new AddCountersTargetEffect(CounterType.CHARGE.createInstance()), Constants.TargetController.YOU, true); diff --git a/Mage.Sets/src/mage/sets/mirrodinbesieged/VictorysHerald.java b/Mage.Sets/src/mage/sets/mirrodinbesieged/VictorysHerald.java index 61d9b76055..f28afa49ae 100644 --- a/Mage.Sets/src/mage/sets/mirrodinbesieged/VictorysHerald.java +++ b/Mage.Sets/src/mage/sets/mirrodinbesieged/VictorysHerald.java @@ -52,7 +52,7 @@ public class VictorysHerald extends CardImpl { super(ownerId, 18, "Victory's Herald", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{3}{W}{W}{W}"); this.expansionSetCode = "MBS"; this.subtype.add("Angel"); - this.color.setWhite(true); + this.color.setWhite(true); this.power = new MageInt(4); this.toughness = new MageInt(4); Ability ability = new AttacksTriggeredAbility(new GainAbilityControlledEffect(FlyingAbility.getInstance(), Constants.Duration.EndOfTurn, new FilterAttackingCreature()), false); diff --git a/Mage.Sets/src/mage/sets/mirrodinbesieged/ViridianClaw.java b/Mage.Sets/src/mage/sets/mirrodinbesieged/ViridianClaw.java index 6fd566cb1b..90f35ac181 100644 --- a/Mage.Sets/src/mage/sets/mirrodinbesieged/ViridianClaw.java +++ b/Mage.Sets/src/mage/sets/mirrodinbesieged/ViridianClaw.java @@ -53,7 +53,7 @@ public class ViridianClaw extends CardImpl { this.subtype.add("Equipment"); this.addAbility(new EquipAbility(Constants.Outcome.AddAbility, new GenericManaCost(1))); this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostEquippedEffect(1, 0))); - this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityAttachedEffect(FirstStrikeAbility.getInstance(), Constants.AttachmentType.EQUIPMENT))); + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityAttachedEffect(FirstStrikeAbility.getInstance(), Constants.AttachmentType.EQUIPMENT))); } public ViridianClaw (final ViridianClaw card) { diff --git a/Mage.Sets/src/mage/sets/mirrodinbesieged/ViridianCorrupter.java b/Mage.Sets/src/mage/sets/mirrodinbesieged/ViridianCorrupter.java index c61a15d0f2..0e0f049ac3 100644 --- a/Mage.Sets/src/mage/sets/mirrodinbesieged/ViridianCorrupter.java +++ b/Mage.Sets/src/mage/sets/mirrodinbesieged/ViridianCorrupter.java @@ -50,26 +50,26 @@ public class ViridianCorrupter extends CardImpl { private static FilterPermanent filter = new FilterPermanent("artifact"); - static { - filter.getCardType().add(CardType.ARTIFACT); - filter.setScopeCardType(Filter.ComparisonScope.Any); - } + static { + filter.getCardType().add(CardType.ARTIFACT); + filter.setScopeCardType(Filter.ComparisonScope.Any); + } public ViridianCorrupter (UUID ownerId) { super(ownerId, 94, "Viridian Corrupter", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{1}{G}{G}"); this.expansionSetCode = "MBS"; this.subtype.add("Elf"); this.subtype.add("Shaman"); - this.color.setGreen(true); + this.color.setGreen(true); this.power = new MageInt(2); this.toughness = new MageInt(2); this.addAbility(InfectAbility.getInstance()); Ability ability = new EntersBattlefieldTriggeredAbility(new DestroyTargetEffect(), false); - Target target = new TargetPermanent(filter); - target.setRequired(true); - ability.addTarget(target); - this.addAbility(ability); + Target target = new TargetPermanent(filter); + target.setRequired(true); + ability.addTarget(target); + this.addAbility(ability); } public ViridianCorrupter (final ViridianCorrupter card) { diff --git a/Mage.Sets/src/mage/sets/mirrodinbesieged/ViridianEmissary.java b/Mage.Sets/src/mage/sets/mirrodinbesieged/ViridianEmissary.java index bb8d2f4909..09b8ef163f 100644 --- a/Mage.Sets/src/mage/sets/mirrodinbesieged/ViridianEmissary.java +++ b/Mage.Sets/src/mage/sets/mirrodinbesieged/ViridianEmissary.java @@ -49,7 +49,7 @@ public class ViridianEmissary extends CardImpl { this.expansionSetCode = "MBS"; this.subtype.add("Elf"); this.subtype.add("Scout"); - this.color.setGreen(true); + this.color.setGreen(true); this.power = new MageInt(2); this.toughness = new MageInt(1); this.addAbility(new DiesTriggeredAbility(new SearchLibraryPutInPlayEffect(new TargetCardInLibrary(new FilterBasicLandCard()), true), true)); diff --git a/Mage.Sets/src/mage/sets/mirrodinbesieged/Vivisection.java b/Mage.Sets/src/mage/sets/mirrodinbesieged/Vivisection.java index 329b0b4e51..efb3aa5dfc 100644 --- a/Mage.Sets/src/mage/sets/mirrodinbesieged/Vivisection.java +++ b/Mage.Sets/src/mage/sets/mirrodinbesieged/Vivisection.java @@ -45,7 +45,7 @@ public class Vivisection extends CardImpl { public Vivisection (UUID ownerId) { super(ownerId, 38, "Vivisection", Rarity.COMMON, new CardType[]{CardType.SORCERY}, "{3}{U}"); this.expansionSetCode = "MBS"; - this.color.setBlue(true); + this.color.setBlue(true); this.getSpellAbility().addEffect(new DrawCardControllerEffect(3)); this.getSpellAbility().addCost(new SacrificeTargetCost(new TargetControlledCreaturePermanent())); } diff --git a/Mage.Sets/src/mage/sets/mirrodinbesieged/WhiteSunsZenith.java b/Mage.Sets/src/mage/sets/mirrodinbesieged/WhiteSunsZenith.java index 461e401e1b..c4b3692239 100644 --- a/Mage.Sets/src/mage/sets/mirrodinbesieged/WhiteSunsZenith.java +++ b/Mage.Sets/src/mage/sets/mirrodinbesieged/WhiteSunsZenith.java @@ -47,7 +47,7 @@ public class WhiteSunsZenith extends CardImpl { public WhiteSunsZenith (UUID ownerId) { super(ownerId, 19, "White Sun's Zenith", Rarity.RARE, new CardType[]{CardType.INSTANT}, "{X}{W}{W}{W}"); this.expansionSetCode = "MBS"; - this.color.setWhite(true); + this.color.setWhite(true); this.getSpellAbility().addEffect(new CreateTokenEffect(new CatToken(), new ManacostVariableValue())); this.getSpellAbility().addEffect(ShuffleSpellEffect.getInstance()); } @@ -66,9 +66,9 @@ class CatToken extends Token { public CatToken() { super("Cat", "2/2 white Cat creature token"); cardType.add(CardType.CREATURE); - color = ObjectColor.WHITE; - subtype.add("Cat"); - power = new MageInt(2); - toughness = new MageInt(2); + color = ObjectColor.WHITE; + subtype.add("Cat"); + power = new MageInt(2); + toughness = new MageInt(2); } } \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/morningtide/ChameleonColossus.java b/Mage.Sets/src/mage/sets/morningtide/ChameleonColossus.java index 4bc28d62d7..42f887c962 100644 --- a/Mage.Sets/src/mage/sets/morningtide/ChameleonColossus.java +++ b/Mage.Sets/src/mage/sets/morningtide/ChameleonColossus.java @@ -85,24 +85,24 @@ class ChameleonColossusEffect extends ContinuousEffectImpl { - final PreeminentCaptainEffect effect = new PreeminentCaptainEffect(); + final PreeminentCaptainEffect effect = new PreeminentCaptainEffect(); - public PreeminentCaptain(UUID ownerId) { - super(ownerId, 20, "Preeminent Captain", Rarity.RARE, - new CardType[] { CardType.CREATURE }, "{2}{W}"); - this.expansionSetCode = "MOR"; - this.subtype.add("Kithkin"); - this.subtype.add("Soldier"); + public PreeminentCaptain(UUID ownerId) { + super(ownerId, 20, "Preeminent Captain", Rarity.RARE, + new CardType[] { CardType.CREATURE }, "{2}{W}"); + this.expansionSetCode = "MOR"; + this.subtype.add("Kithkin"); + this.subtype.add("Soldier"); - this.color.setWhite(true); - this.power = new MageInt(2); - this.toughness = new MageInt(2); + this.color.setWhite(true); + this.power = new MageInt(2); + this.toughness = new MageInt(2); - this.addAbility(FirstStrikeAbility.getInstance()); - // Whenever Preeminent Captain attacks, you may put a Soldier creature - // card from your hand onto the battlefield tapped and attacking. - this.addAbility(new AttacksTriggeredAbility(effect, true)); - } + this.addAbility(FirstStrikeAbility.getInstance()); + // Whenever Preeminent Captain attacks, you may put a Soldier creature + // card from your hand onto the battlefield tapped and attacking. + this.addAbility(new AttacksTriggeredAbility(effect, true)); + } - public PreeminentCaptain(final PreeminentCaptain card) { - super(card); - } + public PreeminentCaptain(final PreeminentCaptain card) { + super(card); + } - @Override - public PreeminentCaptain copy() { - return new PreeminentCaptain(this); - } + @Override + public PreeminentCaptain copy() { + return new PreeminentCaptain(this); + } } class PreeminentCaptainEffect extends OneShotEffect { - public PreeminentCaptainEffect() { - super(Outcome.PutCreatureInPlay); - this.staticText = "put a Soldier creature card from your hand onto the battlefield tapped and attacking."; - } + public PreeminentCaptainEffect() { + super(Outcome.PutCreatureInPlay); + this.staticText = "put a Soldier creature card from your hand onto the battlefield tapped and attacking."; + } - public PreeminentCaptainEffect(final PreeminentCaptainEffect effect) { - super(effect); - } + public PreeminentCaptainEffect(final PreeminentCaptainEffect effect) { + super(effect); + } - @Override - public boolean apply(Game game, Ability source) { - Player player = game.getPlayer(source.getControllerId()); - TargetCardInHand target = new TargetCardInHand(new FilterSoldierCard()); - if (target.canChoose(player.getId(), game) && target.choose(getOutcome(), player.getId(), source.getSourceId(), game)) { - if (target.getTargets().size() > 0) { - UUID cardId = target.getFirstTarget(); - Card card = player.getHand().get(cardId, game); - if (card != null) { - if (card.putOntoBattlefield(game, Zone.HAND, - source.getId(), source.getControllerId())) { - Permanent permanent = game.getPermanent(card.getId()); - permanent.setTapped(true); - TargetDefender def = new TargetDefender(game - .getCombat().getDefenders(), player.getId()); - if (def.choose(getOutcome(), player.getId(), source.getSourceId(), game)) { - // TODO -> If only one option, don't ask, as for - // normal attacking. - if (def.getTargets().size() > 0) { - game.getCombat().declareAttacker( - permanent.getId(), - def.getFirstTarget(), game); - } - } - } - } - return true; - } - } - return false; - } + @Override + public boolean apply(Game game, Ability source) { + Player player = game.getPlayer(source.getControllerId()); + TargetCardInHand target = new TargetCardInHand(new FilterSoldierCard()); + if (target.canChoose(player.getId(), game) && target.choose(getOutcome(), player.getId(), source.getSourceId(), game)) { + if (target.getTargets().size() > 0) { + UUID cardId = target.getFirstTarget(); + Card card = player.getHand().get(cardId, game); + if (card != null) { + if (card.putOntoBattlefield(game, Zone.HAND, + source.getId(), source.getControllerId())) { + Permanent permanent = game.getPermanent(card.getId()); + permanent.setTapped(true); + TargetDefender def = new TargetDefender(game + .getCombat().getDefenders(), player.getId()); + if (def.choose(getOutcome(), player.getId(), source.getSourceId(), game)) { + // TODO -> If only one option, don't ask, as for + // normal attacking. + if (def.getTargets().size() > 0) { + game.getCombat().declareAttacker( + permanent.getId(), + def.getFirstTarget(), game); + } + } + } + } + return true; + } + } + return false; + } - @Override - public PreeminentCaptainEffect copy() { - return new PreeminentCaptainEffect(this); - } + @Override + public PreeminentCaptainEffect copy() { + return new PreeminentCaptainEffect(this); + } } class FilterSoldierCard extends FilterCard { - public FilterSoldierCard() { - this("a soldier creature card."); - } + public FilterSoldierCard() { + this("a soldier creature card."); + } - public FilterSoldierCard(String name) { - super(name); - cardType.add(CardType.CREATURE); - subtype.add("Soldier"); - } + public FilterSoldierCard(String name) { + super(name); + cardType.add(CardType.CREATURE); + subtype.add("Soldier"); + } - public FilterSoldierCard(final FilterSoldierCard filter) { - super(filter); - } + public FilterSoldierCard(final FilterSoldierCard filter) { + super(filter); + } - @Override - public FilterSoldierCard copy() { - return new FilterSoldierCard(this); - } + @Override + public FilterSoldierCard copy() { + return new FilterSoldierCard(this); + } } \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/newphyrexia/Batterskull.java b/Mage.Sets/src/mage/sets/newphyrexia/Batterskull.java index f655c25e8f..7807989da8 100644 --- a/Mage.Sets/src/mage/sets/newphyrexia/Batterskull.java +++ b/Mage.Sets/src/mage/sets/newphyrexia/Batterskull.java @@ -56,7 +56,7 @@ public class Batterskull extends CardImpl { this.expansionSetCode = "NPH"; this.subtype.add("Equipment"); this.addAbility(new LivingWeaponAbility()); - this.addAbility(new SimpleStaticAbility(Constants.Zone.BATTLEFIELD, new BoostEquippedEffect(4, 4))); + this.addAbility(new SimpleStaticAbility(Constants.Zone.BATTLEFIELD, new BoostEquippedEffect(4, 4))); this.addAbility(new SimpleStaticAbility(Constants.Zone.BATTLEFIELD, new GainAbilityAttachedEffect(VigilanceAbility.getInstance(), Constants.AttachmentType.EQUIPMENT))); this.addAbility(new SimpleStaticAbility(Constants.Zone.BATTLEFIELD, new GainAbilityAttachedEffect(LifelinkAbility.getInstance(), Constants.AttachmentType.EQUIPMENT))); this.addAbility(new SimpleActivatedAbility(Constants.Zone.BATTLEFIELD, new ReturnToHandSourceEffect(), new GenericManaCost(3))); diff --git a/Mage.Sets/src/mage/sets/newphyrexia/BladeSplicer.java b/Mage.Sets/src/mage/sets/newphyrexia/BladeSplicer.java index 67c51f2c1d..ef848ab207 100644 --- a/Mage.Sets/src/mage/sets/newphyrexia/BladeSplicer.java +++ b/Mage.Sets/src/mage/sets/newphyrexia/BladeSplicer.java @@ -61,7 +61,7 @@ public class BladeSplicer extends CardImpl { this.expansionSetCode = "NPH"; this.subtype.add("Human"); this.subtype.add("Artificer"); - this.color.setWhite(true); + this.color.setWhite(true); this.power = new MageInt(1); this.toughness = new MageInt(1); this.addAbility(new EntersBattlefieldTriggeredAbility(new CreateTokenEffect(new GolemToken()))); diff --git a/Mage.Sets/src/mage/sets/newphyrexia/CagedSun.java b/Mage.Sets/src/mage/sets/newphyrexia/CagedSun.java index a405c3895a..a2c7d231b5 100644 --- a/Mage.Sets/src/mage/sets/newphyrexia/CagedSun.java +++ b/Mage.Sets/src/mage/sets/newphyrexia/CagedSun.java @@ -62,10 +62,10 @@ public class CagedSun extends CardImpl { // As Caged Sun enters the battlefield, choose a color. this.addAbility(new EntersBattlefieldAbility(new CagedSunEffect1())); - + // Creatures you control of the chosen color get +1/+1. this.addAbility(new SimpleStaticAbility(Constants.Zone.BATTLEFIELD, new CagedSunEffect2())); - + // Whenever a land's ability adds one or more mana of the chosen color to your mana pool, add one additional mana of that color to your mana pool. this.addAbility(new CagedSunTriggeredAbility()); } @@ -82,58 +82,58 @@ public class CagedSun extends CardImpl { class CagedSunEffect1 extends OneShotEffect { - public CagedSunEffect1() { - super(Constants.Outcome.BoostCreature); - staticText = "As {this} enters the battlefield, choose a color"; - } + public CagedSunEffect1() { + super(Constants.Outcome.BoostCreature); + staticText = "As {this} enters the battlefield, choose a color"; + } - public CagedSunEffect1(final CagedSunEffect1 effect) { - super(effect); - } + public CagedSunEffect1(final CagedSunEffect1 effect) { + super(effect); + } - @Override - public boolean apply(Game game, Ability source) { - Player player = game.getPlayer(source.getControllerId()); - Permanent permanent = game.getPermanent(source.getSourceId()); - if (player != null && permanent != null) { - ChoiceColor colorChoice = new ChoiceColor(); - if (player.choose(Constants.Outcome.BoostCreature, colorChoice, game)) { - game.informPlayers(permanent.getName() + ": " + player.getName() + " has chosen " + colorChoice.getChoice()); - game.getState().setValue(permanent.getId() + "_color", colorChoice.getColor()); - } - } - return false; - } + @Override + public boolean apply(Game game, Ability source) { + Player player = game.getPlayer(source.getControllerId()); + Permanent permanent = game.getPermanent(source.getSourceId()); + if (player != null && permanent != null) { + ChoiceColor colorChoice = new ChoiceColor(); + if (player.choose(Constants.Outcome.BoostCreature, colorChoice, game)) { + game.informPlayers(permanent.getName() + ": " + player.getName() + " has chosen " + colorChoice.getChoice()); + game.getState().setValue(permanent.getId() + "_color", colorChoice.getColor()); + } + } + return false; + } - @Override - public CagedSunEffect1 copy() { - return new CagedSunEffect1(this); - } + @Override + public CagedSunEffect1 copy() { + return new CagedSunEffect1(this); + } } class CagedSunEffect2 extends ContinuousEffectImpl { - private static final FilterCreaturePermanent filter = new FilterCreaturePermanent(); + private static final FilterCreaturePermanent filter = new FilterCreaturePermanent(); - public CagedSunEffect2() { - super(Duration.WhileOnBattlefield, Constants.Layer.PTChangingEffects_7, Constants.SubLayer.ModifyPT_7c, Constants.Outcome.BoostCreature); - staticText = "Creatures you control of the chosen color get +1/+1"; - } + public CagedSunEffect2() { + super(Duration.WhileOnBattlefield, Constants.Layer.PTChangingEffects_7, Constants.SubLayer.ModifyPT_7c, Constants.Outcome.BoostCreature); + staticText = "Creatures you control of the chosen color get +1/+1"; + } - public CagedSunEffect2(final CagedSunEffect2 effect) { - super(effect); - } + public CagedSunEffect2(final CagedSunEffect2 effect) { + super(effect); + } - @Override - public CagedSunEffect2 copy() { - return new CagedSunEffect2(this); - } + @Override + public CagedSunEffect2 copy() { + return new CagedSunEffect2(this); + } - @Override - public boolean apply(Game game, Ability source) { - Permanent permanent = game.getPermanent(source.getSourceId()); - if (permanent != null) { + @Override + public boolean apply(Game game, Ability source) { + Permanent permanent = game.getPermanent(source.getSourceId()); + if (permanent != null) { ObjectColor color = (ObjectColor) game.getState().getValue(permanent.getId() + "_color"); if (color != null) { for (Permanent perm: game.getBattlefield().getAllActivePermanents(filter, source.getControllerId(), game)) { @@ -144,48 +144,48 @@ class CagedSunEffect2 extends ContinuousEffectImpl { } } } - return true; - } + return true; + } } class CagedSunTriggeredAbility extends TriggeredManaAbility { - private static final String staticText = "Whenever a land's ability adds one or more mana of the chosen color to your mana pool, add one additional mana of that color to your mana pool."; + private static final String staticText = "Whenever a land's ability adds one or more mana of the chosen color to your mana pool, add one additional mana of that color to your mana pool."; - public CagedSunTriggeredAbility() { - super(Zone.BATTLEFIELD, new CagedSunEffect()); - } + public CagedSunTriggeredAbility() { + super(Zone.BATTLEFIELD, new CagedSunEffect()); + } - public CagedSunTriggeredAbility(CagedSunTriggeredAbility ability) { - super(ability); - } + public CagedSunTriggeredAbility(CagedSunTriggeredAbility ability) { + super(ability); + } - @Override - public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == GameEvent.EventType.MANA_ADDED && event.getPlayerId().equals(controllerId)) { - Permanent permanent = game.getPermanent(event.getTargetId()); - if (permanent == null) { - permanent = (Permanent) game.getLastKnownInformation(event.getTargetId(), Zone.BATTLEFIELD); - } - if (permanent != null && permanent.getCardType().contains(CardType.LAND)) { + @Override + public boolean checkTrigger(GameEvent event, Game game) { + if (event.getType() == GameEvent.EventType.MANA_ADDED && event.getPlayerId().equals(controllerId)) { + Permanent permanent = game.getPermanent(event.getTargetId()); + if (permanent == null) { + permanent = (Permanent) game.getLastKnownInformation(event.getTargetId(), Zone.BATTLEFIELD); + } + if (permanent != null && permanent.getCardType().contains(CardType.LAND)) { ObjectColor color = (ObjectColor) game.getState().getValue(this.sourceId + "_color"); if (color != null && event.getData().contains(color.toString())) return true; - } - } - return false; - } + } + } + return false; + } - @Override - public CagedSunTriggeredAbility copy() { - return new CagedSunTriggeredAbility(this); - } + @Override + public CagedSunTriggeredAbility copy() { + return new CagedSunTriggeredAbility(this); + } - @Override - public String getRule() { - return staticText; - } + @Override + public String getRule() { + return staticText; + } } @@ -195,11 +195,11 @@ class CagedSunEffect extends ManaEffect { super(); staticText = "add one additional mana of that color to your mana pool"; } - + public CagedSunEffect(final CagedSunEffect effect) { super(effect); } - + @Override public boolean apply(Game game, Ability source) { Player player = game.getPlayer(source.getControllerId()); @@ -223,5 +223,5 @@ class CagedSunEffect extends ManaEffect { public CagedSunEffect copy() { return new CagedSunEffect(this); } - + } diff --git a/Mage.Sets/src/mage/sets/newphyrexia/CathedralMembrane.java b/Mage.Sets/src/mage/sets/newphyrexia/CathedralMembrane.java index 3f54ab7784..ef2641dcbe 100644 --- a/Mage.Sets/src/mage/sets/newphyrexia/CathedralMembrane.java +++ b/Mage.Sets/src/mage/sets/newphyrexia/CathedralMembrane.java @@ -64,11 +64,11 @@ public class CathedralMembrane extends CardImpl { // ({WP} can be paid with either {W} or 2 life.) this.addAbility(DefenderAbility.getInstance()); - + // When Cathedral Membrane dies during combat, it deals 6 damage to each creature it blocked this combat. this.addWatcher(new CathedralMembraneWatcher()); this.addAbility(new CathedralMembraneAbility()); - + } public CathedralMembrane(final CathedralMembrane card) { @@ -83,21 +83,21 @@ public class CathedralMembrane extends CardImpl { class CathedralMembraneAbility extends ZoneChangeTriggeredAbility { - public CathedralMembraneAbility() { - super(Zone.BATTLEFIELD, Zone.GRAVEYARD, new CathedralMembraneEffect(), "When {this} dies during combat, ", false); - } + public CathedralMembraneAbility() { + super(Zone.BATTLEFIELD, Zone.GRAVEYARD, new CathedralMembraneEffect(), "When {this} dies during combat, ", false); + } - public CathedralMembraneAbility(CathedralMembraneAbility ability) { - super(ability); - } - - @Override - public CathedralMembraneAbility copy() { - return new CathedralMembraneAbility(this); - } + public CathedralMembraneAbility(CathedralMembraneAbility ability) { + super(ability); + } @Override - public boolean checkTrigger(GameEvent event, Game game) { + public CathedralMembraneAbility copy() { + return new CathedralMembraneAbility(this); + } + + @Override + public boolean checkTrigger(GameEvent event, Game game) { if (super.checkTrigger(event, game)) { if (game.getPhase().getType() == TurnPhase.COMBAT) { return true; @@ -110,66 +110,66 @@ class CathedralMembraneAbility extends ZoneChangeTriggeredAbility { - public CathedralMembraneEffect() { - super(Constants.Outcome.Damage); - staticText = "it deals 6 damage to each creature it blocked this combat"; - } + public CathedralMembraneEffect() { + super(Constants.Outcome.Damage); + staticText = "it deals 6 damage to each creature it blocked this combat"; + } - public CathedralMembraneEffect(final CathedralMembraneEffect effect) { - super(effect); - } + public CathedralMembraneEffect(final CathedralMembraneEffect effect) { + super(effect); + } - @Override - public CathedralMembraneEffect copy() { - return new CathedralMembraneEffect(this); - } + @Override + public CathedralMembraneEffect copy() { + return new CathedralMembraneEffect(this); + } - @Override - public boolean apply(Game game, Ability source) { - CathedralMembraneWatcher watcher = (CathedralMembraneWatcher) game.getState().getWatchers().get("CathedralMembraneWatcher", source.getSourceId()); - if (watcher != null) { - for (UUID uuid : watcher.blockedCreatures) { - Permanent permanent = game.getPermanent(uuid); + @Override + public boolean apply(Game game, Ability source) { + CathedralMembraneWatcher watcher = (CathedralMembraneWatcher) game.getState().getWatchers().get("CathedralMembraneWatcher", source.getSourceId()); + if (watcher != null) { + for (UUID uuid : watcher.blockedCreatures) { + Permanent permanent = game.getPermanent(uuid); if (permanent != null) { permanent.damage(6, source.getSourceId(), game, true, false); } - } - } - return true; - } + } + } + return true; + } } class CathedralMembraneWatcher extends WatcherImpl { - public List blockedCreatures = new ArrayList(); + public List blockedCreatures = new ArrayList(); - public CathedralMembraneWatcher() { - super("CathedralMembraneWatcher", WatcherScope.CARD); - } + public CathedralMembraneWatcher() { + super("CathedralMembraneWatcher", WatcherScope.CARD); + } - public CathedralMembraneWatcher(final CathedralMembraneWatcher watcher) { - super(watcher); + public CathedralMembraneWatcher(final CathedralMembraneWatcher watcher) { + super(watcher); this.blockedCreatures = watcher.blockedCreatures; - } + } - @Override - public CathedralMembraneWatcher copy() { - return new CathedralMembraneWatcher(this); - } + @Override + public CathedralMembraneWatcher copy() { + return new CathedralMembraneWatcher(this); + } - @Override - public void watch(GameEvent event, Game game) { + @Override + public void watch(GameEvent event, Game game) { if (event.getType() == GameEvent.EventType.BLOCKER_DECLARED && event.getSourceId().equals(sourceId)) { if (!blockedCreatures.contains(event.getTargetId())) { blockedCreatures.add(event.getTargetId()); } } - } + } - @Override - public void reset() { - super.reset(); - blockedCreatures.clear(); - } + @Override + public void reset() { + super.reset(); + blockedCreatures.clear(); + } } diff --git a/Mage.Sets/src/mage/sets/newphyrexia/ChancellorOfTheAnnex.java b/Mage.Sets/src/mage/sets/newphyrexia/ChancellorOfTheAnnex.java index b17b062da3..f58be9d443 100644 --- a/Mage.Sets/src/mage/sets/newphyrexia/ChancellorOfTheAnnex.java +++ b/Mage.Sets/src/mage/sets/newphyrexia/ChancellorOfTheAnnex.java @@ -62,11 +62,11 @@ public class ChancellorOfTheAnnex extends CardImpl { // You may reveal this card from your opening hand. If you do, when each opponent casts his or her first spell of the game, counter that spell unless that player pays {1}. this.addAbility(new ChancellorAbility(new ChancellorOfTheAnnexEffect())); - + this.addAbility(FlyingAbility.getInstance()); - + // Whenever an opponent casts a spell, counter it unless that player pays {1}. - this.addAbility(new OpponentCastsSpellTriggeredAbility(new CounterUnlessPaysEffect(new GenericManaCost(1)), false)); + this.addAbility(new OpponentCastsSpellTriggeredAbility(new CounterUnlessPaysEffect(new GenericManaCost(1)), false)); } public ChancellorOfTheAnnex(final ChancellorOfTheAnnex card) { @@ -81,17 +81,17 @@ public class ChancellorOfTheAnnex extends CardImpl { class ChancellorOfTheAnnexEffect extends OneShotEffect { - public ChancellorOfTheAnnexEffect () { - super(Outcome.Benefit); - staticText = "when each opponent casts his or her first spell of the game, counter that spell unless that player pays {1}"; - } + public ChancellorOfTheAnnexEffect () { + super(Outcome.Benefit); + staticText = "when each opponent casts his or her first spell of the game, counter that spell unless that player pays {1}"; + } - public ChancellorOfTheAnnexEffect(ChancellorOfTheAnnexEffect effect) { - super(effect); - } + public ChancellorOfTheAnnexEffect(ChancellorOfTheAnnexEffect effect) { + super(effect); + } - @Override - public boolean apply(Game game, Ability source) { + @Override + public boolean apply(Game game, Ability source) { for (UUID opponentId : game.getOpponents(source.getControllerId())) { DelayedTriggeredAbility ability = new ChancellorOfTheAnnexDelayedTriggeredAbility(opponentId); ability.setSourceId(source.getSourceId()); @@ -99,40 +99,40 @@ class ChancellorOfTheAnnexEffect extends OneShotEffect { private UUID playerId; - - ChancellorOfTheAnnexDelayedTriggeredAbility (UUID playerId) { - super(new CounterUnlessPaysEffect(new GenericManaCost(1))); + + ChancellorOfTheAnnexDelayedTriggeredAbility (UUID playerId) { + super(new CounterUnlessPaysEffect(new GenericManaCost(1))); this.playerId = playerId; - } + } - ChancellorOfTheAnnexDelayedTriggeredAbility(ChancellorOfTheAnnexDelayedTriggeredAbility ability) { - super(ability); + ChancellorOfTheAnnexDelayedTriggeredAbility(ChancellorOfTheAnnexDelayedTriggeredAbility ability) { + super(ability); this.playerId = ability.playerId; - } + } - @Override - public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == GameEvent.EventType.SPELL_CAST && event.getPlayerId().equals(playerId)) { + @Override + public boolean checkTrigger(GameEvent event, Game game) { + if (event.getType() == GameEvent.EventType.SPELL_CAST && event.getPlayerId().equals(playerId)) { this.getEffects().get(0).setTargetPointer(new FixedTarget(event.getTargetId())); - return true; - } - return false; - } - - @Override - public ChancellorOfTheAnnexDelayedTriggeredAbility copy() { - return new ChancellorOfTheAnnexDelayedTriggeredAbility(this); - } + return true; + } + return false; + } + + @Override + public ChancellorOfTheAnnexDelayedTriggeredAbility copy() { + return new ChancellorOfTheAnnexDelayedTriggeredAbility(this); + } } diff --git a/Mage.Sets/src/mage/sets/newphyrexia/ChancellorOfTheDross.java b/Mage.Sets/src/mage/sets/newphyrexia/ChancellorOfTheDross.java index 6eb8ffd706..731406b16e 100644 --- a/Mage.Sets/src/mage/sets/newphyrexia/ChancellorOfTheDross.java +++ b/Mage.Sets/src/mage/sets/newphyrexia/ChancellorOfTheDross.java @@ -49,7 +49,7 @@ import mage.game.events.GameEvent; public class ChancellorOfTheDross extends CardImpl { private static String abilityText = "at the beginning of the first upkeep, each opponent loses 3 life, then you gain life equal to the life lost this way"; - + public ChancellorOfTheDross(UUID ownerId) { super(ownerId, 54, "Chancellor of the Dross", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{4}{B}{B}{B}"); this.expansionSetCode = "NPH"; @@ -61,7 +61,7 @@ public class ChancellorOfTheDross extends CardImpl { // You may reveal this card from your opening hand. If you do, at the beginning of the first upkeep, each opponent loses 3 life, then you gain life equal to the life lost this way. this.addAbility(new ChancellorAbility(new ChancellorOfTheDrossDelayedTriggeredAbility(), abilityText)); - + this.addAbility(FlyingAbility.getInstance()); this.addAbility(LifelinkAbility.getInstance()); } @@ -78,40 +78,40 @@ public class ChancellorOfTheDross extends CardImpl { class ChancellorOfTheDrossDelayedTriggeredAbility extends DelayedTriggeredAbility { - ChancellorOfTheDrossDelayedTriggeredAbility () { - super(new ChancellorOfTheDrossEffect()); - } + ChancellorOfTheDrossDelayedTriggeredAbility () { + super(new ChancellorOfTheDrossEffect()); + } - ChancellorOfTheDrossDelayedTriggeredAbility(ChancellorOfTheDrossDelayedTriggeredAbility ability) { - super(ability); - } + ChancellorOfTheDrossDelayedTriggeredAbility(ChancellorOfTheDrossDelayedTriggeredAbility ability) { + super(ability); + } - @Override - public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == GameEvent.EventType.UPKEEP_STEP_PRE) { - return true; - } - return false; - } - @Override - public ChancellorOfTheDrossDelayedTriggeredAbility copy() { - return new ChancellorOfTheDrossDelayedTriggeredAbility(this); - } + @Override + public boolean checkTrigger(GameEvent event, Game game) { + if (event.getType() == GameEvent.EventType.UPKEEP_STEP_PRE) { + return true; + } + return false; + } + @Override + public ChancellorOfTheDrossDelayedTriggeredAbility copy() { + return new ChancellorOfTheDrossDelayedTriggeredAbility(this); + } } class ChancellorOfTheDrossEffect extends OneShotEffect { - ChancellorOfTheDrossEffect () { - super(Outcome.Benefit); - staticText = "each opponent loses 3 life, then you gain life equal to the life lost this way"; - } + ChancellorOfTheDrossEffect () { + super(Outcome.Benefit); + staticText = "each opponent loses 3 life, then you gain life equal to the life lost this way"; + } - ChancellorOfTheDrossEffect(ChancellorOfTheDrossEffect effect) { - super(effect); - } + ChancellorOfTheDrossEffect(ChancellorOfTheDrossEffect effect) { + super(effect); + } - @Override - public boolean apply(Game game, Ability source) { + @Override + public boolean apply(Game game, Ability source) { int loseLife = 0; for (UUID opponentId : game.getOpponents(source.getControllerId())) { loseLife += game.getPlayer(opponentId).loseLife(3, game); @@ -119,11 +119,11 @@ class ChancellorOfTheDrossEffect extends OneShotEffect 0) game.getPlayer(source.getControllerId()).gainLife(loseLife, game); return true; - } + } - @Override - public ChancellorOfTheDrossEffect copy() { - return new ChancellorOfTheDrossEffect(this); - } + @Override + public ChancellorOfTheDrossEffect copy() { + return new ChancellorOfTheDrossEffect(this); + } } diff --git a/Mage.Sets/src/mage/sets/newphyrexia/ChancellorOfTheForge.java b/Mage.Sets/src/mage/sets/newphyrexia/ChancellorOfTheForge.java index c8ac3a7c9c..0d721ef701 100644 --- a/Mage.Sets/src/mage/sets/newphyrexia/ChancellorOfTheForge.java +++ b/Mage.Sets/src/mage/sets/newphyrexia/ChancellorOfTheForge.java @@ -69,7 +69,7 @@ public class ChancellorOfTheForge extends CardImpl { // You may reveal this card from your opening hand. If you do, at the beginning of the first upkeep, put a 1/1 red Goblin creature token with haste onto the battlefield. this.addAbility(new ChancellorAbility(new ChancellorOfTheForgeDelayedTriggeredAbility(), abilityText)); - + // When Chancellor of the Forge enters the battlefield, put X 1/1 red Goblin creature tokens with haste onto the battlefield, where X is the number of creatures you control. DynamicValue value = new PermanentsOnBattlefieldCount(filter); this.addAbility(new EntersBattlefieldTriggeredAbility(new CreateTokenEffect(new GoblinToken(), value), false)); @@ -87,35 +87,35 @@ public class ChancellorOfTheForge extends CardImpl { class ChancellorOfTheForgeDelayedTriggeredAbility extends DelayedTriggeredAbility { - ChancellorOfTheForgeDelayedTriggeredAbility () { - super(new CreateTokenEffect(new GoblinToken())); - } + ChancellorOfTheForgeDelayedTriggeredAbility () { + super(new CreateTokenEffect(new GoblinToken())); + } - ChancellorOfTheForgeDelayedTriggeredAbility(ChancellorOfTheForgeDelayedTriggeredAbility ability) { - super(ability); - } + ChancellorOfTheForgeDelayedTriggeredAbility(ChancellorOfTheForgeDelayedTriggeredAbility ability) { + super(ability); + } - @Override - public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == GameEvent.EventType.UPKEEP_STEP_PRE) { - return true; - } - return false; - } - @Override - public ChancellorOfTheForgeDelayedTriggeredAbility copy() { - return new ChancellorOfTheForgeDelayedTriggeredAbility(this); - } + @Override + public boolean checkTrigger(GameEvent event, Game game) { + if (event.getType() == GameEvent.EventType.UPKEEP_STEP_PRE) { + return true; + } + return false; + } + @Override + public ChancellorOfTheForgeDelayedTriggeredAbility copy() { + return new ChancellorOfTheForgeDelayedTriggeredAbility(this); + } } class GoblinToken extends Token { - public GoblinToken() { - super("Goblin", "1/1 red Goblin creature token with haste"); - cardType.add(CardType.CREATURE); + public GoblinToken() { + super("Goblin", "1/1 red Goblin creature token with haste"); + cardType.add(CardType.CREATURE); color.setRed(true); - subtype.add("Goblin"); - power = new MageInt(1); - toughness = new MageInt(1); + subtype.add("Goblin"); + power = new MageInt(1); + toughness = new MageInt(1); addAbility(HasteAbility.getInstance()); - } + } } diff --git a/Mage.Sets/src/mage/sets/newphyrexia/ChancellorOfTheSpires.java b/Mage.Sets/src/mage/sets/newphyrexia/ChancellorOfTheSpires.java index fdf82f05bd..6873e6a4cb 100644 --- a/Mage.Sets/src/mage/sets/newphyrexia/ChancellorOfTheSpires.java +++ b/Mage.Sets/src/mage/sets/newphyrexia/ChancellorOfTheSpires.java @@ -56,9 +56,9 @@ import mage.target.common.TargetCardInOpponentsGraveyard; public class ChancellorOfTheSpires extends CardImpl { private static final String abilityText = "at the beginning of the first upkeep, each opponent puts the top seven cards of his or her library into his or her graveyard"; - + private static final FilterCard filter = new FilterCard("instant or sorcery card from an opponent's graveyard"); - + static { filter.getCardType().add(CardType.INSTANT); filter.getCardType().add(CardType.SORCERY); @@ -76,9 +76,9 @@ public class ChancellorOfTheSpires extends CardImpl { // You may reveal this card from your opening hand. If you do, at the beginning of the first upkeep, each opponent puts the top seven cards of his or her library into his or her graveyard. this.addAbility(new ChancellorAbility(new ChancellorOfTheSpiresDelayedTriggeredAbility(), abilityText)); - + this.addAbility(FlyingAbility.getInstance()); - + // When Chancellor of the Spires enters the battlefield, you may cast target instant or sorcery card from an opponent's graveyard without paying its mana cost. Ability ability = new EntersBattlefieldTriggeredAbility(new PlayTargetWithoutPayingManaEffect(), true); ability.addTarget(new TargetCardInOpponentsGraveyard(filter)); @@ -97,40 +97,40 @@ public class ChancellorOfTheSpires extends CardImpl { class ChancellorOfTheSpiresDelayedTriggeredAbility extends DelayedTriggeredAbility { - ChancellorOfTheSpiresDelayedTriggeredAbility () { - super(new ChancellorOfTheSpiresEffect()); - } + ChancellorOfTheSpiresDelayedTriggeredAbility () { + super(new ChancellorOfTheSpiresEffect()); + } - ChancellorOfTheSpiresDelayedTriggeredAbility(ChancellorOfTheSpiresDelayedTriggeredAbility ability) { - super(ability); - } + ChancellorOfTheSpiresDelayedTriggeredAbility(ChancellorOfTheSpiresDelayedTriggeredAbility ability) { + super(ability); + } - @Override - public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == GameEvent.EventType.UPKEEP_STEP_PRE) { - return true; - } - return false; - } - @Override - public ChancellorOfTheSpiresDelayedTriggeredAbility copy() { - return new ChancellorOfTheSpiresDelayedTriggeredAbility(this); - } + @Override + public boolean checkTrigger(GameEvent event, Game game) { + if (event.getType() == GameEvent.EventType.UPKEEP_STEP_PRE) { + return true; + } + return false; + } + @Override + public ChancellorOfTheSpiresDelayedTriggeredAbility copy() { + return new ChancellorOfTheSpiresDelayedTriggeredAbility(this); + } } class ChancellorOfTheSpiresEffect extends OneShotEffect { - ChancellorOfTheSpiresEffect () { - super(Outcome.Benefit); - staticText = "each opponent puts the top seven cards of his or her library into his or her graveyard"; - } + ChancellorOfTheSpiresEffect () { + super(Outcome.Benefit); + staticText = "each opponent puts the top seven cards of his or her library into his or her graveyard"; + } - ChancellorOfTheSpiresEffect(ChancellorOfTheSpiresEffect effect) { - super(effect); - } + ChancellorOfTheSpiresEffect(ChancellorOfTheSpiresEffect effect) { + super(effect); + } - @Override - public boolean apply(Game game, Ability source) { + @Override + public boolean apply(Game game, Ability source) { for (UUID opponentId : game.getOpponents(source.getControllerId())) { Player player = game.getPlayer(opponentId); if (player != null) { @@ -145,12 +145,12 @@ class ChancellorOfTheSpiresEffect extends OneShotEffect { // You may reveal this card from your opening hand. If you do, at the beginning of your first main phase, add {G} to your mana pool. this.addAbility(new ChancellorAbility(new ChancellorOfTheTangleDelayedTriggeredAbility(), abilityText)); - + this.addAbility(VigilanceAbility.getInstance()); this.addAbility(ReachAbility.getInstance()); } @@ -77,23 +77,23 @@ public class ChancellorOfTheTangle extends CardImpl { class ChancellorOfTheTangleDelayedTriggeredAbility extends DelayedTriggeredAbility { - ChancellorOfTheTangleDelayedTriggeredAbility () { - super(new BasicManaEffect(Mana.GreenMana)); - } + ChancellorOfTheTangleDelayedTriggeredAbility () { + super(new BasicManaEffect(Mana.GreenMana)); + } - ChancellorOfTheTangleDelayedTriggeredAbility(ChancellorOfTheTangleDelayedTriggeredAbility ability) { - super(ability); - } + ChancellorOfTheTangleDelayedTriggeredAbility(ChancellorOfTheTangleDelayedTriggeredAbility ability) { + super(ability); + } - @Override - public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == GameEvent.EventType.PRECOMBAT_MAIN_PHASE_PRE && game.getActivePlayerId().equals(controllerId)) { - return true; - } - return false; - } - @Override - public ChancellorOfTheTangleDelayedTriggeredAbility copy() { - return new ChancellorOfTheTangleDelayedTriggeredAbility(this); - } + @Override + public boolean checkTrigger(GameEvent event, Game game) { + if (event.getType() == GameEvent.EventType.PRECOMBAT_MAIN_PHASE_PRE && game.getActivePlayerId().equals(controllerId)) { + return true; + } + return false; + } + @Override + public ChancellorOfTheTangleDelayedTriggeredAbility copy() { + return new ChancellorOfTheTangleDelayedTriggeredAbility(this); + } } diff --git a/Mage.Sets/src/mage/sets/newphyrexia/Despise.java b/Mage.Sets/src/mage/sets/newphyrexia/Despise.java index 1d52ddf628..362b6f3407 100644 --- a/Mage.Sets/src/mage/sets/newphyrexia/Despise.java +++ b/Mage.Sets/src/mage/sets/newphyrexia/Despise.java @@ -72,46 +72,46 @@ public class Despise extends CardImpl { class DespiseEffect extends OneShotEffect { - private static final FilterCard filter = new FilterCard("creature or planeswalker card"); + private static final FilterCard filter = new FilterCard("creature or planeswalker card"); - static { - filter.getCardType().add(CardType.CREATURE); - filter.getCardType().add(CardType.PLANESWALKER); + static { + filter.getCardType().add(CardType.CREATURE); + filter.getCardType().add(CardType.PLANESWALKER); filter.setScopeCardType(Filter.ComparisonScope.Any); - } + } - public DespiseEffect() { - super(Constants.Outcome.Discard); - staticText = "Target opponent reveals his or her hand. You choose a creature or planeswalker card from it. That player discards that card"; - } + public DespiseEffect() { + super(Constants.Outcome.Discard); + staticText = "Target opponent reveals his or her hand. You choose a creature or planeswalker card from it. That player discards that card"; + } - public DespiseEffect(final DespiseEffect effect) { - super(effect); - } + public DespiseEffect(final DespiseEffect effect) { + super(effect); + } - @Override - public boolean apply(Game game, Ability source) { - Player player = game.getPlayer(source.getFirstTarget()); - if (player != null) { - player.revealCards("Despise", player.getHand(), game); - Player you = game.getPlayer(source.getControllerId()); - if (you != null) { - TargetCard target = new TargetCard(Constants.Zone.PICK, filter); + @Override + public boolean apply(Game game, Ability source) { + Player player = game.getPlayer(source.getFirstTarget()); + if (player != null) { + player.revealCards("Despise", player.getHand(), game); + Player you = game.getPlayer(source.getControllerId()); + if (you != null) { + TargetCard target = new TargetCard(Constants.Zone.PICK, filter); target.setRequired(true); - if (you.choose(Constants.Outcome.Benefit, player.getHand(), target, game)) { - Card card = player.getHand().get(target.getFirstTarget(), game); - if (card != null) { - return player.discard(card, source, game); - } - } - } - } - return false; - } + if (you.choose(Constants.Outcome.Benefit, player.getHand(), target, game)) { + Card card = player.getHand().get(target.getFirstTarget(), game); + if (card != null) { + return player.discard(card, source, game); + } + } + } + } + return false; + } - @Override - public DespiseEffect copy() { - return new DespiseEffect(this); - } + @Override + public DespiseEffect copy() { + return new DespiseEffect(this); + } } diff --git a/Mage.Sets/src/mage/sets/newphyrexia/Dismember.java b/Mage.Sets/src/mage/sets/newphyrexia/Dismember.java index 2c4a3c0e32..c8e364a1c8 100644 --- a/Mage.Sets/src/mage/sets/newphyrexia/Dismember.java +++ b/Mage.Sets/src/mage/sets/newphyrexia/Dismember.java @@ -46,7 +46,7 @@ public class Dismember extends CardImpl { public Dismember (UUID ownerId) { super(ownerId, 57, "Dismember", Rarity.UNCOMMON, new CardType[]{CardType.INSTANT}, "{1}{BP}{BP}"); this.expansionSetCode = "NPH"; - this.color.setBlack(true); + this.color.setBlack(true); this.getSpellAbility().addEffect(new BoostTargetEffect(-5, -5, Duration.EndOfTurn)); this.getSpellAbility().addTarget(new TargetCreaturePermanent()); } diff --git a/Mage.Sets/src/mage/sets/newphyrexia/Dispatch.java b/Mage.Sets/src/mage/sets/newphyrexia/Dispatch.java index 9812d04954..676fbd29c0 100644 --- a/Mage.Sets/src/mage/sets/newphyrexia/Dispatch.java +++ b/Mage.Sets/src/mage/sets/newphyrexia/Dispatch.java @@ -47,7 +47,7 @@ public class Dispatch extends CardImpl { public Dispatch (UUID ownerId) { super(ownerId, 7, "Dispatch", Rarity.UNCOMMON, new CardType[]{CardType.INSTANT}, "{W}"); this.expansionSetCode = "NPH"; - this.color.setWhite(true); + this.color.setWhite(true); 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().addTarget(new TargetCreaturePermanent()); diff --git a/Mage.Sets/src/mage/sets/newphyrexia/EleshNornGrandCenobite.java b/Mage.Sets/src/mage/sets/newphyrexia/EleshNornGrandCenobite.java index 3b9eb4ce7b..496de6dea4 100644 --- a/Mage.Sets/src/mage/sets/newphyrexia/EleshNornGrandCenobite.java +++ b/Mage.Sets/src/mage/sets/newphyrexia/EleshNornGrandCenobite.java @@ -50,7 +50,7 @@ public class EleshNornGrandCenobite extends CardImpl { this.expansionSetCode = "NPH"; this.supertype.add("Legendary"); this.subtype.add("Praetor"); - this.color.setWhite(true); + this.color.setWhite(true); this.power = new MageInt(4); this.toughness = new MageInt(7); this.addAbility(VigilanceAbility.getInstance()); diff --git a/Mage.Sets/src/mage/sets/newphyrexia/Enslave.java b/Mage.Sets/src/mage/sets/newphyrexia/Enslave.java index b571bf877f..ca6c2e0eb3 100644 --- a/Mage.Sets/src/mage/sets/newphyrexia/Enslave.java +++ b/Mage.Sets/src/mage/sets/newphyrexia/Enslave.java @@ -57,12 +57,12 @@ public class Enslave extends CardImpl { super(ownerId, 58, "Enslave", Rarity.UNCOMMON, new CardType[]{CardType.ENCHANTMENT}, "{4}{B}{B}"); this.expansionSetCode = "NPH"; this.subtype.add("Aura"); - this.color.setBlack(true); + this.color.setBlack(true); TargetPermanent auraTarget = new TargetCreaturePermanent(); - this.getSpellAbility().addTarget(auraTarget); - this.getSpellAbility().addEffect(new AttachEffect(Constants.Outcome.BoostCreature)); - Ability ability = new EnchantAbility(auraTarget.getTargetName()); - this.addAbility(ability); + this.getSpellAbility().addTarget(auraTarget); + this.getSpellAbility().addEffect(new AttachEffect(Constants.Outcome.BoostCreature)); + Ability ability = new EnchantAbility(auraTarget.getTargetName()); + this.addAbility(ability); this.addAbility(new SimpleStaticAbility(Constants.Zone.BATTLEFIELD, new ControlEnchantedEffect())); this.addAbility(new BeginningOfUpkeepTriggeredAbility(new EnslaveEffect(), Constants.TargetController.YOU, false)); } diff --git a/Mage.Sets/src/mage/sets/newphyrexia/EntomberExarch.java b/Mage.Sets/src/mage/sets/newphyrexia/EntomberExarch.java index 5fdfa045cf..b07bbd2da8 100644 --- a/Mage.Sets/src/mage/sets/newphyrexia/EntomberExarch.java +++ b/Mage.Sets/src/mage/sets/newphyrexia/EntomberExarch.java @@ -102,21 +102,21 @@ class EntomberExarchEffect extends OneShotEffect { @Override public boolean apply(Game game, Ability source) { Player player = game.getPlayer(source.getFirstTarget()); - if (player != null) { - player.revealCards("Entomber Exarch", player.getHand(), game); - Player you = game.getPlayer(source.getControllerId()); - if (you != null) { - TargetCard target = new TargetCard(Constants.Zone.PICK, filter); + if (player != null) { + player.revealCards("Entomber Exarch", player.getHand(), game); + Player you = game.getPlayer(source.getControllerId()); + if (you != null) { + TargetCard target = new TargetCard(Constants.Zone.PICK, filter); target.setRequired(true); - if (you.choose(Constants.Outcome.Benefit, player.getHand(), target, game)) { - Card card = player.getHand().get(target.getFirstTarget(), game); - if (card != null) { - return player.discard(card, source, game); - } - } - } - } - return false; + if (you.choose(Constants.Outcome.Benefit, player.getHand(), target, game)) { + Card card = player.getHand().get(target.getFirstTarget(), game); + if (card != null) { + return player.discard(card, source, game); + } + } + } + } + return false; } @Override diff --git a/Mage.Sets/src/mage/sets/newphyrexia/ForcedWorship.java b/Mage.Sets/src/mage/sets/newphyrexia/ForcedWorship.java index eeba501234..db742312cc 100644 --- a/Mage.Sets/src/mage/sets/newphyrexia/ForcedWorship.java +++ b/Mage.Sets/src/mage/sets/newphyrexia/ForcedWorship.java @@ -57,12 +57,12 @@ public class ForcedWorship extends CardImpl { super(ownerId, 11, "Forced Worship", Rarity.COMMON, new CardType[]{CardType.ENCHANTMENT}, "{1}{W}"); this.expansionSetCode = "NPH"; this.subtype.add("Aura"); - this.color.setWhite(true); + this.color.setWhite(true); TargetPermanent auraTarget = new TargetCreaturePermanent(); - this.getSpellAbility().addTarget(auraTarget); - this.getSpellAbility().addEffect(new AttachEffect(Constants.Outcome.Detriment)); - Ability ability = new EnchantAbility(auraTarget.getTargetName()); - this.addAbility(ability); + this.getSpellAbility().addTarget(auraTarget); + this.getSpellAbility().addEffect(new AttachEffect(Constants.Outcome.Detriment)); + Ability ability = new EnchantAbility(auraTarget.getTargetName()); + this.addAbility(ability); this.addAbility(new SimpleStaticAbility(Constants.Zone.BATTLEFIELD, new ForcedWorshipEffect())); this.addAbility(new SimpleActivatedAbility(Constants.Zone.BATTLEFIELD, new ReturnToHandSourceEffect(), new ManaCostsImpl("{2}{W}"))); } @@ -80,31 +80,31 @@ public class ForcedWorship extends CardImpl { class ForcedWorshipEffect extends RestrictionEffect { - public ForcedWorshipEffect() { - super(Constants.Duration.WhileOnBattlefield); - staticText = "Enchanted creature can't attack"; - } + public ForcedWorshipEffect() { + super(Constants.Duration.WhileOnBattlefield); + staticText = "Enchanted creature can't attack"; + } - public ForcedWorshipEffect(final ForcedWorshipEffect effect) { - super(effect); - } + public ForcedWorshipEffect(final ForcedWorshipEffect effect) { + super(effect); + } - @Override - public boolean applies(Permanent permanent, Ability source, Game game) { - if (permanent.getAttachments().contains((source.getSourceId()))) { - return true; - } - return false; - } + @Override + public boolean applies(Permanent permanent, Ability source, Game game) { + if (permanent.getAttachments().contains((source.getSourceId()))) { + return true; + } + return false; + } - @Override - public boolean canAttack(Game game) { - return false; - } + @Override + public boolean canAttack(Game game) { + return false; + } - @Override - public ForcedWorshipEffect copy() { - return new ForcedWorshipEffect(this); - } + @Override + public ForcedWorshipEffect copy() { + return new ForcedWorshipEffect(this); + } } \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/newphyrexia/GethsVerdict.java b/Mage.Sets/src/mage/sets/newphyrexia/GethsVerdict.java index 86cff0a879..e852c5c5a0 100644 --- a/Mage.Sets/src/mage/sets/newphyrexia/GethsVerdict.java +++ b/Mage.Sets/src/mage/sets/newphyrexia/GethsVerdict.java @@ -46,7 +46,7 @@ public class GethsVerdict extends CardImpl { public GethsVerdict (UUID ownerId) { super(ownerId, 61, "Geth's Verdict", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{B}{B}"); this.expansionSetCode = "NPH"; - this.color.setBlack(true); + this.color.setBlack(true); this.getSpellAbility().addEffect(new SacrificeEffect(new FilterCreaturePermanent(), 1, "Target player")); this.getSpellAbility().addEffect(new LoseLifeTargetEffect(1)); this.getSpellAbility().addTarget(new TargetPlayer()); diff --git a/Mage.Sets/src/mage/sets/newphyrexia/GitaxianProbe.java b/Mage.Sets/src/mage/sets/newphyrexia/GitaxianProbe.java index 8e7c715491..d03a68c837 100644 --- a/Mage.Sets/src/mage/sets/newphyrexia/GitaxianProbe.java +++ b/Mage.Sets/src/mage/sets/newphyrexia/GitaxianProbe.java @@ -50,7 +50,7 @@ public class GitaxianProbe extends CardImpl { public GitaxianProbe (UUID ownerId) { super(ownerId, 35, "Gitaxian Probe", Rarity.COMMON, new CardType[]{CardType.SORCERY}, "{UP}"); this.expansionSetCode = "NPH"; - this.color.setBlue(true); + this.color.setBlue(true); this.getSpellAbility().addEffect(new GitaxianProbeEffect()); this.getSpellAbility().addEffect(new DrawCardControllerEffect(1)); this.getSpellAbility().addTarget(new TargetPlayer()); diff --git a/Mage.Sets/src/mage/sets/newphyrexia/GlisteningOil.java b/Mage.Sets/src/mage/sets/newphyrexia/GlisteningOil.java index 333c4f40ff..01860ac995 100644 --- a/Mage.Sets/src/mage/sets/newphyrexia/GlisteningOil.java +++ b/Mage.Sets/src/mage/sets/newphyrexia/GlisteningOil.java @@ -61,10 +61,10 @@ public class GlisteningOil extends CardImpl { this.subtype.add("Aura"); this.color.setBlack(true); TargetPermanent auraTarget = new TargetCreaturePermanent(); - this.getSpellAbility().addTarget(auraTarget); - this.getSpellAbility().addEffect(new AttachEffect(Constants.Outcome.BoostCreature)); - Ability ability = new EnchantAbility(auraTarget.getTargetName()); - this.addAbility(ability); + this.getSpellAbility().addTarget(auraTarget); + this.getSpellAbility().addEffect(new AttachEffect(Constants.Outcome.BoostCreature)); + Ability ability = new EnchantAbility(auraTarget.getTargetName()); + this.addAbility(ability); this.addAbility(new SimpleStaticAbility(Constants.Zone.BATTLEFIELD, new GainAbilityAttachedEffect(InfectAbility.getInstance(), Constants.AttachmentType.AURA))); this.addAbility(new BeginningOfUpkeepTriggeredAbility(new GlisteningOilEffect(), Constants.TargetController.YOU, false)); this.addAbility(new DiesTriggeredAbility(new ReturnToHandSourceEffect())); @@ -93,13 +93,13 @@ class GlisteningOilEffect extends OneShotEffect { @Override public boolean apply(Game game, Ability source) { Permanent enchantment = game.getPermanent(source.getSourceId()); - if (enchantment != null && enchantment.getAttachedTo() != null) { - Permanent creature = game.getPermanent(enchantment.getAttachedTo()); - if (creature != null) { - creature.addCounters(CounterType.M1M1.createInstance(), game); - } - } - return true; + if (enchantment != null && enchantment.getAttachedTo() != null) { + Permanent creature = game.getPermanent(enchantment.getAttachedTo()); + if (creature != null) { + creature.addCounters(CounterType.M1M1.createInstance(), game); + } + } + return true; } @Override diff --git a/Mage.Sets/src/mage/sets/newphyrexia/GreenhiltTrainee.java b/Mage.Sets/src/mage/sets/newphyrexia/GreenhiltTrainee.java index 28af55ae7c..b6a31d683a 100644 --- a/Mage.Sets/src/mage/sets/newphyrexia/GreenhiltTrainee.java +++ b/Mage.Sets/src/mage/sets/newphyrexia/GreenhiltTrainee.java @@ -55,7 +55,7 @@ public class GreenhiltTrainee extends CardImpl { this.expansionSetCode = "NPH"; this.subtype.add("Elf"); this.subtype.add("Warrior"); - this.color.setGreen(true); + this.color.setGreen(true); this.power = new MageInt(2); this.toughness = new MageInt(3); Ability ability = new SimpleActivatedAbility(Constants.Zone.BATTLEFIELD, new BoostTargetEffect(4, 4, Constants.Duration.EndOfTurn), new TapSourceCost()); diff --git a/Mage.Sets/src/mage/sets/newphyrexia/HexParasite.java b/Mage.Sets/src/mage/sets/newphyrexia/HexParasite.java index d552df55c3..b7c74b1caf 100644 --- a/Mage.Sets/src/mage/sets/newphyrexia/HexParasite.java +++ b/Mage.Sets/src/mage/sets/newphyrexia/HexParasite.java @@ -77,30 +77,30 @@ public class HexParasite extends CardImpl { class HexParasiteEffect extends OneShotEffect { - HexParasiteEffect ( ) { - super(Outcome.Benefit); - staticText = "Remove up to X counters from target permanent. For each counter removed this way, {this} gets +1/+0 until end of turn"; - } + HexParasiteEffect ( ) { + super(Outcome.Benefit); + staticText = "Remove up to X counters from target permanent. For each counter removed this way, {this} gets +1/+0 until end of turn"; + } - HexParasiteEffect ( HexParasiteEffect effect ) { - super(effect); - } + HexParasiteEffect ( HexParasiteEffect effect ) { + super(effect); + } - @Override - public HexParasiteEffect copy() { - return new HexParasiteEffect(this); - } + @Override + public HexParasiteEffect copy() { + return new HexParasiteEffect(this); + } - @Override - public boolean apply(Game game, Ability source) { - TargetPermanent target = (TargetPermanent)source.getTargets().get(0); - Permanent permanent = game.getPermanent(target.getFirstTarget()); + @Override + public boolean apply(Game game, Ability source) { + TargetPermanent target = (TargetPermanent)source.getTargets().get(0); + Permanent permanent = game.getPermanent(target.getFirstTarget()); Player player = game.getPlayer(source.getControllerId()); - if (permanent != null && player != null) { + if (permanent != null && player != null) { int toRemove = source.getManaCostsToPay().getX(); int removed = 0; - String[] counterNames = permanent.getCounters().keySet().toArray(new String[0]); - for (String counterName : counterNames) { + String[] counterNames = permanent.getCounters().keySet().toArray(new String[0]); + for (String counterName : counterNames) { if (player.chooseUse(Outcome.Neutral, "Do you want to remove " + counterName + " counters?", game)) { if (permanent.getCounters().get(counterName).getCount() == 1 || toRemove == 1) { permanent.getCounters().removeCounter(counterName, 1); @@ -115,11 +115,11 @@ class HexParasiteEffect extends OneShotEffect { } if (removed >= toRemove) break; - } + } game.addEffect(new BoostSourceEffect(removed, 0, Duration.EndOfTurn), source); - return true; - } - return false; - } + return true; + } + return false; + } } diff --git a/Mage.Sets/src/mage/sets/newphyrexia/Hovermyr.java b/Mage.Sets/src/mage/sets/newphyrexia/Hovermyr.java index 37ba5b5b91..c13ed1c91d 100644 --- a/Mage.Sets/src/mage/sets/newphyrexia/Hovermyr.java +++ b/Mage.Sets/src/mage/sets/newphyrexia/Hovermyr.java @@ -46,10 +46,10 @@ public class Hovermyr extends CardImpl { super(ownerId, 138, "Hovermyr", Rarity.COMMON, new CardType[]{CardType.ARTIFACT, CardType.CREATURE}, "{2}"); this.expansionSetCode = "NPH"; this.subtype.add("Myr"); - + this.power = new MageInt(1 ); this.toughness = new MageInt( 2); - + this.addAbility(FlyingAbility.getInstance()); this.addAbility(VigilanceAbility.getInstance()); } diff --git a/Mage.Sets/src/mage/sets/newphyrexia/KarnLiberated.java b/Mage.Sets/src/mage/sets/newphyrexia/KarnLiberated.java index 5aac72da02..c392d828d8 100644 --- a/Mage.Sets/src/mage/sets/newphyrexia/KarnLiberated.java +++ b/Mage.Sets/src/mage/sets/newphyrexia/KarnLiberated.java @@ -62,25 +62,25 @@ import mage.util.CardUtil; public class KarnLiberated extends CardImpl { private UUID exileId = UUID.randomUUID(); - + public KarnLiberated(UUID ownerId) { super(ownerId, 1, "Karn Liberated", Rarity.MYTHIC, new CardType[]{CardType.PLANESWALKER}, "{7}"); this.expansionSetCode = "NPH"; this.subtype.add("Karn"); - this.addAbility(new EntersBattlefieldAbility(new AddCountersSourceEffect(CounterType.LOYALTY.createInstance(6)), "")); + this.addAbility(new EntersBattlefieldAbility(new AddCountersSourceEffect(CounterType.LOYALTY.createInstance(6)), "")); // +4: Target player exiles a card from his or her hand. LoyaltyAbility ability1 = new LoyaltyAbility(new ExileFromZoneTargetEffect(Zone.HAND, exileId, "Karn Liberated", new FilterCard()), 4); - ability1.addTarget(new TargetPlayer()); - this.addAbility(ability1); + ability1.addTarget(new TargetPlayer()); + this.addAbility(ability1); // -3: Exile target permanent. - LoyaltyAbility ability2 = new LoyaltyAbility(new ExileTargetEffect(exileId, "Karn Liberated"), -3); - ability2.addTarget(new TargetPermanent()); - this.addAbility(ability2); - + LoyaltyAbility ability2 = new LoyaltyAbility(new ExileTargetEffect(exileId, "Karn Liberated"), -3); + ability2.addTarget(new TargetPermanent()); + this.addAbility(ability2); + // -14: Restart the game, leaving in exile all non-Aura permanent cards exiled with Karn Liberated. Then put those cards onto the battlefield under your control. - this.addAbility(new LoyaltyAbility(new KarnLiberatedEffect(exileId), -14)); + this.addAbility(new LoyaltyAbility(new KarnLiberatedEffect(exileId), -14)); } public KarnLiberated(final KarnLiberated card) { @@ -96,18 +96,18 @@ public class KarnLiberated extends CardImpl { class KarnLiberatedEffect extends OneShotEffect { private UUID exileId; - + public KarnLiberatedEffect(UUID exileId) { super(Outcome.ExtraTurn); this.exileId = exileId; this.staticText = "Restart the game, leaving in exile all non-Aura permanent cards exiled with {this}. Then put those cards onto the battlefield under your control."; } - + public KarnLiberatedEffect(final KarnLiberatedEffect effect) { super(effect); this.exileId = effect.exileId; } - + @Override public boolean apply(Game game, Ability source) { List cards = new ArrayList(); @@ -132,9 +132,9 @@ class KarnLiberatedEffect extends OneShotEffect { player.init(game); } for (Card card: cards) { - if ( CardUtil.isPermanentCard(card) && !card.getSubtype().contains("Aura") ) { - game.getExile().add(exileId, "Karn Liberated", card); - } + if ( CardUtil.isPermanentCard(card) && !card.getSubtype().contains("Aura") ) { + game.getExile().add(exileId, "Karn Liberated", card); + } } DelayedTriggeredAbility delayedAbility = new KarnLiberatedDelayedTriggeredAbility(exileId); delayedAbility.setSourceId(source.getSourceId()); @@ -148,7 +148,7 @@ class KarnLiberatedEffect extends OneShotEffect { public KarnLiberatedEffect copy() { return new KarnLiberatedEffect(this); } - + } class KarnLiberatedDelayedTriggeredAbility extends DelayedTriggeredAbility { @@ -185,12 +185,12 @@ class KarnLiberatedDelayedEffect extends OneShotEffect { this.expansionSetCode = "NPH"; this.subtype.add("Cat"); this.subtype.add("Soldier"); - this.color.setWhite(true); + this.color.setWhite(true); this.power = new MageInt(2); this.toughness = new MageInt(1); this.addAbility(InfectAbility.getInstance()); diff --git a/Mage.Sets/src/mage/sets/newphyrexia/MeliraSylvokOutcast.java b/Mage.Sets/src/mage/sets/newphyrexia/MeliraSylvokOutcast.java index ecdfb2e0e8..6a3ef8e349 100644 --- a/Mage.Sets/src/mage/sets/newphyrexia/MeliraSylvokOutcast.java +++ b/Mage.Sets/src/mage/sets/newphyrexia/MeliraSylvokOutcast.java @@ -69,13 +69,13 @@ public class MeliraSylvokOutcast extends CardImpl { // You can't get poison counters. this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new MeliraSylvokOutcastEffect())); - + // Creatures you control can't have -1/-1 counters placed on them. this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new MeliraSylvokOutcastEffect2())); - + // Creatures your opponents control lose infect. this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new MeliraSylvokOutcastEffect3())); - + } public MeliraSylvokOutcast(final MeliraSylvokOutcast card) { @@ -94,11 +94,11 @@ class MeliraSylvokOutcastEffect extends ReplacementEffectImpl { @@ -130,11 +130,11 @@ class MeliraSylvokOutcastEffect2 extends ReplacementEffectImpl { private static FilterCreaturePermanent filter = new FilterCreaturePermanent(); - - public MeliraSylvokOutcastEffect3() { - super(Duration.WhileOnBattlefield, Layer.AbilityAddingRemovingEffects_6, SubLayer.NA, Outcome.LoseAbility); + + public MeliraSylvokOutcastEffect3() { + super(Duration.WhileOnBattlefield, Layer.AbilityAddingRemovingEffects_6, SubLayer.NA, Outcome.LoseAbility); staticText = "Creatures your opponents control lose infect"; - } + } - public MeliraSylvokOutcastEffect3(final MeliraSylvokOutcastEffect3 effect) { - super(effect); - } + public MeliraSylvokOutcastEffect3(final MeliraSylvokOutcastEffect3 effect) { + super(effect); + } - @Override - public MeliraSylvokOutcastEffect3 copy() { - return new MeliraSylvokOutcastEffect3(this); - } + @Override + public MeliraSylvokOutcastEffect3 copy() { + return new MeliraSylvokOutcastEffect3(this); + } - @Override - public boolean apply(Game game, Ability source) { + @Override + public boolean apply(Game game, Ability source) { Set opponents = game.getOpponents(source.getControllerId()); - for (Permanent perm: game.getBattlefield().getActivePermanents(filter, source.getControllerId(), game)) { - if (opponents.contains(perm.getControllerId())) { + for (Permanent perm: game.getBattlefield().getActivePermanents(filter, source.getControllerId(), game)) { + if (opponents.contains(perm.getControllerId())) { perm.getAbilities().remove(InfectAbility.getInstance()); - } - } - return true; - } + } + } + return true; + } } diff --git a/Mage.Sets/src/mage/sets/newphyrexia/MentalMisstep.java b/Mage.Sets/src/mage/sets/newphyrexia/MentalMisstep.java index 52d5357ae9..9e35189670 100644 --- a/Mage.Sets/src/mage/sets/newphyrexia/MentalMisstep.java +++ b/Mage.Sets/src/mage/sets/newphyrexia/MentalMisstep.java @@ -53,7 +53,7 @@ public class MentalMisstep extends CardImpl { public MentalMisstep (UUID ownerId) { super(ownerId, 38, "Mental Misstep", Rarity.UNCOMMON, new CardType[]{CardType.INSTANT}, "{UP}"); this.expansionSetCode = "NPH"; - this.color.setBlue(true); + this.color.setBlue(true); this.getSpellAbility().addEffect(new CounterTargetEffect()); this.getSpellAbility().addTarget(new TargetSpell(filter)); } diff --git a/Mage.Sets/src/mage/sets/newphyrexia/MutagenicGrowth.java b/Mage.Sets/src/mage/sets/newphyrexia/MutagenicGrowth.java index ff7e276cb6..d55ff4a338 100644 --- a/Mage.Sets/src/mage/sets/newphyrexia/MutagenicGrowth.java +++ b/Mage.Sets/src/mage/sets/newphyrexia/MutagenicGrowth.java @@ -46,8 +46,8 @@ public class MutagenicGrowth extends CardImpl { super(ownerId, 116, "Mutagenic Growth", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{GP}"); this.expansionSetCode = "NPH"; this.color.setGreen(true); - this.getSpellAbility().addTarget(new TargetCreaturePermanent()); - this.getSpellAbility().addEffect(new BoostTargetEffect(2, 2, Duration.EndOfTurn)); + this.getSpellAbility().addTarget(new TargetCreaturePermanent()); + this.getSpellAbility().addEffect(new BoostTargetEffect(2, 2, Duration.EndOfTurn)); } public MutagenicGrowth (final MutagenicGrowth card) { diff --git a/Mage.Sets/src/mage/sets/newphyrexia/MyrSuperion.java b/Mage.Sets/src/mage/sets/newphyrexia/MyrSuperion.java index 4eea71f9ef..ab30297970 100644 --- a/Mage.Sets/src/mage/sets/newphyrexia/MyrSuperion.java +++ b/Mage.Sets/src/mage/sets/newphyrexia/MyrSuperion.java @@ -41,7 +41,7 @@ import mage.filter.common.FilterCreaturePermanent; public class MyrSuperion extends CardImpl { private static FilterCreaturePermanent filter = new FilterCreaturePermanent(); - + public MyrSuperion(UUID ownerId) { super(ownerId, 146, "Myr Superion", Rarity.RARE, new CardType[]{CardType.ARTIFACT, CardType.CREATURE}, "{2}"); this.expansionSetCode = "NPH"; diff --git a/Mage.Sets/src/mage/sets/newphyrexia/NornsAnnex.java b/Mage.Sets/src/mage/sets/newphyrexia/NornsAnnex.java index ca3c50e7a0..b425a9bd06 100644 --- a/Mage.Sets/src/mage/sets/newphyrexia/NornsAnnex.java +++ b/Mage.Sets/src/mage/sets/newphyrexia/NornsAnnex.java @@ -71,7 +71,7 @@ class NornsAnnexReplacementEffect extends ReplacementEffectImpl { public NoxiousRevival (UUID ownerId) { super(ownerId, 118, "Noxious Revival", Rarity.UNCOMMON, new CardType[]{CardType.INSTANT}, "{GP}"); this.expansionSetCode = "NPH"; - this.color.setGreen(true); + this.color.setGreen(true); this.getSpellAbility().addEffect(new PutOnLibraryTargetEffect(true)); this.getSpellAbility().addTarget(new TargetCardInGraveyard()); } diff --git a/Mage.Sets/src/mage/sets/newphyrexia/OmenMachine.java b/Mage.Sets/src/mage/sets/newphyrexia/OmenMachine.java index ed29d8dfd6..925c2ecc11 100644 --- a/Mage.Sets/src/mage/sets/newphyrexia/OmenMachine.java +++ b/Mage.Sets/src/mage/sets/newphyrexia/OmenMachine.java @@ -58,7 +58,7 @@ public class OmenMachine extends CardImpl { // Players can't draw cards. this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new OmenMachineEffect())); - + // At the beginning of each player's draw step, that player exiles the top card of his or her library. If it's a land card, the player puts it onto the battlefield. Otherwise, the player casts it without paying its mana cost if able. this.addAbility(new OmenMachineAbility()); } @@ -79,11 +79,11 @@ class OmenMachineEffect extends ReplacementEffectImpl { super(Duration.WhileOnBattlefield, Outcome.Neutral); staticText = "Players can't draw cards"; } - + public OmenMachineEffect(final OmenMachineEffect effect) { super(effect); } - + @Override public boolean apply(Game game, Ability source) { return true; @@ -106,37 +106,37 @@ class OmenMachineEffect extends ReplacementEffectImpl { } return false; } - + } class OmenMachineAbility extends TriggeredAbilityImpl { - public OmenMachineAbility() { - super(Zone.BATTLEFIELD, new OmenMachineEffect2()); - } + public OmenMachineAbility() { + super(Zone.BATTLEFIELD, new OmenMachineEffect2()); + } - public OmenMachineAbility(final OmenMachineAbility ability) { - super(ability); - } + public OmenMachineAbility(final OmenMachineAbility ability) { + super(ability); + } - @Override - public OmenMachineAbility copy() { - return new OmenMachineAbility(this); - } + @Override + public OmenMachineAbility copy() { + return new OmenMachineAbility(this); + } - @Override - public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == EventType.DRAW_STEP_PRE) { + @Override + public boolean checkTrigger(GameEvent event, Game game) { + if (event.getType() == EventType.DRAW_STEP_PRE) { this.getEffects().get(0).setTargetPointer(new FixedTarget(event.getPlayerId())); - return true; - } - return false; - } + return true; + } + return false; + } - @Override - public String getRule() { - return "At the beginning of each player's draw step, that player exiles the top card of his or her library. If it's a land card, the player puts it onto the battlefield. Otherwise, the player casts it without paying its mana cost if able."; - } + @Override + public String getRule() { + return "At the beginning of each player's draw step, that player exiles the top card of his or her library. If it's a land card, the player puts it onto the battlefield. Otherwise, the player casts it without paying its mana cost if able."; + } } @@ -145,11 +145,11 @@ class OmenMachineEffect2 extends OneShotEffect { public OmenMachineEffect2() { super(Outcome.PlayForFree); } - + public OmenMachineEffect2(final OmenMachineEffect2 effect) { super(effect); } - + @Override public boolean apply(Game game, Ability source) { Player player = game.getPlayer(targetPointer.getFirst(game, source)); @@ -173,5 +173,5 @@ class OmenMachineEffect2 extends OneShotEffect { public OmenMachineEffect2 copy() { return new OmenMachineEffect2(this); } - + } diff --git a/Mage.Sets/src/mage/sets/newphyrexia/ParasiticImplant.java b/Mage.Sets/src/mage/sets/newphyrexia/ParasiticImplant.java index fee6b1d5e6..895e075cea 100644 --- a/Mage.Sets/src/mage/sets/newphyrexia/ParasiticImplant.java +++ b/Mage.Sets/src/mage/sets/newphyrexia/ParasiticImplant.java @@ -59,10 +59,10 @@ public class ParasiticImplant extends CardImpl { this.color.setBlack(true); TargetPermanent auraTarget = new TargetCreaturePermanent(); - this.getSpellAbility().addTarget(auraTarget); - this.getSpellAbility().addEffect(new AttachEffect(Constants.Outcome.Sacrifice)); - Ability ability = new EnchantAbility(auraTarget.getTargetName()); - this.addAbility(ability); + this.getSpellAbility().addTarget(auraTarget); + this.getSpellAbility().addEffect(new AttachEffect(Constants.Outcome.Sacrifice)); + Ability ability = new EnchantAbility(auraTarget.getTargetName()); + this.addAbility(ability); ability = new BeginningOfUpkeepTriggeredAbility(new ParasiticImplantEffect(), Constants.TargetController.YOU, false); ability.addEffect(new CreateTokenEffect(new MyrToken())); this.addAbility(ability); @@ -92,8 +92,8 @@ class ParasiticImplantEffect extends OneShotEffect { @Override public boolean apply(Game game, Ability source) { Permanent enchantment = game.getPermanent(source.getSourceId()); - if (enchantment != null && enchantment.getAttachedTo() != null) { - Permanent creature = game.getPermanent(enchantment.getAttachedTo()); + if (enchantment != null && enchantment.getAttachedTo() != null) { + Permanent creature = game.getPermanent(enchantment.getAttachedTo()); if (creature != null) { return creature.sacrifice(source.getSourceId(), game); } diff --git a/Mage.Sets/src/mage/sets/newphyrexia/PhyrexianIngester.java b/Mage.Sets/src/mage/sets/newphyrexia/PhyrexianIngester.java index 5cc486e0a1..baed65f50f 100644 --- a/Mage.Sets/src/mage/sets/newphyrexia/PhyrexianIngester.java +++ b/Mage.Sets/src/mage/sets/newphyrexia/PhyrexianIngester.java @@ -56,12 +56,12 @@ import mage.target.TargetPermanent; public class PhyrexianIngester extends CardImpl { private static final FilterNonTokenPermanent filter = new FilterNonTokenPermanent("nontoken creature"); - + static { filter.getCardType().add(CardType.CREATURE); filter.setScopeCardType(Filter.ComparisonScope.Any); } - + public PhyrexianIngester(UUID ownerId) { super(ownerId, 41, "Phyrexian Ingester", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{6}{U}"); this.expansionSetCode = "NPH"; diff --git a/Mage.Sets/src/mage/sets/newphyrexia/PhyrexianMetamorph.java b/Mage.Sets/src/mage/sets/newphyrexia/PhyrexianMetamorph.java index c3bb831dca..f4583d015a 100644 --- a/Mage.Sets/src/mage/sets/newphyrexia/PhyrexianMetamorph.java +++ b/Mage.Sets/src/mage/sets/newphyrexia/PhyrexianMetamorph.java @@ -58,10 +58,10 @@ public class PhyrexianMetamorph extends CardImpl { super(ownerId, 42, "Phyrexian Metamorph", Rarity.RARE, new CardType[]{CardType.ARTIFACT, CardType.CREATURE}, "{3}{UP}"); this.expansionSetCode = "NPH"; this.subtype.add("Shapeshifter"); - this.color.setBlue(true); + this.color.setBlue(true); this.power = new MageInt(0); this.toughness = new MageInt(0); - Ability ability = new EntersBattlefieldAbility(new EntersBattlefieldEffect(new PhyrexianMetamorphEffect()), "You may have {this} enter the battlefield as a copy of any artifact or creature on the battlefield, except it's an artifact in addition to its other types"); + Ability ability = new EntersBattlefieldAbility(new EntersBattlefieldEffect(new PhyrexianMetamorphEffect()), "You may have {this} enter the battlefield as a copy of any artifact or creature on the battlefield, except it's an artifact in addition to its other types"); this.addAbility(ability); } @@ -77,7 +77,7 @@ public class PhyrexianMetamorph extends CardImpl { } class PhyrexianMetamorphEffect extends OneShotEffect { - + private static final FilterPermanent filter = new FilterPermanent("artifact or creature"); static { @@ -85,7 +85,7 @@ class PhyrexianMetamorphEffect extends OneShotEffect { filter.getCardType().add(CardType.CREATURE); filter.setScopeCardType(Filter.ComparisonScope.Any); } - + public PhyrexianMetamorphEffect() { super(Outcome.Copy); } @@ -93,7 +93,7 @@ class PhyrexianMetamorphEffect extends OneShotEffect { public PhyrexianMetamorphEffect(final PhyrexianMetamorphEffect effect) { super(effect); } - + @Override public boolean apply(Game game, Ability source) { Player player = game.getPlayer(source.getControllerId()); @@ -125,5 +125,5 @@ class PhyrexianMetamorphEffect extends OneShotEffect { public PhyrexianMetamorphEffect copy() { return new PhyrexianMetamorphEffect(this); } - + } diff --git a/Mage.Sets/src/mage/sets/newphyrexia/PhyrexianObliterator.java b/Mage.Sets/src/mage/sets/newphyrexia/PhyrexianObliterator.java index b9f1d35f56..19a83a988d 100644 --- a/Mage.Sets/src/mage/sets/newphyrexia/PhyrexianObliterator.java +++ b/Mage.Sets/src/mage/sets/newphyrexia/PhyrexianObliterator.java @@ -90,17 +90,17 @@ class PhyrexianObliteratorTriggeredAbility extends TriggeredAbilityImpl { this.color.setWhite(true); // You don't lose the game for having 0 or less life. - this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new PhyrexianUnlifeEffect())); - + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new PhyrexianUnlifeEffect())); + // As long as you have 0 or less life, all damage is dealt to you as though its source had infect. - this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new PhyrexianUnlifeEffect2())); - + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new PhyrexianUnlifeEffect2())); + } public PhyrexianUnlife(final PhyrexianUnlife card) { @@ -107,9 +107,9 @@ class PhyrexianUnlifeEffect extends ReplacementEffectImpl public boolean applies(GameEvent event, Ability source, Game game) { if (event.getType() == EventType.LOSES && event.getPlayerId().equals(source.getControllerId())) { Player player = game.getPlayer(event.getPlayerId()); - if (!player.hasLost() && (player.getLife() <= 0 && !player.isEmptyDraw() && player.getCounters().getCount(CounterType.POISON) < 10)) { - return true; - } + if (!player.hasLost() && (player.getLife() <= 0 && !player.isEmptyDraw() && player.getCounters().getCount(CounterType.POISON) < 10)) { + return true; + } } return false; } @@ -158,9 +158,9 @@ class PhyrexianUnlifeEffect2 extends ReplacementEffectImpl { // Search target opponent's library for a card and exile it face down. Then that player shuffles his or her library. You may look at and play that card for as long as it remains exiled. this.getSpellAbility().addEffect(new PraetorsGraspEffect()); this.getSpellAbility().addTarget(new TargetOpponent()); - + } public PraetorsGrasp(final PraetorsGrasp card) { @@ -118,30 +118,30 @@ class PraetorsGraspEffect extends OneShotEffect { class PraetorsGraspPlayEffect extends AsThoughEffectImpl { private UUID cardId; - - public PraetorsGraspPlayEffect(UUID cardId) { - super(AsThoughEffectType.CAST, Duration.EndOfGame, Outcome.Benefit); + + public PraetorsGraspPlayEffect(UUID cardId) { + super(AsThoughEffectType.CAST, Duration.EndOfGame, Outcome.Benefit); this.cardId = cardId; - staticText = "You may look at and play that card for as long as it remains exiled"; - } + staticText = "You may look at and play that card for as long as it remains exiled"; + } - public PraetorsGraspPlayEffect(final PraetorsGraspPlayEffect effect) { - super(effect); + public PraetorsGraspPlayEffect(final PraetorsGraspPlayEffect effect) { + super(effect); this.cardId = effect.cardId; - } + } - @Override - public boolean apply(Game game, Ability source) { - return true; - } + @Override + public boolean apply(Game game, Ability source) { + return true; + } - @Override - public PraetorsGraspPlayEffect copy() { - return new PraetorsGraspPlayEffect(this); - } + @Override + public PraetorsGraspPlayEffect copy() { + return new PraetorsGraspPlayEffect(this); + } - @Override - public boolean applies(UUID sourceId, Ability source, Game game) { + @Override + public boolean applies(UUID sourceId, Ability source, Game game) { if (sourceId.equals(cardId)) { Card card = game.getCard(cardId); if (card != null && game.getState().getZone(cardId) == Zone.EXILED) { @@ -149,6 +149,6 @@ class PraetorsGraspPlayEffect extends AsThoughEffectImpl { public RuthlessInvasion (UUID ownerId) { super(ownerId, 93, "Ruthless Invasion", Rarity.COMMON, new CardType[]{CardType.SORCERY}, "{3}{RP}"); this.expansionSetCode = "NPH"; - this.color.setRed(true); + this.color.setRed(true); this.getSpellAbility().addEffect(new RuthlessInvasionEffect()); } diff --git a/Mage.Sets/src/mage/sets/newphyrexia/ShatteredAngel.java b/Mage.Sets/src/mage/sets/newphyrexia/ShatteredAngel.java index 8f472ff3c1..7b4e87b235 100644 --- a/Mage.Sets/src/mage/sets/newphyrexia/ShatteredAngel.java +++ b/Mage.Sets/src/mage/sets/newphyrexia/ShatteredAngel.java @@ -53,7 +53,7 @@ public class ShatteredAngel extends CardImpl { super(ownerId, 23, "Shattered Angel", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{3}{W}{W}"); this.expansionSetCode = "NPH"; this.subtype.add("Angel"); - this.color.setWhite(true); + this.color.setWhite(true); this.power = new MageInt(3); this.toughness = new MageInt(3); this.addAbility(FlyingAbility.getInstance()); @@ -88,12 +88,12 @@ class ShatteredAngelTriggeredAbility extends TriggeredAbilityImpl { this.expansionSetCode = "NPH"; this.supertype.add("Legendary"); this.subtype.add("Praetor"); - this.color.setBlack(true); + this.color.setBlack(true); this.power = new MageInt(6); this.toughness = new MageInt(6); this.addAbility(new SwampwalkAbility()); diff --git a/Mage.Sets/src/mage/sets/newphyrexia/ShrineOfBoundlessGrowth.java b/Mage.Sets/src/mage/sets/newphyrexia/ShrineOfBoundlessGrowth.java index a36e13122a..7fda603841 100644 --- a/Mage.Sets/src/mage/sets/newphyrexia/ShrineOfBoundlessGrowth.java +++ b/Mage.Sets/src/mage/sets/newphyrexia/ShrineOfBoundlessGrowth.java @@ -63,7 +63,7 @@ public class ShrineOfBoundlessGrowth extends CardImpl { public ShrineOfBoundlessGrowth (UUID ownerId) { super(ownerId, 152, "Shrine of Boundless Growth", Rarity.UNCOMMON, new CardType[]{CardType.ARTIFACT}, "{3}"); this.expansionSetCode = "NPH"; - + this.addAbility(new BeginningOfUpkeepTriggeredAbility(new AddCountersSourceEffect(CounterType.CHARGE.createInstance()), TargetController.YOU, false)); this.addAbility(new SpellCastTriggeredAbility(new AddCountersSourceEffect(CounterType.CHARGE.createInstance()), filter, false)); diff --git a/Mage.Sets/src/mage/sets/newphyrexia/Sickleslicer.java b/Mage.Sets/src/mage/sets/newphyrexia/Sickleslicer.java index ae9d593ed4..82eff9cbf9 100644 --- a/Mage.Sets/src/mage/sets/newphyrexia/Sickleslicer.java +++ b/Mage.Sets/src/mage/sets/newphyrexia/Sickleslicer.java @@ -51,7 +51,7 @@ public class Sickleslicer extends CardImpl { this.expansionSetCode = "NPH"; this.subtype.add("Equipment"); this.addAbility(new EquipAbility(Constants.Outcome.BoostCreature, new GenericManaCost(4))); - this.addAbility(new SimpleStaticAbility(Constants.Zone.BATTLEFIELD, new BoostEquippedEffect(2, 2))); + this.addAbility(new SimpleStaticAbility(Constants.Zone.BATTLEFIELD, new BoostEquippedEffect(2, 2))); this.addAbility(new LivingWeaponAbility()); } diff --git a/Mage.Sets/src/mage/sets/newphyrexia/SoulConduit.java b/Mage.Sets/src/mage/sets/newphyrexia/SoulConduit.java index b0ec7a79e1..a5ff44fa6e 100644 --- a/Mage.Sets/src/mage/sets/newphyrexia/SoulConduit.java +++ b/Mage.Sets/src/mage/sets/newphyrexia/SoulConduit.java @@ -96,17 +96,17 @@ class SoulConduitEffect extends OneShotEffect { if (lifePlayer1 == lifePlayer2) return false; - + if (!player1.isLifeTotalCanChange() || !player2.isLifeTotalCanChange()) return false; - + // 20110930 - 118.7, 118.8 if (lifePlayer1 < lifePlayer2 && (!player1.isCanGainLife() || !player2.isCanLoseLife())) return false; if (lifePlayer1 > lifePlayer2 && (!player1.isCanLoseLife() || !player2.isCanGainLife())) return false; - + player1.setLife(lifePlayer2, game); player2.setLife(lifePlayer1, game); return true; diff --git a/Mage.Sets/src/mage/sets/newphyrexia/Spellskite.java b/Mage.Sets/src/mage/sets/newphyrexia/Spellskite.java index fd36ce48e2..9e6c8084ab 100644 --- a/Mage.Sets/src/mage/sets/newphyrexia/Spellskite.java +++ b/Mage.Sets/src/mage/sets/newphyrexia/Spellskite.java @@ -81,17 +81,17 @@ class SpellskiteEffect extends OneShotEffect { super(Outcome.Neutral); staticText = "Change a target of target spell or ability to {this}"; } - + public SpellskiteEffect(final SpellskiteEffect effect) { super(effect); } - + @Override public boolean apply(Game game, Ability source) { - Spell spell = game.getStack().getSpell(source.getFirstTarget()); - if (spell != null) { + Spell spell = game.getStack().getSpell(source.getFirstTarget()); + if (spell != null) { Targets targets = spell.getSpellAbility().getTargets(); - if (targets.size() == 1 && targets.get(0).getTargets().size() == 1) { + if (targets.size() == 1 && targets.get(0).getTargets().size() == 1) { Target target = targets.get(0); if (target.canTarget(source.getSourceId(), game)) { target.clearChosen(); @@ -120,13 +120,13 @@ class SpellskiteEffect extends OneShotEffect { } } } - } - return false; + } + return false; } @Override public SpellskiteEffect copy() { return new SpellskiteEffect(this); } - + } \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/newphyrexia/Spinebiter.java b/Mage.Sets/src/mage/sets/newphyrexia/Spinebiter.java index 76fe4cf0a2..53c4f472d1 100644 --- a/Mage.Sets/src/mage/sets/newphyrexia/Spinebiter.java +++ b/Mage.Sets/src/mage/sets/newphyrexia/Spinebiter.java @@ -51,7 +51,7 @@ public class Spinebiter extends CardImpl { this.toughness = new MageInt(4); this.addAbility(InfectAbility.getInstance()); - + // You may have Spinebiter assign its combat damage as though it weren't blocked. this.addAbility(DamageAsThoughNotBlockedAbility.getInstance()); } diff --git a/Mage.Sets/src/mage/sets/newphyrexia/SuturePriest.java b/Mage.Sets/src/mage/sets/newphyrexia/SuturePriest.java index 44bab0606d..a374eff646 100644 --- a/Mage.Sets/src/mage/sets/newphyrexia/SuturePriest.java +++ b/Mage.Sets/src/mage/sets/newphyrexia/SuturePriest.java @@ -55,7 +55,7 @@ public class SuturePriest extends CardImpl { super(ownerId, 25, "Suture Priest", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{1}{W}"); this.expansionSetCode = "NPH"; this.subtype.add("Cleric"); - this.color.setWhite(true); + this.color.setWhite(true); this.power = new MageInt(1); this.toughness = new MageInt(1); this.addAbility(new SuturePriestFirstTriggeredAbility()); @@ -89,13 +89,13 @@ class SuturePriestFirstTriggeredAbility extends TriggeredAbilityImpl { class UnwindingClockEffect extends ContinuousEffectImpl { private static FilterArtifactPermanent filter = new FilterArtifactPermanent(); - + public UnwindingClockEffect() { super(Duration.WhileOnBattlefield, Outcome.Benefit); staticText = "Untap all artifacts you control during each other player's untap step"; diff --git a/Mage.Sets/src/mage/sets/newphyrexia/UrabraskTheHidden.java b/Mage.Sets/src/mage/sets/newphyrexia/UrabraskTheHidden.java index 93a1d264fa..70de105fe1 100644 --- a/Mage.Sets/src/mage/sets/newphyrexia/UrabraskTheHidden.java +++ b/Mage.Sets/src/mage/sets/newphyrexia/UrabraskTheHidden.java @@ -99,9 +99,9 @@ class UrabraskTheHiddenEffect extends ReplacementEffectImpl { public VaporSnag (UUID ownerId) { super(ownerId, 48, "Vapor Snag", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{U}"); this.expansionSetCode = "NPH"; - this.color.setBlue(true); + this.color.setBlue(true); this.getSpellAbility().addEffect(new ReturnToHandTargetEffect()); this.getSpellAbility().addEffect(new LoseLifeControllerEffect(1)); this.getSpellAbility().addTarget(new TargetCreaturePermanent()); diff --git a/Mage.Sets/src/mage/sets/newphyrexia/VaultSkirge.java b/Mage.Sets/src/mage/sets/newphyrexia/VaultSkirge.java index b6e7322d8f..78d996dd09 100644 --- a/Mage.Sets/src/mage/sets/newphyrexia/VaultSkirge.java +++ b/Mage.Sets/src/mage/sets/newphyrexia/VaultSkirge.java @@ -49,7 +49,7 @@ public class VaultSkirge extends CardImpl { this.color.setBlack(true); this.power = new MageInt(1); this.toughness = new MageInt(1); - + this.addAbility(FlyingAbility.getInstance()); this.addAbility(LifelinkAbility.getInstance()); } diff --git a/Mage.Sets/src/mage/sets/newphyrexia/ViralDrake.java b/Mage.Sets/src/mage/sets/newphyrexia/ViralDrake.java index 467aabb592..318559e1e7 100644 --- a/Mage.Sets/src/mage/sets/newphyrexia/ViralDrake.java +++ b/Mage.Sets/src/mage/sets/newphyrexia/ViralDrake.java @@ -55,7 +55,7 @@ public class ViralDrake extends CardImpl { this.toughness = new MageInt(4); this.addAbility(FlyingAbility.getInstance()); - this.addAbility(InfectAbility.getInstance()); + this.addAbility(InfectAbility.getInstance()); this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new ProliferateEffect(), new ManaCostsImpl("{3}{U}"))); } diff --git a/Mage.Sets/src/mage/sets/newphyrexia/ViridianHarvest.java b/Mage.Sets/src/mage/sets/newphyrexia/ViridianHarvest.java index 712d323770..12c2db2bdc 100644 --- a/Mage.Sets/src/mage/sets/newphyrexia/ViridianHarvest.java +++ b/Mage.Sets/src/mage/sets/newphyrexia/ViridianHarvest.java @@ -55,10 +55,10 @@ public class ViridianHarvest extends CardImpl { this.color.setGreen(true); TargetPermanent auraTarget = new TargetArtifactPermanent(); - this.getSpellAbility().addTarget(auraTarget); - this.getSpellAbility().addEffect(new AttachEffect(Constants.Outcome.Benefit)); - Ability ability = new EnchantAbility(auraTarget.getTargetName()); - this.addAbility(ability); + this.getSpellAbility().addTarget(auraTarget); + this.getSpellAbility().addEffect(new AttachEffect(Constants.Outcome.Benefit)); + Ability ability = new EnchantAbility(auraTarget.getTargetName()); + this.addAbility(ability); this.addAbility(new DiesAttachedTriggeredAbility(new GainLifeEffect(6), "enchanted artifact")); } diff --git a/Mage.Sets/src/mage/sets/newphyrexia/VorinclexVoiceOfHunger.java b/Mage.Sets/src/mage/sets/newphyrexia/VorinclexVoiceOfHunger.java index 5dc97bbbf6..7f94ae8a8a 100644 --- a/Mage.Sets/src/mage/sets/newphyrexia/VorinclexVoiceOfHunger.java +++ b/Mage.Sets/src/mage/sets/newphyrexia/VorinclexVoiceOfHunger.java @@ -69,7 +69,7 @@ public class VorinclexVoiceOfHunger extends CardImpl { this.addAbility(TrampleAbility.getInstance()); // Whenever you tap a land for mana, add one mana to your mana pool of any type that land produced. this.addAbility(new VorinclexTriggeredAbility1()); - + // Whenever an opponent taps a land for mana, that land doesn't untap during its controller's next untap step. this.addAbility(new VorinclexTriggeredAbility2()); } @@ -86,40 +86,40 @@ public class VorinclexVoiceOfHunger extends CardImpl { class VorinclexTriggeredAbility1 extends TriggeredManaAbility { - private static final String staticText = "Whenever you tap a land for mana, add one mana to your mana pool of any type that land produced."; + private static final String staticText = "Whenever you tap a land for mana, add one mana to your mana pool of any type that land produced."; - public VorinclexTriggeredAbility1() { - super(Zone.BATTLEFIELD, new VorinclexEffect()); - } + public VorinclexTriggeredAbility1() { + super(Zone.BATTLEFIELD, new VorinclexEffect()); + } - public VorinclexTriggeredAbility1(VorinclexTriggeredAbility1 ability) { - super(ability); - } + public VorinclexTriggeredAbility1(VorinclexTriggeredAbility1 ability) { + super(ability); + } - @Override - public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == GameEvent.EventType.TAPPED_FOR_MANA && event.getPlayerId().equals(controllerId)) { - Permanent permanent = game.getPermanent(event.getSourceId()); - if (permanent == null) { - permanent = (Permanent) game.getLastKnownInformation(event.getSourceId(), Zone.BATTLEFIELD); - } - if (permanent != null && permanent.getCardType().contains(CardType.LAND)) { + @Override + public boolean checkTrigger(GameEvent event, Game game) { + if (event.getType() == GameEvent.EventType.TAPPED_FOR_MANA && event.getPlayerId().equals(controllerId)) { + Permanent permanent = game.getPermanent(event.getSourceId()); + if (permanent == null) { + permanent = (Permanent) game.getLastKnownInformation(event.getSourceId(), Zone.BATTLEFIELD); + } + if (permanent != null && permanent.getCardType().contains(CardType.LAND)) { getEffects().get(0).setTargetPointer(new FixedTarget(permanent.getId())); return true; - } - } - return false; - } + } + } + return false; + } - @Override - public VorinclexTriggeredAbility1 copy() { - return new VorinclexTriggeredAbility1(this); - } + @Override + public VorinclexTriggeredAbility1 copy() { + return new VorinclexTriggeredAbility1(this); + } - @Override - public String getRule() { - return staticText; - } + @Override + public String getRule() { + return staticText; + } } @@ -129,11 +129,11 @@ class VorinclexEffect extends ManaEffect { super(); staticText = "add one mana to your mana pool of any type that land produced"; } - + public VorinclexEffect(final VorinclexEffect effect) { super(effect); } - + @Override public boolean apply(Game game, Ability source) { Permanent land = game.getPermanent(this.targetPointer.getFirst(game, source)); @@ -194,40 +194,40 @@ class VorinclexEffect extends ManaEffect { public VorinclexEffect copy() { return new VorinclexEffect(this); } - + } class VorinclexTriggeredAbility2 extends TriggeredAbilityImpl { - private static final String staticText = "Whenever an opponent taps a land for mana, that land doesn't untap during its controller's next untap step."; + private static final String staticText = "Whenever an opponent taps a land for mana, that land doesn't untap during its controller's next untap step."; - public VorinclexTriggeredAbility2() { - super(Zone.BATTLEFIELD, new SkipNextUntapTargetEffect()); - } + public VorinclexTriggeredAbility2() { + super(Zone.BATTLEFIELD, new SkipNextUntapTargetEffect()); + } - public VorinclexTriggeredAbility2(VorinclexTriggeredAbility2 ability) { - super(ability); - } + public VorinclexTriggeredAbility2(VorinclexTriggeredAbility2 ability) { + super(ability); + } - @Override - public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == GameEvent.EventType.TAPPED_FOR_MANA && game.getOpponents(controllerId).contains(event.getPlayerId())) { - Permanent permanent = game.getPermanent(event.getSourceId()); - if (permanent != null && permanent.getCardType().contains(CardType.LAND)) { + @Override + public boolean checkTrigger(GameEvent event, Game game) { + if (event.getType() == GameEvent.EventType.TAPPED_FOR_MANA && game.getOpponents(controllerId).contains(event.getPlayerId())) { + Permanent permanent = game.getPermanent(event.getSourceId()); + if (permanent != null && permanent.getCardType().contains(CardType.LAND)) { getEffects().get(0).setTargetPointer(new FixedTarget(permanent.getId())); - return true; - } - } - return false; - } + return true; + } + } + return false; + } - @Override - public VorinclexTriggeredAbility2 copy() { - return new VorinclexTriggeredAbility2(this); - } + @Override + public VorinclexTriggeredAbility2 copy() { + return new VorinclexTriggeredAbility2(this); + } - @Override - public String getRule() { - return staticText; - } + @Override + public String getRule() { + return staticText; + } } diff --git a/Mage.Sets/src/mage/sets/newphyrexia/VulshokRefugee.java b/Mage.Sets/src/mage/sets/newphyrexia/VulshokRefugee.java index 57a75d36e8..ac76c58328 100644 --- a/Mage.Sets/src/mage/sets/newphyrexia/VulshokRefugee.java +++ b/Mage.Sets/src/mage/sets/newphyrexia/VulshokRefugee.java @@ -47,7 +47,7 @@ public class VulshokRefugee extends CardImpl { static { filter.setUseColor(true); filter.getColor().setRed(true); - filter.setScopeColor(ComparisonScope.Any); + filter.setScopeColor(ComparisonScope.Any); } public VulshokRefugee(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/ninthedition/ThievingMagpie.java b/Mage.Sets/src/mage/sets/ninthedition/ThievingMagpie.java index f8d8277b6f..2e83e6692f 100644 --- a/Mage.Sets/src/mage/sets/ninthedition/ThievingMagpie.java +++ b/Mage.Sets/src/mage/sets/ninthedition/ThievingMagpie.java @@ -53,7 +53,7 @@ public class ThievingMagpie extends CardImpl { // Flying this.addAbility(FlyingAbility.getInstance()); - + // Whenever Thieving Magpie deals damage to an opponent, draw a card. this.addAbility(new DealsDamageToOpponentTriggeredAbility(new DrawCardControllerEffect(1))); } diff --git a/Mage.Sets/src/mage/sets/onslaught/WirewoodElf.java b/Mage.Sets/src/mage/sets/onslaught/WirewoodElf.java index 5819f51746..93e66c0819 100644 --- a/Mage.Sets/src/mage/sets/onslaught/WirewoodElf.java +++ b/Mage.Sets/src/mage/sets/onslaught/WirewoodElf.java @@ -38,23 +38,23 @@ import mage.cards.CardImpl; * @author Melkhior */ public class WirewoodElf extends CardImpl { - public WirewoodElf(UUID ownerId) { - super(ownerId, 301, "Wirewood Elf", Constants.Rarity.COMMON, new Constants.CardType[]{Constants.CardType.CREATURE}, "{1}{G}"); - this.expansionSetCode = "ONS"; - this.subtype.add("Elf"); - this.subtype.add("Druid"); - this.color.setGreen(true); - this.power = new MageInt(1); - this.toughness = new MageInt(2); - this.addAbility(new GreenManaAbility()); - } + public WirewoodElf(UUID ownerId) { + super(ownerId, 301, "Wirewood Elf", Constants.Rarity.COMMON, new Constants.CardType[]{Constants.CardType.CREATURE}, "{1}{G}"); + this.expansionSetCode = "ONS"; + this.subtype.add("Elf"); + this.subtype.add("Druid"); + this.color.setGreen(true); + this.power = new MageInt(1); + this.toughness = new MageInt(2); + this.addAbility(new GreenManaAbility()); + } - public WirewoodElf(final WirewoodElf card) { - super(card); - } + public WirewoodElf(final WirewoodElf card) { + super(card); + } - @Override - public WirewoodElf copy() { - return new WirewoodElf(this); - } + @Override + public WirewoodElf copy() { + return new WirewoodElf(this); + } } \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/onslaught/WirewoodLodge.java b/Mage.Sets/src/mage/sets/onslaught/WirewoodLodge.java index db48cd2d6f..e9a385b6bb 100644 --- a/Mage.Sets/src/mage/sets/onslaught/WirewoodLodge.java +++ b/Mage.Sets/src/mage/sets/onslaught/WirewoodLodge.java @@ -62,9 +62,9 @@ public class WirewoodLodge extends CardImpl { costs.add(new TapSourceCost()); costs.add(new ManaCostsImpl("{G}")); Ability ability = new SimpleActivatedAbility(Constants.Zone.BATTLEFIELD, new UntapTargetEffect(), costs); - TargetCreaturePermanent target = new TargetCreaturePermanent(filter); - ability.addTarget(target); - this.addAbility(ability); + TargetCreaturePermanent target = new TargetCreaturePermanent(filter); + ability.addTarget(target); + this.addAbility(ability); } public WirewoodLodge(final WirewoodLodge card) { diff --git a/Mage.Sets/src/mage/sets/planarchaos/DuneriderOutlaw.java b/Mage.Sets/src/mage/sets/planarchaos/DuneriderOutlaw.java index 2c4fa56bdc..c84cd388ab 100644 --- a/Mage.Sets/src/mage/sets/planarchaos/DuneriderOutlaw.java +++ b/Mage.Sets/src/mage/sets/planarchaos/DuneriderOutlaw.java @@ -56,7 +56,7 @@ public class DuneriderOutlaw extends CardImpl { filter.setColor(ObjectColor.GREEN); filter.setUseColor(true); } - + public DuneriderOutlaw(UUID ownerId) { super(ownerId, 86, "Dunerider Outlaw", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{B}{B}"); this.expansionSetCode = "PLC"; @@ -67,12 +67,12 @@ public class DuneriderOutlaw extends CardImpl { this.color.setBlack(true); this.power = new MageInt(1); this.toughness = new MageInt(1); - + // Protection from green this.addAbility(new ProtectionAbility(filter)); // At the beginning of each end step, if Dunerider Outlaw dealt damage to an opponent this turn, put a +1/+1 counter on it. TriggeredAbility triggered = new OnEventTriggeredAbility(GameEvent.EventType.END_TURN_STEP_PRE, "beginning of each end step", true, new AddCountersSourceEffect(CounterType.P1P1.createInstance())); - this.addAbility(new ConditionalTriggeredAbility(triggered, new DealtDamageToAnOpponent(), ruleText)); + this.addAbility(new ConditionalTriggeredAbility(triggered, new DealtDamageToAnOpponent(), ruleText)); } public DuneriderOutlaw(final DuneriderOutlaw card) { diff --git a/Mage.Sets/src/mage/sets/planechase/Gravedigger.java b/Mage.Sets/src/mage/sets/planechase/Gravedigger.java index 115ca0d3a7..e8f0006d36 100644 --- a/Mage.Sets/src/mage/sets/planechase/Gravedigger.java +++ b/Mage.Sets/src/mage/sets/planechase/Gravedigger.java @@ -36,19 +36,19 @@ import java.util.UUID; */ public class Gravedigger extends mage.sets.tenth.Gravedigger { - public Gravedigger(UUID ownerId) { - super(ownerId); - this.cardNumber = 29; - this.expansionSetCode = "HOP"; - } + public Gravedigger(UUID ownerId) { + super(ownerId); + this.cardNumber = 29; + this.expansionSetCode = "HOP"; + } - public Gravedigger(final Gravedigger card) { - super(card); - } + public Gravedigger(final Gravedigger card) { + super(card); + } - @Override - public Gravedigger copy() { - return new Gravedigger(this); - } + @Override + public Gravedigger copy() { + return new Gravedigger(this); + } } \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/planechase/OblivionRing.java b/Mage.Sets/src/mage/sets/planechase/OblivionRing.java index bbeb1025d2..136207c98e 100644 --- a/Mage.Sets/src/mage/sets/planechase/OblivionRing.java +++ b/Mage.Sets/src/mage/sets/planechase/OblivionRing.java @@ -36,19 +36,19 @@ import java.util.UUID; */ public class OblivionRing extends mage.sets.shardsofalara.OblivionRing { - public OblivionRing(UUID ownerId) { - super(ownerId); - this.cardNumber = 4; - this.expansionSetCode = "HOP"; - } + public OblivionRing(UUID ownerId) { + super(ownerId); + this.cardNumber = 4; + this.expansionSetCode = "HOP"; + } - public OblivionRing(final OblivionRing card) { - super(card); - } + public OblivionRing(final OblivionRing card) { + super(card); + } - @Override - public OblivionRing copy() { - return new OblivionRing(this); - } + @Override + public OblivionRing copy() { + return new OblivionRing(this); + } } diff --git a/Mage.Sets/src/mage/sets/planechase/SoulWarden.java b/Mage.Sets/src/mage/sets/planechase/SoulWarden.java index b847899c5a..d60268722b 100644 --- a/Mage.Sets/src/mage/sets/planechase/SoulWarden.java +++ b/Mage.Sets/src/mage/sets/planechase/SoulWarden.java @@ -36,19 +36,19 @@ import java.util.UUID; */ public class SoulWarden extends mage.sets.magic2010.SoulWarden { - public SoulWarden(UUID ownerId) { - super(ownerId); - this.cardNumber = 7; - this.expansionSetCode = "HOP"; - } + public SoulWarden(UUID ownerId) { + super(ownerId); + this.cardNumber = 7; + this.expansionSetCode = "HOP"; + } - public SoulWarden(final SoulWarden card) { - super(card); - } + public SoulWarden(final SoulWarden card) { + super(card); + } - @Override - public SoulWarden copy() { - return new SoulWarden(this); - } + @Override + public SoulWarden copy() { + return new SoulWarden(this); + } } diff --git a/Mage.Sets/src/mage/sets/planechase/TerramorphicExpanse.java b/Mage.Sets/src/mage/sets/planechase/TerramorphicExpanse.java index 5ddb6eb618..b47018f6b5 100644 --- a/Mage.Sets/src/mage/sets/planechase/TerramorphicExpanse.java +++ b/Mage.Sets/src/mage/sets/planechase/TerramorphicExpanse.java @@ -36,19 +36,19 @@ import java.util.UUID; */ public class TerramorphicExpanse extends mage.sets.tenth.TerramorphicExpanse { - public TerramorphicExpanse(UUID ownerId) { - super(ownerId); - this.cardNumber = 139; - this.expansionSetCode = "HOP"; - } + public TerramorphicExpanse(UUID ownerId) { + super(ownerId); + this.cardNumber = 139; + this.expansionSetCode = "HOP"; + } - public TerramorphicExpanse(final TerramorphicExpanse card) { - super(card); - } + public TerramorphicExpanse(final TerramorphicExpanse card) { + super(card); + } - @Override - public TerramorphicExpanse copy() { - return new TerramorphicExpanse(this); - } + @Override + public TerramorphicExpanse copy() { + return new TerramorphicExpanse(this); + } } \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/ravnika/BelltowerSphinx.java b/Mage.Sets/src/mage/sets/ravnika/BelltowerSphinx.java index b0cda3e147..000d36103d 100644 --- a/Mage.Sets/src/mage/sets/ravnika/BelltowerSphinx.java +++ b/Mage.Sets/src/mage/sets/ravnika/BelltowerSphinx.java @@ -48,63 +48,63 @@ import java.util.UUID; */ public class BelltowerSphinx extends CardImpl { - public BelltowerSphinx(UUID ownerId) { - super(ownerId, 38, "Belltower Sphinx", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{4}{U}"); - this.expansionSetCode = "RAV"; - this.subtype.add("Sphinx"); + public BelltowerSphinx(UUID ownerId) { + super(ownerId, 38, "Belltower Sphinx", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{4}{U}"); + this.expansionSetCode = "RAV"; + this.subtype.add("Sphinx"); - this.color.setBlue(true); - this.power = new MageInt(2); - this.toughness = new MageInt(5); + this.color.setBlue(true); + this.power = new MageInt(2); + this.toughness = new MageInt(5); - this.addAbility(FlyingAbility.getInstance()); - // Whenever a source deals damage to Belltower Sphinx, that source's controller puts that many cards from the top of his or her library into his or her graveyard. - this.addAbility(new BelltowerSphinxEffect()); - } + this.addAbility(FlyingAbility.getInstance()); + // Whenever a source deals damage to Belltower Sphinx, that source's controller puts that many cards from the top of his or her library into his or her graveyard. + this.addAbility(new BelltowerSphinxEffect()); + } - public BelltowerSphinx(final BelltowerSphinx card) { - super(card); - } + public BelltowerSphinx(final BelltowerSphinx card) { + super(card); + } - @Override - public BelltowerSphinx copy() { - return new BelltowerSphinx(this); - } + @Override + public BelltowerSphinx copy() { + return new BelltowerSphinx(this); + } } class BelltowerSphinxEffect extends TriggeredAbilityImpl { - public BelltowerSphinxEffect() { - super(Constants.Zone.BATTLEFIELD, new PutLibraryIntoGraveTargetEffect(0)); - } + public BelltowerSphinxEffect() { + super(Constants.Zone.BATTLEFIELD, new PutLibraryIntoGraveTargetEffect(0)); + } - public BelltowerSphinxEffect(BelltowerSphinxEffect effect) { - super(effect); - } + public BelltowerSphinxEffect(BelltowerSphinxEffect effect) { + super(effect); + } - @Override - public BelltowerSphinxEffect copy() { - return new BelltowerSphinxEffect(this); - } + @Override + public BelltowerSphinxEffect copy() { + return new BelltowerSphinxEffect(this); + } - @Override - public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == GameEvent.EventType.DAMAGED_CREATURE && event.getTargetId().equals(this.sourceId)) { - UUID controller = game.getControllerId(event.getSourceId()); - if (controller != null) { - Player player = game.getPlayer(controller); - if (player != null) { - getEffects().get(0).setTargetPointer(new FixedTarget(player.getId())); - ((PutLibraryIntoGraveTargetEffect) getEffects().get(0)).setAmount(new StaticValue(event.getAmount())); - return true; - } - } - } - return false; - } + @Override + public boolean checkTrigger(GameEvent event, Game game) { + if (event.getType() == GameEvent.EventType.DAMAGED_CREATURE && event.getTargetId().equals(this.sourceId)) { + UUID controller = game.getControllerId(event.getSourceId()); + if (controller != null) { + Player player = game.getPlayer(controller); + if (player != null) { + getEffects().get(0).setTargetPointer(new FixedTarget(player.getId())); + ((PutLibraryIntoGraveTargetEffect) getEffects().get(0)).setAmount(new StaticValue(event.getAmount())); + return true; + } + } + } + return false; + } - @Override - public String getRule() { - return "Whenever a source deals damage to {this}, that source's controller puts that many cards from the top of his or her library into his or her graveyard."; - } + @Override + public String getRule() { + return "Whenever a source deals damage to {this}, that source's controller puts that many cards from the top of his or her library into his or her graveyard."; + } } diff --git a/Mage.Sets/src/mage/sets/ravnika/BorosGuildmage.java b/Mage.Sets/src/mage/sets/ravnika/BorosGuildmage.java index 577aff59de..751558eaa6 100644 --- a/Mage.Sets/src/mage/sets/ravnika/BorosGuildmage.java +++ b/Mage.Sets/src/mage/sets/ravnika/BorosGuildmage.java @@ -54,8 +54,8 @@ public class BorosGuildmage extends CardImpl { this.expansionSetCode = "RAV"; this.subtype.add("Human"); this.subtype.add("Wizard"); - this.color.setWhite(true); - this.color.setRed(true); + this.color.setWhite(true); + this.color.setRed(true); this.power = new MageInt(2); this.toughness = new MageInt(2); Ability ability = new SimpleActivatedAbility(Constants.Zone.BATTLEFIELD, new GainAbilityTargetEffect(HasteAbility.getInstance(), Constants.Duration.EndOfTurn), new ManaCostsImpl("{1}{R}")); diff --git a/Mage.Sets/src/mage/sets/ravnika/CrownOfConvergence.java b/Mage.Sets/src/mage/sets/ravnika/CrownOfConvergence.java index 5a3d17094a..83d7c8b3a8 100644 --- a/Mage.Sets/src/mage/sets/ravnika/CrownOfConvergence.java +++ b/Mage.Sets/src/mage/sets/ravnika/CrownOfConvergence.java @@ -55,7 +55,7 @@ import mage.game.permanent.Permanent; * @author jeffwadsworth */ public class CrownOfConvergence extends CardImpl { - + private static final String rule1 = "As long as the top card of your library is a creature card, creatures you control that share a color with that card get +1/+1"; public CrownOfConvergence(UUID ownerId) { @@ -64,11 +64,11 @@ public class CrownOfConvergence extends CardImpl { // Play with the top card of your library revealed. this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new PlayWithTheTopCardRevealedEffect())); - + // As long as the top card of your library is a creature card, creatures you control that share a color with that card get +1/+1. ConditionalContinousEffect effect = new ConditionalContinousEffect(new CrownOfConvergenceColorBoostEffect(), new TopLibraryCardTypeCondition(CREATURE), rule1); this.addAbility(new SimpleStaticAbility(Constants.Zone.BATTLEFIELD, effect)); - + // {G}{W}: Put the top card of your library on the bottom of your library. this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new CrownOfConvergenceEffect(), new ManaCostsImpl("{G}{W}"))); } @@ -84,18 +84,18 @@ public class CrownOfConvergence extends CardImpl { } class CrownOfConvergenceColorBoostEffect extends BoostAllEffect { - + private final static FilterControlledCreaturePermanent filter = new FilterControlledCreaturePermanent("creatures you control"); private static final String effectText = "creatures you control that share a color with that card get +1/+1"; - + CrownOfConvergenceColorBoostEffect() { - super(1,1, Constants.Duration.WhileOnBattlefield, new FilterCreaturePermanent(), false); - staticText = effectText; + super(1,1, Constants.Duration.WhileOnBattlefield, new FilterCreaturePermanent(), false); + staticText = effectText; } CrownOfConvergenceColorBoostEffect(CrownOfConvergenceColorBoostEffect effect) { - super(effect); + super(effect); } @Override @@ -123,10 +123,10 @@ class CrownOfConvergenceColorBoostEffect extends BoostAllEffect { } class CrownOfConvergenceEffect extends OneShotEffect { - + public CrownOfConvergenceEffect() { - super(Constants.Outcome.Neutral); - staticText = "Put the top card of your library on the bottom of your library"; + super(Constants.Outcome.Neutral); + staticText = "Put the top card of your library on the bottom of your library"; } public CrownOfConvergenceEffect(final CrownOfConvergenceEffect effect) { @@ -150,5 +150,5 @@ class CrownOfConvergenceEffect extends OneShotEffect { } return false; } - + } diff --git a/Mage.Sets/src/mage/sets/ravnika/FistsOfIronwood.java b/Mage.Sets/src/mage/sets/ravnika/FistsOfIronwood.java index dffab37504..559f222d9f 100644 --- a/Mage.Sets/src/mage/sets/ravnika/FistsOfIronwood.java +++ b/Mage.Sets/src/mage/sets/ravnika/FistsOfIronwood.java @@ -60,11 +60,11 @@ public class FistsOfIronwood extends CardImpl { // Enchant creature TargetPermanent auraTarget = new TargetCreaturePermanent(); - this.getSpellAbility().addTarget(auraTarget); - this.getSpellAbility().addEffect(new AttachEffect(Constants.Outcome.BoostCreature)); - Ability ability = new EnchantAbility(auraTarget.getTargetName()); - this.addAbility(ability); - // When Fists of Ironwood enters the battlefield, put two 1/1 green Saproling creature tokens onto the battlefield. + this.getSpellAbility().addTarget(auraTarget); + this.getSpellAbility().addEffect(new AttachEffect(Constants.Outcome.BoostCreature)); + Ability ability = new EnchantAbility(auraTarget.getTargetName()); + this.addAbility(ability); + // When Fists of Ironwood enters the battlefield, put two 1/1 green Saproling creature tokens onto the battlefield. this.addAbility(new EntersBattlefieldTriggeredAbility(new CreateTokenEffect(new SaprolingToken(), 2), false)); // Enchanted creature has trample. this.addAbility(new SimpleStaticAbility(Constants.Zone.BATTLEFIELD, new GainAbilityAttachedEffect(TrampleAbility.getInstance(), Constants.AttachmentType.AURA))); diff --git a/Mage.Sets/src/mage/sets/ravnika/FlightOfFancy.java b/Mage.Sets/src/mage/sets/ravnika/FlightOfFancy.java index 7fed33d843..998b7f5e7d 100644 --- a/Mage.Sets/src/mage/sets/ravnika/FlightOfFancy.java +++ b/Mage.Sets/src/mage/sets/ravnika/FlightOfFancy.java @@ -59,10 +59,10 @@ public class FlightOfFancy extends CardImpl { // Enchant creature TargetPermanent auraTarget = new TargetCreaturePermanent(); - this.getSpellAbility().addTarget(auraTarget); - this.getSpellAbility().addEffect(new AttachEffect(Constants.Outcome.BoostCreature)); - Ability ability = new EnchantAbility(auraTarget.getTargetName()); - this.addAbility(ability); + this.getSpellAbility().addTarget(auraTarget); + this.getSpellAbility().addEffect(new AttachEffect(Constants.Outcome.BoostCreature)); + Ability ability = new EnchantAbility(auraTarget.getTargetName()); + this.addAbility(ability); // When Flight of Fancy enters the battlefield, draw two cards. this.addAbility(new EntersBattlefieldTriggeredAbility(new DrawCardControllerEffect(2), false)); // Enchanted creature has flying. diff --git a/Mage.Sets/src/mage/sets/ravnika/Forest1.java b/Mage.Sets/src/mage/sets/ravnika/Forest1.java index 857e39e865..9a2be5bcf6 100644 --- a/Mage.Sets/src/mage/sets/ravnika/Forest1.java +++ b/Mage.Sets/src/mage/sets/ravnika/Forest1.java @@ -36,16 +36,16 @@ import java.util.UUID; public class Forest1 extends mage.cards.basiclands.Forest { public Forest1(UUID ownerId) { - super(ownerId, 303); - this.expansionSetCode = "RAV"; - } + super(ownerId, 303); + this.expansionSetCode = "RAV"; + } - public Forest1(final Forest1 card) { - super(card); - } + public Forest1(final Forest1 card) { + super(card); + } - @Override - public Forest1 copy() { - return new Forest1(this); - } + @Override + public Forest1 copy() { + return new Forest1(this); + } } diff --git a/Mage.Sets/src/mage/sets/ravnika/Forest2.java b/Mage.Sets/src/mage/sets/ravnika/Forest2.java index e28f66466c..f7543d12af 100644 --- a/Mage.Sets/src/mage/sets/ravnika/Forest2.java +++ b/Mage.Sets/src/mage/sets/ravnika/Forest2.java @@ -36,16 +36,16 @@ import java.util.UUID; public class Forest2 extends mage.cards.basiclands.Forest { public Forest2(UUID ownerId) { - super(ownerId, 304); - this.expansionSetCode = "RAV"; - } + super(ownerId, 304); + this.expansionSetCode = "RAV"; + } - public Forest2(final Forest2 card) { - super(card); - } + public Forest2(final Forest2 card) { + super(card); + } - @Override - public Forest2 copy() { - return new Forest2(this); - } + @Override + public Forest2 copy() { + return new Forest2(this); + } } diff --git a/Mage.Sets/src/mage/sets/ravnika/Forest3.java b/Mage.Sets/src/mage/sets/ravnika/Forest3.java index 706a47f0cb..6128eb938e 100644 --- a/Mage.Sets/src/mage/sets/ravnika/Forest3.java +++ b/Mage.Sets/src/mage/sets/ravnika/Forest3.java @@ -36,16 +36,16 @@ import java.util.UUID; public class Forest3 extends mage.cards.basiclands.Forest { public Forest3(UUID ownerId) { - super(ownerId, 305); - this.expansionSetCode = "RAV"; - } + super(ownerId, 305); + this.expansionSetCode = "RAV"; + } - public Forest3(final Forest3 card) { - super(card); - } + public Forest3(final Forest3 card) { + super(card); + } - @Override - public Forest3 copy() { - return new Forest3(this); - } + @Override + public Forest3 copy() { + return new Forest3(this); + } } diff --git a/Mage.Sets/src/mage/sets/ravnika/Forest4.java b/Mage.Sets/src/mage/sets/ravnika/Forest4.java index 6e4d066222..8bd3aa7f17 100644 --- a/Mage.Sets/src/mage/sets/ravnika/Forest4.java +++ b/Mage.Sets/src/mage/sets/ravnika/Forest4.java @@ -36,16 +36,16 @@ import java.util.UUID; public class Forest4 extends mage.cards.basiclands.Forest { public Forest4(UUID ownerId) { - super(ownerId, 306); - this.expansionSetCode = "RAV"; - } + super(ownerId, 306); + this.expansionSetCode = "RAV"; + } - public Forest4(final Forest4 card) { - super(card); - } + public Forest4(final Forest4 card) { + super(card); + } - @Override - public Forest4 copy() { - return new Forest4(this); - } + @Override + public Forest4 copy() { + return new Forest4(this); + } } diff --git a/Mage.Sets/src/mage/sets/ravnika/GalvanicArc.java b/Mage.Sets/src/mage/sets/ravnika/GalvanicArc.java index 4d2f2286ab..72d0366c60 100644 --- a/Mage.Sets/src/mage/sets/ravnika/GalvanicArc.java +++ b/Mage.Sets/src/mage/sets/ravnika/GalvanicArc.java @@ -60,11 +60,11 @@ public class GalvanicArc extends CardImpl { // Enchant creature TargetPermanent auraTarget = new TargetCreaturePermanent(); - this.getSpellAbility().addTarget(auraTarget); - this.getSpellAbility().addEffect(new AttachEffect(Constants.Outcome.BoostCreature)); - Ability ability = new EnchantAbility(auraTarget.getTargetName()); - this.addAbility(ability); - // When Galvanic Arc enters the battlefield, it deals 3 damage to target creature or player. + this.getSpellAbility().addTarget(auraTarget); + this.getSpellAbility().addEffect(new AttachEffect(Constants.Outcome.BoostCreature)); + Ability ability = new EnchantAbility(auraTarget.getTargetName()); + this.addAbility(ability); + // When Galvanic Arc enters the battlefield, it deals 3 damage to target creature or player. Ability triggeredAbility = new EntersBattlefieldTriggeredAbility(new DamageTargetEffect(3)); triggeredAbility.addTarget(new TargetCreatureOrPlayer()); this.addAbility(triggeredAbility); diff --git a/Mage.Sets/src/mage/sets/ravnika/HalcyonGlaze.java b/Mage.Sets/src/mage/sets/ravnika/HalcyonGlaze.java index 7ee89d268d..ff1419f3ea 100644 --- a/Mage.Sets/src/mage/sets/ravnika/HalcyonGlaze.java +++ b/Mage.Sets/src/mage/sets/ravnika/HalcyonGlaze.java @@ -52,7 +52,7 @@ public class HalcyonGlaze extends CardImpl { filter.getCardType().add(CardType.CREATURE); filter.setScopeCardType(Filter.ComparisonScope.Any); } - + public HalcyonGlaze(UUID ownerId) { super(ownerId, 54, "Halcyon Glaze", Rarity.UNCOMMON, new CardType[]{CardType.ENCHANTMENT}, "{1}{U}{U}"); this.expansionSetCode = "RAV"; diff --git a/Mage.Sets/src/mage/sets/ravnika/Island1.java b/Mage.Sets/src/mage/sets/ravnika/Island1.java index 6fe6e23303..0393a5f9bf 100644 --- a/Mage.Sets/src/mage/sets/ravnika/Island1.java +++ b/Mage.Sets/src/mage/sets/ravnika/Island1.java @@ -36,18 +36,18 @@ import java.util.UUID; */ public class Island1 extends mage.cards.basiclands.Island { - public Island1(UUID ownerId) { - super(ownerId, 291); - this.expansionSetCode = "RAV"; - } + public Island1(UUID ownerId) { + super(ownerId, 291); + this.expansionSetCode = "RAV"; + } - public Island1(final Island1 card) { - super(card); - } + public Island1(final Island1 card) { + super(card); + } - @Override - public Island1 copy() { - return new Island1(this); - } + @Override + public Island1 copy() { + return new Island1(this); + } } diff --git a/Mage.Sets/src/mage/sets/ravnika/Island2.java b/Mage.Sets/src/mage/sets/ravnika/Island2.java index 057e5244f7..65b5f39b52 100644 --- a/Mage.Sets/src/mage/sets/ravnika/Island2.java +++ b/Mage.Sets/src/mage/sets/ravnika/Island2.java @@ -36,18 +36,18 @@ import java.util.UUID; */ public class Island2 extends mage.cards.basiclands.Island { - public Island2(UUID ownerId) { - super(ownerId, 292); - this.expansionSetCode = "RAV"; - } + public Island2(UUID ownerId) { + super(ownerId, 292); + this.expansionSetCode = "RAV"; + } - public Island2(final Island2 card) { - super(card); - } + public Island2(final Island2 card) { + super(card); + } - @Override - public Island2 copy() { - return new Island2(this); - } + @Override + public Island2 copy() { + return new Island2(this); + } } diff --git a/Mage.Sets/src/mage/sets/ravnika/Island3.java b/Mage.Sets/src/mage/sets/ravnika/Island3.java index 877725badc..1e59036703 100644 --- a/Mage.Sets/src/mage/sets/ravnika/Island3.java +++ b/Mage.Sets/src/mage/sets/ravnika/Island3.java @@ -36,18 +36,18 @@ import java.util.UUID; */ public class Island3 extends mage.cards.basiclands.Island { - public Island3(UUID ownerId) { - super(ownerId, 293); - this.expansionSetCode = "RAV"; - } + public Island3(UUID ownerId) { + super(ownerId, 293); + this.expansionSetCode = "RAV"; + } - public Island3(final Island3 card) { - super(card); - } + public Island3(final Island3 card) { + super(card); + } - @Override - public Island3 copy() { - return new Island3(this); - } + @Override + public Island3 copy() { + return new Island3(this); + } } diff --git a/Mage.Sets/src/mage/sets/ravnika/Island4.java b/Mage.Sets/src/mage/sets/ravnika/Island4.java index 4e00271ed2..09b7687d15 100644 --- a/Mage.Sets/src/mage/sets/ravnika/Island4.java +++ b/Mage.Sets/src/mage/sets/ravnika/Island4.java @@ -36,18 +36,18 @@ import java.util.UUID; */ public class Island4 extends mage.cards.basiclands.Island { - public Island4(UUID ownerId) { - super(ownerId, 294); - this.expansionSetCode = "RAV"; - } + public Island4(UUID ownerId) { + super(ownerId, 294); + this.expansionSetCode = "RAV"; + } - public Island4(final Island4 card) { - super(card); - } + public Island4(final Island4 card) { + super(card); + } - @Override - public Island4 copy() { - return new Island4(this); - } + @Override + public Island4 copy() { + return new Island4(this); + } } diff --git a/Mage.Sets/src/mage/sets/ravnika/Mountain1.java b/Mage.Sets/src/mage/sets/ravnika/Mountain1.java index d556967d61..3da3d7cc3d 100644 --- a/Mage.Sets/src/mage/sets/ravnika/Mountain1.java +++ b/Mage.Sets/src/mage/sets/ravnika/Mountain1.java @@ -36,19 +36,19 @@ import java.util.UUID; */ public class Mountain1 extends mage.cards.basiclands.Mountain { - public Mountain1(UUID ownerId) { - super(ownerId, 299); - this.expansionSetCode = "RAV"; - } + public Mountain1(UUID ownerId) { + super(ownerId, 299); + this.expansionSetCode = "RAV"; + } - public Mountain1(final Mountain1 card) { - super(card); - } + public Mountain1(final Mountain1 card) { + super(card); + } - @Override - public Mountain1 copy() { - return new Mountain1(this); - } + @Override + public Mountain1 copy() { + return new Mountain1(this); + } } diff --git a/Mage.Sets/src/mage/sets/ravnika/Mountain2.java b/Mage.Sets/src/mage/sets/ravnika/Mountain2.java index 9f7a199240..9a3a93e860 100644 --- a/Mage.Sets/src/mage/sets/ravnika/Mountain2.java +++ b/Mage.Sets/src/mage/sets/ravnika/Mountain2.java @@ -36,18 +36,18 @@ import java.util.UUID; */ public class Mountain2 extends mage.cards.basiclands.Mountain { - public Mountain2(UUID ownerId) { - super(ownerId, 300); - this.expansionSetCode = "RAV"; - } + public Mountain2(UUID ownerId) { + super(ownerId, 300); + this.expansionSetCode = "RAV"; + } - public Mountain2(final Mountain2 card) { - super(card); - } + public Mountain2(final Mountain2 card) { + super(card); + } - @Override - public Mountain2 copy() { - return new Mountain2(this); - } + @Override + public Mountain2 copy() { + return new Mountain2(this); + } } diff --git a/Mage.Sets/src/mage/sets/ravnika/Mountain3.java b/Mage.Sets/src/mage/sets/ravnika/Mountain3.java index 0f7e81d65a..0043de2d39 100644 --- a/Mage.Sets/src/mage/sets/ravnika/Mountain3.java +++ b/Mage.Sets/src/mage/sets/ravnika/Mountain3.java @@ -36,18 +36,18 @@ import java.util.UUID; */ public class Mountain3 extends mage.cards.basiclands.Mountain { - public Mountain3(UUID ownerId) { - super(ownerId, 301); - this.expansionSetCode = "RAV"; - } + public Mountain3(UUID ownerId) { + super(ownerId, 301); + this.expansionSetCode = "RAV"; + } - public Mountain3(final Mountain3 card) { - super(card); - } + public Mountain3(final Mountain3 card) { + super(card); + } - @Override - public Mountain3 copy() { - return new Mountain3(this); - } + @Override + public Mountain3 copy() { + return new Mountain3(this); + } } diff --git a/Mage.Sets/src/mage/sets/ravnika/Mountain4.java b/Mage.Sets/src/mage/sets/ravnika/Mountain4.java index 7e21fca7f1..17cad6b7ba 100644 --- a/Mage.Sets/src/mage/sets/ravnika/Mountain4.java +++ b/Mage.Sets/src/mage/sets/ravnika/Mountain4.java @@ -36,18 +36,18 @@ import java.util.UUID; */ public class Mountain4 extends mage.cards.basiclands.Mountain { - public Mountain4(UUID ownerId) { - super(ownerId, 302); - this.expansionSetCode = "RAV"; - } + public Mountain4(UUID ownerId) { + super(ownerId, 302); + this.expansionSetCode = "RAV"; + } - public Mountain4(final Mountain4 card) { - super(card); - } + public Mountain4(final Mountain4 card) { + super(card); + } - @Override - public Mountain4 copy() { - return new Mountain4(this); - } + @Override + public Mountain4 copy() { + return new Mountain4(this); + } } diff --git a/Mage.Sets/src/mage/sets/ravnika/MuddleTheMixture.java b/Mage.Sets/src/mage/sets/ravnika/MuddleTheMixture.java index 6bd19607eb..19c497dc7b 100644 --- a/Mage.Sets/src/mage/sets/ravnika/MuddleTheMixture.java +++ b/Mage.Sets/src/mage/sets/ravnika/MuddleTheMixture.java @@ -58,7 +58,7 @@ public class MuddleTheMixture extends CardImpl { // Counter target instant or sorcery spell. this.getSpellAbility().addTarget(new TargetSpell(filter)); - this.getSpellAbility().addEffect(new CounterTargetEffect()); + this.getSpellAbility().addEffect(new CounterTargetEffect()); // Transmute {1}{U}{U} this.addAbility(new TransmuteAbility("{1}{U}{U}")); } diff --git a/Mage.Sets/src/mage/sets/ravnika/Plains1.java b/Mage.Sets/src/mage/sets/ravnika/Plains1.java index a6f3a9f7cb..04b128c89d 100644 --- a/Mage.Sets/src/mage/sets/ravnika/Plains1.java +++ b/Mage.Sets/src/mage/sets/ravnika/Plains1.java @@ -36,18 +36,18 @@ import java.util.UUID; */ public class Plains1 extends mage.cards.basiclands.Plains { - public Plains1(UUID ownerId) { - super(ownerId, 287); - this.expansionSetCode = "RAV"; - } + public Plains1(UUID ownerId) { + super(ownerId, 287); + this.expansionSetCode = "RAV"; + } - public Plains1(final Plains1 card) { - super(card); - } + public Plains1(final Plains1 card) { + super(card); + } - @Override - public Plains1 copy() { - return new Plains1(this); - } + @Override + public Plains1 copy() { + return new Plains1(this); + } } diff --git a/Mage.Sets/src/mage/sets/ravnika/Plains2.java b/Mage.Sets/src/mage/sets/ravnika/Plains2.java index 5a6783afea..0b51051fa2 100644 --- a/Mage.Sets/src/mage/sets/ravnika/Plains2.java +++ b/Mage.Sets/src/mage/sets/ravnika/Plains2.java @@ -36,18 +36,18 @@ import java.util.UUID; */ public class Plains2 extends mage.cards.basiclands.Plains { - public Plains2(UUID ownerId) { - super(ownerId, 288); - this.expansionSetCode = "RAV"; - } + public Plains2(UUID ownerId) { + super(ownerId, 288); + this.expansionSetCode = "RAV"; + } - public Plains2(final Plains2 card) { - super(card); - } + public Plains2(final Plains2 card) { + super(card); + } - @Override - public Plains2 copy() { - return new Plains2(this); - } + @Override + public Plains2 copy() { + return new Plains2(this); + } } diff --git a/Mage.Sets/src/mage/sets/ravnika/Plains3.java b/Mage.Sets/src/mage/sets/ravnika/Plains3.java index b5858d43ae..5dcb0736d6 100644 --- a/Mage.Sets/src/mage/sets/ravnika/Plains3.java +++ b/Mage.Sets/src/mage/sets/ravnika/Plains3.java @@ -36,18 +36,18 @@ import java.util.UUID; */ public class Plains3 extends mage.cards.basiclands.Plains { - public Plains3(UUID ownerId) { - super(ownerId, 289); - this.expansionSetCode = "RAV"; - } + public Plains3(UUID ownerId) { + super(ownerId, 289); + this.expansionSetCode = "RAV"; + } - public Plains3(final Plains3 card) { - super(card); - } + public Plains3(final Plains3 card) { + super(card); + } - @Override - public Plains3 copy() { - return new Plains3(this); - } + @Override + public Plains3 copy() { + return new Plains3(this); + } } diff --git a/Mage.Sets/src/mage/sets/ravnika/Plains4.java b/Mage.Sets/src/mage/sets/ravnika/Plains4.java index fb6647b889..9d937b2f1a 100644 --- a/Mage.Sets/src/mage/sets/ravnika/Plains4.java +++ b/Mage.Sets/src/mage/sets/ravnika/Plains4.java @@ -36,18 +36,18 @@ import java.util.UUID; */ public class Plains4 extends mage.cards.basiclands.Plains { - public Plains4(UUID ownerId) { - super(ownerId, 290); - this.expansionSetCode = "RAV"; - } + public Plains4(UUID ownerId) { + super(ownerId, 290); + this.expansionSetCode = "RAV"; + } - public Plains4(final Plains4 card) { - super(card); - } + public Plains4(final Plains4 card) { + super(card); + } - @Override - public Plains4 copy() { - return new Plains4(this); - } + @Override + public Plains4 copy() { + return new Plains4(this); + } } diff --git a/Mage.Sets/src/mage/sets/ravnika/PrimordialSage.java b/Mage.Sets/src/mage/sets/ravnika/PrimordialSage.java index 84086c82a8..63523697d0 100644 --- a/Mage.Sets/src/mage/sets/ravnika/PrimordialSage.java +++ b/Mage.Sets/src/mage/sets/ravnika/PrimordialSage.java @@ -49,7 +49,7 @@ public class PrimordialSage extends CardImpl { filter.getCardType().add(CardType.CREATURE); filter.setScopeCardType(Filter.ComparisonScope.Any); } - + public PrimordialSage(UUID ownerId) { super(ownerId, 177, "Primordial Sage", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{4}{G}{G}"); this.expansionSetCode = "RAV"; diff --git a/Mage.Sets/src/mage/sets/ravnika/Swamp1.java b/Mage.Sets/src/mage/sets/ravnika/Swamp1.java index 893ffb4f0c..71f2e95d27 100644 --- a/Mage.Sets/src/mage/sets/ravnika/Swamp1.java +++ b/Mage.Sets/src/mage/sets/ravnika/Swamp1.java @@ -36,18 +36,18 @@ import java.util.UUID; */ public class Swamp1 extends mage.cards.basiclands.Swamp { - public Swamp1(UUID ownerId) { - super(ownerId, 295); - this.expansionSetCode = "RAV"; - } + public Swamp1(UUID ownerId) { + super(ownerId, 295); + this.expansionSetCode = "RAV"; + } - public Swamp1(final Swamp1 card) { - super(card); - } + public Swamp1(final Swamp1 card) { + super(card); + } - @Override - public Swamp1 copy() { - return new Swamp1(this); - } + @Override + public Swamp1 copy() { + return new Swamp1(this); + } } diff --git a/Mage.Sets/src/mage/sets/ravnika/Swamp2.java b/Mage.Sets/src/mage/sets/ravnika/Swamp2.java index d2509b9e0a..3f9ce4d296 100644 --- a/Mage.Sets/src/mage/sets/ravnika/Swamp2.java +++ b/Mage.Sets/src/mage/sets/ravnika/Swamp2.java @@ -36,18 +36,18 @@ import java.util.UUID; */ public class Swamp2 extends mage.cards.basiclands.Swamp { - public Swamp2(UUID ownerId) { - super(ownerId, 296); - this.expansionSetCode = "RAV"; - } + public Swamp2(UUID ownerId) { + super(ownerId, 296); + this.expansionSetCode = "RAV"; + } - public Swamp2(final Swamp2 card) { - super(card); - } + public Swamp2(final Swamp2 card) { + super(card); + } - @Override - public Swamp2 copy() { - return new Swamp2(this); - } + @Override + public Swamp2 copy() { + return new Swamp2(this); + } } diff --git a/Mage.Sets/src/mage/sets/ravnika/Swamp3.java b/Mage.Sets/src/mage/sets/ravnika/Swamp3.java index 0a23b877ff..75b0b16b9b 100644 --- a/Mage.Sets/src/mage/sets/ravnika/Swamp3.java +++ b/Mage.Sets/src/mage/sets/ravnika/Swamp3.java @@ -36,18 +36,18 @@ import java.util.UUID; */ public class Swamp3 extends mage.cards.basiclands.Swamp { - public Swamp3(UUID ownerId) { - super(ownerId, 297); - this.expansionSetCode = "RAV"; - } + public Swamp3(UUID ownerId) { + super(ownerId, 297); + this.expansionSetCode = "RAV"; + } - public Swamp3(final Swamp3 card) { - super(card); - } + public Swamp3(final Swamp3 card) { + super(card); + } - @Override - public Swamp3 copy() { - return new Swamp3(this); - } + @Override + public Swamp3 copy() { + return new Swamp3(this); + } } diff --git a/Mage.Sets/src/mage/sets/ravnika/Swamp4.java b/Mage.Sets/src/mage/sets/ravnika/Swamp4.java index 20bed111b3..851da1ff6d 100644 --- a/Mage.Sets/src/mage/sets/ravnika/Swamp4.java +++ b/Mage.Sets/src/mage/sets/ravnika/Swamp4.java @@ -36,18 +36,18 @@ import java.util.UUID; */ public class Swamp4 extends mage.cards.basiclands.Swamp { - public Swamp4(UUID ownerId) { - super(ownerId, 298); - this.expansionSetCode = "RAV"; - } + public Swamp4(UUID ownerId) { + super(ownerId, 298); + this.expansionSetCode = "RAV"; + } - public Swamp4(final Swamp4 card) { - super(card); - } + public Swamp4(final Swamp4 card) { + super(card); + } - @Override - public Swamp4 copy() { - return new Swamp4(this); - } + @Override + public Swamp4 copy() { + return new Swamp4(this); + } } diff --git a/Mage.Sets/src/mage/sets/ravnika/VinelasherKudzu.java b/Mage.Sets/src/mage/sets/ravnika/VinelasherKudzu.java index 2c7df8eff9..ce67a2cab1 100644 --- a/Mage.Sets/src/mage/sets/ravnika/VinelasherKudzu.java +++ b/Mage.Sets/src/mage/sets/ravnika/VinelasherKudzu.java @@ -68,21 +68,21 @@ public class VinelasherKudzu extends CardImpl { class VinelasherKudzuAbility extends LandfallAbility { - VinelasherKudzuAbility() { - super(new AddCountersSourceEffect(CounterType.P1P1.createInstance()), false); - } + VinelasherKudzuAbility() { + super(new AddCountersSourceEffect(CounterType.P1P1.createInstance()), false); + } - public VinelasherKudzuAbility(final VinelasherKudzuAbility ability) { - super(ability); - } + public VinelasherKudzuAbility(final VinelasherKudzuAbility ability) { + super(ability); + } - @Override - public String getRule() { - return "Whenever a land enters the battlefield under your control, put a +1/+1 counter on {this}."; - } + @Override + public String getRule() { + return "Whenever a land enters the battlefield under your control, put a +1/+1 counter on {this}."; + } - @Override - public LandfallAbility copy() { - return new VinelasherKudzuAbility(this); - } + @Override + public LandfallAbility copy() { + return new VinelasherKudzuAbility(this); + } } diff --git a/Mage.Sets/src/mage/sets/ravnika/WateryGrave.java b/Mage.Sets/src/mage/sets/ravnika/WateryGrave.java index 0ef202cf1e..5435a29f2d 100644 --- a/Mage.Sets/src/mage/sets/ravnika/WateryGrave.java +++ b/Mage.Sets/src/mage/sets/ravnika/WateryGrave.java @@ -44,23 +44,23 @@ import mage.cards.CardImpl; */ public class WateryGrave extends CardImpl { - public WateryGrave(UUID ownerId) { - super(ownerId, 286, "Watery Grave", Rarity.RARE, new CardType[]{CardType.LAND}, null); - this.expansionSetCode = "RAV"; - this.subtype.add("Island"); - this.subtype.add("Swamp"); - this.addAbility(new BlueManaAbility()); - this.addAbility(new BlackManaAbility()); - this.addAbility(new EntersBattlefieldAbility(new TapSourceUnlessPaysEffect(new PayLifeCost(2)), "As {this} enters the battlefield, you may pay 2 life. If you don't, {this} enters the battlefield tapped")); - } + public WateryGrave(UUID ownerId) { + super(ownerId, 286, "Watery Grave", Rarity.RARE, new CardType[]{CardType.LAND}, null); + this.expansionSetCode = "RAV"; + this.subtype.add("Island"); + this.subtype.add("Swamp"); + this.addAbility(new BlueManaAbility()); + this.addAbility(new BlackManaAbility()); + this.addAbility(new EntersBattlefieldAbility(new TapSourceUnlessPaysEffect(new PayLifeCost(2)), "As {this} enters the battlefield, you may pay 2 life. If you don't, {this} enters the battlefield tapped")); + } - public WateryGrave(final WateryGrave card) { - super(card); - } + public WateryGrave(final WateryGrave card) { + super(card); + } - @Override - public WateryGrave copy() { - return new WateryGrave(this); - } + @Override + public WateryGrave copy() { + return new WateryGrave(this); + } } diff --git a/Mage.Sets/src/mage/sets/riseoftheeldrazi/AncientStirrings.java b/Mage.Sets/src/mage/sets/riseoftheeldrazi/AncientStirrings.java index 1b623008db..fc34a1b7de 100644 --- a/Mage.Sets/src/mage/sets/riseoftheeldrazi/AncientStirrings.java +++ b/Mage.Sets/src/mage/sets/riseoftheeldrazi/AncientStirrings.java @@ -52,8 +52,8 @@ public class AncientStirrings extends CardImpl { public AncientStirrings (UUID ownerId) { super(ownerId, 174, "Ancient Stirrings", Rarity.COMMON, new CardType[]{CardType.SORCERY}, "{G}"); this.expansionSetCode = "ROE"; - this.color.setGreen(true); - + this.color.setGreen(true); + // Look at the top five cards of your library. You may reveal a colorless card from among them and put it into your hand. // Then put the rest on the bottom of your library in any order. (Cards with no colored mana in their mana costs are colorless. Lands are also colorless.) this.getSpellAbility().addEffect(new LookLibraryAndPickControllerEffect(new StaticValue(5), false, new StaticValue(1), filter, false)); diff --git a/Mage.Sets/src/mage/sets/riseoftheeldrazi/AngelheartVial.java b/Mage.Sets/src/mage/sets/riseoftheeldrazi/AngelheartVial.java index 238ebdb314..245580187c 100644 --- a/Mage.Sets/src/mage/sets/riseoftheeldrazi/AngelheartVial.java +++ b/Mage.Sets/src/mage/sets/riseoftheeldrazi/AngelheartVial.java @@ -59,7 +59,7 @@ public class AngelheartVial extends CardImpl { // Whenever you're dealt damage, you may put that many charge counters on Angelheart Vial. this.addAbility(new AngelheartVialTriggeredAbility()); - + // {2}, {tap}, Remove four charge counters from Angelheart Vial: You gain 2 life and draw a card. Ability ability = new SimpleActivatedAbility(Constants.Zone.BATTLEFIELD, new GainLifeEffect(2), new GenericManaCost(2)); ability.addCost(new TapSourceCost()); @@ -80,49 +80,49 @@ public class AngelheartVial extends CardImpl { class AngelheartVialTriggeredAbility extends TriggeredAbilityImpl { - public AngelheartVialTriggeredAbility() { - super(Constants.Zone.BATTLEFIELD, new AngelheartVialEffect(), true); - } + public AngelheartVialTriggeredAbility() { + super(Constants.Zone.BATTLEFIELD, new AngelheartVialEffect(), true); + } - public AngelheartVialTriggeredAbility(final AngelheartVialTriggeredAbility ability) { - super(ability); - } + public AngelheartVialTriggeredAbility(final AngelheartVialTriggeredAbility ability) { + super(ability); + } - @Override - public AngelheartVialTriggeredAbility copy() { - return new AngelheartVialTriggeredAbility(this); - } + @Override + public AngelheartVialTriggeredAbility copy() { + return new AngelheartVialTriggeredAbility(this); + } - @Override - public boolean checkTrigger(GameEvent event, Game game) { - if ((event.getType() == GameEvent.EventType.DAMAGED_PLAYER && event.getTargetId().equals(this.getControllerId()))) { + @Override + public boolean checkTrigger(GameEvent event, Game game) { + if ((event.getType() == GameEvent.EventType.DAMAGED_PLAYER && event.getTargetId().equals(this.getControllerId()))) { this.getEffects().get(0).setValue("damageAmount", event.getAmount()); return true; } - return false; - } + return false; + } - @Override - public String getRule() { - return "Whenever you are dealt damage, you may put that many charge counters on {this}"; - } + @Override + public String getRule() { + return "Whenever you are dealt damage, you may put that many charge counters on {this}"; + } } class AngelheartVialEffect extends OneShotEffect { - + public AngelheartVialEffect() { super(Outcome.Benefit); } - + public AngelheartVialEffect(final AngelheartVialEffect effect) { super(effect); } - + @Override public AngelheartVialEffect copy() { return new AngelheartVialEffect(this); } - + @Override public boolean apply(Game game, Ability source) { Permanent permanent = game.getPermanent(source.getSourceId()); diff --git a/Mage.Sets/src/mage/sets/riseoftheeldrazi/ArrogantBloodlord.java b/Mage.Sets/src/mage/sets/riseoftheeldrazi/ArrogantBloodlord.java index 383fe81e6a..b02d21a173 100644 --- a/Mage.Sets/src/mage/sets/riseoftheeldrazi/ArrogantBloodlord.java +++ b/Mage.Sets/src/mage/sets/riseoftheeldrazi/ArrogantBloodlord.java @@ -112,16 +112,16 @@ class ArrogantBloodlordTriggeredAbility extends TriggeredAbilityImpl { - + ArrogantBloodlordEffect() { super(Outcome.Detriment); staticText = "Destroy {this} at the end of combat"; } - + ArrogantBloodlordEffect(final ArrogantBloodlordEffect effect) { super(effect); } - + @Override public boolean apply(Game game, Ability source) { Permanent permanent = game.getPermanent(source.getSourceId()); @@ -135,11 +135,11 @@ class ArrogantBloodlordEffect extends OneShotEffect { } return false; } - + @Override public ArrogantBloodlordEffect copy() { return new ArrogantBloodlordEffect(this); } } - - + + diff --git a/Mage.Sets/src/mage/sets/riseoftheeldrazi/AwakeningZone.java b/Mage.Sets/src/mage/sets/riseoftheeldrazi/AwakeningZone.java index 8ab01c8d98..98e5a2a4a2 100644 --- a/Mage.Sets/src/mage/sets/riseoftheeldrazi/AwakeningZone.java +++ b/Mage.Sets/src/mage/sets/riseoftheeldrazi/AwakeningZone.java @@ -43,20 +43,20 @@ import mage.game.permanent.token.EldraziSpawnToken; */ public class AwakeningZone extends CardImpl { - public AwakeningZone(UUID ownerId) { - super(ownerId, 176, "Awakening Zone", Rarity.RARE, new CardType[]{CardType.ENCHANTMENT}, "{2}{G}"); - this.expansionSetCode = "ROE"; - this.getColor().setGreen(true); - this.addAbility(new OnEventTriggeredAbility(EventType.UPKEEP_STEP_PRE, "beginning of your upkeep", new CreateTokenEffect(new EldraziSpawnToken()), true)); - } + public AwakeningZone(UUID ownerId) { + super(ownerId, 176, "Awakening Zone", Rarity.RARE, new CardType[]{CardType.ENCHANTMENT}, "{2}{G}"); + this.expansionSetCode = "ROE"; + this.getColor().setGreen(true); + this.addAbility(new OnEventTriggeredAbility(EventType.UPKEEP_STEP_PRE, "beginning of your upkeep", new CreateTokenEffect(new EldraziSpawnToken()), true)); + } - public AwakeningZone(final AwakeningZone card) { - super(card); - } + public AwakeningZone(final AwakeningZone card) { + super(card); + } - @Override - public AwakeningZone copy() { - return new AwakeningZone(this); - } + @Override + public AwakeningZone copy() { + return new AwakeningZone(this); + } } diff --git a/Mage.Sets/src/mage/sets/riseoftheeldrazi/BanefulOmen.java b/Mage.Sets/src/mage/sets/riseoftheeldrazi/BanefulOmen.java index f2e774e0d5..1f8c6e423e 100644 --- a/Mage.Sets/src/mage/sets/riseoftheeldrazi/BanefulOmen.java +++ b/Mage.Sets/src/mage/sets/riseoftheeldrazi/BanefulOmen.java @@ -68,22 +68,22 @@ public class BanefulOmen extends CardImpl { public BanefulOmen copy() { return new BanefulOmen(this); } - + class BanefulOmenTriggeredAbility extends TriggeredAbilityImpl { - + public BanefulOmenTriggeredAbility() { super(Zone.BATTLEFIELD, new BanefulOmenEffect(), true); } - + public BanefulOmenTriggeredAbility(BanefulOmenTriggeredAbility ability) { super(ability); } - + @Override public BanefulOmenTriggeredAbility copy() { return new BanefulOmenTriggeredAbility(this); } - + @Override public boolean checkTrigger(GameEvent event, Game game) { if (event.getType() == GameEvent.EventType.END_PHASE_PRE && event.getPlayerId().equals(this.controllerId)) { @@ -91,23 +91,23 @@ public class BanefulOmen extends CardImpl { } return false; } - + @Override public String getRule() { return "At the beginning of your end step, you may reveal the top card of your library. If you do, each opponent loses life equal to that card's converted mana cost."; } } - + class BanefulOmenEffect extends OneShotEffect { - + public BanefulOmenEffect() { super(Outcome.Benefit); } - + public BanefulOmenEffect(final BanefulOmenEffect effect) { super(effect); } - + @Override public boolean apply(Game game, Ability source) { Player player = game.getPlayer(source.getControllerId()); diff --git a/Mage.Sets/src/mage/sets/riseoftheeldrazi/BattleRattleShaman.java b/Mage.Sets/src/mage/sets/riseoftheeldrazi/BattleRattleShaman.java index 45759b2f29..ee71c409e9 100644 --- a/Mage.Sets/src/mage/sets/riseoftheeldrazi/BattleRattleShaman.java +++ b/Mage.Sets/src/mage/sets/riseoftheeldrazi/BattleRattleShaman.java @@ -58,7 +58,7 @@ public class BattleRattleShaman extends CardImpl { Ability ability = new BeginningOfCombatTriggeredAbility(Constants.Zone.BATTLEFIELD, new BoostTargetEffect(2, 0, Constants.Duration.EndOfTurn), Constants.TargetController.YOU, true); ability.addTarget(new TargetCreaturePermanent()); this.addAbility(ability); - + } public BattleRattleShaman(final BattleRattleShaman card) { diff --git a/Mage.Sets/src/mage/sets/riseoftheeldrazi/BloodthroneVampire.java b/Mage.Sets/src/mage/sets/riseoftheeldrazi/BloodthroneVampire.java index 4985c085c8..fbd05c71a3 100644 --- a/Mage.Sets/src/mage/sets/riseoftheeldrazi/BloodthroneVampire.java +++ b/Mage.Sets/src/mage/sets/riseoftheeldrazi/BloodthroneVampire.java @@ -46,22 +46,22 @@ import mage.target.common.TargetControlledCreaturePermanent; */ public class BloodthroneVampire extends CardImpl { - public BloodthroneVampire(UUID ownerId) { - super(ownerId, 98, "Bloodthrone Vampire", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{1}{B}"); - this.expansionSetCode = "ROE"; - this.color.setBlack(true); - this.subtype.add("Vampire"); - this.power = new MageInt(1); - this.toughness = new MageInt(1); - this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new BoostSourceEffect(2, 2, Duration.EndOfTurn), new SacrificeTargetCost(new TargetControlledCreaturePermanent()))); - } + public BloodthroneVampire(UUID ownerId) { + super(ownerId, 98, "Bloodthrone Vampire", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{1}{B}"); + this.expansionSetCode = "ROE"; + this.color.setBlack(true); + this.subtype.add("Vampire"); + this.power = new MageInt(1); + this.toughness = new MageInt(1); + this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new BoostSourceEffect(2, 2, Duration.EndOfTurn), new SacrificeTargetCost(new TargetControlledCreaturePermanent()))); + } - public BloodthroneVampire(final BloodthroneVampire card) { - super(card); - } + public BloodthroneVampire(final BloodthroneVampire card) { + super(card); + } - @Override - public BloodthroneVampire copy() { - return new BloodthroneVampire(this); - } + @Override + public BloodthroneVampire copy() { + return new BloodthroneVampire(this); + } } diff --git a/Mage.Sets/src/mage/sets/riseoftheeldrazi/BoarUmbra.java b/Mage.Sets/src/mage/sets/riseoftheeldrazi/BoarUmbra.java index 520deb9ee3..afb7f3f30e 100644 --- a/Mage.Sets/src/mage/sets/riseoftheeldrazi/BoarUmbra.java +++ b/Mage.Sets/src/mage/sets/riseoftheeldrazi/BoarUmbra.java @@ -57,9 +57,9 @@ public class BoarUmbra extends CardImpl { // Enchant creature TargetPermanent auraTarget = new TargetCreaturePermanent(); - this.getSpellAbility().addTarget(auraTarget); - this.getSpellAbility().addEffect(new AttachEffect(Constants.Outcome.BoostCreature)); - Ability ability = new EnchantAbility(auraTarget.getTargetName()); + this.getSpellAbility().addTarget(auraTarget); + this.getSpellAbility().addEffect(new AttachEffect(Constants.Outcome.BoostCreature)); + Ability ability = new EnchantAbility(auraTarget.getTargetName()); this.addAbility(ability); // Enchanted creature gets +3/+3. this.addAbility(new SimpleStaticAbility(Constants.Zone.BATTLEFIELD, new BoostEnchantedEffect(3, 3, Constants.Duration.WhileOnBattlefield))); diff --git a/Mage.Sets/src/mage/sets/riseoftheeldrazi/ChampionsDrake.java b/Mage.Sets/src/mage/sets/riseoftheeldrazi/ChampionsDrake.java index 6f5f7bea92..ea65b1b942 100644 --- a/Mage.Sets/src/mage/sets/riseoftheeldrazi/ChampionsDrake.java +++ b/Mage.Sets/src/mage/sets/riseoftheeldrazi/ChampionsDrake.java @@ -48,7 +48,7 @@ import mage.Constants.Zone; * @author jeffwadsworth */ public class ChampionsDrake extends CardImpl { - + private static final String rule = "{this} gets +3/+3 as long as you control a creature with three or more level counters on it."; public ChampionsDrake(UUID ownerId) { @@ -62,7 +62,7 @@ public class ChampionsDrake extends CardImpl { this.toughness = new MageInt(1); this.addAbility(FlyingAbility.getInstance()); - + // Champion's Drake gets +3/+3 as long as you control a creature with three or more level counters on it. ConditionalContinousEffect effect = new ConditionalContinousEffect(new BoostSourceEffect(3, 3, Duration.WhileOnBattlefield), new PermanentHasCounterCondition(CounterType.LEVEL, 2, new FilterCreaturePermanent(), PermanentHasCounterCondition.CountType.MORE_THAN), rule); this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, effect)); diff --git a/Mage.Sets/src/mage/sets/riseoftheeldrazi/ConqueringManticore.java b/Mage.Sets/src/mage/sets/riseoftheeldrazi/ConqueringManticore.java index 0759d6d87e..36870619fb 100644 --- a/Mage.Sets/src/mage/sets/riseoftheeldrazi/ConqueringManticore.java +++ b/Mage.Sets/src/mage/sets/riseoftheeldrazi/ConqueringManticore.java @@ -55,7 +55,7 @@ public class ConqueringManticore extends CardImpl { this.color.setRed(true); this.power = new MageInt(5); this.toughness = new MageInt(5); - + Ability ability = new EntersBattlefieldTriggeredAbility(new GainControlTargetEffect(Duration.EndOfTurn), false); ability.addEffect(new UntapTargetEffect()); ability.addEffect(new GainAbilityTargetEffect(HasteAbility.getInstance(), Duration.EndOfTurn)); diff --git a/Mage.Sets/src/mage/sets/riseoftheeldrazi/ConsumeTheMeek.java b/Mage.Sets/src/mage/sets/riseoftheeldrazi/ConsumeTheMeek.java index 425e236ca8..d011170197 100644 --- a/Mage.Sets/src/mage/sets/riseoftheeldrazi/ConsumeTheMeek.java +++ b/Mage.Sets/src/mage/sets/riseoftheeldrazi/ConsumeTheMeek.java @@ -40,12 +40,12 @@ import mage.abilities.effects.common.DestroyAllEffect; * @author anonymous */ public class ConsumeTheMeek extends CardImpl { - + private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("creatures with converted mana cost 3 or less"); static { - filter.setConvertedManaCost(4); - filter.setConvertedManaCostComparison(Filter.ComparisonType.LessThan); + filter.setConvertedManaCost(4); + filter.setConvertedManaCostComparison(Filter.ComparisonType.LessThan); } public ConsumeTheMeek(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/riseoftheeldrazi/ConsumingVapors.java b/Mage.Sets/src/mage/sets/riseoftheeldrazi/ConsumingVapors.java index c4639920b6..ee0fcea486 100644 --- a/Mage.Sets/src/mage/sets/riseoftheeldrazi/ConsumingVapors.java +++ b/Mage.Sets/src/mage/sets/riseoftheeldrazi/ConsumingVapors.java @@ -49,67 +49,67 @@ import mage.target.common.TargetControlledPermanent; */ public class ConsumingVapors extends CardImpl { - - public ConsumingVapors(UUID ownerId) { - super(ownerId, 101, "Consuming Vapors", Rarity.RARE, new CardType[]{CardType.SORCERY}, "{3}{B}"); - this.expansionSetCode = "ROE"; - this.color.setBlack(true); - this.getSpellAbility().addEffect(new ConsumingVaporsEffect()); - this.getSpellAbility().addTarget(new TargetPlayer()); - this.addAbility(new ReboundAbility()); - } + public ConsumingVapors(UUID ownerId) { + super(ownerId, 101, "Consuming Vapors", Rarity.RARE, new CardType[]{CardType.SORCERY}, "{3}{B}"); + this.expansionSetCode = "ROE"; - public ConsumingVapors(final ConsumingVapors card) { - super(card); - } + this.color.setBlack(true); + this.getSpellAbility().addEffect(new ConsumingVaporsEffect()); + this.getSpellAbility().addTarget(new TargetPlayer()); + this.addAbility(new ReboundAbility()); + } - @Override - public ConsumingVapors copy() { - return new ConsumingVapors(this); - } + public ConsumingVapors(final ConsumingVapors card) { + super(card); + } + + @Override + public ConsumingVapors copy() { + return new ConsumingVapors(this); + } } class ConsumingVaporsEffect extends OneShotEffect { - ConsumingVaporsEffect ( ) { - super(Outcome.Sacrifice); - staticText = "Target player sacrifices a creature. You gain life equal to that creature's toughness"; - } + ConsumingVaporsEffect ( ) { + super(Outcome.Sacrifice); + staticText = "Target player sacrifices a creature. You gain life equal to that creature's toughness"; + } - ConsumingVaporsEffect ( ConsumingVaporsEffect effect ) { - super(effect); - } + ConsumingVaporsEffect ( ConsumingVaporsEffect effect ) { + super(effect); + } - @Override - public boolean apply(Game game, Ability source) { - Player player = game.getPlayer(source.getTargets().getFirstTarget()); - Player controller = game.getPlayer(source.getControllerId()); + @Override + public boolean apply(Game game, Ability source) { + Player player = game.getPlayer(source.getTargets().getFirstTarget()); + Player controller = game.getPlayer(source.getControllerId()); - FilterControlledPermanent filter = new FilterControlledPermanent("creature"); - filter.getCardType().add(CardType.CREATURE); - filter.setTargetController(TargetController.YOU); - TargetControlledPermanent target = new TargetControlledPermanent(1, 1, filter, false); + FilterControlledPermanent filter = new FilterControlledPermanent("creature"); + filter.getCardType().add(CardType.CREATURE); + filter.setTargetController(TargetController.YOU); + TargetControlledPermanent target = new TargetControlledPermanent(1, 1, filter, false); - //A spell or ability could have removed the only legal target this player - //had, if thats the case this ability should fizzle. - if (target.canChoose(player.getId(), game)) { - player.choose(Outcome.Sacrifice, target, source.getSourceId(), game); + //A spell or ability could have removed the only legal target this player + //had, if thats the case this ability should fizzle. + if (target.canChoose(player.getId(), game)) { + player.choose(Outcome.Sacrifice, target, source.getSourceId(), game); - Permanent permanent = game.getPermanent(target.getFirstTarget()); - if ( permanent != null ) { - controller.gainLife(permanent.getToughness().getValue(), game); - return permanent.sacrifice(source.getId(), game); - } - return true; - } - return false; - } + Permanent permanent = game.getPermanent(target.getFirstTarget()); + if ( permanent != null ) { + controller.gainLife(permanent.getToughness().getValue(), game); + return permanent.sacrifice(source.getId(), game); + } + return true; + } + return false; + } - @Override - public ConsumingVaporsEffect copy() { - return new ConsumingVaporsEffect(this); - } + @Override + public ConsumingVaporsEffect copy() { + return new ConsumingVaporsEffect(this); + } } diff --git a/Mage.Sets/src/mage/sets/riseoftheeldrazi/CrabUmbra.java b/Mage.Sets/src/mage/sets/riseoftheeldrazi/CrabUmbra.java index 25157a72b3..d08b442c0e 100644 --- a/Mage.Sets/src/mage/sets/riseoftheeldrazi/CrabUmbra.java +++ b/Mage.Sets/src/mage/sets/riseoftheeldrazi/CrabUmbra.java @@ -58,9 +58,9 @@ public class CrabUmbra extends CardImpl { // Enchant creature TargetPermanent auraTarget = new TargetCreaturePermanent(); - this.getSpellAbility().addTarget(auraTarget); - this.getSpellAbility().addEffect(new AttachEffect(Constants.Outcome.BoostCreature)); - Ability ability = new EnchantAbility(auraTarget.getTargetName()); + this.getSpellAbility().addTarget(auraTarget); + this.getSpellAbility().addEffect(new AttachEffect(Constants.Outcome.BoostCreature)); + Ability ability = new EnchantAbility(auraTarget.getTargetName()); this.addAbility(ability); // {2}{U}: Untap enchanted creature. this.addAbility(new SimpleActivatedAbility(Constants.Zone.BATTLEFIELD, new UntapEnchantedEffect(), new ManaCostsImpl("{2}{U}"))); diff --git a/Mage.Sets/src/mage/sets/riseoftheeldrazi/CurseOfWizardry.java b/Mage.Sets/src/mage/sets/riseoftheeldrazi/CurseOfWizardry.java index d7f7d17191..cad59ce53d 100644 --- a/Mage.Sets/src/mage/sets/riseoftheeldrazi/CurseOfWizardry.java +++ b/Mage.Sets/src/mage/sets/riseoftheeldrazi/CurseOfWizardry.java @@ -60,10 +60,10 @@ public class CurseOfWizardry extends CardImpl { // As Curse of Wizardry enters the battlefield, choose a color. this.addAbility(new EntersBattlefieldAbility(new CurseOfWizardryChooseColorEffect())); - + // Whenever a player casts a spell of the chosen color, that player loses 1 life. this.addAbility(new CurseOfWizardryPlayerCastsSpellChosenColorTriggeredAbility()); - + } public CurseOfWizardry(final CurseOfWizardry card) { @@ -77,49 +77,49 @@ public class CurseOfWizardry extends CardImpl { } class CurseOfWizardryChooseColorEffect extends OneShotEffect { - + public CurseOfWizardryChooseColorEffect() { super(Constants.Outcome.Detriment); - staticText = "As {this} enters the battlefield, choose a color"; + staticText = "As {this} enters the battlefield, choose a color"; } public CurseOfWizardryChooseColorEffect(final CurseOfWizardryChooseColorEffect effect) { - super(effect); + super(effect); } @Override public boolean apply(Game game, Ability source) { - Player player = game.getPlayer(source.getControllerId()); - Permanent curseOfWizardry = game.getPermanent(source.getSourceId()); - if (player != null && curseOfWizardry != null) { + Player player = game.getPlayer(source.getControllerId()); + Permanent curseOfWizardry = game.getPermanent(source.getSourceId()); + if (player != null && curseOfWizardry != null) { ChoiceColor colorChoice = new ChoiceColor(); if (player.choose(Constants.Outcome.Detriment, colorChoice, game)) { - game.informPlayers(curseOfWizardry.getName() + ": " + player.getName() + " has chosen " + colorChoice.getChoice()); - game.getState().setValue(curseOfWizardry.getId() + "_color", colorChoice.getColor()); + game.informPlayers(curseOfWizardry.getName() + ": " + player.getName() + " has chosen " + colorChoice.getChoice()); + game.getState().setValue(curseOfWizardry.getId() + "_color", colorChoice.getColor()); } - } - return false; + } + return false; } @Override public CurseOfWizardryChooseColorEffect copy() { - return new CurseOfWizardryChooseColorEffect(this); + return new CurseOfWizardryChooseColorEffect(this); } } class CurseOfWizardryPlayerCastsSpellChosenColorTriggeredAbility extends TriggeredAbilityImpl { - + public CurseOfWizardryPlayerCastsSpellChosenColorTriggeredAbility() { - super(Constants.Zone.BATTLEFIELD, new LoseLifeTargetEffect(1), false); + super(Constants.Zone.BATTLEFIELD, new LoseLifeTargetEffect(1), false); } public CurseOfWizardryPlayerCastsSpellChosenColorTriggeredAbility(final CurseOfWizardryPlayerCastsSpellChosenColorTriggeredAbility ability) { - super(ability); + super(ability); } @Override public CurseOfWizardryPlayerCastsSpellChosenColorTriggeredAbility copy() { - return new CurseOfWizardryPlayerCastsSpellChosenColorTriggeredAbility(this); + return new CurseOfWizardryPlayerCastsSpellChosenColorTriggeredAbility(this); } @Override @@ -139,9 +139,9 @@ class CurseOfWizardryPlayerCastsSpellChosenColorTriggeredAbility extends Trigger } return false; } - + @Override public String getRule() { - return "Whenever a player casts a spell of the chosen color, that player loses 1 life."; + return "Whenever a player casts a spell of the chosen color, that player loses 1 life."; } } diff --git a/Mage.Sets/src/mage/sets/riseoftheeldrazi/DeathlessAngel.java b/Mage.Sets/src/mage/sets/riseoftheeldrazi/DeathlessAngel.java index fc5f043f0d..a2e32ec165 100644 --- a/Mage.Sets/src/mage/sets/riseoftheeldrazi/DeathlessAngel.java +++ b/Mage.Sets/src/mage/sets/riseoftheeldrazi/DeathlessAngel.java @@ -53,7 +53,7 @@ public class DeathlessAngel extends CardImpl { super(ownerId, 17, "Deathless Angel", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{4}{W}{W}"); this.expansionSetCode = "ROE"; this.subtype.add("Angel"); - this.color.setWhite(true); + this.color.setWhite(true); this.power = new MageInt(5); this.toughness = new MageInt(7); this.addAbility(FlyingAbility.getInstance()); diff --git a/Mage.Sets/src/mage/sets/riseoftheeldrazi/DemonicAppetite.java b/Mage.Sets/src/mage/sets/riseoftheeldrazi/DemonicAppetite.java index 8fbb3e0441..668ae948da 100644 --- a/Mage.Sets/src/mage/sets/riseoftheeldrazi/DemonicAppetite.java +++ b/Mage.Sets/src/mage/sets/riseoftheeldrazi/DemonicAppetite.java @@ -59,7 +59,7 @@ public class DemonicAppetite extends CardImpl { TargetPermanent auraTarget = new TargetControlledCreaturePermanent(); this.getSpellAbility().addTarget(auraTarget); this.getSpellAbility().addEffect(new AttachEffect(Constants.Outcome.BoostCreature)); - + Ability ability = new EnchantAbility(auraTarget.getTargetName()); this.addAbility(ability); this.addAbility(new SimpleStaticAbility(Constants.Zone.BATTLEFIELD, new BoostEnchantedEffect(3, 3, Constants.Duration.WhileOnBattlefield))); @@ -83,15 +83,15 @@ public class DemonicAppetite extends CardImpl { } class DemonicAppetiteEffect extends SacrificeTargetEffect { - + DemonicAppetiteEffect() { super(); staticText = "sacrifice a creature"; } - + @Override public DemonicAppetiteEffect copy() { return new DemonicAppetiteEffect(); } - + } diff --git a/Mage.Sets/src/mage/sets/riseoftheeldrazi/Deprive.java b/Mage.Sets/src/mage/sets/riseoftheeldrazi/Deprive.java index 0b2f151417..a069ddf70a 100644 --- a/Mage.Sets/src/mage/sets/riseoftheeldrazi/Deprive.java +++ b/Mage.Sets/src/mage/sets/riseoftheeldrazi/Deprive.java @@ -45,29 +45,29 @@ import mage.target.common.TargetControlledPermanent; */ public class Deprive extends CardImpl { - private static final FilterControlledPermanent filter = new FilterControlledPermanent("land"); + private static final FilterControlledPermanent filter = new FilterControlledPermanent("land"); - static { - filter.getCardType().add(CardType.LAND); - filter.setScopeCardType(ComparisonScope.Any); - } + static { + filter.getCardType().add(CardType.LAND); + filter.setScopeCardType(ComparisonScope.Any); + } - public Deprive(UUID ownerId) { - super(ownerId, 59, "Deprive", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{U}{U}"); - this.expansionSetCode = "ROE"; - this.color.setBlue(true); - this.getSpellAbility().addCost(new ReturnToHandTargetCost(new TargetControlledPermanent(filter))); - this.getSpellAbility().addTarget(new TargetSpell()); - this.getSpellAbility().addEffect(new CounterTargetEffect()); - } + public Deprive(UUID ownerId) { + super(ownerId, 59, "Deprive", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{U}{U}"); + this.expansionSetCode = "ROE"; + this.color.setBlue(true); + this.getSpellAbility().addCost(new ReturnToHandTargetCost(new TargetControlledPermanent(filter))); + this.getSpellAbility().addTarget(new TargetSpell()); + this.getSpellAbility().addEffect(new CounterTargetEffect()); + } - public Deprive(final Deprive card) { - super(card); - } + public Deprive(final Deprive card) { + super(card); + } - @Override - public Deprive copy() { - return new Deprive(this); - } + @Override + public Deprive copy() { + return new Deprive(this); + } } diff --git a/Mage.Sets/src/mage/sets/riseoftheeldrazi/DormantGomazoa.java b/Mage.Sets/src/mage/sets/riseoftheeldrazi/DormantGomazoa.java index 6903310262..f2409392e9 100644 --- a/Mage.Sets/src/mage/sets/riseoftheeldrazi/DormantGomazoa.java +++ b/Mage.Sets/src/mage/sets/riseoftheeldrazi/DormantGomazoa.java @@ -56,13 +56,13 @@ public class DormantGomazoa extends CardImpl { this.toughness = new MageInt(5); this.addAbility(FlyingAbility.getInstance()); - + // Dormant Gomazoa enters the battlefield tapped. this.addAbility(new EntersBattlefieldTappedAbility()); - + // Dormant Gomazoa doesn't untap during your untap step. this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new SkipUntapSourceEffect())); - + // Whenever you become the target of a spell, you may untap Dormant Gomazoa. this.addAbility(new BecomesTargetControllerSpellTriggeredAbility(new UntapSourceEffect(), true)); } diff --git a/Mage.Sets/src/mage/sets/riseoftheeldrazi/DrakeUmbra.java b/Mage.Sets/src/mage/sets/riseoftheeldrazi/DrakeUmbra.java index 1fe033045b..c2eaab0238 100644 --- a/Mage.Sets/src/mage/sets/riseoftheeldrazi/DrakeUmbra.java +++ b/Mage.Sets/src/mage/sets/riseoftheeldrazi/DrakeUmbra.java @@ -59,9 +59,9 @@ public class DrakeUmbra extends CardImpl { // Enchant creature TargetPermanent auraTarget = new TargetCreaturePermanent(); - this.getSpellAbility().addTarget(auraTarget); - this.getSpellAbility().addEffect(new AttachEffect(Constants.Outcome.BoostCreature)); - Ability ability = new EnchantAbility(auraTarget.getTargetName()); + this.getSpellAbility().addTarget(auraTarget); + this.getSpellAbility().addEffect(new AttachEffect(Constants.Outcome.BoostCreature)); + Ability ability = new EnchantAbility(auraTarget.getTargetName()); this.addAbility(ability); // Enchanted creature gets +3/+3 and has flying. this.addAbility(new SimpleStaticAbility(Constants.Zone.BATTLEFIELD, new BoostEnchantedEffect(3, 3, Constants.Duration.WhileOnBattlefield))); diff --git a/Mage.Sets/src/mage/sets/riseoftheeldrazi/DreadDrone.java b/Mage.Sets/src/mage/sets/riseoftheeldrazi/DreadDrone.java index e18d8916a5..e8c8e4f6a7 100644 --- a/Mage.Sets/src/mage/sets/riseoftheeldrazi/DreadDrone.java +++ b/Mage.Sets/src/mage/sets/riseoftheeldrazi/DreadDrone.java @@ -48,7 +48,7 @@ public class DreadDrone extends CardImpl { this.expansionSetCode = "ROE"; this.subtype.add("Eldrazi"); this.subtype.add("Drone"); - this.color.setBlack(true); + this.color.setBlack(true); this.power = new MageInt(4); this.toughness = new MageInt(1); this.addAbility(new EntersBattlefieldTriggeredAbility(new CreateTokenEffect(new EldraziSpawnToken(), 2))); diff --git a/Mage.Sets/src/mage/sets/riseoftheeldrazi/DreamstoneHedron.java b/Mage.Sets/src/mage/sets/riseoftheeldrazi/DreamstoneHedron.java index ae9d59ecff..bb19aebdcf 100644 --- a/Mage.Sets/src/mage/sets/riseoftheeldrazi/DreamstoneHedron.java +++ b/Mage.Sets/src/mage/sets/riseoftheeldrazi/DreamstoneHedron.java @@ -68,7 +68,7 @@ public class DreamstoneHedron extends CardImpl { public DreamstoneHedron copy() { return new DreamstoneHedron(this); } - + class DreamstoneHedronFirstManaAbility extends BasicManaAbility { public DreamstoneHedronFirstManaAbility() { diff --git a/Mage.Sets/src/mage/sets/riseoftheeldrazi/EelUmbra.java b/Mage.Sets/src/mage/sets/riseoftheeldrazi/EelUmbra.java index 45db6b3d15..e4084c9587 100644 --- a/Mage.Sets/src/mage/sets/riseoftheeldrazi/EelUmbra.java +++ b/Mage.Sets/src/mage/sets/riseoftheeldrazi/EelUmbra.java @@ -59,9 +59,9 @@ public class EelUmbra extends CardImpl { this.addAbility(FlashAbility.getInstance()); // Enchant creature TargetPermanent auraTarget = new TargetCreaturePermanent(); - this.getSpellAbility().addTarget(auraTarget); - this.getSpellAbility().addEffect(new AttachEffect(Constants.Outcome.BoostCreature)); - Ability ability = new EnchantAbility(auraTarget.getTargetName()); + this.getSpellAbility().addTarget(auraTarget); + this.getSpellAbility().addEffect(new AttachEffect(Constants.Outcome.BoostCreature)); + Ability ability = new EnchantAbility(auraTarget.getTargetName()); this.addAbility(ability); // Enchanted creature gets +1/+1. this.addAbility(new SimpleStaticAbility(Constants.Zone.BATTLEFIELD, new BoostEnchantedEffect(1, 1, Constants.Duration.WhileOnBattlefield))); diff --git a/Mage.Sets/src/mage/sets/riseoftheeldrazi/ElandUmbra.java b/Mage.Sets/src/mage/sets/riseoftheeldrazi/ElandUmbra.java index b15ce5e5d1..0b8619636f 100644 --- a/Mage.Sets/src/mage/sets/riseoftheeldrazi/ElandUmbra.java +++ b/Mage.Sets/src/mage/sets/riseoftheeldrazi/ElandUmbra.java @@ -57,9 +57,9 @@ public class ElandUmbra extends CardImpl { // Enchant creature TargetPermanent auraTarget = new TargetCreaturePermanent(); - this.getSpellAbility().addTarget(auraTarget); - this.getSpellAbility().addEffect(new AttachEffect(Constants.Outcome.BoostCreature)); - Ability ability = new EnchantAbility(auraTarget.getTargetName()); + this.getSpellAbility().addTarget(auraTarget); + this.getSpellAbility().addEffect(new AttachEffect(Constants.Outcome.BoostCreature)); + Ability ability = new EnchantAbility(auraTarget.getTargetName()); this.addAbility(ability); // Enchanted creature gets +0/+4. this.addAbility(new SimpleStaticAbility(Constants.Zone.BATTLEFIELD, new BoostEnchantedEffect(0, 4, Constants.Duration.WhileOnBattlefield))); diff --git a/Mage.Sets/src/mage/sets/riseoftheeldrazi/EldraziConscription.java b/Mage.Sets/src/mage/sets/riseoftheeldrazi/EldraziConscription.java index 7e401e2c10..bff717ecff 100644 --- a/Mage.Sets/src/mage/sets/riseoftheeldrazi/EldraziConscription.java +++ b/Mage.Sets/src/mage/sets/riseoftheeldrazi/EldraziConscription.java @@ -60,10 +60,10 @@ public class EldraziConscription extends CardImpl { this.subtype.add("Aura"); TargetPermanent auraTarget = new TargetCreaturePermanent(); - this.getSpellAbility().addTarget(auraTarget); - this.getSpellAbility().addEffect(new AttachEffect(Constants.Outcome.BoostCreature)); - Ability ability = new EnchantAbility(auraTarget.getTargetName()); - this.addAbility(ability); + this.getSpellAbility().addTarget(auraTarget); + this.getSpellAbility().addEffect(new AttachEffect(Constants.Outcome.BoostCreature)); + Ability ability = new EnchantAbility(auraTarget.getTargetName()); + this.addAbility(ability); this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostEnchantedEffect(10, 10, Duration.WhileOnBattlefield))); this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityAttachedEffect(TrampleAbility.getInstance(), Constants.AttachmentType.AURA))); diff --git a/Mage.Sets/src/mage/sets/riseoftheeldrazi/EldraziTemple.java b/Mage.Sets/src/mage/sets/riseoftheeldrazi/EldraziTemple.java index 2d116c14ec..391fc59143 100644 --- a/Mage.Sets/src/mage/sets/riseoftheeldrazi/EldraziTemple.java +++ b/Mage.Sets/src/mage/sets/riseoftheeldrazi/EldraziTemple.java @@ -85,20 +85,20 @@ class EldraziTempleManaAbility extends BasicManaAbility { - public EmrakulsHatcher(UUID ownerId) { - super(ownerId, 142, "Emrakul's Hatcher", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{4}{R}"); - this.expansionSetCode = "ROE"; - this.subtype.add("Eldrazi"); - this.subtype.add("Drone"); - this.color.setRed(true); - this.power = new MageInt(3); - this.toughness = new MageInt(3); + public EmrakulsHatcher(UUID ownerId) { + super(ownerId, 142, "Emrakul's Hatcher", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{4}{R}"); + this.expansionSetCode = "ROE"; + this.subtype.add("Eldrazi"); + this.subtype.add("Drone"); + this.color.setRed(true); + this.power = new MageInt(3); + this.toughness = new MageInt(3); - this.addAbility(new EntersBattlefieldTriggeredAbility(new CreateTokenEffect(new EldraziSpawnToken(), 3), false)); - } + this.addAbility(new EntersBattlefieldTriggeredAbility(new CreateTokenEffect(new EldraziSpawnToken(), 3), false)); + } - public EmrakulsHatcher(final EmrakulsHatcher card) { - super(card); - } + public EmrakulsHatcher(final EmrakulsHatcher card) { + super(card); + } - @Override - public EmrakulsHatcher copy() { - return new EmrakulsHatcher(this); - } + @Override + public EmrakulsHatcher copy() { + return new EmrakulsHatcher(this); + } } diff --git a/Mage.Sets/src/mage/sets/riseoftheeldrazi/EssenceFeed.java b/Mage.Sets/src/mage/sets/riseoftheeldrazi/EssenceFeed.java index 63db46964b..86e376dc8b 100644 --- a/Mage.Sets/src/mage/sets/riseoftheeldrazi/EssenceFeed.java +++ b/Mage.Sets/src/mage/sets/riseoftheeldrazi/EssenceFeed.java @@ -47,7 +47,7 @@ public class EssenceFeed extends CardImpl { public EssenceFeed (UUID ownerId) { super(ownerId, 110, "Essence Feed", Rarity.COMMON, new CardType[]{CardType.SORCERY}, "{5}{B}"); this.expansionSetCode = "ROE"; - this.color.setBlack(true); + this.color.setBlack(true); this.getSpellAbility().addEffect(new LoseLifeTargetEffect(3)); this.getSpellAbility().addEffect(new GainLifeEffect(3)); this.getSpellAbility().addEffect(new CreateTokenEffect(new EldraziSpawnToken(), 3)); diff --git a/Mage.Sets/src/mage/sets/riseoftheeldrazi/EvolvingWilds.java b/Mage.Sets/src/mage/sets/riseoftheeldrazi/EvolvingWilds.java index 888fd81696..be2b4e6942 100644 --- a/Mage.Sets/src/mage/sets/riseoftheeldrazi/EvolvingWilds.java +++ b/Mage.Sets/src/mage/sets/riseoftheeldrazi/EvolvingWilds.java @@ -47,40 +47,40 @@ import mage.target.common.TargetCardInLibrary; */ public class EvolvingWilds extends CardImpl { - public EvolvingWilds(UUID ownerId) { - super(ownerId, 228, "Evolving Wilds", Rarity.COMMON, new CardType[]{CardType.LAND}, null); - this.expansionSetCode = "ROE"; - this.addAbility(new EvolvingWildsAbility()); - } + public EvolvingWilds(UUID ownerId) { + super(ownerId, 228, "Evolving Wilds", Rarity.COMMON, new CardType[]{CardType.LAND}, null); + this.expansionSetCode = "ROE"; + this.addAbility(new EvolvingWildsAbility()); + } - public EvolvingWilds(final EvolvingWilds card) { - super(card); - } + public EvolvingWilds(final EvolvingWilds card) { + super(card); + } - @Override - public EvolvingWilds copy() { - return new EvolvingWilds(this); - } + @Override + public EvolvingWilds copy() { + return new EvolvingWilds(this); + } } class EvolvingWildsAbility extends ActivatedAbilityImpl { - public EvolvingWildsAbility() { - super(Zone.BATTLEFIELD, null); - addCost(new TapSourceCost()); - addCost(new SacrificeSourceCost()); - TargetCardInLibrary target = new TargetCardInLibrary(new FilterBasicLandCard()); - addEffect(new SearchLibraryPutInPlayEffect(target, true, Outcome.PutLandInPlay)); - } + public EvolvingWildsAbility() { + super(Zone.BATTLEFIELD, null); + addCost(new TapSourceCost()); + addCost(new SacrificeSourceCost()); + TargetCardInLibrary target = new TargetCardInLibrary(new FilterBasicLandCard()); + addEffect(new SearchLibraryPutInPlayEffect(target, true, Outcome.PutLandInPlay)); + } - public EvolvingWildsAbility(final EvolvingWildsAbility ability) { - super(ability); - } + public EvolvingWildsAbility(final EvolvingWildsAbility ability) { + super(ability); + } - @Override - public EvolvingWildsAbility copy() { - return new EvolvingWildsAbility(this); - } + @Override + public EvolvingWildsAbility copy() { + return new EvolvingWildsAbility(this); + } } diff --git a/Mage.Sets/src/mage/sets/riseoftheeldrazi/FissureVent.java b/Mage.Sets/src/mage/sets/riseoftheeldrazi/FissureVent.java index 25cbaf1f81..1df300eada 100644 --- a/Mage.Sets/src/mage/sets/riseoftheeldrazi/FissureVent.java +++ b/Mage.Sets/src/mage/sets/riseoftheeldrazi/FissureVent.java @@ -43,30 +43,30 @@ import mage.target.common.TargetNonBasicLandPermanent; */ public class FissureVent extends CardImpl { - public FissureVent(UUID ownerId) { - super(ownerId, 144, "Fissure Vent", Rarity.COMMON, new CardType[]{CardType.SORCERY}, "{3}{R}{R}"); - this.expansionSetCode = "ROE"; - this.color.setRed(true); - this.getSpellAbility().addTarget(new TargetArtifactPermanent()); - this.getSpellAbility().addEffect(new DestroyTargetEffect()); - Mode mode1 = new Mode(); - mode1.getTargets().add(new TargetNonBasicLandPermanent()); - mode1.getEffects().add(new DestroyTargetEffect()); - this.getSpellAbility().addMode(mode1); - Mode mode2 = new Mode(); - mode2.getTargets().add(new TargetArtifactPermanent()); - mode2.getTargets().add(new TargetNonBasicLandPermanent()); - mode2.getEffects().add(new DestroyMultiTargetEffect()); - this.getSpellAbility().addMode(mode2); - } + public FissureVent(UUID ownerId) { + super(ownerId, 144, "Fissure Vent", Rarity.COMMON, new CardType[]{CardType.SORCERY}, "{3}{R}{R}"); + this.expansionSetCode = "ROE"; + this.color.setRed(true); + this.getSpellAbility().addTarget(new TargetArtifactPermanent()); + this.getSpellAbility().addEffect(new DestroyTargetEffect()); + Mode mode1 = new Mode(); + mode1.getTargets().add(new TargetNonBasicLandPermanent()); + mode1.getEffects().add(new DestroyTargetEffect()); + this.getSpellAbility().addMode(mode1); + Mode mode2 = new Mode(); + mode2.getTargets().add(new TargetArtifactPermanent()); + mode2.getTargets().add(new TargetNonBasicLandPermanent()); + mode2.getEffects().add(new DestroyMultiTargetEffect()); + this.getSpellAbility().addMode(mode2); + } - public FissureVent(final FissureVent card) { - super(card); - } + public FissureVent(final FissureVent card) { + super(card); + } - @Override - public FissureVent copy() { - return new FissureVent(this); - } + @Override + public FissureVent copy() { + return new FissureVent(this); + } } diff --git a/Mage.Sets/src/mage/sets/riseoftheeldrazi/FlameSlash.java b/Mage.Sets/src/mage/sets/riseoftheeldrazi/FlameSlash.java index 7c103351e6..b33933ee75 100644 --- a/Mage.Sets/src/mage/sets/riseoftheeldrazi/FlameSlash.java +++ b/Mage.Sets/src/mage/sets/riseoftheeldrazi/FlameSlash.java @@ -41,21 +41,21 @@ import mage.target.common.TargetCreaturePermanent; */ public class FlameSlash extends CardImpl { - public FlameSlash(UUID ownerId) { - super(ownerId, 145, "Flame Slash", Rarity.COMMON, new CardType[]{CardType.SORCERY}, "{R}"); - this.expansionSetCode = "ROE"; - this.color.setRed(true); - this.getSpellAbility().addTarget(new TargetCreaturePermanent()); - this.getSpellAbility().addEffect(new DamageTargetEffect(4)); - } + public FlameSlash(UUID ownerId) { + super(ownerId, 145, "Flame Slash", Rarity.COMMON, new CardType[]{CardType.SORCERY}, "{R}"); + this.expansionSetCode = "ROE"; + this.color.setRed(true); + this.getSpellAbility().addTarget(new TargetCreaturePermanent()); + this.getSpellAbility().addEffect(new DamageTargetEffect(4)); + } - public FlameSlash(final FlameSlash card) { - super(card); - } + public FlameSlash(final FlameSlash card) { + super(card); + } - @Override - public FlameSlash copy() { - return new FlameSlash(this); - } + @Override + public FlameSlash copy() { + return new FlameSlash(this); + } } diff --git a/Mage.Sets/src/mage/sets/riseoftheeldrazi/FleetingDistraction.java b/Mage.Sets/src/mage/sets/riseoftheeldrazi/FleetingDistraction.java index 993b332d7b..9c798d3b10 100644 --- a/Mage.Sets/src/mage/sets/riseoftheeldrazi/FleetingDistraction.java +++ b/Mage.Sets/src/mage/sets/riseoftheeldrazi/FleetingDistraction.java @@ -47,7 +47,7 @@ public class FleetingDistraction extends CardImpl { public FleetingDistraction (UUID ownerId) { super(ownerId, 67, "Fleeting Distraction", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{U}"); this.expansionSetCode = "ROE"; - this.color.setBlue(true); + this.color.setBlue(true); this.getSpellAbility().addEffect(new BoostTargetEffect(-1, 0, Constants.Duration.EndOfTurn)); this.getSpellAbility().addEffect(new DrawCardControllerEffect(1)); this.getSpellAbility().addTarget(new TargetCreaturePermanent()); diff --git a/Mage.Sets/src/mage/sets/riseoftheeldrazi/Forest1.java b/Mage.Sets/src/mage/sets/riseoftheeldrazi/Forest1.java index 7dc10c3ac6..86232412f2 100644 --- a/Mage.Sets/src/mage/sets/riseoftheeldrazi/Forest1.java +++ b/Mage.Sets/src/mage/sets/riseoftheeldrazi/Forest1.java @@ -36,18 +36,18 @@ import java.util.UUID; */ public class Forest1 extends mage.cards.basiclands.Forest { - public Forest1(UUID ownerId) { - super(ownerId, 245); - this.expansionSetCode = "ROE"; - } + public Forest1(UUID ownerId) { + super(ownerId, 245); + this.expansionSetCode = "ROE"; + } - public Forest1(final Forest1 card) { - super(card); - } + public Forest1(final Forest1 card) { + super(card); + } - @Override - public Forest1 copy() { - return new Forest1(this); - } + @Override + public Forest1 copy() { + return new Forest1(this); + } } \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/riseoftheeldrazi/Forest2.java b/Mage.Sets/src/mage/sets/riseoftheeldrazi/Forest2.java index 6827cc69ae..18ca67924f 100644 --- a/Mage.Sets/src/mage/sets/riseoftheeldrazi/Forest2.java +++ b/Mage.Sets/src/mage/sets/riseoftheeldrazi/Forest2.java @@ -36,18 +36,18 @@ import java.util.UUID; */ public class Forest2 extends mage.cards.basiclands.Forest { - public Forest2(UUID ownerId) { - super(ownerId, 246); - this.expansionSetCode = "ROE"; - } + public Forest2(UUID ownerId) { + super(ownerId, 246); + this.expansionSetCode = "ROE"; + } - public Forest2(final Forest2 card) { - super(card); - } + public Forest2(final Forest2 card) { + super(card); + } - @Override - public Forest2 copy() { - return new Forest2(this); - } + @Override + public Forest2 copy() { + return new Forest2(this); + } } \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/riseoftheeldrazi/Forest3.java b/Mage.Sets/src/mage/sets/riseoftheeldrazi/Forest3.java index fbe1d4b312..291c968b96 100644 --- a/Mage.Sets/src/mage/sets/riseoftheeldrazi/Forest3.java +++ b/Mage.Sets/src/mage/sets/riseoftheeldrazi/Forest3.java @@ -36,18 +36,18 @@ import java.util.UUID; */ public class Forest3 extends mage.cards.basiclands.Forest { - public Forest3(UUID ownerId) { - super(ownerId, 247); - this.expansionSetCode = "ROE"; - } + public Forest3(UUID ownerId) { + super(ownerId, 247); + this.expansionSetCode = "ROE"; + } - public Forest3(final Forest3 card) { - super(card); - } + public Forest3(final Forest3 card) { + super(card); + } - @Override - public Forest3 copy() { - return new Forest3(this); - } + @Override + public Forest3 copy() { + return new Forest3(this); + } } \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/riseoftheeldrazi/Forest4.java b/Mage.Sets/src/mage/sets/riseoftheeldrazi/Forest4.java index ccd35c6846..8de4e1f892 100644 --- a/Mage.Sets/src/mage/sets/riseoftheeldrazi/Forest4.java +++ b/Mage.Sets/src/mage/sets/riseoftheeldrazi/Forest4.java @@ -36,18 +36,18 @@ import java.util.UUID; */ public class Forest4 extends mage.cards.basiclands.Forest { - public Forest4(UUID ownerId) { - super(ownerId, 248); - this.expansionSetCode = "ROE"; - } + public Forest4(UUID ownerId) { + super(ownerId, 248); + this.expansionSetCode = "ROE"; + } - public Forest4(final Forest4 card) { - super(card); - } + public Forest4(final Forest4 card) { + super(card); + } - @Override - public Forest4 copy() { - return new Forest4(this); - } + @Override + public Forest4 copy() { + return new Forest4(this); + } } \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/riseoftheeldrazi/GideonJura.java b/Mage.Sets/src/mage/sets/riseoftheeldrazi/GideonJura.java index 98cff101d2..778fc1ca4f 100644 --- a/Mage.Sets/src/mage/sets/riseoftheeldrazi/GideonJura.java +++ b/Mage.Sets/src/mage/sets/riseoftheeldrazi/GideonJura.java @@ -57,95 +57,95 @@ import mage.target.common.TargetOpponent; */ public class GideonJura extends CardImpl { - private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("tapped creature"); + private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("tapped creature"); - static { - filter.setUseTapped(true); - filter.setTapped(true); - } + static { + filter.setUseTapped(true); + filter.setTapped(true); + } - public GideonJura(UUID ownerId) { - super(ownerId, 21, "Gideon Jura", Rarity.MYTHIC, new CardType[]{CardType.PLANESWALKER}, "{3}{W}{W}"); - this.expansionSetCode = "ROE"; - this.subtype.add("Gideon"); - this.color.setWhite(true); - this.addAbility(new EntersBattlefieldAbility(new AddCountersSourceEffect(CounterType.LOYALTY.createInstance(6)), "")); + public GideonJura(UUID ownerId) { + super(ownerId, 21, "Gideon Jura", Rarity.MYTHIC, new CardType[]{CardType.PLANESWALKER}, "{3}{W}{W}"); + this.expansionSetCode = "ROE"; + this.subtype.add("Gideon"); + this.color.setWhite(true); + this.addAbility(new EntersBattlefieldAbility(new AddCountersSourceEffect(CounterType.LOYALTY.createInstance(6)), "")); - LoyaltyAbility ability1 = new LoyaltyAbility(new GideonJuraEffect(), 2); - ability1.addTarget(new TargetOpponent()); - this.addAbility(ability1); + LoyaltyAbility ability1 = new LoyaltyAbility(new GideonJuraEffect(), 2); + ability1.addTarget(new TargetOpponent()); + this.addAbility(ability1); - LoyaltyAbility ability2 = new LoyaltyAbility(new DestroyTargetEffect(), -2); - ability2.addTarget(new TargetCreaturePermanent(filter)); - this.addAbility(ability2); + LoyaltyAbility ability2 = new LoyaltyAbility(new DestroyTargetEffect(), -2); + ability2.addTarget(new TargetCreaturePermanent(filter)); + this.addAbility(ability2); - LoyaltyAbility ability3 = new LoyaltyAbility(new BecomesCreatureSourceEffect(new GideonJuraToken(), "planeswalker", Duration.EndOfTurn), 0); - ability3.addEffect(new PreventAllDamageSourceEffect(Duration.EndOfTurn)); - this.addAbility(ability3); - } + LoyaltyAbility ability3 = new LoyaltyAbility(new BecomesCreatureSourceEffect(new GideonJuraToken(), "planeswalker", Duration.EndOfTurn), 0); + ability3.addEffect(new PreventAllDamageSourceEffect(Duration.EndOfTurn)); + this.addAbility(ability3); + } - public GideonJura(final GideonJura card) { - super(card); - } + public GideonJura(final GideonJura card) { + super(card); + } - @Override - public GideonJura copy() { - return new GideonJura(this); - } + @Override + public GideonJura copy() { + return new GideonJura(this); + } } class GideonJuraToken extends Token { - public GideonJuraToken() { - super("", "6/6 Human Soldier creature"); - cardType.add(CardType.CREATURE); - subtype.add("Human"); - subtype.add("Soldier"); - power = new MageInt(6); - toughness = new MageInt(6); - } + public GideonJuraToken() { + super("", "6/6 Human Soldier creature"); + cardType.add(CardType.CREATURE); + subtype.add("Human"); + subtype.add("Soldier"); + power = new MageInt(6); + toughness = new MageInt(6); + } } class GideonJuraEffect extends RequirementEffect { - public GideonJuraEffect() { - super(Duration.Custom); - staticText = "During target opponent's next turn, creatures that player controls attack {this} if able"; - } + public GideonJuraEffect() { + super(Duration.Custom); + staticText = "During target opponent's next turn, creatures that player controls attack {this} if able"; + } - public GideonJuraEffect(final GideonJuraEffect effect) { - super(effect); - } + public GideonJuraEffect(final GideonJuraEffect effect) { + super(effect); + } - @Override - public GideonJuraEffect copy() { - return new GideonJuraEffect(this); - } + @Override + public GideonJuraEffect copy() { + return new GideonJuraEffect(this); + } - @Override - public boolean applies(Permanent permanent, Ability source, Game game) { - return permanent.getControllerId().equals(source.getFirstTarget()); - } + @Override + public boolean applies(Permanent permanent, Ability source, Game game) { + return permanent.getControllerId().equals(source.getFirstTarget()); + } - @Override - public boolean isInactive(Ability source, Game game) { - return (game.getPhase().getType() == TurnPhase.END && game.getActivePlayerId().equals(source.getFirstTarget())); - } + @Override + public boolean isInactive(Ability source, Game game) { + return (game.getPhase().getType() == TurnPhase.END && game.getActivePlayerId().equals(source.getFirstTarget())); + } - @Override - public UUID mustAttackDefender(Ability source, Game game) { - return source.getSourceId(); - } + @Override + public UUID mustAttackDefender(Ability source, Game game) { + return source.getSourceId(); + } - @Override - public boolean mustAttack(Game game) { - return true; - } + @Override + public boolean mustAttack(Game game) { + return true; + } - @Override - public boolean mustBlock(Game game) { - return false; - } + @Override + public boolean mustBlock(Game game) { + return false; + } } \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/riseoftheeldrazi/Gigantomancer.java b/Mage.Sets/src/mage/sets/riseoftheeldrazi/Gigantomancer.java index 5c144c3bb2..187fbd5389 100644 --- a/Mage.Sets/src/mage/sets/riseoftheeldrazi/Gigantomancer.java +++ b/Mage.Sets/src/mage/sets/riseoftheeldrazi/Gigantomancer.java @@ -52,12 +52,12 @@ public class Gigantomancer extends CardImpl { this.expansionSetCode = "ROE"; this.subtype.add("Human"); this.subtype.add("Shaman"); - this.color.setGreen(true); + this.color.setGreen(true); this.power = new MageInt(1); this.toughness = new MageInt(1); - Ability ability = new SimpleActivatedAbility(Constants.Zone.BATTLEFIELD, new SetPowerToughnessTargetEffect(7, 7, Constants.Duration.EndOfTurn), new GenericManaCost(1)); - ability.addTarget(new TargetControlledCreaturePermanent()); - this.addAbility(ability); + Ability ability = new SimpleActivatedAbility(Constants.Zone.BATTLEFIELD, new SetPowerToughnessTargetEffect(7, 7, Constants.Duration.EndOfTurn), new GenericManaCost(1)); + ability.addTarget(new TargetControlledCreaturePermanent()); + this.addAbility(ability); } public Gigantomancer (final Gigantomancer card) { diff --git a/Mage.Sets/src/mage/sets/riseoftheeldrazi/Gloomhunter.java b/Mage.Sets/src/mage/sets/riseoftheeldrazi/Gloomhunter.java index dd177570a0..34e975f878 100644 --- a/Mage.Sets/src/mage/sets/riseoftheeldrazi/Gloomhunter.java +++ b/Mage.Sets/src/mage/sets/riseoftheeldrazi/Gloomhunter.java @@ -45,7 +45,7 @@ public class Gloomhunter extends CardImpl { super(ownerId, 111, "Gloomhunter", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{2}{B}"); this.expansionSetCode = "ROE"; this.subtype.add("Bat"); - this.color.setBlack(true); + this.color.setBlack(true); this.power = new MageInt(2); this.toughness = new MageInt(1); this.addAbility(FlyingAbility.getInstance()); diff --git a/Mage.Sets/src/mage/sets/riseoftheeldrazi/GlorySeeker.java b/Mage.Sets/src/mage/sets/riseoftheeldrazi/GlorySeeker.java index 1b27bf028f..1512e581e4 100644 --- a/Mage.Sets/src/mage/sets/riseoftheeldrazi/GlorySeeker.java +++ b/Mage.Sets/src/mage/sets/riseoftheeldrazi/GlorySeeker.java @@ -45,7 +45,7 @@ public class GlorySeeker extends CardImpl { this.expansionSetCode = "ROE"; this.subtype.add("Human"); this.subtype.add("Soldier"); - this.color.setWhite(true); + this.color.setWhite(true); this.power = new MageInt(2); this.toughness = new MageInt(2); } diff --git a/Mage.Sets/src/mage/sets/riseoftheeldrazi/GoblinTunneler.java b/Mage.Sets/src/mage/sets/riseoftheeldrazi/GoblinTunneler.java index fb24e030d9..d3b6440c96 100644 --- a/Mage.Sets/src/mage/sets/riseoftheeldrazi/GoblinTunneler.java +++ b/Mage.Sets/src/mage/sets/riseoftheeldrazi/GoblinTunneler.java @@ -50,34 +50,34 @@ import mage.target.common.TargetCreaturePermanent; */ public class GoblinTunneler extends CardImpl { - private static FilterCreaturePermanent filter = new FilterCreaturePermanent("creature with power 2 or less"); + private static FilterCreaturePermanent filter = new FilterCreaturePermanent("creature with power 2 or less"); - static { - filter.setPower(3); - filter.setPowerComparison(ComparisonType.LessThan); - } + static { + filter.setPower(3); + filter.setPowerComparison(ComparisonType.LessThan); + } - public GoblinTunneler(UUID ownerId) { - super(ownerId, 148, "Goblin Tunneler", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{1}{R}"); - this.expansionSetCode = "ROE"; - this.subtype.add("Goblin"); - this.subtype.add("Rogue"); - this.color.setRed(true); - this.power = new MageInt(1); - this.toughness = new MageInt(1); + public GoblinTunneler(UUID ownerId) { + super(ownerId, 148, "Goblin Tunneler", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{1}{R}"); + this.expansionSetCode = "ROE"; + this.subtype.add("Goblin"); + this.subtype.add("Rogue"); + this.color.setRed(true); + this.power = new MageInt(1); + this.toughness = new MageInt(1); - Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new GainAbilityTargetEffect(UnblockableAbility.getInstance(), Duration.EndOfTurn), new TapSourceCost()); - ability.addTarget(new TargetCreaturePermanent(filter)); - this.addAbility(ability); - } + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new GainAbilityTargetEffect(UnblockableAbility.getInstance(), Duration.EndOfTurn), new TapSourceCost()); + ability.addTarget(new TargetCreaturePermanent(filter)); + this.addAbility(ability); + } - public GoblinTunneler(final GoblinTunneler card) { - super(card); - } + public GoblinTunneler(final GoblinTunneler card) { + super(card); + } - @Override - public GoblinTunneler copy() { - return new GoblinTunneler(this); - } + @Override + public GoblinTunneler copy() { + return new GoblinTunneler(this); + } } diff --git a/Mage.Sets/src/mage/sets/riseoftheeldrazi/GravitationalShift.java b/Mage.Sets/src/mage/sets/riseoftheeldrazi/GravitationalShift.java index 5dad44756e..0eb3def153 100644 --- a/Mage.Sets/src/mage/sets/riseoftheeldrazi/GravitationalShift.java +++ b/Mage.Sets/src/mage/sets/riseoftheeldrazi/GravitationalShift.java @@ -43,7 +43,7 @@ import mage.Constants.Zone; * @author jeffwadsworth */ public class GravitationalShift extends CardImpl { - + private final static FilterCreaturePermanent filter1 = new FilterCreaturePermanent("Creatures with flying"); private final static FilterCreaturePermanent filter2 = new FilterCreaturePermanent("Creatures without flying"); @@ -61,7 +61,7 @@ public class GravitationalShift extends CardImpl { // Creatures with flying get +2/+0. this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostAllEffect(2, 0, Duration.WhileOnBattlefield, filter1, false))); - + // Creatures without flying get -2/-0. this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostAllEffect(-2, 0, Duration.WhileOnBattlefield, filter2, false))); } diff --git a/Mage.Sets/src/mage/sets/riseoftheeldrazi/GravityWell.java b/Mage.Sets/src/mage/sets/riseoftheeldrazi/GravityWell.java index 2151511203..cd1c072e04 100644 --- a/Mage.Sets/src/mage/sets/riseoftheeldrazi/GravityWell.java +++ b/Mage.Sets/src/mage/sets/riseoftheeldrazi/GravityWell.java @@ -70,18 +70,18 @@ public class GravityWell extends CardImpl { } class GravityWellTriggeredAbility extends TriggeredAbilityImpl { - + public GravityWellTriggeredAbility() { - super(Constants.Zone.BATTLEFIELD, new GravityWellEffect()); + super(Constants.Zone.BATTLEFIELD, new GravityWellEffect()); } public GravityWellTriggeredAbility(final GravityWellTriggeredAbility ability) { - super(ability); + super(ability); } @Override public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == GameEvent.EventType.ATTACKER_DECLARED ) { + if (event.getType() == GameEvent.EventType.ATTACKER_DECLARED ) { Permanent attacker = game.getPermanent(event.getSourceId()); if (attacker != null && attacker.getAbilities().contains(FlyingAbility.getInstance())) { for (Effect effect : getEffects()) { @@ -95,59 +95,59 @@ class GravityWellTriggeredAbility extends TriggeredAbilityImpl { - + public GravityWellEffect() { - super(Constants.Duration.EndOfTurn, Constants.Outcome.LoseAbility); - staticText = "it loses flying until end of turn"; + super(Constants.Duration.EndOfTurn, Constants.Outcome.LoseAbility); + staticText = "it loses flying until end of turn"; } public GravityWellEffect(final GravityWellEffect effect) { - super(effect); + super(effect); } @Override public GravityWellEffect copy() { - return new GravityWellEffect(this); + return new GravityWellEffect(this); } @Override public boolean apply(Constants.Layer layer, Constants.SubLayer sublayer, Ability source, Game game) { - Permanent permanent = game.getPermanent(targetPointer.getFirst(game, source)); - if (permanent != null) { + Permanent permanent = game.getPermanent(targetPointer.getFirst(game, source)); + if (permanent != null) { switch (layer) { case AbilityAddingRemovingEffects_6: if (sublayer == Constants.SubLayer.NA) { - for (Iterator i = permanent.getAbilities().iterator(); i.hasNext();) { + for (Iterator i = permanent.getAbilities().iterator(); i.hasNext();) { Ability entry = i.next(); if (entry.getId().equals(FlyingAbility.getInstance().getId())) - i.remove(); - } + i.remove(); + } } break; } return true; } - return false; + return false; } @Override public boolean apply(Game game, Ability source) { - return false; + return false; } @Override public boolean hasLayer(Constants.Layer layer) { - return layer == Constants.Layer.AbilityAddingRemovingEffects_6; + return layer == Constants.Layer.AbilityAddingRemovingEffects_6; } } \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/riseoftheeldrazi/GuardDuty.java b/Mage.Sets/src/mage/sets/riseoftheeldrazi/GuardDuty.java index 9bc33cdfc6..3fd6d248e3 100644 --- a/Mage.Sets/src/mage/sets/riseoftheeldrazi/GuardDuty.java +++ b/Mage.Sets/src/mage/sets/riseoftheeldrazi/GuardDuty.java @@ -53,13 +53,13 @@ public class GuardDuty extends CardImpl { super(ownerId, 23, "Guard Duty", Rarity.COMMON, new CardType[]{CardType.ENCHANTMENT}, "{W}"); this.expansionSetCode = "ROE"; this.subtype.add("Aura"); - this.color.setWhite(true); + this.color.setWhite(true); TargetPermanent auraTarget = new TargetCreaturePermanent(); - this.getSpellAbility().addTarget(auraTarget); - this.getSpellAbility().addEffect(new AttachEffect(Constants.Outcome.BoostCreature)); - Ability ability = new EnchantAbility(auraTarget.getTargetName()); - this.addAbility(ability); + this.getSpellAbility().addTarget(auraTarget); + this.getSpellAbility().addEffect(new AttachEffect(Constants.Outcome.BoostCreature)); + Ability ability = new EnchantAbility(auraTarget.getTargetName()); + this.addAbility(ability); this.addAbility(new SimpleStaticAbility(Constants.Zone.BATTLEFIELD, new GainAbilityAttachedEffect(DefenderAbility.getInstance(), Constants.AttachmentType.AURA))); } diff --git a/Mage.Sets/src/mage/sets/riseoftheeldrazi/GuardGomazoa.java b/Mage.Sets/src/mage/sets/riseoftheeldrazi/GuardGomazoa.java index 56b056f5b1..f8ed1fa67b 100644 --- a/Mage.Sets/src/mage/sets/riseoftheeldrazi/GuardGomazoa.java +++ b/Mage.Sets/src/mage/sets/riseoftheeldrazi/GuardGomazoa.java @@ -56,7 +56,7 @@ public class GuardGomazoa extends CardImpl { this.addAbility(DefenderAbility.getInstance()); this.addAbility(FlyingAbility.getInstance()); - + // Prevent all combat damage that would be dealt to Guard Gomazoa. this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new PreventCombatDamageSourceEffect(Constants.Duration.WhileOnBattlefield))); } diff --git a/Mage.Sets/src/mage/sets/riseoftheeldrazi/GuulDrazAssassin.java b/Mage.Sets/src/mage/sets/riseoftheeldrazi/GuulDrazAssassin.java index 7441ceb683..dfaf1e67c3 100644 --- a/Mage.Sets/src/mage/sets/riseoftheeldrazi/GuulDrazAssassin.java +++ b/Mage.Sets/src/mage/sets/riseoftheeldrazi/GuulDrazAssassin.java @@ -57,7 +57,7 @@ public class GuulDrazAssassin extends LevelerCard { this.expansionSetCode = "ROE"; this.subtype.add("Vampire"); this.subtype.add("Assassin"); - this.color.setBlack(true); + this.color.setBlack(true); this.power = new MageInt(1); this.toughness = new MageInt(1); diff --git a/Mage.Sets/src/mage/sets/riseoftheeldrazi/HarmlessAssault.java b/Mage.Sets/src/mage/sets/riseoftheeldrazi/HarmlessAssault.java index f8ebca4c92..464bcb7fc2 100644 --- a/Mage.Sets/src/mage/sets/riseoftheeldrazi/HarmlessAssault.java +++ b/Mage.Sets/src/mage/sets/riseoftheeldrazi/HarmlessAssault.java @@ -42,31 +42,31 @@ import mage.filter.common.FilterCreaturePermanent; public class HarmlessAssault extends CardImpl { private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("attacking creatures"); - + static { filter.setAttacking(true); filter.setUseAttacking(true); } - - public HarmlessAssault(UUID ownerId) { - super(ownerId, 24, "Harmless Assault", Rarity.COMMON, - new CardType[] { CardType.INSTANT }, "{2}{W}{W}"); - this.expansionSetCode = "ROE"; - this.color.setWhite(true); + public HarmlessAssault(UUID ownerId) { + super(ownerId, 24, "Harmless Assault", Rarity.COMMON, + new CardType[] { CardType.INSTANT }, "{2}{W}{W}"); + this.expansionSetCode = "ROE"; - // Prevent all combat damage that would be dealt this turn by attacking - // creatures. - this.getSpellAbility().addEffect( - new PreventAllDamageEffect(filter, Duration.EndOfTurn, true)); - } + this.color.setWhite(true); - public HarmlessAssault(final HarmlessAssault card) { - super(card); - } + // Prevent all combat damage that would be dealt this turn by attacking + // creatures. + this.getSpellAbility().addEffect( + new PreventAllDamageEffect(filter, Duration.EndOfTurn, true)); + } - @Override - public HarmlessAssault copy() { - return new HarmlessAssault(this); - } + public HarmlessAssault(final HarmlessAssault card) { + super(card); + } + + @Override + public HarmlessAssault copy() { + return new HarmlessAssault(this); + } } diff --git a/Mage.Sets/src/mage/sets/riseoftheeldrazi/HazeFrog.java b/Mage.Sets/src/mage/sets/riseoftheeldrazi/HazeFrog.java index 6b82f944b8..491ae6f15a 100644 --- a/Mage.Sets/src/mage/sets/riseoftheeldrazi/HazeFrog.java +++ b/Mage.Sets/src/mage/sets/riseoftheeldrazi/HazeFrog.java @@ -59,7 +59,7 @@ public class HazeFrog extends CardImpl { // Flash this.addAbility(FlashAbility.getInstance()); - + // When Haze Frog enters the battlefield, prevent all combat damage that other creatures would deal this turn. this.addAbility(new EntersBattlefieldTriggeredAbility(new HazeFrogEffect())); } diff --git a/Mage.Sets/src/mage/sets/riseoftheeldrazi/HedronMatrix.java b/Mage.Sets/src/mage/sets/riseoftheeldrazi/HedronMatrix.java index b07a404672..1ccde8fa6f 100644 --- a/Mage.Sets/src/mage/sets/riseoftheeldrazi/HedronMatrix.java +++ b/Mage.Sets/src/mage/sets/riseoftheeldrazi/HedronMatrix.java @@ -71,31 +71,31 @@ public class HedronMatrix extends CardImpl { class HedronMatrixEffect extends ContinuousEffectImpl { - public HedronMatrixEffect() { - super(Duration.WhileOnBattlefield, Constants.Layer.PTChangingEffects_7, Constants.SubLayer.ModifyPT_7c, Constants.Outcome.BoostCreature); - staticText = "Equipped creature gets +X/+X, where X is its converted mana cost"; - } + public HedronMatrixEffect() { + super(Duration.WhileOnBattlefield, Constants.Layer.PTChangingEffects_7, Constants.SubLayer.ModifyPT_7c, Constants.Outcome.BoostCreature); + staticText = "Equipped creature gets +X/+X, where X is its converted mana cost"; + } - public HedronMatrixEffect(final HedronMatrixEffect effect) { - super(effect); - } + public HedronMatrixEffect(final HedronMatrixEffect effect) { + super(effect); + } - @Override - public HedronMatrixEffect copy() { - return new HedronMatrixEffect(this); - } + @Override + public HedronMatrixEffect copy() { + return new HedronMatrixEffect(this); + } - @Override - public boolean apply(Game game, Ability source) { - Permanent equipment = game.getPermanent(source.getSourceId()); - if (equipment != null && equipment.getAttachedTo() != null) { - Permanent creature = game.getPermanent(equipment.getAttachedTo()); - if (creature != null) { - creature.addPower(creature.getManaCost().convertedManaCost()); - creature.addToughness(creature.getManaCost().convertedManaCost()); - } - } - return true; - } + @Override + public boolean apply(Game game, Ability source) { + Permanent equipment = game.getPermanent(source.getSourceId()); + if (equipment != null && equipment.getAttachedTo() != null) { + Permanent creature = game.getPermanent(equipment.getAttachedTo()); + if (creature != null) { + creature.addPower(creature.getManaCost().convertedManaCost()); + creature.addToughness(creature.getManaCost().convertedManaCost()); + } + } + return true; + } } diff --git a/Mage.Sets/src/mage/sets/riseoftheeldrazi/HellcarverDemon.java b/Mage.Sets/src/mage/sets/riseoftheeldrazi/HellcarverDemon.java index 36813f68fb..a9d550575b 100644 --- a/Mage.Sets/src/mage/sets/riseoftheeldrazi/HellcarverDemon.java +++ b/Mage.Sets/src/mage/sets/riseoftheeldrazi/HellcarverDemon.java @@ -51,7 +51,7 @@ import mage.game.Game; */ public class HellcarverDemon extends CardImpl { - + public HellcarverDemon(UUID ownerId) { super(ownerId, 113, "Hellcarver Demon", Rarity.MYTHIC, new CardType[]{CardType.CREATURE}, "{3}{B}{B}{B}"); this.expansionSetCode = "ROE"; @@ -62,7 +62,7 @@ public class HellcarverDemon extends CardImpl { this.toughness = new MageInt(6); this.addAbility(FlyingAbility.getInstance()); - + // Whenever Hellcarver Demon deals combat damage to a player, sacrifice all other permanents you control and discard your hand. Exile the top six cards of your library. You may cast any number of nonland cards exiled this way without paying their mana costs. this.addAbility(new DealsCombatDamageToAPlayerTriggeredAbility(new HellcarverDemonEffect(), false)); } @@ -78,42 +78,42 @@ public class HellcarverDemon extends CardImpl { } class HellcarverDemonEffect extends OneShotEffect { - + private final static FilterControlledPermanent filterPermanents = new FilterControlledPermanent("Permanent"); private static FilterNonlandCard filter = new FilterNonlandCard("nonland card exiled with Hellcarver Demon"); - + public HellcarverDemonEffect() { super(Outcome.PlayForFree); staticText = "sacrifice all other permanents you control and discard your hand. Exile the top six cards of your library. You may cast any number of nonland cards exiled this way without paying their mana costs."; } - + public HellcarverDemonEffect(final HellcarverDemonEffect effect) { super(effect); } - + @Override public boolean apply(Game game, Ability source) { - Player player = game.getPlayer(source.getControllerId()); + Player player = game.getPlayer(source.getControllerId()); Permanent hellcarverDemon = game.getPermanent(source.getSourceId()); - + for (Permanent permanent: game.getBattlefield().getActivePermanents(filterPermanents, source.getControllerId(), game)) { if (permanent != hellcarverDemon) { permanent.sacrifice(source.getSourceId(), game); } } - + if (player != null && player.getHand().size() > 0) { int cardsInHand = player.getHand().size(); player.discard(cardsInHand, source, game); } - + for (int i = 0; i < 6; i++) { if (player != null && player.getLibrary().size() > 0) { Card topCard = player.getLibrary().getFromTop(game); topCard.moveToExile(source.getSourceId(), "Cards exiled by Hellcarver Demon", source.getId(), game); } } - + while (player != null && player.chooseUse(Outcome.PlayForFree, "Cast another nonland card exiled with Hellcarver Demon without paying that card's mana cost?", game)) { TargetCardInExile target = new TargetCardInExile(filter, source.getSourceId()); while (player.choose(Outcome.PlayForFree, game.getExile().getExileZone(source.getSourceId()), target, game)) { @@ -131,6 +131,6 @@ class HellcarverDemonEffect extends OneShotEffect { @Override public HellcarverDemonEffect copy() { - return new HellcarverDemonEffect(this); + return new HellcarverDemonEffect(this); } } diff --git a/Mage.Sets/src/mage/sets/riseoftheeldrazi/HyenaUmbra.java b/Mage.Sets/src/mage/sets/riseoftheeldrazi/HyenaUmbra.java index 8e759ec43c..9a73b330e6 100644 --- a/Mage.Sets/src/mage/sets/riseoftheeldrazi/HyenaUmbra.java +++ b/Mage.Sets/src/mage/sets/riseoftheeldrazi/HyenaUmbra.java @@ -59,9 +59,9 @@ public class HyenaUmbra extends CardImpl { // Enchant creature TargetPermanent auraTarget = new TargetCreaturePermanent(); - this.getSpellAbility().addTarget(auraTarget); - this.getSpellAbility().addEffect(new AttachEffect(Constants.Outcome.BoostCreature)); - Ability ability = new EnchantAbility(auraTarget.getTargetName()); + this.getSpellAbility().addTarget(auraTarget); + this.getSpellAbility().addEffect(new AttachEffect(Constants.Outcome.BoostCreature)); + Ability ability = new EnchantAbility(auraTarget.getTargetName()); this.addAbility(ability); // Enchanted creature gets +1/+1 and has first strike. this.addAbility(new SimpleStaticAbility(Constants.Zone.BATTLEFIELD, new BoostEnchantedEffect(1, 1, Constants.Duration.WhileOnBattlefield))); diff --git a/Mage.Sets/src/mage/sets/riseoftheeldrazi/IkiralOutrider.java b/Mage.Sets/src/mage/sets/riseoftheeldrazi/IkiralOutrider.java index 6dd3f9ddcf..e6bbce0146 100644 --- a/Mage.Sets/src/mage/sets/riseoftheeldrazi/IkiralOutrider.java +++ b/Mage.Sets/src/mage/sets/riseoftheeldrazi/IkiralOutrider.java @@ -53,7 +53,7 @@ public class IkiralOutrider extends LevelerCard { this.expansionSetCode = "ROE"; this.subtype.add("Human"); this.subtype.add("Soldier"); - this.color.setWhite(true); + this.color.setWhite(true); this.power = new MageInt(1); this.toughness = new MageInt(2); diff --git a/Mage.Sets/src/mage/sets/riseoftheeldrazi/InquisitionOfKozilek.java b/Mage.Sets/src/mage/sets/riseoftheeldrazi/InquisitionOfKozilek.java index eaa6df922a..a5e0a848a0 100644 --- a/Mage.Sets/src/mage/sets/riseoftheeldrazi/InquisitionOfKozilek.java +++ b/Mage.Sets/src/mage/sets/riseoftheeldrazi/InquisitionOfKozilek.java @@ -58,58 +58,58 @@ public class InquisitionOfKozilek extends CardImpl { this.getSpellAbility().addEffect(new InquisitionOfKozilekEffect()); } - public InquisitionOfKozilek(final InquisitionOfKozilek card) { - super(card); - } + public InquisitionOfKozilek(final InquisitionOfKozilek card) { + super(card); + } - @Override - public InquisitionOfKozilek copy() { - return new InquisitionOfKozilek(this); - } + @Override + public InquisitionOfKozilek copy() { + return new InquisitionOfKozilek(this); + } } class InquisitionOfKozilekEffect extends OneShotEffect { - private static final FilterCard filter = new FilterCard("nonland card with converted mana cost 3 or less"); + private static final FilterCard filter = new FilterCard("nonland card with converted mana cost 3 or less"); - static { - filter.getNotCardType().add(CardType.LAND); - - filter.setConvertedManaCost(4); - filter.setConvertedManaCostComparison(ComparisonType.LessThan); - } + static { + filter.getNotCardType().add(CardType.LAND); - public InquisitionOfKozilekEffect() { - super(Outcome.Discard); - staticText = "Target player reveals his or her hand. You choose a nonland card from it with converted mana cost 3 or less. That player discards that card"; - } + filter.setConvertedManaCost(4); + filter.setConvertedManaCostComparison(ComparisonType.LessThan); + } - public InquisitionOfKozilekEffect(final InquisitionOfKozilekEffect effect) { - super(effect); - } + public InquisitionOfKozilekEffect() { + super(Outcome.Discard); + staticText = "Target player reveals his or her hand. You choose a nonland card from it with converted mana cost 3 or less. That player discards that card"; + } - @Override - public boolean apply(Game game, Ability source) { - Player player = game.getPlayer(source.getFirstTarget()); - if (player != null) { - player.revealCards("Inquisition of Kozilek", player.getHand(), game); - Player you = game.getPlayer(source.getControllerId()); - if (you != null) { - TargetCard target = new TargetCard(Zone.PICK, filter); - if (you.choose(Outcome.Benefit, player.getHand(), target, game)) { - Card card = player.getHand().get(target.getFirstTarget(), game); - if (card != null) { - return player.discard(card, source, game); - } - } - } - } - return false; - } + public InquisitionOfKozilekEffect(final InquisitionOfKozilekEffect effect) { + super(effect); + } - @Override - public InquisitionOfKozilekEffect copy() { - return new InquisitionOfKozilekEffect(this); - } + @Override + public boolean apply(Game game, Ability source) { + Player player = game.getPlayer(source.getFirstTarget()); + if (player != null) { + player.revealCards("Inquisition of Kozilek", player.getHand(), game); + Player you = game.getPlayer(source.getControllerId()); + if (you != null) { + TargetCard target = new TargetCard(Zone.PICK, filter); + if (you.choose(Outcome.Benefit, player.getHand(), target, game)) { + Card card = player.getHand().get(target.getFirstTarget(), game); + if (card != null) { + return player.discard(card, source, game); + } + } + } + } + return false; + } + + @Override + public InquisitionOfKozilekEffect copy() { + return new InquisitionOfKozilekEffect(this); + } } diff --git a/Mage.Sets/src/mage/sets/riseoftheeldrazi/Island1.java b/Mage.Sets/src/mage/sets/riseoftheeldrazi/Island1.java index e0d54ecd43..9805ebcf32 100644 --- a/Mage.Sets/src/mage/sets/riseoftheeldrazi/Island1.java +++ b/Mage.Sets/src/mage/sets/riseoftheeldrazi/Island1.java @@ -36,18 +36,18 @@ import java.util.UUID; */ public class Island1 extends mage.cards.basiclands.Island { - public Island1(UUID ownerId) { - super(ownerId, 233); - this.expansionSetCode = "ROE"; - } + public Island1(UUID ownerId) { + super(ownerId, 233); + this.expansionSetCode = "ROE"; + } - public Island1(final Island1 card) { - super(card); - } + public Island1(final Island1 card) { + super(card); + } - @Override - public Island1 copy() { - return new Island1(this); - } + @Override + public Island1 copy() { + return new Island1(this); + } } diff --git a/Mage.Sets/src/mage/sets/riseoftheeldrazi/Island2.java b/Mage.Sets/src/mage/sets/riseoftheeldrazi/Island2.java index 05aecd3c57..e166488bb6 100644 --- a/Mage.Sets/src/mage/sets/riseoftheeldrazi/Island2.java +++ b/Mage.Sets/src/mage/sets/riseoftheeldrazi/Island2.java @@ -36,18 +36,18 @@ import java.util.UUID; */ public class Island2 extends mage.cards.basiclands.Island { - public Island2(UUID ownerId) { - super(ownerId, 234); - this.expansionSetCode = "ROE"; - } + public Island2(UUID ownerId) { + super(ownerId, 234); + this.expansionSetCode = "ROE"; + } - public Island2(final Island2 card) { - super(card); - } + public Island2(final Island2 card) { + super(card); + } - @Override - public Island2 copy() { - return new Island2(this); - } + @Override + public Island2 copy() { + return new Island2(this); + } } diff --git a/Mage.Sets/src/mage/sets/riseoftheeldrazi/Island3.java b/Mage.Sets/src/mage/sets/riseoftheeldrazi/Island3.java index afe203b697..afa715b91e 100644 --- a/Mage.Sets/src/mage/sets/riseoftheeldrazi/Island3.java +++ b/Mage.Sets/src/mage/sets/riseoftheeldrazi/Island3.java @@ -36,18 +36,18 @@ import java.util.UUID; */ public class Island3 extends mage.cards.basiclands.Island { - public Island3(UUID ownerId) { - super(ownerId, 235); - this.expansionSetCode = "ROE"; - } + public Island3(UUID ownerId) { + super(ownerId, 235); + this.expansionSetCode = "ROE"; + } - public Island3(final Island3 card) { - super(card); - } + public Island3(final Island3 card) { + super(card); + } - @Override - public Island3 copy() { - return new Island3(this); - } + @Override + public Island3 copy() { + return new Island3(this); + } } diff --git a/Mage.Sets/src/mage/sets/riseoftheeldrazi/Island4.java b/Mage.Sets/src/mage/sets/riseoftheeldrazi/Island4.java index 446990310c..320937c50e 100644 --- a/Mage.Sets/src/mage/sets/riseoftheeldrazi/Island4.java +++ b/Mage.Sets/src/mage/sets/riseoftheeldrazi/Island4.java @@ -36,18 +36,18 @@ import java.util.UUID; */ public class Island4 extends mage.cards.basiclands.Island { - public Island4(UUID ownerId) { - super(ownerId, 236); - this.expansionSetCode = "ROE"; - } + public Island4(UUID ownerId) { + super(ownerId, 236); + this.expansionSetCode = "ROE"; + } - public Island4(final Island4 card) { - super(card); - } + public Island4(final Island4 card) { + super(card); + } - @Override - public Island4 copy() { - return new Island4(this); - } + @Override + public Island4 copy() { + return new Island4(this); + } } diff --git a/Mage.Sets/src/mage/sets/riseoftheeldrazi/ItThatBetrays.java b/Mage.Sets/src/mage/sets/riseoftheeldrazi/ItThatBetrays.java index e96c4584ff..10553d9405 100644 --- a/Mage.Sets/src/mage/sets/riseoftheeldrazi/ItThatBetrays.java +++ b/Mage.Sets/src/mage/sets/riseoftheeldrazi/ItThatBetrays.java @@ -43,7 +43,7 @@ import mage.abilities.common.OpponentSacrificesNonTokenPermanentTriggeredAbility * @author jeffwadsworth */ public class ItThatBetrays extends CardImpl { - + FilterNonTokenPermanent filter = new FilterNonTokenPermanent(); public ItThatBetrays(UUID ownerId) { @@ -55,7 +55,7 @@ public class ItThatBetrays extends CardImpl { this.toughness = new MageInt(11); this.addAbility(new AnnihilatorAbility(2)); - + // Whenever an opponent sacrifices a nontoken permanent, put that card onto the battlefield under your control. this.addAbility(new OpponentSacrificesNonTokenPermanentTriggeredAbility(new ReturnToBattlefieldUnderYourControlTargetEffect())); } diff --git a/Mage.Sets/src/mage/sets/riseoftheeldrazi/JoragaTreespeaker.java b/Mage.Sets/src/mage/sets/riseoftheeldrazi/JoragaTreespeaker.java index 751606017e..fe16dc77f7 100644 --- a/Mage.Sets/src/mage/sets/riseoftheeldrazi/JoragaTreespeaker.java +++ b/Mage.Sets/src/mage/sets/riseoftheeldrazi/JoragaTreespeaker.java @@ -57,28 +57,28 @@ import java.util.UUID; */ public class JoragaTreespeaker extends LevelerCard { - private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("Elves"); + private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("Elves"); - static { - filter.getSubtype().add("Elf"); - } + static { + filter.getSubtype().add("Elf"); + } - public JoragaTreespeaker(UUID ownerId) { - super(ownerId, 190, "Joraga Treespeaker", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{G}"); - this.expansionSetCode = "ROE"; - this.subtype.add("Elf"); - this.subtype.add("Druid"); - - this.color.setGreen(true); - this.power = new MageInt(1); - this.toughness = new MageInt(1); + public JoragaTreespeaker(UUID ownerId) { + super(ownerId, 190, "Joraga Treespeaker", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{G}"); + this.expansionSetCode = "ROE"; + this.subtype.add("Elf"); + this.subtype.add("Druid"); - this.addAbility(new LevelUpAbility(new ManaCostsImpl("{1}{G}"))); - - Abilities abilities1 = new AbilitiesImpl(); - abilities1.add(new SimpleManaAbility(Zone.BATTLEFIELD, new BasicManaEffect(Mana.GreenMana(2)), new TapSourceCost())); + this.color.setGreen(true); + this.power = new MageInt(1); + this.toughness = new MageInt(1); - Abilities abilities2 = new AbilitiesImpl(); + this.addAbility(new LevelUpAbility(new ManaCostsImpl("{1}{G}"))); + + Abilities abilities1 = new AbilitiesImpl(); + abilities1.add(new SimpleManaAbility(Zone.BATTLEFIELD, new BasicManaEffect(Mana.GreenMana(2)), new TapSourceCost())); + + Abilities abilities2 = new AbilitiesImpl(); abilities2.add(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityControlledEffect(new SimpleActivatedAbility(Zone.BATTLEFIELD, new BasicManaEffect(Mana.GreenMana(2)), @@ -89,16 +89,16 @@ public class JoragaTreespeaker extends LevelerCard { new LevelerCardBuilder.LevelAbility(1, 4, abilities1, 1, 2), new LevelerCardBuilder.LevelAbility(5, -1, abilities2, 1, 4) ); - } + } - public JoragaTreespeaker(final JoragaTreespeaker card) { - super(card); - } + public JoragaTreespeaker(final JoragaTreespeaker card) { + super(card); + } - @Override - public JoragaTreespeaker copy() { - return new JoragaTreespeaker(this); - } + @Override + public JoragaTreespeaker copy() { + return new JoragaTreespeaker(this); + } } diff --git a/Mage.Sets/src/mage/sets/riseoftheeldrazi/KarganDragonlord.java b/Mage.Sets/src/mage/sets/riseoftheeldrazi/KarganDragonlord.java index 8df5320132..08522e68ba 100644 --- a/Mage.Sets/src/mage/sets/riseoftheeldrazi/KarganDragonlord.java +++ b/Mage.Sets/src/mage/sets/riseoftheeldrazi/KarganDragonlord.java @@ -53,38 +53,38 @@ import java.util.UUID; */ public class KarganDragonlord extends LevelerCard { - public KarganDragonlord(UUID ownerId) { - super(ownerId, 152, "Kargan Dragonlord", Rarity.MYTHIC, new CardType[]{CardType.CREATURE}, "{R}{R}"); - this.expansionSetCode = "ROE"; - this.subtype.add("Human"); - this.subtype.add("Warrior"); - this.color.setRed(true); - this.power = new MageInt(2); - this.toughness = new MageInt(2); + public KarganDragonlord(UUID ownerId) { + super(ownerId, 152, "Kargan Dragonlord", Rarity.MYTHIC, new CardType[]{CardType.CREATURE}, "{R}{R}"); + this.expansionSetCode = "ROE"; + this.subtype.add("Human"); + this.subtype.add("Warrior"); + this.color.setRed(true); + this.power = new MageInt(2); + this.toughness = new MageInt(2); - this.addAbility(new LevelUpAbility(new ManaCostsImpl("{R}"))); + this.addAbility(new LevelUpAbility(new ManaCostsImpl("{R}"))); - Abilities abilities1 = new AbilitiesImpl(); - abilities1.add(FlyingAbility.getInstance()); + Abilities abilities1 = new AbilitiesImpl(); + abilities1.add(FlyingAbility.getInstance()); - Abilities abilities2 = new AbilitiesImpl(); - abilities2.add(FlyingAbility.getInstance()); - abilities2.add(TrampleAbility.getInstance()); - abilities2.add(new SimpleActivatedAbility(Zone.BATTLEFIELD, new BoostSourceEffect(1, 0, Duration.EndOfTurn), new ManaCostsImpl("{R}"))); + Abilities abilities2 = new AbilitiesImpl(); + abilities2.add(FlyingAbility.getInstance()); + abilities2.add(TrampleAbility.getInstance()); + abilities2.add(new SimpleActivatedAbility(Zone.BATTLEFIELD, new BoostSourceEffect(1, 0, Duration.EndOfTurn), new ManaCostsImpl("{R}"))); LevelerCardBuilder.construct(this, new LevelerCardBuilder.LevelAbility(4, 7, abilities1, 4, 4), new LevelerCardBuilder.LevelAbility(8, -1, abilities2, 8, 8) ); - } + } - public KarganDragonlord(final KarganDragonlord card) { - super(card); - } + public KarganDragonlord(final KarganDragonlord card) { + super(card); + } - @Override - public KarganDragonlord copy() { - return new KarganDragonlord(this); - } + @Override + public KarganDragonlord copy() { + return new KarganDragonlord(this); + } } diff --git a/Mage.Sets/src/mage/sets/riseoftheeldrazi/KhalniHydra.java b/Mage.Sets/src/mage/sets/riseoftheeldrazi/KhalniHydra.java index 09db70103e..8eee232eb6 100644 --- a/Mage.Sets/src/mage/sets/riseoftheeldrazi/KhalniHydra.java +++ b/Mage.Sets/src/mage/sets/riseoftheeldrazi/KhalniHydra.java @@ -50,69 +50,69 @@ import mage.game.Game; */ public class KhalniHydra extends CardImpl { - private static final FilterControlledCreaturePermanent filter; + private static final FilterControlledCreaturePermanent filter; - static { - filter = new FilterControlledCreaturePermanent(); - filter.setUseColor(true); - filter.setColor(ObjectColor.GREEN); - } + static { + filter = new FilterControlledCreaturePermanent(); + filter.setUseColor(true); + filter.setColor(ObjectColor.GREEN); + } - public KhalniHydra(UUID ownerId) { - super(ownerId, 192, "Khalni Hydra", Rarity.MYTHIC, new CardType[]{CardType.CREATURE}, "{G}{G}{G}{G}{G}{G}{G}{G}"); - this.expansionSetCode = "ROE"; - this.subtype.add("Hydra"); + public KhalniHydra(UUID ownerId) { + super(ownerId, 192, "Khalni Hydra", Rarity.MYTHIC, new CardType[]{CardType.CREATURE}, "{G}{G}{G}{G}{G}{G}{G}{G}"); + this.expansionSetCode = "ROE"; + this.subtype.add("Hydra"); - this.color.setGreen(true); - this.power = new MageInt(8); - this.toughness = new MageInt(8); - this.addAbility(new SimpleStaticAbility(Zone.STACK, new KhalniHydraCostReductionEffect())); - this.addAbility(TrampleAbility.getInstance()); - } + this.color.setGreen(true); + this.power = new MageInt(8); + this.toughness = new MageInt(8); + this.addAbility(new SimpleStaticAbility(Zone.STACK, new KhalniHydraCostReductionEffect())); + this.addAbility(TrampleAbility.getInstance()); + } - public KhalniHydra(final KhalniHydra card) { - super(card); - } + public KhalniHydra(final KhalniHydra card) { + super(card); + } - @Override - public void adjustCosts(Ability ability, Game game) { - super.adjustCosts(ability, game); - int reductionAmount = game.getBattlefield().getAllActivePermanents(filter, game).size(); - Iterator iter = ability.getManaCostsToPay().iterator(); + @Override + public void adjustCosts(Ability ability, Game game) { + super.adjustCosts(ability, game); + int reductionAmount = game.getBattlefield().getAllActivePermanents(filter, game).size(); + Iterator iter = ability.getManaCostsToPay().iterator(); - while ( reductionAmount > 0 && iter.hasNext() ) { - iter.next(); - iter.remove(); - reductionAmount--; - } - } + while ( reductionAmount > 0 && iter.hasNext() ) { + iter.next(); + iter.remove(); + reductionAmount--; + } + } - @Override - public KhalniHydra copy() { - return new KhalniHydra(this); - } + @Override + public KhalniHydra copy() { + return new KhalniHydra(this); + } } class KhalniHydraCostReductionEffect extends OneShotEffect { - private static final String effectText = "{this} costs {G} less to cast for each green creature you control"; + private static final String effectText = "{this} costs {G} less to cast for each green creature you control"; - KhalniHydraCostReductionEffect ( ) { - super(Outcome.Benefit); - this.staticText = effectText; - } + KhalniHydraCostReductionEffect ( ) { + super(Outcome.Benefit); + this.staticText = effectText; + } - KhalniHydraCostReductionEffect ( KhalniHydraCostReductionEffect effect ) { - super(effect); - } + KhalniHydraCostReductionEffect ( KhalniHydraCostReductionEffect effect ) { + super(effect); + } - @Override - public boolean apply(Game game, Ability source) { - return false; - } + @Override + public boolean apply(Game game, Ability source) { + return false; + } - @Override - public KhalniHydraCostReductionEffect copy() { - return new KhalniHydraCostReductionEffect(this); - } + @Override + public KhalniHydraCostReductionEffect copy() { + return new KhalniHydraCostReductionEffect(this); + } } diff --git a/Mage.Sets/src/mage/sets/riseoftheeldrazi/KozileksPredator.java b/Mage.Sets/src/mage/sets/riseoftheeldrazi/KozileksPredator.java index ed9a0fd486..e019c76f80 100644 --- a/Mage.Sets/src/mage/sets/riseoftheeldrazi/KozileksPredator.java +++ b/Mage.Sets/src/mage/sets/riseoftheeldrazi/KozileksPredator.java @@ -43,25 +43,25 @@ import mage.game.permanent.token.EldraziSpawnToken; */ public class KozileksPredator extends CardImpl { - public KozileksPredator(UUID ownerId) { - super(ownerId, 193, "Kozilek's Predator", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{3}{G}"); - this.expansionSetCode = "ROE"; - this.subtype.add("Eldrazi"); - this.subtype.add("Drone"); - this.color.setGreen(true); - this.power = new MageInt(3); - this.toughness = new MageInt(3); + public KozileksPredator(UUID ownerId) { + super(ownerId, 193, "Kozilek's Predator", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{3}{G}"); + this.expansionSetCode = "ROE"; + this.subtype.add("Eldrazi"); + this.subtype.add("Drone"); + this.color.setGreen(true); + this.power = new MageInt(3); + this.toughness = new MageInt(3); - this.addAbility(new EntersBattlefieldTriggeredAbility(new CreateTokenEffect(new EldraziSpawnToken(), 2), false)); - } + this.addAbility(new EntersBattlefieldTriggeredAbility(new CreateTokenEffect(new EldraziSpawnToken(), 2), false)); + } - public KozileksPredator(final KozileksPredator card) { - super(card); - } + public KozileksPredator(final KozileksPredator card) { + super(card); + } - @Override - public KozileksPredator copy() { - return new KozileksPredator(this); - } + @Override + public KozileksPredator copy() { + return new KozileksPredator(this); + } } diff --git a/Mage.Sets/src/mage/sets/riseoftheeldrazi/LagacLizard.java b/Mage.Sets/src/mage/sets/riseoftheeldrazi/LagacLizard.java index a81d8a070e..4e1577c958 100644 --- a/Mage.Sets/src/mage/sets/riseoftheeldrazi/LagacLizard.java +++ b/Mage.Sets/src/mage/sets/riseoftheeldrazi/LagacLizard.java @@ -44,7 +44,7 @@ public class LagacLizard extends CardImpl { super(ownerId, 154, "Lagac Lizard", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{3}{R}"); this.expansionSetCode = "ROE"; this.subtype.add("Lizard"); - this.color.setRed(true); + this.color.setRed(true); this.power = new MageInt(3); this.toughness = new MageInt(3); } diff --git a/Mage.Sets/src/mage/sets/riseoftheeldrazi/LastKiss.java b/Mage.Sets/src/mage/sets/riseoftheeldrazi/LastKiss.java index e96e298eac..97dd771ee4 100644 --- a/Mage.Sets/src/mage/sets/riseoftheeldrazi/LastKiss.java +++ b/Mage.Sets/src/mage/sets/riseoftheeldrazi/LastKiss.java @@ -45,7 +45,7 @@ public class LastKiss extends CardImpl { public LastKiss (UUID ownerId) { super(ownerId, 116, "Last Kiss", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{2}{B}"); this.expansionSetCode = "ROE"; - this.color.setBlack(true); + this.color.setBlack(true); this.getSpellAbility().addEffect(new DamageTargetEffect(2)); this.getSpellAbility().addEffect(new GainLifeEffect(2)); this.getSpellAbility().addTarget(new TargetCreaturePermanent()); diff --git a/Mage.Sets/src/mage/sets/riseoftheeldrazi/LayBare.java b/Mage.Sets/src/mage/sets/riseoftheeldrazi/LayBare.java index 4963162bb0..f4acb1e521 100644 --- a/Mage.Sets/src/mage/sets/riseoftheeldrazi/LayBare.java +++ b/Mage.Sets/src/mage/sets/riseoftheeldrazi/LayBare.java @@ -70,16 +70,16 @@ public class LayBare extends CardImpl { } class LayBareEffect extends OneShotEffect { - + public LayBareEffect() { super(Outcome.Benefit); staticText = "Look at its controller's hand"; } - + public LayBareEffect(final LayBareEffect effect) { super(effect); } - + @Override public boolean apply(Game game, Ability source) { Player player = game.getPlayer(source.getControllerId()); @@ -93,7 +93,7 @@ class LayBareEffect extends OneShotEffect { } return false; } - + @Override public LayBareEffect copy() { return new LayBareEffect(this); diff --git a/Mage.Sets/src/mage/sets/riseoftheeldrazi/LighthouseChronologist.java b/Mage.Sets/src/mage/sets/riseoftheeldrazi/LighthouseChronologist.java index 85354ac63b..26ba0586db 100644 --- a/Mage.Sets/src/mage/sets/riseoftheeldrazi/LighthouseChronologist.java +++ b/Mage.Sets/src/mage/sets/riseoftheeldrazi/LighthouseChronologist.java @@ -105,9 +105,9 @@ class LighthouseChronologistAbility extends TriggeredAbilityImpl { - public LighthouseChronologistEffect() { - super(Outcome.ExtraTurn); - } + public LighthouseChronologistEffect() { + super(Outcome.ExtraTurn); + } - public LighthouseChronologistEffect(final LighthouseChronologistEffect effect) { - super(effect); - } + public LighthouseChronologistEffect(final LighthouseChronologistEffect effect) { + super(effect); + } - @Override - public LighthouseChronologistEffect copy() { - return new LighthouseChronologistEffect(this); - } + @Override + public LighthouseChronologistEffect copy() { + return new LighthouseChronologistEffect(this); + } - @Override - public boolean apply(Game game, Ability source) { - game.getState().getTurnMods().add(new TurnMod(source.getControllerId(), false)); - return true; - } + @Override + public boolean apply(Game game, Ability source) { + game.getState().getTurnMods().add(new TurnMod(source.getControllerId(), false)); + return true; + } } \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/riseoftheeldrazi/LinvalaKeeperOfSilence.java b/Mage.Sets/src/mage/sets/riseoftheeldrazi/LinvalaKeeperOfSilence.java index 178dffb6df..19f36e503a 100644 --- a/Mage.Sets/src/mage/sets/riseoftheeldrazi/LinvalaKeeperOfSilence.java +++ b/Mage.Sets/src/mage/sets/riseoftheeldrazi/LinvalaKeeperOfSilence.java @@ -57,7 +57,7 @@ public class LinvalaKeeperOfSilence extends CardImpl { this.expansionSetCode = "ROE"; this.supertype.add("Legendary"); this.subtype.add("Angel"); - this.color.setWhite(true); + this.color.setWhite(true); this.power = new MageInt(3); this.toughness = new MageInt(4); this.addAbility(FlyingAbility.getInstance()); @@ -94,8 +94,8 @@ class LinvalaKeeperOfSilenceEffect extends ReplacementEffectImpl { // Enchant creature TargetPermanent auraTarget = new TargetCreaturePermanent(); - this.getSpellAbility().addTarget(auraTarget); - this.getSpellAbility().addEffect(new AttachEffect(Constants.Outcome.BoostCreature)); - Ability ability = new EnchantAbility(auraTarget.getTargetName()); + this.getSpellAbility().addTarget(auraTarget); + this.getSpellAbility().addEffect(new AttachEffect(Constants.Outcome.BoostCreature)); + Ability ability = new EnchantAbility(auraTarget.getTargetName()); this.addAbility(ability); // Enchanted creature gets +3/+3 and has vigilance. this.addAbility(new SimpleStaticAbility(Constants.Zone.BATTLEFIELD, new BoostEnchantedEffect(3, 3, Constants.Duration.WhileOnBattlefield))); diff --git a/Mage.Sets/src/mage/sets/riseoftheeldrazi/MomentousFall.java b/Mage.Sets/src/mage/sets/riseoftheeldrazi/MomentousFall.java index c69cfd18ef..4911abad72 100644 --- a/Mage.Sets/src/mage/sets/riseoftheeldrazi/MomentousFall.java +++ b/Mage.Sets/src/mage/sets/riseoftheeldrazi/MomentousFall.java @@ -54,7 +54,7 @@ public class MomentousFall extends CardImpl { // As an additional cost to cast Momentous Fall, sacrifice a creature. this.getSpellAbility().addCost(new SacrificeTargetCost(new TargetControlledCreaturePermanent())); - + // You draw cards equal to the sacrificed creature's power, then you gain life equal to its toughness. this.getSpellAbility().addEffect(new MomentousFallEffect()); } @@ -70,22 +70,22 @@ public class MomentousFall extends CardImpl { } class MomentousFallEffect extends OneShotEffect { - + public MomentousFallEffect() { super(Outcome.GainLife); staticText = "You draw cards equal to the sacrificed creature's power, then you gain life equal to its toughness"; } - + public MomentousFallEffect(final MomentousFallEffect effect) { super(effect); } - + @Override public boolean apply(Game game, Ability source) { int power = 0; int toughness = 0; Player player = game.getPlayer(source.getControllerId()); - + for (Cost cost: source.getCosts()) { if (cost instanceof SacrificeTargetCost && ((SacrificeTargetCost)cost).getPermanents().size() > 0) { power = ((SacrificeTargetCost)cost).getPermanents().get(0).getPower().getValue(); @@ -101,7 +101,7 @@ class MomentousFallEffect extends OneShotEffect { } return true; } - + @Override public MomentousFallEffect copy() { return new MomentousFallEffect(this); diff --git a/Mage.Sets/src/mage/sets/riseoftheeldrazi/Mountain1.java b/Mage.Sets/src/mage/sets/riseoftheeldrazi/Mountain1.java index 85ace36b8c..a0aa294485 100644 --- a/Mage.Sets/src/mage/sets/riseoftheeldrazi/Mountain1.java +++ b/Mage.Sets/src/mage/sets/riseoftheeldrazi/Mountain1.java @@ -36,18 +36,18 @@ import java.util.UUID; */ public class Mountain1 extends mage.cards.basiclands.Mountain { - public Mountain1(UUID ownerId) { - super(ownerId, 241); - this.expansionSetCode = "ROE"; - } + public Mountain1(UUID ownerId) { + super(ownerId, 241); + this.expansionSetCode = "ROE"; + } - public Mountain1(final Mountain1 card) { - super(card); - } + public Mountain1(final Mountain1 card) { + super(card); + } - @Override - public Mountain1 copy() { - return new Mountain1(this); - } + @Override + public Mountain1 copy() { + return new Mountain1(this); + } } diff --git a/Mage.Sets/src/mage/sets/riseoftheeldrazi/Mountain2.java b/Mage.Sets/src/mage/sets/riseoftheeldrazi/Mountain2.java index 8c601cdbd4..5b33152245 100644 --- a/Mage.Sets/src/mage/sets/riseoftheeldrazi/Mountain2.java +++ b/Mage.Sets/src/mage/sets/riseoftheeldrazi/Mountain2.java @@ -36,18 +36,18 @@ import java.util.UUID; */ public class Mountain2 extends mage.cards.basiclands.Mountain { - public Mountain2(UUID ownerId) { - super(ownerId, 242); - this.expansionSetCode = "ROE"; - } + public Mountain2(UUID ownerId) { + super(ownerId, 242); + this.expansionSetCode = "ROE"; + } - public Mountain2(final Mountain2 card) { - super(card); - } + public Mountain2(final Mountain2 card) { + super(card); + } - @Override - public Mountain2 copy() { - return new Mountain2(this); - } + @Override + public Mountain2 copy() { + return new Mountain2(this); + } } diff --git a/Mage.Sets/src/mage/sets/riseoftheeldrazi/Mountain3.java b/Mage.Sets/src/mage/sets/riseoftheeldrazi/Mountain3.java index 041e775d16..9a6cd57a96 100644 --- a/Mage.Sets/src/mage/sets/riseoftheeldrazi/Mountain3.java +++ b/Mage.Sets/src/mage/sets/riseoftheeldrazi/Mountain3.java @@ -36,18 +36,18 @@ import java.util.UUID; */ public class Mountain3 extends mage.cards.basiclands.Mountain { - public Mountain3(UUID ownerId) { - super(ownerId, 243); - this.expansionSetCode = "ROE"; - } + public Mountain3(UUID ownerId) { + super(ownerId, 243); + this.expansionSetCode = "ROE"; + } - public Mountain3(final Mountain3 card) { - super(card); - } + public Mountain3(final Mountain3 card) { + super(card); + } - @Override - public Mountain3 copy() { - return new Mountain3(this); - } + @Override + public Mountain3 copy() { + return new Mountain3(this); + } } diff --git a/Mage.Sets/src/mage/sets/riseoftheeldrazi/Mountain4.java b/Mage.Sets/src/mage/sets/riseoftheeldrazi/Mountain4.java index c9df94ceb6..cd60724671 100644 --- a/Mage.Sets/src/mage/sets/riseoftheeldrazi/Mountain4.java +++ b/Mage.Sets/src/mage/sets/riseoftheeldrazi/Mountain4.java @@ -36,18 +36,18 @@ import java.util.UUID; */ public class Mountain4 extends mage.cards.basiclands.Mountain { - public Mountain4(UUID ownerId) { - super(ownerId, 244); - this.expansionSetCode = "ROE"; - } + public Mountain4(UUID ownerId) { + super(ownerId, 244); + this.expansionSetCode = "ROE"; + } - public Mountain4(final Mountain4 card) { - super(card); - } + public Mountain4(final Mountain4 card) { + super(card); + } - @Override - public Mountain4 copy() { - return new Mountain4(this); - } + @Override + public Mountain4 copy() { + return new Mountain4(this); + } } diff --git a/Mage.Sets/src/mage/sets/riseoftheeldrazi/MulDayaChannelers.java b/Mage.Sets/src/mage/sets/riseoftheeldrazi/MulDayaChannelers.java index 60faa14c90..ad2bb1b400 100644 --- a/Mage.Sets/src/mage/sets/riseoftheeldrazi/MulDayaChannelers.java +++ b/Mage.Sets/src/mage/sets/riseoftheeldrazi/MulDayaChannelers.java @@ -50,7 +50,7 @@ import mage.choices.ChoiceColor; * @author jeffwadsworth */ public class MulDayaChannelers extends CardImpl { - + private static final String rule1 = "As long as the top card of your library is a creature card, {this} gets +3/+3"; private static final String rule2 = "As long as the top card of your library is a land card, {this} has T: Add two mana of any one color to your mana pool."; @@ -64,14 +64,14 @@ public class MulDayaChannelers extends CardImpl { this.color.setGreen(true); this.power = new MageInt(2); this.toughness = new MageInt(2); - + // Play with the top card of your library revealed. this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new PlayWithTheTopCardRevealedEffect())); - + // As long as the top card of your library is a creature card, Mul Daya Channelers gets +3/+3. ConditionalContinousEffect effect = new ConditionalContinousEffect(new BoostSourceEffect(3, 3, Constants.Duration.WhileOnBattlefield), new TopLibraryCardTypeCondition(CREATURE), rule1); this.addAbility(new SimpleStaticAbility(Constants.Zone.BATTLEFIELD, effect)); - + // As long as the top card of your library is a land card, Mul Daya Channelers has "T: Add two mana of any one color to your mana pool." ConditionalActivatedAbility ability = new ConditionalActivatedAbility(Zone.BATTLEFIELD, new AddManaOfAnyColorEffect(2), new TapSourceCost(), new TopLibraryCardTypeCondition(LAND), rule2); ability.addChoice(new ChoiceColor()); diff --git a/Mage.Sets/src/mage/sets/riseoftheeldrazi/Narcolepsy.java b/Mage.Sets/src/mage/sets/riseoftheeldrazi/Narcolepsy.java index 4d5cd696bc..fcccef728e 100644 --- a/Mage.Sets/src/mage/sets/riseoftheeldrazi/Narcolepsy.java +++ b/Mage.Sets/src/mage/sets/riseoftheeldrazi/Narcolepsy.java @@ -49,7 +49,7 @@ import mage.game.Game; * @author jeffwadsworth */ public class Narcolepsy extends CardImpl { - + private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("creature"); static { @@ -69,7 +69,7 @@ public class Narcolepsy extends CardImpl { this.getSpellAbility().addEffect(new AttachEffect(Constants.Outcome.Detriment)); EnchantAbility ability = new EnchantAbility(auraTarget.getTargetName()); this.addAbility(ability); - + // At the beginning of each upkeep, if enchanted creature is untapped, tap it. this.addAbility(new BeginningOfUpkeepTriggeredAbility(Zone.BATTLEFIELD, new NarcolepsyEffect(), Constants.TargetController.ANY, false)); } @@ -85,16 +85,16 @@ public class Narcolepsy extends CardImpl { } class NarcolepsyEffect extends OneShotEffect { - + public NarcolepsyEffect() { super(Constants.Outcome.Detriment); this.staticText = "if enchanted creature is untapped, tap it"; } - + public NarcolepsyEffect(final NarcolepsyEffect effect) { super(effect); } - + @Override public boolean apply(Game game, Ability source) { Permanent narcolepsy = game.getPermanent(source.getSourceId()); @@ -107,7 +107,7 @@ class NarcolepsyEffect extends OneShotEffect { } return false; } - + @Override public NarcolepsyEffect copy() { return new NarcolepsyEffect(this); diff --git a/Mage.Sets/src/mage/sets/riseoftheeldrazi/Naturalize.java b/Mage.Sets/src/mage/sets/riseoftheeldrazi/Naturalize.java index b61da6c4c2..e600d10e22 100644 --- a/Mage.Sets/src/mage/sets/riseoftheeldrazi/Naturalize.java +++ b/Mage.Sets/src/mage/sets/riseoftheeldrazi/Naturalize.java @@ -36,19 +36,19 @@ import java.util.UUID; */ public class Naturalize extends mage.sets.tenth.Naturalize { - public Naturalize(UUID ownerId) { - super(ownerId); - this.cardNumber = 199; - this.expansionSetCode = "ROE"; - } + public Naturalize(UUID ownerId) { + super(ownerId); + this.cardNumber = 199; + this.expansionSetCode = "ROE"; + } - public Naturalize(final Naturalize card) { - super(card); - } + public Naturalize(final Naturalize card) { + super(card); + } - @Override - public Naturalize copy() { - return new Naturalize(this); - } + @Override + public Naturalize copy() { + return new Naturalize(this); + } } diff --git a/Mage.Sets/src/mage/sets/riseoftheeldrazi/NemaSiltlurker.java b/Mage.Sets/src/mage/sets/riseoftheeldrazi/NemaSiltlurker.java index 878e81ecbc..30a3ff0e2b 100644 --- a/Mage.Sets/src/mage/sets/riseoftheeldrazi/NemaSiltlurker.java +++ b/Mage.Sets/src/mage/sets/riseoftheeldrazi/NemaSiltlurker.java @@ -44,7 +44,7 @@ public class NemaSiltlurker extends CardImpl { super(ownerId, 200, "Nema Siltlurker", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{4}{G}"); this.expansionSetCode = "ROE"; this.subtype.add("Lizard"); - this.color.setGreen(true); + this.color.setGreen(true); this.power = new MageInt(3); this.toughness = new MageInt(5); } diff --git a/Mage.Sets/src/mage/sets/riseoftheeldrazi/NestInvader.java b/Mage.Sets/src/mage/sets/riseoftheeldrazi/NestInvader.java index 55e683e1ee..4c662aafce 100644 --- a/Mage.Sets/src/mage/sets/riseoftheeldrazi/NestInvader.java +++ b/Mage.Sets/src/mage/sets/riseoftheeldrazi/NestInvader.java @@ -43,25 +43,25 @@ import mage.game.permanent.token.EldraziSpawnToken; */ public class NestInvader extends CardImpl { - public NestInvader(UUID ownerId) { - super(ownerId, 201, "Nest Invader", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{1}{G}"); - this.expansionSetCode = "ROE"; - this.subtype.add("Eldrazi"); - this.subtype.add("Drone"); - this.color.setGreen(true); - this.power = new MageInt(2); - this.toughness = new MageInt(2); + public NestInvader(UUID ownerId) { + super(ownerId, 201, "Nest Invader", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{1}{G}"); + this.expansionSetCode = "ROE"; + this.subtype.add("Eldrazi"); + this.subtype.add("Drone"); + this.color.setGreen(true); + this.power = new MageInt(2); + this.toughness = new MageInt(2); - this.addAbility(new EntersBattlefieldTriggeredAbility(new CreateTokenEffect(new EldraziSpawnToken()), false)); - } + this.addAbility(new EntersBattlefieldTriggeredAbility(new CreateTokenEffect(new EldraziSpawnToken()), false)); + } - public NestInvader(final NestInvader card) { - super(card); - } + public NestInvader(final NestInvader card) { + super(card); + } - @Override - public NestInvader copy() { - return new NestInvader(this); - } + @Override + public NestInvader copy() { + return new NestInvader(this); + } } \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/riseoftheeldrazi/Nighthaze.java b/Mage.Sets/src/mage/sets/riseoftheeldrazi/Nighthaze.java index 72fd7a18a7..7b6262fd98 100644 --- a/Mage.Sets/src/mage/sets/riseoftheeldrazi/Nighthaze.java +++ b/Mage.Sets/src/mage/sets/riseoftheeldrazi/Nighthaze.java @@ -48,7 +48,7 @@ public class Nighthaze extends CardImpl { public Nighthaze (UUID ownerId) { super(ownerId, 118, "Nighthaze", Rarity.COMMON, new CardType[]{CardType.SORCERY}, "{B}"); this.expansionSetCode = "ROE"; - this.color.setBlack(true); + this.color.setBlack(true); this.getSpellAbility().addEffect(new GainAbilityTargetEffect(new SwampwalkAbility(), Constants.Duration.EndOfTurn)); this.getSpellAbility().addEffect(new DrawCardControllerEffect(1)); this.getSpellAbility().addTarget(new TargetCreaturePermanent()); diff --git a/Mage.Sets/src/mage/sets/riseoftheeldrazi/NirkanaCutthroat.java b/Mage.Sets/src/mage/sets/riseoftheeldrazi/NirkanaCutthroat.java index 3cf5c28fdc..aeda80a53d 100644 --- a/Mage.Sets/src/mage/sets/riseoftheeldrazi/NirkanaCutthroat.java +++ b/Mage.Sets/src/mage/sets/riseoftheeldrazi/NirkanaCutthroat.java @@ -54,7 +54,7 @@ public class NirkanaCutthroat extends LevelerCard { this.expansionSetCode = "ROE"; this.subtype.add("Vampire"); this.subtype.add("Warrior"); - this.color.setBlack(true); + this.color.setBlack(true); this.power = new MageInt(3); this.toughness = new MageInt(2); this.addAbility(new LevelUpAbility(new ManaCostsImpl("{2}{B}"))); diff --git a/Mage.Sets/src/mage/sets/riseoftheeldrazi/NirkanaRevenant.java b/Mage.Sets/src/mage/sets/riseoftheeldrazi/NirkanaRevenant.java index e1923449a5..8e90953103 100644 --- a/Mage.Sets/src/mage/sets/riseoftheeldrazi/NirkanaRevenant.java +++ b/Mage.Sets/src/mage/sets/riseoftheeldrazi/NirkanaRevenant.java @@ -66,7 +66,7 @@ public class NirkanaRevenant extends CardImpl { // Whenever you tap a Swamp for mana, add {B} to your mana pool. this.addAbility(new NirkanaRevenantTriggeredAbility()); - + // {B}: Nirkana Revenant gets +1/+1 until end of turn. this.addAbility(new SimpleActivatedAbility(Constants.Zone.BATTLEFIELD, new BoostSourceEffect(1, 1, Constants.Duration.EndOfTurn), new ManaCostsImpl("{B}"))); } @@ -82,33 +82,33 @@ public class NirkanaRevenant extends CardImpl { } class NirkanaRevenantTriggeredAbility extends TriggeredAbilityImpl { - + public NirkanaRevenantTriggeredAbility() { - super(Zone.BATTLEFIELD, new NirkanaRevenantEffect()); + super(Zone.BATTLEFIELD, new NirkanaRevenantEffect()); } public NirkanaRevenantTriggeredAbility(final NirkanaRevenantTriggeredAbility ability) { - super(ability); + super(ability); } - + @Override public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == GameEvent.EventType.TAPPED_FOR_MANA ) { + if (event.getType() == GameEvent.EventType.TAPPED_FOR_MANA ) { Permanent permanent = game.getPermanent(event.getSourceId()); if (permanent == null) { - permanent = (Permanent) game.getLastKnownInformation(event.getSourceId(), Zone.BATTLEFIELD); + permanent = (Permanent) game.getLastKnownInformation(event.getSourceId(), Zone.BATTLEFIELD); } if (permanent != null && permanent.getSubtype().contains("Swamp") && permanent.getControllerId().equals(this.controllerId)) { getEffects().get(0).setTargetPointer(new FixedTarget(permanent.getId())); return true; } - } - return false; } - + return false; + } + @Override public NirkanaRevenantTriggeredAbility copy() { - return new NirkanaRevenantTriggeredAbility(this); + return new NirkanaRevenantTriggeredAbility(this); } @Override @@ -118,15 +118,15 @@ public class NirkanaRevenant extends CardImpl { } class NirkanaRevenantEffect extends OneShotEffect { - + NirkanaRevenantEffect() { super(Outcome.PutManaInPool); } - + NirkanaRevenantEffect(final NirkanaRevenantEffect effect) { super(effect); } - + @Override public boolean apply(Game game, Ability source) { Player player = game.getPlayer(source.getControllerId()); @@ -136,10 +136,10 @@ class NirkanaRevenantEffect extends OneShotEffect { } return false; } - + @Override public NirkanaRevenantEffect copy() { - return new NirkanaRevenantEffect(this); + return new NirkanaRevenantEffect(this); } } diff --git a/Mage.Sets/src/mage/sets/riseoftheeldrazi/NotOfThisWorld.java b/Mage.Sets/src/mage/sets/riseoftheeldrazi/NotOfThisWorld.java index 1b17c6ba5f..a86c1113fd 100644 --- a/Mage.Sets/src/mage/sets/riseoftheeldrazi/NotOfThisWorld.java +++ b/Mage.Sets/src/mage/sets/riseoftheeldrazi/NotOfThisWorld.java @@ -49,165 +49,165 @@ import java.util.UUID; */ public class NotOfThisWorld extends CardImpl { - public NotOfThisWorld(UUID ownerId) { - super(ownerId, 8, "Not of This World", Rarity.UNCOMMON, - new CardType[] { CardType.INSTANT }, "{7}"); - this.expansionSetCode = "ROE"; - this.supertype.add("Tribal"); - this.subtype.add("Eldrazi"); + public NotOfThisWorld(UUID ownerId) { + super(ownerId, 8, "Not of This World", Rarity.UNCOMMON, + new CardType[] { CardType.INSTANT }, "{7}"); + this.expansionSetCode = "ROE"; + this.supertype.add("Tribal"); + this.subtype.add("Eldrazi"); - // Counter target spell or ability that targets a permanent you control. - this.getSpellAbility() - .addTarget( - new TargetSpellTargetingControlledPermanent( - new FilterSpell( - "a spell or ability that targets a creature you control with power 7 or greater."))); - this.getSpellAbility().addEffect(new CounterTargetEffect()); - // Not of This World costs {7} less to cast if it targets a spell or - // ability that targets a creature you control with power 7 or greater. - } + // Counter target spell or ability that targets a permanent you control. + this.getSpellAbility() + .addTarget( + new TargetSpellTargetingControlledPermanent( + new FilterSpell( + "a spell or ability that targets a creature you control with power 7 or greater."))); + this.getSpellAbility().addEffect(new CounterTargetEffect()); + // Not of This World costs {7} less to cast if it targets a spell or + // ability that targets a creature you control with power 7 or greater. + } - @Override - public void adjustCosts(Ability ability, Game game) { + @Override + public void adjustCosts(Ability ability, Game game) { - if (ability.getTargets().isChosen() - && game.getStack().getStackObject( - ability.getTargets().getFirstTarget()) != null - && game.getPermanent(game.getStack() - .getStackObject(ability.getTargets().getFirstTarget()) - .getStackAbility().getTargets().getFirstTarget()) != null - && game.getPermanent( - game.getStack() - .getStackObject( - ability.getTargets().getFirstTarget()) - .getStackAbility().getTargets() - .getFirstTarget()).getPower().getValue() >= 7) { + if (ability.getTargets().isChosen() + && game.getStack().getStackObject( + ability.getTargets().getFirstTarget()) != null + && game.getPermanent(game.getStack() + .getStackObject(ability.getTargets().getFirstTarget()) + .getStackAbility().getTargets().getFirstTarget()) != null + && game.getPermanent( + game.getStack() + .getStackObject( + ability.getTargets().getFirstTarget()) + .getStackAbility().getTargets() + .getFirstTarget()).getPower().getValue() >= 7) { - String adjustedCost = "{0}"; - ability.getManaCostsToPay().clear(); - ability.getManaCostsToPay().load(adjustedCost); + String adjustedCost = "{0}"; + ability.getManaCostsToPay().clear(); + ability.getManaCostsToPay().load(adjustedCost); - } + } - } + } - public NotOfThisWorld(final NotOfThisWorld card) { - super(card); - } + public NotOfThisWorld(final NotOfThisWorld card) { + super(card); + } - @Override - public NotOfThisWorld copy() { - return new NotOfThisWorld(this); - } + @Override + public NotOfThisWorld copy() { + return new NotOfThisWorld(this); + } } class TargetSpellTargetingControlledPermanent extends - TargetObject { + TargetObject { - protected FilterSpell filter; + protected FilterSpell filter; - public TargetSpellTargetingControlledPermanent() { - this(1, 1, new FilterSpell()); - } + public TargetSpellTargetingControlledPermanent() { + this(1, 1, new FilterSpell()); + } - public TargetSpellTargetingControlledPermanent(FilterSpell filter) { - this(1, 1, filter); - } + public TargetSpellTargetingControlledPermanent(FilterSpell filter) { + this(1, 1, filter); + } - public TargetSpellTargetingControlledPermanent(int numTargets, - FilterSpell filter) { - this(numTargets, numTargets, filter); - } + public TargetSpellTargetingControlledPermanent(int numTargets, + FilterSpell filter) { + this(numTargets, numTargets, filter); + } - public TargetSpellTargetingControlledPermanent(int minNumTargets, - int maxNumTargets, FilterSpell filter) { - this.minNumberOfTargets = minNumTargets; - this.maxNumberOfTargets = maxNumTargets; - this.zone = Zone.STACK; - this.filter = filter; - this.targetName = filter.getMessage(); - } + public TargetSpellTargetingControlledPermanent(int minNumTargets, + int maxNumTargets, FilterSpell filter) { + this.minNumberOfTargets = minNumTargets; + this.maxNumberOfTargets = maxNumTargets; + this.zone = Zone.STACK; + this.filter = filter; + this.targetName = filter.getMessage(); + } - public TargetSpellTargetingControlledPermanent( - final TargetSpellTargetingControlledPermanent target) { - super(target); - this.filter = target.filter.copy(); - } + public TargetSpellTargetingControlledPermanent( + final TargetSpellTargetingControlledPermanent target) { + super(target); + this.filter = target.filter.copy(); + } - @Override - public FilterSpell getFilter() { - return filter; - } + @Override + public FilterSpell getFilter() { + return filter; + } - @Override - public boolean canTarget(UUID id, Ability source, Game game) { - Spell spell = game.getStack().getSpell(id); - if (spell != null) { - return filter.match(spell, game); - } - return false; - } + @Override + public boolean canTarget(UUID id, Ability source, Game game) { + Spell spell = game.getStack().getSpell(id); + if (spell != null) { + return filter.match(spell, game); + } + return false; + } - @Override - public boolean canChoose(UUID sourceId, UUID sourceControllerId, Game game) { - return canChoose(sourceControllerId, game); - } + @Override + public boolean canChoose(UUID sourceId, UUID sourceControllerId, Game game) { + return canChoose(sourceControllerId, game); + } - @Override - public boolean canChoose(UUID sourceControllerId, Game game) { - int count = 0; - for (StackObject stackObject : game.getStack()) { - if (stackObject instanceof Spell - && game.getPlayer(sourceControllerId).getInRange() - .contains(stackObject.getControllerId()) - && filter.match((Spell) stackObject, game) - && ((Spell) stackObject).getSpellAbility().getTargets() - .isChosen() - && game.getPermanent(((Spell) stackObject) - .getSpellAbility().getTargets().getFirstTarget()) != null - && game.getPermanent( - ((Spell) stackObject).getSpellAbility() - .getTargets().getFirstTarget()) - .getControllerId() == sourceControllerId) { - count++; - if (count >= this.minNumberOfTargets) - return true; - } - } - return false; - } + @Override + public boolean canChoose(UUID sourceControllerId, Game game) { + int count = 0; + for (StackObject stackObject : game.getStack()) { + if (stackObject instanceof Spell + && game.getPlayer(sourceControllerId).getInRange() + .contains(stackObject.getControllerId()) + && filter.match((Spell) stackObject, game) + && ((Spell) stackObject).getSpellAbility().getTargets() + .isChosen() + && game.getPermanent(((Spell) stackObject) + .getSpellAbility().getTargets().getFirstTarget()) != null + && game.getPermanent( + ((Spell) stackObject).getSpellAbility() + .getTargets().getFirstTarget()) + .getControllerId() == sourceControllerId) { + count++; + if (count >= this.minNumberOfTargets) + return true; + } + } + return false; + } - @Override - public Set possibleTargets(UUID sourceId, UUID sourceControllerId, - Game game) { - return possibleTargets(sourceControllerId, game); - } + @Override + public Set possibleTargets(UUID sourceId, UUID sourceControllerId, + Game game) { + return possibleTargets(sourceControllerId, game); + } - @Override - public Set possibleTargets(UUID sourceControllerId, Game game) { - Set possibleTargets = new HashSet(); - for (StackObject stackObject : game.getStack()) { - if (stackObject instanceof Spell - && game.getPlayer(sourceControllerId).getInRange() - .contains(stackObject.getControllerId()) - && filter.match((Spell) stackObject, game) - && ((Spell) stackObject).getSpellAbility().getTargets() - .isChosen() - && game.getPermanent(((Spell) stackObject) - .getSpellAbility().getTargets().getFirstTarget()) != null - && game.getPermanent( - ((Spell) stackObject).getSpellAbility() - .getTargets().getFirstTarget()) - .getControllerId() == sourceControllerId) { - possibleTargets.add(stackObject.getId()); - } - } - return possibleTargets; - } + @Override + public Set possibleTargets(UUID sourceControllerId, Game game) { + Set possibleTargets = new HashSet(); + for (StackObject stackObject : game.getStack()) { + if (stackObject instanceof Spell + && game.getPlayer(sourceControllerId).getInRange() + .contains(stackObject.getControllerId()) + && filter.match((Spell) stackObject, game) + && ((Spell) stackObject).getSpellAbility().getTargets() + .isChosen() + && game.getPermanent(((Spell) stackObject) + .getSpellAbility().getTargets().getFirstTarget()) != null + && game.getPermanent( + ((Spell) stackObject).getSpellAbility() + .getTargets().getFirstTarget()) + .getControllerId() == sourceControllerId) { + possibleTargets.add(stackObject.getId()); + } + } + return possibleTargets; + } - @Override - public TargetSpellTargetingControlledPermanent copy() { - return new TargetSpellTargetingControlledPermanent(this); - } + @Override + public TargetSpellTargetingControlledPermanent copy() { + return new TargetSpellTargetingControlledPermanent(this); + } } diff --git a/Mage.Sets/src/mage/sets/riseoftheeldrazi/NullChampion.java b/Mage.Sets/src/mage/sets/riseoftheeldrazi/NullChampion.java index 43809c5ec1..2f02dfea4d 100644 --- a/Mage.Sets/src/mage/sets/riseoftheeldrazi/NullChampion.java +++ b/Mage.Sets/src/mage/sets/riseoftheeldrazi/NullChampion.java @@ -55,7 +55,7 @@ public class NullChampion extends LevelerCard { this.expansionSetCode = "ROE"; this.subtype.add("Zombie"); this.subtype.add("Warrior"); - this.color.setBlack(true); + this.color.setBlack(true); this.power = new MageInt(1); this.toughness = new MageInt(1); this.addAbility(new LevelUpAbility(new ManaCostsImpl("{3}"))); diff --git a/Mage.Sets/src/mage/sets/riseoftheeldrazi/OgresCleaver.java b/Mage.Sets/src/mage/sets/riseoftheeldrazi/OgresCleaver.java index dcc8a0c9bb..99c1f81b1c 100644 --- a/Mage.Sets/src/mage/sets/riseoftheeldrazi/OgresCleaver.java +++ b/Mage.Sets/src/mage/sets/riseoftheeldrazi/OgresCleaver.java @@ -49,9 +49,9 @@ public class OgresCleaver extends CardImpl { super(ownerId, 220, "Ogre's Cleaver", Rarity.UNCOMMON, new CardType[]{CardType.ARTIFACT}, "{2}"); this.expansionSetCode = "ROE"; this.subtype.add("Equipment"); - + this.addAbility(new EquipAbility(Outcome.AddAbility, new GenericManaCost(5))); - this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostEquippedEffect(5, 0))); + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostEquippedEffect(5, 0))); } public OgresCleaver (final OgresCleaver card) { diff --git a/Mage.Sets/src/mage/sets/riseoftheeldrazi/PestilenceDemon.java b/Mage.Sets/src/mage/sets/riseoftheeldrazi/PestilenceDemon.java index 7a68ee11c9..2124b1cbae 100644 --- a/Mage.Sets/src/mage/sets/riseoftheeldrazi/PestilenceDemon.java +++ b/Mage.Sets/src/mage/sets/riseoftheeldrazi/PestilenceDemon.java @@ -54,7 +54,7 @@ public class PestilenceDemon extends CardImpl { super(ownerId, 124, "Pestilence Demon", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{5}{B}{B}{B}"); this.expansionSetCode = "ROE"; this.subtype.add("Demon"); - this.color.setBlack(true); + this.color.setBlack(true); this.power = new MageInt(7); this.toughness = new MageInt(6); this.addAbility(FlyingAbility.getInstance()); diff --git a/Mage.Sets/src/mage/sets/riseoftheeldrazi/Plains1.java b/Mage.Sets/src/mage/sets/riseoftheeldrazi/Plains1.java index 41d3ef0c6e..fe69346547 100644 --- a/Mage.Sets/src/mage/sets/riseoftheeldrazi/Plains1.java +++ b/Mage.Sets/src/mage/sets/riseoftheeldrazi/Plains1.java @@ -36,18 +36,18 @@ import java.util.UUID; */ public class Plains1 extends mage.cards.basiclands.Plains { - public Plains1(UUID ownerId) { - super(ownerId, 229); - this.expansionSetCode = "ROE"; - } + public Plains1(UUID ownerId) { + super(ownerId, 229); + this.expansionSetCode = "ROE"; + } - public Plains1(final Plains1 card) { - super(card); - } + public Plains1(final Plains1 card) { + super(card); + } - @Override - public Plains1 copy() { - return new Plains1(this); - } + @Override + public Plains1 copy() { + return new Plains1(this); + } } diff --git a/Mage.Sets/src/mage/sets/riseoftheeldrazi/Plains2.java b/Mage.Sets/src/mage/sets/riseoftheeldrazi/Plains2.java index 77c3941260..382070b919 100644 --- a/Mage.Sets/src/mage/sets/riseoftheeldrazi/Plains2.java +++ b/Mage.Sets/src/mage/sets/riseoftheeldrazi/Plains2.java @@ -36,18 +36,18 @@ import java.util.UUID; */ public class Plains2 extends mage.cards.basiclands.Plains { - public Plains2(UUID ownerId) { - super(ownerId, 230); - this.expansionSetCode = "ROE"; - } + public Plains2(UUID ownerId) { + super(ownerId, 230); + this.expansionSetCode = "ROE"; + } - public Plains2(final Plains2 card) { - super(card); - } + public Plains2(final Plains2 card) { + super(card); + } - @Override - public Plains2 copy() { - return new Plains2(this); - } + @Override + public Plains2 copy() { + return new Plains2(this); + } } diff --git a/Mage.Sets/src/mage/sets/riseoftheeldrazi/Plains3.java b/Mage.Sets/src/mage/sets/riseoftheeldrazi/Plains3.java index 1b1535ee9a..bd3331edbd 100644 --- a/Mage.Sets/src/mage/sets/riseoftheeldrazi/Plains3.java +++ b/Mage.Sets/src/mage/sets/riseoftheeldrazi/Plains3.java @@ -36,18 +36,18 @@ import java.util.UUID; */ public class Plains3 extends mage.cards.basiclands.Plains { - public Plains3(UUID ownerId) { - super(ownerId, 231); - this.expansionSetCode = "ROE"; - } + public Plains3(UUID ownerId) { + super(ownerId, 231); + this.expansionSetCode = "ROE"; + } - public Plains3(final Plains3 card) { - super(card); - } + public Plains3(final Plains3 card) { + super(card); + } - @Override - public Plains3 copy() { - return new Plains3(this); - } + @Override + public Plains3 copy() { + return new Plains3(this); + } } diff --git a/Mage.Sets/src/mage/sets/riseoftheeldrazi/Plains4.java b/Mage.Sets/src/mage/sets/riseoftheeldrazi/Plains4.java index ae77653539..bc5e01410b 100644 --- a/Mage.Sets/src/mage/sets/riseoftheeldrazi/Plains4.java +++ b/Mage.Sets/src/mage/sets/riseoftheeldrazi/Plains4.java @@ -36,18 +36,18 @@ import java.util.UUID; */ public class Plains4 extends mage.cards.basiclands.Plains { - public Plains4(UUID ownerId) { - super(ownerId, 232); - this.expansionSetCode = "ROE"; - } + public Plains4(UUID ownerId) { + super(ownerId, 232); + this.expansionSetCode = "ROE"; + } - public Plains4(final Plains4 card) { - super(card); - } + public Plains4(final Plains4 card) { + super(card); + } - @Override - public Plains4 copy() { - return new Plains4(this); - } + @Override + public Plains4 copy() { + return new Plains4(this); + } } diff --git a/Mage.Sets/src/mage/sets/riseoftheeldrazi/PreysVengeance.java b/Mage.Sets/src/mage/sets/riseoftheeldrazi/PreysVengeance.java index 242f236814..ba7ed4f0cd 100644 --- a/Mage.Sets/src/mage/sets/riseoftheeldrazi/PreysVengeance.java +++ b/Mage.Sets/src/mage/sets/riseoftheeldrazi/PreysVengeance.java @@ -47,7 +47,7 @@ public class PreysVengeance extends CardImpl { public PreysVengeance (UUID ownerId) { super(ownerId, 205, "Prey's Vengeance", Rarity.UNCOMMON, new CardType[]{CardType.INSTANT}, "{G}"); this.expansionSetCode = "ROE"; - this.color.setGreen(true); + this.color.setGreen(true); this.getSpellAbility().addEffect(new BoostTargetEffect(2, 2, Constants.Duration.EndOfTurn)); this.getSpellAbility().addTarget(new TargetCreaturePermanent()); this.addAbility(new ReboundAbility()); diff --git a/Mage.Sets/src/mage/sets/riseoftheeldrazi/SarkhanTheMad.java b/Mage.Sets/src/mage/sets/riseoftheeldrazi/SarkhanTheMad.java index 83be4fa05c..180e881b6c 100644 --- a/Mage.Sets/src/mage/sets/riseoftheeldrazi/SarkhanTheMad.java +++ b/Mage.Sets/src/mage/sets/riseoftheeldrazi/SarkhanTheMad.java @@ -59,150 +59,150 @@ import mage.target.common.TargetCreaturePermanent; */ public class SarkhanTheMad extends CardImpl { - public SarkhanTheMad(UUID ownerId) { - super(ownerId, 214, "Sarkhan the Mad", Rarity.MYTHIC, new CardType[]{CardType.PLANESWALKER}, "{3}{B}{R}"); - this.expansionSetCode = "ROE"; - this.subtype.add("Sarkhan"); - this.addAbility(new EntersBattlefieldAbility(new AddCountersSourceEffect(CounterType.LOYALTY.createInstance(7)), "")); + public SarkhanTheMad(UUID ownerId) { + super(ownerId, 214, "Sarkhan the Mad", Rarity.MYTHIC, new CardType[]{CardType.PLANESWALKER}, "{3}{B}{R}"); + this.expansionSetCode = "ROE"; + this.subtype.add("Sarkhan"); + this.addAbility(new EntersBattlefieldAbility(new AddCountersSourceEffect(CounterType.LOYALTY.createInstance(7)), "")); - this.color.setBlack(true); - this.color.setRed(true); + this.color.setBlack(true); + this.color.setRed(true); - this.addAbility(new LoyaltyAbility(new SarkhanTheMadRevealAndDrawEffect(), 0)); - Target targetCreature = new TargetCreaturePermanent(); - Ability sacAbility = new LoyaltyAbility(new SarkhanTheMadSacEffect(), -2); - sacAbility.addTarget(targetCreature); - this.addAbility(sacAbility); - Ability damageAbility = new LoyaltyAbility(new SarkhanTheMadDragonDamageEffect(), -4); - damageAbility.addTarget(new TargetPlayer()); - this.addAbility(damageAbility); - } + this.addAbility(new LoyaltyAbility(new SarkhanTheMadRevealAndDrawEffect(), 0)); + Target targetCreature = new TargetCreaturePermanent(); + Ability sacAbility = new LoyaltyAbility(new SarkhanTheMadSacEffect(), -2); + sacAbility.addTarget(targetCreature); + this.addAbility(sacAbility); + Ability damageAbility = new LoyaltyAbility(new SarkhanTheMadDragonDamageEffect(), -4); + damageAbility.addTarget(new TargetPlayer()); + this.addAbility(damageAbility); + } - public SarkhanTheMad(final SarkhanTheMad card) { - super(card); - } + public SarkhanTheMad(final SarkhanTheMad card) { + super(card); + } - @Override - public SarkhanTheMad copy() { - return new SarkhanTheMad(this); - } + @Override + public SarkhanTheMad copy() { + return new SarkhanTheMad(this); + } } class SarkhanTheMadRevealAndDrawEffect extends OneShotEffect { - private static final String effectText = "Reveal the top card of your library and put it into your hand. {this} deals damage to himself equal to that card's converted mana cost"; + private static final String effectText = "Reveal the top card of your library and put it into your hand. {this} deals damage to himself equal to that card's converted mana cost"; - SarkhanTheMadRevealAndDrawEffect ( ) { - super(Outcome.DrawCard); - staticText = effectText; - } + SarkhanTheMadRevealAndDrawEffect ( ) { + super(Outcome.DrawCard); + staticText = effectText; + } - SarkhanTheMadRevealAndDrawEffect ( SarkhanTheMadRevealAndDrawEffect effect ) { - super(effect); - } + SarkhanTheMadRevealAndDrawEffect ( SarkhanTheMadRevealAndDrawEffect effect ) { + super(effect); + } - @Override - public boolean apply(Game game, Ability source) { - Player player = game.getPlayer(source.getControllerId()); - if (player != null && player.getLibrary().size() > 0) { - Card card = player.getLibrary().removeFromTop(game); - Permanent permanent = game.getPermanent(source.getSourceId()); - if (card != null) { - card.moveToZone(Zone.HAND, source.getId(), game, false); - permanent.damage(card.getManaCost().convertedManaCost(), this.getId(), game, false, false); - Cards cards = new CardsImpl(); - cards.add(card); - player.revealCards("Sarkhan the Mad", cards, game); - return true; - } - } - return false; - } + @Override + public boolean apply(Game game, Ability source) { + Player player = game.getPlayer(source.getControllerId()); + if (player != null && player.getLibrary().size() > 0) { + Card card = player.getLibrary().removeFromTop(game); + Permanent permanent = game.getPermanent(source.getSourceId()); + if (card != null) { + card.moveToZone(Zone.HAND, source.getId(), game, false); + permanent.damage(card.getManaCost().convertedManaCost(), this.getId(), game, false, false); + Cards cards = new CardsImpl(); + cards.add(card); + player.revealCards("Sarkhan the Mad", cards, game); + return true; + } + } + return false; + } - @Override - public SarkhanTheMadRevealAndDrawEffect copy() { - return new SarkhanTheMadRevealAndDrawEffect(this); - } + @Override + public SarkhanTheMadRevealAndDrawEffect copy() { + return new SarkhanTheMadRevealAndDrawEffect(this); + } } class SarkhanTheMadSacEffect extends OneShotEffect { - private static final String effectText = "Target creature's controller sacrifices it, then that player puts a 5/5 red Dragon creature token with flying onto the battlefield"; + private static final String effectText = "Target creature's controller sacrifices it, then that player puts a 5/5 red Dragon creature token with flying onto the battlefield"; - SarkhanTheMadSacEffect ( ) { - super(Outcome.Sacrifice); - staticText = effectText; - } + SarkhanTheMadSacEffect ( ) { + super(Outcome.Sacrifice); + staticText = effectText; + } - SarkhanTheMadSacEffect ( SarkhanTheMadSacEffect effect ) { - super(effect); - } + SarkhanTheMadSacEffect ( SarkhanTheMadSacEffect effect ) { + super(effect); + } - @Override - public boolean apply(Game game, Ability source) { - Permanent permanent = game.getPermanent(source.getTargets().getFirstTarget()); - if ( permanent != null ) { - Player player = game.getPlayer(permanent.getControllerId()); - permanent.sacrifice(this.getId(), game); - Token dragonToken = new DragonToken(); - dragonToken.putOntoBattlefield(1, game, this.getId(), player.getId()); - } - return false; - } + @Override + public boolean apply(Game game, Ability source) { + Permanent permanent = game.getPermanent(source.getTargets().getFirstTarget()); + if ( permanent != null ) { + Player player = game.getPlayer(permanent.getControllerId()); + permanent.sacrifice(this.getId(), game); + Token dragonToken = new DragonToken(); + dragonToken.putOntoBattlefield(1, game, this.getId(), player.getId()); + } + return false; + } - @Override - public SarkhanTheMadSacEffect copy() { - return new SarkhanTheMadSacEffect(this); - } + @Override + public SarkhanTheMadSacEffect copy() { + return new SarkhanTheMadSacEffect(this); + } } class SarkhanTheMadDragonDamageEffect extends OneShotEffect { - private static final String effectText = "Each Dragon creature you control deals damage equal to its power to target player"; - private static final FilterControlledPermanent filter; + private static final String effectText = "Each Dragon creature you control deals damage equal to its power to target player"; + private static final FilterControlledPermanent filter; - static { - filter = new FilterControlledPermanent(); - filter.getCardType().add(CardType.CREATURE); - filter.getSubtype().add("Dragon"); - } + static { + filter = new FilterControlledPermanent(); + filter.getCardType().add(CardType.CREATURE); + filter.getSubtype().add("Dragon"); + } - SarkhanTheMadDragonDamageEffect ( ) { - super(Outcome.Damage); - staticText = effectText; - } + SarkhanTheMadDragonDamageEffect ( ) { + super(Outcome.Damage); + staticText = effectText; + } - SarkhanTheMadDragonDamageEffect ( SarkhanTheMadDragonDamageEffect effect ) { - super(effect); - } + SarkhanTheMadDragonDamageEffect ( SarkhanTheMadDragonDamageEffect effect ) { + super(effect); + } - @Override - public boolean apply(Game game, Ability source) { - List dragons = game.getBattlefield().getAllActivePermanents(filter, game); - Player player = game.getPlayer(source.getTargets().getFirstTarget()); - if ( player != null && dragons != null && !dragons.isEmpty() ) { - for ( Permanent dragon : dragons ) { - player.damage(dragon.getPower().getValue(), dragon.getId(), game, true, false); - } - return true; - } + @Override + public boolean apply(Game game, Ability source) { + List dragons = game.getBattlefield().getAllActivePermanents(filter, game); + Player player = game.getPlayer(source.getTargets().getFirstTarget()); + if ( player != null && dragons != null && !dragons.isEmpty() ) { + for ( Permanent dragon : dragons ) { + player.damage(dragon.getPower().getValue(), dragon.getId(), game, true, false); + } + return true; + } - return false; - } + return false; + } - @Override - public SarkhanTheMadDragonDamageEffect copy() { - return new SarkhanTheMadDragonDamageEffect(this); - } + @Override + public SarkhanTheMadDragonDamageEffect copy() { + return new SarkhanTheMadDragonDamageEffect(this); + } } class DragonToken extends mage.game.permanent.token.DragonToken { - DragonToken ( ) { - super(); - this.power = new MageInt(5); - this.toughness = new MageInt(5); - } + DragonToken ( ) { + super(); + this.power = new MageInt(5); + this.toughness = new MageInt(5); + } } diff --git a/Mage.Sets/src/mage/sets/riseoftheeldrazi/SeaGateOracle.java b/Mage.Sets/src/mage/sets/riseoftheeldrazi/SeaGateOracle.java index c88ce63320..e438d6c3d2 100644 --- a/Mage.Sets/src/mage/sets/riseoftheeldrazi/SeaGateOracle.java +++ b/Mage.Sets/src/mage/sets/riseoftheeldrazi/SeaGateOracle.java @@ -52,78 +52,78 @@ import mage.target.TargetCard; */ public class SeaGateOracle extends CardImpl { - public SeaGateOracle(UUID ownerId) { - super(ownerId, 85, "Sea Gate Oracle", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{2}{U}"); - this.expansionSetCode = "ROE"; - this.color.setBlue(true); - this.subtype.add("Human"); - this.subtype.add("Wizard"); - this.power = new MageInt(1); - this.toughness = new MageInt(3); - this.addAbility(new EntersBattlefieldTriggeredAbility(new SeaGateOracleEffect(), false)); - } + public SeaGateOracle(UUID ownerId) { + super(ownerId, 85, "Sea Gate Oracle", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{2}{U}"); + this.expansionSetCode = "ROE"; + this.color.setBlue(true); + this.subtype.add("Human"); + this.subtype.add("Wizard"); + this.power = new MageInt(1); + this.toughness = new MageInt(3); + this.addAbility(new EntersBattlefieldTriggeredAbility(new SeaGateOracleEffect(), false)); + } - public SeaGateOracle(final SeaGateOracle card) { - super(card); - } + public SeaGateOracle(final SeaGateOracle card) { + super(card); + } - @Override - public SeaGateOracle copy() { - return new SeaGateOracle(this); - } + @Override + public SeaGateOracle copy() { + return new SeaGateOracle(this); + } } class SeaGateOracleEffect extends OneShotEffect { - private static FilterCard filter = new FilterCard("card to put in hand"); + private static FilterCard filter = new FilterCard("card to put in hand"); - public SeaGateOracleEffect() { - super(Outcome.DrawCard); - staticText = "look at the top two cards of your library. Put one of them into your hand and the other on the bottom of your library"; - } + public SeaGateOracleEffect() { + super(Outcome.DrawCard); + staticText = "look at the top two cards of your library. Put one of them into your hand and the other on the bottom of your library"; + } - public SeaGateOracleEffect(SeaGateOracleEffect effect) { - super(effect); - } + public SeaGateOracleEffect(SeaGateOracleEffect effect) { + super(effect); + } - @Override - public boolean apply(Game game, Ability source) { - Player player = game.getPlayer(source.getControllerId()); - if (player.getLibrary().size() > 0) { - if (player.getLibrary().size() == 1) { - Card card = player.getLibrary().removeFromTop(game); - card.moveToZone(Zone.HAND, source.getId(), game, false); - } - else { - Cards cards = new CardsImpl(Zone.PICK); - Card card = player.getLibrary().removeFromTop(game); - cards.add(card); - game.setZone(card.getId(), Zone.PICK); - card = player.getLibrary().removeFromTop(game); - cards.add(card); - game.setZone(card.getId(), Zone.PICK); - TargetCard target = new TargetCard(Zone.PICK, filter); - target.setRequired(true); - player.lookAtCards("Sea Gate Oracle", cards, game); - player.choose(Outcome.Benefit, cards, target, game); - card = cards.get(target.getFirstTarget(), game); - if (card != null) { - card.moveToZone(Zone.HAND, source.getId(), game, false); - cards.remove(card); - } - for (Card card1: cards.getCards(game)) { - card1.moveToZone(Zone.LIBRARY, source.getId(), game, false); - } - } - return true; - } - return false; - } + @Override + public boolean apply(Game game, Ability source) { + Player player = game.getPlayer(source.getControllerId()); + if (player.getLibrary().size() > 0) { + if (player.getLibrary().size() == 1) { + Card card = player.getLibrary().removeFromTop(game); + card.moveToZone(Zone.HAND, source.getId(), game, false); + } + else { + Cards cards = new CardsImpl(Zone.PICK); + Card card = player.getLibrary().removeFromTop(game); + cards.add(card); + game.setZone(card.getId(), Zone.PICK); + card = player.getLibrary().removeFromTop(game); + cards.add(card); + game.setZone(card.getId(), Zone.PICK); + TargetCard target = new TargetCard(Zone.PICK, filter); + target.setRequired(true); + player.lookAtCards("Sea Gate Oracle", cards, game); + player.choose(Outcome.Benefit, cards, target, game); + card = cards.get(target.getFirstTarget(), game); + if (card != null) { + card.moveToZone(Zone.HAND, source.getId(), game, false); + cards.remove(card); + } + for (Card card1: cards.getCards(game)) { + card1.moveToZone(Zone.LIBRARY, source.getId(), game, false); + } + } + return true; + } + return false; + } - @Override - public SeaGateOracleEffect copy() { - return new SeaGateOracleEffect(this); - } + @Override + public SeaGateOracleEffect copy() { + return new SeaGateOracleEffect(this); + } } \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/riseoftheeldrazi/SeeBeyond.java b/Mage.Sets/src/mage/sets/riseoftheeldrazi/SeeBeyond.java index 03a2857eff..683834ed65 100644 --- a/Mage.Sets/src/mage/sets/riseoftheeldrazi/SeeBeyond.java +++ b/Mage.Sets/src/mage/sets/riseoftheeldrazi/SeeBeyond.java @@ -48,59 +48,59 @@ import mage.target.TargetCard; */ public class SeeBeyond extends CardImpl { - public SeeBeyond(UUID ownerId) { - super(ownerId, 86, "See Beyond", Rarity.COMMON, new CardType[]{CardType.SORCERY}, "{1}{U}"); - this.expansionSetCode = "ROE"; - this.color.setBlue(true); - this.getSpellAbility().addEffect(new SeeBeyondEffect()); - } + public SeeBeyond(UUID ownerId) { + super(ownerId, 86, "See Beyond", Rarity.COMMON, new CardType[]{CardType.SORCERY}, "{1}{U}"); + this.expansionSetCode = "ROE"; + this.color.setBlue(true); + this.getSpellAbility().addEffect(new SeeBeyondEffect()); + } - public SeeBeyond(final SeeBeyond card) { - super(card); - } + public SeeBeyond(final SeeBeyond card) { + super(card); + } - @Override - public SeeBeyond copy() { - return new SeeBeyond(this); - } + @Override + public SeeBeyond copy() { + return new SeeBeyond(this); + } } class SeeBeyondEffect extends OneShotEffect { - private static FilterCard filter = new FilterCard("card to shuffle into your library"); + private static FilterCard filter = new FilterCard("card to shuffle into your library"); - public SeeBeyondEffect() { - super(Outcome.DrawCard); - staticText = "Draw two cards, then shuffle a card from your hand into your library"; - } + public SeeBeyondEffect() { + super(Outcome.DrawCard); + staticText = "Draw two cards, then shuffle a card from your hand into your library"; + } - public SeeBeyondEffect(SeeBeyondEffect effect) { - super(effect); - } + public SeeBeyondEffect(SeeBeyondEffect effect) { + super(effect); + } - @Override - public boolean apply(Game game, Ability source) { - Player player = game.getPlayer(source.getControllerId()); - player.drawCards(2, game); - if (player.getHand().size() > 0) { - TargetCard target = new TargetCard(Zone.HAND, filter); - target.setRequired(true); - player.choose(Outcome.Detriment, player.getHand(), target, game); - Card card = player.getHand().get(target.getFirstTarget(), game); - if (card != null) { - player.removeFromHand(card, game); - card.moveToZone(Zone.LIBRARY, source.getId(), game, true); - player.shuffleLibrary(game); - return true; - } - } - return true; - } + @Override + public boolean apply(Game game, Ability source) { + Player player = game.getPlayer(source.getControllerId()); + player.drawCards(2, game); + if (player.getHand().size() > 0) { + TargetCard target = new TargetCard(Zone.HAND, filter); + target.setRequired(true); + player.choose(Outcome.Detriment, player.getHand(), target, game); + Card card = player.getHand().get(target.getFirstTarget(), game); + if (card != null) { + player.removeFromHand(card, game); + card.moveToZone(Zone.LIBRARY, source.getId(), game, true); + player.shuffleLibrary(game); + return true; + } + } + return true; + } - @Override - public SeeBeyondEffect copy() { - return new SeeBeyondEffect(this); - } + @Override + public SeeBeyondEffect copy() { + return new SeeBeyondEffect(this); + } } \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/riseoftheeldrazi/SphinxOfMagosi.java b/Mage.Sets/src/mage/sets/riseoftheeldrazi/SphinxOfMagosi.java index ecb956e304..b0d2a1f643 100644 --- a/Mage.Sets/src/mage/sets/riseoftheeldrazi/SphinxOfMagosi.java +++ b/Mage.Sets/src/mage/sets/riseoftheeldrazi/SphinxOfMagosi.java @@ -53,13 +53,13 @@ public class SphinxOfMagosi extends CardImpl { super(ownerId, 89, "Sphinx of Magosi", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{3}{U}{U}{U}"); this.expansionSetCode = "ROE"; this.subtype.add("Sphinx"); - this.color.setBlue(true); + this.color.setBlue(true); this.power = new MageInt(6); this.toughness = new MageInt(6); - this.addAbility(FlyingAbility.getInstance()); - Ability ability = new SimpleActivatedAbility(Constants.Zone.BATTLEFIELD, new DrawCardControllerEffect(1), new ManaCostsImpl("{2}{U}")); - ability.addEffect(new AddCountersSourceEffect(CounterType.P1P1.createInstance())); - this.addAbility(ability); + this.addAbility(FlyingAbility.getInstance()); + Ability ability = new SimpleActivatedAbility(Constants.Zone.BATTLEFIELD, new DrawCardControllerEffect(1), new ManaCostsImpl("{2}{U}")); + ability.addEffect(new AddCountersSourceEffect(CounterType.P1P1.createInstance())); + this.addAbility(ability); } public SphinxOfMagosi (final SphinxOfMagosi card) { diff --git a/Mage.Sets/src/mage/sets/riseoftheeldrazi/SpiderUmbra.java b/Mage.Sets/src/mage/sets/riseoftheeldrazi/SpiderUmbra.java index b4c711d092..b814b64ebf 100644 --- a/Mage.Sets/src/mage/sets/riseoftheeldrazi/SpiderUmbra.java +++ b/Mage.Sets/src/mage/sets/riseoftheeldrazi/SpiderUmbra.java @@ -59,9 +59,9 @@ public class SpiderUmbra extends CardImpl { // Enchant creature TargetPermanent auraTarget = new TargetCreaturePermanent(); - this.getSpellAbility().addTarget(auraTarget); - this.getSpellAbility().addEffect(new AttachEffect(Constants.Outcome.BoostCreature)); - Ability ability = new EnchantAbility(auraTarget.getTargetName()); + this.getSpellAbility().addTarget(auraTarget); + this.getSpellAbility().addEffect(new AttachEffect(Constants.Outcome.BoostCreature)); + Ability ability = new EnchantAbility(auraTarget.getTargetName()); this.addAbility(ability); // Enchanted creature gets +1/+1 and has reach. this.addAbility(new SimpleStaticAbility(Constants.Zone.BATTLEFIELD, new BoostEnchantedEffect(1, 1, Constants.Duration.WhileOnBattlefield))); diff --git a/Mage.Sets/src/mage/sets/riseoftheeldrazi/Staggershock.java b/Mage.Sets/src/mage/sets/riseoftheeldrazi/Staggershock.java index 9ccd285d82..14c07d7e7c 100644 --- a/Mage.Sets/src/mage/sets/riseoftheeldrazi/Staggershock.java +++ b/Mage.Sets/src/mage/sets/riseoftheeldrazi/Staggershock.java @@ -41,22 +41,22 @@ import mage.target.common.TargetCreatureOrPlayer; */ public class Staggershock extends CardImpl { - public Staggershock(UUID ownerId) { - super(ownerId, 166, "Staggershock", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{2}{R}"); - this.expansionSetCode = "ROE"; + public Staggershock(UUID ownerId) { + super(ownerId, 166, "Staggershock", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{2}{R}"); + this.expansionSetCode = "ROE"; - this.color.setRed(true); - this.getSpellAbility().addTarget(new TargetCreatureOrPlayer()); - this.getSpellAbility().addEffect(new DamageTargetEffect(2)); - this.addAbility(new ReboundAbility()); - } + this.color.setRed(true); + this.getSpellAbility().addTarget(new TargetCreatureOrPlayer()); + this.getSpellAbility().addEffect(new DamageTargetEffect(2)); + this.addAbility(new ReboundAbility()); + } - public Staggershock(final Staggershock card) { - super(card); - } + public Staggershock(final Staggershock card) { + super(card); + } - @Override - public Staggershock copy() { - return new Staggershock(this); - } + @Override + public Staggershock copy() { + return new Staggershock(this); + } } diff --git a/Mage.Sets/src/mage/sets/riseoftheeldrazi/StalwartShieldBearers.java b/Mage.Sets/src/mage/sets/riseoftheeldrazi/StalwartShieldBearers.java index cbfb94ec47..4f0e9fbd5e 100644 --- a/Mage.Sets/src/mage/sets/riseoftheeldrazi/StalwartShieldBearers.java +++ b/Mage.Sets/src/mage/sets/riseoftheeldrazi/StalwartShieldBearers.java @@ -50,7 +50,7 @@ public class StalwartShieldBearers extends CardImpl { static { filter.getAbilities().add(DefenderAbility.getInstance()); } - + public StalwartShieldBearers(UUID ownerId) { super(ownerId, 46, "Stalwart Shield-Bearers", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{1}{W}"); this.expansionSetCode = "ROE"; @@ -60,7 +60,7 @@ public class StalwartShieldBearers extends CardImpl { this.color.setWhite(true); this.power = new MageInt(0); this.toughness = new MageInt(3); - + this.addAbility(DefenderAbility.getInstance()); this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostControlledEffect(0, 2, Duration.WhileOnBattlefield, filter, true))); } diff --git a/Mage.Sets/src/mage/sets/riseoftheeldrazi/StomperCub.java b/Mage.Sets/src/mage/sets/riseoftheeldrazi/StomperCub.java index 2512a39a9d..afbddc2dd5 100644 --- a/Mage.Sets/src/mage/sets/riseoftheeldrazi/StomperCub.java +++ b/Mage.Sets/src/mage/sets/riseoftheeldrazi/StomperCub.java @@ -45,7 +45,7 @@ public class StomperCub extends CardImpl { super(ownerId, 210, "Stomper Cub", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{3}{G}{G}"); this.expansionSetCode = "ROE"; this.subtype.add("Beast"); - this.color.setGreen(true); + this.color.setGreen(true); this.power = new MageInt(5); this.toughness = new MageInt(3); this.addAbility(TrampleAbility.getInstance()); diff --git a/Mage.Sets/src/mage/sets/riseoftheeldrazi/SurrakarSpellblade.java b/Mage.Sets/src/mage/sets/riseoftheeldrazi/SurrakarSpellblade.java index 505d0d031f..63b13c6ddb 100644 --- a/Mage.Sets/src/mage/sets/riseoftheeldrazi/SurrakarSpellblade.java +++ b/Mage.Sets/src/mage/sets/riseoftheeldrazi/SurrakarSpellblade.java @@ -46,7 +46,7 @@ import mage.abilities.dynamicvalue.common.CountersCount; * @author jeffwadsworth */ public class SurrakarSpellblade extends CardImpl { - + private static final FilterSpell filter = new FilterSpell("instant or sorcery card"); static { @@ -66,7 +66,7 @@ public class SurrakarSpellblade extends CardImpl { // Whenever you cast an instant or sorcery spell, you may put a charge counter on Surrakar Spellblade. this.addAbility(new SpellCastTriggeredAbility(new AddCountersSourceEffect(CounterType.CHARGE.createInstance()), filter, true)); - + // Whenever Surrakar Spellblade deals combat damage to a player, you may draw X cards, where X is the number of charge counters on it. this.addAbility(new DealsCombatDamageToAPlayerTriggeredAbility(new DrawCardControllerEffect(new CountersCount(CounterType.CHARGE)), true)); } diff --git a/Mage.Sets/src/mage/sets/riseoftheeldrazi/Swamp1.java b/Mage.Sets/src/mage/sets/riseoftheeldrazi/Swamp1.java index 176dc0544f..54380add12 100644 --- a/Mage.Sets/src/mage/sets/riseoftheeldrazi/Swamp1.java +++ b/Mage.Sets/src/mage/sets/riseoftheeldrazi/Swamp1.java @@ -36,18 +36,18 @@ import java.util.UUID; */ public class Swamp1 extends mage.cards.basiclands.Swamp { - public Swamp1(UUID ownerId) { - super(ownerId, 237); - this.expansionSetCode = "ROE"; - } + public Swamp1(UUID ownerId) { + super(ownerId, 237); + this.expansionSetCode = "ROE"; + } - public Swamp1(final Swamp1 card) { - super(card); - } + public Swamp1(final Swamp1 card) { + super(card); + } - @Override - public Swamp1 copy() { - return new Swamp1(this); - } + @Override + public Swamp1 copy() { + return new Swamp1(this); + } } \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/riseoftheeldrazi/Swamp2.java b/Mage.Sets/src/mage/sets/riseoftheeldrazi/Swamp2.java index 552609eab1..3099a6d471 100644 --- a/Mage.Sets/src/mage/sets/riseoftheeldrazi/Swamp2.java +++ b/Mage.Sets/src/mage/sets/riseoftheeldrazi/Swamp2.java @@ -36,18 +36,18 @@ import java.util.UUID; */ public class Swamp2 extends mage.cards.basiclands.Swamp { - public Swamp2(UUID ownerId) { - super(ownerId, 238); - this.expansionSetCode = "ROE"; - } + public Swamp2(UUID ownerId) { + super(ownerId, 238); + this.expansionSetCode = "ROE"; + } - public Swamp2(final Swamp2 card) { - super(card); - } + public Swamp2(final Swamp2 card) { + super(card); + } - @Override - public Swamp2 copy() { - return new Swamp2(this); - } + @Override + public Swamp2 copy() { + return new Swamp2(this); + } } \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/riseoftheeldrazi/Swamp3.java b/Mage.Sets/src/mage/sets/riseoftheeldrazi/Swamp3.java index 80e17d2597..d3bba21e0a 100644 --- a/Mage.Sets/src/mage/sets/riseoftheeldrazi/Swamp3.java +++ b/Mage.Sets/src/mage/sets/riseoftheeldrazi/Swamp3.java @@ -36,18 +36,18 @@ import java.util.UUID; */ public class Swamp3 extends mage.cards.basiclands.Swamp { - public Swamp3(UUID ownerId) { - super(ownerId, 239); - this.expansionSetCode = "ROE"; - } + public Swamp3(UUID ownerId) { + super(ownerId, 239); + this.expansionSetCode = "ROE"; + } - public Swamp3(final Swamp3 card) { - super(card); - } + public Swamp3(final Swamp3 card) { + super(card); + } - @Override - public Swamp3 copy() { - return new Swamp3(this); - } + @Override + public Swamp3 copy() { + return new Swamp3(this); + } } \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/riseoftheeldrazi/Swamp4.java b/Mage.Sets/src/mage/sets/riseoftheeldrazi/Swamp4.java index 359cdd5a54..f4c5df66f2 100644 --- a/Mage.Sets/src/mage/sets/riseoftheeldrazi/Swamp4.java +++ b/Mage.Sets/src/mage/sets/riseoftheeldrazi/Swamp4.java @@ -36,18 +36,18 @@ import java.util.UUID; */ public class Swamp4 extends mage.cards.basiclands.Swamp { - public Swamp4(UUID ownerId) { - super(ownerId, 240); - this.expansionSetCode = "ROE"; - } + public Swamp4(UUID ownerId) { + super(ownerId, 240); + this.expansionSetCode = "ROE"; + } - public Swamp4(final Swamp4 card) { - super(card); - } + public Swamp4(final Swamp4 card) { + super(card); + } - @Override - public Swamp4 copy() { - return new Swamp4(this); - } + @Override + public Swamp4 copy() { + return new Swamp4(this); + } } \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/riseoftheeldrazi/ThoughtGorger.java b/Mage.Sets/src/mage/sets/riseoftheeldrazi/ThoughtGorger.java index a0166e9ca5..09d03aa796 100644 --- a/Mage.Sets/src/mage/sets/riseoftheeldrazi/ThoughtGorger.java +++ b/Mage.Sets/src/mage/sets/riseoftheeldrazi/ThoughtGorger.java @@ -60,11 +60,11 @@ public class ThoughtGorger extends CardImpl { this.toughness = new MageInt(2); this.addAbility(TrampleAbility.getInstance()); - + // When Thought Gorger enters the battlefield, put a +1/+1 counter on it for each card in your hand. If you do, discard your hand. Ability ability1 = new EntersBattlefieldTriggeredAbility(new ThoughtGorgerEffectEnters()); this.addAbility(ability1); - + // When Thought Gorger leaves the battlefield, draw a card for each +1/+1 counter on it. Ability ability2 = new LeavesBattlefieldTriggeredAbility(new ThoughtGorgerEffectLeaves(), false); this.addAbility(ability2); @@ -78,7 +78,7 @@ public class ThoughtGorger extends CardImpl { public ThoughtGorger copy() { return new ThoughtGorger(this); } - + } class ThoughtGorgerEffectEnters extends OneShotEffect { @@ -112,21 +112,21 @@ class ThoughtGorgerEffectEnters extends OneShotEffect } class ThoughtGorgerEffectLeaves extends OneShotEffect { - + public ThoughtGorgerEffectLeaves() { super(Outcome.Neutral); this.staticText = "draw a card for each +1/+1 counter on it."; } - + public ThoughtGorgerEffectLeaves(final ThoughtGorgerEffectLeaves effect) { super(effect); } - + @Override public ThoughtGorgerEffectLeaves copy() { return new ThoughtGorgerEffectLeaves(this); } - + @Override public boolean apply(Game game, Ability source) { Player player = game.getPlayer(source.getControllerId()); diff --git a/Mage.Sets/src/mage/sets/riseoftheeldrazi/TrainingGrounds.java b/Mage.Sets/src/mage/sets/riseoftheeldrazi/TrainingGrounds.java index 8f71e1445b..4c6d233fd7 100644 --- a/Mage.Sets/src/mage/sets/riseoftheeldrazi/TrainingGrounds.java +++ b/Mage.Sets/src/mage/sets/riseoftheeldrazi/TrainingGrounds.java @@ -57,8 +57,8 @@ public class TrainingGrounds extends CardImpl { public TrainingGrounds (UUID ownerId) { super(ownerId, 91, "Training Grounds", Rarity.RARE, new CardType[]{CardType.ENCHANTMENT}, "{U}"); this.expansionSetCode = "ROE"; - - this.color.setBlue(true); + + this.color.setBlue(true); this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new TrainingGroundsCostReductionEffect())); } @@ -74,59 +74,59 @@ public class TrainingGrounds extends CardImpl { class TrainingGroundsCostReductionEffect extends ContinuousEffectImpl { - private static final String effectText = "Activated abilities of creatures you control cost up to {2} less to activate. This effect can't reduce the amount of mana an ability costs to activate to less than one mana"; - private static final FilterControlledCreaturePermanent filter; + private static final String effectText = "Activated abilities of creatures you control cost up to {2} less to activate. This effect can't reduce the amount of mana an ability costs to activate to less than one mana"; + private static final FilterControlledCreaturePermanent filter; - static { - filter = new FilterControlledCreaturePermanent(); - } + static { + filter = new FilterControlledCreaturePermanent(); + } - TrainingGroundsCostReductionEffect ( ) { - super(Duration.WhileOnBattlefield, Layer.TextChangingEffects_3, SubLayer.NA, Outcome.Benefit); - staticText = effectText; - } + TrainingGroundsCostReductionEffect ( ) { + super(Duration.WhileOnBattlefield, Layer.TextChangingEffects_3, SubLayer.NA, Outcome.Benefit); + staticText = effectText; + } - TrainingGroundsCostReductionEffect ( TrainingGroundsCostReductionEffect effect ) { - super(effect); - } + TrainingGroundsCostReductionEffect ( TrainingGroundsCostReductionEffect effect ) { + super(effect); + } - @Override - public boolean apply(Game game, Ability source) { - boolean applied = false; - List permanents = game.getBattlefield().getActivePermanents(filter, source.getControllerId(), source.getSourceId(), game); + @Override + public boolean apply(Game game, Ability source) { + boolean applied = false; + List permanents = game.getBattlefield().getActivePermanents(filter, source.getControllerId(), source.getSourceId(), game); - if ( permanents != null && !permanents.isEmpty() ) { - for ( Permanent permanent : permanents ) { - for ( Ability ability : permanent.getAbilities() ) { - if ( !(ability instanceof SpellAbility) && ability.getManaCosts() != null ) { - int costCount = ability.getManaCosts().size(); - for ( Cost cost : ability.getManaCosts() ) { - if ( cost instanceof GenericManaCost ) { - GenericManaCost costCasted = (GenericManaCost)cost; - int amount = costCasted.convertedManaCost(); - int adjustedAmount = 0; - if ( costCount == 1 && (amount - 2) <= 0 ) { - adjustedAmount = 1; - } - else { - //In case the adjusted amount goes below 0. - adjustedAmount = Math.max(0, amount - 2); - } - costCasted.setMana(adjustedAmount); - applied = true; - } - } - } - } - } - } - - return applied; - } + if ( permanents != null && !permanents.isEmpty() ) { + for ( Permanent permanent : permanents ) { + for ( Ability ability : permanent.getAbilities() ) { + if ( !(ability instanceof SpellAbility) && ability.getManaCosts() != null ) { + int costCount = ability.getManaCosts().size(); + for ( Cost cost : ability.getManaCosts() ) { + if ( cost instanceof GenericManaCost ) { + GenericManaCost costCasted = (GenericManaCost)cost; + int amount = costCasted.convertedManaCost(); + int adjustedAmount = 0; + if ( costCount == 1 && (amount - 2) <= 0 ) { + adjustedAmount = 1; + } + else { + //In case the adjusted amount goes below 0. + adjustedAmount = Math.max(0, amount - 2); + } + costCasted.setMana(adjustedAmount); + applied = true; + } + } + } + } + } + } - @Override - public TrainingGroundsCostReductionEffect copy() { - return new TrainingGroundsCostReductionEffect(this); - } + return applied; + } + + @Override + public TrainingGroundsCostReductionEffect copy() { + return new TrainingGroundsCostReductionEffect(this); + } } diff --git a/Mage.Sets/src/mage/sets/riseoftheeldrazi/TuktukTheExplorer.java b/Mage.Sets/src/mage/sets/riseoftheeldrazi/TuktukTheExplorer.java index d8ab18ad7b..94ecac7580 100644 --- a/Mage.Sets/src/mage/sets/riseoftheeldrazi/TuktukTheExplorer.java +++ b/Mage.Sets/src/mage/sets/riseoftheeldrazi/TuktukTheExplorer.java @@ -49,11 +49,11 @@ public class TuktukTheExplorer extends CardImpl { this.expansionSetCode = "ROE"; this.supertype.add("Legendary"); this.subtype.add("Goblin"); - this.color.setRed(true); + this.color.setRed(true); this.power = new MageInt(1); this.toughness = new MageInt(1); - this.addAbility(HasteAbility.getInstance()); - this.addAbility(new DiesTriggeredAbility(new CreateTokenEffect(new TuktukTheReturnedToken()))); + this.addAbility(HasteAbility.getInstance()); + this.addAbility(new DiesTriggeredAbility(new CreateTokenEffect(new TuktukTheReturnedToken()))); } public TuktukTheExplorer (final TuktukTheExplorer card) { @@ -68,13 +68,13 @@ public class TuktukTheExplorer extends CardImpl { } class TuktukTheReturnedToken extends Token { - TuktukTheReturnedToken() { - super("Tuktuk the Returned", "a legendary 5/5 colorless Goblin Golem artifact creature token"); - cardType.add(CardType.ARTIFACT); - cardType.add(CardType.CREATURE); - supertype.add("Legendary"); - subtype.add("Goblin"); - power = new MageInt(5); - toughness = new MageInt(5); - } + TuktukTheReturnedToken() { + super("Tuktuk the Returned", "a legendary 5/5 colorless Goblin Golem artifact creature token"); + cardType.add(CardType.ARTIFACT); + cardType.add(CardType.CREATURE); + supertype.add("Legendary"); + subtype.add("Goblin"); + power = new MageInt(5); + toughness = new MageInt(5); + } } \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/riseoftheeldrazi/UlamogTheInfiniteGyre.java b/Mage.Sets/src/mage/sets/riseoftheeldrazi/UlamogTheInfiniteGyre.java index b2c50c1d49..557d787293 100644 --- a/Mage.Sets/src/mage/sets/riseoftheeldrazi/UlamogTheInfiniteGyre.java +++ b/Mage.Sets/src/mage/sets/riseoftheeldrazi/UlamogTheInfiniteGyre.java @@ -54,92 +54,92 @@ import mage.target.TargetPermanent; */ public class UlamogTheInfiniteGyre extends CardImpl { - private static final String effectText = "When Ulamog is put into a graveyard from anywhere, its owner shuffles his or her graveyard into his or her library"; + private static final String effectText = "When Ulamog is put into a graveyard from anywhere, its owner shuffles his or her graveyard into his or her library"; - public UlamogTheInfiniteGyre(UUID ownerId) { - super(ownerId, 12, "Ulamog, the Infinite Gyre", Rarity.MYTHIC, new CardType[]{CardType.CREATURE}, "{11}"); - this.expansionSetCode = "ROE"; - this.supertype.add("Legendary"); - this.subtype.add("Eldrazi"); + public UlamogTheInfiniteGyre(UUID ownerId) { + super(ownerId, 12, "Ulamog, the Infinite Gyre", Rarity.MYTHIC, new CardType[]{CardType.CREATURE}, "{11}"); + this.expansionSetCode = "ROE"; + this.supertype.add("Legendary"); + this.subtype.add("Eldrazi"); - this.power = new MageInt(10); - this.toughness = new MageInt(10); + this.power = new MageInt(10); + this.toughness = new MageInt(10); - this.addAbility(new UlamogTheInfiniteGyreDestroyOnCastAbility()); - this.addAbility(new AnnihilatorAbility(4)); - this.addAbility(IndestructibleAbility.getInstance()); - this.addAbility(new ZoneChangeTriggeredAbility(Zone.GRAVEYARD, new UlamogTheInfiniteGyreEnterGraveyardEffect(), effectText, false)); - } + this.addAbility(new UlamogTheInfiniteGyreDestroyOnCastAbility()); + this.addAbility(new AnnihilatorAbility(4)); + this.addAbility(IndestructibleAbility.getInstance()); + this.addAbility(new ZoneChangeTriggeredAbility(Zone.GRAVEYARD, new UlamogTheInfiniteGyreEnterGraveyardEffect(), effectText, false)); + } - public UlamogTheInfiniteGyre(final UlamogTheInfiniteGyre card) { - super(card); - } + public UlamogTheInfiniteGyre(final UlamogTheInfiniteGyre card) { + super(card); + } - @Override - public UlamogTheInfiniteGyre copy() { - return new UlamogTheInfiniteGyre(this); - } + @Override + public UlamogTheInfiniteGyre copy() { + return new UlamogTheInfiniteGyre(this); + } } class UlamogTheInfiniteGyreDestroyOnCastAbility extends TriggeredAbilityImpl { - private static final String abilityText = "When you cast {this}, destroy target permanent"; + private static final String abilityText = "When you cast {this}, destroy target permanent"; - UlamogTheInfiniteGyreDestroyOnCastAbility ( ) { - super(Zone.STACK, new DestroyTargetEffect()); - this.addTarget(new TargetPermanent()); - } + UlamogTheInfiniteGyreDestroyOnCastAbility ( ) { + super(Zone.STACK, new DestroyTargetEffect()); + this.addTarget(new TargetPermanent()); + } - UlamogTheInfiniteGyreDestroyOnCastAbility(UlamogTheInfiniteGyreDestroyOnCastAbility ability) { - super(ability); - } + UlamogTheInfiniteGyreDestroyOnCastAbility(UlamogTheInfiniteGyreDestroyOnCastAbility ability) { + super(ability); + } - @Override - public boolean checkTrigger(GameEvent event, Game game) { - if ( event.getType() == EventType.SPELL_CAST ) { - Spell spell = (Spell)game.getObject(event.getTargetId()); - if ( this.getSourceId().equals(spell.getSourceId())) { - return true; - } - } - return false; - } + @Override + public boolean checkTrigger(GameEvent event, Game game) { + if ( event.getType() == EventType.SPELL_CAST ) { + Spell spell = (Spell)game.getObject(event.getTargetId()); + if ( this.getSourceId().equals(spell.getSourceId())) { + return true; + } + } + return false; + } - @Override - public UlamogTheInfiniteGyreDestroyOnCastAbility copy() { - return new UlamogTheInfiniteGyreDestroyOnCastAbility(this); - } + @Override + public UlamogTheInfiniteGyreDestroyOnCastAbility copy() { + return new UlamogTheInfiniteGyreDestroyOnCastAbility(this); + } - @Override - public String getRule() { - return abilityText; - } + @Override + public String getRule() { + return abilityText; + } } class UlamogTheInfiniteGyreEnterGraveyardEffect extends OneShotEffect { - UlamogTheInfiniteGyreEnterGraveyardEffect ( ) { - super(Outcome.Benefit); - } + UlamogTheInfiniteGyreEnterGraveyardEffect ( ) { + super(Outcome.Benefit); + } - UlamogTheInfiniteGyreEnterGraveyardEffect(UlamogTheInfiniteGyreEnterGraveyardEffect effect) { - super(effect); - } + UlamogTheInfiniteGyreEnterGraveyardEffect(UlamogTheInfiniteGyreEnterGraveyardEffect effect) { + super(effect); + } - @Override - public boolean apply(Game game, Ability source) { - Player player = game.getPlayer(source.getControllerId()); - if (player != null) { - player.getLibrary().addAll(player.getGraveyard().getCards(game), game); - player.getGraveyard().clear(); - player.shuffleLibrary(game); - return true; - } - return false; - } + @Override + public boolean apply(Game game, Ability source) { + Player player = game.getPlayer(source.getControllerId()); + if (player != null) { + player.getLibrary().addAll(player.getGraveyard().getCards(game), game); + player.getGraveyard().clear(); + player.shuffleLibrary(game); + return true; + } + return false; + } - @Override - public UlamogTheInfiniteGyreEnterGraveyardEffect copy() { - return new UlamogTheInfiniteGyreEnterGraveyardEffect(this); - } + @Override + public UlamogTheInfiniteGyreEnterGraveyardEffect copy() { + return new UlamogTheInfiniteGyreEnterGraveyardEffect(this); + } } diff --git a/Mage.Sets/src/mage/sets/riseoftheeldrazi/UnifiedWill.java b/Mage.Sets/src/mage/sets/riseoftheeldrazi/UnifiedWill.java index 99c51aa41f..a48004cad1 100644 --- a/Mage.Sets/src/mage/sets/riseoftheeldrazi/UnifiedWill.java +++ b/Mage.Sets/src/mage/sets/riseoftheeldrazi/UnifiedWill.java @@ -46,51 +46,51 @@ import java.util.UUID; */ public class UnifiedWill extends CardImpl { - public UnifiedWill(UUID ownerId) { - super(ownerId, 92, "Unified Will", Rarity.UNCOMMON, new CardType[]{CardType.INSTANT}, "{1}{U}"); - this.expansionSetCode = "ROE"; - this.color.setBlue(true); - this.getSpellAbility().addTarget(new TargetSpell()); - this.getSpellAbility().addEffect(new UnifiedWillEffect()); - } + public UnifiedWill(UUID ownerId) { + super(ownerId, 92, "Unified Will", Rarity.UNCOMMON, new CardType[]{CardType.INSTANT}, "{1}{U}"); + this.expansionSetCode = "ROE"; + this.color.setBlue(true); + this.getSpellAbility().addTarget(new TargetSpell()); + this.getSpellAbility().addEffect(new UnifiedWillEffect()); + } - public UnifiedWill(final UnifiedWill card) { - super(card); - } + public UnifiedWill(final UnifiedWill card) { + super(card); + } - @Override - public UnifiedWill copy() { - return new UnifiedWill(this); - } + @Override + public UnifiedWill copy() { + return new UnifiedWill(this); + } } class UnifiedWillEffect extends CounterTargetEffect { - private static FilterCreaturePermanent filter = new FilterCreaturePermanent(); + private static FilterCreaturePermanent filter = new FilterCreaturePermanent(); - public UnifiedWillEffect() {} + public UnifiedWillEffect() {} - public UnifiedWillEffect(final UnifiedWillEffect effect) { - super(effect); - staticText = "Counter target spell if you control more creatures than that spell's controller"; - } + public UnifiedWillEffect(final UnifiedWillEffect effect) { + super(effect); + staticText = "Counter target spell if you control more creatures than that spell's controller"; + } - @Override - public boolean apply(Game game, Ability source) { - StackObject stackObject = game.getStack().getStackObject(source.getFirstTarget()); - if (stackObject != null) { - if (game.getBattlefield().countAll(filter, source.getControllerId(), game) > game.getBattlefield().countAll(filter, stackObject.getControllerId(), game)) { - return game.getStack().counter(source.getFirstTarget(), source.getSourceId(), game); - } - return true; - } - return false; - } + @Override + public boolean apply(Game game, Ability source) { + StackObject stackObject = game.getStack().getStackObject(source.getFirstTarget()); + if (stackObject != null) { + if (game.getBattlefield().countAll(filter, source.getControllerId(), game) > game.getBattlefield().countAll(filter, stackObject.getControllerId(), game)) { + return game.getStack().counter(source.getFirstTarget(), source.getSourceId(), game); + } + return true; + } + return false; + } - @Override - public UnifiedWillEffect copy() { - return new UnifiedWillEffect(this); - } + @Override + public UnifiedWillEffect copy() { + return new UnifiedWillEffect(this); + } } \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/riseoftheeldrazi/VeneratedTeacher.java b/Mage.Sets/src/mage/sets/riseoftheeldrazi/VeneratedTeacher.java index 9be32ec83e..01f9898c79 100644 --- a/Mage.Sets/src/mage/sets/riseoftheeldrazi/VeneratedTeacher.java +++ b/Mage.Sets/src/mage/sets/riseoftheeldrazi/VeneratedTeacher.java @@ -74,18 +74,18 @@ public class VeneratedTeacher extends CardImpl { } class VeneratedTeacherEffect extends OneShotEffect { - + FilterControlledCreaturePermanent filter = new FilterControlledCreaturePermanent("creatures you control"); - + public VeneratedTeacherEffect() { super(Outcome.BoostCreature); staticText = "put two level counters on each creature you control with level up"; } - + public VeneratedTeacherEffect(final VeneratedTeacherEffect effect) { super(effect); } - + @Override public boolean apply(Game game, Ability source) { List permanents = game.getBattlefield().getAllActivePermanents(filter, source.getControllerId(), game); @@ -101,7 +101,7 @@ class VeneratedTeacherEffect extends OneShotEffect { } return false; } - + @Override public VeneratedTeacherEffect copy() { return new VeneratedTeacherEffect(this); diff --git a/Mage.Sets/src/mage/sets/riseoftheeldrazi/Vengevine.java b/Mage.Sets/src/mage/sets/riseoftheeldrazi/Vengevine.java index 5fb47cdd9e..0baa3c6d8d 100644 --- a/Mage.Sets/src/mage/sets/riseoftheeldrazi/Vengevine.java +++ b/Mage.Sets/src/mage/sets/riseoftheeldrazi/Vengevine.java @@ -51,99 +51,99 @@ import mage.watchers.WatcherImpl; */ public class Vengevine extends CardImpl { - public Vengevine(UUID ownerId) { - super(ownerId, 212, "Vengevine", Rarity.MYTHIC, new CardType[]{CardType.CREATURE}, "{2}{G}{G}"); - this.expansionSetCode = "ROE"; - this.subtype.add("Elemental"); - this.color.setGreen(true); - this.power = new MageInt(4); - this.toughness = new MageInt(3); + public Vengevine(UUID ownerId) { + super(ownerId, 212, "Vengevine", Rarity.MYTHIC, new CardType[]{CardType.CREATURE}, "{2}{G}{G}"); + this.expansionSetCode = "ROE"; + this.subtype.add("Elemental"); + this.color.setGreen(true); + this.power = new MageInt(4); + this.toughness = new MageInt(3); - this.addAbility(HasteAbility.getInstance()); - this.addAbility(new VengevineAbility()); - this.addWatcher(new VengevineWatcher()); - } + this.addAbility(HasteAbility.getInstance()); + this.addAbility(new VengevineAbility()); + this.addWatcher(new VengevineWatcher()); + } - public Vengevine(final Vengevine card) { - super(card); - } + public Vengevine(final Vengevine card) { + super(card); + } - @Override - public Vengevine copy() { - return new Vengevine(this); - } + @Override + public Vengevine copy() { + return new Vengevine(this); + } } class VengevineAbility extends TriggeredAbilityImpl { - public VengevineAbility() { - super(Zone.GRAVEYARD, new ReturnSourceFromGraveyardToBattlefieldEffect(), true); - } + public VengevineAbility() { + super(Zone.GRAVEYARD, new ReturnSourceFromGraveyardToBattlefieldEffect(), true); + } - public VengevineAbility(final VengevineAbility ability) { - super(ability); - } + public VengevineAbility(final VengevineAbility ability) { + super(ability); + } - @Override - public VengevineAbility copy() { - return new VengevineAbility(this); - } + @Override + public VengevineAbility copy() { + return new VengevineAbility(this); + } - @Override - public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == EventType.SPELL_CAST && event.getPlayerId().equals(controllerId)) { + @Override + public boolean checkTrigger(GameEvent event, Game game) { + if (event.getType() == EventType.SPELL_CAST && event.getPlayerId().equals(controllerId)) { Watcher watcher = game.getState().getWatchers().get("CreatureCast", controllerId); if (watcher != null && watcher.conditionMet()) { return true; } - } - return false; - } + } + return false; + } - @Override - public String getRule() { - return "Whenever you cast a spell, if it's the second creature spell you cast this turn, you may return {this} from your graveyard to the battlefield."; - } + @Override + public String getRule() { + return "Whenever you cast a spell, if it's the second creature spell you cast this turn, you may return {this} from your graveyard to the battlefield."; + } } class VengevineWatcher extends WatcherImpl { - int creatureSpellCount = 0; + int creatureSpellCount = 0; - public VengevineWatcher() { - super("CreatureCast", WatcherScope.PLAYER); - } + public VengevineWatcher() { + super("CreatureCast", WatcherScope.PLAYER); + } - public VengevineWatcher(final VengevineWatcher watcher) { - super(watcher); + public VengevineWatcher(final VengevineWatcher watcher) { + super(watcher); this.creatureSpellCount = watcher.creatureSpellCount; - } + } - @Override - public VengevineWatcher copy() { - return new VengevineWatcher(this); - } + @Override + public VengevineWatcher copy() { + return new VengevineWatcher(this); + } - @Override - public void watch(GameEvent event, Game game) { - condition = false; - if (event.getType() == EventType.SPELL_CAST && event.getPlayerId().equals(controllerId)) { - Spell spell = game.getStack().getSpell(event.getTargetId()); - if (spell != null && spell.getCardType().contains(CardType.CREATURE)) { - creatureSpellCount++; - if (creatureSpellCount == 2) - condition = true; - } - } - } + @Override + public void watch(GameEvent event, Game game) { + condition = false; + if (event.getType() == EventType.SPELL_CAST && event.getPlayerId().equals(controllerId)) { + Spell spell = game.getStack().getSpell(event.getTargetId()); + if (spell != null && spell.getCardType().contains(CardType.CREATURE)) { + creatureSpellCount++; + if (creatureSpellCount == 2) + condition = true; + } + } + } - @Override - public void reset() { - super.reset(); - creatureSpellCount = 0; - } + @Override + public void reset() { + super.reset(); + creatureSpellCount = 0; + } } diff --git a/Mage.Sets/src/mage/sets/riseoftheeldrazi/VentSentinel.java b/Mage.Sets/src/mage/sets/riseoftheeldrazi/VentSentinel.java index efcd46bd3c..eda1254c9e 100644 --- a/Mage.Sets/src/mage/sets/riseoftheeldrazi/VentSentinel.java +++ b/Mage.Sets/src/mage/sets/riseoftheeldrazi/VentSentinel.java @@ -60,7 +60,7 @@ public class VentSentinel extends CardImpl { this.color.setRed(true); this.power = new MageInt(2); this.toughness = new MageInt(4); - + this.addAbility(DefenderAbility.getInstance()); SimpleActivatedAbility ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DamageTargetEffect(new PermanentsOnBattlefieldCount(filter)), new ManaCostsImpl("{1}{R}")); ability.addCost(new TapSourceCost()); diff --git a/Mage.Sets/src/mage/sets/riseoftheeldrazi/WallOfOmens.java b/Mage.Sets/src/mage/sets/riseoftheeldrazi/WallOfOmens.java index 0c9237a7cd..d967ebbbcb 100644 --- a/Mage.Sets/src/mage/sets/riseoftheeldrazi/WallOfOmens.java +++ b/Mage.Sets/src/mage/sets/riseoftheeldrazi/WallOfOmens.java @@ -43,25 +43,25 @@ import mage.cards.CardImpl; */ public class WallOfOmens extends CardImpl { - public WallOfOmens(UUID ownerId) { - super(ownerId, 53, "Wall of Omens", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{1}{W}"); - this.expansionSetCode = "ROE"; - this.subtype.add("Wall"); - this.color.setWhite(true); - this.power = new MageInt(0); - this.toughness = new MageInt(4); + public WallOfOmens(UUID ownerId) { + super(ownerId, 53, "Wall of Omens", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{1}{W}"); + this.expansionSetCode = "ROE"; + this.subtype.add("Wall"); + this.color.setWhite(true); + this.power = new MageInt(0); + this.toughness = new MageInt(4); - this.addAbility(DefenderAbility.getInstance()); - this.addAbility(new EntersBattlefieldTriggeredAbility(new DrawCardControllerEffect(1), false)); - } + this.addAbility(DefenderAbility.getInstance()); + this.addAbility(new EntersBattlefieldTriggeredAbility(new DrawCardControllerEffect(1), false)); + } - public WallOfOmens(final WallOfOmens card) { - super(card); - } + public WallOfOmens(final WallOfOmens card) { + super(card); + } - @Override - public WallOfOmens copy() { - return new WallOfOmens(this); - } + @Override + public WallOfOmens copy() { + return new WallOfOmens(this); + } } diff --git a/Mage.Sets/src/mage/sets/saviorsofkamigawa/BriarknitKami.java b/Mage.Sets/src/mage/sets/saviorsofkamigawa/BriarknitKami.java index cfa7bc645a..3289260f14 100644 --- a/Mage.Sets/src/mage/sets/saviorsofkamigawa/BriarknitKami.java +++ b/Mage.Sets/src/mage/sets/saviorsofkamigawa/BriarknitKami.java @@ -46,7 +46,7 @@ import mage.target.common.TargetCreaturePermanent; public class BriarknitKami extends CardImpl { private final static FilterSpiritOrArcaneCard filter = new FilterSpiritOrArcaneCard(); - + public BriarknitKami(UUID ownerId) { super(ownerId, 124, "Briarknit Kami", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{3}{G}{G}"); this.expansionSetCode = "SOK"; diff --git a/Mage.Sets/src/mage/sets/saviorsofkamigawa/FiddleheadKami.java b/Mage.Sets/src/mage/sets/saviorsofkamigawa/FiddleheadKami.java index 6a4da2a460..e1d06489da 100644 --- a/Mage.Sets/src/mage/sets/saviorsofkamigawa/FiddleheadKami.java +++ b/Mage.Sets/src/mage/sets/saviorsofkamigawa/FiddleheadKami.java @@ -43,7 +43,7 @@ import mage.filter.common.FilterSpiritOrArcaneCard; public class FiddleheadKami extends CardImpl { private final static FilterSpiritOrArcaneCard filter = new FilterSpiritOrArcaneCard(); - + public FiddleheadKami(UUID ownerId) { super(ownerId, 130, "Fiddlehead Kami", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{4}{G}"); this.expansionSetCode = "SOK"; diff --git a/Mage.Sets/src/mage/sets/saviorsofkamigawa/FreedFromTheReal.java b/Mage.Sets/src/mage/sets/saviorsofkamigawa/FreedFromTheReal.java index 6871ca0a54..2f317a5d73 100644 --- a/Mage.Sets/src/mage/sets/saviorsofkamigawa/FreedFromTheReal.java +++ b/Mage.Sets/src/mage/sets/saviorsofkamigawa/FreedFromTheReal.java @@ -63,7 +63,7 @@ public class FreedFromTheReal extends CardImpl { this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new TapEnchantedEffect(), new ManaCostsImpl("{U}"))); // {U}: Untap enchanted creature. this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new UntapEnchantedEffect(), new ManaCostsImpl("{U}"))); - + } public FreedFromTheReal(final FreedFromTheReal card) { diff --git a/Mage.Sets/src/mage/sets/saviorsofkamigawa/HaruOnna.java b/Mage.Sets/src/mage/sets/saviorsofkamigawa/HaruOnna.java index 31e71e56bc..382c4fddfc 100644 --- a/Mage.Sets/src/mage/sets/saviorsofkamigawa/HaruOnna.java +++ b/Mage.Sets/src/mage/sets/saviorsofkamigawa/HaruOnna.java @@ -45,7 +45,7 @@ import mage.filter.common.FilterSpiritOrArcaneCard; public class HaruOnna extends CardImpl { private final static FilterSpiritOrArcaneCard filter = new FilterSpiritOrArcaneCard(); - + public HaruOnna(UUID ownerId) { super(ownerId, 132, "Haru-Onna", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{3}{G}"); this.expansionSetCode = "SOK"; diff --git a/Mage.Sets/src/mage/sets/saviorsofkamigawa/KashiTribeElite.java b/Mage.Sets/src/mage/sets/saviorsofkamigawa/KashiTribeElite.java index 4d1302fc6f..6b5a0b9607 100644 --- a/Mage.Sets/src/mage/sets/saviorsofkamigawa/KashiTribeElite.java +++ b/Mage.Sets/src/mage/sets/saviorsofkamigawa/KashiTribeElite.java @@ -48,9 +48,9 @@ import mage.filter.common.FilterControlledPermanent; * @author LevelX */ public class KashiTribeElite extends CardImpl { - + private final static FilterControlledPermanent filter = new FilterControlledPermanent("Legendary Snakes"); - + static { filter.getSupertype().add("Legendary"); filter.setScopeSupertype(Filter.ComparisonScope.Any); @@ -76,7 +76,7 @@ public class KashiTribeElite extends CardImpl { ability = new DealsCombatDamageToACreatureTriggeredAbility(new TapTargetEffect("that creature"), false, true); ability.addEffect(new SkipNextUntapTargetEffect("and it")); this.addAbility(ability); - + } public KashiTribeElite(final KashiTribeElite card) { diff --git a/Mage.Sets/src/mage/sets/saviorsofkamigawa/KemuriOnna.java b/Mage.Sets/src/mage/sets/saviorsofkamigawa/KemuriOnna.java index 4fb1b22851..295246278c 100644 --- a/Mage.Sets/src/mage/sets/saviorsofkamigawa/KemuriOnna.java +++ b/Mage.Sets/src/mage/sets/saviorsofkamigawa/KemuriOnna.java @@ -47,7 +47,7 @@ import mage.target.TargetPlayer; public class KemuriOnna extends CardImpl { private final static FilterSpiritOrArcaneCard filter = new FilterSpiritOrArcaneCard(); - + public KemuriOnna(UUID ownerId) { super(ownerId, 76, "Kemuri-Onna", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{4}{B}"); this.expansionSetCode = "SOK"; diff --git a/Mage.Sets/src/mage/sets/saviorsofkamigawa/KiriOnna.java b/Mage.Sets/src/mage/sets/saviorsofkamigawa/KiriOnna.java index dfb105c3f4..9e14099824 100644 --- a/Mage.Sets/src/mage/sets/saviorsofkamigawa/KiriOnna.java +++ b/Mage.Sets/src/mage/sets/saviorsofkamigawa/KiriOnna.java @@ -47,7 +47,7 @@ import mage.target.common.TargetCreaturePermanent; public class KiriOnna extends CardImpl { private final static FilterSpiritOrArcaneCard filter = new FilterSpiritOrArcaneCard(); - + public KiriOnna(UUID ownerId) { super(ownerId, 43, "Kiri-Onna", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{4}{U}"); this.expansionSetCode = "SOK"; diff --git a/Mage.Sets/src/mage/sets/saviorsofkamigawa/MatsuTribeBirdstalker.java b/Mage.Sets/src/mage/sets/saviorsofkamigawa/MatsuTribeBirdstalker.java index 01fe0b2c66..8e1fc424dc 100644 --- a/Mage.Sets/src/mage/sets/saviorsofkamigawa/MatsuTribeBirdstalker.java +++ b/Mage.Sets/src/mage/sets/saviorsofkamigawa/MatsuTribeBirdstalker.java @@ -47,7 +47,7 @@ import mage.cards.CardImpl; * @author LevelX */ public class MatsuTribeBirdstalker extends CardImpl { - + public MatsuTribeBirdstalker(UUID ownerId) { super(ownerId, 137, "Matsu-Tribe Birdstalker", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{2}{G}{G}"); this.expansionSetCode = "SOK"; @@ -63,7 +63,7 @@ public class MatsuTribeBirdstalker extends CardImpl { ability = new DealsCombatDamageToACreatureTriggeredAbility(new TapTargetEffect("that creature"), false, true); ability.addEffect(new SkipNextUntapTargetEffect("and it")); this.addAbility(ability); - + // {G}: Matsu-Tribe Birdstalker gains reach until end of turn. (It can block creatures with flying.) this.addAbility(new SimpleActivatedAbility(Constants.Zone.BATTLEFIELD, new GainAbilitySourceEffect(ReachAbility.getInstance(), Constants.Duration.EndOfTurn), diff --git a/Mage.Sets/src/mage/sets/scarsofmirrodin/AbunaAcolyte.java b/Mage.Sets/src/mage/sets/scarsofmirrodin/AbunaAcolyte.java index 0795c14194..81ccbe5a91 100644 --- a/Mage.Sets/src/mage/sets/scarsofmirrodin/AbunaAcolyte.java +++ b/Mage.Sets/src/mage/sets/scarsofmirrodin/AbunaAcolyte.java @@ -50,36 +50,36 @@ import java.util.UUID; */ public class AbunaAcolyte extends CardImpl { - final static FilterCreaturePermanent filter = new FilterCreaturePermanent("artifact creature"); + final static FilterCreaturePermanent filter = new FilterCreaturePermanent("artifact creature"); - static { - filter.getCardType().add(CardType.ARTIFACT); - filter.setScopeCardType(ComparisonScope.All); - } + static { + filter.getCardType().add(CardType.ARTIFACT); + filter.setScopeCardType(ComparisonScope.All); + } - public AbunaAcolyte(UUID ownerId) { - super(ownerId, 1, "Abuna Acolyte", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{1}{W}"); - this.expansionSetCode = "SOM"; - this.subtype.add("Cat"); - this.subtype.add("Cleric"); - this.color.setWhite(true); - this.power = new MageInt(1); - this.toughness = new MageInt(1); - Ability ability1 = new SimpleActivatedAbility(Zone.BATTLEFIELD, new PreventDamageTargetEffect(Duration.EndOfTurn, 1), new TapSourceCost()); - ability1.addTarget(new TargetCreatureOrPlayer()); - Ability ability2 = new SimpleActivatedAbility(Zone.BATTLEFIELD, new PreventDamageTargetEffect(Duration.EndOfTurn, 2), new TapSourceCost()); - ability2.addTarget(new TargetCreaturePermanent(filter)); - this.addAbility(ability1); - this.addAbility(ability2); - } + public AbunaAcolyte(UUID ownerId) { + super(ownerId, 1, "Abuna Acolyte", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{1}{W}"); + this.expansionSetCode = "SOM"; + this.subtype.add("Cat"); + this.subtype.add("Cleric"); + this.color.setWhite(true); + this.power = new MageInt(1); + this.toughness = new MageInt(1); + Ability ability1 = new SimpleActivatedAbility(Zone.BATTLEFIELD, new PreventDamageTargetEffect(Duration.EndOfTurn, 1), new TapSourceCost()); + ability1.addTarget(new TargetCreatureOrPlayer()); + Ability ability2 = new SimpleActivatedAbility(Zone.BATTLEFIELD, new PreventDamageTargetEffect(Duration.EndOfTurn, 2), new TapSourceCost()); + ability2.addTarget(new TargetCreaturePermanent(filter)); + this.addAbility(ability1); + this.addAbility(ability2); + } - public AbunaAcolyte(final AbunaAcolyte card) { - super(card); - } + public AbunaAcolyte(final AbunaAcolyte card) { + super(card); + } - @Override - public AbunaAcolyte copy() { - return new AbunaAcolyte(this); - } + @Override + public AbunaAcolyte copy() { + return new AbunaAcolyte(this); + } } \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/scarsofmirrodin/AccordersShield.java b/Mage.Sets/src/mage/sets/scarsofmirrodin/AccordersShield.java index 49562b0d61..c86c2ca8ec 100644 --- a/Mage.Sets/src/mage/sets/scarsofmirrodin/AccordersShield.java +++ b/Mage.Sets/src/mage/sets/scarsofmirrodin/AccordersShield.java @@ -53,8 +53,8 @@ public class AccordersShield extends CardImpl { this.expansionSetCode = "SOM"; this.subtype.add("Equipment"); this.addAbility(new EquipAbility(Constants.Outcome.AddAbility, new GenericManaCost(3))); - this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityAttachedEffect(VigilanceAbility.getInstance(), Constants.AttachmentType.EQUIPMENT))); - this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostEquippedEffect(0, 3))); + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityAttachedEffect(VigilanceAbility.getInstance(), Constants.AttachmentType.EQUIPMENT))); + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostEquippedEffect(0, 3))); } public AccordersShield (final AccordersShield card) { diff --git a/Mage.Sets/src/mage/sets/scarsofmirrodin/AcidWebSpider.java b/Mage.Sets/src/mage/sets/scarsofmirrodin/AcidWebSpider.java index 2a603ccf14..2ec9e8caf3 100644 --- a/Mage.Sets/src/mage/sets/scarsofmirrodin/AcidWebSpider.java +++ b/Mage.Sets/src/mage/sets/scarsofmirrodin/AcidWebSpider.java @@ -57,7 +57,7 @@ public class AcidWebSpider extends CardImpl { super(ownerId, 108, "Acid Web Spider", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{3}{G}{G}"); this.expansionSetCode = "SOM"; this.subtype.add("Spider"); - this.color.setGreen(true); + this.color.setGreen(true); this.power = new MageInt(3); this.toughness = new MageInt(5); this.addAbility(ReachAbility.getInstance()); diff --git a/Mage.Sets/src/mage/sets/scarsofmirrodin/AlphaTyrranax.java b/Mage.Sets/src/mage/sets/scarsofmirrodin/AlphaTyrranax.java index a504ce0295..e5d3a159f6 100644 --- a/Mage.Sets/src/mage/sets/scarsofmirrodin/AlphaTyrranax.java +++ b/Mage.Sets/src/mage/sets/scarsofmirrodin/AlphaTyrranax.java @@ -45,7 +45,7 @@ public class AlphaTyrranax extends CardImpl { super(ownerId, 109, "Alpha Tyrranax", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{4}{G}{G}"); this.expansionSetCode = "SOM"; this.subtype.add("Beast"); - this.color.setGreen(true); + this.color.setGreen(true); this.power = new MageInt(6); this.toughness = new MageInt(5); } diff --git a/Mage.Sets/src/mage/sets/scarsofmirrodin/ArcTrail.java b/Mage.Sets/src/mage/sets/scarsofmirrodin/ArcTrail.java index 1eeb216ed5..e6c74b781d 100644 --- a/Mage.Sets/src/mage/sets/scarsofmirrodin/ArcTrail.java +++ b/Mage.Sets/src/mage/sets/scarsofmirrodin/ArcTrail.java @@ -53,11 +53,11 @@ public class ArcTrail extends CardImpl { super(ownerId, 81, "Arc Trail", Rarity.UNCOMMON, new CardType[] { CardType.SORCERY }, "{1}{R}"); this.expansionSetCode = "SOM"; - this.color.setRed(true); + this.color.setRed(true); - Target target = new TargetCreatureOrPlayer(2); - this.getSpellAbility().addTarget(target); - this.getSpellAbility().addEffect(ArcTrailEffect.getInstance()); + Target target = new TargetCreatureOrPlayer(2); + this.getSpellAbility().addTarget(target); + this.getSpellAbility().addEffect(ArcTrailEffect.getInstance()); } public ArcTrail (final ArcTrail card) { @@ -73,51 +73,51 @@ public class ArcTrail extends CardImpl { class ArcTrailEffect extends OneShotEffect { - private static final ArcTrailEffect fINSTANCE = new ArcTrailEffect(); + private static final ArcTrailEffect fINSTANCE = new ArcTrailEffect(); - private Object readResolve() throws ObjectStreamException { - return fINSTANCE; - } + private Object readResolve() throws ObjectStreamException { + return fINSTANCE; + } - public static ArcTrailEffect getInstance() { - return fINSTANCE; - } + public static ArcTrailEffect getInstance() { + return fINSTANCE; + } - private ArcTrailEffect ( ) { - super(Outcome.Damage); - staticText = "{source} deals 2 damage to target creature or player and 1 damage to another target creature or player."; - } + private ArcTrailEffect ( ) { + super(Outcome.Damage); + staticText = "{source} deals 2 damage to target creature or player and 1 damage to another target creature or player."; + } - @Override - public boolean apply(Game game, Ability source) { + @Override + public boolean apply(Game game, Ability source) { - boolean applied = false; - boolean twoDamageDone = false; - int damage = 2; + boolean applied = false; + boolean twoDamageDone = false; + int damage = 2; - for ( UUID target : targetPointer.getTargets(game, source) ) { - Permanent permanent = game.getPermanent(target); + for ( UUID target : targetPointer.getTargets(game, source) ) { + Permanent permanent = game.getPermanent(target); - if ( twoDamageDone ) { - damage = 1; - } + if ( twoDamageDone ) { + damage = 1; + } - if (permanent != null) { - applied |= (permanent.damage( damage, source.getSourceId(), game, false, true ) > 0); - } - Player player = game.getPlayer(target); - if (player != null) { - applied |= (player.damage( damage, source.getSourceId(), game, false, true ) > 0); - } + if (permanent != null) { + applied |= (permanent.damage( damage, source.getSourceId(), game, false, true ) > 0); + } + Player player = game.getPlayer(target); + if (player != null) { + applied |= (player.damage( damage, source.getSourceId(), game, false, true ) > 0); + } - twoDamageDone = true; - } - return applied; - } + twoDamageDone = true; + } + return applied; + } - @Override - public Effect copy() { - return fINSTANCE; - } + @Override + public Effect copy() { + return fINSTANCE; + } } \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/scarsofmirrodin/ArgentSphinx.java b/Mage.Sets/src/mage/sets/scarsofmirrodin/ArgentSphinx.java index 016014f876..1fc9ab59ea 100644 --- a/Mage.Sets/src/mage/sets/scarsofmirrodin/ArgentSphinx.java +++ b/Mage.Sets/src/mage/sets/scarsofmirrodin/ArgentSphinx.java @@ -57,7 +57,7 @@ public class ArgentSphinx extends CardImpl { super(ownerId, 28, "Argent Sphinx", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{2}{U}{U}"); this.expansionSetCode = "SOM"; this.subtype.add("Sphinx"); - this.color.setBlue(true); + this.color.setBlue(true); this.power = new MageInt(4); this.toughness = new MageInt(3); this.addAbility(FlyingAbility.getInstance()); @@ -79,36 +79,36 @@ public class ArgentSphinx extends CardImpl { class ArgentSphinxEffect extends OneShotEffect { - private static final String effectText = "Exile {this}. Return it to the battlefield under your control at the beginning of the next end step"; + private static final String effectText = "Exile {this}. Return it to the battlefield under your control at the beginning of the next end step"; - ArgentSphinxEffect ( ) { - super(Constants.Outcome.Benefit); - staticText = effectText; - } + ArgentSphinxEffect ( ) { + super(Constants.Outcome.Benefit); + staticText = effectText; + } - ArgentSphinxEffect(ArgentSphinxEffect effect) { - super(effect); - } + ArgentSphinxEffect(ArgentSphinxEffect effect) { + super(effect); + } - @Override - public boolean apply(Game game, Ability source) { - Permanent permanent = game.getPermanent(source.getSourceId()); - if (permanent != null) { - if (permanent.moveToExile(source.getSourceId(), "Argent Sphinx Exile", source.getId(), game)) { - //create delayed triggered ability - AtEndOfTurnDelayedTriggeredAbility delayedAbility = new AtEndOfTurnDelayedTriggeredAbility(new ReturnFromExileEffect(source.getSourceId(), Zone.BATTLEFIELD)); - delayedAbility.setSourceId(source.getSourceId()); - delayedAbility.setControllerId(source.getControllerId()); - game.addDelayedTriggeredAbility(delayedAbility); - return true; - } - } - return false; - } + @Override + public boolean apply(Game game, Ability source) { + Permanent permanent = game.getPermanent(source.getSourceId()); + if (permanent != null) { + if (permanent.moveToExile(source.getSourceId(), "Argent Sphinx Exile", source.getId(), game)) { + //create delayed triggered ability + AtEndOfTurnDelayedTriggeredAbility delayedAbility = new AtEndOfTurnDelayedTriggeredAbility(new ReturnFromExileEffect(source.getSourceId(), Zone.BATTLEFIELD)); + delayedAbility.setSourceId(source.getSourceId()); + delayedAbility.setControllerId(source.getControllerId()); + game.addDelayedTriggeredAbility(delayedAbility); + return true; + } + } + return false; + } - @Override - public ArgentSphinxEffect copy() { - return new ArgentSphinxEffect(this); - } + @Override + public ArgentSphinxEffect copy() { + return new ArgentSphinxEffect(this); + } } diff --git a/Mage.Sets/src/mage/sets/scarsofmirrodin/Asceticism.java b/Mage.Sets/src/mage/sets/scarsofmirrodin/Asceticism.java index 3f8ef8b965..90f367c4a3 100644 --- a/Mage.Sets/src/mage/sets/scarsofmirrodin/Asceticism.java +++ b/Mage.Sets/src/mage/sets/scarsofmirrodin/Asceticism.java @@ -52,77 +52,77 @@ import java.util.UUID; */ public class Asceticism extends CardImpl { - private static final FilterStackObject filter = new FilterStackObject("spells or abilities your opponents control"); + private static final FilterStackObject filter = new FilterStackObject("spells or abilities your opponents control"); - static { - filter.setTargetController(Constants.TargetController.OPPONENT); - } + static { + filter.setTargetController(Constants.TargetController.OPPONENT); + } - public Asceticism(UUID ownerId) { - super(ownerId, 110, "Asceticism", Rarity.RARE, new CardType[]{CardType.ENCHANTMENT}, "{3}{G}{G}"); - this.expansionSetCode = "SOM"; - this.color.setGreen(true); - this.addAbility(new SimpleStaticAbility(Constants.Zone.BATTLEFIELD, new AsceticismEffect(filter, Constants.Duration.WhileOnBattlefield))); - Ability ability = new SimpleActivatedAbility(Constants.Zone.BATTLEFIELD, new RegenerateTargetEffect(), new ManaCostsImpl("{1}{G}")); - ability.addTarget(new TargetCreaturePermanent()); - this.addAbility(ability); - } + public Asceticism(UUID ownerId) { + super(ownerId, 110, "Asceticism", Rarity.RARE, new CardType[]{CardType.ENCHANTMENT}, "{3}{G}{G}"); + this.expansionSetCode = "SOM"; + this.color.setGreen(true); + this.addAbility(new SimpleStaticAbility(Constants.Zone.BATTLEFIELD, new AsceticismEffect(filter, Constants.Duration.WhileOnBattlefield))); + Ability ability = new SimpleActivatedAbility(Constants.Zone.BATTLEFIELD, new RegenerateTargetEffect(), new ManaCostsImpl("{1}{G}")); + ability.addTarget(new TargetCreaturePermanent()); + this.addAbility(ability); + } - public Asceticism(final Asceticism card) { - super(card); - } + public Asceticism(final Asceticism card) { + super(card); + } - @Override - public Asceticism copy() { - return new Asceticism(this); - } + @Override + public Asceticism copy() { + return new Asceticism(this); + } } class AsceticismEffect extends ReplacementEffectImpl { - private FilterStackObject filterSource; + private FilterStackObject filterSource; - public AsceticismEffect(FilterStackObject filterSource, Constants.Duration duration) { - super(duration, Constants.Outcome.Benefit); - this.filterSource = filterSource; - staticText = "Creatures you control can't be the targets of spells or abilities your opponents control"; - } + public AsceticismEffect(FilterStackObject filterSource, Constants.Duration duration) { + super(duration, Constants.Outcome.Benefit); + this.filterSource = filterSource; + staticText = "Creatures you control can't be the targets of spells or abilities your opponents control"; + } - public AsceticismEffect(final AsceticismEffect effect) { - super(effect); - this.filterSource = effect.filterSource.copy(); - } + public AsceticismEffect(final AsceticismEffect effect) { + super(effect); + this.filterSource = effect.filterSource.copy(); + } - @Override - public AsceticismEffect copy() { - return new AsceticismEffect(this); - } + @Override + public AsceticismEffect copy() { + return new AsceticismEffect(this); + } - @Override - public boolean apply(Game game, Ability source) { - return true; - } + @Override + public boolean apply(Game game, Ability source) { + return true; + } - @Override - public boolean replaceEvent(GameEvent event, Ability source, Game game) { - return true; - } + @Override + public boolean replaceEvent(GameEvent event, Ability source, Game game) { + return true; + } - @Override - public boolean applies(GameEvent event, Ability source, Game game) { - if (event.getType() == GameEvent.EventType.TARGET) { - Permanent permanent = game.getBattlefield().getPermanent(event.getTargetId()); - if (permanent != null && permanent.getControllerId().equals(source.getControllerId()) - && permanent.getCardType().contains(CardType.CREATURE)) { - StackObject sourceObject = game.getStack().getStackObject(event.getSourceId()); - if (sourceObject != null && filterSource.match(sourceObject, source.getControllerId(), game)) { - return true; - } - } - } - return false; - } + @Override + public boolean applies(GameEvent event, Ability source, Game game) { + if (event.getType() == GameEvent.EventType.TARGET) { + Permanent permanent = game.getBattlefield().getPermanent(event.getTargetId()); + if (permanent != null && permanent.getControllerId().equals(source.getControllerId()) + && permanent.getCardType().contains(CardType.CREATURE)) { + StackObject sourceObject = game.getStack().getStackObject(event.getSourceId()); + if (sourceObject != null && filterSource.match(sourceObject, source.getControllerId(), game)) { + return true; + } + } + } + return false; + } } diff --git a/Mage.Sets/src/mage/sets/scarsofmirrodin/AssaultStrobe.java b/Mage.Sets/src/mage/sets/scarsofmirrodin/AssaultStrobe.java index 3f1081a078..5e564484d8 100644 --- a/Mage.Sets/src/mage/sets/scarsofmirrodin/AssaultStrobe.java +++ b/Mage.Sets/src/mage/sets/scarsofmirrodin/AssaultStrobe.java @@ -47,7 +47,7 @@ public class AssaultStrobe extends CardImpl { public AssaultStrobe (UUID ownerId) { super(ownerId, 82, "Assault Strobe", Rarity.COMMON, new CardType[]{CardType.SORCERY}, "{R}"); this.expansionSetCode = "SOM"; - this.color.setRed(true); + this.color.setRed(true); this.getSpellAbility().addEffect(new GainAbilityTargetEffect(DoubleStrikeAbility.getInstance(), Duration.EndOfTurn)); this.getSpellAbility().addTarget(new TargetCreaturePermanent()); } diff --git a/Mage.Sets/src/mage/sets/scarsofmirrodin/AuriokEdgewright.java b/Mage.Sets/src/mage/sets/scarsofmirrodin/AuriokEdgewright.java index 88237af9eb..4c7f08c880 100644 --- a/Mage.Sets/src/mage/sets/scarsofmirrodin/AuriokEdgewright.java +++ b/Mage.Sets/src/mage/sets/scarsofmirrodin/AuriokEdgewright.java @@ -47,28 +47,28 @@ import mage.cards.CardImpl; */ public class AuriokEdgewright extends CardImpl { - protected static String effectText = "Metalcraft - Auriok Edgewright has double strike as long as you control three or more artifacts."; + protected static String effectText = "Metalcraft - Auriok Edgewright has double strike as long as you control three or more artifacts."; - public AuriokEdgewright(UUID ownerId) { - super(ownerId, 3, "Auriok Edgewright", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{W}{W}"); - this.expansionSetCode = "SOM"; - this.subtype.add("Human"); - this.subtype.add("Soldier"); + public AuriokEdgewright(UUID ownerId) { + super(ownerId, 3, "Auriok Edgewright", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{W}{W}"); + this.expansionSetCode = "SOM"; + this.subtype.add("Human"); + this.subtype.add("Soldier"); - this.color.setWhite(true); - this.power = new MageInt(2); - this.toughness = new MageInt(2); - - ContinuousEffect effect = new GainAbilitySourceEffect(DoubleStrikeAbility.getInstance(), Duration.WhileOnBattlefield); + this.color.setWhite(true); + this.power = new MageInt(2); + this.toughness = new MageInt(2); + + ContinuousEffect effect = new GainAbilitySourceEffect(DoubleStrikeAbility.getInstance(), Duration.WhileOnBattlefield); this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new ConditionalContinousEffect(effect, MetalcraftCondition.getInstance(), effectText))); - } + } - public AuriokEdgewright(final AuriokEdgewright card) { - super(card); - } + public AuriokEdgewright(final AuriokEdgewright card) { + super(card); + } - @Override - public AuriokEdgewright copy() { - return new AuriokEdgewright(this); - } + @Override + public AuriokEdgewright copy() { + return new AuriokEdgewright(this); + } } diff --git a/Mage.Sets/src/mage/sets/scarsofmirrodin/AuriokReplica.java b/Mage.Sets/src/mage/sets/scarsofmirrodin/AuriokReplica.java index b2b888b49b..b453024e85 100644 --- a/Mage.Sets/src/mage/sets/scarsofmirrodin/AuriokReplica.java +++ b/Mage.Sets/src/mage/sets/scarsofmirrodin/AuriokReplica.java @@ -51,84 +51,84 @@ import mage.target.TargetSource; */ public class AuriokReplica extends CardImpl { - public AuriokReplica(UUID ownerId) { - super(ownerId, 138, "Auriok Replica", Rarity.COMMON, new CardType[]{CardType.ARTIFACT, CardType.CREATURE}, "{3}"); - this.expansionSetCode = "SOM"; - this.subtype.add("Cleric"); - this.power = new MageInt(2); - this.toughness = new MageInt(2); + public AuriokReplica(UUID ownerId) { + super(ownerId, 138, "Auriok Replica", Rarity.COMMON, new CardType[]{CardType.ARTIFACT, CardType.CREATURE}, "{3}"); + this.expansionSetCode = "SOM"; + this.subtype.add("Cleric"); + this.power = new MageInt(2); + this.toughness = new MageInt(2); - Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new AuriokReplicaEffect(), new ManaCostsImpl("{W}")); - ability.addCost(new SacrificeSourceCost()); - this.addAbility(ability); - } + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new AuriokReplicaEffect(), new ManaCostsImpl("{W}")); + ability.addCost(new SacrificeSourceCost()); + this.addAbility(ability); + } - public AuriokReplica(final AuriokReplica card) { - super(card); - } + public AuriokReplica(final AuriokReplica card) { + super(card); + } - @Override - public AuriokReplica copy() { - return new AuriokReplica(this); - } + @Override + public AuriokReplica copy() { + return new AuriokReplica(this); + } } class AuriokReplicaEffect extends PreventionEffectImpl { - private TargetSource target = new TargetSource(); + private TargetSource target = new TargetSource(); - public AuriokReplicaEffect() { - super(Duration.EndOfTurn); - staticText = "Prevent all damage a source of your choice would deal to you this turn"; - } + public AuriokReplicaEffect() { + super(Duration.EndOfTurn); + staticText = "Prevent all damage a source of your choice would deal to you this turn"; + } - public AuriokReplicaEffect(final AuriokReplicaEffect effect) { - super(effect); - this.target = effect.target.copy(); - } + public AuriokReplicaEffect(final AuriokReplicaEffect effect) { + super(effect); + this.target = effect.target.copy(); + } - @Override - public AuriokReplicaEffect copy() { - return new AuriokReplicaEffect(this); - } + @Override + public AuriokReplicaEffect copy() { + return new AuriokReplicaEffect(this); + } - @Override - public boolean apply(Game game, Ability source) { - return true; - } + @Override + public boolean apply(Game game, Ability source) { + return true; + } - @Override - public void init(Ability source, Game game) { - this.target.choose(Outcome.PreventDamage, source.getControllerId(), source.getSourceId(), game); - } + @Override + public void init(Ability source, Game game) { + this.target.choose(Outcome.PreventDamage, source.getControllerId(), source.getSourceId(), game); + } - @Override - public boolean replaceEvent(GameEvent event, Ability source, Game game) { - if (event.getTargetId().equals(source.getControllerId()) && event.getSourceId().equals(target.getFirstTarget())) { - preventDamage(event, source, target.getFirstTarget(), game); - return true; - } - return false; - } + @Override + public boolean replaceEvent(GameEvent event, Ability source, Game game) { + if (event.getTargetId().equals(source.getControllerId()) && event.getSourceId().equals(target.getFirstTarget())) { + preventDamage(event, source, target.getFirstTarget(), game); + return true; + } + return false; + } - private void preventDamage(GameEvent event, Ability source, UUID target, Game game) { - GameEvent preventEvent = new GameEvent(GameEvent.EventType.PREVENT_DAMAGE, target, source.getId(), source.getControllerId(), event.getAmount(), false); - if (!game.replaceEvent(preventEvent)) { - int damage = event.getAmount(); - event.setAmount(0); - game.fireEvent(GameEvent.getEvent(GameEvent.EventType.PREVENTED_DAMAGE, target, source.getId(), source.getControllerId(), damage)); - } - } + private void preventDamage(GameEvent event, Ability source, UUID target, Game game) { + GameEvent preventEvent = new GameEvent(GameEvent.EventType.PREVENT_DAMAGE, target, source.getId(), source.getControllerId(), event.getAmount(), false); + if (!game.replaceEvent(preventEvent)) { + int damage = event.getAmount(); + event.setAmount(0); + game.fireEvent(GameEvent.getEvent(GameEvent.EventType.PREVENTED_DAMAGE, target, source.getId(), source.getControllerId(), damage)); + } + } - @Override - public boolean applies(GameEvent event, Ability source, Game game) { - if (!this.used && super.applies(event, source, game)) { - if (event.getTargetId().equals(source.getControllerId()) && event.getSourceId().equals(target.getFirstTarget())) { - return true; - } - } - return false; - } + @Override + public boolean applies(GameEvent event, Ability source, Game game) { + if (!this.used && super.applies(event, source, game)) { + if (event.getTargetId().equals(source.getControllerId()) && event.getSourceId().equals(target.getFirstTarget())) { + return true; + } + } + return false; + } } \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/scarsofmirrodin/AuriokSunchaser.java b/Mage.Sets/src/mage/sets/scarsofmirrodin/AuriokSunchaser.java index f9eb3df5e6..d751184bcb 100644 --- a/Mage.Sets/src/mage/sets/scarsofmirrodin/AuriokSunchaser.java +++ b/Mage.Sets/src/mage/sets/scarsofmirrodin/AuriokSunchaser.java @@ -48,31 +48,31 @@ import mage.cards.CardImpl; */ public class AuriokSunchaser extends CardImpl { - protected static String effect1Text = "Metalcraft - As long as you control three or more artifacts, Auriok Sunchaser gets +2/+2"; - protected static String effect2Text = "Metalcraft - As long as you control three or more artifacts, Auriok Sunchaser has flying"; + protected static String effect1Text = "Metalcraft - As long as you control three or more artifacts, Auriok Sunchaser gets +2/+2"; + protected static String effect2Text = "Metalcraft - As long as you control three or more artifacts, Auriok Sunchaser has flying"; - public AuriokSunchaser(UUID ownerId) { - super(ownerId, 4, "Auriok Sunchaser", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{1}{W}"); - this.expansionSetCode = "SOM"; - this.subtype.add("Human"); - this.subtype.add("Soldier"); + public AuriokSunchaser(UUID ownerId) { + super(ownerId, 4, "Auriok Sunchaser", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{1}{W}"); + this.expansionSetCode = "SOM"; + this.subtype.add("Human"); + this.subtype.add("Soldier"); - this.color.setWhite(true); - this.power = new MageInt(1); - this.toughness = new MageInt(1); + this.color.setWhite(true); + this.power = new MageInt(1); + this.toughness = new MageInt(1); - ContinuousEffect effect1 = new BoostSourceEffect(2, 2, Duration.WhileOnBattlefield); + ContinuousEffect effect1 = new BoostSourceEffect(2, 2, Duration.WhileOnBattlefield); this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new ConditionalContinousEffect(effect1, MetalcraftCondition.getInstance(), effect1Text))); - ContinuousEffect effect2 = new GainAbilitySourceEffect(FlyingAbility.getInstance(), Duration.WhileOnBattlefield); + ContinuousEffect effect2 = new GainAbilitySourceEffect(FlyingAbility.getInstance(), Duration.WhileOnBattlefield); this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new ConditionalContinousEffect(effect2, MetalcraftCondition.getInstance(), effect2Text))); - } + } - public AuriokSunchaser(final AuriokSunchaser card) { - super(card); - } + public AuriokSunchaser(final AuriokSunchaser card) { + super(card); + } - @Override - public AuriokSunchaser copy() { - return new AuriokSunchaser(this); - } + @Override + public AuriokSunchaser copy() { + return new AuriokSunchaser(this); + } } diff --git a/Mage.Sets/src/mage/sets/scarsofmirrodin/BarrageOgre.java b/Mage.Sets/src/mage/sets/scarsofmirrodin/BarrageOgre.java index 74100b88d4..81c0881616 100644 --- a/Mage.Sets/src/mage/sets/scarsofmirrodin/BarrageOgre.java +++ b/Mage.Sets/src/mage/sets/scarsofmirrodin/BarrageOgre.java @@ -62,7 +62,7 @@ public class BarrageOgre extends CardImpl { this.expansionSetCode = "SOM"; this.subtype.add("Ogre"); this.subtype.add("Warrior"); - this.color.setRed(true); + this.color.setRed(true); this.power = new MageInt(3); this.toughness = new MageInt(3); Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DamageTargetEffect(2), new TapSourceCost()); diff --git a/Mage.Sets/src/mage/sets/scarsofmirrodin/BellowingTanglewurm.java b/Mage.Sets/src/mage/sets/scarsofmirrodin/BellowingTanglewurm.java index d0c41297df..6cb61e5455 100644 --- a/Mage.Sets/src/mage/sets/scarsofmirrodin/BellowingTanglewurm.java +++ b/Mage.Sets/src/mage/sets/scarsofmirrodin/BellowingTanglewurm.java @@ -59,7 +59,7 @@ public class BellowingTanglewurm extends CardImpl { super(ownerId, 111, "Bellowing Tanglewurm", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{3}{G}{G}"); this.expansionSetCode = "SOM"; this.subtype.add("Wurm"); - this.color.setGreen(true); + this.color.setGreen(true); this.power = new MageInt(4); this.toughness = new MageInt(4); this.addAbility(IntimidateAbility.getInstance()); diff --git a/Mage.Sets/src/mage/sets/scarsofmirrodin/BlackcleaveCliffs.java b/Mage.Sets/src/mage/sets/scarsofmirrodin/BlackcleaveCliffs.java index d4b5e80065..be18ff0f2f 100644 --- a/Mage.Sets/src/mage/sets/scarsofmirrodin/BlackcleaveCliffs.java +++ b/Mage.Sets/src/mage/sets/scarsofmirrodin/BlackcleaveCliffs.java @@ -49,22 +49,22 @@ import mage.filter.common.FilterLandPermanent; */ public class BlackcleaveCliffs extends CardImpl { - private static final FilterLandPermanent filter = new FilterLandPermanent(); + private static final FilterLandPermanent filter = new FilterLandPermanent(); - static { - filter.setScopeSubtype(ComparisonScope.Any); - filter.setMessage("lands"); - } + static { + filter.setScopeSubtype(ComparisonScope.Any); + filter.setMessage("lands"); + } public BlackcleaveCliffs (UUID ownerId) { super(ownerId, 224, "Blackcleave Cliffs", Rarity.RARE, new CardType[]{CardType.LAND}, null); this.expansionSetCode = "SOM"; - Condition controls = new UnlessCondition(new ControlsPermanentCondition(filter, ControlsPermanentCondition.CountType.FEWER_THAN, 4)); - String abilityText = "tap it unless you control fewer than 3 " + filter.getMessage(); - this.addAbility(new EntersBattlefieldAbility(new ConditionalOneShotEffect(new TapSourceEffect(), controls, abilityText), abilityText)); - this.addAbility(new BlackManaAbility()); - this.addAbility(new RedManaAbility()); + Condition controls = new UnlessCondition(new ControlsPermanentCondition(filter, ControlsPermanentCondition.CountType.FEWER_THAN, 4)); + String abilityText = "tap it unless you control fewer than 3 " + filter.getMessage(); + this.addAbility(new EntersBattlefieldAbility(new ConditionalOneShotEffect(new TapSourceEffect(), controls, abilityText), abilityText)); + this.addAbility(new BlackManaAbility()); + this.addAbility(new RedManaAbility()); } public BlackcleaveCliffs (final BlackcleaveCliffs card) { diff --git a/Mage.Sets/src/mage/sets/scarsofmirrodin/BlackcleaveGoblin.java b/Mage.Sets/src/mage/sets/scarsofmirrodin/BlackcleaveGoblin.java index 9b9e5932c1..f91ed62dd5 100644 --- a/Mage.Sets/src/mage/sets/scarsofmirrodin/BlackcleaveGoblin.java +++ b/Mage.Sets/src/mage/sets/scarsofmirrodin/BlackcleaveGoblin.java @@ -47,7 +47,7 @@ public class BlackcleaveGoblin extends CardImpl { this.expansionSetCode = "SOM"; this.subtype.add("Goblin"); this.subtype.add("Zombie"); - this.color.setBlack(true); + this.color.setBlack(true); this.power = new MageInt(2); this.toughness = new MageInt(1); this.addAbility(HasteAbility.getInstance()); diff --git a/Mage.Sets/src/mage/sets/scarsofmirrodin/BladeTribeBerserkers.java b/Mage.Sets/src/mage/sets/scarsofmirrodin/BladeTribeBerserkers.java index 4190842e83..7b0b111e7b 100644 --- a/Mage.Sets/src/mage/sets/scarsofmirrodin/BladeTribeBerserkers.java +++ b/Mage.Sets/src/mage/sets/scarsofmirrodin/BladeTribeBerserkers.java @@ -61,7 +61,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.getInstance(), effectText)); } public BladeTribeBerserkers(final BladeTribeBerserkers card) { diff --git a/Mage.Sets/src/mage/sets/scarsofmirrodin/BlightMamba.java b/Mage.Sets/src/mage/sets/scarsofmirrodin/BlightMamba.java index 46efe883d3..49078f1ca3 100644 --- a/Mage.Sets/src/mage/sets/scarsofmirrodin/BlightMamba.java +++ b/Mage.Sets/src/mage/sets/scarsofmirrodin/BlightMamba.java @@ -49,7 +49,7 @@ public class BlightMamba extends CardImpl { super(ownerId, 112, "Blight Mamba", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{1}{G}"); this.expansionSetCode = "SOM"; this.subtype.add("Snake"); - this.color.setGreen(true); + this.color.setGreen(true); this.power = new MageInt(1); this.toughness = new MageInt(1); this.addAbility(InfectAbility.getInstance()); diff --git a/Mage.Sets/src/mage/sets/scarsofmirrodin/Blistergrub.java b/Mage.Sets/src/mage/sets/scarsofmirrodin/Blistergrub.java index 8623dc6484..836a2e6145 100644 --- a/Mage.Sets/src/mage/sets/scarsofmirrodin/Blistergrub.java +++ b/Mage.Sets/src/mage/sets/scarsofmirrodin/Blistergrub.java @@ -51,7 +51,7 @@ public class Blistergrub extends CardImpl { super(ownerId, 56, "Blistergrub", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{2}{B}"); this.expansionSetCode = "SOM"; this.subtype.add("Horror"); - this.color.setBlack(true); + this.color.setBlack(true); this.power = new MageInt(2); this.toughness = new MageInt(2); this.addAbility(new DiesTriggeredAbility(new BlistergrubEffect(), false)); diff --git a/Mage.Sets/src/mage/sets/scarsofmirrodin/BluntTheAssault.java b/Mage.Sets/src/mage/sets/scarsofmirrodin/BluntTheAssault.java index 526064f387..9e290f7832 100644 --- a/Mage.Sets/src/mage/sets/scarsofmirrodin/BluntTheAssault.java +++ b/Mage.Sets/src/mage/sets/scarsofmirrodin/BluntTheAssault.java @@ -54,7 +54,7 @@ public class BluntTheAssault extends CardImpl { public BluntTheAssault (UUID ownerId) { super(ownerId, 113, "Blunt the Assault", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{3}{G}"); this.expansionSetCode = "SOM"; - this.color.setGreen(true); + this.color.setGreen(true); this.getSpellAbility().addEffect(new GainLifeEffect(new PermanentsOnBattlefieldCount(filter))); this.getSpellAbility().addEffect(new PreventAllDamageEffect(Constants.Duration.EndOfTurn, true)); } diff --git a/Mage.Sets/src/mage/sets/scarsofmirrodin/BondsOfQuicksilver.java b/Mage.Sets/src/mage/sets/scarsofmirrodin/BondsOfQuicksilver.java index ac3a8c6f9b..1fe095e3d1 100644 --- a/Mage.Sets/src/mage/sets/scarsofmirrodin/BondsOfQuicksilver.java +++ b/Mage.Sets/src/mage/sets/scarsofmirrodin/BondsOfQuicksilver.java @@ -52,16 +52,16 @@ public class BondsOfQuicksilver extends CardImpl { super(ownerId, 29, "Bonds of Quicksilver", Rarity.COMMON, new CardType[]{CardType.ENCHANTMENT}, "{3}{U}"); this.expansionSetCode = "SOM"; this.subtype.add("Aura"); - this.color.setBlue(true); + this.color.setBlue(true); - this.addAbility(FlashAbility.getInstance()); - TargetPermanent auraTarget = new TargetCreaturePermanent(); - this.getSpellAbility().addTarget(auraTarget); - this.getSpellAbility().addEffect(new AttachEffect(Constants.Outcome.Detriment)); - Ability ability = new EnchantAbility(auraTarget.getTargetName()); - ability.addEffect(new SkipEnchantedUntapEffect()); - this.addAbility(ability); - } + this.addAbility(FlashAbility.getInstance()); + TargetPermanent auraTarget = new TargetCreaturePermanent(); + this.getSpellAbility().addTarget(auraTarget); + this.getSpellAbility().addEffect(new AttachEffect(Constants.Outcome.Detriment)); + Ability ability = new EnchantAbility(auraTarget.getTargetName()); + ability.addEffect(new SkipEnchantedUntapEffect()); + this.addAbility(ability); + } public BondsOfQuicksilver (final BondsOfQuicksilver card) { super(card); diff --git a/Mage.Sets/src/mage/sets/scarsofmirrodin/CarapaceForger.java b/Mage.Sets/src/mage/sets/scarsofmirrodin/CarapaceForger.java index 9e19711abd..be388e10c6 100644 --- a/Mage.Sets/src/mage/sets/scarsofmirrodin/CarapaceForger.java +++ b/Mage.Sets/src/mage/sets/scarsofmirrodin/CarapaceForger.java @@ -53,7 +53,7 @@ public class CarapaceForger extends CardImpl { this.expansionSetCode = "SOM"; this.subtype.add("Elf"); this.subtype.add("Artificer"); - this.color.setGreen(true); + this.color.setGreen(true); this.power = new MageInt(2); this.toughness = new MageInt(2); ContinuousEffect boostSource = new BoostSourceEffect(2, 2, Duration.WhileOnBattlefield); diff --git a/Mage.Sets/src/mage/sets/scarsofmirrodin/CarnifexDemon.java b/Mage.Sets/src/mage/sets/scarsofmirrodin/CarnifexDemon.java index 4200bf407f..2e06af89d6 100644 --- a/Mage.Sets/src/mage/sets/scarsofmirrodin/CarnifexDemon.java +++ b/Mage.Sets/src/mage/sets/scarsofmirrodin/CarnifexDemon.java @@ -58,7 +58,7 @@ public class CarnifexDemon extends CardImpl { super(ownerId, 57, "Carnifex Demon", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{4}{B}{B}"); this.expansionSetCode = "SOM"; this.subtype.add("Demon"); - this.color.setBlack(true); + this.color.setBlack(true); this.power = new MageInt(6); this.toughness = new MageInt(6); this.addAbility(FlyingAbility.getInstance()); diff --git a/Mage.Sets/src/mage/sets/scarsofmirrodin/CarrionCall.java b/Mage.Sets/src/mage/sets/scarsofmirrodin/CarrionCall.java index f7b9efb0f6..04d2a85a17 100644 --- a/Mage.Sets/src/mage/sets/scarsofmirrodin/CarrionCall.java +++ b/Mage.Sets/src/mage/sets/scarsofmirrodin/CarrionCall.java @@ -47,7 +47,7 @@ public class CarrionCall extends CardImpl { public CarrionCall (UUID ownerId) { super(ownerId, 115, "Carrion Call", Rarity.UNCOMMON, new CardType[]{CardType.INSTANT}, "{3}{G}"); this.expansionSetCode = "SOM"; - this.color.setGreen(true); + this.color.setGreen(true); this.getSpellAbility().addEffect(new CreateTokenEffect(new InsectToken(), 2)); } @@ -65,11 +65,11 @@ class InsectToken extends Token { public InsectToken() { super("Insect", "1/1 green Insect creature tokens with infect"); - cardType.add(CardType.CREATURE); - color = ObjectColor.GREEN; - subtype.add("Insect"); - power = new MageInt(1); - toughness = new MageInt(1); + cardType.add(CardType.CREATURE); + color = ObjectColor.GREEN; + subtype.add("Insect"); + power = new MageInt(1); + toughness = new MageInt(1); this.addAbility(InfectAbility.getInstance()); } } \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/scarsofmirrodin/CerebralEruption.java b/Mage.Sets/src/mage/sets/scarsofmirrodin/CerebralEruption.java index e4d8316498..66ffbab742 100644 --- a/Mage.Sets/src/mage/sets/scarsofmirrodin/CerebralEruption.java +++ b/Mage.Sets/src/mage/sets/scarsofmirrodin/CerebralEruption.java @@ -53,89 +53,89 @@ import java.util.UUID; */ public class CerebralEruption extends CardImpl { - public CerebralEruption(UUID ownerId) { - super(ownerId, 86, "Cerebral Eruption", Rarity.RARE, new CardType[]{CardType.SORCERY}, "{2}{R}{R}"); - this.expansionSetCode = "SOM"; - this.color.setRed(true); - this.getSpellAbility().addTarget(new TargetOpponent()); - this.getSpellAbility().addEffect(new CerebralEruptionEffect1()); - this.getSpellAbility().addEffect(new CerebralEruptionEffect2()); - } + public CerebralEruption(UUID ownerId) { + super(ownerId, 86, "Cerebral Eruption", Rarity.RARE, new CardType[]{CardType.SORCERY}, "{2}{R}{R}"); + this.expansionSetCode = "SOM"; + this.color.setRed(true); + this.getSpellAbility().addTarget(new TargetOpponent()); + this.getSpellAbility().addEffect(new CerebralEruptionEffect1()); + this.getSpellAbility().addEffect(new CerebralEruptionEffect2()); + } - public CerebralEruption(final CerebralEruption card) { - super(card); - } + public CerebralEruption(final CerebralEruption card) { + super(card); + } - @Override - public CerebralEruption copy() { - return new CerebralEruption(this); - } + @Override + public CerebralEruption copy() { + return new CerebralEruption(this); + } } class CerebralEruptionEffect1 extends OneShotEffect { - private static FilterPermanent filter = new FilterCreaturePermanent(); - - public CerebralEruptionEffect1() { - super(Outcome.Damage); - staticText = "Target opponent reveals the top card of his or her library. {this} deals damage equal to the revealed card's converted mana cost to that player and each creature he or she controls."; - } - - public CerebralEruptionEffect1(final CerebralEruptionEffect1 effect) { - super(effect); - } - - @Override - public boolean apply(Game game, Ability source) { - Player player = game.getPlayer(source.getFirstTarget()); - if (player != null && player.getLibrary().size() > 0) { - Card card = player.getLibrary().getFromTop(game); - Cards cards = new CardsImpl(); - cards.add(card); - player.revealCards("Cerebral Eruption", cards, game); - game.getState().setValue(source.getId().toString(), card); - int damage = card.getManaCost().convertedManaCost(); - player.damage(damage, source.getId(), game, false, true); - for (Permanent perm: game.getBattlefield().getAllActivePermanents(filter, player.getId(), game)) { - perm.damage(damage, source.getId(), game, true, false); - } - return true; - } - return false; - } + private static FilterPermanent filter = new FilterCreaturePermanent(); + + public CerebralEruptionEffect1() { + super(Outcome.Damage); + staticText = "Target opponent reveals the top card of his or her library. {this} deals damage equal to the revealed card's converted mana cost to that player and each creature he or she controls."; + } + + public CerebralEruptionEffect1(final CerebralEruptionEffect1 effect) { + super(effect); + } + + @Override + public boolean apply(Game game, Ability source) { + Player player = game.getPlayer(source.getFirstTarget()); + if (player != null && player.getLibrary().size() > 0) { + Card card = player.getLibrary().getFromTop(game); + Cards cards = new CardsImpl(); + cards.add(card); + player.revealCards("Cerebral Eruption", cards, game); + game.getState().setValue(source.getId().toString(), card); + int damage = card.getManaCost().convertedManaCost(); + player.damage(damage, source.getId(), game, false, true); + for (Permanent perm: game.getBattlefield().getAllActivePermanents(filter, player.getId(), game)) { + perm.damage(damage, source.getId(), game, true, false); + } + return true; + } + return false; + } + + @Override + public CerebralEruptionEffect1 copy() { + return new CerebralEruptionEffect1(this); + } - @Override - public CerebralEruptionEffect1 copy() { - return new CerebralEruptionEffect1(this); - } - } class CerebralEruptionEffect2 extends PostResolveEffect { - public CerebralEruptionEffect2() { - staticText = "If a land card is revealed this way, return {this} to its owner's hand"; - } - - public CerebralEruptionEffect2(final CerebralEruptionEffect2 effect) { - super(effect); - } - - @Override - public void postResolve(Card card, Ability source, UUID controllerId, Game game) { - Card revealed = (Card) game.getState().getValue(source.getId().toString()); - if (revealed != null && revealed.getCardType().contains(CardType.LAND)) { - card.moveToZone(Zone.HAND, source.getId(), game, false); - } - else { - card.moveToZone(Zone.GRAVEYARD, source.getId(), game, false); - } - } + public CerebralEruptionEffect2() { + staticText = "If a land card is revealed this way, return {this} to its owner's hand"; + } + + public CerebralEruptionEffect2(final CerebralEruptionEffect2 effect) { + super(effect); + } + + @Override + public void postResolve(Card card, Ability source, UUID controllerId, Game game) { + Card revealed = (Card) game.getState().getValue(source.getId().toString()); + if (revealed != null && revealed.getCardType().contains(CardType.LAND)) { + card.moveToZone(Zone.HAND, source.getId(), game, false); + } + else { + card.moveToZone(Zone.GRAVEYARD, source.getId(), game, false); + } + } + + @Override + public CerebralEruptionEffect2 copy() { + return new CerebralEruptionEffect2(this); + } - @Override - public CerebralEruptionEffect2 copy() { - return new CerebralEruptionEffect2(this); - } - } \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/scarsofmirrodin/CloneShell.java b/Mage.Sets/src/mage/sets/scarsofmirrodin/CloneShell.java index 9fc5f42dd9..495b03e606 100644 --- a/Mage.Sets/src/mage/sets/scarsofmirrodin/CloneShell.java +++ b/Mage.Sets/src/mage/sets/scarsofmirrodin/CloneShell.java @@ -53,132 +53,132 @@ import java.util.UUID; */ public class CloneShell extends CardImpl { - public CloneShell(UUID ownerId) { - super(ownerId, 143, "Clone Shell", Rarity.UNCOMMON, new CardType[]{CardType.ARTIFACT, CardType.CREATURE}, "{5}"); - this.expansionSetCode = "SOM"; - this.subtype.add("Shapeshifter"); + public CloneShell(UUID ownerId) { + super(ownerId, 143, "Clone Shell", Rarity.UNCOMMON, new CardType[]{CardType.ARTIFACT, CardType.CREATURE}, "{5}"); + this.expansionSetCode = "SOM"; + this.subtype.add("Shapeshifter"); - this.power = new MageInt(2); - this.toughness = new MageInt(2); + this.power = new MageInt(2); + this.toughness = new MageInt(2); - // Imprint - When Clone Shell enters the battlefield, look at the top four cards of your library, exile one face down, then put the rest on the bottom of your library in any order. - this.addAbility(new EntersBattlefieldTriggeredAbility(new CloneShellEffect(), false)); + // Imprint - When Clone Shell enters the battlefield, look at the top four cards of your library, exile one face down, then put the rest on the bottom of your library in any order. + this.addAbility(new EntersBattlefieldTriggeredAbility(new CloneShellEffect(), false)); - // When Clone Shell dies, turn the exiled card face up. If it's a creature card, put it onto the battlefield under your control. - this.addAbility(new DiesTriggeredAbility(new CloneShellDiesEffect())); - } + // When Clone Shell dies, turn the exiled card face up. If it's a creature card, put it onto the battlefield under your control. + this.addAbility(new DiesTriggeredAbility(new CloneShellDiesEffect())); + } - public CloneShell(final CloneShell card) { - super(card); - } + public CloneShell(final CloneShell card) { + super(card); + } - @Override - public CloneShell copy() { - return new CloneShell(this); - } + @Override + public CloneShell copy() { + return new CloneShell(this); + } } class CloneShellEffect extends OneShotEffect { - protected static FilterCard filter1 = new FilterCard("card to exile face down"); - protected static FilterCard filter2 = new FilterCard("card to put on the bottom of your library"); + protected static FilterCard filter1 = new FilterCard("card to exile face down"); + protected static FilterCard filter2 = new FilterCard("card to put on the bottom of your library"); - public CloneShellEffect() { - super(Constants.Outcome.Benefit); - staticText = "look at the top four cards of your library, exile one face down, then put the rest on the bottom of your library in any order"; - } + public CloneShellEffect() { + super(Constants.Outcome.Benefit); + staticText = "look at the top four cards of your library, exile one face down, then put the rest on the bottom of your library in any order"; + } - public CloneShellEffect(CloneShellEffect effect) { - super(effect); - } + public CloneShellEffect(CloneShellEffect effect) { + super(effect); + } - @Override - public boolean apply(Game game, Ability source) { - Player player = game.getPlayer(source.getControllerId()); - Cards cards = new CardsImpl(Constants.Zone.PICK); - int count = Math.min(player.getLibrary().size(), 4); - for (int i = 0; i < count; i++) { - Card card = player.getLibrary().removeFromTop(game); - cards.add(card); - game.setZone(card.getId(), Constants.Zone.PICK); - } + @Override + public boolean apply(Game game, Ability source) { + Player player = game.getPlayer(source.getControllerId()); + Cards cards = new CardsImpl(Constants.Zone.PICK); + int count = Math.min(player.getLibrary().size(), 4); + for (int i = 0; i < count; i++) { + Card card = player.getLibrary().removeFromTop(game); + cards.add(card); + game.setZone(card.getId(), Constants.Zone.PICK); + } - if (cards.size() == 0) { - return false; + if (cards.size() == 0) { + return false; - } - TargetCard target1 = new TargetCard(Constants.Zone.PICK, filter1); - if (player.choose(Constants.Outcome.Detriment, cards, target1, game)) { - Card card = cards.get(target1.getFirstTarget(), game); - if (card != null) { - cards.remove(card); - card.setFaceDown(true); - card.moveToExile(getId(), "Clone Shell (Imprint)", source.getSourceId(), game); - Permanent permanent = game.getPermanent(source.getSourceId()); - if (permanent != null) { - permanent.imprint(card.getId(), game); - } - } - target1.clearChosen(); - } + } + TargetCard target1 = new TargetCard(Constants.Zone.PICK, filter1); + if (player.choose(Constants.Outcome.Detriment, cards, target1, game)) { + Card card = cards.get(target1.getFirstTarget(), game); + if (card != null) { + cards.remove(card); + card.setFaceDown(true); + card.moveToExile(getId(), "Clone Shell (Imprint)", source.getSourceId(), game); + Permanent permanent = game.getPermanent(source.getSourceId()); + if (permanent != null) { + permanent.imprint(card.getId(), game); + } + } + target1.clearChosen(); + } - if (cards.size() > 0) { - TargetCard target2 = new TargetCard(Constants.Zone.PICK, filter2); - target2.setRequired(true); - while (cards.size() > 1) { - player.choose(Constants.Outcome.Benefit, cards, target2, game); - Card card = cards.get(target2.getFirstTarget(), game); - if (card != null) { - cards.remove(card); - card.moveToZone(Constants.Zone.LIBRARY, source.getId(), game, false); - } - target2.clearChosen(); - } - Card card = cards.get(cards.iterator().next(), game); - card.moveToZone(Constants.Zone.LIBRARY, source.getId(), game, true); - } + if (cards.size() > 0) { + TargetCard target2 = new TargetCard(Constants.Zone.PICK, filter2); + target2.setRequired(true); + while (cards.size() > 1) { + player.choose(Constants.Outcome.Benefit, cards, target2, game); + Card card = cards.get(target2.getFirstTarget(), game); + if (card != null) { + cards.remove(card); + card.moveToZone(Constants.Zone.LIBRARY, source.getId(), game, false); + } + target2.clearChosen(); + } + Card card = cards.get(cards.iterator().next(), game); + card.moveToZone(Constants.Zone.LIBRARY, source.getId(), game, true); + } - return true; - } + return true; + } - @Override - public CloneShellEffect copy() { - return new CloneShellEffect(this); - } + @Override + public CloneShellEffect copy() { + return new CloneShellEffect(this); + } } class CloneShellDiesEffect extends OneShotEffect { - public CloneShellDiesEffect() { - super(Constants.Outcome.Benefit); - staticText = "turn the exiled card face up. If it's a creature card, put it onto the battlefield under your control"; - } + public CloneShellDiesEffect() { + super(Constants.Outcome.Benefit); + staticText = "turn the exiled card face up. If it's a creature card, put it onto the battlefield under your control"; + } - public CloneShellDiesEffect(CloneShellDiesEffect effect) { - super(effect); - } + public CloneShellDiesEffect(CloneShellDiesEffect effect) { + super(effect); + } - @Override - public boolean apply(Game game, Ability source) { - Permanent permanent = (Permanent) game.getLastKnownInformation(source.getSourceId(), Constants.Zone.BATTLEFIELD); - if (permanent != null) { - List imprinted = permanent.getImprinted(); - if (imprinted.size() > 0) { - Card imprintedCard = game.getCard(imprinted.get(0)); - imprintedCard.setFaceDown(false); - if (imprintedCard.getCardType().contains(CardType.CREATURE)) { - imprintedCard.putOntoBattlefield(game, Constants.Zone.EXILED, source.getSourceId(), source.getControllerId()); - } - } - } + @Override + public boolean apply(Game game, Ability source) { + Permanent permanent = (Permanent) game.getLastKnownInformation(source.getSourceId(), Constants.Zone.BATTLEFIELD); + if (permanent != null) { + List imprinted = permanent.getImprinted(); + if (imprinted.size() > 0) { + Card imprintedCard = game.getCard(imprinted.get(0)); + imprintedCard.setFaceDown(false); + if (imprintedCard.getCardType().contains(CardType.CREATURE)) { + imprintedCard.putOntoBattlefield(game, Constants.Zone.EXILED, source.getSourceId(), source.getControllerId()); + } + } + } - return true; - } + return true; + } - @Override - public CloneShellDiesEffect copy() { - return new CloneShellDiesEffect(this); - } + @Override + public CloneShellDiesEffect copy() { + return new CloneShellDiesEffect(this); + } } diff --git a/Mage.Sets/src/mage/sets/scarsofmirrodin/ContagionClasp.java b/Mage.Sets/src/mage/sets/scarsofmirrodin/ContagionClasp.java index b55b1275b6..d115690843 100644 --- a/Mage.Sets/src/mage/sets/scarsofmirrodin/ContagionClasp.java +++ b/Mage.Sets/src/mage/sets/scarsofmirrodin/ContagionClasp.java @@ -53,14 +53,14 @@ public class ContagionClasp extends CardImpl { public ContagionClasp (UUID ownerId) { super(ownerId, 144, "Contagion Clasp", Rarity.UNCOMMON, new CardType[]{CardType.ARTIFACT}, "{2}"); this.expansionSetCode = "SOM"; - + // When Contagion Clasp enters the battlefield, put a -1/-1 counter on target creature. Ability ability = new EntersBattlefieldTriggeredAbility(new AddCountersTargetEffect(CounterType.M1M1.createInstance(), Outcome.UnboostCreature), false); TargetCreaturePermanent target = new TargetCreaturePermanent(); target.setRequired(true); ability.addTarget(target); this.addAbility(ability); - + /* {4}, {T}: Proliferate. (You choose any number of permanents and/or players * with counters on them, then give each another counter of a kind already there.) */ ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new ProliferateEffect(), new GenericManaCost(4)); diff --git a/Mage.Sets/src/mage/sets/scarsofmirrodin/ContagionEngine.java b/Mage.Sets/src/mage/sets/scarsofmirrodin/ContagionEngine.java index 96e6713db7..1b0d1386f0 100644 --- a/Mage.Sets/src/mage/sets/scarsofmirrodin/ContagionEngine.java +++ b/Mage.Sets/src/mage/sets/scarsofmirrodin/ContagionEngine.java @@ -59,11 +59,11 @@ public class ContagionEngine extends CardImpl { this.expansionSetCode = "SOM"; Ability ability = new EntersBattlefieldTriggeredAbility(new ContagionEngineEffect()); ability.addTarget(new TargetPlayer()); - this.addAbility(ability); - ability = new SimpleActivatedAbility(Constants.Zone.BATTLEFIELD, new ProliferateEffect(), new GenericManaCost(4)); - ability.addCost(new TapSourceCost()); - ability.addEffect(new ProliferateEffect()); - this.addAbility(ability); + this.addAbility(ability); + ability = new SimpleActivatedAbility(Constants.Zone.BATTLEFIELD, new ProliferateEffect(), new GenericManaCost(4)); + ability.addCost(new TapSourceCost()); + ability.addEffect(new ProliferateEffect()); + this.addAbility(ability); } public ContagionEngine (final ContagionEngine card) { @@ -78,30 +78,30 @@ public class ContagionEngine extends CardImpl { } class ContagionEngineEffect extends OneShotEffect { - ContagionEngineEffect() { - super(Constants.Outcome.UnboostCreature); - staticText = "put a -1/-1 counter on each creature target player controls"; - } + ContagionEngineEffect() { + super(Constants.Outcome.UnboostCreature); + staticText = "put a -1/-1 counter on each creature target player controls"; + } - ContagionEngineEffect(final ContagionEngineEffect effect) { - super(effect); - } + ContagionEngineEffect(final ContagionEngineEffect effect) { + super(effect); + } - @Override - public boolean apply(Game game, Ability source) { - Player target = game.getPlayer(source.getFirstTarget()); - if (target != null) { - for (Permanent p : game.getBattlefield().getAllActivePermanents(new FilterCreaturePermanent(), target.getId(), game)) { - p.addCounters(CounterType.M1M1.createInstance(), game); - } - return true; - } - return false; - } + @Override + public boolean apply(Game game, Ability source) { + Player target = game.getPlayer(source.getFirstTarget()); + if (target != null) { + for (Permanent p : game.getBattlefield().getAllActivePermanents(new FilterCreaturePermanent(), target.getId(), game)) { + p.addCounters(CounterType.M1M1.createInstance(), game); + } + return true; + } + return false; + } - @Override - public ContagionEngineEffect copy() { - return new ContagionEngineEffect(this); - } + @Override + public ContagionEngineEffect copy() { + return new ContagionEngineEffect(this); + } } \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/scarsofmirrodin/ContagiousNim.java b/Mage.Sets/src/mage/sets/scarsofmirrodin/ContagiousNim.java index 53a907a18f..993cd6f56b 100644 --- a/Mage.Sets/src/mage/sets/scarsofmirrodin/ContagiousNim.java +++ b/Mage.Sets/src/mage/sets/scarsofmirrodin/ContagiousNim.java @@ -45,7 +45,7 @@ public class ContagiousNim extends CardImpl { super(ownerId, 58, "Contagious Nim", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{2}{B}"); this.expansionSetCode = "SOM"; this.subtype.add("Zombie"); - this.color.setBlack(true); + this.color.setBlack(true); this.power = new MageInt(2); this.toughness = new MageInt(2); this.addAbility(InfectAbility.getInstance()); diff --git a/Mage.Sets/src/mage/sets/scarsofmirrodin/CopperhornScout.java b/Mage.Sets/src/mage/sets/scarsofmirrodin/CopperhornScout.java index e43aad8c2d..b887c150ff 100644 --- a/Mage.Sets/src/mage/sets/scarsofmirrodin/CopperhornScout.java +++ b/Mage.Sets/src/mage/sets/scarsofmirrodin/CopperhornScout.java @@ -50,86 +50,86 @@ import mage.game.permanent.Permanent; */ public class CopperhornScout extends CardImpl { - public CopperhornScout(UUID ownerId) { - super(ownerId, 116, "Copperhorn Scout", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{G}"); - this.expansionSetCode = "SOM"; - this.subtype.add("Elf"); - this.subtype.add("Scout"); + public CopperhornScout(UUID ownerId) { + super(ownerId, 116, "Copperhorn Scout", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{G}"); + this.expansionSetCode = "SOM"; + this.subtype.add("Elf"); + this.subtype.add("Scout"); - this.color.setGreen(true); - this.power = new MageInt(1); - this.toughness = new MageInt(1); + this.color.setGreen(true); + this.power = new MageInt(1); + this.toughness = new MageInt(1); - this.addAbility(new CopperhornScoutTriggeredAbility()); - } + this.addAbility(new CopperhornScoutTriggeredAbility()); + } - public CopperhornScout(final CopperhornScout card) { - super(card); - } + public CopperhornScout(final CopperhornScout card) { + super(card); + } - @Override - public CopperhornScout copy() { - return new CopperhornScout(this); - } + @Override + public CopperhornScout copy() { + return new CopperhornScout(this); + } } class CopperhornScoutTriggeredAbility extends TriggeredAbilityImpl { - public CopperhornScoutTriggeredAbility() { - super(Zone.BATTLEFIELD, new CopperhornScoutUntapEffect(), false); - } + public CopperhornScoutTriggeredAbility() { + super(Zone.BATTLEFIELD, new CopperhornScoutUntapEffect(), false); + } - public CopperhornScoutTriggeredAbility(final CopperhornScoutTriggeredAbility ability) { - super(ability); - } + public CopperhornScoutTriggeredAbility(final CopperhornScoutTriggeredAbility ability) { + super(ability); + } - @Override - public CopperhornScoutTriggeredAbility copy() { - return new CopperhornScoutTriggeredAbility(this); - } + @Override + public CopperhornScoutTriggeredAbility copy() { + return new CopperhornScoutTriggeredAbility(this); + } - @Override - public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == EventType.ATTACKER_DECLARED && event.getSourceId().equals(this.getSourceId())) { - return true; - } - return false; - } + @Override + public boolean checkTrigger(GameEvent event, Game game) { + if (event.getType() == EventType.ATTACKER_DECLARED && event.getSourceId().equals(this.getSourceId())) { + return true; + } + return false; + } - @Override - public String getRule() { - return "Whenever {this} attacks, untap each other creature you control."; - } + @Override + public String getRule() { + return "Whenever {this} attacks, untap each other creature you control."; + } } class CopperhornScoutUntapEffect extends OneShotEffect { - CopperhornScoutUntapEffect ( ) { - super(Outcome.Untap); - } + CopperhornScoutUntapEffect ( ) { + super(Outcome.Untap); + } - CopperhornScoutUntapEffect ( CopperhornScoutUntapEffect effect ) { - super(effect); - } + CopperhornScoutUntapEffect ( CopperhornScoutUntapEffect effect ) { + super(effect); + } - @Override - public boolean apply(Game game, Ability source) { - FilterControlledCreaturePermanent filter = new FilterControlledCreaturePermanent(); + @Override + public boolean apply(Game game, Ability source) { + FilterControlledCreaturePermanent filter = new FilterControlledCreaturePermanent(); - List creatures = game.getBattlefield().getActivePermanents(filter, source.getControllerId(), source.getSourceId(), game); + List creatures = game.getBattlefield().getActivePermanents(filter, source.getControllerId(), source.getSourceId(), game); - for ( Permanent creature : creatures ) { - if ( !creature.getId().equals(source.getSourceId()) ) { - creature.untap(game); - } - } + for ( Permanent creature : creatures ) { + if ( !creature.getId().equals(source.getSourceId()) ) { + creature.untap(game); + } + } - return true; - } + return true; + } - @Override - public CopperhornScoutUntapEffect copy() { - return new CopperhornScoutUntapEffect(this); - } + @Override + public CopperhornScoutUntapEffect copy() { + return new CopperhornScoutUntapEffect(this); + } } diff --git a/Mage.Sets/src/mage/sets/scarsofmirrodin/CopperlineGorge.java b/Mage.Sets/src/mage/sets/scarsofmirrodin/CopperlineGorge.java index 1821abfc8c..1d35b8d77a 100644 --- a/Mage.Sets/src/mage/sets/scarsofmirrodin/CopperlineGorge.java +++ b/Mage.Sets/src/mage/sets/scarsofmirrodin/CopperlineGorge.java @@ -49,22 +49,22 @@ import mage.filter.common.FilterLandPermanent; */ public class CopperlineGorge extends CardImpl { - private static FilterLandPermanent filter = new FilterLandPermanent(); + private static FilterLandPermanent filter = new FilterLandPermanent(); + + static { + filter.setScopeSubtype(ComparisonScope.Any); + filter.setMessage("lands"); + } - static { - filter.setScopeSubtype(ComparisonScope.Any); - filter.setMessage("lands"); - } - public CopperlineGorge (UUID ownerId) { super(ownerId, 225, "Copperline Gorge", Rarity.RARE, new CardType[]{CardType.LAND}, null); this.expansionSetCode = "SOM"; Condition controls = new UnlessCondition(new ControlsPermanentCondition(filter, ControlsPermanentCondition.CountType.FEWER_THAN, 4)); - String abilityText = "tap it unless you control fewer than 3 " + filter.getMessage(); - this.addAbility(new EntersBattlefieldAbility(new ConditionalOneShotEffect(new TapSourceEffect(), controls, abilityText), abilityText)); - this.addAbility(new RedManaAbility()); - this.addAbility(new GreenManaAbility()); + String abilityText = "tap it unless you control fewer than 3 " + filter.getMessage(); + this.addAbility(new EntersBattlefieldAbility(new ConditionalOneShotEffect(new TapSourceEffect(), controls, abilityText), abilityText)); + this.addAbility(new RedManaAbility()); + this.addAbility(new GreenManaAbility()); } public CopperlineGorge (final CopperlineGorge card) { diff --git a/Mage.Sets/src/mage/sets/scarsofmirrodin/CorpseCur.java b/Mage.Sets/src/mage/sets/scarsofmirrodin/CorpseCur.java index c14bdcfa7c..66f624caa6 100644 --- a/Mage.Sets/src/mage/sets/scarsofmirrodin/CorpseCur.java +++ b/Mage.Sets/src/mage/sets/scarsofmirrodin/CorpseCur.java @@ -48,11 +48,11 @@ public class CorpseCur extends CardImpl { private static final FilterCard filter = new FilterCard("creature card with infect from your graveyard"); - static { - filter.getAbilities().add(InfectAbility.getInstance()); - filter.setNotAbilities(false); + static { + filter.getAbilities().add(InfectAbility.getInstance()); + filter.setNotAbilities(false); - } + } public CorpseCur (UUID ownerId) { super(ownerId, 147, "Corpse Cur", Rarity.COMMON, new CardType[]{CardType.ARTIFACT, CardType.CREATURE}, "{4}"); diff --git a/Mage.Sets/src/mage/sets/scarsofmirrodin/CorruptedHarvester.java b/Mage.Sets/src/mage/sets/scarsofmirrodin/CorruptedHarvester.java index 53836bca5a..168b999d65 100644 --- a/Mage.Sets/src/mage/sets/scarsofmirrodin/CorruptedHarvester.java +++ b/Mage.Sets/src/mage/sets/scarsofmirrodin/CorruptedHarvester.java @@ -51,7 +51,7 @@ public class CorruptedHarvester extends CardImpl { super(ownerId, 59, "Corrupted Harvester", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{4}{B}{B}"); this.expansionSetCode = "SOM"; this.subtype.add("Horror"); - this.color.setBlack(true); + this.color.setBlack(true); this.power = new MageInt(6); this.toughness = new MageInt(3); Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new RegenerateSourceEffect(), new ManaCostsImpl("{B}")); diff --git a/Mage.Sets/src/mage/sets/scarsofmirrodin/DarkslickDrake.java b/Mage.Sets/src/mage/sets/scarsofmirrodin/DarkslickDrake.java index 883309d325..1e0191db57 100644 --- a/Mage.Sets/src/mage/sets/scarsofmirrodin/DarkslickDrake.java +++ b/Mage.Sets/src/mage/sets/scarsofmirrodin/DarkslickDrake.java @@ -48,7 +48,7 @@ public class DarkslickDrake extends CardImpl { super(ownerId, 30, "Darkslick Drake", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{2}{U}{U}"); this.expansionSetCode = "SOM"; this.subtype.add("Drake"); - this.color.setBlue(true); + this.color.setBlue(true); this.power = new MageInt(2); this.toughness = new MageInt(4); this.addAbility(FlyingAbility.getInstance()); diff --git a/Mage.Sets/src/mage/sets/scarsofmirrodin/DarkslickShores.java b/Mage.Sets/src/mage/sets/scarsofmirrodin/DarkslickShores.java index 634655a47b..478c7a8d9b 100644 --- a/Mage.Sets/src/mage/sets/scarsofmirrodin/DarkslickShores.java +++ b/Mage.Sets/src/mage/sets/scarsofmirrodin/DarkslickShores.java @@ -49,22 +49,22 @@ import mage.filter.common.FilterLandPermanent; */ public class DarkslickShores extends CardImpl { - private static FilterLandPermanent filter = new FilterLandPermanent(); + private static FilterLandPermanent filter = new FilterLandPermanent(); + + static { + filter.setScopeSubtype(ComparisonScope.Any); + filter.setMessage("lands"); + } - static { - filter.setScopeSubtype(ComparisonScope.Any); - filter.setMessage("lands"); - } - public DarkslickShores (UUID ownerId) { super(ownerId, 226, "Darkslick Shores", Rarity.RARE, new CardType[]{CardType.LAND}, null); this.expansionSetCode = "SOM"; Condition controls = new UnlessCondition(new ControlsPermanentCondition(filter, ControlsPermanentCondition.CountType.FEWER_THAN, 4)); - String abilityText = "tap it unless you control fewer than 3 " + filter.getMessage(); - this.addAbility(new EntersBattlefieldAbility(new ConditionalOneShotEffect(new TapSourceEffect(), controls, abilityText), abilityText)); - this.addAbility(new BlueManaAbility()); - this.addAbility(new BlackManaAbility()); + String abilityText = "tap it unless you control fewer than 3 " + filter.getMessage(); + this.addAbility(new EntersBattlefieldAbility(new ConditionalOneShotEffect(new TapSourceEffect(), controls, abilityText), abilityText)); + this.addAbility(new BlueManaAbility()); + this.addAbility(new BlackManaAbility()); } public DarkslickShores (final DarkslickShores card) { diff --git a/Mage.Sets/src/mage/sets/scarsofmirrodin/DarksteelJuggernaut.java b/Mage.Sets/src/mage/sets/scarsofmirrodin/DarksteelJuggernaut.java index d7c1d6f400..51ad787452 100644 --- a/Mage.Sets/src/mage/sets/scarsofmirrodin/DarksteelJuggernaut.java +++ b/Mage.Sets/src/mage/sets/scarsofmirrodin/DarksteelJuggernaut.java @@ -60,7 +60,7 @@ public class DarksteelJuggernaut extends CardImpl { this.subtype.add("Juggernaut"); this.power = new MageInt(0); this.toughness = new MageInt(0); - + SetPowerToughnessSourceEffect effect = new SetPowerToughnessSourceEffect(new PermanentsOnBattlefieldCount(filter), Constants.Duration.EndOfGame); this.addAbility(new SimpleStaticAbility(Constants.Zone.ALL, effect)); this.addAbility(IndestructibleAbility.getInstance()); diff --git a/Mage.Sets/src/mage/sets/scarsofmirrodin/DispenseJustice.java b/Mage.Sets/src/mage/sets/scarsofmirrodin/DispenseJustice.java index 00daa3b702..ca1eec1870 100644 --- a/Mage.Sets/src/mage/sets/scarsofmirrodin/DispenseJustice.java +++ b/Mage.Sets/src/mage/sets/scarsofmirrodin/DispenseJustice.java @@ -50,11 +50,11 @@ public class DispenseJustice extends CardImpl { public DispenseJustice (UUID ownerId) { super(ownerId, 5, "Dispense Justice", Rarity.UNCOMMON, new CardType[]{CardType.INSTANT}, "{2}{W}"); this.expansionSetCode = "SOM"; - - this.color.setWhite(true); + + this.color.setWhite(true); this.getSpellAbility().addEffect(new DispenseJusticeEffect()); - this.getSpellAbility().addTarget(new TargetPlayer()); + this.getSpellAbility().addTarget(new TargetPlayer()); } public DispenseJustice (final DispenseJustice card) { @@ -70,39 +70,39 @@ public class DispenseJustice extends CardImpl { class DispenseJusticeEffect extends OneShotEffect { - private static final String effectText = "Target player sacrifices an attacking creature.\r\n\r\n" - + "Metalcraft - That player sacrifices two attacking creatures instead if you control three or more artifacts"; + private static final String effectText = "Target player sacrifices an attacking creature.\r\n\r\n" + + "Metalcraft - That player sacrifices two attacking creatures instead if you control three or more artifacts"; - private static final FilterCreaturePermanent filter; + private static final FilterCreaturePermanent filter; - static { - filter = new FilterCreaturePermanent(); - filter.setUseAttacking(true); - filter.setAttacking(true); - } + static { + filter = new FilterCreaturePermanent(); + filter.setUseAttacking(true); + filter.setAttacking(true); + } - DispenseJusticeEffect ( ) { - super(Outcome.Sacrifice); - staticText = effectText; - } + DispenseJusticeEffect ( ) { + super(Outcome.Sacrifice); + staticText = effectText; + } - DispenseJusticeEffect ( DispenseJusticeEffect effect ) { - super(effect); - } + DispenseJusticeEffect ( DispenseJusticeEffect effect ) { + super(effect); + } - @Override - public boolean apply(Game game, Ability source) { - if ( MetalcraftCondition.getInstance().apply(game, source) ) { - return new SacrificeEffect(filter, 2, effectText).apply(game, source); - } - else { - return new SacrificeEffect(filter, 1, effectText).apply(game, source); - } - } + @Override + public boolean apply(Game game, Ability source) { + if ( MetalcraftCondition.getInstance().apply(game, source) ) { + return new SacrificeEffect(filter, 2, effectText).apply(game, source); + } + else { + return new SacrificeEffect(filter, 1, effectText).apply(game, source); + } + } - @Override - public DispenseJusticeEffect copy() { - return new DispenseJusticeEffect(this); - } + @Override + public DispenseJusticeEffect copy() { + return new DispenseJusticeEffect(this); + } } diff --git a/Mage.Sets/src/mage/sets/scarsofmirrodin/Disperse.java b/Mage.Sets/src/mage/sets/scarsofmirrodin/Disperse.java index 379ca58710..a942a8374f 100644 --- a/Mage.Sets/src/mage/sets/scarsofmirrodin/Disperse.java +++ b/Mage.Sets/src/mage/sets/scarsofmirrodin/Disperse.java @@ -46,7 +46,7 @@ public class Disperse extends CardImpl { this.expansionSetCode = "SOM"; this.color.setBlue(true); - this.getSpellAbility().addTarget(new TargetNonlandPermanent()); + this.getSpellAbility().addTarget(new TargetNonlandPermanent()); this.getSpellAbility().addEffect(new ReturnToHandTargetEffect()); } diff --git a/Mage.Sets/src/mage/sets/scarsofmirrodin/DrossHopper.java b/Mage.Sets/src/mage/sets/scarsofmirrodin/DrossHopper.java index 45d63df699..fdf6d9049c 100644 --- a/Mage.Sets/src/mage/sets/scarsofmirrodin/DrossHopper.java +++ b/Mage.Sets/src/mage/sets/scarsofmirrodin/DrossHopper.java @@ -52,7 +52,7 @@ public class DrossHopper extends CardImpl { this.expansionSetCode = "SOM"; this.subtype.add("Insect"); this.subtype.add("Horror"); - this.color.setBlack(true); + this.color.setBlack(true); this.power = new MageInt(2); this.toughness = new MageInt(1); this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, diff --git a/Mage.Sets/src/mage/sets/scarsofmirrodin/EchoCirclet.java b/Mage.Sets/src/mage/sets/scarsofmirrodin/EchoCirclet.java index 5600b90dbe..a5ce7b2d70 100644 --- a/Mage.Sets/src/mage/sets/scarsofmirrodin/EchoCirclet.java +++ b/Mage.Sets/src/mage/sets/scarsofmirrodin/EchoCirclet.java @@ -46,70 +46,70 @@ import java.util.UUID; */ public class EchoCirclet extends CardImpl { - public EchoCirclet(UUID ownerId) { - super(ownerId, 153, "Echo Circlet", Rarity.COMMON, new CardType[]{CardType.ARTIFACT}, "{2}"); - this.expansionSetCode = "SOM"; - this.subtype.add("Equipment"); + public EchoCirclet(UUID ownerId) { + super(ownerId, 153, "Echo Circlet", Rarity.COMMON, new CardType[]{CardType.ARTIFACT}, "{2}"); + this.expansionSetCode = "SOM"; + this.subtype.add("Equipment"); - this.addAbility(new EquipAbility(Constants.Outcome.AddAbility, new GenericManaCost(1))); - // Equipped creature can block an additional creature. - this.addAbility(new SimpleStaticAbility(Constants.Zone.BATTLEFIELD, new EchoCircletEffect())); - } + this.addAbility(new EquipAbility(Constants.Outcome.AddAbility, new GenericManaCost(1))); + // Equipped creature can block an additional creature. + this.addAbility(new SimpleStaticAbility(Constants.Zone.BATTLEFIELD, new EchoCircletEffect())); + } - public EchoCirclet(final EchoCirclet card) { - super(card); - } + public EchoCirclet(final EchoCirclet card) { + super(card); + } - @Override - public EchoCirclet copy() { - return new EchoCirclet(this); - } + @Override + public EchoCirclet copy() { + return new EchoCirclet(this); + } } class EchoCircletEffect extends ContinuousEffectImpl { - public EchoCircletEffect() { - super(Constants.Duration.WhileOnBattlefield, Constants.Outcome.Benefit); - staticText = "Equipped creature can block an additional creature"; - } + public EchoCircletEffect() { + super(Constants.Duration.WhileOnBattlefield, Constants.Outcome.Benefit); + staticText = "Equipped creature can block an additional creature"; + } - public EchoCircletEffect(final EchoCircletEffect effect) { - super(effect); - } + public EchoCircletEffect(final EchoCircletEffect effect) { + super(effect); + } - @Override - public EchoCircletEffect copy() { - return new EchoCircletEffect(this); - } + @Override + public EchoCircletEffect copy() { + return new EchoCircletEffect(this); + } - @Override - public boolean apply(Constants.Layer layer, Constants.SubLayer sublayer, Ability source, Game game) { - Permanent perm = game.getPermanent(source.getSourceId()); - if (perm != null && perm.getAttachedTo() != null) { - Permanent equipped = game.getPermanent(perm.getAttachedTo()); - if (equipped != null) { - switch (layer) { - case RulesEffects: - // maxBlocks = 0 equals to "can block any number of creatures" - if (equipped.getMaxBlocks() > 0) { - equipped.setMaxBlocks(equipped.getMaxBlocks() + 1); - } - break; - } - return true; - } - } - return false; - } + @Override + public boolean apply(Constants.Layer layer, Constants.SubLayer sublayer, Ability source, Game game) { + Permanent perm = game.getPermanent(source.getSourceId()); + if (perm != null && perm.getAttachedTo() != null) { + Permanent equipped = game.getPermanent(perm.getAttachedTo()); + if (equipped != null) { + switch (layer) { + case RulesEffects: + // maxBlocks = 0 equals to "can block any number of creatures" + if (equipped.getMaxBlocks() > 0) { + equipped.setMaxBlocks(equipped.getMaxBlocks() + 1); + } + break; + } + return true; + } + } + return false; + } - @Override - public boolean apply(Game game, Ability source) { - return false; - } + @Override + public boolean apply(Game game, Ability source) { + return false; + } - @Override - public boolean hasLayer(Constants.Layer layer) { - return layer == Constants.Layer.RulesEffects; - } + @Override + public boolean hasLayer(Constants.Layer layer) { + return layer == Constants.Layer.RulesEffects; + } } diff --git a/Mage.Sets/src/mage/sets/scarsofmirrodin/ElspethTirel.java b/Mage.Sets/src/mage/sets/scarsofmirrodin/ElspethTirel.java index 74af93e1ed..c5aac78e33 100644 --- a/Mage.Sets/src/mage/sets/scarsofmirrodin/ElspethTirel.java +++ b/Mage.Sets/src/mage/sets/scarsofmirrodin/ElspethTirel.java @@ -58,10 +58,10 @@ public class ElspethTirel extends CardImpl { super(ownerId, 6, "Elspeth Tirel", Rarity.MYTHIC, new CardType[]{CardType.PLANESWALKER}, "{3}{W}{W}"); this.expansionSetCode = "SOM"; this.subtype.add("Elspeth"); - this.color.setWhite(true); + this.color.setWhite(true); this.addAbility(new EntersBattlefieldAbility(new AddCountersSourceEffect(CounterType.LOYALTY.createInstance(4)), "")); - + this.addAbility(new LoyaltyAbility(new ElspethTirelFirstEffect(), 2)); this.addAbility(new LoyaltyAbility(new CreateTokenEffect(new SoldierToken(), 3), -2)); this.addAbility(new LoyaltyAbility(new ElspethTirelThirdEffect(), -5)); @@ -91,10 +91,10 @@ class ElspethTirelFirstEffect extends OneShotEffect { public boolean apply(Game game, Ability source) { int amount = game.getBattlefield().countAll(new FilterCreaturePermanent(), source.getControllerId(), game); Player player = game.getPlayer(source.getControllerId()); - if (player != null) { - player.gainLife(amount, game); - } - return true; + if (player != null) { + player.gainLife(amount, game); + } + return true; } @Override @@ -117,9 +117,9 @@ class ElspethTirelThirdEffect extends OneShotEffect { @Override public boolean apply(Game game, Ability source) { for (Permanent perm: game.getBattlefield().getActivePermanents(source.getControllerId(), game)) { - if (!perm.getId().equals(source.getSourceId()) && !(perm instanceof PermanentToken) && ! (perm.getCardType().contains(CardType.LAND))) - perm.destroy(source.getId(), game, false); - } + if (!perm.getId().equals(source.getSourceId()) && !(perm instanceof PermanentToken) && ! (perm.getCardType().contains(CardType.LAND))) + perm.destroy(source.getId(), game, false); + } return true; } diff --git a/Mage.Sets/src/mage/sets/scarsofmirrodin/EngulfingSlagwurm.java b/Mage.Sets/src/mage/sets/scarsofmirrodin/EngulfingSlagwurm.java index 2ecaa50324..004e057896 100644 --- a/Mage.Sets/src/mage/sets/scarsofmirrodin/EngulfingSlagwurm.java +++ b/Mage.Sets/src/mage/sets/scarsofmirrodin/EngulfingSlagwurm.java @@ -53,7 +53,7 @@ public class EngulfingSlagwurm extends CardImpl { super(ownerId, 118, "Engulfing Slagwurm", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{5}{G}{G}"); this.expansionSetCode = "SOM"; this.subtype.add("Wurm"); - this.color.setGreen(true); + this.color.setGreen(true); this.power = new MageInt(7); this.toughness = new MageInt(7); diff --git a/Mage.Sets/src/mage/sets/scarsofmirrodin/EtchedChampion.java b/Mage.Sets/src/mage/sets/scarsofmirrodin/EtchedChampion.java index 90b6311551..5a9ba173c3 100644 --- a/Mage.Sets/src/mage/sets/scarsofmirrodin/EtchedChampion.java +++ b/Mage.Sets/src/mage/sets/scarsofmirrodin/EtchedChampion.java @@ -69,7 +69,7 @@ public class EtchedChampion extends CardImpl { this.power = new MageInt(2); this.toughness = new MageInt(2); - + ContinuousEffect effect = new GainAbilitySourceEffect(new ProtectionAbility(filter), Duration.WhileOnBattlefield); this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new ConditionalContinousEffect(effect, MetalcraftCondition.getInstance(), ruleText))); } diff --git a/Mage.Sets/src/mage/sets/scarsofmirrodin/Exsanguinate.java b/Mage.Sets/src/mage/sets/scarsofmirrodin/Exsanguinate.java index 988195b9da..3d6bc64f59 100644 --- a/Mage.Sets/src/mage/sets/scarsofmirrodin/Exsanguinate.java +++ b/Mage.Sets/src/mage/sets/scarsofmirrodin/Exsanguinate.java @@ -47,7 +47,7 @@ public class Exsanguinate extends CardImpl { public Exsanguinate (UUID ownerId) { super(ownerId, 61, "Exsanguinate", Rarity.UNCOMMON, new CardType[]{CardType.SORCERY}, "{X}{B}{B}"); this.expansionSetCode = "SOM"; - this.color.setBlack(true); + this.color.setBlack(true); this.getSpellAbility().addEffect(new ExsanguinateEffect()); } diff --git a/Mage.Sets/src/mage/sets/scarsofmirrodin/EzuriRenegadeLeader.java b/Mage.Sets/src/mage/sets/scarsofmirrodin/EzuriRenegadeLeader.java index b6523e5861..2f4bcff946 100644 --- a/Mage.Sets/src/mage/sets/scarsofmirrodin/EzuriRenegadeLeader.java +++ b/Mage.Sets/src/mage/sets/scarsofmirrodin/EzuriRenegadeLeader.java @@ -51,48 +51,48 @@ import mage.target.common.TargetControlledCreaturePermanent; */ public class EzuriRenegadeLeader extends CardImpl { - private static final FilterCreaturePermanent elfFilter = new FilterCreaturePermanent(); - private static final FilterControlledCreaturePermanent notEzuri = new FilterControlledCreaturePermanent(); + private static final FilterCreaturePermanent elfFilter = new FilterCreaturePermanent(); + private static final FilterControlledCreaturePermanent notEzuri = new FilterControlledCreaturePermanent(); - static { - elfFilter.getSubtype().add("Elf"); - elfFilter.setMessage("Elf creatures"); + static { + elfFilter.getSubtype().add("Elf"); + elfFilter.setMessage("Elf creatures"); - notEzuri.getSubtype().add("Elf"); - notEzuri.getName().add("Ezuri, Renegade Leader"); - notEzuri.setNotName(true); - } + notEzuri.getSubtype().add("Elf"); + notEzuri.getName().add("Ezuri, Renegade Leader"); + notEzuri.setNotName(true); + } - public EzuriRenegadeLeader(UUID ownerId) { - super(ownerId, 119, "Ezuri, Renegade Leader", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{1}{G}{G}"); - this.expansionSetCode = "SOM"; - this.supertype.add("Legendary"); - this.subtype.add("Elf"); - this.subtype.add("Warrior"); + public EzuriRenegadeLeader(UUID ownerId) { + super(ownerId, 119, "Ezuri, Renegade Leader", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{1}{G}{G}"); + this.expansionSetCode = "SOM"; + this.supertype.add("Legendary"); + this.subtype.add("Elf"); + this.subtype.add("Warrior"); - this.color.setGreen(true); - this.power = new MageInt(2); - this.toughness = new MageInt(2); + this.color.setGreen(true); + this.power = new MageInt(2); + this.toughness = new MageInt(2); - Ability ezuriRegen = new SimpleActivatedAbility(Zone.BATTLEFIELD, new RegenerateTargetEffect(), new ManaCostsImpl("{G}")); - TargetControlledCreaturePermanent regenTarget = new TargetControlledCreaturePermanent(1, 1, notEzuri, false); - regenTarget.setTargetName("another target Elf"); - ezuriRegen.addTarget(regenTarget); - this.addAbility(ezuriRegen); + Ability ezuriRegen = new SimpleActivatedAbility(Zone.BATTLEFIELD, new RegenerateTargetEffect(), new ManaCostsImpl("{G}")); + TargetControlledCreaturePermanent regenTarget = new TargetControlledCreaturePermanent(1, 1, notEzuri, false); + regenTarget.setTargetName("another target Elf"); + ezuriRegen.addTarget(regenTarget); + this.addAbility(ezuriRegen); - Ability ezuriBoost = new SimpleActivatedAbility(Zone.BATTLEFIELD, - new BoostControlledEffect(3, 3, Duration.EndOfTurn, elfFilter, false), - new ManaCostsImpl("{2}{G}{G}{G}")); - ezuriBoost.addEffect(new GainAbilityControlledEffect(TrampleAbility.getInstance(), Duration.EndOfTurn, elfFilter)); - this.addAbility(ezuriBoost); - } + Ability ezuriBoost = new SimpleActivatedAbility(Zone.BATTLEFIELD, + new BoostControlledEffect(3, 3, Duration.EndOfTurn, elfFilter, false), + new ManaCostsImpl("{2}{G}{G}{G}")); + ezuriBoost.addEffect(new GainAbilityControlledEffect(TrampleAbility.getInstance(), Duration.EndOfTurn, elfFilter)); + this.addAbility(ezuriBoost); + } - public EzuriRenegadeLeader(final EzuriRenegadeLeader card) { - super(card); - } + public EzuriRenegadeLeader(final EzuriRenegadeLeader card) { + super(card); + } - @Override - public EzuriRenegadeLeader copy() { - return new EzuriRenegadeLeader(this); - } + @Override + public EzuriRenegadeLeader copy() { + return new EzuriRenegadeLeader(this); + } } diff --git a/Mage.Sets/src/mage/sets/scarsofmirrodin/EzurisBrigade.java b/Mage.Sets/src/mage/sets/scarsofmirrodin/EzurisBrigade.java index 6f22e1f65c..a25f0c674e 100644 --- a/Mage.Sets/src/mage/sets/scarsofmirrodin/EzurisBrigade.java +++ b/Mage.Sets/src/mage/sets/scarsofmirrodin/EzurisBrigade.java @@ -56,7 +56,7 @@ public class EzurisBrigade extends CardImpl { this.expansionSetCode = "SOM"; this.subtype.add("Elf"); this.subtype.add("Warrior"); - this.color.setGreen(true); + this.color.setGreen(true); this.power = new MageInt(4); this.toughness = new MageInt(4); ContinuousEffect boostSource = new BoostSourceEffect(4, 4, Duration.WhileOnBattlefield); diff --git a/Mage.Sets/src/mage/sets/scarsofmirrodin/Ferrovore.java b/Mage.Sets/src/mage/sets/scarsofmirrodin/Ferrovore.java index 14a132bb4a..090989aff7 100644 --- a/Mage.Sets/src/mage/sets/scarsofmirrodin/Ferrovore.java +++ b/Mage.Sets/src/mage/sets/scarsofmirrodin/Ferrovore.java @@ -60,8 +60,8 @@ public class Ferrovore extends CardImpl { super(ownerId, 88, "Ferrovore", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{2}{R}"); this.expansionSetCode = "SOM"; this.subtype.add("Beast"); - - this.color.setRed(true); + + this.color.setRed(true); this.power = new MageInt(2); this.toughness = new MageInt(2); Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new BoostSourceEffect(3, 0, Duration.EndOfTurn), new ManaCostsImpl("{R}")); diff --git a/Mage.Sets/src/mage/sets/scarsofmirrodin/FlamebornHellion.java b/Mage.Sets/src/mage/sets/scarsofmirrodin/FlamebornHellion.java index c17cecd557..d6bcf7b925 100644 --- a/Mage.Sets/src/mage/sets/scarsofmirrodin/FlamebornHellion.java +++ b/Mage.Sets/src/mage/sets/scarsofmirrodin/FlamebornHellion.java @@ -46,8 +46,8 @@ public class FlamebornHellion extends CardImpl { super(ownerId, 89, "Flameborn Hellion", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{5}{R}"); this.expansionSetCode = "SOM"; this.subtype.add("Hellion"); - - this.color.setRed(true); + + this.color.setRed(true); this.power = new MageInt(5); this.toughness = new MageInt(4); this.addAbility(HasteAbility.getInstance()); diff --git a/Mage.Sets/src/mage/sets/scarsofmirrodin/FleshAllergy.java b/Mage.Sets/src/mage/sets/scarsofmirrodin/FleshAllergy.java index da571b5fd5..898a4f629f 100644 --- a/Mage.Sets/src/mage/sets/scarsofmirrodin/FleshAllergy.java +++ b/Mage.Sets/src/mage/sets/scarsofmirrodin/FleshAllergy.java @@ -60,12 +60,12 @@ public class FleshAllergy extends CardImpl { public FleshAllergy (UUID ownerId) { super(ownerId, 62, "Flesh Allergy", Rarity.UNCOMMON, new CardType[]{CardType.SORCERY}, "{2}{B}{B}"); this.expansionSetCode = "SOM"; - this.color.setBlack(true); - this.getSpellAbility().addCost(new SacrificeTargetCost(new TargetControlledCreaturePermanent())); - this.getSpellAbility().addEffect(new DestroyTargetEffect()); - this.getSpellAbility().addTarget(new TargetCreaturePermanent()); - this.getSpellAbility().addEffect(new FleshAllergyEffect()); - this.addWatcher(new FleshAllergyWatcher()); + this.color.setBlack(true); + this.getSpellAbility().addCost(new SacrificeTargetCost(new TargetControlledCreaturePermanent())); + this.getSpellAbility().addEffect(new DestroyTargetEffect()); + this.getSpellAbility().addTarget(new TargetCreaturePermanent()); + this.getSpellAbility().addEffect(new FleshAllergyEffect()); + this.addWatcher(new FleshAllergyWatcher()); } public FleshAllergy (final FleshAllergy card) { @@ -80,57 +80,57 @@ public class FleshAllergy extends CardImpl { class FleshAllergyWatcher extends WatcherImpl { - public int creaturesDiedThisTurn = 0; + public int creaturesDiedThisTurn = 0; - public FleshAllergyWatcher() { - super("CreaturesDied", WatcherScope.GAME); - } + public FleshAllergyWatcher() { + super("CreaturesDied", WatcherScope.GAME); + } - public FleshAllergyWatcher(final FleshAllergyWatcher watcher) { - super(watcher); - } + public FleshAllergyWatcher(final FleshAllergyWatcher watcher) { + super(watcher); + } - @Override - public FleshAllergyWatcher copy() { - return new FleshAllergyWatcher(this); - } + @Override + public FleshAllergyWatcher copy() { + return new FleshAllergyWatcher(this); + } - @Override - public void watch(GameEvent event, Game game) { - if (event.getType() == EventType.ZONE_CHANGE && ((ZoneChangeEvent)event).isDiesEvent()) { + @Override + public void watch(GameEvent event, Game game) { + if (event.getType() == EventType.ZONE_CHANGE && ((ZoneChangeEvent)event).isDiesEvent()) { MageObject card = game.getLastKnownInformation(event.getTargetId(), Zone.BATTLEFIELD); if (card != null && card.getCardType().contains(CardType.CREATURE)) { creaturesDiedThisTurn++; } - } - } + } + } - @Override - public void reset() { - super.reset(); - creaturesDiedThisTurn = 0; - } + @Override + public void reset() { + super.reset(); + creaturesDiedThisTurn = 0; + } } class FleshAllergyEffect extends OneShotEffect { - public FleshAllergyEffect() { - super(Outcome.DestroyPermanent); - staticText = "Its controller loses life equal to the number of creatures that died this turn"; - } + public FleshAllergyEffect() { + super(Outcome.DestroyPermanent); + staticText = "Its controller loses life equal to the number of creatures that died this turn"; + } - public FleshAllergyEffect(final FleshAllergyEffect effect) { - super(effect); - } + public FleshAllergyEffect(final FleshAllergyEffect effect) { + super(effect); + } - @Override - public FleshAllergyEffect copy() { - return new FleshAllergyEffect(this); - } + @Override + public FleshAllergyEffect copy() { + return new FleshAllergyEffect(this); + } - @Override - public boolean apply(Game game, Ability source) { + @Override + public boolean apply(Game game, Ability source) { FleshAllergyWatcher watcher = (FleshAllergyWatcher) game.getState().getWatchers().get("CreaturesDied"); MageObject card = game.getLastKnownInformation(source.getFirstTarget(), Zone.BATTLEFIELD); if (card != null && watcher != null) { @@ -143,7 +143,7 @@ class FleshAllergyEffect extends OneShotEffect { } } } - return false; - } + return false; + } } diff --git a/Mage.Sets/src/mage/sets/scarsofmirrodin/Forest1.java b/Mage.Sets/src/mage/sets/scarsofmirrodin/Forest1.java index fe03e31fd3..f4e9d64212 100644 --- a/Mage.Sets/src/mage/sets/scarsofmirrodin/Forest1.java +++ b/Mage.Sets/src/mage/sets/scarsofmirrodin/Forest1.java @@ -36,16 +36,16 @@ import java.util.UUID; public class Forest1 extends mage.cards.basiclands.Forest { public Forest1(UUID ownerId) { - super(ownerId, 246); - this.expansionSetCode = "SOM"; - } + super(ownerId, 246); + this.expansionSetCode = "SOM"; + } - public Forest1(final Forest1 card) { - super(card); - } + public Forest1(final Forest1 card) { + super(card); + } - @Override - public Forest1 copy() { - return new Forest1(this); - } + @Override + public Forest1 copy() { + return new Forest1(this); + } } diff --git a/Mage.Sets/src/mage/sets/scarsofmirrodin/Forest2.java b/Mage.Sets/src/mage/sets/scarsofmirrodin/Forest2.java index ec6aaf4b30..4b33245a4e 100644 --- a/Mage.Sets/src/mage/sets/scarsofmirrodin/Forest2.java +++ b/Mage.Sets/src/mage/sets/scarsofmirrodin/Forest2.java @@ -36,16 +36,16 @@ import java.util.UUID; public class Forest2 extends mage.cards.basiclands.Forest { public Forest2(UUID ownerId) { - super(ownerId, 247); - this.expansionSetCode = "SOM"; - } + super(ownerId, 247); + this.expansionSetCode = "SOM"; + } - public Forest2(final Forest2 card) { - super(card); - } + public Forest2(final Forest2 card) { + super(card); + } - @Override - public Forest2 copy() { - return new Forest2(this); - } + @Override + public Forest2 copy() { + return new Forest2(this); + } } diff --git a/Mage.Sets/src/mage/sets/scarsofmirrodin/Forest3.java b/Mage.Sets/src/mage/sets/scarsofmirrodin/Forest3.java index 3522b4238f..5e39bd8505 100644 --- a/Mage.Sets/src/mage/sets/scarsofmirrodin/Forest3.java +++ b/Mage.Sets/src/mage/sets/scarsofmirrodin/Forest3.java @@ -36,16 +36,16 @@ import java.util.UUID; public class Forest3 extends mage.cards.basiclands.Forest { public Forest3(UUID ownerId) { - super(ownerId, 248); - this.expansionSetCode = "SOM"; - } + super(ownerId, 248); + this.expansionSetCode = "SOM"; + } - public Forest3(final Forest3 card) { - super(card); - } + public Forest3(final Forest3 card) { + super(card); + } - @Override - public Forest3 copy() { - return new Forest3(this); - } + @Override + public Forest3 copy() { + return new Forest3(this); + } } diff --git a/Mage.Sets/src/mage/sets/scarsofmirrodin/Forest4.java b/Mage.Sets/src/mage/sets/scarsofmirrodin/Forest4.java index 4114c188e3..11a1896f35 100644 --- a/Mage.Sets/src/mage/sets/scarsofmirrodin/Forest4.java +++ b/Mage.Sets/src/mage/sets/scarsofmirrodin/Forest4.java @@ -36,16 +36,16 @@ import java.util.UUID; public class Forest4 extends mage.cards.basiclands.Forest { public Forest4(UUID ownerId) { - super(ownerId, 249); - this.expansionSetCode = "SOM"; - } + super(ownerId, 249); + this.expansionSetCode = "SOM"; + } - public Forest4(final Forest4 card) { - super(card); - } + public Forest4(final Forest4 card) { + super(card); + } - @Override - public Forest4 copy() { - return new Forest4(this); - } + @Override + public Forest4 copy() { + return new Forest4(this); + } } diff --git a/Mage.Sets/src/mage/sets/scarsofmirrodin/FulgentDistraction.java b/Mage.Sets/src/mage/sets/scarsofmirrodin/FulgentDistraction.java index 838d912870..14e134d74e 100644 --- a/Mage.Sets/src/mage/sets/scarsofmirrodin/FulgentDistraction.java +++ b/Mage.Sets/src/mage/sets/scarsofmirrodin/FulgentDistraction.java @@ -51,11 +51,11 @@ public class FulgentDistraction extends CardImpl { public FulgentDistraction (UUID ownerId) { super(ownerId, 7, "Fulgent Distraction", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{2}{W}"); this.expansionSetCode = "SOM"; - - this.color.setWhite(true); - this.getSpellAbility().addEffect(new FulgentDistractionEffect()); - this.getSpellAbility().addTarget(new TargetCreaturePermanent(2)); + this.color.setWhite(true); + + this.getSpellAbility().addEffect(new FulgentDistractionEffect()); + this.getSpellAbility().addTarget(new TargetCreaturePermanent(2)); } public FulgentDistraction (final FulgentDistraction card) { @@ -70,46 +70,46 @@ public class FulgentDistraction extends CardImpl { class FulgentDistractionEffect extends OneShotEffect { - private static String text = "Choose two target creatures. Tap those creatures, then unattach all Equipment from them"; + private static String text = "Choose two target creatures. Tap those creatures, then unattach all Equipment from them"; - FulgentDistractionEffect ( ) { - super(Outcome.Tap); - staticText = text; - } + FulgentDistractionEffect ( ) { + super(Outcome.Tap); + staticText = text; + } - FulgentDistractionEffect ( FulgentDistractionEffect effect ) { - super(effect); - } + FulgentDistractionEffect ( FulgentDistractionEffect effect ) { + super(effect); + } - @Override - public boolean apply(Game game, Ability source) { - for ( UUID target : targetPointer.getTargets(game, source) ) { - Permanent creature = game.getPermanent(target); + @Override + public boolean apply(Game game, Ability source) { + for ( UUID target : targetPointer.getTargets(game, source) ) { + Permanent creature = game.getPermanent(target); - List copiedAttachments = new ArrayList(creature.getAttachments()); - for ( UUID equipmentId : copiedAttachments ) { - Permanent equipment = game.getPermanent(equipmentId); - boolean isEquipment = false; + List copiedAttachments = new ArrayList(creature.getAttachments()); + for ( UUID equipmentId : copiedAttachments ) { + Permanent equipment = game.getPermanent(equipmentId); + boolean isEquipment = false; - for ( Ability ability : equipment.getAbilities() ) { - if ( ability instanceof EquipAbility ) { - isEquipment = true; - } - } + for ( Ability ability : equipment.getAbilities() ) { + if ( ability instanceof EquipAbility ) { + isEquipment = true; + } + } - if ( isEquipment ) { - creature.removeAttachment(equipmentId, game); - } - } - - creature.tap(game); - } - return true; - } + if ( isEquipment ) { + creature.removeAttachment(equipmentId, game); + } + } - @Override - public FulgentDistractionEffect copy() { - return new FulgentDistractionEffect(this); - } + creature.tap(game); + } + return true; + } + + @Override + public FulgentDistractionEffect copy() { + return new FulgentDistractionEffect(this); + } } diff --git a/Mage.Sets/src/mage/sets/scarsofmirrodin/FumeSpitter.java b/Mage.Sets/src/mage/sets/scarsofmirrodin/FumeSpitter.java index 15229b0f37..e5499a1482 100644 --- a/Mage.Sets/src/mage/sets/scarsofmirrodin/FumeSpitter.java +++ b/Mage.Sets/src/mage/sets/scarsofmirrodin/FumeSpitter.java @@ -51,7 +51,7 @@ public class FumeSpitter extends CardImpl { super(ownerId, 63, "Fume Spitter", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{B}"); this.expansionSetCode = "SOM"; this.subtype.add("Horror"); - this.color.setBlack(true); + this.color.setBlack(true); this.power = new MageInt(1); this.toughness = new MageInt(1); Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new AddCountersTargetEffect(CounterType.M1M1.createInstance()), new SacrificeSourceCost()); diff --git a/Mage.Sets/src/mage/sets/scarsofmirrodin/FurnaceCelebration.java b/Mage.Sets/src/mage/sets/scarsofmirrodin/FurnaceCelebration.java index de4d7c010a..3b7f5baf63 100644 --- a/Mage.Sets/src/mage/sets/scarsofmirrodin/FurnaceCelebration.java +++ b/Mage.Sets/src/mage/sets/scarsofmirrodin/FurnaceCelebration.java @@ -46,52 +46,52 @@ import mage.target.common.TargetCreatureOrPlayer; */ public class FurnaceCelebration extends CardImpl { - public FurnaceCelebration(UUID ownerId) { - super(ownerId, 90, "Furnace Celebration", Rarity.UNCOMMON, new CardType[]{CardType.ENCHANTMENT}, "{1}{R}{R}"); - this.expansionSetCode = "SOM"; - this.color.setRed(true); - this.addAbility(new FurnaceCelebrationAbility()); - } + public FurnaceCelebration(UUID ownerId) { + super(ownerId, 90, "Furnace Celebration", Rarity.UNCOMMON, new CardType[]{CardType.ENCHANTMENT}, "{1}{R}{R}"); + this.expansionSetCode = "SOM"; + this.color.setRed(true); + this.addAbility(new FurnaceCelebrationAbility()); + } - public FurnaceCelebration(final FurnaceCelebration card) { - super(card); - } + public FurnaceCelebration(final FurnaceCelebration card) { + super(card); + } - @Override - public FurnaceCelebration copy() { - return new FurnaceCelebration(this); - } + @Override + public FurnaceCelebration copy() { + return new FurnaceCelebration(this); + } } class FurnaceCelebrationAbility extends TriggeredAbilityImpl { - public FurnaceCelebrationAbility() { - super(Zone.BATTLEFIELD, new DoIfCostPaid(new DamageTargetEffect(2), new ManaCostsImpl("{2}"))); - this.addTarget(new TargetCreatureOrPlayer()); - } - - public FurnaceCelebrationAbility(final FurnaceCelebrationAbility ability) { - super(ability); - } - - @Override - public FurnaceCelebrationAbility copy() { - return new FurnaceCelebrationAbility(this); - } + public FurnaceCelebrationAbility() { + super(Zone.BATTLEFIELD, new DoIfCostPaid(new DamageTargetEffect(2), new ManaCostsImpl("{2}"))); + this.addTarget(new TargetCreatureOrPlayer()); + } - @Override - public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == GameEvent.EventType.SACRIFICED_PERMANENT && event.getPlayerId().equals(this.getControllerId()) && !event.getTargetId().equals(sourceId)) { - return true; - } - return false; - } + public FurnaceCelebrationAbility(final FurnaceCelebrationAbility ability) { + super(ability); + } + + @Override + public FurnaceCelebrationAbility copy() { + return new FurnaceCelebrationAbility(this); + } + + @Override + public boolean checkTrigger(GameEvent event, Game game) { + if (event.getType() == GameEvent.EventType.SACRIFICED_PERMANENT && event.getPlayerId().equals(this.getControllerId()) && !event.getTargetId().equals(sourceId)) { + return true; + } + return false; + } + + @Override + public String getRule() { + return "Whenever you sacrifice another permanent, " + super.getRule(); + } - @Override - public String getRule() { - return "Whenever you sacrifice another permanent, " + super.getRule(); - } - } \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/scarsofmirrodin/GalvanicBlast.java b/Mage.Sets/src/mage/sets/scarsofmirrodin/GalvanicBlast.java index cd00da3e2e..ff7efeffaa 100644 --- a/Mage.Sets/src/mage/sets/scarsofmirrodin/GalvanicBlast.java +++ b/Mage.Sets/src/mage/sets/scarsofmirrodin/GalvanicBlast.java @@ -41,17 +41,17 @@ import mage.target.common.TargetCreatureOrPlayer; * @author North */ public class GalvanicBlast extends CardImpl { - + private final String effectText = "Metalcraft - Galvanic Blast deals 4 damage to that creature or player instead if you control three or more artifacts."; public GalvanicBlast(UUID ownerId) { super(ownerId, 91, "Galvanic Blast", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{R}"); this.expansionSetCode = "SOM"; this.color.setRed(true); - + this.getSpellAbility().addTarget(new TargetCreatureOrPlayer()); this.getSpellAbility().addEffect(new DamageTargetEffect(2)); - + this.getSpellAbility().addEffect(new ConditionalOneShotEffect(new DamageTargetEffect(2), MetalcraftCondition.getInstance(), effectText)); } diff --git a/Mage.Sets/src/mage/sets/scarsofmirrodin/GenesisWave.java b/Mage.Sets/src/mage/sets/scarsofmirrodin/GenesisWave.java index 2d815ec862..ec288eec24 100644 --- a/Mage.Sets/src/mage/sets/scarsofmirrodin/GenesisWave.java +++ b/Mage.Sets/src/mage/sets/scarsofmirrodin/GenesisWave.java @@ -50,69 +50,69 @@ import mage.target.TargetCard; */ public class GenesisWave extends CardImpl { - public GenesisWave(UUID ownerId) { - super(ownerId, 122, "Genesis Wave", Rarity.RARE, new CardType[]{CardType.SORCERY}, "{X}{G}{G}{G}"); - this.expansionSetCode = "SOM"; - this.color.setGreen(true); - this.getSpellAbility().addEffect(new GenesisWaveEffect()); - } + public GenesisWave(UUID ownerId) { + super(ownerId, 122, "Genesis Wave", Rarity.RARE, new CardType[]{CardType.SORCERY}, "{X}{G}{G}{G}"); + this.expansionSetCode = "SOM"; + this.color.setGreen(true); + this.getSpellAbility().addEffect(new GenesisWaveEffect()); + } - public GenesisWave(final GenesisWave card) { - super(card); - } + public GenesisWave(final GenesisWave card) { + super(card); + } - @Override - public GenesisWave copy() { - return new GenesisWave(this); - } + @Override + public GenesisWave copy() { + return new GenesisWave(this); + } } class GenesisWaveEffect extends OneShotEffect { - public GenesisWaveEffect() { - super(Outcome.PutCardInPlay); - staticText = "Reveal the top X cards of your library. You may put any number of permanent cards with converted mana cost X or less from among them onto the battlefield. Then put all cards revealed this way that weren't put onto the battlefield into your graveyard"; - } + public GenesisWaveEffect() { + super(Outcome.PutCardInPlay); + staticText = "Reveal the top X cards of your library. You may put any number of permanent cards with converted mana cost X or less from among them onto the battlefield. Then put all cards revealed this way that weren't put onto the battlefield into your graveyard"; + } - public GenesisWaveEffect(final GenesisWaveEffect effect) { - super(effect); - } + public GenesisWaveEffect(final GenesisWaveEffect effect) { + super(effect); + } - @Override - public boolean apply(Game game, Ability source) { - Player player = game.getPlayer(source.getControllerId()); - Cards cards = new CardsImpl(Zone.PICK); + @Override + public boolean apply(Game game, Ability source) { + Player player = game.getPlayer(source.getControllerId()); + Cards cards = new CardsImpl(Zone.PICK); int count = source.getManaCostsToPay().getX(); - count = Math.min(player.getLibrary().size(), count); - for (int i = 0; i < count; i++) { - Card card = player.getLibrary().removeFromTop(game); - cards.add(card); - game.setZone(card.getId(), Zone.PICK); - } - FilterCard filter = new FilterCard("card with converted mana cost " + count + " or less to put onto the battlefield"); - filter.setConvertedManaCost(count + 1); - filter.setConvertedManaCostComparison(ComparisonType.LessThan); - TargetCard target1 = new TargetCard(Zone.PICK, filter); - while (cards.size() > 0 && player.choose(Outcome.PutCardInPlay, cards, target1, game)) { - Card card = cards.get(target1.getFirstTarget(), game); - if (card != null) { - cards.remove(card); - card.putOntoBattlefield(game, Zone.HAND, source.getSourceId(), source.getControllerId()); - } - target1.clearChosen(); - } - while (cards.size() > 0) { - Card card = cards.get(cards.iterator().next(), game); - cards.remove(card); - card.moveToZone(Zone.GRAVEYARD, source.getId(), game, true); - } - return true; - } + count = Math.min(player.getLibrary().size(), count); + for (int i = 0; i < count; i++) { + Card card = player.getLibrary().removeFromTop(game); + cards.add(card); + game.setZone(card.getId(), Zone.PICK); + } + FilterCard filter = new FilterCard("card with converted mana cost " + count + " or less to put onto the battlefield"); + filter.setConvertedManaCost(count + 1); + filter.setConvertedManaCostComparison(ComparisonType.LessThan); + TargetCard target1 = new TargetCard(Zone.PICK, filter); + while (cards.size() > 0 && player.choose(Outcome.PutCardInPlay, cards, target1, game)) { + Card card = cards.get(target1.getFirstTarget(), game); + if (card != null) { + cards.remove(card); + card.putOntoBattlefield(game, Zone.HAND, source.getSourceId(), source.getControllerId()); + } + target1.clearChosen(); + } + while (cards.size() > 0) { + Card card = cards.get(cards.iterator().next(), game); + cards.remove(card); + card.moveToZone(Zone.GRAVEYARD, source.getId(), game, true); + } + return true; + } - @Override - public GenesisWaveEffect copy() { - return new GenesisWaveEffect(this); - } + @Override + public GenesisWaveEffect copy() { + return new GenesisWaveEffect(this); + } } diff --git a/Mage.Sets/src/mage/sets/scarsofmirrodin/GethLordOfTheVault.java b/Mage.Sets/src/mage/sets/scarsofmirrodin/GethLordOfTheVault.java index 31ea3978cc..38bbc68ea2 100644 --- a/Mage.Sets/src/mage/sets/scarsofmirrodin/GethLordOfTheVault.java +++ b/Mage.Sets/src/mage/sets/scarsofmirrodin/GethLordOfTheVault.java @@ -58,44 +58,44 @@ import mage.target.common.TargetCardInOpponentsGraveyard; */ public class GethLordOfTheVault extends CardImpl { - private static final FilterCard filter = new FilterCard("artifact or creature card from an opponent's graveyard"); + private static final FilterCard filter = new FilterCard("artifact or creature card from an opponent's graveyard"); + + static { + filter.getCardType().add(CardType.CREATURE); + filter.getCardType().add(CardType.ARTIFACT); + filter.setScopeCardType(ComparisonScope.Any); + } - static { - filter.getCardType().add(CardType.CREATURE); - filter.getCardType().add(CardType.ARTIFACT); - filter.setScopeCardType(ComparisonScope.Any); - } - public GethLordOfTheVault (UUID ownerId) { super(ownerId, 64, "Geth, Lord of the Vault", Rarity.MYTHIC, new CardType[]{CardType.CREATURE}, "{4}{B}{B}"); this.expansionSetCode = "SOM"; this.supertype.add("Legendary"); this.subtype.add("Zombie"); - this.color.setBlack(true); + this.color.setBlack(true); this.power = new MageInt(5); this.toughness = new MageInt(5); - + this.addAbility(IntimidateAbility.getInstance()); Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new GethLordOfTheVaultEffect(), new ManaCostsImpl("{X}{B}")); ability.addTarget(new TargetCardInOpponentsGraveyard(filter)); this.addAbility(ability); } - @Override - public void adjustCosts(Ability ability, Game game) { - Card card = game.getCard(ability.getFirstTarget()); - if (card != null) { - // insert at the beginning (so it will be {2}{B}, not {B}{2}) - ability.getManaCostsToPay().add(0, new GenericManaCost(card.getManaCost().convertedManaCost())); - } - // no {X} anymore as we already have chosen the target with defined manacost - for (ManaCost cost : ability.getManaCostsToPay()) { - if (cost instanceof VariableCost) { - cost.setPaid(); - } - } - } - + @Override + public void adjustCosts(Ability ability, Game game) { + Card card = game.getCard(ability.getFirstTarget()); + if (card != null) { + // insert at the beginning (so it will be {2}{B}, not {B}{2}) + ability.getManaCostsToPay().add(0, new GenericManaCost(card.getManaCost().convertedManaCost())); + } + // no {X} anymore as we already have chosen the target with defined manacost + for (ManaCost cost : ability.getManaCostsToPay()) { + if (cost instanceof VariableCost) { + cost.setPaid(); + } + } + } + public GethLordOfTheVault (final GethLordOfTheVault card) { super(card); } @@ -107,8 +107,8 @@ public class GethLordOfTheVault extends CardImpl { } class GethLordOfTheVaultEffect extends OneShotEffect { - - public GethLordOfTheVaultEffect() { + + public GethLordOfTheVaultEffect() { super(Outcome.Benefit); staticText = "Put target artifact or creature card with converted mana cost X from an opponent's graveyard onto the battlefield under your control tapped. Then that player puts the top X cards of his or her library into his or her graveyard"; } @@ -119,34 +119,34 @@ class GethLordOfTheVaultEffect extends OneShotEffect { @Override public boolean apply(Game game, Ability source) { - Card card = game.getCard(source.getFirstTarget()); - if (card != null) { - // if still in graveyard - if (game.getState().getZone(card.getId()).equals(Zone.GRAVEYARD)) { - Player player = game.getPlayer(card.getOwnerId()); - if (card.putOntoBattlefield(game, Zone.GRAVEYARD, source.getId(), source.getControllerId())) { - - Permanent permanent = game.getPermanent(card.getId()); - if (permanent != null) { - permanent.setTapped(true); - } + Card card = game.getCard(source.getFirstTarget()); + if (card != null) { + // if still in graveyard + if (game.getState().getZone(card.getId()).equals(Zone.GRAVEYARD)) { + Player player = game.getPlayer(card.getOwnerId()); + if (card.putOntoBattlefield(game, Zone.GRAVEYARD, source.getId(), source.getControllerId())) { - int xvalue = card.getManaCost().convertedManaCost(); - int cardsCount = Math.min(xvalue, player.getLibrary().size()); + Permanent permanent = game.getPermanent(card.getId()); + if (permanent != null) { + permanent.setTapped(true); + } - for (int i = 0; i < cardsCount; i++) { - Card removedCard = player.getLibrary().getFromTop(game); - if (removedCard != null) { - removedCard.moveToZone(Zone.GRAVEYARD, source.getId(), game, false); - } else { - break; - } - } + int xvalue = card.getManaCost().convertedManaCost(); + int cardsCount = Math.min(xvalue, player.getLibrary().size()); - } - } - } - return false; + for (int i = 0; i < cardsCount; i++) { + Card removedCard = player.getLibrary().getFromTop(game); + if (removedCard != null) { + removedCard.moveToZone(Zone.GRAVEYARD, source.getId(), game, false); + } else { + break; + } + } + + } + } + } + return false; } @Override diff --git a/Mage.Sets/src/mage/sets/scarsofmirrodin/GhalmasWarden.java b/Mage.Sets/src/mage/sets/scarsofmirrodin/GhalmasWarden.java index 131466c038..7980344ae4 100644 --- a/Mage.Sets/src/mage/sets/scarsofmirrodin/GhalmasWarden.java +++ b/Mage.Sets/src/mage/sets/scarsofmirrodin/GhalmasWarden.java @@ -54,7 +54,7 @@ public class GhalmasWarden extends CardImpl { this.expansionSetCode = "SOM"; this.subtype.add("Elephant"); this.subtype.add("Soldier"); - this.color.setWhite(true); + this.color.setWhite(true); this.power = new MageInt(2); this.toughness = new MageInt(4); ContinuousEffect boostSource = new BoostSourceEffect(2, 2, Duration.WhileOnBattlefield); diff --git a/Mage.Sets/src/mage/sets/scarsofmirrodin/GlimmerpointStag.java b/Mage.Sets/src/mage/sets/scarsofmirrodin/GlimmerpointStag.java index 5bafc06682..5aa198735e 100644 --- a/Mage.Sets/src/mage/sets/scarsofmirrodin/GlimmerpointStag.java +++ b/Mage.Sets/src/mage/sets/scarsofmirrodin/GlimmerpointStag.java @@ -51,66 +51,66 @@ import java.util.UUID; * @author maurer.it_at_gmail.com */ public class GlimmerpointStag extends CardImpl { - - public GlimmerpointStag(UUID ownerId) { - super(ownerId, 9, "Glimmerpoint Stag", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{2}{W}{W}"); - this.expansionSetCode = "SOM"; - this.subtype.add("Elk"); - this.color.setWhite(true); - this.power = new MageInt(3); - this.toughness = new MageInt(3); - - this.addAbility(VigilanceAbility.getInstance()); - Target etbTarget = new TargetPermanent(); - etbTarget.setRequired(true); - Ability etbAbility = new EntersBattlefieldTriggeredAbility(new GlimmerpointStagEffect()); - etbAbility.addTarget(etbTarget); - this.addAbility(etbAbility); - } + public GlimmerpointStag(UUID ownerId) { + super(ownerId, 9, "Glimmerpoint Stag", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{2}{W}{W}"); + this.expansionSetCode = "SOM"; + this.subtype.add("Elk"); - public GlimmerpointStag(final GlimmerpointStag card) { - super(card); - } + this.color.setWhite(true); + this.power = new MageInt(3); + this.toughness = new MageInt(3); - @Override - public GlimmerpointStag copy() { - return new GlimmerpointStag(this); - } + this.addAbility(VigilanceAbility.getInstance()); + Target etbTarget = new TargetPermanent(); + etbTarget.setRequired(true); + Ability etbAbility = new EntersBattlefieldTriggeredAbility(new GlimmerpointStagEffect()); + etbAbility.addTarget(etbTarget); + this.addAbility(etbAbility); + } + + public GlimmerpointStag(final GlimmerpointStag card) { + super(card); + } + + @Override + public GlimmerpointStag copy() { + return new GlimmerpointStag(this); + } } class GlimmerpointStagEffect extends OneShotEffect { - private static final String effectText = "exile another target permanent. Return that card to the battlefield under its owner's control at the beginning of the next end step"; + private static final String effectText = "exile another target permanent. Return that card to the battlefield under its owner's control at the beginning of the next end step"; - GlimmerpointStagEffect ( ) { - super(Outcome.Detriment); - staticText = effectText; - } - - GlimmerpointStagEffect(GlimmerpointStagEffect effect) { - super(effect); - } + GlimmerpointStagEffect ( ) { + super(Outcome.Detriment); + staticText = effectText; + } - @Override - public boolean apply(Game game, Ability source) { - Permanent permanent = game.getPermanent(source.getFirstTarget()); - if (permanent != null) { - if (permanent.moveToExile(source.getSourceId(), "Glimmerpoint Stag Exile", source.getId(), game)) { - //create delayed triggered ability - AtEndOfTurnDelayedTriggeredAbility delayedAbility = new AtEndOfTurnDelayedTriggeredAbility(new ReturnFromExileEffect(source.getSourceId(), Zone.BATTLEFIELD)); - delayedAbility.setSourceId(source.getSourceId()); - delayedAbility.setControllerId(source.getControllerId()); - game.addDelayedTriggeredAbility(delayedAbility); - return true; - } - } - return false; - } + GlimmerpointStagEffect(GlimmerpointStagEffect effect) { + super(effect); + } - @Override - public GlimmerpointStagEffect copy() { - return new GlimmerpointStagEffect(this); - } + @Override + public boolean apply(Game game, Ability source) { + Permanent permanent = game.getPermanent(source.getFirstTarget()); + if (permanent != null) { + if (permanent.moveToExile(source.getSourceId(), "Glimmerpoint Stag Exile", source.getId(), game)) { + //create delayed triggered ability + AtEndOfTurnDelayedTriggeredAbility delayedAbility = new AtEndOfTurnDelayedTriggeredAbility(new ReturnFromExileEffect(source.getSourceId(), Zone.BATTLEFIELD)); + delayedAbility.setSourceId(source.getSourceId()); + delayedAbility.setControllerId(source.getControllerId()); + game.addDelayedTriggeredAbility(delayedAbility); + return true; + } + } + return false; + } + + @Override + public GlimmerpointStagEffect copy() { + return new GlimmerpointStagEffect(this); + } } diff --git a/Mage.Sets/src/mage/sets/scarsofmirrodin/GlintHawk.java b/Mage.Sets/src/mage/sets/scarsofmirrodin/GlintHawk.java index bb039b43f0..1d8c9d68b5 100644 --- a/Mage.Sets/src/mage/sets/scarsofmirrodin/GlintHawk.java +++ b/Mage.Sets/src/mage/sets/scarsofmirrodin/GlintHawk.java @@ -51,74 +51,74 @@ import mage.target.TargetPermanent; */ public class GlintHawk extends CardImpl { - public GlintHawk(UUID ownerId) { - super(ownerId, 10, "Glint Hawk", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{W}"); - this.expansionSetCode = "SOM"; - this.subtype.add("Bird"); + public GlintHawk(UUID ownerId) { + super(ownerId, 10, "Glint Hawk", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{W}"); + this.expansionSetCode = "SOM"; + this.subtype.add("Bird"); - this.color.setWhite(true); - this.power = new MageInt(2); - this.toughness = new MageInt(2); + this.color.setWhite(true); + this.power = new MageInt(2); + this.toughness = new MageInt(2); - this.addAbility(FlyingAbility.getInstance()); - this.addAbility(new EntersBattlefieldTriggeredAbility(new GlintHawkEffect())); - } + this.addAbility(FlyingAbility.getInstance()); + this.addAbility(new EntersBattlefieldTriggeredAbility(new GlintHawkEffect())); + } - public GlintHawk(final GlintHawk card) { - super(card); - } + public GlintHawk(final GlintHawk card) { + super(card); + } - @Override - public GlintHawk copy() { - return new GlintHawk(this); - } + @Override + public GlintHawk copy() { + return new GlintHawk(this); + } } class GlintHawkEffect extends OneShotEffect { - private static final FilterControlledPermanent filter; - private static final String effectText = "When {this} enters the battlefield, sacrifice it unless you return an artifact you control to its owner's hand"; + private static final FilterControlledPermanent filter; + private static final String effectText = "When {this} enters the battlefield, sacrifice it unless you return an artifact you control to its owner's hand"; - static { - filter = new FilterControlledPermanent(); - filter.getCardType().add(CardType.ARTIFACT); - } - - GlintHawkEffect ( ) { - super(Outcome.Sacrifice); - staticText = effectText; - } + static { + filter = new FilterControlledPermanent(); + filter.getCardType().add(CardType.ARTIFACT); + } - GlintHawkEffect ( GlintHawkEffect effect ) { - super(effect); - } + GlintHawkEffect ( ) { + super(Outcome.Sacrifice); + staticText = effectText; + } - @Override - public boolean apply(Game game, Ability source) { - boolean targetChosen = false; - Player player = game.getPlayer(source.getControllerId()); - TargetPermanent target = new TargetPermanent(1, 1, filter, false); + GlintHawkEffect ( GlintHawkEffect effect ) { + super(effect); + } - if (target.canChoose(player.getId(), game)) { - player.choose(Outcome.Sacrifice, target, source.getSourceId(), game); - Permanent permanent = game.getPermanent(target.getFirstTarget()); + @Override + public boolean apply(Game game, Ability source) { + boolean targetChosen = false; + Player player = game.getPlayer(source.getControllerId()); + TargetPermanent target = new TargetPermanent(1, 1, filter, false); - if ( permanent != null ) { - targetChosen = true; - permanent.moveToZone(Zone.HAND, this.getId(), game, false); - } - } + if (target.canChoose(player.getId(), game)) { + player.choose(Outcome.Sacrifice, target, source.getSourceId(), game); + Permanent permanent = game.getPermanent(target.getFirstTarget()); - if ( !targetChosen ) { - new SacrificeSourceEffect().apply(game, source); - } + if ( permanent != null ) { + targetChosen = true; + permanent.moveToZone(Zone.HAND, this.getId(), game, false); + } + } - return false; - } + if ( !targetChosen ) { + new SacrificeSourceEffect().apply(game, source); + } - @Override - public GlintHawkEffect copy() { - return new GlintHawkEffect(this); - } + return false; + } + + @Override + public GlintHawkEffect copy() { + return new GlintHawkEffect(this); + } } diff --git a/Mage.Sets/src/mage/sets/scarsofmirrodin/GlintHawkIdol.java b/Mage.Sets/src/mage/sets/scarsofmirrodin/GlintHawkIdol.java index e803227b38..e0e0da11af 100644 --- a/Mage.Sets/src/mage/sets/scarsofmirrodin/GlintHawkIdol.java +++ b/Mage.Sets/src/mage/sets/scarsofmirrodin/GlintHawkIdol.java @@ -88,16 +88,16 @@ class GlintHawkIdolTriggeredAbility extends TriggeredAbilityImpl { - private static final FilterPermanent filter = new FilterPermanent("artifact creature"); + private static final FilterPermanent filter = new FilterPermanent("artifact creature"); - static { - filter.getCardType().add(CardType.ARTIFACT); - filter.getCardType().add(CardType.CREATURE); - filter.setScopeCardType(Filter.ComparisonScope.All); - } + static { + filter.getCardType().add(CardType.ARTIFACT); + filter.getCardType().add(CardType.CREATURE); + filter.setScopeCardType(Filter.ComparisonScope.All); + } - public GolemArtisan(UUID ownerId) { - super(ownerId, 159, "Golem Artisan", Rarity.UNCOMMON, new CardType[]{CardType.ARTIFACT, CardType.CREATURE}, "{5}"); - this.expansionSetCode = "SOM"; - this.subtype.add("Golem"); + public GolemArtisan(UUID ownerId) { + super(ownerId, 159, "Golem Artisan", Rarity.UNCOMMON, new CardType[]{CardType.ARTIFACT, CardType.CREATURE}, "{5}"); + this.expansionSetCode = "SOM"; + this.subtype.add("Golem"); - this.power = new MageInt(3); - this.toughness = new MageInt(3); + this.power = new MageInt(3); + this.toughness = new MageInt(3); - // {2}: Target artifact creature gets +1/+1 until end of turn. - Ability ability = new SimpleActivatedAbility(Constants.Zone.BATTLEFIELD, new BoostTargetEffect(1, 1, Constants.Duration.EndOfTurn), new GenericManaCost(2)); - Target target = new TargetPermanent(filter); - ability.addTarget(target); - this.addAbility(ability); + // {2}: Target artifact creature gets +1/+1 until end of turn. + Ability ability = new SimpleActivatedAbility(Constants.Zone.BATTLEFIELD, new BoostTargetEffect(1, 1, Constants.Duration.EndOfTurn), new GenericManaCost(2)); + Target target = new TargetPermanent(filter); + ability.addTarget(target); + this.addAbility(ability); - // {2}: Target artifact creature gains your choice of flying, trample, or haste until end of turn. - ability = new SimpleActivatedAbility(Constants.Zone.BATTLEFIELD, new GolemArtisanEffect(), new GenericManaCost(2)); - target = new TargetPermanent(filter); - ability.addTarget(target); - this.addAbility(ability); + // {2}: Target artifact creature gains your choice of flying, trample, or haste until end of turn. + ability = new SimpleActivatedAbility(Constants.Zone.BATTLEFIELD, new GolemArtisanEffect(), new GenericManaCost(2)); + target = new TargetPermanent(filter); + ability.addTarget(target); + this.addAbility(ability); - } + } - public GolemArtisan(final GolemArtisan card) { - super(card); - } + public GolemArtisan(final GolemArtisan card) { + super(card); + } - @Override - public GolemArtisan copy() { - return new GolemArtisan(this); - } + @Override + public GolemArtisan copy() { + return new GolemArtisan(this); + } } class GolemArtisanEffect extends OneShotEffect { - GolemArtisanEffect() { - super(Constants.Outcome.AddAbility); - staticText = "Target artifact creature gains your choice of flying, trample, or haste until end of turn"; - } + GolemArtisanEffect() { + super(Constants.Outcome.AddAbility); + staticText = "Target artifact creature gains your choice of flying, trample, or haste until end of turn"; + } - GolemArtisanEffect(final GolemArtisanEffect effect) { - super(effect); - } + GolemArtisanEffect(final GolemArtisanEffect effect) { + super(effect); + } - @Override - public boolean apply(Game game, Ability source) { - Permanent permanent = game.getPermanent(targetPointer.getFirst(game, source)); - Player playerControls = game.getPlayer(source.getControllerId()); - if (permanent != null && playerControls != null) { - Choice abilityChoice = new ChoiceImpl(); - abilityChoice.setMessage("Choose an ability to add"); + @Override + public boolean apply(Game game, Ability source) { + Permanent permanent = game.getPermanent(targetPointer.getFirst(game, source)); + Player playerControls = game.getPlayer(source.getControllerId()); + if (permanent != null && playerControls != null) { + Choice abilityChoice = new ChoiceImpl(); + abilityChoice.setMessage("Choose an ability to add"); - Set abilities = new HashSet(); - abilities.add(FlyingAbility.getInstance().getRule()); - abilities.add(TrampleAbility.getInstance().getRule()); - abilities.add(HasteAbility.getInstance().getRule()); - abilityChoice.setChoices(abilities); - playerControls.choose(Constants.Outcome.AddAbility, abilityChoice, game); + Set abilities = new HashSet(); + abilities.add(FlyingAbility.getInstance().getRule()); + abilities.add(TrampleAbility.getInstance().getRule()); + abilities.add(HasteAbility.getInstance().getRule()); + abilityChoice.setChoices(abilities); + playerControls.choose(Constants.Outcome.AddAbility, abilityChoice, game); - String chosen = abilityChoice.getChoice(); - Ability ability = null; - if (FlyingAbility.getInstance().getRule().equals(chosen)) { - ability = FlyingAbility.getInstance(); - } else if (TrampleAbility.getInstance().getRule().equals(chosen)) { - ability = TrampleAbility.getInstance(); - } else if (HasteAbility.getInstance().getRule().equals(chosen)) { - ability = HasteAbility.getInstance(); - } + String chosen = abilityChoice.getChoice(); + Ability ability = null; + if (FlyingAbility.getInstance().getRule().equals(chosen)) { + ability = FlyingAbility.getInstance(); + } else if (TrampleAbility.getInstance().getRule().equals(chosen)) { + ability = TrampleAbility.getInstance(); + } else if (HasteAbility.getInstance().getRule().equals(chosen)) { + ability = HasteAbility.getInstance(); + } - if (ability != null) { - ContinuousEffect effect = new GainAbilityTargetEffect(ability, Constants.Duration.EndOfTurn); - game.addEffect(effect, source); - return true; - } - } + if (ability != null) { + ContinuousEffect effect = new GainAbilityTargetEffect(ability, Constants.Duration.EndOfTurn); + game.addEffect(effect, source); + return true; + } + } - return false; - } + return false; + } - @Override - public GolemArtisanEffect copy() { - return new GolemArtisanEffect(this); - } + @Override + public GolemArtisanEffect copy() { + return new GolemArtisanEffect(this); + } } diff --git a/Mage.Sets/src/mage/sets/scarsofmirrodin/GolemFoundry.java b/Mage.Sets/src/mage/sets/scarsofmirrodin/GolemFoundry.java index 7d3b37aeb6..822644a3e4 100644 --- a/Mage.Sets/src/mage/sets/scarsofmirrodin/GolemFoundry.java +++ b/Mage.Sets/src/mage/sets/scarsofmirrodin/GolemFoundry.java @@ -80,8 +80,8 @@ class GolemToken extends Token { super("Golem", "a 3/3 colorless Golem artifact creature token"); cardType.add(CardType.ARTIFACT); cardType.add(CardType.CREATURE); - subtype.add("Golem"); - power = new MageInt(3); - toughness = new MageInt(3); + subtype.add("Golem"); + power = new MageInt(3); + toughness = new MageInt(3); } } \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/scarsofmirrodin/GolemsHeart.java b/Mage.Sets/src/mage/sets/scarsofmirrodin/GolemsHeart.java index c802373252..f55b27e563 100644 --- a/Mage.Sets/src/mage/sets/scarsofmirrodin/GolemsHeart.java +++ b/Mage.Sets/src/mage/sets/scarsofmirrodin/GolemsHeart.java @@ -64,33 +64,33 @@ public class GolemsHeart extends CardImpl { class GolemsHeartAbility extends TriggeredAbilityImpl { - public GolemsHeartAbility() { - super(Zone.BATTLEFIELD, new GainLifeEffect(1), true); - } + public GolemsHeartAbility() { + super(Zone.BATTLEFIELD, new GainLifeEffect(1), true); + } - public GolemsHeartAbility(final GolemsHeartAbility ability) { - super(ability); - } + public GolemsHeartAbility(final GolemsHeartAbility ability) { + super(ability); + } - @Override - public GolemsHeartAbility copy() { - return new GolemsHeartAbility(this); - } + @Override + public GolemsHeartAbility copy() { + return new GolemsHeartAbility(this); + } - @Override - public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == GameEvent.EventType.SPELL_CAST) { - Spell spell = game.getStack().getSpell(event.getTargetId()); - if (spell != null && spell.getCardType().contains(CardType.ARTIFACT)) { - return true; - } - } - return false; - } + @Override + public boolean checkTrigger(GameEvent event, Game game) { + if (event.getType() == GameEvent.EventType.SPELL_CAST) { + Spell spell = game.getStack().getSpell(event.getTargetId()); + if (spell != null && spell.getCardType().contains(CardType.ARTIFACT)) { + return true; + } + } + return false; + } - @Override - public String getRule() { - return "Whenever a player casts an artifact spell, you may gain 1 life."; - } + @Override + public String getRule() { + return "Whenever a player casts an artifact spell, you may gain 1 life."; + } } \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/scarsofmirrodin/GraftedExoskeleton.java b/Mage.Sets/src/mage/sets/scarsofmirrodin/GraftedExoskeleton.java index f23a8ed8dd..06a0ab5f98 100644 --- a/Mage.Sets/src/mage/sets/scarsofmirrodin/GraftedExoskeleton.java +++ b/Mage.Sets/src/mage/sets/scarsofmirrodin/GraftedExoskeleton.java @@ -54,11 +54,11 @@ public class GraftedExoskeleton extends CardImpl { this.subtype.add("Equipment"); this.addAbility(new EquipAbility(Constants.Outcome.AddAbility, new GenericManaCost(2))); - // Equipped creature gets +2/+2 and has infect. - this.addAbility(new SimpleStaticAbility(Constants.Zone.BATTLEFIELD, new GainAbilityAttachedEffect(InfectAbility.getInstance(), Constants.AttachmentType.EQUIPMENT))); - this.addAbility(new SimpleStaticAbility(Constants.Zone.BATTLEFIELD, new BoostEquippedEffect(2, 2))); - // Whenever Grafted Exoskeleton becomes unattached from a permanent, sacrifice that permanent. - this.addAbility(new UnattachedTriggeredAbility(new SacrificeEquippedEffect(), false)); + // Equipped creature gets +2/+2 and has infect. + this.addAbility(new SimpleStaticAbility(Constants.Zone.BATTLEFIELD, new GainAbilityAttachedEffect(InfectAbility.getInstance(), Constants.AttachmentType.EQUIPMENT))); + this.addAbility(new SimpleStaticAbility(Constants.Zone.BATTLEFIELD, new BoostEquippedEffect(2, 2))); + // Whenever Grafted Exoskeleton becomes unattached from a permanent, sacrifice that permanent. + this.addAbility(new UnattachedTriggeredAbility(new SacrificeEquippedEffect(), false)); } public GraftedExoskeleton(final GraftedExoskeleton card) { diff --git a/Mage.Sets/src/mage/sets/scarsofmirrodin/GrandArchitect.java b/Mage.Sets/src/mage/sets/scarsofmirrodin/GrandArchitect.java index 06bc20f1d5..ff951a52ce 100644 --- a/Mage.Sets/src/mage/sets/scarsofmirrodin/GrandArchitect.java +++ b/Mage.Sets/src/mage/sets/scarsofmirrodin/GrandArchitect.java @@ -66,72 +66,72 @@ import mage.target.common.TargetControlledCreaturePermanent; */ public class GrandArchitect extends CardImpl { - private static final FilterCreaturePermanent boostFilter = new FilterCreaturePermanent("blue creatures"); - private static final FilterCreaturePermanent targetFilter = new FilterCreaturePermanent("artifact creature"); + private static final FilterCreaturePermanent boostFilter = new FilterCreaturePermanent("blue creatures"); + private static final FilterCreaturePermanent targetFilter = new FilterCreaturePermanent("artifact creature"); - static { - boostFilter.getColor().setBlue(true); - boostFilter.setUseColor(true); - targetFilter.getCardType().add(CardType.ARTIFACT); - targetFilter.setScopeCardType(ComparisonScope.All); - } + static { + boostFilter.getColor().setBlue(true); + boostFilter.setUseColor(true); + targetFilter.getCardType().add(CardType.ARTIFACT); + targetFilter.setScopeCardType(ComparisonScope.All); + } - public GrandArchitect(UUID ownerId) { - super(ownerId, 33, "Grand Architect", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{1}{U}{U}"); - this.expansionSetCode = "SOM"; - this.subtype.add("Vedalken"); - this.subtype.add("Artificer"); - this.color.setBlue(true); - this.power = new MageInt(1); - this.toughness = new MageInt(3); + public GrandArchitect(UUID ownerId) { + super(ownerId, 33, "Grand Architect", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{1}{U}{U}"); + this.expansionSetCode = "SOM"; + this.subtype.add("Vedalken"); + this.subtype.add("Artificer"); + this.color.setBlue(true); + this.power = new MageInt(1); + this.toughness = new MageInt(3); - this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostControlledEffect(1, 1, Duration.WhileOnBattlefield, boostFilter, true))); - Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new GrandArchitectEffect(), new ManaCostsImpl("{U}")); - ability.addTarget(new TargetPermanent(targetFilter)); - this.addAbility(ability); - this.addAbility(new GrandArchitectManaAbility()); - } + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostControlledEffect(1, 1, Duration.WhileOnBattlefield, boostFilter, true))); + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new GrandArchitectEffect(), new ManaCostsImpl("{U}")); + ability.addTarget(new TargetPermanent(targetFilter)); + this.addAbility(ability); + this.addAbility(new GrandArchitectManaAbility()); + } - public GrandArchitect(final GrandArchitect card) { - super(card); - } + public GrandArchitect(final GrandArchitect card) { + super(card); + } - @Override - public GrandArchitect copy() { - return new GrandArchitect(this); - } + @Override + public GrandArchitect copy() { + return new GrandArchitect(this); + } } class GrandArchitectEffect extends ContinuousEffectImpl { - public GrandArchitectEffect() { - super(Duration.EndOfTurn, Layer.ColorChangingEffects_5, SubLayer.NA, Outcome.Detriment); - staticText = "Target artifact creature becomes blue until end of turn"; - } + public GrandArchitectEffect() { + super(Duration.EndOfTurn, Layer.ColorChangingEffects_5, SubLayer.NA, Outcome.Detriment); + staticText = "Target artifact creature becomes blue until end of turn"; + } - public GrandArchitectEffect(final GrandArchitectEffect effect) { - super(effect); - } + public GrandArchitectEffect(final GrandArchitectEffect effect) { + super(effect); + } - @Override - public GrandArchitectEffect copy() { - return new GrandArchitectEffect(this); - } + @Override + public GrandArchitectEffect copy() { + return new GrandArchitectEffect(this); + } - @Override - public boolean apply(Game game, Ability source) { - Permanent permanent = game.getPermanent(source.getFirstTarget()); - if (permanent != null) { - permanent.getColor().setRed(false); - permanent.getColor().setWhite(false); - permanent.getColor().setGreen(false); - permanent.getColor().setBlue(true); - permanent.getColor().setBlack(false); - return true; - } - return false; - } + @Override + public boolean apply(Game game, Ability source) { + Permanent permanent = game.getPermanent(source.getFirstTarget()); + if (permanent != null) { + permanent.getColor().setRed(false); + permanent.getColor().setWhite(false); + permanent.getColor().setGreen(false); + permanent.getColor().setBlue(true); + permanent.getColor().setBlack(false); + return true; + } + return false; + } } @@ -139,13 +139,13 @@ class GrandArchitectManaAbility extends ManaAbility { private static final FilterControlledCreaturePermanent filter = new FilterControlledCreaturePermanent("untapped blue creature"); - static { - filter.getColor().setBlue(true); - filter.setUseColor(true); - filter.setTapped(false); - filter.setUseTapped(true); - } - + static { + filter.getColor().setBlue(true); + filter.setUseColor(true); + filter.setTapped(false); + filter.setUseTapped(true); + } + GrandArchitectManaAbility ( ) { super(Zone.BATTLEFIELD, new BasicManaEffect(new GrandArchitectConditionalMana()), new TapTargetCost(new TargetControlledCreaturePermanent(1, 1, filter, true))); this.netMana.setColorless(2); @@ -163,20 +163,20 @@ class GrandArchitectManaAbility extends ManaAbility { class GrandArchitectConditionalMana extends ConditionalMana { - public GrandArchitectConditionalMana() { - super(Mana.ColorlessMana(2)); - staticText = "Spend this mana only to cast artifact spells or activate abilities of artifacts"; - addCondition(new GrandArchitectManaCondition()); - } + public GrandArchitectConditionalMana() { + super(Mana.ColorlessMana(2)); + staticText = "Spend this mana only to cast artifact spells or activate abilities of artifacts"; + addCondition(new GrandArchitectManaCondition()); + } } class GrandArchitectManaCondition implements Condition { - @Override - public boolean apply(Game game, Ability source) { - MageObject object = game.getObject(source.getSourceId()); - if (object != null && object.getCardType().contains(CardType.ARTIFACT)) { - return true; - } - return false; - } + @Override + public boolean apply(Game game, Ability source) { + MageObject object = game.getObject(source.getSourceId()); + if (object != null && object.getCardType().contains(CardType.ARTIFACT)) { + return true; + } + return false; + } } diff --git a/Mage.Sets/src/mage/sets/scarsofmirrodin/GraspOfDarkness.java b/Mage.Sets/src/mage/sets/scarsofmirrodin/GraspOfDarkness.java index fafaa744ba..bbda2ff965 100644 --- a/Mage.Sets/src/mage/sets/scarsofmirrodin/GraspOfDarkness.java +++ b/Mage.Sets/src/mage/sets/scarsofmirrodin/GraspOfDarkness.java @@ -45,7 +45,7 @@ public class GraspOfDarkness extends CardImpl { public GraspOfDarkness (UUID ownerId) { super(ownerId, 65, "Grasp of Darkness", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{B}{B}"); this.expansionSetCode = "SOM"; - this.color.setBlack(true); + this.color.setBlack(true); this.getSpellAbility().addEffect(new BoostTargetEffect(-4, -4, Duration.EndOfTurn)); this.getSpellAbility().addTarget(new TargetCreaturePermanent()); } diff --git a/Mage.Sets/src/mage/sets/scarsofmirrodin/Grindclock.java b/Mage.Sets/src/mage/sets/scarsofmirrodin/Grindclock.java index b78c518092..08e63d4f52 100644 --- a/Mage.Sets/src/mage/sets/scarsofmirrodin/Grindclock.java +++ b/Mage.Sets/src/mage/sets/scarsofmirrodin/Grindclock.java @@ -86,16 +86,16 @@ class GrindclockEffect extends OneShotEffect { public boolean apply(Game game, Ability source) { int amount = game.getPermanent(source.getSourceId()).getCounters().getCount(CounterType.CHARGE); Player player = game.getPlayer(source.getFirstTarget()); - Card card; - for (int i = 0; i < amount; i++) { - card = player.getLibrary().removeFromTop(game); - if (card != null) { - card.moveToZone(Zone.GRAVEYARD, source.getId(), game, false); - } else { - break; - } - } - return true; + Card card; + for (int i = 0; i < amount; i++) { + card = player.getLibrary().removeFromTop(game); + if (card != null) { + card.moveToZone(Zone.GRAVEYARD, source.getId(), game, false); + } else { + break; + } + } + return true; } @Override diff --git a/Mage.Sets/src/mage/sets/scarsofmirrodin/HaltOrder.java b/Mage.Sets/src/mage/sets/scarsofmirrodin/HaltOrder.java index 0703a9e854..012c08716b 100644 --- a/Mage.Sets/src/mage/sets/scarsofmirrodin/HaltOrder.java +++ b/Mage.Sets/src/mage/sets/scarsofmirrodin/HaltOrder.java @@ -44,20 +44,20 @@ import mage.target.TargetSpell; */ public class HaltOrder extends CardImpl { - private static final FilterSpell filter = new FilterSpell("artifact spell"); + private static final FilterSpell filter = new FilterSpell("artifact spell"); - static { - filter.getCardType().add(CardType.ARTIFACT); - filter.setScopeCardType(Filter.ComparisonScope.Any); - } + static { + filter.getCardType().add(CardType.ARTIFACT); + filter.setScopeCardType(Filter.ComparisonScope.Any); + } public HaltOrder (UUID ownerId) { super(ownerId, 34, "Halt Order", Rarity.UNCOMMON, new CardType[]{CardType.INSTANT}, "{2}{U}"); this.expansionSetCode = "SOM"; this.color.setBlue(true); this.getSpellAbility().addTarget(new TargetSpell(filter)); - this.getSpellAbility().addEffect(new CounterTargetEffect()); - this.getSpellAbility().addEffect(new DrawCardControllerEffect(1)); + this.getSpellAbility().addEffect(new CounterTargetEffect()); + this.getSpellAbility().addEffect(new DrawCardControllerEffect(1)); } public HaltOrder (final HaltOrder card) { diff --git a/Mage.Sets/src/mage/sets/scarsofmirrodin/HandOfThePraetors.java b/Mage.Sets/src/mage/sets/scarsofmirrodin/HandOfThePraetors.java index a9afcd6d1b..f6150ded30 100644 --- a/Mage.Sets/src/mage/sets/scarsofmirrodin/HandOfThePraetors.java +++ b/Mage.Sets/src/mage/sets/scarsofmirrodin/HandOfThePraetors.java @@ -55,20 +55,20 @@ public class HandOfThePraetors extends CardImpl { private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("creatures with infect"); private static final FilterSpell filterSpell = new FilterSpell("a creature spell with infect"); - static { - filter.getAbilities().add(InfectAbility.getInstance()); - filter.setNotAbilities(false); + static { + filter.getAbilities().add(InfectAbility.getInstance()); + filter.setNotAbilities(false); filterSpell.getAbilities().add(InfectAbility.getInstance()); filterSpell.getCardType().add(CardType.CREATURE); filterSpell.setScopeCardType(Filter.ComparisonScope.Any); - } + } public HandOfThePraetors (UUID ownerId) { super(ownerId, 66, "Hand of the Praetors", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{3}{B}"); this.expansionSetCode = "SOM"; this.subtype.add("Zombie"); - this.color.setBlack(true); + this.color.setBlack(true); this.power = new MageInt(3); this.toughness = new MageInt(2); diff --git a/Mage.Sets/src/mage/sets/scarsofmirrodin/HoardSmelterDragon.java b/Mage.Sets/src/mage/sets/scarsofmirrodin/HoardSmelterDragon.java index cc72bb6eb1..b8ff6198ad 100644 --- a/Mage.Sets/src/mage/sets/scarsofmirrodin/HoardSmelterDragon.java +++ b/Mage.Sets/src/mage/sets/scarsofmirrodin/HoardSmelterDragon.java @@ -52,24 +52,24 @@ import mage.target.TargetPermanent; * @author Loki */ public class HoardSmelterDragon extends CardImpl { - private static FilterPermanent filter = new FilterPermanent("artifact"); + private static FilterPermanent filter = new FilterPermanent("artifact"); - static { - filter.getCardType().add(CardType.ARTIFACT); - } + static { + filter.getCardType().add(CardType.ARTIFACT); + } public HoardSmelterDragon (UUID ownerId) { super(ownerId, 93, "Hoard-Smelter Dragon", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{4}{R}{R}"); this.expansionSetCode = "SOM"; this.subtype.add("Dragon"); - this.color.setRed(true); + this.color.setRed(true); this.power = new MageInt(5); this.toughness = new MageInt(5); - this.addAbility(FlyingAbility.getInstance()); - Ability ability = new SimpleActivatedAbility(Constants.Zone.BATTLEFIELD, new DestroyTargetEffect(), new ManaCostsImpl("{3}{R}")); - ability.addTarget(new TargetPermanent(filter)); - ability.addEffect(new HoardSmelterEffect()); - this.addAbility(ability); + this.addAbility(FlyingAbility.getInstance()); + Ability ability = new SimpleActivatedAbility(Constants.Zone.BATTLEFIELD, new DestroyTargetEffect(), new ManaCostsImpl("{3}{R}")); + ability.addTarget(new TargetPermanent(filter)); + ability.addEffect(new HoardSmelterEffect()); + this.addAbility(ability); } public HoardSmelterDragon (final HoardSmelterDragon card) { @@ -83,39 +83,39 @@ public class HoardSmelterDragon extends CardImpl { } class HoardSmelterEffect extends ContinuousEffectImpl { - private int costValue = 0; + private int costValue = 0; - HoardSmelterEffect() { - super(Constants.Duration.EndOfTurn, Constants.Layer.PTChangingEffects_7, Constants.SubLayer.ModifyPT_7c, Constants.Outcome.BoostCreature); - staticText = "{this} gets +X/+0 until end of turn, where X is that artifact's converted mana cost"; - } + HoardSmelterEffect() { + super(Constants.Duration.EndOfTurn, Constants.Layer.PTChangingEffects_7, Constants.SubLayer.ModifyPT_7c, Constants.Outcome.BoostCreature); + staticText = "{this} gets +X/+0 until end of turn, where X is that artifact's converted mana cost"; + } - HoardSmelterEffect(final HoardSmelterEffect effect) { - super(effect); - this.costValue = effect.costValue; - } + HoardSmelterEffect(final HoardSmelterEffect effect) { + super(effect); + this.costValue = effect.costValue; + } - @Override - public boolean apply(Game game, Ability source) { - Permanent target = game.getPermanent(source.getSourceId()); - if (target != null) { - target.addPower(costValue); - return true; - } - return false; - } + @Override + public boolean apply(Game game, Ability source) { + Permanent target = game.getPermanent(source.getSourceId()); + if (target != null) { + target.addPower(costValue); + return true; + } + return false; + } - @Override - public void init(Ability source, Game game) { - Card targeted = game.getCard(source.getFirstTarget()); - if (targeted != null) { - costValue = targeted.getManaCost().convertedManaCost(); - } - } + @Override + public void init(Ability source, Game game) { + Card targeted = game.getCard(source.getFirstTarget()); + if (targeted != null) { + costValue = targeted.getManaCost().convertedManaCost(); + } + } - @Override - public HoardSmelterEffect copy() { - return new HoardSmelterEffect(this); - } + @Override + public HoardSmelterEffect copy() { + return new HoardSmelterEffect(this); + } } \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/scarsofmirrodin/IchorRats.java b/Mage.Sets/src/mage/sets/scarsofmirrodin/IchorRats.java index dad7160831..f301428c2e 100644 --- a/Mage.Sets/src/mage/sets/scarsofmirrodin/IchorRats.java +++ b/Mage.Sets/src/mage/sets/scarsofmirrodin/IchorRats.java @@ -53,7 +53,7 @@ public class IchorRats extends CardImpl { super(ownerId, 67, "Ichor Rats", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{1}{B}{B}"); this.expansionSetCode = "SOM"; this.subtype.add("Rat"); - this.color.setBlack(true); + this.color.setBlack(true); this.power = new MageInt(2); this.toughness = new MageInt(1); this.addAbility(InfectAbility.getInstance()); diff --git a/Mage.Sets/src/mage/sets/scarsofmirrodin/IndomitableArchangel.java b/Mage.Sets/src/mage/sets/scarsofmirrodin/IndomitableArchangel.java index 767f3867d4..9a052edaa5 100644 --- a/Mage.Sets/src/mage/sets/scarsofmirrodin/IndomitableArchangel.java +++ b/Mage.Sets/src/mage/sets/scarsofmirrodin/IndomitableArchangel.java @@ -55,8 +55,8 @@ public class IndomitableArchangel extends CardImpl { private static FilterPermanent filter = new FilterPermanent("Artifacts"); static { - filter.getCardType().add(CardType.ARTIFACT); - } + filter.getCardType().add(CardType.ARTIFACT); + } public IndomitableArchangel(UUID ownerId) { super(ownerId, 11, "Indomitable Archangel", Rarity.MYTHIC, new CardType[]{CardType.CREATURE}, "{2}{W}{W}"); diff --git a/Mage.Sets/src/mage/sets/scarsofmirrodin/InexorableTide.java b/Mage.Sets/src/mage/sets/scarsofmirrodin/InexorableTide.java index a9b72fbada..2744f194d4 100644 --- a/Mage.Sets/src/mage/sets/scarsofmirrodin/InexorableTide.java +++ b/Mage.Sets/src/mage/sets/scarsofmirrodin/InexorableTide.java @@ -44,7 +44,7 @@ public class InexorableTide extends CardImpl { public InexorableTide (UUID ownerId) { super(ownerId, 35, "Inexorable Tide", Rarity.RARE, new CardType[]{CardType.ENCHANTMENT}, "{3}{U}{U}"); this.expansionSetCode = "SOM"; - this.color.setBlue(true); + this.color.setBlue(true); this.addAbility(new SpellCastTriggeredAbility(new ProliferateEffect(), false)); } diff --git a/Mage.Sets/src/mage/sets/scarsofmirrodin/InstillInfection.java b/Mage.Sets/src/mage/sets/scarsofmirrodin/InstillInfection.java index d57b3a34e3..2de0303238 100644 --- a/Mage.Sets/src/mage/sets/scarsofmirrodin/InstillInfection.java +++ b/Mage.Sets/src/mage/sets/scarsofmirrodin/InstillInfection.java @@ -46,7 +46,7 @@ public class InstillInfection extends CardImpl { public InstillInfection (UUID ownerId) { super(ownerId, 68, "Instill Infection", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{3}{B}"); this.expansionSetCode = "SOM"; - this.color.setBlack(true); + this.color.setBlack(true); this.getSpellAbility().addEffect(new AddCountersTargetEffect(CounterType.M1M1.createInstance())); this.getSpellAbility().addEffect(new DrawCardControllerEffect(1)); this.getSpellAbility().addTarget(new TargetCreaturePermanent()); diff --git a/Mage.Sets/src/mage/sets/scarsofmirrodin/Island1.java b/Mage.Sets/src/mage/sets/scarsofmirrodin/Island1.java index 00accdf04e..74fa9d94d5 100644 --- a/Mage.Sets/src/mage/sets/scarsofmirrodin/Island1.java +++ b/Mage.Sets/src/mage/sets/scarsofmirrodin/Island1.java @@ -36,18 +36,18 @@ import java.util.UUID; */ public class Island1 extends mage.cards.basiclands.Island { - public Island1(UUID ownerId) { - super(ownerId, 234); - this.expansionSetCode = "SOM"; - } + public Island1(UUID ownerId) { + super(ownerId, 234); + this.expansionSetCode = "SOM"; + } - public Island1(final Island1 card) { - super(card); - } + public Island1(final Island1 card) { + super(card); + } - @Override - public Island1 copy() { - return new Island1(this); - } + @Override + public Island1 copy() { + return new Island1(this); + } } diff --git a/Mage.Sets/src/mage/sets/scarsofmirrodin/Island2.java b/Mage.Sets/src/mage/sets/scarsofmirrodin/Island2.java index c5a50ec861..0f5004a6c3 100644 --- a/Mage.Sets/src/mage/sets/scarsofmirrodin/Island2.java +++ b/Mage.Sets/src/mage/sets/scarsofmirrodin/Island2.java @@ -36,18 +36,18 @@ import java.util.UUID; */ public class Island2 extends mage.cards.basiclands.Island { - public Island2(UUID ownerId) { - super(ownerId, 235); - this.expansionSetCode = "SOM"; - } + public Island2(UUID ownerId) { + super(ownerId, 235); + this.expansionSetCode = "SOM"; + } - public Island2(final Island2 card) { - super(card); - } + public Island2(final Island2 card) { + super(card); + } - @Override - public Island2 copy() { - return new Island2(this); - } + @Override + public Island2 copy() { + return new Island2(this); + } } diff --git a/Mage.Sets/src/mage/sets/scarsofmirrodin/Island3.java b/Mage.Sets/src/mage/sets/scarsofmirrodin/Island3.java index 9d8b64af1d..83438d2e63 100644 --- a/Mage.Sets/src/mage/sets/scarsofmirrodin/Island3.java +++ b/Mage.Sets/src/mage/sets/scarsofmirrodin/Island3.java @@ -36,18 +36,18 @@ import java.util.UUID; */ public class Island3 extends mage.cards.basiclands.Island { - public Island3(UUID ownerId) { - super(ownerId, 236); - this.expansionSetCode = "SOM"; - } + public Island3(UUID ownerId) { + super(ownerId, 236); + this.expansionSetCode = "SOM"; + } - public Island3(final Island3 card) { - super(card); - } + public Island3(final Island3 card) { + super(card); + } - @Override - public Island3 copy() { - return new Island3(this); - } + @Override + public Island3 copy() { + return new Island3(this); + } } diff --git a/Mage.Sets/src/mage/sets/scarsofmirrodin/Island4.java b/Mage.Sets/src/mage/sets/scarsofmirrodin/Island4.java index 217a5d5199..92c2e5fc76 100644 --- a/Mage.Sets/src/mage/sets/scarsofmirrodin/Island4.java +++ b/Mage.Sets/src/mage/sets/scarsofmirrodin/Island4.java @@ -36,18 +36,18 @@ import java.util.UUID; */ public class Island4 extends mage.cards.basiclands.Island { - public Island4(UUID ownerId) { - super(ownerId, 237); - this.expansionSetCode = "SOM"; - } + public Island4(UUID ownerId) { + super(ownerId, 237); + this.expansionSetCode = "SOM"; + } - public Island4(final Island4 card) { - super(card); - } + public Island4(final Island4 card) { + super(card); + } - @Override - public Island4 copy() { - return new Island4(this); - } + @Override + public Island4 copy() { + return new Island4(this); + } } diff --git a/Mage.Sets/src/mage/sets/scarsofmirrodin/KembasSkyguard.java b/Mage.Sets/src/mage/sets/scarsofmirrodin/KembasSkyguard.java index dcd440bf22..a56a154afc 100644 --- a/Mage.Sets/src/mage/sets/scarsofmirrodin/KembasSkyguard.java +++ b/Mage.Sets/src/mage/sets/scarsofmirrodin/KembasSkyguard.java @@ -43,26 +43,26 @@ import mage.cards.CardImpl; */ public class KembasSkyguard extends CardImpl { - public KembasSkyguard(UUID ownerId) { - super(ownerId, 13, "Kemba's Skyguard", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{1}{W}{W}"); - this.expansionSetCode = "SOM"; - this.subtype.add("Cat"); - this.subtype.add("Knight"); + public KembasSkyguard(UUID ownerId) { + super(ownerId, 13, "Kemba's Skyguard", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{1}{W}{W}"); + this.expansionSetCode = "SOM"; + this.subtype.add("Cat"); + this.subtype.add("Knight"); - this.color.setWhite(true); - this.power = new MageInt(2); - this.toughness = new MageInt(2); + this.color.setWhite(true); + this.power = new MageInt(2); + this.toughness = new MageInt(2); - this.addAbility(FlyingAbility.getInstance()); - this.addAbility(new EntersBattlefieldTriggeredAbility(new GainLifeEffect(2))); - } + this.addAbility(FlyingAbility.getInstance()); + this.addAbility(new EntersBattlefieldTriggeredAbility(new GainLifeEffect(2))); + } - public KembasSkyguard(final KembasSkyguard card) { - super(card); - } + public KembasSkyguard(final KembasSkyguard card) { + super(card); + } - @Override - public KembasSkyguard copy() { - return new KembasSkyguard(this); - } + @Override + public KembasSkyguard copy() { + return new KembasSkyguard(this); + } } diff --git a/Mage.Sets/src/mage/sets/scarsofmirrodin/KothOfTheHammer.java b/Mage.Sets/src/mage/sets/scarsofmirrodin/KothOfTheHammer.java index f57bfa3e68..7ed188c138 100644 --- a/Mage.Sets/src/mage/sets/scarsofmirrodin/KothOfTheHammer.java +++ b/Mage.Sets/src/mage/sets/scarsofmirrodin/KothOfTheHammer.java @@ -68,7 +68,7 @@ public class KothOfTheHammer extends CardImpl { static { filter.getSubtype().add("Mountain"); - filter.setTargetController(Constants.TargetController.YOU); + filter.setTargetController(Constants.TargetController.YOU); filterCount.getSubtype().add("Mountain"); filterCount.setTargetController(Constants.TargetController.YOU); } @@ -77,9 +77,9 @@ public class KothOfTheHammer extends CardImpl { super(ownerId, 94, "Koth of the Hammer", Rarity.MYTHIC, new CardType[]{CardType.PLANESWALKER}, "{2}{R}{R}"); this.expansionSetCode = "SOM"; this.subtype.add("Koth"); - this.color.setRed(true); + this.color.setRed(true); this.addAbility(new EntersBattlefieldAbility(new AddCountersSourceEffect(CounterType.LOYALTY.createInstance(3)), "")); - + Ability ability = new LoyaltyAbility(new UntapTargetEffect(), 1); ability.addEffect(new BecomesCreatureTargetEffect(new KothOfTheHammerToken(), "land", Duration.EndOfTurn)); ability.addTarget(new TargetLandPermanent(filter)); @@ -99,15 +99,15 @@ public class KothOfTheHammer extends CardImpl { } class KothOfTheHammerToken extends Token { - public KothOfTheHammerToken() { - super("Elemental", "4/4 red Elemental"); - this.cardType.add(CardType.CREATURE); - this.subtype.add("Elemental"); + public KothOfTheHammerToken() { + super("Elemental", "4/4 red Elemental"); + this.cardType.add(CardType.CREATURE); + this.subtype.add("Elemental"); - this.color.setRed(true); - this.power = new MageInt(4); - this.toughness = new MageInt(4); - } + this.color.setRed(true); + this.power = new MageInt(4); + this.toughness = new MageInt(4); + } } class KothOfTheHammerThirdEffect extends ContinuousEffectImpl { @@ -121,7 +121,7 @@ class KothOfTheHammerThirdEffect extends ContinuousEffectImpl { - public KuldothaPhoenix(UUID ownerId) { - super(ownerId, 95, "Kuldotha Phoenix", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{2}{R}{R}{R}"); - this.expansionSetCode = "SOM"; - this.subtype.add("Phoenix"); - this.color.setRed(true); - this.power = new MageInt(4); - this.toughness = new MageInt(4); + public KuldothaPhoenix(UUID ownerId) { + super(ownerId, 95, "Kuldotha Phoenix", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{2}{R}{R}{R}"); + this.expansionSetCode = "SOM"; + this.subtype.add("Phoenix"); + this.color.setRed(true); + this.power = new MageInt(4); + this.toughness = new MageInt(4); - this.addAbility(FlyingAbility.getInstance()); - this.addAbility(HasteAbility.getInstance()); - Ability ability = new SimpleActivatedAbility(Zone.GRAVEYARD, new ReturnSourceFromGraveyardToBattlefieldEffect(true), new ManaCostsImpl("{4}")); - ability.addCost(new MetalcraftCost()); - ability.addCost(new OnlyDuringUpkeepCost()); - this.addAbility(ability); - } + this.addAbility(FlyingAbility.getInstance()); + this.addAbility(HasteAbility.getInstance()); + Ability ability = new SimpleActivatedAbility(Zone.GRAVEYARD, new ReturnSourceFromGraveyardToBattlefieldEffect(true), new ManaCostsImpl("{4}")); + ability.addCost(new MetalcraftCost()); + ability.addCost(new OnlyDuringUpkeepCost()); + this.addAbility(ability); + } - public KuldothaPhoenix(final KuldothaPhoenix card) { - super(card); - } + public KuldothaPhoenix(final KuldothaPhoenix card) { + super(card); + } - @Override - public KuldothaPhoenix copy() { - return new KuldothaPhoenix(this); - } + @Override + public KuldothaPhoenix copy() { + return new KuldothaPhoenix(this); + } } \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/scarsofmirrodin/KuldothaRebirth.java b/Mage.Sets/src/mage/sets/scarsofmirrodin/KuldothaRebirth.java index 9648c6ff3c..bfb5277113 100644 --- a/Mage.Sets/src/mage/sets/scarsofmirrodin/KuldothaRebirth.java +++ b/Mage.Sets/src/mage/sets/scarsofmirrodin/KuldothaRebirth.java @@ -55,7 +55,7 @@ public class KuldothaRebirth extends CardImpl { public KuldothaRebirth (UUID ownerId) { super(ownerId, 96, "Kuldotha Rebirth", Rarity.COMMON, new CardType[]{CardType.SORCERY}, "{R}"); this.expansionSetCode = "SOM"; - this.color.setRed(true); + this.color.setRed(true); this.getSpellAbility().addEffect(new CreateTokenEffect(new GoblinToken(), 3)); this.getSpellAbility().addCost(new SacrificeTargetCost(new TargetControlledPermanent(filter))); } diff --git a/Mage.Sets/src/mage/sets/scarsofmirrodin/LeoninArbiter.java b/Mage.Sets/src/mage/sets/scarsofmirrodin/LeoninArbiter.java index 9d04374f2d..fc0479269d 100644 --- a/Mage.Sets/src/mage/sets/scarsofmirrodin/LeoninArbiter.java +++ b/Mage.Sets/src/mage/sets/scarsofmirrodin/LeoninArbiter.java @@ -52,84 +52,84 @@ import mage.players.Player; */ public class LeoninArbiter extends CardImpl { - public LeoninArbiter(UUID ownerId) { - super(ownerId, 14, "Leonin Arbiter", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{1}{W}"); - this.expansionSetCode = "SOM"; - this.subtype.add("Cat"); - this.subtype.add("Cleric"); + public LeoninArbiter(UUID ownerId) { + super(ownerId, 14, "Leonin Arbiter", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{1}{W}"); + this.expansionSetCode = "SOM"; + this.subtype.add("Cat"); + this.subtype.add("Cleric"); - this.color.setWhite(true); - this.power = new MageInt(2); - this.toughness = new MageInt(2); + this.color.setWhite(true); + this.power = new MageInt(2); + this.toughness = new MageInt(2); - this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new LeoninArbiterReplacementEffect())); - } + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new LeoninArbiterReplacementEffect())); + } - public LeoninArbiter(final LeoninArbiter card) { - super(card); - } + public LeoninArbiter(final LeoninArbiter card) { + super(card); + } - @Override - public LeoninArbiter copy() { - return new LeoninArbiter(this); - } + @Override + public LeoninArbiter copy() { + return new LeoninArbiter(this); + } } class LeoninArbiterReplacementEffect extends ReplacementEffectImpl { - private static final String effectText = "Players can't search libraries. Any player may pay {2} for that player to ignore this effect until end of turn"; - private List paidPlayers = new ArrayList(); + private static final String effectText = "Players can't search libraries. Any player may pay {2} for that player to ignore this effect until end of turn"; + private List paidPlayers = new ArrayList(); - LeoninArbiterReplacementEffect ( ) { - super(Duration.WhileOnBattlefield, Outcome.Neutral); - staticText = effectText; - } + LeoninArbiterReplacementEffect ( ) { + super(Duration.WhileOnBattlefield, Outcome.Neutral); + staticText = effectText; + } - LeoninArbiterReplacementEffect ( LeoninArbiterReplacementEffect effect ) { - super(effect); - this.paidPlayers = effect.paidPlayers; - } + LeoninArbiterReplacementEffect ( LeoninArbiterReplacementEffect effect ) { + super(effect); + this.paidPlayers = effect.paidPlayers; + } - @Override - public boolean apply(Game game, Ability source) { - throw new UnsupportedOperationException("Not supported."); - } + @Override + public boolean apply(Game game, Ability source) { + throw new UnsupportedOperationException("Not supported."); + } - @Override - public boolean replaceEvent(GameEvent event, Ability source, Game game) { - if ( event.getType() == EventType.SEARCH_LIBRARY && !paidPlayers.contains(event.getPlayerId()) ) { - Player player = game.getPlayer(event.getPlayerId()); + @Override + public boolean replaceEvent(GameEvent event, Ability source, Game game) { + if ( event.getType() == EventType.SEARCH_LIBRARY && !paidPlayers.contains(event.getPlayerId()) ) { + Player player = game.getPlayer(event.getPlayerId()); - if ( player != null ) { - ManaCostsImpl arbiterTax = new ManaCostsImpl("{2}"); - if ( arbiterTax.canPay(source.getSourceId(), event.getPlayerId(), game) && - player.chooseUse(Outcome.Neutral, "Pay {2} to search your library?", game) ) - { - if (arbiterTax.payOrRollback(source, game, this.getId(), event.getPlayerId()) ) { - paidPlayers.add(event.getPlayerId()); - return false; - } - } - } - return true; - } - return false; - } + if ( player != null ) { + ManaCostsImpl arbiterTax = new ManaCostsImpl("{2}"); + if ( arbiterTax.canPay(source.getSourceId(), event.getPlayerId(), game) && + player.chooseUse(Outcome.Neutral, "Pay {2} to search your library?", game) ) + { + if (arbiterTax.payOrRollback(source, game, this.getId(), event.getPlayerId()) ) { + paidPlayers.add(event.getPlayerId()); + return false; + } + } + } + return true; + } + return false; + } - @Override - public boolean applies(GameEvent event, Ability source, Game game) { - if ( event.getType() == EventType.SEARCH_LIBRARY ) { - return true; - } - if ( event.getType() == EventType.END_TURN_STEP_POST ) { - this.paidPlayers.clear(); - } - return false; - } - - @Override - public LeoninArbiterReplacementEffect copy() { - return new LeoninArbiterReplacementEffect(this); - } + @Override + public boolean applies(GameEvent event, Ability source, Game game) { + if ( event.getType() == EventType.SEARCH_LIBRARY ) { + return true; + } + if ( event.getType() == EventType.END_TURN_STEP_POST ) { + this.paidPlayers.clear(); + } + return false; + } + + @Override + public LeoninArbiterReplacementEffect copy() { + return new LeoninArbiterReplacementEffect(this); + } } diff --git a/Mage.Sets/src/mage/sets/scarsofmirrodin/LiegeOfTheTangle.java b/Mage.Sets/src/mage/sets/scarsofmirrodin/LiegeOfTheTangle.java index ab1f00fcbe..3bf7b8d11b 100644 --- a/Mage.Sets/src/mage/sets/scarsofmirrodin/LiegeOfTheTangle.java +++ b/Mage.Sets/src/mage/sets/scarsofmirrodin/LiegeOfTheTangle.java @@ -64,11 +64,11 @@ public class LiegeOfTheTangle extends CardImpl { super(ownerId, 123, "Liege of the Tangle", Rarity.MYTHIC, new CardType[]{CardType.CREATURE}, "{6}{G}{G}"); this.expansionSetCode = "SOM"; this.subtype.add("Elemental"); - this.color.setGreen(true); + this.color.setGreen(true); this.power = new MageInt(8); this.toughness = new MageInt(8); - this.addAbility(TrampleAbility.getInstance()); - this.addAbility(new LiegeOfTheTangleTriggeredAbility()); + this.addAbility(TrampleAbility.getInstance()); + this.addAbility(new LiegeOfTheTangleTriggeredAbility()); } public LiegeOfTheTangle (final LiegeOfTheTangle card) { @@ -82,113 +82,113 @@ public class LiegeOfTheTangle extends CardImpl { } class LiegeOfTheTangleTriggeredAbility extends TriggeredAbilityImpl { - LiegeOfTheTangleTriggeredAbility() { - super(Zone.BATTLEFIELD, new AddCountersTargetEffect(CounterType.AWAKENING.createInstance())); - this.addEffect(new LiegeOfTheTangleEffect()); -// Ability ability = new SimpleStaticAbility(Constants.Zone.BATTLEFIELD, -// new ConditionalContinousEffect( + LiegeOfTheTangleTriggeredAbility() { + super(Zone.BATTLEFIELD, new AddCountersTargetEffect(CounterType.AWAKENING.createInstance())); + this.addEffect(new LiegeOfTheTangleEffect()); +// Ability ability = new SimpleStaticAbility(Constants.Zone.BATTLEFIELD, +// new ConditionalContinousEffect( // new BecomesCreatureSourceEOTEffect(new AwakeningLandToken(), "land"), // new HaveCounter(CounterType.AWAKENING), // "This land is an 8/8 green Elemental creature for as long as it has an awakening counter on it. It's still a land")); // this.addEffect(new GainAbilityTargetEffect(ability, Constants.Duration.EndOfGame)); - Target target = new TargetLandPermanent(0, Integer.MAX_VALUE, new FilterLandPermanent(), true); - this.addTarget(target); - } + Target target = new TargetLandPermanent(0, Integer.MAX_VALUE, new FilterLandPermanent(), true); + this.addTarget(target); + } - public LiegeOfTheTangleTriggeredAbility(final LiegeOfTheTangleTriggeredAbility ability) { - super(ability); - } + public LiegeOfTheTangleTriggeredAbility(final LiegeOfTheTangleTriggeredAbility ability) { + super(ability); + } - @Override - public LiegeOfTheTangleTriggeredAbility copy() { - return new LiegeOfTheTangleTriggeredAbility(this); - } + @Override + public LiegeOfTheTangleTriggeredAbility copy() { + return new LiegeOfTheTangleTriggeredAbility(this); + } - @Override + @Override public boolean checkTrigger(GameEvent event, Game game) { if (event instanceof DamagedPlayerEvent) { DamagedPlayerEvent damageEvent = (DamagedPlayerEvent)event; Permanent p = game.getPermanent(event.getSourceId()); if (damageEvent.isCombatDamage() && p != null && p.getId().equals(this.getSourceId())) { - return true; + return true; } } return false; } - @Override - public String getRule() { - return "Whenever {this} deals combat damage to a player, you may choose any number of target lands you control and put an awakening counter on each of them. Each of those lands is an 8/8 green Elemental creature for as long as it has an awakening counter on it. They're still lands."; - } + @Override + public String getRule() { + return "Whenever {this} deals combat damage to a player, you may choose any number of target lands you control and put an awakening counter on each of them. Each of those lands is an 8/8 green Elemental creature for as long as it has an awakening counter on it. They're still lands."; + } } class LiegeOfTheTangleEffect extends ContinuousEffectImpl { - private static AwakeningLandToken token = new AwakeningLandToken(); + private static AwakeningLandToken token = new AwakeningLandToken(); - public LiegeOfTheTangleEffect() { - super(Duration.EndOfGame, Outcome.BecomeCreature); - } + public LiegeOfTheTangleEffect() { + super(Duration.EndOfGame, Outcome.BecomeCreature); + } - public LiegeOfTheTangleEffect(final LiegeOfTheTangleEffect effect) { - super(effect); - } + public LiegeOfTheTangleEffect(final LiegeOfTheTangleEffect effect) { + super(effect); + } - @Override - public boolean apply(Layer layer, SubLayer sublayer, Ability source, Game game) { - for (UUID permId: objects) { - Permanent perm = game.getPermanent(permId); - if (perm != null) { - if (perm.getCounters().getCount(CounterType.AWAKENING) > 0) { - switch (layer) { - case TypeChangingEffects_4: - if (sublayer == SubLayer.NA) { - perm.getCardType().addAll(token.getCardType()); - perm.getSubtype().addAll(token.getSubtype()); - } - break; - case ColorChangingEffects_5: - if (sublayer == SubLayer.NA) { - perm.getColor().setColor(token.getColor()); - } - break; - case PTChangingEffects_7: - if (sublayer == SubLayer.SetPT_7b) { - perm.getPower().setValue(token.getPower().getValue()); - perm.getToughness().setValue(token.getToughness().getValue()); - } - break; - } - } - } - } - return true; - } + @Override + public boolean apply(Layer layer, SubLayer sublayer, Ability source, Game game) { + for (UUID permId: objects) { + Permanent perm = game.getPermanent(permId); + if (perm != null) { + if (perm.getCounters().getCount(CounterType.AWAKENING) > 0) { + switch (layer) { + case TypeChangingEffects_4: + if (sublayer == SubLayer.NA) { + perm.getCardType().addAll(token.getCardType()); + perm.getSubtype().addAll(token.getSubtype()); + } + break; + case ColorChangingEffects_5: + if (sublayer == SubLayer.NA) { + perm.getColor().setColor(token.getColor()); + } + break; + case PTChangingEffects_7: + if (sublayer == SubLayer.SetPT_7b) { + perm.getPower().setValue(token.getPower().getValue()); + perm.getToughness().setValue(token.getToughness().getValue()); + } + break; + } + } + } + } + return true; + } - @Override - public boolean apply(Game game, Ability source) { - return false; - } + @Override + public boolean apply(Game game, Ability source) { + return false; + } - @Override - public void init(Ability source, Game game) { - super.init(source, game); - if (this.affectedObjectsSet) { - for (UUID permId: targetPointer.getTargets(game, source)) { - objects.add(permId); - } - } - } + @Override + public void init(Ability source, Game game) { + super.init(source, game); + if (this.affectedObjectsSet) { + for (UUID permId: targetPointer.getTargets(game, source)) { + objects.add(permId); + } + } + } - @Override - public LiegeOfTheTangleEffect copy() { - return new LiegeOfTheTangleEffect(this); - } + @Override + public LiegeOfTheTangleEffect copy() { + return new LiegeOfTheTangleEffect(this); + } - @Override - public boolean hasLayer(Layer layer) { - return layer == Layer.PTChangingEffects_7 || layer == Layer.ColorChangingEffects_5 || layer == layer.TypeChangingEffects_4; - } + @Override + public boolean hasLayer(Layer layer) { + return layer == Layer.PTChangingEffects_7 || layer == Layer.ColorChangingEffects_5 || layer == layer.TypeChangingEffects_4; + } } @@ -197,10 +197,10 @@ class AwakeningLandToken extends Token { public AwakeningLandToken() { super("", "an 8/8 green Elemental creature"); cardType.add(CardType.CREATURE); - color.setGreen(true); - subtype.add("Elemental"); - power = new MageInt(8); - toughness = new MageInt(8); + color.setGreen(true); + subtype.add("Elemental"); + power = new MageInt(8); + toughness = new MageInt(8); } } diff --git a/Mage.Sets/src/mage/sets/scarsofmirrodin/Lifesmith.java b/Mage.Sets/src/mage/sets/scarsofmirrodin/Lifesmith.java index d1527f8f18..0f3b7e00dc 100644 --- a/Mage.Sets/src/mage/sets/scarsofmirrodin/Lifesmith.java +++ b/Mage.Sets/src/mage/sets/scarsofmirrodin/Lifesmith.java @@ -62,7 +62,7 @@ public class Lifesmith extends CardImpl { this.subtype.add("Human"); this.subtype.add("Artificer"); - this.color.setGreen(true); + this.color.setGreen(true); this.power = new MageInt(2); this.toughness = new MageInt(1); diff --git a/Mage.Sets/src/mage/sets/scarsofmirrodin/LoxodonWayfarer.java b/Mage.Sets/src/mage/sets/scarsofmirrodin/LoxodonWayfarer.java index 7f945e08ff..fc0ee951bc 100644 --- a/Mage.Sets/src/mage/sets/scarsofmirrodin/LoxodonWayfarer.java +++ b/Mage.Sets/src/mage/sets/scarsofmirrodin/LoxodonWayfarer.java @@ -46,7 +46,7 @@ public class LoxodonWayfarer extends CardImpl { this.expansionSetCode = "SOM"; this.subtype.add("Elephant"); this.subtype.add("Monk"); - this.color.setWhite(true); + this.color.setWhite(true); this.power = new MageInt(1); this.toughness = new MageInt(5); } diff --git a/Mage.Sets/src/mage/sets/scarsofmirrodin/LumengridDrake.java b/Mage.Sets/src/mage/sets/scarsofmirrodin/LumengridDrake.java index 2b9b42c1c8..c3940cc73f 100644 --- a/Mage.Sets/src/mage/sets/scarsofmirrodin/LumengridDrake.java +++ b/Mage.Sets/src/mage/sets/scarsofmirrodin/LumengridDrake.java @@ -51,7 +51,7 @@ public class LumengridDrake extends CardImpl { super(ownerId, 36, "Lumengrid Drake", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{3}{U}"); this.expansionSetCode = "SOM"; this.subtype.add("Drake"); - + this.color.setBlue(true); this.power = new MageInt(2); this.toughness = new MageInt(2); diff --git a/Mage.Sets/src/mage/sets/scarsofmirrodin/MeltTerrain.java b/Mage.Sets/src/mage/sets/scarsofmirrodin/MeltTerrain.java index b7c8159d0e..8873b37284 100644 --- a/Mage.Sets/src/mage/sets/scarsofmirrodin/MeltTerrain.java +++ b/Mage.Sets/src/mage/sets/scarsofmirrodin/MeltTerrain.java @@ -52,7 +52,7 @@ public class MeltTerrain extends CardImpl { public MeltTerrain (UUID ownerId) { super(ownerId, 97, "Melt Terrain", Rarity.COMMON, new CardType[]{CardType.SORCERY}, "{2}{R}{R}"); this.expansionSetCode = "SOM"; - this.color.setRed(true); + this.color.setRed(true); this.getSpellAbility().addEffect(new DestroyTargetEffect()); this.getSpellAbility().addEffect(new MeltTerrainEffect()); this.getSpellAbility().addTarget(new TargetLandPermanent()); diff --git a/Mage.Sets/src/mage/sets/scarsofmirrodin/Memoricide.java b/Mage.Sets/src/mage/sets/scarsofmirrodin/Memoricide.java index 5b444c07d4..1645cabd5e 100644 --- a/Mage.Sets/src/mage/sets/scarsofmirrodin/Memoricide.java +++ b/Mage.Sets/src/mage/sets/scarsofmirrodin/Memoricide.java @@ -50,79 +50,79 @@ import mage.target.TargetPlayer; */ public class Memoricide extends CardImpl { - public Memoricide(UUID ownerId) { - super(ownerId, 69, "Memoricide", Rarity.RARE, new CardType[]{CardType.SORCERY}, "{3}{B}"); - this.expansionSetCode = "SOM"; - this.color.setBlack(true); + public Memoricide(UUID ownerId) { + super(ownerId, 69, "Memoricide", Rarity.RARE, new CardType[]{CardType.SORCERY}, "{3}{B}"); + this.expansionSetCode = "SOM"; + this.color.setBlack(true); // Name a nonland card. Search target player's graveyard, hand, and library for any number of cards with // that name and exile them. Then that player shuffles his or her library - this.getSpellAbility().addTarget(new TargetPlayer()); - this.getSpellAbility().addEffect(new MemoricideEffect()); - } + this.getSpellAbility().addTarget(new TargetPlayer()); + this.getSpellAbility().addEffect(new MemoricideEffect()); + } - public Memoricide(final Memoricide card) { - super(card); - } + public Memoricide(final Memoricide card) { + super(card); + } - @Override - public Memoricide copy() { - return new Memoricide(this); - } + @Override + public Memoricide copy() { + return new Memoricide(this); + } } class MemoricideEffect extends OneShotEffect { - - public MemoricideEffect() { - super(Outcome.Exile); - staticText = "Name a nonland card. Search target player's graveyard, hand, and library for any number of cards with that name and exile them. Then that player shuffles his or her library"; - } - - public MemoricideEffect(final MemoricideEffect effect) { - super(effect); - } - @Override - public boolean apply(Game game, Ability source) { - Player player = game.getPlayer(targetPointer.getFirst(game, source)); - Player controller = game.getPlayer(source.getControllerId()); - if (player != null && controller != null) { - Choice cardChoice = new ChoiceImpl(); - cardChoice.setChoices(Sets.getNonLandCardNames()); - cardChoice.clearChoice(); + public MemoricideEffect() { + super(Outcome.Exile); + staticText = "Name a nonland card. Search target player's graveyard, hand, and library for any number of cards with that name and exile them. Then that player shuffles his or her library"; + } + + public MemoricideEffect(final MemoricideEffect effect) { + super(effect); + } + + @Override + public boolean apply(Game game, Ability source) { + Player player = game.getPlayer(targetPointer.getFirst(game, source)); + Player controller = game.getPlayer(source.getControllerId()); + if (player != null && controller != null) { + Choice cardChoice = new ChoiceImpl(); + cardChoice.setChoices(Sets.getNonLandCardNames()); + cardChoice.clearChoice(); while (!controller.choose(Outcome.Exile, cardChoice, game)) { game.debugMessage("player canceled choosing name. retrying."); } - String cardName = cardChoice.getChoice(); + String cardName = cardChoice.getChoice(); game.informPlayers("Memoricide, named card: [" + cardName + "]"); - for (Card card: player.getGraveyard().getCards(game)) { - if (card.getName().equals(cardName)) { - card.moveToExile(null, "", source.getId(), game); - } - } - for (Card card: player.getHand().getCards(game)) { - if (card.getName().equals(cardName)) { - card.moveToExile(null, "", source.getId(), game); - } - } - for (Card card: player.getLibrary().getCards(game)) { - if (card.getName().equals(cardName)) { - card.moveToExile(null, "", source.getId(), game); - } - } - controller.lookAtCards("Memoricide Hand", player.getHand(), game); - controller.lookAtCards("Memoricide Library", new CardsImpl(Zone.PICK, player.getLibrary().getCards(game)), game); - player.shuffleLibrary(game); - } - return true; - } + for (Card card: player.getGraveyard().getCards(game)) { + if (card.getName().equals(cardName)) { + card.moveToExile(null, "", source.getId(), game); + } + } + for (Card card: player.getHand().getCards(game)) { + if (card.getName().equals(cardName)) { + card.moveToExile(null, "", source.getId(), game); + } + } + for (Card card: player.getLibrary().getCards(game)) { + if (card.getName().equals(cardName)) { + card.moveToExile(null, "", source.getId(), game); + } + } + controller.lookAtCards("Memoricide Hand", player.getHand(), game); + controller.lookAtCards("Memoricide Library", new CardsImpl(Zone.PICK, player.getLibrary().getCards(game)), game); + player.shuffleLibrary(game); + } + return true; + } + + @Override + public MemoricideEffect copy() { + return new MemoricideEffect(this); + } - @Override - public MemoricideEffect copy() { - return new MemoricideEffect(this); - } - } \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/scarsofmirrodin/MimicVat.java b/Mage.Sets/src/mage/sets/scarsofmirrodin/MimicVat.java index cd76757e7a..8541735bcf 100644 --- a/Mage.Sets/src/mage/sets/scarsofmirrodin/MimicVat.java +++ b/Mage.Sets/src/mage/sets/scarsofmirrodin/MimicVat.java @@ -58,162 +58,162 @@ import java.util.UUID; */ public class MimicVat extends CardImpl { - public MimicVat(UUID ownerId) { - super(ownerId, 175, "Mimic Vat", Rarity.RARE, new CardType[]{CardType.ARTIFACT}, "{3}"); - this.expansionSetCode = "SOM"; + public MimicVat(UUID ownerId) { + super(ownerId, 175, "Mimic Vat", Rarity.RARE, new CardType[]{CardType.ARTIFACT}, "{3}"); + this.expansionSetCode = "SOM"; - // Imprint - Whenever a nontoken creature dies, you may exile that card. If you do, return each other card exiled with Mimic Vat to its owner's graveyard. - this.addAbility(new MimicVatTriggeredAbility()); + // Imprint - Whenever a nontoken creature dies, you may exile that card. If you do, return each other card exiled with Mimic Vat to its owner's graveyard. + this.addAbility(new MimicVatTriggeredAbility()); - // {3}, {tap}: Put a token onto the battlefield that's a copy of the exiled card. It gains haste. Exile it at the beginning of the next end step. - Ability ability = new SimpleActivatedAbility(Constants.Zone.BATTLEFIELD, new MimicVatCreateTokenEffect(), new GenericManaCost(3)); - ability.addCost(new TapSourceCost()); - this.addAbility(ability); - } + // {3}, {tap}: Put a token onto the battlefield that's a copy of the exiled card. It gains haste. Exile it at the beginning of the next end step. + Ability ability = new SimpleActivatedAbility(Constants.Zone.BATTLEFIELD, new MimicVatCreateTokenEffect(), new GenericManaCost(3)); + ability.addCost(new TapSourceCost()); + this.addAbility(ability); + } - public MimicVat(final MimicVat card) { - super(card); - } + public MimicVat(final MimicVat card) { + super(card); + } - @Override - public MimicVat copy() { - return new MimicVat(this); - } + @Override + public MimicVat copy() { + return new MimicVat(this); + } } class MimicVatTriggeredAbility extends TriggeredAbilityImpl { - MimicVatTriggeredAbility() { - super(Constants.Zone.BATTLEFIELD, new MimicVatEffect(), true); - } + MimicVatTriggeredAbility() { + super(Constants.Zone.BATTLEFIELD, new MimicVatEffect(), true); + } - MimicVatTriggeredAbility(MimicVatTriggeredAbility ability) { - super(ability); - } + MimicVatTriggeredAbility(MimicVatTriggeredAbility ability) { + super(ability); + } - @Override - public MimicVatTriggeredAbility copy() { - return new MimicVatTriggeredAbility(this); - } + @Override + public MimicVatTriggeredAbility copy() { + return new MimicVatTriggeredAbility(this); + } - @Override - public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == GameEvent.EventType.ZONE_CHANGE) { + @Override + public boolean checkTrigger(GameEvent event, Game game) { + if (event.getType() == GameEvent.EventType.ZONE_CHANGE) { - // make sure card is on battlefield - UUID sourceCardId = getSourceId(); - if (game.getPermanent(sourceCardId) == null) { - // or it is being removed - if (game.getLastKnownInformation(sourceCardId, Constants.Zone.BATTLEFIELD) == null) { - return false; - } - } + // make sure card is on battlefield + UUID sourceCardId = getSourceId(); + if (game.getPermanent(sourceCardId) == null) { + // or it is being removed + if (game.getLastKnownInformation(sourceCardId, Constants.Zone.BATTLEFIELD) == null) { + return false; + } + } - ZoneChangeEvent zEvent = (ZoneChangeEvent) event; - Permanent permanent = zEvent.getTarget(); + ZoneChangeEvent zEvent = (ZoneChangeEvent) event; + Permanent permanent = zEvent.getTarget(); - if (permanent != null && - zEvent.getToZone() == Constants.Zone.GRAVEYARD && - zEvent.getFromZone() == Constants.Zone.BATTLEFIELD && - !(permanent instanceof PermanentToken) && - permanent.getCardType().contains(CardType.CREATURE)) { + if (permanent != null && + zEvent.getToZone() == Constants.Zone.GRAVEYARD && + zEvent.getFromZone() == Constants.Zone.BATTLEFIELD && + !(permanent instanceof PermanentToken) && + permanent.getCardType().contains(CardType.CREATURE)) { - getEffects().get(0).setTargetPointer(new FixedTarget(permanent.getId())); - return true; - } - } - return false; - } + getEffects().get(0).setTargetPointer(new FixedTarget(permanent.getId())); + return true; + } + } + return false; + } - @Override - public String getRule() { - return "Whenever a nontoken creature dies, you may exile that card. If you do, return each other card exiled with Mimic Vat to its owner's graveyard"; - } + @Override + public String getRule() { + return "Whenever a nontoken creature dies, you may exile that card. If you do, return each other card exiled with Mimic Vat to its owner's graveyard"; + } } class MimicVatEffect extends OneShotEffect { - public MimicVatEffect() { - super(Constants.Outcome.Benefit); - staticText = "exile that card"; - } + public MimicVatEffect() { + super(Constants.Outcome.Benefit); + staticText = "exile that card"; + } - public MimicVatEffect(MimicVatEffect effect) { - super(effect); - } + public MimicVatEffect(MimicVatEffect effect) { + super(effect); + } - @Override - public boolean apply(Game game, Ability source) { - Permanent permanent = game.getPermanent(source.getSourceId()); - if (permanent == null) return false; + @Override + public boolean apply(Game game, Ability source) { + Permanent permanent = game.getPermanent(source.getSourceId()); + if (permanent == null) return false; - // return older cards to graveyard - for (UUID imprinted : permanent.getImprinted()) { - Card card = game.getCard(imprinted); - card.moveToZone(Constants.Zone.GRAVEYARD, source.getSourceId(), game, false); - } - permanent.clearImprinted(game); + // return older cards to graveyard + for (UUID imprinted : permanent.getImprinted()) { + Card card = game.getCard(imprinted); + card.moveToZone(Constants.Zone.GRAVEYARD, source.getSourceId(), game, false); + } + permanent.clearImprinted(game); - // Imprint a new one - UUID target = targetPointer.getFirst(game, source); - if (target != null) { - Card card = game.getCard(target); - card.moveToExile(getId(), "Mimic Vat (Imprint)", source.getSourceId(), game); - permanent.imprint(card.getId(), game); - } + // Imprint a new one + UUID target = targetPointer.getFirst(game, source); + if (target != null) { + Card card = game.getCard(target); + card.moveToExile(getId(), "Mimic Vat (Imprint)", source.getSourceId(), game); + permanent.imprint(card.getId(), game); + } - return true; - } + return true; + } - @Override - public MimicVatEffect copy() { - return new MimicVatEffect(this); - } + @Override + public MimicVatEffect copy() { + return new MimicVatEffect(this); + } } class MimicVatCreateTokenEffect extends OneShotEffect { - public MimicVatCreateTokenEffect() { - super(Constants.Outcome.PutCreatureInPlay); - this.staticText = "Put a token onto the battlefield that's a copy of the exiled card. It gains haste. Exile it at the beginning of the next end step"; - } + public MimicVatCreateTokenEffect() { + super(Constants.Outcome.PutCreatureInPlay); + this.staticText = "Put a token onto the battlefield that's a copy of the exiled card. It gains haste. Exile it at the beginning of the next end step"; + } - public MimicVatCreateTokenEffect(final MimicVatCreateTokenEffect effect) { - super(effect); - } + public MimicVatCreateTokenEffect(final MimicVatCreateTokenEffect effect) { + super(effect); + } - @Override - public MimicVatCreateTokenEffect copy() { - return new MimicVatCreateTokenEffect(this); - } + @Override + public MimicVatCreateTokenEffect copy() { + return new MimicVatCreateTokenEffect(this); + } - @Override - public boolean apply(Game game, Ability source) { - Permanent permanent = game.getPermanent(source.getSourceId()); - if (permanent == null) return false; + @Override + public boolean apply(Game game, Ability source) { + Permanent permanent = game.getPermanent(source.getSourceId()); + if (permanent == null) return false; - if (permanent.getImprinted().size() > 0) { - Card card = game.getCard(permanent.getImprinted().get(0)); - if (card != null) { - EmptyToken token = new EmptyToken(); - CardUtil.copyTo(token).from(card); + if (permanent.getImprinted().size() > 0) { + Card card = game.getCard(permanent.getImprinted().get(0)); + if (card != null) { + EmptyToken token = new EmptyToken(); + CardUtil.copyTo(token).from(card); - token.addAbility(HasteAbility.getInstance()); - token.putOntoBattlefield(1, game, source.getSourceId(), source.getControllerId()); + token.addAbility(HasteAbility.getInstance()); + token.putOntoBattlefield(1, game, source.getSourceId(), source.getControllerId()); - ExileTargetEffect exileEffect = new ExileTargetEffect(); - exileEffect.setTargetPointer(new FixedTarget(token.getLastAddedToken())); - DelayedTriggeredAbility delayedAbility = new AtEndOfTurnDelayedTriggeredAbility(exileEffect); - delayedAbility.setSourceId(source.getSourceId()); - delayedAbility.setControllerId(source.getControllerId()); - game.addDelayedTriggeredAbility(delayedAbility); + ExileTargetEffect exileEffect = new ExileTargetEffect(); + exileEffect.setTargetPointer(new FixedTarget(token.getLastAddedToken())); + DelayedTriggeredAbility delayedAbility = new AtEndOfTurnDelayedTriggeredAbility(exileEffect); + delayedAbility.setSourceId(source.getSourceId()); + delayedAbility.setControllerId(source.getControllerId()); + game.addDelayedTriggeredAbility(delayedAbility); - return true; - } - } + return true; + } + } - return false; - } + return false; + } } diff --git a/Mage.Sets/src/mage/sets/scarsofmirrodin/Mindslaver.java b/Mage.Sets/src/mage/sets/scarsofmirrodin/Mindslaver.java index b0640958f7..31566b2772 100644 --- a/Mage.Sets/src/mage/sets/scarsofmirrodin/Mindslaver.java +++ b/Mage.Sets/src/mage/sets/scarsofmirrodin/Mindslaver.java @@ -53,11 +53,11 @@ public class Mindslaver extends CardImpl { this.supertype.add("Legendary"); // {4}, {tap}, Sacrifice Mindslaver: You control target player during that player's next turn. - Ability ability = new SimpleActivatedAbility(Constants.Zone.BATTLEFIELD, new ControlTargetPlayerNextTurnEffect(), new GenericManaCost(4)); - ability.addCost(new TapSourceCost()); - ability.addCost(new SacrificeSourceCost()); - ability.addTarget(new TargetPlayer()); - this.addAbility(ability); + Ability ability = new SimpleActivatedAbility(Constants.Zone.BATTLEFIELD, new ControlTargetPlayerNextTurnEffect(), new GenericManaCost(4)); + ability.addCost(new TapSourceCost()); + ability.addCost(new SacrificeSourceCost()); + ability.addTarget(new TargetPlayer()); + this.addAbility(ability); } public Mindslaver(final Mindslaver card) { diff --git a/Mage.Sets/src/mage/sets/scarsofmirrodin/MoltenPsyche.java b/Mage.Sets/src/mage/sets/scarsofmirrodin/MoltenPsyche.java index 9250f945f9..f8a8413e50 100644 --- a/Mage.Sets/src/mage/sets/scarsofmirrodin/MoltenPsyche.java +++ b/Mage.Sets/src/mage/sets/scarsofmirrodin/MoltenPsyche.java @@ -50,89 +50,89 @@ import mage.watchers.WatcherImpl; */ public class MoltenPsyche extends CardImpl { - public MoltenPsyche(UUID ownerId) { - super(ownerId, 98, "Molten Psyche", Rarity.RARE, new CardType[]{CardType.SORCERY}, "{1}{R}{R}"); - this.expansionSetCode = "SOM"; - this.color.setRed(true); - this.getSpellAbility().addEffect(new MoltenPsycheEffect()); - this.addWatcher(new MoltenPsycheWatcher()); - } + public MoltenPsyche(UUID ownerId) { + super(ownerId, 98, "Molten Psyche", Rarity.RARE, new CardType[]{CardType.SORCERY}, "{1}{R}{R}"); + this.expansionSetCode = "SOM"; + this.color.setRed(true); + this.getSpellAbility().addEffect(new MoltenPsycheEffect()); + this.addWatcher(new MoltenPsycheWatcher()); + } - public MoltenPsyche(final MoltenPsyche card) { - super(card); - } + public MoltenPsyche(final MoltenPsyche card) { + super(card); + } - @Override - public MoltenPsyche copy() { - return new MoltenPsyche(this); - } + @Override + public MoltenPsyche copy() { + return new MoltenPsyche(this); + } } class MoltenPsycheEffect extends OneShotEffect { - public MoltenPsycheEffect() { - super(Outcome.Neutral); - staticText = "Each player shuffles the cards from his or her hand into his or her library, then draws that many cards.\\n" + - "Metalcraft - If you control three or more artifacts, {this} deals damage to each opponent equal to the number of cards that player has drawn this turn."; - } + public MoltenPsycheEffect() { + super(Outcome.Neutral); + staticText = "Each player shuffles the cards from his or her hand into his or her library, then draws that many cards.\\n" + + "Metalcraft - If you control three or more artifacts, {this} deals damage to each opponent equal to the number of cards that player has drawn this turn."; + } - public MoltenPsycheEffect(final MoltenPsycheEffect effect) { - super(effect); - } - - @Override - public boolean apply(Game game, Ability source) { - Player sourcePlayer = game.getPlayer(source.getControllerId()); - for (UUID playerId: sourcePlayer.getInRange()) { - Player player = game.getPlayer(playerId); - if (player != null) { - int count = player.getHand().size(); - player.getLibrary().addAll(player.getHand().getCards(game), game); - player.shuffleLibrary(game); - player.getHand().clear(); - player.drawCards(count, game); - if (MetalcraftCondition.getInstance().apply(game, source) && !playerId.equals(source.getControllerId())) { + public MoltenPsycheEffect(final MoltenPsycheEffect effect) { + super(effect); + } + + @Override + public boolean apply(Game game, Ability source) { + Player sourcePlayer = game.getPlayer(source.getControllerId()); + for (UUID playerId: sourcePlayer.getInRange()) { + Player player = game.getPlayer(playerId); + if (player != null) { + int count = player.getHand().size(); + player.getLibrary().addAll(player.getHand().getCards(game), game); + player.shuffleLibrary(game); + player.getHand().clear(); + player.drawCards(count, game); + if (MetalcraftCondition.getInstance().apply(game, source) && !playerId.equals(source.getControllerId())) { MoltenPsycheWatcher watcher = (MoltenPsycheWatcher) game.getState().getWatchers().get("CardsDrawn"); player.damage(watcher.getDraws(playerId), source.getId(), game, false, true); } - } - } - return true; - } + } + } + return true; + } - @Override - public MoltenPsycheEffect copy() { - return new MoltenPsycheEffect(this); - } + @Override + public MoltenPsycheEffect copy() { + return new MoltenPsycheEffect(this); + } } class MoltenPsycheWatcher extends WatcherImpl { - private Map draws = new HashMap(); - - public MoltenPsycheWatcher() { + private Map draws = new HashMap(); + + public MoltenPsycheWatcher() { super("CardsDrawn", WatcherScope.GAME); - } - - public MoltenPsycheWatcher(final MoltenPsycheWatcher watcher) { - super(watcher); + } + + public MoltenPsycheWatcher(final MoltenPsycheWatcher watcher) { + super(watcher); for (Entry entry: watcher.draws.entrySet()) { draws.put(entry.getKey(), entry.getValue()); } - } - - @Override - public void watch(GameEvent event, Game game) { + } + + @Override + public void watch(GameEvent event, Game game) { if (event.getType() == GameEvent.EventType.DREW_CARD) { - int count = 1; - if (draws.containsKey(event.getPlayerId())) { - count += draws.get(event.getPlayerId()); - } - draws.put(event.getPlayerId(), count); - } - } + int count = 1; + if (draws.containsKey(event.getPlayerId())) { + count += draws.get(event.getPlayerId()); + } + draws.put(event.getPlayerId(), count); + } + } @Override public void reset() { @@ -140,16 +140,16 @@ class MoltenPsycheWatcher extends WatcherImpl { draws.clear(); } - public int getDraws(UUID playerId) { - if (draws.containsKey(playerId)) { - return draws.get(playerId); - } - return 0; - } - - @Override - public MoltenPsycheWatcher copy() { - return new MoltenPsycheWatcher(this); - } - + public int getDraws(UUID playerId) { + if (draws.containsKey(playerId)) { + return draws.get(playerId); + } + return 0; + } + + @Override + public MoltenPsycheWatcher copy() { + return new MoltenPsycheWatcher(this); + } + } \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/scarsofmirrodin/MoltenTailMasticore.java b/Mage.Sets/src/mage/sets/scarsofmirrodin/MoltenTailMasticore.java index 96ae94b2ab..071461ae8e 100644 --- a/Mage.Sets/src/mage/sets/scarsofmirrodin/MoltenTailMasticore.java +++ b/Mage.Sets/src/mage/sets/scarsofmirrodin/MoltenTailMasticore.java @@ -96,15 +96,15 @@ class MoltenTailMasticoreAbility extends TriggeredAbilityImpl { this.expansionSetCode = "SOM"; this.subtype.add("Human"); this.subtype.add("Warrior"); - this.color.setBlack(true); + this.color.setBlack(true); this.power = new MageInt(3); this.toughness = new MageInt(2); } diff --git a/Mage.Sets/src/mage/sets/scarsofmirrodin/Mountain1.java b/Mage.Sets/src/mage/sets/scarsofmirrodin/Mountain1.java index cd0d8fc92f..9a28698e2b 100644 --- a/Mage.Sets/src/mage/sets/scarsofmirrodin/Mountain1.java +++ b/Mage.Sets/src/mage/sets/scarsofmirrodin/Mountain1.java @@ -36,19 +36,19 @@ import java.util.UUID; */ public class Mountain1 extends mage.cards.basiclands.Mountain { - public Mountain1(UUID ownerId) { - super(ownerId, 242); - this.expansionSetCode = "SOM"; - } + public Mountain1(UUID ownerId) { + super(ownerId, 242); + this.expansionSetCode = "SOM"; + } - public Mountain1(final Mountain1 card) { - super(card); - } + public Mountain1(final Mountain1 card) { + super(card); + } - @Override - public Mountain1 copy() { - return new Mountain1(this); - } + @Override + public Mountain1 copy() { + return new Mountain1(this); + } } diff --git a/Mage.Sets/src/mage/sets/scarsofmirrodin/Mountain2.java b/Mage.Sets/src/mage/sets/scarsofmirrodin/Mountain2.java index d6e87f0e1b..d9b21965f8 100644 --- a/Mage.Sets/src/mage/sets/scarsofmirrodin/Mountain2.java +++ b/Mage.Sets/src/mage/sets/scarsofmirrodin/Mountain2.java @@ -36,18 +36,18 @@ import java.util.UUID; */ public class Mountain2 extends mage.cards.basiclands.Mountain { - public Mountain2(UUID ownerId) { - super(ownerId, 243); - this.expansionSetCode = "SOM"; - } + public Mountain2(UUID ownerId) { + super(ownerId, 243); + this.expansionSetCode = "SOM"; + } - public Mountain2(final Mountain2 card) { - super(card); - } + public Mountain2(final Mountain2 card) { + super(card); + } - @Override - public Mountain2 copy() { - return new Mountain2(this); - } + @Override + public Mountain2 copy() { + return new Mountain2(this); + } } diff --git a/Mage.Sets/src/mage/sets/scarsofmirrodin/Mountain3.java b/Mage.Sets/src/mage/sets/scarsofmirrodin/Mountain3.java index 6bc022d617..2c5f36d52f 100644 --- a/Mage.Sets/src/mage/sets/scarsofmirrodin/Mountain3.java +++ b/Mage.Sets/src/mage/sets/scarsofmirrodin/Mountain3.java @@ -36,18 +36,18 @@ import java.util.UUID; */ public class Mountain3 extends mage.cards.basiclands.Mountain { - public Mountain3(UUID ownerId) { - super(ownerId, 244); - this.expansionSetCode = "SOM"; - } + public Mountain3(UUID ownerId) { + super(ownerId, 244); + this.expansionSetCode = "SOM"; + } - public Mountain3(final Mountain3 card) { - super(card); - } + public Mountain3(final Mountain3 card) { + super(card); + } - @Override - public Mountain3 copy() { - return new Mountain3(this); - } + @Override + public Mountain3 copy() { + return new Mountain3(this); + } } diff --git a/Mage.Sets/src/mage/sets/scarsofmirrodin/Mountain4.java b/Mage.Sets/src/mage/sets/scarsofmirrodin/Mountain4.java index efc8129d5b..2dc8ae4c17 100644 --- a/Mage.Sets/src/mage/sets/scarsofmirrodin/Mountain4.java +++ b/Mage.Sets/src/mage/sets/scarsofmirrodin/Mountain4.java @@ -36,18 +36,18 @@ import java.util.UUID; */ public class Mountain4 extends mage.cards.basiclands.Mountain { - public Mountain4(UUID ownerId) { - super(ownerId, 245); - this.expansionSetCode = "SOM"; - } + public Mountain4(UUID ownerId) { + super(ownerId, 245); + this.expansionSetCode = "SOM"; + } - public Mountain4(final Mountain4 card) { - super(card); - } + public Mountain4(final Mountain4 card) { + super(card); + } - @Override - public Mountain4 copy() { - return new Mountain4(this); - } + @Override + public Mountain4 copy() { + return new Mountain4(this); + } } diff --git a/Mage.Sets/src/mage/sets/scarsofmirrodin/MoxOpal.java b/Mage.Sets/src/mage/sets/scarsofmirrodin/MoxOpal.java index 50908475a8..f2d78546ed 100644 --- a/Mage.Sets/src/mage/sets/scarsofmirrodin/MoxOpal.java +++ b/Mage.Sets/src/mage/sets/scarsofmirrodin/MoxOpal.java @@ -43,23 +43,23 @@ import java.util.UUID; */ public class MoxOpal extends CardImpl { - public MoxOpal(UUID ownerId) { - super(ownerId, 179, "Mox Opal", Rarity.MYTHIC, new CardType[]{CardType.ARTIFACT}, "{0}"); - this.supertype.add("Legendary"); - this.expansionSetCode = "SOM"; + public MoxOpal(UUID ownerId) { + super(ownerId, 179, "Mox Opal", Rarity.MYTHIC, new CardType[]{CardType.ARTIFACT}, "{0}"); + this.supertype.add("Legendary"); + this.expansionSetCode = "SOM"; - Ability ability = new AnyColorManaAbility(); - ability.addCost(new MetalcraftCost()); - this.addAbility(ability); - } + Ability ability = new AnyColorManaAbility(); + ability.addCost(new MetalcraftCost()); + this.addAbility(ability); + } - public MoxOpal(final MoxOpal card) { - super(card); - } + public MoxOpal(final MoxOpal card) { + super(card); + } - @Override - public MoxOpal copy() { - return new MoxOpal(this); - } + @Override + public MoxOpal copy() { + return new MoxOpal(this); + } } diff --git a/Mage.Sets/src/mage/sets/scarsofmirrodin/MyrBattlesphere.java b/Mage.Sets/src/mage/sets/scarsofmirrodin/MyrBattlesphere.java index 5a5490731b..9caf986191 100644 --- a/Mage.Sets/src/mage/sets/scarsofmirrodin/MyrBattlesphere.java +++ b/Mage.Sets/src/mage/sets/scarsofmirrodin/MyrBattlesphere.java @@ -59,106 +59,106 @@ import mage.target.common.TargetControlledCreaturePermanent; */ public class MyrBattlesphere extends CardImpl { - public MyrBattlesphere(UUID ownerId) { - super(ownerId, 180, "Myr Battlesphere", Rarity.RARE, new CardType[]{CardType.ARTIFACT, CardType.CREATURE}, "{7}"); - this.expansionSetCode = "SOM"; - this.subtype.add("Myr"); - this.subtype.add("Construct"); - this.power = new MageInt(4); - this.toughness = new MageInt(7); + public MyrBattlesphere(UUID ownerId) { + super(ownerId, 180, "Myr Battlesphere", Rarity.RARE, new CardType[]{CardType.ARTIFACT, CardType.CREATURE}, "{7}"); + this.expansionSetCode = "SOM"; + this.subtype.add("Myr"); + this.subtype.add("Construct"); + this.power = new MageInt(4); + this.toughness = new MageInt(7); - this.addAbility(new EntersBattlefieldTriggeredAbility(new CreateTokenEffect(new MyrToken(), 4), false)); - this.addAbility(new MyrBattlesphereAbility()); - } + this.addAbility(new EntersBattlefieldTriggeredAbility(new CreateTokenEffect(new MyrToken(), 4), false)); + this.addAbility(new MyrBattlesphereAbility()); + } - public MyrBattlesphere(final MyrBattlesphere card) { - super(card); - } + public MyrBattlesphere(final MyrBattlesphere card) { + super(card); + } - @Override - public MyrBattlesphere copy() { - return new MyrBattlesphere(this); - } + @Override + public MyrBattlesphere copy() { + return new MyrBattlesphere(this); + } } class MyrBattlesphereAbility extends TriggeredAbilityImpl { - private static final FilterControlledCreaturePermanent filter = new FilterControlledCreaturePermanent("untapped Myr"); + private static final FilterControlledCreaturePermanent filter = new FilterControlledCreaturePermanent("untapped Myr"); - static { - filter.getSubtype().add("Myr"); - filter.setTapped(false); - filter.setUseTapped(true); - } + static { + filter.getSubtype().add("Myr"); + filter.setTapped(false); + filter.setUseTapped(true); + } - public MyrBattlesphereAbility() { - super(Zone.BATTLEFIELD, new BoostSourceEffect(new GetXValue(), new StaticValue(0), Duration.EndOfTurn), true); - this.addEffect(new MyrBattlesphereEffect()); - this.addCost(new TapVariableTargetCost(new TargetControlledCreaturePermanent(1, Integer.MAX_VALUE, filter, false))); - } + public MyrBattlesphereAbility() { + super(Zone.BATTLEFIELD, new BoostSourceEffect(new GetXValue(), new StaticValue(0), Duration.EndOfTurn), true); + this.addEffect(new MyrBattlesphereEffect()); + this.addCost(new TapVariableTargetCost(new TargetControlledCreaturePermanent(1, Integer.MAX_VALUE, filter, false))); + } - public MyrBattlesphereAbility(final MyrBattlesphereAbility ability) { - super(ability); - } + public MyrBattlesphereAbility(final MyrBattlesphereAbility ability) { + super(ability); + } - @Override - public boolean checkInterveningIfClause(Game game) { - if (costs.isPaid()) - return true; + @Override + public boolean checkInterveningIfClause(Game game) { + if (costs.isPaid()) + return true; if (costs.canPay(this.getId(), this.getControllerId(), game)) return costs.pay(this, game, this.getId(), this.getControllerId(), false); return false; - } + } - @Override - public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == EventType.ATTACKER_DECLARED && event.getSourceId().equals(this.getSourceId()) ) { - costs.clearPaid(); - return true; - } - return false; - } + @Override + public boolean checkTrigger(GameEvent event, Game game) { + if (event.getType() == EventType.ATTACKER_DECLARED && event.getSourceId().equals(this.getSourceId()) ) { + costs.clearPaid(); + return true; + } + return false; + } - @Override - public String getRule() { - return "When {this} attacks, " + super.getRule(); - } + @Override + public String getRule() { + return "When {this} attacks, " + super.getRule(); + } - @Override - public MyrBattlesphereAbility copy() { - return new MyrBattlesphereAbility(this); - } + @Override + public MyrBattlesphereAbility copy() { + return new MyrBattlesphereAbility(this); + } } class MyrBattlesphereEffect extends OneShotEffect { private GetXValue amount = new GetXValue(); - - public MyrBattlesphereEffect() { - super(Outcome.Damage); - } - public MyrBattlesphereEffect(final MyrBattlesphereEffect effect) { - super(effect); + public MyrBattlesphereEffect() { + super(Outcome.Damage); + } + + public MyrBattlesphereEffect(final MyrBattlesphereEffect effect) { + super(effect); this.amount = effect.amount.clone(); - } + } - @Override - public boolean apply(Game game, Ability source) { - UUID defenderId = game.getCombat().getDefendingPlayer(source.getSourceId()); - Player defender = game.getPlayer(defenderId); - if (defender != null) { - defender.damage(amount.calculate(game, source), source.getSourceId(), game, false, false); - return true; - } - return false; - } + @Override + public boolean apply(Game game, Ability source) { + UUID defenderId = game.getCombat().getDefendingPlayer(source.getSourceId()); + Player defender = game.getPlayer(defenderId); + if (defender != null) { + defender.damage(amount.calculate(game, source), source.getSourceId(), game, false, false); + return true; + } + return false; + } - @Override - public MyrBattlesphereEffect copy() { - return new MyrBattlesphereEffect(this); - } + @Override + public MyrBattlesphereEffect copy() { + return new MyrBattlesphereEffect(this); + } } \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/scarsofmirrodin/MyrPropagator.java b/Mage.Sets/src/mage/sets/scarsofmirrodin/MyrPropagator.java index e2d526015f..0fd9e9fa4d 100644 --- a/Mage.Sets/src/mage/sets/scarsofmirrodin/MyrPropagator.java +++ b/Mage.Sets/src/mage/sets/scarsofmirrodin/MyrPropagator.java @@ -60,9 +60,9 @@ public class MyrPropagator extends CardImpl { this.toughness = new MageInt(1); // {3}, {tap}: Put a token that's a copy of Myr Propagator onto the battlefield. - Ability ability = new SimpleActivatedAbility(Constants.Zone.BATTLEFIELD, new MyrPropagatorCreateTokenEffect(), new GenericManaCost(3)); - ability.addCost(new TapSourceCost()); - this.addAbility(ability); + Ability ability = new SimpleActivatedAbility(Constants.Zone.BATTLEFIELD, new MyrPropagatorCreateTokenEffect(), new GenericManaCost(3)); + ability.addCost(new TapSourceCost()); + this.addAbility(ability); } public MyrPropagator(final MyrPropagator card) { @@ -77,38 +77,38 @@ public class MyrPropagator extends CardImpl { class MyrPropagatorCreateTokenEffect extends OneShotEffect { - public MyrPropagatorCreateTokenEffect() { - super(Constants.Outcome.PutCreatureInPlay); - this.staticText = "Put a token that's a copy of Myr Propagator onto the battlefield"; - } + public MyrPropagatorCreateTokenEffect() { + super(Constants.Outcome.PutCreatureInPlay); + this.staticText = "Put a token that's a copy of Myr Propagator onto the battlefield"; + } - public MyrPropagatorCreateTokenEffect(final MyrPropagatorCreateTokenEffect effect) { - super(effect); - } + public MyrPropagatorCreateTokenEffect(final MyrPropagatorCreateTokenEffect effect) { + super(effect); + } - @Override - public MyrPropagatorCreateTokenEffect copy() { - return new MyrPropagatorCreateTokenEffect(this); - } + @Override + public MyrPropagatorCreateTokenEffect copy() { + return new MyrPropagatorCreateTokenEffect(this); + } - @Override - public boolean apply(Game game, Ability source) { - MageObject thisCard = game.getLastKnownInformation(source.getSourceId(), Constants.Zone.BATTLEFIELD); - if (thisCard != null && thisCard instanceof Permanent) { - EmptyToken token = new EmptyToken(); - CardUtil.copyTo(token).from((Permanent)thisCard); - token.putOntoBattlefield(1, game, source.getSourceId(), source.getControllerId()); - return true; - } else { // maybe it's token - Permanent permanent = game.getBattlefield().getPermanent(source.getSourceId()); - if (permanent != null) { - EmptyToken token = new EmptyToken(); - CardUtil.copyTo(token).from(permanent); - token.putOntoBattlefield(1, game, source.getSourceId(), source.getControllerId()); - return true; - } - } - return false; - } + @Override + public boolean apply(Game game, Ability source) { + MageObject thisCard = game.getLastKnownInformation(source.getSourceId(), Constants.Zone.BATTLEFIELD); + if (thisCard != null && thisCard instanceof Permanent) { + EmptyToken token = new EmptyToken(); + CardUtil.copyTo(token).from((Permanent)thisCard); + token.putOntoBattlefield(1, game, source.getSourceId(), source.getControllerId()); + return true; + } else { // maybe it's token + Permanent permanent = game.getBattlefield().getPermanent(source.getSourceId()); + if (permanent != null) { + EmptyToken token = new EmptyToken(); + CardUtil.copyTo(token).from(permanent); + token.putOntoBattlefield(1, game, source.getSourceId(), source.getControllerId()); + return true; + } + } + return false; + } } diff --git a/Mage.Sets/src/mage/sets/scarsofmirrodin/MyrReservoir.java b/Mage.Sets/src/mage/sets/scarsofmirrodin/MyrReservoir.java index 1e8698a5f6..89f9bb8167 100644 --- a/Mage.Sets/src/mage/sets/scarsofmirrodin/MyrReservoir.java +++ b/Mage.Sets/src/mage/sets/scarsofmirrodin/MyrReservoir.java @@ -53,69 +53,69 @@ import java.util.UUID; */ public class MyrReservoir extends CardImpl { - private static final FilterCard myrCardFilter = new FilterCard("Myr card from your graveyard"); + private static final FilterCard myrCardFilter = new FilterCard("Myr card from your graveyard"); - static { - myrCardFilter.getSubtype().add("Myr"); - } + static { + myrCardFilter.getSubtype().add("Myr"); + } - public MyrReservoir(UUID ownerId) { - super(ownerId, 183, "Myr Reservoir", Rarity.RARE, new CardType[]{CardType.ARTIFACT}, "{3}"); - this.expansionSetCode = "SOM"; + public MyrReservoir(UUID ownerId) { + super(ownerId, 183, "Myr Reservoir", Rarity.RARE, new CardType[]{CardType.ARTIFACT}, "{3}"); + this.expansionSetCode = "SOM"; - // {tap}: Add {2} to your mana pool. Spend this mana only to cast Myr spells or activate abilities of Myr. - this.addAbility(new MyrReservoirManaAbility()); + // {tap}: Add {2} to your mana pool. Spend this mana only to cast Myr spells or activate abilities of Myr. + this.addAbility(new MyrReservoirManaAbility()); - // {3}, {tap}: Return target Myr card from your graveyard to your hand. - Ability ability = new SimpleActivatedAbility(Constants.Zone.BATTLEFIELD, new ReturnToHandTargetEffect(), new GenericManaCost(3)); - ability.addCost(new TapSourceCost()); - ability.addTarget(new TargetCardInYourGraveyard(myrCardFilter)); - this.addAbility(ability); - } + // {3}, {tap}: Return target Myr card from your graveyard to your hand. + Ability ability = new SimpleActivatedAbility(Constants.Zone.BATTLEFIELD, new ReturnToHandTargetEffect(), new GenericManaCost(3)); + ability.addCost(new TapSourceCost()); + ability.addTarget(new TargetCardInYourGraveyard(myrCardFilter)); + this.addAbility(ability); + } - public MyrReservoir(final MyrReservoir card) { - super(card); - } + public MyrReservoir(final MyrReservoir card) { + super(card); + } - @Override - public MyrReservoir copy() { - return new MyrReservoir(this); - } + @Override + public MyrReservoir copy() { + return new MyrReservoir(this); + } } class MyrReservoirManaAbility extends BasicManaAbility { - MyrReservoirManaAbility() { - super(new BasicManaEffect(new MyrConditionalMana())); - this.netMana.setColorless(2); - } + MyrReservoirManaAbility() { + super(new BasicManaEffect(new MyrConditionalMana())); + this.netMana.setColorless(2); + } - MyrReservoirManaAbility(MyrReservoirManaAbility ability) { - super(ability); - } + MyrReservoirManaAbility(MyrReservoirManaAbility ability) { + super(ability); + } - @Override - public MyrReservoirManaAbility copy() { - return new MyrReservoirManaAbility(this); - } + @Override + public MyrReservoirManaAbility copy() { + return new MyrReservoirManaAbility(this); + } } class MyrConditionalMana extends ConditionalMana { - public MyrConditionalMana() { - super(Mana.ColorlessMana(2)); - staticText = "Spend this mana only to cast Myr spells or activate abilities of Myr"; - addCondition(new MyrManaCondition()); - } + public MyrConditionalMana() { + super(Mana.ColorlessMana(2)); + staticText = "Spend this mana only to cast Myr spells or activate abilities of Myr"; + addCondition(new MyrManaCondition()); + } } class MyrManaCondition implements Condition { - @Override - public boolean apply(Game game, Ability source) { - MageObject object = game.getObject(source.getSourceId()); - if (object != null && object.hasSubtype("Myr")) { - return true; - } - return false; - } + @Override + public boolean apply(Game game, Ability source) { + MageObject object = game.getObject(source.getSourceId()); + if (object != null && object.hasSubtype("Myr")) { + return true; + } + return false; + } } diff --git a/Mage.Sets/src/mage/sets/scarsofmirrodin/Myrsmith.java b/Mage.Sets/src/mage/sets/scarsofmirrodin/Myrsmith.java index 77ad47051c..c44eeddff2 100644 --- a/Mage.Sets/src/mage/sets/scarsofmirrodin/Myrsmith.java +++ b/Mage.Sets/src/mage/sets/scarsofmirrodin/Myrsmith.java @@ -62,7 +62,7 @@ public class Myrsmith extends CardImpl { this.subtype.add("Human"); this.subtype.add("Artificer"); - this.color.setWhite(true); + this.color.setWhite(true); this.power = new MageInt(2); this.toughness = new MageInt(1); diff --git a/Mage.Sets/src/mage/sets/scarsofmirrodin/NecrogenScudder.java b/Mage.Sets/src/mage/sets/scarsofmirrodin/NecrogenScudder.java index 573560b473..a1d4a84276 100644 --- a/Mage.Sets/src/mage/sets/scarsofmirrodin/NecrogenScudder.java +++ b/Mage.Sets/src/mage/sets/scarsofmirrodin/NecrogenScudder.java @@ -47,7 +47,7 @@ public class NecrogenScudder extends CardImpl { super(ownerId, 71, "Necrogen Scudder", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{2}{B}"); this.expansionSetCode = "SOM"; this.subtype.add("Horror"); - this.color.setBlack(true); + this.color.setBlack(true); this.power = new MageInt(3); this.toughness = new MageInt(3); this.addAbility(new EntersBattlefieldTriggeredAbility(new LoseLifeSourceEffect(3))); diff --git a/Mage.Sets/src/mage/sets/scarsofmirrodin/NecroticOoze.java b/Mage.Sets/src/mage/sets/scarsofmirrodin/NecroticOoze.java index 5570d7bea0..afc6f0a441 100644 --- a/Mage.Sets/src/mage/sets/scarsofmirrodin/NecroticOoze.java +++ b/Mage.Sets/src/mage/sets/scarsofmirrodin/NecroticOoze.java @@ -52,78 +52,78 @@ import mage.players.Player; */ public class NecroticOoze extends CardImpl { - public NecroticOoze(UUID ownerId) { - super(ownerId, 72, "Necrotic Ooze", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{2}{B}{B}"); - this.expansionSetCode = "SOM"; - this.subtype.add("Ooze"); - this.color.setBlack(true); - this.power = new MageInt(4); - this.toughness = new MageInt(3); + public NecroticOoze(UUID ownerId) { + super(ownerId, 72, "Necrotic Ooze", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{2}{B}{B}"); + this.expansionSetCode = "SOM"; + this.subtype.add("Ooze"); + this.color.setBlack(true); + this.power = new MageInt(4); + this.toughness = new MageInt(3); - this.addAbility(new NecroticOozeAbility()); - } + this.addAbility(new NecroticOozeAbility()); + } - public NecroticOoze(final NecroticOoze card) { - super(card); - } + public NecroticOoze(final NecroticOoze card) { + super(card); + } - @Override - public NecroticOoze copy() { - return new NecroticOoze(this); - } + @Override + public NecroticOoze copy() { + return new NecroticOoze(this); + } } class NecroticOozeAbility extends StaticAbility { - public NecroticOozeAbility() { - super(Zone.BATTLEFIELD, new NecroticOozeEffect()); - } - - public NecroticOozeAbility(final NecroticOozeAbility ability) { - super(ability); - } - - @Override - public NecroticOozeAbility copy() { - return new NecroticOozeAbility(this); - } - + public NecroticOozeAbility() { + super(Zone.BATTLEFIELD, new NecroticOozeEffect()); + } + + public NecroticOozeAbility(final NecroticOozeAbility ability) { + super(ability); + } + + @Override + public NecroticOozeAbility copy() { + return new NecroticOozeAbility(this); + } + } class NecroticOozeEffect extends ContinuousEffectImpl { - public NecroticOozeEffect() { - super(Duration.WhileOnBattlefield, Layer.AbilityAddingRemovingEffects_6, SubLayer.NA, Outcome.AddAbility); - staticText = "As long as {this} is on the battlefield, it has all activated abilities of all creature cards in all graveyards"; - } - - public NecroticOozeEffect(final NecroticOozeEffect effect) { - super(effect); - } - - @Override - public boolean apply(Game game, Ability source) { - Permanent perm = game.getPermanent(source.getSourceId()); - if (perm != null) { - for (Player player: game.getPlayers().values()) { - for (Card card: player.getGraveyard().getCards(game)) { - if (card.getCardType().contains(CardType.CREATURE)) { - for (Ability ability: card.getAbilities()) { - if (ability instanceof ActivatedAbility) { - perm.addAbility(ability, game); - } - } - } - } - } - } - return true; - } + public NecroticOozeEffect() { + super(Duration.WhileOnBattlefield, Layer.AbilityAddingRemovingEffects_6, SubLayer.NA, Outcome.AddAbility); + staticText = "As long as {this} is on the battlefield, it has all activated abilities of all creature cards in all graveyards"; + } + + public NecroticOozeEffect(final NecroticOozeEffect effect) { + super(effect); + } + + @Override + public boolean apply(Game game, Ability source) { + Permanent perm = game.getPermanent(source.getSourceId()); + if (perm != null) { + for (Player player: game.getPlayers().values()) { + for (Card card: player.getGraveyard().getCards(game)) { + if (card.getCardType().contains(CardType.CREATURE)) { + for (Ability ability: card.getAbilities()) { + if (ability instanceof ActivatedAbility) { + perm.addAbility(ability, game); + } + } + } + } + } + } + return true; + } + + @Override + public NecroticOozeEffect copy() { + return new NecroticOozeEffect(this); + } - @Override - public NecroticOozeEffect copy() { - return new NecroticOozeEffect(this); - } - } \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/scarsofmirrodin/NeurokInvisimancer.java b/Mage.Sets/src/mage/sets/scarsofmirrodin/NeurokInvisimancer.java index c001d660a8..61bb4d2e11 100644 --- a/Mage.Sets/src/mage/sets/scarsofmirrodin/NeurokInvisimancer.java +++ b/Mage.Sets/src/mage/sets/scarsofmirrodin/NeurokInvisimancer.java @@ -51,7 +51,7 @@ public class NeurokInvisimancer extends CardImpl { this.expansionSetCode = "SOM"; this.subtype.add("Human"); this.subtype.add("Wizard"); - this.color.setBlue(true); + this.color.setBlue(true); this.power = new MageInt(2); this.toughness = new MageInt(1); this.addAbility(UnblockableAbility.getInstance()); diff --git a/Mage.Sets/src/mage/sets/scarsofmirrodin/NimDeathmantle.java b/Mage.Sets/src/mage/sets/scarsofmirrodin/NimDeathmantle.java index ee5524fd53..830c5a7514 100644 --- a/Mage.Sets/src/mage/sets/scarsofmirrodin/NimDeathmantle.java +++ b/Mage.Sets/src/mage/sets/scarsofmirrodin/NimDeathmantle.java @@ -66,16 +66,16 @@ public class NimDeathmantle extends CardImpl { this.expansionSetCode = "SOM"; this.subtype.add("Equipment"); - this.addAbility(new EquipAbility(Constants.Outcome.AddAbility, new GenericManaCost(4))); + this.addAbility(new EquipAbility(Constants.Outcome.AddAbility, new GenericManaCost(4))); // Equipped creature gets +2/+2, has intimidate, and is a black Zombie. - this.addAbility(new SimpleStaticAbility(Constants.Zone.BATTLEFIELD, new BoostEquippedEffect(2, 2))); - this.addAbility(new SimpleStaticAbility(Constants.Zone.BATTLEFIELD, new GainAbilityAttachedEffect(IntimidateAbility.getInstance(), Constants.AttachmentType.EQUIPMENT))); - this.addAbility(new SimpleStaticAbility(Constants.Zone.BATTLEFIELD, new SetCardColorAttachedEffect(ObjectColor.BLACK, Constants.Duration.WhileOnBattlefield, Constants.AttachmentType.EQUIPMENT))); - this.addAbility(new SimpleStaticAbility(Constants.Zone.BATTLEFIELD, new SetCardSubtypeAttachedEffect("Zombie", Constants.Duration.WhileOnBattlefield, Constants.AttachmentType.EQUIPMENT))); + this.addAbility(new SimpleStaticAbility(Constants.Zone.BATTLEFIELD, new BoostEquippedEffect(2, 2))); + this.addAbility(new SimpleStaticAbility(Constants.Zone.BATTLEFIELD, new GainAbilityAttachedEffect(IntimidateAbility.getInstance(), Constants.AttachmentType.EQUIPMENT))); + this.addAbility(new SimpleStaticAbility(Constants.Zone.BATTLEFIELD, new SetCardColorAttachedEffect(ObjectColor.BLACK, Constants.Duration.WhileOnBattlefield, Constants.AttachmentType.EQUIPMENT))); + this.addAbility(new SimpleStaticAbility(Constants.Zone.BATTLEFIELD, new SetCardSubtypeAttachedEffect("Zombie", Constants.Duration.WhileOnBattlefield, Constants.AttachmentType.EQUIPMENT))); // Whenever a nontoken creature is put into your graveyard from the battlefield, you may pay {4}. If you do, return that card to the battlefield and attach Nim Deathmantle to it. - this.addAbility(new NimDeathmantleTriggeredAbility()); + this.addAbility(new NimDeathmantleTriggeredAbility()); } public NimDeathmantle(final NimDeathmantle card) { @@ -90,101 +90,101 @@ public class NimDeathmantle extends CardImpl { class NimDeathmantleTriggeredAbility extends TriggeredAbilityImpl { - NimDeathmantleTriggeredAbility() { - super(Constants.Zone.BATTLEFIELD, new NimDeathmantleEffect(), true); - } + NimDeathmantleTriggeredAbility() { + super(Constants.Zone.BATTLEFIELD, new NimDeathmantleEffect(), true); + } - NimDeathmantleTriggeredAbility(NimDeathmantleTriggeredAbility ability) { - super(ability); - } + NimDeathmantleTriggeredAbility(NimDeathmantleTriggeredAbility ability) { + super(ability); + } - @Override - public NimDeathmantleTriggeredAbility copy() { - return new NimDeathmantleTriggeredAbility(this); - } + @Override + public NimDeathmantleTriggeredAbility copy() { + return new NimDeathmantleTriggeredAbility(this); + } - @Override - public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == GameEvent.EventType.ZONE_CHANGE) { + @Override + public boolean checkTrigger(GameEvent event, Game game) { + if (event.getType() == GameEvent.EventType.ZONE_CHANGE) { - // make sure card is on battlefield - UUID sourceId = getSourceId(); - if (game.getPermanent(sourceId) == null) { - // or it is being removed - if (game.getLastKnownInformation(sourceId, Constants.Zone.BATTLEFIELD) == null) { - return false; - } - } + // make sure card is on battlefield + UUID sourceId = getSourceId(); + if (game.getPermanent(sourceId) == null) { + // or it is being removed + if (game.getLastKnownInformation(sourceId, Constants.Zone.BATTLEFIELD) == null) { + return false; + } + } - ZoneChangeEvent zEvent = (ZoneChangeEvent) event; - Permanent permanent = zEvent.getTarget(); + ZoneChangeEvent zEvent = (ZoneChangeEvent) event; + Permanent permanent = zEvent.getTarget(); - if (permanent != null && + if (permanent != null && permanent.getControllerId().equals(this.controllerId) && - zEvent.getToZone() == Constants.Zone.GRAVEYARD && - zEvent.getFromZone() == Constants.Zone.BATTLEFIELD && - !(permanent instanceof PermanentToken) && - permanent.getCardType().contains(CardType.CREATURE)) { + zEvent.getToZone() == Constants.Zone.GRAVEYARD && + zEvent.getFromZone() == Constants.Zone.BATTLEFIELD && + !(permanent instanceof PermanentToken) && + permanent.getCardType().contains(CardType.CREATURE)) { - getEffects().get(0).setTargetPointer(new FixedTarget(permanent.getId())); - return true; - } - } - return false; - } + getEffects().get(0).setTargetPointer(new FixedTarget(permanent.getId())); + return true; + } + } + return false; + } - @Override - public String getRule() { - return "Whenever a nontoken creature is put into your graveyard from the battlefield, you may pay {4}. If you do, return that card to the battlefield and attach Nim Deathmantle to it."; - } + @Override + public String getRule() { + return "Whenever a nontoken creature is put into your graveyard from the battlefield, you may pay {4}. If you do, return that card to the battlefield and attach Nim Deathmantle to it."; + } } class NimDeathmantleEffect extends OneShotEffect { - private final Cost cost = new GenericManaCost(4); + private final Cost cost = new GenericManaCost(4); - public NimDeathmantleEffect() { - super(Constants.Outcome.Benefit); + public NimDeathmantleEffect() { + super(Constants.Outcome.Benefit); - } + } - public NimDeathmantleEffect(NimDeathmantleEffect effect) { - super(effect); - } + public NimDeathmantleEffect(NimDeathmantleEffect effect) { + super(effect); + } - @Override - public boolean apply(Game game, Ability source) { - Player player = game.getPlayer(source.getControllerId()); - Permanent equipment = game.getPermanent(source.getSourceId()); - if (player != null && equipment != null) { - if (player.chooseUse(Constants.Outcome.Benefit, equipment.getName() + " - Pay " + cost.getText() + "?", game)) { - cost.clearPaid(); - if (cost.pay(source, game, source.getId(), source.getControllerId(), false)) { - UUID target = targetPointer.getFirst(game, source); - if (target != null && equipment != null) { - Card card = game.getCard(target); - // check if it's still in graveyard - if (card != null && game.getState().getZone(card.getId()).equals(Constants.Zone.GRAVEYARD)) { - Player owner = game.getPlayer(card.getOwnerId()); - if (card.putOntoBattlefield(game, Constants.Zone.GRAVEYARD, source.getId(), source.getControllerId())) { - Permanent permanent = game.getPermanent(card.getId()); - if (permanent != null) { - permanent.addAttachment(equipment.getId(), game); - return true; - } - } - } - } - } - } - } + @Override + public boolean apply(Game game, Ability source) { + Player player = game.getPlayer(source.getControllerId()); + Permanent equipment = game.getPermanent(source.getSourceId()); + if (player != null && equipment != null) { + if (player.chooseUse(Constants.Outcome.Benefit, equipment.getName() + " - Pay " + cost.getText() + "?", game)) { + cost.clearPaid(); + if (cost.pay(source, game, source.getId(), source.getControllerId(), false)) { + UUID target = targetPointer.getFirst(game, source); + if (target != null && equipment != null) { + Card card = game.getCard(target); + // check if it's still in graveyard + if (card != null && game.getState().getZone(card.getId()).equals(Constants.Zone.GRAVEYARD)) { + Player owner = game.getPlayer(card.getOwnerId()); + if (card.putOntoBattlefield(game, Constants.Zone.GRAVEYARD, source.getId(), source.getControllerId())) { + Permanent permanent = game.getPermanent(card.getId()); + if (permanent != null) { + permanent.addAttachment(equipment.getId(), game); + return true; + } + } + } + } + } + } + } - return false; - } + return false; + } - @Override - public NimDeathmantleEffect copy() { - return new NimDeathmantleEffect(this); - } + @Override + public NimDeathmantleEffect copy() { + return new NimDeathmantleEffect(this); + } } diff --git a/Mage.Sets/src/mage/sets/scarsofmirrodin/OgreGeargrabber.java b/Mage.Sets/src/mage/sets/scarsofmirrodin/OgreGeargrabber.java index 5ee25d31fa..9b6dda9538 100644 --- a/Mage.Sets/src/mage/sets/scarsofmirrodin/OgreGeargrabber.java +++ b/Mage.Sets/src/mage/sets/scarsofmirrodin/OgreGeargrabber.java @@ -51,136 +51,136 @@ import mage.target.TargetPermanent; * @author BetaSteward_at_googlemail.com */ public class OgreGeargrabber extends CardImpl { - - private static FilterEquipment filter = new FilterEquipment("Equipment an opponent controls"); - - static { - filter.setTargetController(TargetController.OPPONENT); - } - public OgreGeargrabber(UUID ownerId) { - super(ownerId, 99, "Ogre Geargrabber", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{4}{R}{R}"); - this.expansionSetCode = "SOM"; - this.subtype.add("Ogre"); - this.subtype.add("Warrior"); - this.color.setRed(true); - this.power = new MageInt(4); - this.toughness = new MageInt(4); - Ability ability = new AttacksTriggeredAbility(new OgreGeargrabberEffect1(), false); - ability.addEffect(new GainControlTargetEffect(Duration.EndOfTurn)); - ability.addTarget(new TargetPermanent(1, 1, filter, false)); - this.addAbility(ability); - } + private static FilterEquipment filter = new FilterEquipment("Equipment an opponent controls"); - public OgreGeargrabber(final OgreGeargrabber card) { - super(card); - } + static { + filter.setTargetController(TargetController.OPPONENT); + } - @Override - public OgreGeargrabber copy() { - return new OgreGeargrabber(this); - } + public OgreGeargrabber(UUID ownerId) { + super(ownerId, 99, "Ogre Geargrabber", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{4}{R}{R}"); + this.expansionSetCode = "SOM"; + this.subtype.add("Ogre"); + this.subtype.add("Warrior"); + this.color.setRed(true); + this.power = new MageInt(4); + this.toughness = new MageInt(4); + Ability ability = new AttacksTriggeredAbility(new OgreGeargrabberEffect1(), false); + ability.addEffect(new GainControlTargetEffect(Duration.EndOfTurn)); + ability.addTarget(new TargetPermanent(1, 1, filter, false)); + this.addAbility(ability); + } + + public OgreGeargrabber(final OgreGeargrabber card) { + super(card); + } + + @Override + public OgreGeargrabber copy() { + return new OgreGeargrabber(this); + } } class OgreGeargrabberEffect1 extends OneShotEffect { - public OgreGeargrabberEffect1() { - super(Outcome.GainControl); - staticText = "Attach it to {this}. When you lose control of that Equipment, unattach it."; - } - - public OgreGeargrabberEffect1(final OgreGeargrabberEffect1 effect) { - super(effect); - } - - @Override - public OgreGeargrabberEffect1 copy() { - return new OgreGeargrabberEffect1(this); - } + public OgreGeargrabberEffect1() { + super(Outcome.GainControl); + staticText = "Attach it to {this}. When you lose control of that Equipment, unattach it."; + } - @Override - public boolean apply(Game game, Ability source) { - UUID equipmentId = source.getFirstTarget(); - if (equipmentId != null) { - OgreGeargrabberDelayedTriggeredAbility delayedAbility = new OgreGeargrabberDelayedTriggeredAbility(equipmentId); - delayedAbility.setSourceId(source.getSourceId()); - delayedAbility.setControllerId(source.getControllerId()); - game.addDelayedTriggeredAbility(delayedAbility); - Permanent equipment = game.getPermanent(equipmentId); - if (equipment != null) { - Permanent ogre = game.getPermanent(source.getSourceId()); - if (ogre != null) { - ogre.addAttachment(equipmentId, game); - } - } - return true; - } - return false; - } + public OgreGeargrabberEffect1(final OgreGeargrabberEffect1 effect) { + super(effect); + } + + @Override + public OgreGeargrabberEffect1 copy() { + return new OgreGeargrabberEffect1(this); + } + + @Override + public boolean apply(Game game, Ability source) { + UUID equipmentId = source.getFirstTarget(); + if (equipmentId != null) { + OgreGeargrabberDelayedTriggeredAbility delayedAbility = new OgreGeargrabberDelayedTriggeredAbility(equipmentId); + delayedAbility.setSourceId(source.getSourceId()); + delayedAbility.setControllerId(source.getControllerId()); + game.addDelayedTriggeredAbility(delayedAbility); + Permanent equipment = game.getPermanent(equipmentId); + if (equipment != null) { + Permanent ogre = game.getPermanent(source.getSourceId()); + if (ogre != null) { + ogre.addAttachment(equipmentId, game); + } + } + return true; + } + return false; + } } class OgreGeargrabberDelayedTriggeredAbility extends DelayedTriggeredAbility { - private UUID equipmentId; - - OgreGeargrabberDelayedTriggeredAbility (UUID equipmentId) { - super(new OgreGeargrabberEffect2(equipmentId)); - this.equipmentId = equipmentId; - } + private UUID equipmentId; - OgreGeargrabberDelayedTriggeredAbility(OgreGeargrabberDelayedTriggeredAbility ability) { - super(ability); - this.equipmentId = ability.equipmentId; - } + OgreGeargrabberDelayedTriggeredAbility (UUID equipmentId) { + super(new OgreGeargrabberEffect2(equipmentId)); + this.equipmentId = equipmentId; + } - @Override - public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == GameEvent.EventType.LOST_CONTROL && event.getPlayerId().equals(controllerId) && event.getTargetId().equals(equipmentId)) { - return true; - } - return false; - } - @Override - public OgreGeargrabberDelayedTriggeredAbility copy() { - return new OgreGeargrabberDelayedTriggeredAbility(this); - } + OgreGeargrabberDelayedTriggeredAbility(OgreGeargrabberDelayedTriggeredAbility ability) { + super(ability); + this.equipmentId = ability.equipmentId; + } + + @Override + public boolean checkTrigger(GameEvent event, Game game) { + if (event.getType() == GameEvent.EventType.LOST_CONTROL && event.getPlayerId().equals(controllerId) && event.getTargetId().equals(equipmentId)) { + return true; + } + return false; + } + @Override + public OgreGeargrabberDelayedTriggeredAbility copy() { + return new OgreGeargrabberDelayedTriggeredAbility(this); + } } class OgreGeargrabberEffect2 extends OneShotEffect { - private UUID equipmentId; + private UUID equipmentId; - public OgreGeargrabberEffect2(UUID equipmentId) { - super(Outcome.Neutral); - this.equipmentId = equipmentId; - staticText = "When you lose control of that Equipment, unattach it."; - } - - public OgreGeargrabberEffect2(final OgreGeargrabberEffect2 effect) { - super(effect); - this.equipmentId = effect.equipmentId; - } - - @Override - public OgreGeargrabberEffect2 copy() { - return new OgreGeargrabberEffect2(this); - } + public OgreGeargrabberEffect2(UUID equipmentId) { + super(Outcome.Neutral); + this.equipmentId = equipmentId; + staticText = "When you lose control of that Equipment, unattach it."; + } - @Override - public boolean apply(Game game, Ability source) { - if (equipmentId != null) { - Permanent equipment = game.getPermanent(equipmentId); - if (equipment != null && equipment.getAttachedTo() != null) { - Permanent attachedTo = game.getPermanent(equipment.getAttachedTo()); - if (attachedTo != null) { - attachedTo.removeAttachment(equipmentId, game); - } - } - return true; - } - return false; - } + public OgreGeargrabberEffect2(final OgreGeargrabberEffect2 effect) { + super(effect); + this.equipmentId = effect.equipmentId; + } + + @Override + public OgreGeargrabberEffect2 copy() { + return new OgreGeargrabberEffect2(this); + } + + @Override + public boolean apply(Game game, Ability source) { + if (equipmentId != null) { + Permanent equipment = game.getPermanent(equipmentId); + if (equipment != null && equipment.getAttachedTo() != null) { + Permanent attachedTo = game.getPermanent(equipment.getAttachedTo()); + if (attachedTo != null) { + attachedTo.removeAttachment(equipmentId, game); + } + } + return true; + } + return false; + } } diff --git a/Mage.Sets/src/mage/sets/scarsofmirrodin/OxiddaDaredevil.java b/Mage.Sets/src/mage/sets/scarsofmirrodin/OxiddaDaredevil.java index 325fa32dc8..798940c6fe 100644 --- a/Mage.Sets/src/mage/sets/scarsofmirrodin/OxiddaDaredevil.java +++ b/Mage.Sets/src/mage/sets/scarsofmirrodin/OxiddaDaredevil.java @@ -59,7 +59,7 @@ public class OxiddaDaredevil extends CardImpl { public OxiddaDaredevil (UUID ownerId) { super(ownerId, 100, "Oxidda Daredevil", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{1}{R}"); this.expansionSetCode = "SOM"; - this.color.setRed(true); + this.color.setRed(true); this.power = new MageInt(2); this.toughness = new MageInt(1); this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, diff --git a/Mage.Sets/src/mage/sets/scarsofmirrodin/OxiddaScrapmelter.java b/Mage.Sets/src/mage/sets/scarsofmirrodin/OxiddaScrapmelter.java index 5b5d5c8847..7f02333315 100644 --- a/Mage.Sets/src/mage/sets/scarsofmirrodin/OxiddaScrapmelter.java +++ b/Mage.Sets/src/mage/sets/scarsofmirrodin/OxiddaScrapmelter.java @@ -52,7 +52,7 @@ public class OxiddaScrapmelter extends CardImpl { this.expansionSetCode = "SOM"; this.subtype.add("Beast"); - this.color.setRed(true); + this.color.setRed(true); this.power = new MageInt(3); this.toughness = new MageInt(3); diff --git a/Mage.Sets/src/mage/sets/scarsofmirrodin/PainfulQuandary.java b/Mage.Sets/src/mage/sets/scarsofmirrodin/PainfulQuandary.java index 1f753a44d6..a57bacc830 100644 --- a/Mage.Sets/src/mage/sets/scarsofmirrodin/PainfulQuandary.java +++ b/Mage.Sets/src/mage/sets/scarsofmirrodin/PainfulQuandary.java @@ -51,83 +51,83 @@ import mage.target.targetpointer.FixedTarget; */ public class PainfulQuandary extends CardImpl { - public PainfulQuandary(UUID ownerId) { - super(ownerId, 73, "Painful Quandary", Rarity.RARE, new CardType[]{CardType.ENCHANTMENT}, "{3}{B}{B}"); - this.expansionSetCode = "SOM"; - this.color.setBlack(true); - this.addAbility(new PainfulQuandryAbility()); - } + public PainfulQuandary(UUID ownerId) { + super(ownerId, 73, "Painful Quandary", Rarity.RARE, new CardType[]{CardType.ENCHANTMENT}, "{3}{B}{B}"); + this.expansionSetCode = "SOM"; + this.color.setBlack(true); + this.addAbility(new PainfulQuandryAbility()); + } - public PainfulQuandary(final PainfulQuandary card) { - super(card); - } + public PainfulQuandary(final PainfulQuandary card) { + super(card); + } - @Override - public PainfulQuandary copy() { - return new PainfulQuandary(this); - } + @Override + public PainfulQuandary copy() { + return new PainfulQuandary(this); + } } class PainfulQuandryAbility extends TriggeredAbilityImpl { - public PainfulQuandryAbility() { - super(Zone.BATTLEFIELD, new PainfulQuandryEffect()); - } - - public PainfulQuandryAbility(final PainfulQuandryAbility ability) { - super(ability); - } - - @Override - public PainfulQuandryAbility copy() { - return new PainfulQuandryAbility(this); - } + public PainfulQuandryAbility() { + super(Zone.BATTLEFIELD, new PainfulQuandryEffect()); + } - @Override - public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == EventType.SPELL_CAST && game.getOpponents(controllerId).contains(event.getPlayerId())) { + public PainfulQuandryAbility(final PainfulQuandryAbility ability) { + super(ability); + } + + @Override + public PainfulQuandryAbility copy() { + return new PainfulQuandryAbility(this); + } + + @Override + public boolean checkTrigger(GameEvent event, Game game) { + if (event.getType() == EventType.SPELL_CAST && game.getOpponents(controllerId).contains(event.getPlayerId())) { this.getEffects().get(0).setTargetPointer(new FixedTarget(event.getPlayerId())); - return true; - } - return false; - } - - @Override - public String getRule() { - return "Whenever an opponent casts a spell, that player loses 5 life unless he or she discards a card."; - } + return true; + } + return false; + } + + @Override + public String getRule() { + return "Whenever an opponent casts a spell, that player loses 5 life unless he or she discards a card."; + } } class PainfulQuandryEffect extends OneShotEffect { - public PainfulQuandryEffect() { - super(Outcome.Damage); - staticText = "player loses 5 life unless he or she discards a card"; - } + public PainfulQuandryEffect() { + super(Outcome.Damage); + staticText = "player loses 5 life unless he or she discards a card"; + } - public PainfulQuandryEffect(final PainfulQuandryEffect effect) { - super(effect); - } + public PainfulQuandryEffect(final PainfulQuandryEffect effect) { + super(effect); + } - @Override - public PainfulQuandryEffect copy() { - return new PainfulQuandryEffect(this); - } + @Override + public PainfulQuandryEffect copy() { + return new PainfulQuandryEffect(this); + } - @Override - public boolean apply(Game game, Ability source) { - Player player = game.getPlayer(targetPointer.getFirst(game, source)); - if (player != null) { - Cost cost = new DiscardTargetCost(new TargetCardInHand()); + @Override + public boolean apply(Game game, Ability source) { + Player player = game.getPlayer(targetPointer.getFirst(game, source)); + if (player != null) { + Cost cost = new DiscardTargetCost(new TargetCardInHand()); if (cost.canPay(player.getId(), player.getId(), game)) { if (!cost.pay(source, game, player.getId(), player.getId(), false)) { player.loseLife(5, game); } - return true; + return true; } - } - return false; - } + } + return false; + } } diff --git a/Mage.Sets/src/mage/sets/scarsofmirrodin/Painsmith.java b/Mage.Sets/src/mage/sets/scarsofmirrodin/Painsmith.java index 7b4a7ac25c..dc5a3c5c5e 100644 --- a/Mage.Sets/src/mage/sets/scarsofmirrodin/Painsmith.java +++ b/Mage.Sets/src/mage/sets/scarsofmirrodin/Painsmith.java @@ -60,10 +60,10 @@ public class Painsmith extends CardImpl { this.subtype.add("Human"); this.subtype.add("Artificer"); - this.color.setBlack(true); + this.color.setBlack(true); this.power = new MageInt(2); this.toughness = new MageInt(1); - + SpellCastTriggeredAbility ability = new SpellCastTriggeredAbility(new BoostTargetEffect(2, 0, Duration.EndOfTurn), filter, true); ability.addEffect(new GainAbilityTargetEffect(DeathtouchAbility.getInstance(), Duration.EndOfTurn)); ability.addTarget(new TargetCreaturePermanent()); diff --git a/Mage.Sets/src/mage/sets/scarsofmirrodin/PlagueStinger.java b/Mage.Sets/src/mage/sets/scarsofmirrodin/PlagueStinger.java index 9604398bac..bf248cfc0b 100644 --- a/Mage.Sets/src/mage/sets/scarsofmirrodin/PlagueStinger.java +++ b/Mage.Sets/src/mage/sets/scarsofmirrodin/PlagueStinger.java @@ -48,7 +48,7 @@ public class PlagueStinger extends CardImpl { this.expansionSetCode = "SOM"; this.subtype.add("Insect"); this.subtype.add("Horror"); - this.color.setBlack(true); + this.color.setBlack(true); this.power = new MageInt(1); this.toughness = new MageInt(1); this.addAbility(FlyingAbility.getInstance()); diff --git a/Mage.Sets/src/mage/sets/scarsofmirrodin/Plains1.java b/Mage.Sets/src/mage/sets/scarsofmirrodin/Plains1.java index 57c62eb9c7..214822d8d2 100644 --- a/Mage.Sets/src/mage/sets/scarsofmirrodin/Plains1.java +++ b/Mage.Sets/src/mage/sets/scarsofmirrodin/Plains1.java @@ -36,18 +36,18 @@ import java.util.UUID; */ public class Plains1 extends mage.cards.basiclands.Plains { - public Plains1(UUID ownerId) { - super(ownerId, 230); - this.expansionSetCode = "SOM"; - } + public Plains1(UUID ownerId) { + super(ownerId, 230); + this.expansionSetCode = "SOM"; + } - public Plains1(final Plains1 card) { - super(card); - } + public Plains1(final Plains1 card) { + super(card); + } - @Override - public Plains1 copy() { - return new Plains1(this); - } + @Override + public Plains1 copy() { + return new Plains1(this); + } } diff --git a/Mage.Sets/src/mage/sets/scarsofmirrodin/Plains2.java b/Mage.Sets/src/mage/sets/scarsofmirrodin/Plains2.java index 7b71ccfdbf..20a6834f83 100644 --- a/Mage.Sets/src/mage/sets/scarsofmirrodin/Plains2.java +++ b/Mage.Sets/src/mage/sets/scarsofmirrodin/Plains2.java @@ -36,18 +36,18 @@ import java.util.UUID; */ public class Plains2 extends mage.cards.basiclands.Plains { - public Plains2(UUID ownerId) { - super(ownerId, 231); - this.expansionSetCode = "SOM"; - } + public Plains2(UUID ownerId) { + super(ownerId, 231); + this.expansionSetCode = "SOM"; + } - public Plains2(final Plains2 card) { - super(card); - } + public Plains2(final Plains2 card) { + super(card); + } - @Override - public Plains2 copy() { - return new Plains2(this); - } + @Override + public Plains2 copy() { + return new Plains2(this); + } } diff --git a/Mage.Sets/src/mage/sets/scarsofmirrodin/Plains3.java b/Mage.Sets/src/mage/sets/scarsofmirrodin/Plains3.java index a4853339db..8a527e5623 100644 --- a/Mage.Sets/src/mage/sets/scarsofmirrodin/Plains3.java +++ b/Mage.Sets/src/mage/sets/scarsofmirrodin/Plains3.java @@ -36,18 +36,18 @@ import java.util.UUID; */ public class Plains3 extends mage.cards.basiclands.Plains { - public Plains3(UUID ownerId) { - super(ownerId, 232); - this.expansionSetCode = "SOM"; - } + public Plains3(UUID ownerId) { + super(ownerId, 232); + this.expansionSetCode = "SOM"; + } - public Plains3(final Plains3 card) { - super(card); - } + public Plains3(final Plains3 card) { + super(card); + } - @Override - public Plains3 copy() { - return new Plains3(this); - } + @Override + public Plains3 copy() { + return new Plains3(this); + } } diff --git a/Mage.Sets/src/mage/sets/scarsofmirrodin/Plains4.java b/Mage.Sets/src/mage/sets/scarsofmirrodin/Plains4.java index 2c60fc569c..2747cf8e18 100644 --- a/Mage.Sets/src/mage/sets/scarsofmirrodin/Plains4.java +++ b/Mage.Sets/src/mage/sets/scarsofmirrodin/Plains4.java @@ -36,18 +36,18 @@ import java.util.UUID; */ public class Plains4 extends mage.cards.basiclands.Plains { - public Plains4(UUID ownerId) { - super(ownerId, 233); - this.expansionSetCode = "SOM"; - } + public Plains4(UUID ownerId) { + super(ownerId, 233); + this.expansionSetCode = "SOM"; + } - public Plains4(final Plains4 card) { - super(card); - } + public Plains4(final Plains4 card) { + super(card); + } - @Override - public Plains4 copy() { - return new Plains4(this); - } + @Override + public Plains4 copy() { + return new Plains4(this); + } } diff --git a/Mage.Sets/src/mage/sets/scarsofmirrodin/PlatedSeastrider.java b/Mage.Sets/src/mage/sets/scarsofmirrodin/PlatedSeastrider.java index b37e772d55..25aace2914 100644 --- a/Mage.Sets/src/mage/sets/scarsofmirrodin/PlatedSeastrider.java +++ b/Mage.Sets/src/mage/sets/scarsofmirrodin/PlatedSeastrider.java @@ -45,7 +45,7 @@ public class PlatedSeastrider extends CardImpl { super(ownerId, 38, "Plated Seastrider", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{U}{U}"); this.expansionSetCode = "SOM"; this.subtype.add("Beast"); - this.color.setBlue(true); + this.color.setBlue(true); this.power = new MageInt(1); this.toughness = new MageInt(4); } diff --git a/Mage.Sets/src/mage/sets/scarsofmirrodin/PlatinumEmperion.java b/Mage.Sets/src/mage/sets/scarsofmirrodin/PlatinumEmperion.java index f2acb018da..a9cdf88664 100644 --- a/Mage.Sets/src/mage/sets/scarsofmirrodin/PlatinumEmperion.java +++ b/Mage.Sets/src/mage/sets/scarsofmirrodin/PlatinumEmperion.java @@ -52,7 +52,7 @@ public class PlatinumEmperion extends CardImpl { this.toughness = new MageInt(8); // Your life total can't change. - this.addAbility(new SimpleStaticAbility(Constants.Zone.BATTLEFIELD, new LifeTotalCantChangeControllerEffect(Constants.Duration.WhileOnBattlefield))); + this.addAbility(new SimpleStaticAbility(Constants.Zone.BATTLEFIELD, new LifeTotalCantChangeControllerEffect(Constants.Duration.WhileOnBattlefield))); } public PlatinumEmperion(final PlatinumEmperion card) { diff --git a/Mage.Sets/src/mage/sets/scarsofmirrodin/PrecursorGolem.java b/Mage.Sets/src/mage/sets/scarsofmirrodin/PrecursorGolem.java index 469762b834..71babb7534 100644 --- a/Mage.Sets/src/mage/sets/scarsofmirrodin/PrecursorGolem.java +++ b/Mage.Sets/src/mage/sets/scarsofmirrodin/PrecursorGolem.java @@ -56,158 +56,158 @@ import java.util.UUID; */ public class PrecursorGolem extends CardImpl { - public PrecursorGolem(UUID ownerId) { - super(ownerId, 194, "Precursor Golem", Rarity.RARE, new CardType[]{CardType.ARTIFACT, CardType.CREATURE}, "{5}"); - this.expansionSetCode = "SOM"; - this.subtype.add("Golem"); + public PrecursorGolem(UUID ownerId) { + super(ownerId, 194, "Precursor Golem", Rarity.RARE, new CardType[]{CardType.ARTIFACT, CardType.CREATURE}, "{5}"); + this.expansionSetCode = "SOM"; + this.subtype.add("Golem"); - this.power = new MageInt(3); - this.toughness = new MageInt(3); + this.power = new MageInt(3); + this.toughness = new MageInt(3); - // When Precursor Golem enters the battlefield, put two 3/3 colorless Golem artifact creature tokens onto the battlefield. - this.addAbility(new EntersBattlefieldTriggeredAbility(new CreateTokenEffect(new GolemToken(), 2), false)); + // When Precursor Golem enters the battlefield, put two 3/3 colorless Golem artifact creature tokens onto the battlefield. + this.addAbility(new EntersBattlefieldTriggeredAbility(new CreateTokenEffect(new GolemToken(), 2), false)); - // Whenever a player casts an instant or sorcery spell that targets only a single Golem, that player copies that spell for each other Golem that spell could target. Each copy targets a different one of those Golems. - this.addAbility(new PrecursorGolemCopyTriggeredAbility()); - } + // Whenever a player casts an instant or sorcery spell that targets only a single Golem, that player copies that spell for each other Golem that spell could target. Each copy targets a different one of those Golems. + this.addAbility(new PrecursorGolemCopyTriggeredAbility()); + } - public PrecursorGolem(final PrecursorGolem card) { - super(card); - } + public PrecursorGolem(final PrecursorGolem card) { + super(card); + } - @Override - public PrecursorGolem copy() { - return new PrecursorGolem(this); - } + @Override + public PrecursorGolem copy() { + return new PrecursorGolem(this); + } } class PrecursorGolemCopyTriggeredAbility extends TriggeredAbilityImpl { - private static FilterSpell filter = new FilterSpell(); + private static FilterSpell filter = new FilterSpell(); - static { - filter.getCardType().add(CardType.INSTANT); - filter.getCardType().add(CardType.SORCERY); - filter.setScopeCardType(Filter.ComparisonScope.Any); - } + static { + filter.getCardType().add(CardType.INSTANT); + filter.getCardType().add(CardType.SORCERY); + filter.setScopeCardType(Filter.ComparisonScope.Any); + } - PrecursorGolemCopyTriggeredAbility() { - super(Constants.Zone.BATTLEFIELD, new PrecursorGolemCopySpellEffect(), false); - } + PrecursorGolemCopyTriggeredAbility() { + super(Constants.Zone.BATTLEFIELD, new PrecursorGolemCopySpellEffect(), false); + } - PrecursorGolemCopyTriggeredAbility(final PrecursorGolemCopyTriggeredAbility ability) { - super(ability); - } + PrecursorGolemCopyTriggeredAbility(final PrecursorGolemCopyTriggeredAbility ability) { + super(ability); + } - @Override - public PrecursorGolemCopyTriggeredAbility copy() { - return new PrecursorGolemCopyTriggeredAbility(this); - } + @Override + public PrecursorGolemCopyTriggeredAbility copy() { + return new PrecursorGolemCopyTriggeredAbility(this); + } - @Override - public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == GameEvent.EventType.SPELL_CAST) { - Spell spell = game.getStack().getSpell(event.getTargetId()); - if (checkSpell(spell, game)) { - return true; - } - } - return false; - } + @Override + public boolean checkTrigger(GameEvent event, Game game) { + if (event.getType() == GameEvent.EventType.SPELL_CAST) { + Spell spell = game.getStack().getSpell(event.getTargetId()); + if (checkSpell(spell, game)) { + return true; + } + } + return false; + } - private boolean checkSpell(Spell spell, Game game) { - if (spell != null && - (spell.getCardType().contains(CardType.INSTANT) || spell.getCardType().contains(CardType.SORCERY))) { - UUID targetGolem = null; - SpellAbility sa = spell.getSpellAbility(); - for (Effect effect : sa.getEffects()) { - for (UUID target : effect.getTargetPointer().getTargets(game, sa)) { - Permanent permanent = game.getPermanent(target); - if (permanent != null) { - if (!permanent.hasSubtype("Golem")) { - return false; - } - if (targetGolem == null) { - targetGolem = target; - } else { - // If a spell has multiple targets, but it's targeting the same Golem with all of them, Precursor Golem's last ability will trigger - if (!targetGolem.equals(target)) { - return false; - } - } - } - } - } - getEffects().get(0).setTargetPointer(new FixedTarget(spell.getId())); - getEffects().get(0).setValue("targetedGolem", targetGolem); - return true; - } - return false; - } + private boolean checkSpell(Spell spell, Game game) { + if (spell != null && + (spell.getCardType().contains(CardType.INSTANT) || spell.getCardType().contains(CardType.SORCERY))) { + UUID targetGolem = null; + SpellAbility sa = spell.getSpellAbility(); + for (Effect effect : sa.getEffects()) { + for (UUID target : effect.getTargetPointer().getTargets(game, sa)) { + Permanent permanent = game.getPermanent(target); + if (permanent != null) { + if (!permanent.hasSubtype("Golem")) { + return false; + } + if (targetGolem == null) { + targetGolem = target; + } else { + // If a spell has multiple targets, but it's targeting the same Golem with all of them, Precursor Golem's last ability will trigger + if (!targetGolem.equals(target)) { + return false; + } + } + } + } + } + getEffects().get(0).setTargetPointer(new FixedTarget(spell.getId())); + getEffects().get(0).setValue("targetedGolem", targetGolem); + return true; + } + return false; + } - @Override - public String getRule() { - return "Whenever a player casts an instant or sorcery spell that targets only a single Golem, that player copies that spell for each other Golem that spell could target. Each copy targets a different one of those Golems"; - } + @Override + public String getRule() { + return "Whenever a player casts an instant or sorcery spell that targets only a single Golem, that player copies that spell for each other Golem that spell could target. Each copy targets a different one of those Golems"; + } } class PrecursorGolemCopySpellEffect extends OneShotEffect { - private static FilterPermanent filterGolem = new FilterPermanent(); + private static FilterPermanent filterGolem = new FilterPermanent(); - static { - filterGolem.getSubtype().add("Golem"); - filterGolem.setScopeSubtype(Filter.ComparisonScope.Any); - } + static { + filterGolem.getSubtype().add("Golem"); + filterGolem.setScopeSubtype(Filter.ComparisonScope.Any); + } - public PrecursorGolemCopySpellEffect() { - super(Constants.Outcome.Copy); - } + public PrecursorGolemCopySpellEffect() { + super(Constants.Outcome.Copy); + } - public PrecursorGolemCopySpellEffect(final PrecursorGolemCopySpellEffect effect) { - super(effect); - } + public PrecursorGolemCopySpellEffect(final PrecursorGolemCopySpellEffect effect) { + super(effect); + } - @Override - public boolean apply(Game game, Ability source) { - Spell spell = game.getStack().getSpell(targetPointer.getFirst(game, source)); - if (spell != null) { - SpellAbility sa = spell.getSpellAbility(); - UUID targetedGolem = (UUID) getValue("targetedGolem"); - for (Permanent permanent : game.getBattlefield().getAllActivePermanents(filterGolem, game)) { - if (permanent.getId().equals(targetedGolem)) { - continue; // copy only for other golems - } - boolean legal = true; - for (Target target : sa.getTargets()) { - if (!target.canTarget(permanent.getId(), game)) { - legal = false; - break; - } - } - if (legal) { - Spell copy = spell.copySpell(); - copy.setControllerId(spell.getControllerId()); - copy.setCopiedSpell(true); - for (Effect effect : copy.getSpellAbility().getEffects()) { - effect.setTargetPointer(new FixedTarget(permanent.getId())); - } - for (Target target : copy.getSpellAbility().getTargets()) { - target.clearChosen(); - target.add(permanent.getId(), game); - } - game.getStack().push(copy); - } - } - return true; - } - return false; - } + @Override + public boolean apply(Game game, Ability source) { + Spell spell = game.getStack().getSpell(targetPointer.getFirst(game, source)); + if (spell != null) { + SpellAbility sa = spell.getSpellAbility(); + UUID targetedGolem = (UUID) getValue("targetedGolem"); + for (Permanent permanent : game.getBattlefield().getAllActivePermanents(filterGolem, game)) { + if (permanent.getId().equals(targetedGolem)) { + continue; // copy only for other golems + } + boolean legal = true; + for (Target target : sa.getTargets()) { + if (!target.canTarget(permanent.getId(), game)) { + legal = false; + break; + } + } + if (legal) { + Spell copy = spell.copySpell(); + copy.setControllerId(spell.getControllerId()); + copy.setCopiedSpell(true); + for (Effect effect : copy.getSpellAbility().getEffects()) { + effect.setTargetPointer(new FixedTarget(permanent.getId())); + } + for (Target target : copy.getSpellAbility().getTargets()) { + target.clearChosen(); + target.add(permanent.getId(), game); + } + game.getStack().push(copy); + } + } + return true; + } + return false; + } - @Override - public PrecursorGolemCopySpellEffect copy() { - return new PrecursorGolemCopySpellEffect(this); - } + @Override + public PrecursorGolemCopySpellEffect copy() { + return new PrecursorGolemCopySpellEffect(this); + } } diff --git a/Mage.Sets/src/mage/sets/scarsofmirrodin/PrototypePortal.java b/Mage.Sets/src/mage/sets/scarsofmirrodin/PrototypePortal.java index 4610bb346e..318e6b8fbf 100644 --- a/Mage.Sets/src/mage/sets/scarsofmirrodin/PrototypePortal.java +++ b/Mage.Sets/src/mage/sets/scarsofmirrodin/PrototypePortal.java @@ -57,122 +57,122 @@ import java.util.UUID; */ public class PrototypePortal extends CardImpl { - public PrototypePortal(UUID ownerId) { - super(ownerId, 195, "Prototype Portal", Rarity.RARE, new CardType[]{CardType.ARTIFACT}, "{4}"); - this.expansionSetCode = "SOM"; + public PrototypePortal(UUID ownerId) { + super(ownerId, 195, "Prototype Portal", Rarity.RARE, new CardType[]{CardType.ARTIFACT}, "{4}"); + this.expansionSetCode = "SOM"; - // Imprint - When Prototype Portal enters the battlefield, you may exile an artifact card from your hand. - this.addAbility(new EntersBattlefieldTriggeredAbility(new PrototypePortalEffect(), true)); + // Imprint - When Prototype Portal enters the battlefield, you may exile an artifact card from your hand. + this.addAbility(new EntersBattlefieldTriggeredAbility(new PrototypePortalEffect(), true)); - // {X}, {tap}: Put a token that's a copy of the exiled card onto the battlefield. X is the converted mana cost of that card. - Ability ability = new SimpleActivatedAbility(Constants.Zone.BATTLEFIELD, new PrototypePortalCreateTokenEffect(), new ManaCostsImpl("{X}")); - ability.addCost(new TapSourceCost()); - this.addAbility(ability); - } + // {X}, {tap}: Put a token that's a copy of the exiled card onto the battlefield. X is the converted mana cost of that card. + Ability ability = new SimpleActivatedAbility(Constants.Zone.BATTLEFIELD, new PrototypePortalCreateTokenEffect(), new ManaCostsImpl("{X}")); + ability.addCost(new TapSourceCost()); + this.addAbility(ability); + } - public PrototypePortal(final PrototypePortal card) { - super(card); - } + public PrototypePortal(final PrototypePortal card) { + super(card); + } - @Override - public void adjustCosts(Ability ability, Game game) { - Permanent card = game.getPermanent(ability.getSourceId()); - if (card != null) { - if (card.getImprinted().size() > 0) { - Card imprinted = game.getCard(card.getImprinted().get(0)); - if (imprinted != null) { - ability.getManaCostsToPay().add(0, new GenericManaCost(imprinted.getManaCost().convertedManaCost())); - } - } - } + @Override + public void adjustCosts(Ability ability, Game game) { + Permanent card = game.getPermanent(ability.getSourceId()); + if (card != null) { + if (card.getImprinted().size() > 0) { + Card imprinted = game.getCard(card.getImprinted().get(0)); + if (imprinted != null) { + ability.getManaCostsToPay().add(0, new GenericManaCost(imprinted.getManaCost().convertedManaCost())); + } + } + } - // no {X} anymore as we already have imprinted the card with defined manacost - for (ManaCost cost : ability.getManaCostsToPay()) { - if (cost instanceof VariableCost) { - cost.setPaid(); - } - } - } + // no {X} anymore as we already have imprinted the card with defined manacost + for (ManaCost cost : ability.getManaCostsToPay()) { + if (cost instanceof VariableCost) { + cost.setPaid(); + } + } + } - @Override - public PrototypePortal copy() { - return new PrototypePortal(this); - } + @Override + public PrototypePortal copy() { + return new PrototypePortal(this); + } } class PrototypePortalEffect extends OneShotEffect { - private static FilterCard filter = new FilterArtifactCard(); + private static FilterCard filter = new FilterArtifactCard(); - public PrototypePortalEffect() { - super(Constants.Outcome.Benefit); - staticText = "exile an artifact card from your hand"; - } + public PrototypePortalEffect() { + super(Constants.Outcome.Benefit); + staticText = "exile an artifact card from your hand"; + } - public PrototypePortalEffect(PrototypePortalEffect effect) { - super(effect); - } + public PrototypePortalEffect(PrototypePortalEffect effect) { + super(effect); + } - @Override - public boolean apply(Game game, Ability source) { - Player player = game.getPlayer(source.getControllerId()); - if (player.getHand().size() > 0) { - TargetCard target = new TargetCard(Constants.Zone.HAND, filter); - target.setRequired(true); - player.choose(Constants.Outcome.Benefit, player.getHand(), target, game); - Card card = player.getHand().get(target.getFirstTarget(), game); - if (card != null) { - card.moveToExile(getId(), "Prototype Portal (Imprint)", source.getSourceId(), game); - Permanent permanent = game.getPermanent(source.getSourceId()); - if (permanent != null) { - permanent.imprint(card.getId(), game); - } - return true; - } - } - return true; - } + @Override + public boolean apply(Game game, Ability source) { + Player player = game.getPlayer(source.getControllerId()); + if (player.getHand().size() > 0) { + TargetCard target = new TargetCard(Constants.Zone.HAND, filter); + target.setRequired(true); + player.choose(Constants.Outcome.Benefit, player.getHand(), target, game); + Card card = player.getHand().get(target.getFirstTarget(), game); + if (card != null) { + card.moveToExile(getId(), "Prototype Portal (Imprint)", source.getSourceId(), game); + Permanent permanent = game.getPermanent(source.getSourceId()); + if (permanent != null) { + permanent.imprint(card.getId(), game); + } + return true; + } + } + return true; + } - @Override - public PrototypePortalEffect copy() { - return new PrototypePortalEffect(this); - } + @Override + public PrototypePortalEffect copy() { + return new PrototypePortalEffect(this); + } } class PrototypePortalCreateTokenEffect extends OneShotEffect { - public PrototypePortalCreateTokenEffect() { - super(Constants.Outcome.PutCreatureInPlay); - this.staticText = "Put a token that's a copy of the exiled card onto the battlefield. X is the converted mana cost of that card"; - } + public PrototypePortalCreateTokenEffect() { + super(Constants.Outcome.PutCreatureInPlay); + this.staticText = "Put a token that's a copy of the exiled card onto the battlefield. X is the converted mana cost of that card"; + } - public PrototypePortalCreateTokenEffect(final PrototypePortalCreateTokenEffect effect) { - super(effect); - } + public PrototypePortalCreateTokenEffect(final PrototypePortalCreateTokenEffect effect) { + super(effect); + } - @Override - public PrototypePortalCreateTokenEffect copy() { - return new PrototypePortalCreateTokenEffect(this); - } + @Override + public PrototypePortalCreateTokenEffect copy() { + return new PrototypePortalCreateTokenEffect(this); + } - @Override - public boolean apply(Game game, Ability source) { - Permanent permanent = game.getPermanent(source.getSourceId()); - if (permanent == null) return false; + @Override + public boolean apply(Game game, Ability source) { + Permanent permanent = game.getPermanent(source.getSourceId()); + if (permanent == null) return false; - if (permanent.getImprinted().size() > 0) { - Card card = game.getCard(permanent.getImprinted().get(0)); - if (card != null) { - EmptyToken token = new EmptyToken(); - CardUtil.copyTo(token).from(card); - token.putOntoBattlefield(1, game, source.getSourceId(), source.getControllerId()); - return true; - } - } + if (permanent.getImprinted().size() > 0) { + Card card = game.getCard(permanent.getImprinted().get(0)); + if (card != null) { + EmptyToken token = new EmptyToken(); + CardUtil.copyTo(token).from(card); + token.putOntoBattlefield(1, game, source.getSourceId(), source.getControllerId()); + return true; + } + } - return false; - } + return false; + } } diff --git a/Mage.Sets/src/mage/sets/scarsofmirrodin/PsychicMiasma.java b/Mage.Sets/src/mage/sets/scarsofmirrodin/PsychicMiasma.java index d4bd01d6e1..e9370b21e5 100644 --- a/Mage.Sets/src/mage/sets/scarsofmirrodin/PsychicMiasma.java +++ b/Mage.Sets/src/mage/sets/scarsofmirrodin/PsychicMiasma.java @@ -48,85 +48,85 @@ import mage.target.common.TargetDiscard; */ public class PsychicMiasma extends CardImpl { - public PsychicMiasma(UUID ownerId) { - super(ownerId, 76, "Psychic Miasma", Rarity.COMMON, new CardType[]{CardType.SORCERY}, "{1}{B}"); - this.expansionSetCode = "SOM"; - this.color.setBlack(true); - this.getSpellAbility().addTarget(new TargetPlayer()); - PsychicMiasmaEffect1 effect1 = new PsychicMiasmaEffect1(); - this.getSpellAbility().addEffect(effect1); - this.getSpellAbility().addEffect(new PsychicMiasmaEffect2()); - } + public PsychicMiasma(UUID ownerId) { + super(ownerId, 76, "Psychic Miasma", Rarity.COMMON, new CardType[]{CardType.SORCERY}, "{1}{B}"); + this.expansionSetCode = "SOM"; + this.color.setBlack(true); + this.getSpellAbility().addTarget(new TargetPlayer()); + PsychicMiasmaEffect1 effect1 = new PsychicMiasmaEffect1(); + this.getSpellAbility().addEffect(effect1); + this.getSpellAbility().addEffect(new PsychicMiasmaEffect2()); + } - public PsychicMiasma(final PsychicMiasma card) { - super(card); - } + public PsychicMiasma(final PsychicMiasma card) { + super(card); + } - @Override - public PsychicMiasma copy() { - return new PsychicMiasma(this); - } + @Override + public PsychicMiasma copy() { + return new PsychicMiasma(this); + } } class PsychicMiasmaEffect1 extends OneShotEffect { - public PsychicMiasmaEffect1() { - super(Outcome.Discard); - staticText = "Target player discards a card"; - } - - public PsychicMiasmaEffect1(final PsychicMiasmaEffect1 effect) { - super(effect); - } - - @Override - public boolean apply(Game game, Ability source) { + public PsychicMiasmaEffect1() { + super(Outcome.Discard); + staticText = "Target player discards a card"; + } + + public PsychicMiasmaEffect1(final PsychicMiasmaEffect1 effect) { + super(effect); + } + + @Override + public boolean apply(Game game, Ability source) { Player player = game.getPlayer(targetPointer.getFirst(game, source)); if (player != null) { - TargetDiscard target = new TargetDiscard(player.getId()); - player.choose(Outcome.Discard, target, source.getSourceId(), game); - Card card = player.getHand().get(target.getFirstTarget(), game); - if (card != null) { - player.discard(card, source, game); - game.getState().setValue(source.getId().toString(), card); - return true; - } + TargetDiscard target = new TargetDiscard(player.getId()); + player.choose(Outcome.Discard, target, source.getSourceId(), game); + Card card = player.getHand().get(target.getFirstTarget(), game); + if (card != null) { + player.discard(card, source, game); + game.getState().setValue(source.getId().toString(), card); + return true; + } } return false; - } + } + + @Override + public PsychicMiasmaEffect1 copy() { + return new PsychicMiasmaEffect1(this); + } - @Override - public PsychicMiasmaEffect1 copy() { - return new PsychicMiasmaEffect1(this); - } - } class PsychicMiasmaEffect2 extends PostResolveEffect { - public PsychicMiasmaEffect2() { - staticText = "If a land card is discarded this way, return {this} to its owner's hand"; - } - - public PsychicMiasmaEffect2(final PsychicMiasmaEffect2 effect) { - super(effect); - } - - @Override - public PsychicMiasmaEffect2 copy() { - return new PsychicMiasmaEffect2(this); - } + public PsychicMiasmaEffect2() { + staticText = "If a land card is discarded this way, return {this} to its owner's hand"; + } + + public PsychicMiasmaEffect2(final PsychicMiasmaEffect2 effect) { + super(effect); + } + + @Override + public PsychicMiasmaEffect2 copy() { + return new PsychicMiasmaEffect2(this); + } + + @Override + public void postResolve(Card card, Ability source, UUID controllerId, Game game) { + Card discard = (Card) game.getState().getValue(source.getId().toString()); + if (discard != null && discard.getCardType().contains(CardType.LAND)) { + card.moveToZone(Zone.HAND, source.getId(), game, false); + } + else { + card.moveToZone(Zone.GRAVEYARD, source.getId(), game, false); + } + } - @Override - public void postResolve(Card card, Ability source, UUID controllerId, Game game) { - Card discard = (Card) game.getState().getValue(source.getId().toString()); - if (discard != null && discard.getCardType().contains(CardType.LAND)) { - card.moveToZone(Zone.HAND, source.getId(), game, false); - } - else { - card.moveToZone(Zone.GRAVEYARD, source.getId(), game, false); - } - } - } \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/scarsofmirrodin/Putrefax.java b/Mage.Sets/src/mage/sets/scarsofmirrodin/Putrefax.java index b00470add7..7f61a606f8 100644 --- a/Mage.Sets/src/mage/sets/scarsofmirrodin/Putrefax.java +++ b/Mage.Sets/src/mage/sets/scarsofmirrodin/Putrefax.java @@ -50,7 +50,7 @@ public class Putrefax extends CardImpl { super(ownerId, 126, "Putrefax", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{3}{G}{G}"); this.expansionSetCode = "SOM"; this.subtype.add("Horror"); - this.color.setGreen(true); + this.color.setGreen(true); this.power = new MageInt(5); this.toughness = new MageInt(3); this.addAbility(TrampleAbility.getInstance()); diff --git a/Mage.Sets/src/mage/sets/scarsofmirrodin/QuicksilverGargantuan.java b/Mage.Sets/src/mage/sets/scarsofmirrodin/QuicksilverGargantuan.java index f5f8aec3e6..d7d6b3fc0c 100644 --- a/Mage.Sets/src/mage/sets/scarsofmirrodin/QuicksilverGargantuan.java +++ b/Mage.Sets/src/mage/sets/scarsofmirrodin/QuicksilverGargantuan.java @@ -48,75 +48,75 @@ import java.util.UUID; */ public class QuicksilverGargantuan extends CardImpl { - private static final String text = "You may have {this} enter the battlefield as a copy of any creature on the battlefield, except it's still 7/7"; + private static final String text = "You may have {this} enter the battlefield as a copy of any creature on the battlefield, except it's still 7/7"; - public QuicksilverGargantuan(UUID ownerId) { - super(ownerId, 39, "Quicksilver Gargantuan", Rarity.MYTHIC, new CardType[]{CardType.CREATURE}, "{5}{U}{U}"); - this.expansionSetCode = "SOM"; - this.subtype.add("Shapeshifter"); - this.color.setBlue(true); - this.power = new MageInt(7); - this.toughness = new MageInt(7); + public QuicksilverGargantuan(UUID ownerId) { + super(ownerId, 39, "Quicksilver Gargantuan", Rarity.MYTHIC, new CardType[]{CardType.CREATURE}, "{5}{U}{U}"); + this.expansionSetCode = "SOM"; + this.subtype.add("Shapeshifter"); + this.color.setBlue(true); + this.power = new MageInt(7); + this.toughness = new MageInt(7); - Ability ability = new EntersBattlefieldAbility(new QuicksilverGargantuanCopyEffect(), text); - ability.addTarget(new TargetCreaturePermanent()); - this.addAbility(ability); - } + Ability ability = new EntersBattlefieldAbility(new QuicksilverGargantuanCopyEffect(), text); + ability.addTarget(new TargetCreaturePermanent()); + this.addAbility(ability); + } - public QuicksilverGargantuan(final QuicksilverGargantuan card) { - super(card); - } + public QuicksilverGargantuan(final QuicksilverGargantuan card) { + super(card); + } - @Override - public QuicksilverGargantuan copy() { - return new QuicksilverGargantuan(this); - } + @Override + public QuicksilverGargantuan copy() { + return new QuicksilverGargantuan(this); + } - private class QuicksilverGargantuanCopyEffect extends ContinuousEffectImpl { + private class QuicksilverGargantuanCopyEffect extends ContinuousEffectImpl { - public QuicksilverGargantuanCopyEffect() { - super(Constants.Duration.WhileOnBattlefield, Constants.Layer.CopyEffects_1, Constants.SubLayer.NA, Constants.Outcome.BecomeCreature); - staticText = "You may have {this} enter the battlefield as a copy of any creature on the battlefield, except it's still 7/7"; - } + public QuicksilverGargantuanCopyEffect() { + super(Constants.Duration.WhileOnBattlefield, Constants.Layer.CopyEffects_1, Constants.SubLayer.NA, Constants.Outcome.BecomeCreature); + staticText = "You may have {this} enter the battlefield as a copy of any creature on the battlefield, except it's still 7/7"; + } - public QuicksilverGargantuanCopyEffect(final QuicksilverGargantuanCopyEffect effect) { - super(effect); - } + public QuicksilverGargantuanCopyEffect(final QuicksilverGargantuanCopyEffect effect) { + super(effect); + } - @Override - public boolean apply(Game game, Ability source) { - Card card = game.getCard(source.getFirstTarget()); - Permanent permanent = game.getPermanent(source.getSourceId()); - permanent.setName(card.getName()); - permanent.getColor().setColor(card.getColor()); - permanent.getManaCost().clear(); - permanent.getManaCost().add(card.getManaCost()); - permanent.getCardType().clear(); - for (CardType type : card.getCardType()) { - permanent.getCardType().add(type); - } - permanent.getSubtype().clear(); - for (String type : card.getSubtype()) { - permanent.getSubtype().add(type); - } - permanent.getSupertype().clear(); - for (String type : card.getSupertype()) { - permanent.getSupertype().add(type); - } - permanent.setExpansionSetCode(card.getExpansionSetCode()); - permanent.getAbilities().clear(); - for (Ability ability : card.getAbilities()) { - permanent.addAbility(ability, game); - } + @Override + public boolean apply(Game game, Ability source) { + Card card = game.getCard(source.getFirstTarget()); + Permanent permanent = game.getPermanent(source.getSourceId()); + permanent.setName(card.getName()); + permanent.getColor().setColor(card.getColor()); + permanent.getManaCost().clear(); + permanent.getManaCost().add(card.getManaCost()); + permanent.getCardType().clear(); + for (CardType type : card.getCardType()) { + permanent.getCardType().add(type); + } + permanent.getSubtype().clear(); + for (String type : card.getSubtype()) { + permanent.getSubtype().add(type); + } + permanent.getSupertype().clear(); + for (String type : card.getSupertype()) { + permanent.getSupertype().add(type); + } + permanent.setExpansionSetCode(card.getExpansionSetCode()); + permanent.getAbilities().clear(); + for (Ability ability : card.getAbilities()) { + permanent.addAbility(ability, game); + } - return true; - } + return true; + } - @Override - public QuicksilverGargantuanCopyEffect copy() { - return new QuicksilverGargantuanCopyEffect(this); - } + @Override + public QuicksilverGargantuanCopyEffect copy() { + return new QuicksilverGargantuanCopyEffect(this); + } - } + } } diff --git a/Mage.Sets/src/mage/sets/scarsofmirrodin/RatchetBomb.java b/Mage.Sets/src/mage/sets/scarsofmirrodin/RatchetBomb.java index 3e45610071..6a9fc246fd 100644 --- a/Mage.Sets/src/mage/sets/scarsofmirrodin/RatchetBomb.java +++ b/Mage.Sets/src/mage/sets/scarsofmirrodin/RatchetBomb.java @@ -83,7 +83,7 @@ public class RatchetBomb extends CardImpl { @Override public boolean apply(Game game, Ability source) { Permanent p = game.getBattlefield().getPermanent(source.getSourceId()); - if (p == null) { + if (p == null) { p = (Permanent) game.getLastKnownInformation(source.getSourceId(), Zone.BATTLEFIELD); if (p == null) { return false; @@ -92,10 +92,10 @@ public class RatchetBomb extends CardImpl { int count = p.getCounters().getCount(CounterType.CHARGE); for (Permanent perm: game.getBattlefield().getAllActivePermanents()) { - if (perm.getManaCost().convertedManaCost() == count && !(perm.getCardType().contains(CardType.LAND))) { - perm.destroy(source.getId(), game, false); - } - } + if (perm.getManaCost().convertedManaCost() == count && !(perm.getCardType().contains(CardType.LAND))) { + perm.destroy(source.getId(), game, false); + } + } return true; } diff --git a/Mage.Sets/src/mage/sets/scarsofmirrodin/RazorHippogriff.java b/Mage.Sets/src/mage/sets/scarsofmirrodin/RazorHippogriff.java index 375b3ec265..1054edfb19 100644 --- a/Mage.Sets/src/mage/sets/scarsofmirrodin/RazorHippogriff.java +++ b/Mage.Sets/src/mage/sets/scarsofmirrodin/RazorHippogriff.java @@ -59,19 +59,19 @@ public class RazorHippogriff extends CardImpl { this.expansionSetCode = "SOM"; this.subtype.add("Hippogriff"); - this.color.setWhite(true); + this.color.setWhite(true); this.power = new MageInt(3); - this.toughness = new MageInt(3); + this.toughness = new MageInt(3); - this.addAbility(FlyingAbility.getInstance()); + this.addAbility(FlyingAbility.getInstance()); - Ability ability = new EntersBattlefieldTriggeredAbility(new ReturnToHandTargetEffect()); - TargetCard target = new TargetCardInYourGraveyard(new FilterArtifactCard("artifact card from your graveyard")); - target.setRequired(true); - ability.addTarget(target); - ability.addEffect(new RazorHippogriffGainLifeEffect()); + Ability ability = new EntersBattlefieldTriggeredAbility(new ReturnToHandTargetEffect()); + TargetCard target = new TargetCardInYourGraveyard(new FilterArtifactCard("artifact card from your graveyard")); + target.setRequired(true); + ability.addTarget(target); + ability.addEffect(new RazorHippogriffGainLifeEffect()); - this.addAbility(ability); + this.addAbility(ability); } public RazorHippogriff (final RazorHippogriff card) { @@ -83,37 +83,37 @@ public class RazorHippogriff extends CardImpl { return new RazorHippogriff(this); } - public class RazorHippogriffGainLifeEffect extends OneShotEffect { + public class RazorHippogriffGainLifeEffect extends OneShotEffect { - public RazorHippogriffGainLifeEffect() { - super(Constants.Outcome.GainLife); - staticText = "you gain life equal to that card's converted mana cost."; - } + public RazorHippogriffGainLifeEffect() { + super(Constants.Outcome.GainLife); + staticText = "you gain life equal to that card's converted mana cost."; + } - public RazorHippogriffGainLifeEffect(final RazorHippogriffGainLifeEffect effect) { - super(effect); - } + public RazorHippogriffGainLifeEffect(final RazorHippogriffGainLifeEffect effect) { + super(effect); + } - @Override - public RazorHippogriffGainLifeEffect copy() { - return new RazorHippogriffGainLifeEffect(this); - } + @Override + public RazorHippogriffGainLifeEffect copy() { + return new RazorHippogriffGainLifeEffect(this); + } - @Override - public boolean apply(Game game, Ability source) { - Player player = game.getPlayer(source.getControllerId()); - if (player != null) { - Card card = player.getGraveyard().get(source.getFirstTarget(), game); - if (card == null) { - card = (Card)game.getLastKnownInformation(source.getFirstTarget(), Zone.GRAVEYARD); - } - if (card != null) { - player.gainLife(card.getManaCost().convertedManaCost(), game); - } - } - return true; - } + @Override + public boolean apply(Game game, Ability source) { + Player player = game.getPlayer(source.getControllerId()); + if (player != null) { + Card card = player.getGraveyard().get(source.getFirstTarget(), game); + if (card == null) { + card = (Card)game.getLastKnownInformation(source.getFirstTarget(), Zone.GRAVEYARD); + } + if (card != null) { + player.gainLife(card.getManaCost().convertedManaCost(), game); + } + } + return true; + } - } + } } diff --git a/Mage.Sets/src/mage/sets/scarsofmirrodin/RazorvergeThicket.java b/Mage.Sets/src/mage/sets/scarsofmirrodin/RazorvergeThicket.java index 7e31d4e081..9f3aa217df 100644 --- a/Mage.Sets/src/mage/sets/scarsofmirrodin/RazorvergeThicket.java +++ b/Mage.Sets/src/mage/sets/scarsofmirrodin/RazorvergeThicket.java @@ -49,22 +49,22 @@ import mage.filter.common.FilterLandPermanent; */ public class RazorvergeThicket extends CardImpl { - private static FilterLandPermanent filter = new FilterLandPermanent(); + private static FilterLandPermanent filter = new FilterLandPermanent(); + + static { + filter.setScopeSubtype(ComparisonScope.Any); + filter.setMessage("lands"); + } - static { - filter.setScopeSubtype(ComparisonScope.Any); - filter.setMessage("lands"); - } - public RazorvergeThicket (UUID ownerId) { super(ownerId, 228, "Razorverge Thicket", Rarity.RARE, new CardType[]{CardType.LAND}, null); this.expansionSetCode = "SOM"; Condition controls = new UnlessCondition(new ControlsPermanentCondition(filter, ControlsPermanentCondition.CountType.FEWER_THAN, 4)); - String abilityText = "tap it unless you control fewer than 3 " + filter.getMessage(); - this.addAbility(new EntersBattlefieldAbility(new ConditionalOneShotEffect(new TapSourceEffect(), controls, abilityText), abilityText)); - this.addAbility(new GreenManaAbility()); - this.addAbility(new WhiteManaAbility()); + String abilityText = "tap it unless you control fewer than 3 " + filter.getMessage(); + this.addAbility(new EntersBattlefieldAbility(new ConditionalOneShotEffect(new TapSourceEffect(), controls, abilityText), abilityText)); + this.addAbility(new GreenManaAbility()); + this.addAbility(new WhiteManaAbility()); } public RazorvergeThicket (final RazorvergeThicket card) { diff --git a/Mage.Sets/src/mage/sets/scarsofmirrodin/RelicPutrescence.java b/Mage.Sets/src/mage/sets/scarsofmirrodin/RelicPutrescence.java index 24623cc2af..fba03f8a18 100644 --- a/Mage.Sets/src/mage/sets/scarsofmirrodin/RelicPutrescence.java +++ b/Mage.Sets/src/mage/sets/scarsofmirrodin/RelicPutrescence.java @@ -58,13 +58,13 @@ public class RelicPutrescence extends CardImpl { super(ownerId, 77, "Relic Putrescence", Rarity.COMMON, new CardType[]{CardType.ENCHANTMENT}, "{2}{B}"); this.expansionSetCode = "SOM"; this.subtype.add("Aura"); - this.color.setBlack(true); - TargetPermanent auraTarget = new TargetArtifactPermanent(); - this.getSpellAbility().addTarget(auraTarget); - this.getSpellAbility().addEffect(new AttachEffect(Constants.Outcome.Detriment)); - Ability ability = new EnchantAbility(auraTarget.getTargetName()); - this.addAbility(ability); - this.addAbility(new RelicPutrescenceAbility()); + this.color.setBlack(true); + TargetPermanent auraTarget = new TargetArtifactPermanent(); + this.getSpellAbility().addTarget(auraTarget); + this.getSpellAbility().addEffect(new AttachEffect(Constants.Outcome.Detriment)); + Ability ability = new EnchantAbility(auraTarget.getTargetName()); + this.addAbility(ability); + this.addAbility(new RelicPutrescenceAbility()); } public RelicPutrescence (final RelicPutrescence card) { @@ -80,35 +80,35 @@ public class RelicPutrescence extends CardImpl { class RelicPutrescenceAbility extends TriggeredAbilityImpl { - public RelicPutrescenceAbility() { - super(Zone.BATTLEFIELD, new AddCountersControllerEffect(CounterType.POISON.createInstance(), true)); - } + public RelicPutrescenceAbility() { + super(Zone.BATTLEFIELD, new AddCountersControllerEffect(CounterType.POISON.createInstance(), true)); + } - public RelicPutrescenceAbility(final RelicPutrescenceAbility ability) { - super(ability); - } + public RelicPutrescenceAbility(final RelicPutrescenceAbility ability) { + super(ability); + } - @Override - public RelicPutrescenceAbility copy() { - return new RelicPutrescenceAbility(this); - } + @Override + public RelicPutrescenceAbility copy() { + return new RelicPutrescenceAbility(this); + } - @Override - public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == EventType.TAPPED) { - Permanent enchantment = game.getPermanent(sourceId); - if (enchantment != null && enchantment.getAttachedTo() != null) { - if (event.getTargetId().equals(enchantment.getAttachedTo())) { - return true; - } - } - } - return false; - } + @Override + public boolean checkTrigger(GameEvent event, Game game) { + if (event.getType() == EventType.TAPPED) { + Permanent enchantment = game.getPermanent(sourceId); + if (enchantment != null && enchantment.getAttachedTo() != null) { + if (event.getTargetId().equals(enchantment.getAttachedTo())) { + return true; + } + } + } + return false; + } - @Override - public String getRule() { - return "Whenever enchanted artifact becomes tapped, its controller gets a poison counter."; - } + @Override + public String getRule() { + return "Whenever enchanted artifact becomes tapped, its controller gets a poison counter."; + } } diff --git a/Mage.Sets/src/mage/sets/scarsofmirrodin/RevokeExistence.java b/Mage.Sets/src/mage/sets/scarsofmirrodin/RevokeExistence.java index 7ca864cd25..964ddcc3b7 100644 --- a/Mage.Sets/src/mage/sets/scarsofmirrodin/RevokeExistence.java +++ b/Mage.Sets/src/mage/sets/scarsofmirrodin/RevokeExistence.java @@ -54,7 +54,7 @@ public class RevokeExistence extends CardImpl { public RevokeExistence (UUID ownerId) { super(ownerId, 18, "Revoke Existence", Rarity.COMMON, new CardType[]{CardType.SORCERY}, "{1}{W}"); this.expansionSetCode = "SOM"; - this.color.setWhite(true); + this.color.setWhite(true); this.getSpellAbility().addEffect(new ExileTargetEffect()); this.getSpellAbility().addTarget(new TargetPermanent(filter)); } diff --git a/Mage.Sets/src/mage/sets/scarsofmirrodin/Riddlesmith.java b/Mage.Sets/src/mage/sets/scarsofmirrodin/Riddlesmith.java index 37ffd86905..d09b9fb0ed 100644 --- a/Mage.Sets/src/mage/sets/scarsofmirrodin/Riddlesmith.java +++ b/Mage.Sets/src/mage/sets/scarsofmirrodin/Riddlesmith.java @@ -56,7 +56,7 @@ public class Riddlesmith extends CardImpl { this.subtype.add("Human"); this.subtype.add("Artificer"); - this.color.setBlue(true); + this.color.setBlue(true); this.power = new MageInt(2); this.toughness = new MageInt(1); diff --git a/Mage.Sets/src/mage/sets/scarsofmirrodin/RustTick.java b/Mage.Sets/src/mage/sets/scarsofmirrodin/RustTick.java index bd8f8a8bf1..5518a09f75 100644 --- a/Mage.Sets/src/mage/sets/scarsofmirrodin/RustTick.java +++ b/Mage.Sets/src/mage/sets/scarsofmirrodin/RustTick.java @@ -52,136 +52,136 @@ import java.util.UUID; */ public class RustTick extends CardImpl { - public RustTick(UUID ownerId) { - super(ownerId, 198, "Rust Tick", Rarity.UNCOMMON, new CardType[]{CardType.ARTIFACT, CardType.CREATURE}, "{3}"); - this.expansionSetCode = "SOM"; - this.subtype.add("Insect"); + public RustTick(UUID ownerId) { + super(ownerId, 198, "Rust Tick", Rarity.UNCOMMON, new CardType[]{CardType.ARTIFACT, CardType.CREATURE}, "{3}"); + this.expansionSetCode = "SOM"; + this.subtype.add("Insect"); - this.power = new MageInt(1); - this.toughness = new MageInt(3); + this.power = new MageInt(1); + this.toughness = new MageInt(3); - // You may choose not to untap Rust Tick during your untap step. - this.addAbility(new SimpleStaticAbility(Constants.Zone.BATTLEFIELD, new RustTickSelfRestrictionEffect())); + // You may choose not to untap Rust Tick during your untap step. + this.addAbility(new SimpleStaticAbility(Constants.Zone.BATTLEFIELD, new RustTickSelfRestrictionEffect())); - // {1}, {tap}: Tap target artifact. It doesn't untap during its controller's untap step for as long as Rust Tick remains tapped. - Ability ability = new SimpleActivatedAbility(Constants.Zone.BATTLEFIELD, new RustTickTapTargetEffect(), new GenericManaCost(1)); - ability.addCost(new TapSourceCost()); - ability.addTarget(new TargetArtifactPermanent()); - this.addAbility(ability); + // {1}, {tap}: Tap target artifact. It doesn't untap during its controller's untap step for as long as Rust Tick remains tapped. + Ability ability = new SimpleActivatedAbility(Constants.Zone.BATTLEFIELD, new RustTickTapTargetEffect(), new GenericManaCost(1)); + ability.addCost(new TapSourceCost()); + ability.addTarget(new TargetArtifactPermanent()); + this.addAbility(ability); - this.addAbility(new SimpleStaticAbility(Constants.Zone.BATTLEFIELD, new RustTickRestrictionEffect())); - } + this.addAbility(new SimpleStaticAbility(Constants.Zone.BATTLEFIELD, new RustTickRestrictionEffect())); + } - public RustTick(final RustTick card) { - super(card); - } + public RustTick(final RustTick card) { + super(card); + } - @Override - public RustTick copy() { - return new RustTick(this); - } + @Override + public RustTick copy() { + return new RustTick(this); + } } class RustTickTapTargetEffect extends TapTargetEffect { - public RustTickTapTargetEffect() { - super(); - staticText = "Tap target artifact. It doesn't untap during its controller's untap step for as long as Rust Tick remains tapped"; - } + public RustTickTapTargetEffect() { + super(); + staticText = "Tap target artifact. It doesn't untap during its controller's untap step for as long as Rust Tick remains tapped"; + } - public RustTickTapTargetEffect(final RustTickTapTargetEffect effect) { - super(effect); - } + public RustTickTapTargetEffect(final RustTickTapTargetEffect effect) { + super(effect); + } - @Override - public boolean apply(Game game, Ability source) { - Permanent rustTick = game.getPermanent(source.getSourceId()); - if (rustTick != null) rustTick.clearConnectedCards("HisokasGuard"); - for (UUID target : targetPointer.getTargets(game, source)) { - Permanent permanent = game.getPermanent(target); - if (permanent != null) { - rustTick.addConnectedCard("HisokasGuard", permanent.getId()); - permanent.tap(game); - } else { - return false; - } - } - return true; - } + @Override + public boolean apply(Game game, Ability source) { + Permanent rustTick = game.getPermanent(source.getSourceId()); + if (rustTick != null) rustTick.clearConnectedCards("HisokasGuard"); + for (UUID target : targetPointer.getTargets(game, source)) { + Permanent permanent = game.getPermanent(target); + if (permanent != null) { + rustTick.addConnectedCard("HisokasGuard", permanent.getId()); + permanent.tap(game); + } else { + return false; + } + } + return true; + } - @Override - public RustTickTapTargetEffect copy() { - return new RustTickTapTargetEffect(this); - } + @Override + public RustTickTapTargetEffect copy() { + return new RustTickTapTargetEffect(this); + } - @Override - public String getText(Mode mode) { - return staticText; - } + @Override + public String getText(Mode mode) { + return staticText; + } } class RustTickRestrictionEffect extends RestrictionEffect { - public RustTickRestrictionEffect() { - super(Constants.Duration.WhileOnBattlefield); - } + public RustTickRestrictionEffect() { + super(Constants.Duration.WhileOnBattlefield); + } - public RustTickRestrictionEffect(final RustTickRestrictionEffect effect) { - super(effect); - } + public RustTickRestrictionEffect(final RustTickRestrictionEffect effect) { + super(effect); + } - @Override - public boolean applies(Permanent permanent, Ability source, Game game) { - Permanent rustTick = game.getPermanent(source.getSourceId()); - if (rustTick != null && rustTick.isTapped()) { - if (rustTick.getConnectedCards("HisokasGuard").size() > 0) { - UUID target = rustTick.getConnectedCards("HisokasGuard").get(0); - if (target != null && target.equals(permanent.getId())) { - return true; - } - } - } - return false; - } + @Override + public boolean applies(Permanent permanent, Ability source, Game game) { + Permanent rustTick = game.getPermanent(source.getSourceId()); + if (rustTick != null && rustTick.isTapped()) { + if (rustTick.getConnectedCards("HisokasGuard").size() > 0) { + UUID target = rustTick.getConnectedCards("HisokasGuard").get(0); + if (target != null && target.equals(permanent.getId())) { + return true; + } + } + } + return false; + } - @Override - public boolean canBeUntapped(Permanent permanent, Game game) { - return false; - } + @Override + public boolean canBeUntapped(Permanent permanent, Game game) { + return false; + } - @Override - public RustTickRestrictionEffect copy() { - return new RustTickRestrictionEffect(this); - } + @Override + public RustTickRestrictionEffect copy() { + return new RustTickRestrictionEffect(this); + } } class RustTickSelfRestrictionEffect extends RestrictionEffect { - public RustTickSelfRestrictionEffect() { - super(Constants.Duration.WhileOnBattlefield); - staticText = "You may choose not to untap Rust Tick during your untap step"; - } + public RustTickSelfRestrictionEffect() { + super(Constants.Duration.WhileOnBattlefield); + staticText = "You may choose not to untap Rust Tick during your untap step"; + } - public RustTickSelfRestrictionEffect(final RustTickSelfRestrictionEffect effect) { - super(effect); - } + public RustTickSelfRestrictionEffect(final RustTickSelfRestrictionEffect effect) { + super(effect); + } - @Override - public boolean applies(Permanent permanent, Ability source, Game game) { - return permanent.getId().equals(source.getSourceId()) && permanent.isTapped(); - } + @Override + public boolean applies(Permanent permanent, Ability source, Game game) { + return permanent.getId().equals(source.getSourceId()) && permanent.isTapped(); + } - @Override - public boolean canBeUntapped(Permanent permanent, Game game) { - Player player = game.getPlayer(permanent.getControllerId()); - return player != null && player.chooseUse(Constants.Outcome.Benefit, "Untap Rust Tick?", game); - } + @Override + public boolean canBeUntapped(Permanent permanent, Game game) { + Player player = game.getPlayer(permanent.getControllerId()); + return player != null && player.chooseUse(Constants.Outcome.Benefit, "Untap Rust Tick?", game); + } - @Override - public RustTickSelfRestrictionEffect copy() { - return new RustTickSelfRestrictionEffect(this); - } + @Override + public RustTickSelfRestrictionEffect copy() { + return new RustTickSelfRestrictionEffect(this); + } } diff --git a/Mage.Sets/src/mage/sets/scarsofmirrodin/RustedRelic.java b/Mage.Sets/src/mage/sets/scarsofmirrodin/RustedRelic.java index d8d44a3faf..ebf46c3ffb 100644 --- a/Mage.Sets/src/mage/sets/scarsofmirrodin/RustedRelic.java +++ b/Mage.Sets/src/mage/sets/scarsofmirrodin/RustedRelic.java @@ -75,8 +75,8 @@ class RustedRelicToken extends Token { public RustedRelicToken() { super("Rusted Relic", "a 5/5 Golem artifact creature"); cardType.add(Constants.CardType.CREATURE); - subtype.add("Golem"); - power = new MageInt(5); - toughness = new MageInt(5); + subtype.add("Golem"); + power = new MageInt(5); + toughness = new MageInt(5); } } \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/scarsofmirrodin/SalvageScout.java b/Mage.Sets/src/mage/sets/scarsofmirrodin/SalvageScout.java index 81bd60b8b7..7592ad5ce8 100644 --- a/Mage.Sets/src/mage/sets/scarsofmirrodin/SalvageScout.java +++ b/Mage.Sets/src/mage/sets/scarsofmirrodin/SalvageScout.java @@ -48,29 +48,29 @@ import java.util.UUID; */ public class SalvageScout extends CardImpl { - public SalvageScout(UUID ownerId) { - super(ownerId, 19, "Salvage Scout", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{W}"); - this.expansionSetCode = "SOM"; - this.subtype.add("Human"); - this.subtype.add("Scout"); + public SalvageScout(UUID ownerId) { + super(ownerId, 19, "Salvage Scout", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{W}"); + this.expansionSetCode = "SOM"; + this.subtype.add("Human"); + this.subtype.add("Scout"); - this.color.setWhite(true); - this.power = new MageInt(1); - this.toughness = new MageInt(1); + this.color.setWhite(true); + this.power = new MageInt(1); + this.toughness = new MageInt(1); - Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new ReturnToHandTargetEffect(), new ManaCostsImpl("{W}")); - ability.addTarget(new TargetCardInYourGraveyard(new FilterArtifactCard("artifact card from your graveyard"))); - ability.addCost(new SacrificeSourceCost()); - this.addAbility(ability); - } + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new ReturnToHandTargetEffect(), new ManaCostsImpl("{W}")); + ability.addTarget(new TargetCardInYourGraveyard(new FilterArtifactCard("artifact card from your graveyard"))); + ability.addCost(new SacrificeSourceCost()); + this.addAbility(ability); + } - public SalvageScout(final SalvageScout card) { - super(card); - } + public SalvageScout(final SalvageScout card) { + super(card); + } - @Override - public SalvageScout copy() { - return new SalvageScout(this); - } + @Override + public SalvageScout copy() { + return new SalvageScout(this); + } } diff --git a/Mage.Sets/src/mage/sets/scarsofmirrodin/ScoriaElemental.java b/Mage.Sets/src/mage/sets/scarsofmirrodin/ScoriaElemental.java index fcb5dbc324..41d2759d26 100644 --- a/Mage.Sets/src/mage/sets/scarsofmirrodin/ScoriaElemental.java +++ b/Mage.Sets/src/mage/sets/scarsofmirrodin/ScoriaElemental.java @@ -45,7 +45,7 @@ public class ScoriaElemental extends CardImpl { super(ownerId, 102, "Scoria Elemental", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{4}{R}"); this.expansionSetCode = "SOM"; this.subtype.add("Elemental"); - this.color.setRed(true); + this.color.setRed(true); this.power = new MageInt(6); this.toughness = new MageInt(1); } diff --git a/Mage.Sets/src/mage/sets/scarsofmirrodin/ScrapdiverSerpent.java b/Mage.Sets/src/mage/sets/scarsofmirrodin/ScrapdiverSerpent.java index 47fba8d089..8f37c3fb54 100644 --- a/Mage.Sets/src/mage/sets/scarsofmirrodin/ScrapdiverSerpent.java +++ b/Mage.Sets/src/mage/sets/scarsofmirrodin/ScrapdiverSerpent.java @@ -53,25 +53,25 @@ import mage.game.Game; */ public class ScrapdiverSerpent extends CardImpl { - private static final String text = "Scrapdiver Serpent is unblockable as long as defending player controls an artifact"; + private static final String text = "Scrapdiver Serpent is unblockable as long as defending player controls an artifact"; - private static final FilterPermanent filter = new FilterPermanent(); + private static final FilterPermanent filter = new FilterPermanent(); static { filter.getCardType().add(Constants.CardType.ARTIFACT); filter.setScopeCardType(Filter.ComparisonScope.Any); } - private class DefendingPlayerControlsArtifact implements Condition { - @Override - public boolean apply(Game game, Ability source) { - UUID defendingPlayer = game.getCombat().getDefendingPlayer(source.getSourceId()); - if (defendingPlayer != null) { - return game.getBattlefield().countAll(filter, defendingPlayer, game) > 0; - } - return false; - } - } + private class DefendingPlayerControlsArtifact implements Condition { + @Override + public boolean apply(Game game, Ability source) { + UUID defendingPlayer = game.getCombat().getDefendingPlayer(source.getSourceId()); + if (defendingPlayer != null) { + return game.getBattlefield().countAll(filter, defendingPlayer, game) > 0; + } + return false; + } + } public ScrapdiverSerpent (UUID ownerId) { super(ownerId, 41, "Scrapdiver Serpent", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{5}{U}{U}"); @@ -80,9 +80,9 @@ public class ScrapdiverSerpent extends CardImpl { this.color.setBlue(true); this.power = new MageInt(5); this.toughness = new MageInt(5); - ContinuousEffect gainAbility = new GainAbilitySourceEffect(UnblockableAbility.getInstance(), Constants.Duration.WhileOnBattlefield); - Effect effect = new ConditionalContinousEffect(gainAbility, new DefendingPlayerControlsArtifact(), text); - this.addAbility(new SimpleStaticAbility(Constants.Zone.BATTLEFIELD, effect)); + ContinuousEffect gainAbility = new GainAbilitySourceEffect(UnblockableAbility.getInstance(), Constants.Duration.WhileOnBattlefield); + Effect effect = new ConditionalContinousEffect(gainAbility, new DefendingPlayerControlsArtifact(), text); + this.addAbility(new SimpleStaticAbility(Constants.Zone.BATTLEFIELD, effect)); } public ScrapdiverSerpent (final ScrapdiverSerpent card) { diff --git a/Mage.Sets/src/mage/sets/scarsofmirrodin/SeachromeCoast.java b/Mage.Sets/src/mage/sets/scarsofmirrodin/SeachromeCoast.java index 44185605ed..42cb6f4c77 100644 --- a/Mage.Sets/src/mage/sets/scarsofmirrodin/SeachromeCoast.java +++ b/Mage.Sets/src/mage/sets/scarsofmirrodin/SeachromeCoast.java @@ -49,22 +49,22 @@ import mage.filter.common.FilterLandPermanent; */ public class SeachromeCoast extends CardImpl { - private static FilterLandPermanent filter = new FilterLandPermanent(); + private static FilterLandPermanent filter = new FilterLandPermanent(); + + static { + filter.setScopeSubtype(ComparisonScope.Any); + filter.setMessage("lands"); + } - static { - filter.setScopeSubtype(ComparisonScope.Any); - filter.setMessage("lands"); - } - public SeachromeCoast (UUID ownerId) { super(ownerId, 229, "Seachrome Coast", Rarity.RARE, new CardType[]{CardType.LAND}, null); this.expansionSetCode = "SOM"; Condition controls = new UnlessCondition(new ControlsPermanentCondition(filter, ControlsPermanentCondition.CountType.FEWER_THAN, 4)); - String abilityText = "tap it unless you control fewer than 3 " + filter.getMessage(); - this.addAbility(new EntersBattlefieldAbility(new ConditionalOneShotEffect(new TapSourceEffect(), controls, abilityText), abilityText)); - this.addAbility(new WhiteManaAbility()); - this.addAbility(new BlueManaAbility()); + String abilityText = "tap it unless you control fewer than 3 " + filter.getMessage(); + this.addAbility(new EntersBattlefieldAbility(new ConditionalOneShotEffect(new TapSourceEffect(), controls, abilityText), abilityText)); + this.addAbility(new WhiteManaAbility()); + this.addAbility(new BlueManaAbility()); } public SeachromeCoast (final SeachromeCoast card) { diff --git a/Mage.Sets/src/mage/sets/scarsofmirrodin/SeizeTheInitiative.java b/Mage.Sets/src/mage/sets/scarsofmirrodin/SeizeTheInitiative.java index d4accb9568..5ce0d9876c 100644 --- a/Mage.Sets/src/mage/sets/scarsofmirrodin/SeizeTheInitiative.java +++ b/Mage.Sets/src/mage/sets/scarsofmirrodin/SeizeTheInitiative.java @@ -48,7 +48,7 @@ public class SeizeTheInitiative extends CardImpl { public SeizeTheInitiative (UUID ownerId) { super(ownerId, 20, "Seize the Initiative", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{W}"); this.expansionSetCode = "SOM"; - this.color.setWhite(true); + this.color.setWhite(true); this.getSpellAbility().addEffect(new BoostTargetEffect(1, 1, Duration.EndOfTurn)); this.getSpellAbility().addEffect(new GainAbilityTargetEffect(FirstStrikeAbility.getInstance(), Duration.EndOfTurn)); this.getSpellAbility().addTarget(new TargetCreaturePermanent()); diff --git a/Mage.Sets/src/mage/sets/scarsofmirrodin/SemblanceAnvil.java b/Mage.Sets/src/mage/sets/scarsofmirrodin/SemblanceAnvil.java index 9ad999932d..32b7b46c58 100644 --- a/Mage.Sets/src/mage/sets/scarsofmirrodin/SemblanceAnvil.java +++ b/Mage.Sets/src/mage/sets/scarsofmirrodin/SemblanceAnvil.java @@ -54,109 +54,109 @@ import java.util.UUID; */ public class SemblanceAnvil extends CardImpl { - public SemblanceAnvil(UUID ownerId) { - super(ownerId, 201, "Semblance Anvil", Rarity.RARE, new CardType[]{CardType.ARTIFACT}, "{3}"); - this.expansionSetCode = "SOM"; + public SemblanceAnvil(UUID ownerId) { + super(ownerId, 201, "Semblance Anvil", Rarity.RARE, new CardType[]{CardType.ARTIFACT}, "{3}"); + this.expansionSetCode = "SOM"; - // Imprint - When Semblance Anvil enters the battlefield, you may exile a nonland card from your hand. - this.addAbility(new EntersBattlefieldTriggeredAbility(new SemblanceAnvilEffect(), true)); + // Imprint - When Semblance Anvil enters the battlefield, you may exile a nonland card from your hand. + this.addAbility(new EntersBattlefieldTriggeredAbility(new SemblanceAnvilEffect(), true)); - // Spells you cast that share a card type with the exiled card cost {2} less to cast. - this.addAbility(new SimpleStaticAbility(Constants.Zone.BATTLEFIELD, new SemblanceAnvilCostReductionEffect())); - } + // Spells you cast that share a card type with the exiled card cost {2} less to cast. + this.addAbility(new SimpleStaticAbility(Constants.Zone.BATTLEFIELD, new SemblanceAnvilCostReductionEffect())); + } - public SemblanceAnvil(final SemblanceAnvil card) { - super(card); - } + public SemblanceAnvil(final SemblanceAnvil card) { + super(card); + } - @Override - public SemblanceAnvil copy() { - return new SemblanceAnvil(this); - } + @Override + public SemblanceAnvil copy() { + return new SemblanceAnvil(this); + } } class SemblanceAnvilEffect extends OneShotEffect { - private static FilterCard filter = new FilterNonlandCard(); + private static FilterCard filter = new FilterNonlandCard(); - public SemblanceAnvilEffect() { - super(Constants.Outcome.Benefit); - staticText = "exile a nonland card from your hand"; - } + public SemblanceAnvilEffect() { + super(Constants.Outcome.Benefit); + staticText = "exile a nonland card from your hand"; + } - public SemblanceAnvilEffect(SemblanceAnvilEffect effect) { - super(effect); - } + public SemblanceAnvilEffect(SemblanceAnvilEffect effect) { + super(effect); + } - @Override - public boolean apply(Game game, Ability source) { - Player player = game.getPlayer(source.getControllerId()); - if (player.getHand().size() > 0) { - TargetCard target = new TargetCard(Constants.Zone.HAND, filter); - player.choose(Constants.Outcome.Benefit, player.getHand(), target, game); - Card card = player.getHand().get(target.getFirstTarget(), game); - if (card != null) { - card.moveToExile(getId(), "Semblance Anvil (Imprint)", source.getSourceId(), game); - Permanent permanent = game.getPermanent(source.getSourceId()); - if (permanent != null) { - permanent.imprint(card.getId(), game); - } - return true; - } - } - return true; - } + @Override + public boolean apply(Game game, Ability source) { + Player player = game.getPlayer(source.getControllerId()); + if (player.getHand().size() > 0) { + TargetCard target = new TargetCard(Constants.Zone.HAND, filter); + player.choose(Constants.Outcome.Benefit, player.getHand(), target, game); + Card card = player.getHand().get(target.getFirstTarget(), game); + if (card != null) { + card.moveToExile(getId(), "Semblance Anvil (Imprint)", source.getSourceId(), game); + Permanent permanent = game.getPermanent(source.getSourceId()); + if (permanent != null) { + permanent.imprint(card.getId(), game); + } + return true; + } + } + return true; + } - @Override - public SemblanceAnvilEffect copy() { - return new SemblanceAnvilEffect(this); - } + @Override + public SemblanceAnvilEffect copy() { + return new SemblanceAnvilEffect(this); + } } class SemblanceAnvilCostReductionEffect extends CostModificationEffectImpl { - private static final String effectText = "Spells you cast that share a card type with the exiled card cost {2} less to cast"; + private static final String effectText = "Spells you cast that share a card type with the exiled card cost {2} less to cast"; - SemblanceAnvilCostReductionEffect() { - super(Constants.Duration.WhileOnBattlefield, Constants.Outcome.Benefit); - staticText = effectText; - } + SemblanceAnvilCostReductionEffect() { + super(Constants.Duration.WhileOnBattlefield, Constants.Outcome.Benefit); + staticText = effectText; + } - SemblanceAnvilCostReductionEffect(SemblanceAnvilCostReductionEffect effect) { - super(effect); - } + SemblanceAnvilCostReductionEffect(SemblanceAnvilCostReductionEffect effect) { + super(effect); + } - @Override - public boolean apply(Game game, Ability source, Ability abilityToModify) { - SpellAbility spellAbility = (SpellAbility) abilityToModify; - CardUtil.adjustCost(spellAbility, 2); - return true; - } + @Override + public boolean apply(Game game, Ability source, Ability abilityToModify) { + SpellAbility spellAbility = (SpellAbility) abilityToModify; + CardUtil.adjustCost(spellAbility, 2); + return true; + } - @Override - public boolean applies(Ability abilityToModify, Ability source, Game game) { - if (abilityToModify instanceof SpellAbility) { - Card sourceCard = game.getCard(((SpellAbility) abilityToModify).getSourceId()); - if (sourceCard != null && sourceCard.getOwnerId().equals(source.getControllerId())) { - Permanent permanent = game.getPermanent(source.getSourceId()); - if (permanent != null) { - List imprinted = permanent.getImprinted(); - if (imprinted.size() > 0) { - Card imprintedCard = game.getCard(imprinted.get(0)); - if (imprintedCard != null && CardUtil.shareTypes(imprintedCard, sourceCard)) { - return true; - } - } - } - } - } - return false; - } + @Override + public boolean applies(Ability abilityToModify, Ability source, Game game) { + if (abilityToModify instanceof SpellAbility) { + Card sourceCard = game.getCard(((SpellAbility) abilityToModify).getSourceId()); + if (sourceCard != null && sourceCard.getOwnerId().equals(source.getControllerId())) { + Permanent permanent = game.getPermanent(source.getSourceId()); + if (permanent != null) { + List imprinted = permanent.getImprinted(); + if (imprinted.size() > 0) { + Card imprintedCard = game.getCard(imprinted.get(0)); + if (imprintedCard != null && CardUtil.shareTypes(imprintedCard, sourceCard)) { + return true; + } + } + } + } + } + return false; + } - @Override - public SemblanceAnvilCostReductionEffect copy() { - return new SemblanceAnvilCostReductionEffect(this); - } + @Override + public SemblanceAnvilCostReductionEffect copy() { + return new SemblanceAnvilCostReductionEffect(this); + } } diff --git a/Mage.Sets/src/mage/sets/scarsofmirrodin/ShapeAnew.java b/Mage.Sets/src/mage/sets/scarsofmirrodin/ShapeAnew.java index be7912aa95..227e03c213 100644 --- a/Mage.Sets/src/mage/sets/scarsofmirrodin/ShapeAnew.java +++ b/Mage.Sets/src/mage/sets/scarsofmirrodin/ShapeAnew.java @@ -52,19 +52,19 @@ import mage.target.TargetPermanent; */ public class ShapeAnew extends CardImpl { - private static final FilterPermanent filter = new FilterPermanent("an artifact"); + private static final FilterPermanent filter = new FilterPermanent("an artifact"); - static { - filter.getCardType().add(CardType.ARTIFACT); - } + static { + filter.getCardType().add(CardType.ARTIFACT); + } public ShapeAnew (UUID ownerId) { super(ownerId, 43, "Shape Anew", Rarity.RARE, new CardType[]{CardType.SORCERY}, "{3}{U}"); this.expansionSetCode = "SOM"; this.color.setBlue(true); this.getSpellAbility().addEffect(new SacrificeTargetEffect()); - this.getSpellAbility().addTarget(new TargetPermanent(filter)); - this.getSpellAbility().addEffect(new ShapeAnewEffect()); + this.getSpellAbility().addTarget(new TargetPermanent(filter)); + this.getSpellAbility().addEffect(new ShapeAnewEffect()); } public ShapeAnew (final ShapeAnew card) { @@ -76,49 +76,49 @@ public class ShapeAnew extends CardImpl { return new ShapeAnew(this); } - private class ShapeAnewEffect extends OneShotEffect { + private class ShapeAnewEffect extends OneShotEffect { - public ShapeAnewEffect() { - super(Constants.Outcome.PutCardInPlay); + public ShapeAnewEffect() { + super(Constants.Outcome.PutCardInPlay); staticText = "Then reveals cards from the top of his or her library until he or she reveals an artifact card. That player puts that card onto the battlefield, then shuffles all other cards revealed this way into his or her library"; - } + } - public ShapeAnewEffect(ShapeAnewEffect effect) { - super(effect); - } + public ShapeAnewEffect(ShapeAnewEffect effect) { + super(effect); + } - @Override - public boolean apply(Game game, Ability source) { + @Override + public boolean apply(Game game, Ability source) { Permanent sourcePermanent = (Permanent) game.getLastKnownInformation(targetPointer.getFirst(game, source), Constants.Zone.BATTLEFIELD); if (sourcePermanent == null) { return false; } - Player controller = game.getPlayer(source.getControllerId()); - if (controller == null) { - return false; - } - Cards revealed = new CardsImpl(); - Card artifactCard = null; - Cards nonArtifactCards = new CardsImpl(); - Player player = game.getPlayer(sourcePermanent.getControllerId()); - while (artifactCard == null && player.getLibrary().size() > 0) { - Card card = player.getLibrary().removeFromTop(game); - revealed.add(card); - if (card.getCardType().contains(CardType.ARTIFACT)) - artifactCard = card; - else - nonArtifactCards.add(card); - } - player.revealCards("Shape Anew", revealed, game); - artifactCard.putOntoBattlefield(game, Constants.Zone.LIBRARY, source.getId(), player.getId()); - player.getLibrary().addAll(nonArtifactCards.getCards(game), game); - player.shuffleLibrary(game); - return true; - } + Player controller = game.getPlayer(source.getControllerId()); + if (controller == null) { + return false; + } + Cards revealed = new CardsImpl(); + Card artifactCard = null; + Cards nonArtifactCards = new CardsImpl(); + Player player = game.getPlayer(sourcePermanent.getControllerId()); + while (artifactCard == null && player.getLibrary().size() > 0) { + Card card = player.getLibrary().removeFromTop(game); + revealed.add(card); + if (card.getCardType().contains(CardType.ARTIFACT)) + artifactCard = card; + else + nonArtifactCards.add(card); + } + player.revealCards("Shape Anew", revealed, game); + artifactCard.putOntoBattlefield(game, Constants.Zone.LIBRARY, source.getId(), player.getId()); + player.getLibrary().addAll(nonArtifactCards.getCards(game), game); + player.shuffleLibrary(game); + return true; + } - @Override - public ShapeAnewEffect copy() { - return new ShapeAnewEffect(this); - } - } + @Override + public ShapeAnewEffect copy() { + return new ShapeAnewEffect(this); + } + } } diff --git a/Mage.Sets/src/mage/sets/scarsofmirrodin/SkithiryxTheBlightDragon.java b/Mage.Sets/src/mage/sets/scarsofmirrodin/SkithiryxTheBlightDragon.java index 30684d8534..39641dda06 100644 --- a/Mage.Sets/src/mage/sets/scarsofmirrodin/SkithiryxTheBlightDragon.java +++ b/Mage.Sets/src/mage/sets/scarsofmirrodin/SkithiryxTheBlightDragon.java @@ -55,7 +55,7 @@ public class SkithiryxTheBlightDragon extends CardImpl this.supertype.add("Legendary"); this.subtype.add("Dragon"); this.subtype.add("Skeleton"); - this.color.setBlack(true); + this.color.setBlack(true); this.power = new MageInt(4); this.toughness = new MageInt(4); this.addAbility(FlyingAbility.getInstance()); diff --git a/Mage.Sets/src/mage/sets/scarsofmirrodin/SkyEelSchool.java b/Mage.Sets/src/mage/sets/scarsofmirrodin/SkyEelSchool.java index 55c9f0cfef..d760c4da40 100644 --- a/Mage.Sets/src/mage/sets/scarsofmirrodin/SkyEelSchool.java +++ b/Mage.Sets/src/mage/sets/scarsofmirrodin/SkyEelSchool.java @@ -47,7 +47,7 @@ public class SkyEelSchool extends CardImpl { super(ownerId, 44, "Sky-Eel School", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{3}{U}{U}"); this.expansionSetCode = "SOM"; this.subtype.add("Fish"); - this.color.setBlue(true); + this.color.setBlue(true); this.power = new MageInt(3); this.toughness = new MageInt(3); this.addAbility(FlyingAbility.getInstance()); diff --git a/Mage.Sets/src/mage/sets/scarsofmirrodin/SliceinTwain.java b/Mage.Sets/src/mage/sets/scarsofmirrodin/SliceinTwain.java index 59448aedb7..5c58186aa4 100644 --- a/Mage.Sets/src/mage/sets/scarsofmirrodin/SliceinTwain.java +++ b/Mage.Sets/src/mage/sets/scarsofmirrodin/SliceinTwain.java @@ -45,16 +45,16 @@ import mage.target.TargetPermanent; public class SliceinTwain extends CardImpl { private static final FilterPermanent filter = new FilterPermanent("artifact or enchantment"); - static { - filter.getCardType().add(CardType.ARTIFACT); - filter.getCardType().add(CardType.ENCHANTMENT); - filter.setScopeCardType(Filter.ComparisonScope.Any); - } + static { + filter.getCardType().add(CardType.ARTIFACT); + filter.getCardType().add(CardType.ENCHANTMENT); + filter.setScopeCardType(Filter.ComparisonScope.Any); + } public SliceinTwain (UUID ownerId) { super(ownerId, 127, "Slice in Twain", Rarity.UNCOMMON, new CardType[]{CardType.INSTANT}, "{2}{G}{G}"); this.expansionSetCode = "SOM"; - this.color.setGreen(true); + this.color.setGreen(true); this.getSpellAbility().addEffect(new DestroyTargetEffect()); this.getSpellAbility().addEffect(new DrawCardControllerEffect(1)); this.getSpellAbility().addTarget(new TargetPermanent(filter)); diff --git a/Mage.Sets/src/mage/sets/scarsofmirrodin/SoulParry.java b/Mage.Sets/src/mage/sets/scarsofmirrodin/SoulParry.java index aa39d8fe19..659704bfc2 100644 --- a/Mage.Sets/src/mage/sets/scarsofmirrodin/SoulParry.java +++ b/Mage.Sets/src/mage/sets/scarsofmirrodin/SoulParry.java @@ -46,11 +46,11 @@ public class SoulParry extends CardImpl { public SoulParry (UUID ownerId) { super(ownerId, 21, "Soul Parry", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{1}{W}"); this.expansionSetCode = "SOM"; - this.color.setWhite(true); - Target target = new TargetCreaturePermanent(1,2); - target.setTargetName("one or two creatures"); - this.getSpellAbility().addEffect(new PreventDamageFromTargetEffect(Duration.EndOfTurn, true)); - this.getSpellAbility().addTarget(target); + this.color.setWhite(true); + Target target = new TargetCreaturePermanent(1,2); + target.setTargetName("one or two creatures"); + this.getSpellAbility().addEffect(new PreventDamageFromTargetEffect(Duration.EndOfTurn, true)); + this.getSpellAbility().addTarget(target); } public SoulParry (final SoulParry card) { diff --git a/Mage.Sets/src/mage/sets/scarsofmirrodin/SpikeshotElder.java b/Mage.Sets/src/mage/sets/scarsofmirrodin/SpikeshotElder.java index 37a46d56fa..730c21d406 100644 --- a/Mage.Sets/src/mage/sets/scarsofmirrodin/SpikeshotElder.java +++ b/Mage.Sets/src/mage/sets/scarsofmirrodin/SpikeshotElder.java @@ -56,7 +56,7 @@ public class SpikeshotElder extends CardImpl { this.expansionSetCode = "SOM"; this.subtype.add("Goblin"); this.subtype.add("Shaman"); - this.color.setRed(true); + this.color.setRed(true); this.power = new MageInt(1); this.toughness = new MageInt(1); Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new SpikeshotElderEffect(), new ManaCostsImpl("{1}{R}{R}")); @@ -91,16 +91,16 @@ class SpikeshotElderEffect extends OneShotEffect { if (sourcePermanent == null) { sourcePermanent = (Permanent) game.getLastKnownInformation(source.getSourceId(), Constants.Zone.BATTLEFIELD); } - if (sourcePermanent != null && permanent != null) { - permanent.damage(sourcePermanent.getPower().getValue(), source.getId(), game, true, false); - return true; - } - Player player = game.getPlayer(source.getFirstTarget()); - if (sourcePermanent != null && player != null) { - player.damage(sourcePermanent.getPower().getValue(), source.getSourceId(), game, false, true); - return true; - } - return false; + if (sourcePermanent != null && permanent != null) { + permanent.damage(sourcePermanent.getPower().getValue(), source.getId(), game, true, false); + return true; + } + Player player = game.getPlayer(source.getFirstTarget()); + if (sourcePermanent != null && player != null) { + player.damage(sourcePermanent.getPower().getValue(), source.getSourceId(), game, false, true); + return true; + } + return false; } @Override diff --git a/Mage.Sets/src/mage/sets/scarsofmirrodin/SteadyProgress.java b/Mage.Sets/src/mage/sets/scarsofmirrodin/SteadyProgress.java index 4d51fe2233..d6f18da0f3 100644 --- a/Mage.Sets/src/mage/sets/scarsofmirrodin/SteadyProgress.java +++ b/Mage.Sets/src/mage/sets/scarsofmirrodin/SteadyProgress.java @@ -44,9 +44,9 @@ public class SteadyProgress extends CardImpl { public SteadyProgress (UUID ownerId) { super(ownerId, 45, "Steady Progress", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{2}{U}"); this.expansionSetCode = "SOM"; - this.color.setBlue(true); - this.getSpellAbility().addEffect(new ProliferateEffect()); - this.getSpellAbility().addEffect(new DrawCardControllerEffect(1)); + this.color.setBlue(true); + this.getSpellAbility().addEffect(new ProliferateEffect()); + this.getSpellAbility().addEffect(new DrawCardControllerEffect(1)); } public SteadyProgress (final SteadyProgress card) { diff --git a/Mage.Sets/src/mage/sets/scarsofmirrodin/SteelHellkite.java b/Mage.Sets/src/mage/sets/scarsofmirrodin/SteelHellkite.java index 7cc28631df..117d55a10d 100644 --- a/Mage.Sets/src/mage/sets/scarsofmirrodin/SteelHellkite.java +++ b/Mage.Sets/src/mage/sets/scarsofmirrodin/SteelHellkite.java @@ -55,51 +55,51 @@ import mage.filter.common.FilterNonlandPermanent; */ public class SteelHellkite extends CardImpl { - public SteelHellkite(UUID ownerId) { - super(ownerId, 205, "Steel Hellkite", Rarity.RARE, new CardType[]{CardType.ARTIFACT, CardType.CREATURE}, "{6}"); - this.expansionSetCode = "SOM"; - this.subtype.add("Dragon"); + public SteelHellkite(UUID ownerId) { + super(ownerId, 205, "Steel Hellkite", Rarity.RARE, new CardType[]{CardType.ARTIFACT, CardType.CREATURE}, "{6}"); + this.expansionSetCode = "SOM"; + this.subtype.add("Dragon"); - this.power = new MageInt(5); - this.toughness = new MageInt(5); + this.power = new MageInt(5); + this.toughness = new MageInt(5); - this.addAbility(FlyingAbility.getInstance()); - // {2}: Steel Hellkite gets +1/+0 until end of turn. - this.addAbility(new SimpleActivatedAbility(Constants.Zone.BATTLEFIELD, new BoostSourceEffect(1, 0, Constants.Duration.EndOfTurn), new GenericManaCost(2))); - // {X}: Destroy each nonland permanent with converted mana cost X whose controller was dealt combat damage by Steel Hellkite this turn. Activate this ability only once each turn. - this.addAbility(new ActivateOncePerTurnActivatedAbility(Constants.Zone.BATTLEFIELD, new SteelHellkiteDestroyEffect(), new ManaCostsImpl("{X}"))); + this.addAbility(FlyingAbility.getInstance()); + // {2}: Steel Hellkite gets +1/+0 until end of turn. + this.addAbility(new SimpleActivatedAbility(Constants.Zone.BATTLEFIELD, new BoostSourceEffect(1, 0, Constants.Duration.EndOfTurn), new GenericManaCost(2))); + // {X}: Destroy each nonland permanent with converted mana cost X whose controller was dealt combat damage by Steel Hellkite this turn. Activate this ability only once each turn. + this.addAbility(new ActivateOncePerTurnActivatedAbility(Constants.Zone.BATTLEFIELD, new SteelHellkiteDestroyEffect(), new ManaCostsImpl("{X}"))); - this.addWatcher(new SteelHellkiteWatcher()); - } + this.addWatcher(new SteelHellkiteWatcher()); + } - public SteelHellkite(final SteelHellkite card) { - super(card); - } + public SteelHellkite(final SteelHellkite card) { + super(card); + } - @Override - public SteelHellkite copy() { - return new SteelHellkite(this); - } + @Override + public SteelHellkite copy() { + return new SteelHellkite(this); + } } class SteelHellkiteDestroyEffect extends OneShotEffect { - public SteelHellkiteDestroyEffect() { - super(Constants.Outcome.DestroyPermanent); - staticText = "Destroy each nonland permanent with converted mana cost X whose controller was dealt combat damage by Steel Hellkite this turn"; - } + public SteelHellkiteDestroyEffect() { + super(Constants.Outcome.DestroyPermanent); + staticText = "Destroy each nonland permanent with converted mana cost X whose controller was dealt combat damage by Steel Hellkite this turn"; + } - public SteelHellkiteDestroyEffect(final SteelHellkiteDestroyEffect effect) { - super(effect); - } + public SteelHellkiteDestroyEffect(final SteelHellkiteDestroyEffect effect) { + super(effect); + } - @Override - public SteelHellkiteDestroyEffect copy() { - return new SteelHellkiteDestroyEffect(this); - } + @Override + public SteelHellkiteDestroyEffect copy() { + return new SteelHellkiteDestroyEffect(this); + } - @Override - public boolean apply(Game game, Ability source) { + @Override + public boolean apply(Game game, Ability source) { SteelHellkiteWatcher watcher = (SteelHellkiteWatcher) game.getState().getWatchers().get("SteelHellkiteWatcher", source.getSourceId()); if (watcher != null) { int xValue = source.getManaCostsToPay().getX(); @@ -112,47 +112,47 @@ class SteelHellkiteDestroyEffect extends OneShotEffect { } } return true; - } + } } class SteelHellkiteWatcher extends WatcherImpl { - public List damagedPlayers = new ArrayList(); + public List damagedPlayers = new ArrayList(); - public SteelHellkiteWatcher() { - super("SteelHellkiteWatcher", WatcherScope.CARD); - } + public SteelHellkiteWatcher() { + super("SteelHellkiteWatcher", WatcherScope.CARD); + } - public SteelHellkiteWatcher(final SteelHellkiteWatcher watcher) { - super(watcher); + public SteelHellkiteWatcher(final SteelHellkiteWatcher watcher) { + super(watcher); for (UUID playerId: watcher.damagedPlayers) { damagedPlayers.add(playerId); } - } + } - @Override - public SteelHellkiteWatcher copy() { - return new SteelHellkiteWatcher(this); - } + @Override + public SteelHellkiteWatcher copy() { + return new SteelHellkiteWatcher(this); + } - @Override - public void watch(GameEvent event, Game game) { - if (event.getType() == GameEvent.EventType.DAMAGED_PLAYER) { + @Override + public void watch(GameEvent event, Game game) { + if (event.getType() == GameEvent.EventType.DAMAGED_PLAYER) { DamagedPlayerEvent damageEvent = (DamagedPlayerEvent)event; - UUID sourceId = damageEvent.getSourceId(); - Permanent permanent = game.getPermanent(sourceId); - if (sourceId != null && permanent != null && permanent.getName().equals("Steel Hellkite")) { + UUID sourceId = damageEvent.getSourceId(); + Permanent permanent = game.getPermanent(sourceId); + if (sourceId != null && permanent != null && permanent.getName().equals("Steel Hellkite")) { if (!damagedPlayers.contains(event.getTargetId())) { damagedPlayers.add(event.getTargetId()); } - } + } } - } + } - @Override - public void reset() { - super.reset(); - damagedPlayers.clear(); - } + @Override + public void reset() { + super.reset(); + damagedPlayers.clear(); + } } diff --git a/Mage.Sets/src/mage/sets/scarsofmirrodin/StoicRebuttal.java b/Mage.Sets/src/mage/sets/scarsofmirrodin/StoicRebuttal.java index 2e478f04b9..c6a02f178b 100644 --- a/Mage.Sets/src/mage/sets/scarsofmirrodin/StoicRebuttal.java +++ b/Mage.Sets/src/mage/sets/scarsofmirrodin/StoicRebuttal.java @@ -44,43 +44,43 @@ import java.util.UUID; */ public class StoicRebuttal extends CardImpl { - public StoicRebuttal(UUID ownerId) { - super(ownerId, 46, "Stoic Rebuttal", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{1}{U}{U}"); - this.expansionSetCode = "SOM"; - this.color.setBlue(true); - this.getSpellAbility().addTarget(new TargetSpell()); - this.getSpellAbility().addEffect(new CounterTargetEffect()); - } + public StoicRebuttal(UUID ownerId) { + super(ownerId, 46, "Stoic Rebuttal", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{1}{U}{U}"); + this.expansionSetCode = "SOM"; + this.color.setBlue(true); + this.getSpellAbility().addTarget(new TargetSpell()); + this.getSpellAbility().addEffect(new CounterTargetEffect()); + } - public StoicRebuttal(final StoicRebuttal card) { - super(card); - } + public StoicRebuttal(final StoicRebuttal card) { + super(card); + } - @Override - public void adjustCosts(Ability ability, Game game) { - if (MetalcraftCondition.getInstance().apply(game, ability)) { - /*ManaCosts previousCost = ability.getManaCostsToPay(); - ManaCosts adjustedCost = new ManaCostsImpl(); - boolean reduced = false; - for (ManaCost manaCost : previousCost) { - Mana mana = manaCost.getOptions().get(0); - if (!reduced && mana != null && mana.getColorless() > 0) { - mana.setColorless(0); - adjustedCost.add(manaCost); - reduced = true; - } else { - adjustedCost.add(manaCost); - } - } - ability.getManaCostsToPay().clear(); - ability.getManaCostsToPay().addAll(adjustedCost);*/ - ability.getManaCostsToPay().clear(); - ability.getManaCostsToPay().load("{U}{U}"); - } - } + @Override + public void adjustCosts(Ability ability, Game game) { + if (MetalcraftCondition.getInstance().apply(game, ability)) { + /*ManaCosts previousCost = ability.getManaCostsToPay(); + ManaCosts adjustedCost = new ManaCostsImpl(); + boolean reduced = false; + for (ManaCost manaCost : previousCost) { + Mana mana = manaCost.getOptions().get(0); + if (!reduced && mana != null && mana.getColorless() > 0) { + mana.setColorless(0); + adjustedCost.add(manaCost); + reduced = true; + } else { + adjustedCost.add(manaCost); + } + } + ability.getManaCostsToPay().clear(); + ability.getManaCostsToPay().addAll(adjustedCost);*/ + ability.getManaCostsToPay().clear(); + ability.getManaCostsToPay().load("{U}{U}"); + } + } - @Override - public StoicRebuttal copy() { - return new StoicRebuttal(this); - } + @Override + public StoicRebuttal copy() { + return new StoicRebuttal(this); + } } diff --git a/Mage.Sets/src/mage/sets/scarsofmirrodin/StrataScythe.java b/Mage.Sets/src/mage/sets/scarsofmirrodin/StrataScythe.java index 81e5b7101a..1183caa350 100644 --- a/Mage.Sets/src/mage/sets/scarsofmirrodin/StrataScythe.java +++ b/Mage.Sets/src/mage/sets/scarsofmirrodin/StrataScythe.java @@ -92,16 +92,16 @@ class StrataScytheImprintEffect extends OneShotEffect if (player == null) return false; TargetCardInLibrary target = new TargetCardInLibrary(new FilterLandCard()); - if (player.searchLibrary(target, game)) { + if (player.searchLibrary(target, game)) { if (target.getTargets().size() > 0) { UUID cardId = target.getTargets().get(0); Card card = player.getLibrary().remove(cardId, game); - if (card != null) { + if (card != null) { card.moveToExile(source.getSourceId(), "Strata Scythe", source.getId(), game); - Permanent permanent = game.getPermanent(source.getSourceId()); - if (permanent != null) { - permanent.imprint(card.getId(), game); - } + Permanent permanent = game.getPermanent(source.getSourceId()); + if (permanent != null) { + permanent.imprint(card.getId(), game); + } } } } @@ -130,12 +130,12 @@ class SameNameAsExiledCountValue implements DynamicValue { public int calculate(Game game, Ability sourceAbility) { int value = 0; Permanent permanent = game.getPermanent(sourceAbility.getSourceId()); - if (permanent != null && permanent.getImprinted().size() > 0) { - FilterPermanent filterPermanent = new FilterPermanent(); + if (permanent != null && permanent.getImprinted().size() > 0) { + FilterPermanent filterPermanent = new FilterPermanent(); filterPermanent.getName().add(game.getCard(permanent.getImprinted().get(0)).getName()); value = game.getBattlefield().countAll(filterPermanent, game); - } - return value; + } + return value; } @Override diff --git a/Mage.Sets/src/mage/sets/scarsofmirrodin/StriderHarness.java b/Mage.Sets/src/mage/sets/scarsofmirrodin/StriderHarness.java index f558707d5d..6f0b9a6617 100644 --- a/Mage.Sets/src/mage/sets/scarsofmirrodin/StriderHarness.java +++ b/Mage.Sets/src/mage/sets/scarsofmirrodin/StriderHarness.java @@ -54,7 +54,7 @@ public class StriderHarness extends CardImpl { this.subtype.add("Equipment"); this.addAbility(new EquipAbility(Constants.Outcome.AddAbility, new GenericManaCost(1))); this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityAttachedEffect(HasteAbility.getInstance(), Constants.AttachmentType.EQUIPMENT))); - this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostEquippedEffect(1, 1))); + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostEquippedEffect(1, 1))); } public StriderHarness (final StriderHarness card) { diff --git a/Mage.Sets/src/mage/sets/scarsofmirrodin/SunblastAngel.java b/Mage.Sets/src/mage/sets/scarsofmirrodin/SunblastAngel.java index f305ec8f7c..0c37ff7eb1 100644 --- a/Mage.Sets/src/mage/sets/scarsofmirrodin/SunblastAngel.java +++ b/Mage.Sets/src/mage/sets/scarsofmirrodin/SunblastAngel.java @@ -45,23 +45,23 @@ import mage.filter.common.FilterCreaturePermanent; */ public class SunblastAngel extends CardImpl { - private static final FilterPermanent tappedFilter = new FilterCreaturePermanent("tapped creatures"); + private static final FilterPermanent tappedFilter = new FilterCreaturePermanent("tapped creatures"); - static { - tappedFilter.setUseTapped(true); - tappedFilter.setTapped(true); - } + static { + tappedFilter.setUseTapped(true); + tappedFilter.setTapped(true); + } public SunblastAngel (UUID ownerId) { super(ownerId, 22, "Sunblast Angel", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{4}{W}{W}"); this.expansionSetCode = "SOM"; this.subtype.add("Angel"); - this.color.setWhite(true); + this.color.setWhite(true); this.power = new MageInt(4); - this.toughness = new MageInt(5); + this.toughness = new MageInt(5); - addAbility(FlyingAbility.getInstance()); - addAbility(new EntersBattlefieldTriggeredAbility(new DestroyAllEffect(tappedFilter), false)); + addAbility(FlyingAbility.getInstance()); + addAbility(new EntersBattlefieldTriggeredAbility(new DestroyAllEffect(tappedFilter), false)); } public SunblastAngel (final SunblastAngel card) { diff --git a/Mage.Sets/src/mage/sets/scarsofmirrodin/Swamp1.java b/Mage.Sets/src/mage/sets/scarsofmirrodin/Swamp1.java index caf648ad36..a631f7afd8 100644 --- a/Mage.Sets/src/mage/sets/scarsofmirrodin/Swamp1.java +++ b/Mage.Sets/src/mage/sets/scarsofmirrodin/Swamp1.java @@ -36,18 +36,18 @@ import java.util.UUID; */ public class Swamp1 extends mage.cards.basiclands.Swamp { - public Swamp1(UUID ownerId) { - super(ownerId, 238); - this.expansionSetCode = "SOM"; - } + public Swamp1(UUID ownerId) { + super(ownerId, 238); + this.expansionSetCode = "SOM"; + } - public Swamp1(final Swamp1 card) { - super(card); - } + public Swamp1(final Swamp1 card) { + super(card); + } - @Override - public Swamp1 copy() { - return new Swamp1(this); - } + @Override + public Swamp1 copy() { + return new Swamp1(this); + } } diff --git a/Mage.Sets/src/mage/sets/scarsofmirrodin/Swamp2.java b/Mage.Sets/src/mage/sets/scarsofmirrodin/Swamp2.java index 09946055e9..70858ab1d4 100644 --- a/Mage.Sets/src/mage/sets/scarsofmirrodin/Swamp2.java +++ b/Mage.Sets/src/mage/sets/scarsofmirrodin/Swamp2.java @@ -36,18 +36,18 @@ import java.util.UUID; */ public class Swamp2 extends mage.cards.basiclands.Swamp { - public Swamp2(UUID ownerId) { - super(ownerId, 239); - this.expansionSetCode = "SOM"; - } + public Swamp2(UUID ownerId) { + super(ownerId, 239); + this.expansionSetCode = "SOM"; + } - public Swamp2(final Swamp2 card) { - super(card); - } + public Swamp2(final Swamp2 card) { + super(card); + } - @Override - public Swamp2 copy() { - return new Swamp2(this); - } + @Override + public Swamp2 copy() { + return new Swamp2(this); + } } diff --git a/Mage.Sets/src/mage/sets/scarsofmirrodin/Swamp3.java b/Mage.Sets/src/mage/sets/scarsofmirrodin/Swamp3.java index 03d2187048..fd183de488 100644 --- a/Mage.Sets/src/mage/sets/scarsofmirrodin/Swamp3.java +++ b/Mage.Sets/src/mage/sets/scarsofmirrodin/Swamp3.java @@ -36,18 +36,18 @@ import java.util.UUID; */ public class Swamp3 extends mage.cards.basiclands.Swamp { - public Swamp3(UUID ownerId) { - super(ownerId, 240); - this.expansionSetCode = "SOM"; - } + public Swamp3(UUID ownerId) { + super(ownerId, 240); + this.expansionSetCode = "SOM"; + } - public Swamp3(final Swamp3 card) { - super(card); - } + public Swamp3(final Swamp3 card) { + super(card); + } - @Override - public Swamp3 copy() { - return new Swamp3(this); - } + @Override + public Swamp3 copy() { + return new Swamp3(this); + } } diff --git a/Mage.Sets/src/mage/sets/scarsofmirrodin/Swamp4.java b/Mage.Sets/src/mage/sets/scarsofmirrodin/Swamp4.java index 5ef577f70c..f0b613f2e4 100644 --- a/Mage.Sets/src/mage/sets/scarsofmirrodin/Swamp4.java +++ b/Mage.Sets/src/mage/sets/scarsofmirrodin/Swamp4.java @@ -36,18 +36,18 @@ import java.util.UUID; */ public class Swamp4 extends mage.cards.basiclands.Swamp { - public Swamp4(UUID ownerId) { - super(ownerId, 241); - this.expansionSetCode = "SOM"; - } + public Swamp4(UUID ownerId) { + super(ownerId, 241); + this.expansionSetCode = "SOM"; + } - public Swamp4(final Swamp4 card) { - super(card); - } + public Swamp4(final Swamp4 card) { + super(card); + } - @Override - public Swamp4 copy() { - return new Swamp4(this); - } + @Override + public Swamp4 copy() { + return new Swamp4(this); + } } diff --git a/Mage.Sets/src/mage/sets/scarsofmirrodin/SwordOfBodyAndMind.java b/Mage.Sets/src/mage/sets/scarsofmirrodin/SwordOfBodyAndMind.java index 1e232acfc6..c397b2cd39 100644 --- a/Mage.Sets/src/mage/sets/scarsofmirrodin/SwordOfBodyAndMind.java +++ b/Mage.Sets/src/mage/sets/scarsofmirrodin/SwordOfBodyAndMind.java @@ -116,7 +116,7 @@ class SwordOfBodyAndMindAbility extends TriggeredAbilityImpl { public TaintedStrike (UUID ownerId) { super(ownerId, 80, "Tainted Strike", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{B}"); this.expansionSetCode = "SOM"; - this.color.setBlack(true); + this.color.setBlack(true); this.getSpellAbility().addEffect(new BoostTargetEffect(1, 0, Duration.EndOfTurn)); this.getSpellAbility().addEffect(new GainAbilityTargetEffect(InfectAbility.getInstance(), Duration.EndOfTurn)); this.getSpellAbility().addTarget(new TargetCreaturePermanent()); diff --git a/Mage.Sets/src/mage/sets/scarsofmirrodin/TangleAngler.java b/Mage.Sets/src/mage/sets/scarsofmirrodin/TangleAngler.java index 8bc75d1df1..5e0c8fccc8 100644 --- a/Mage.Sets/src/mage/sets/scarsofmirrodin/TangleAngler.java +++ b/Mage.Sets/src/mage/sets/scarsofmirrodin/TangleAngler.java @@ -46,27 +46,27 @@ import mage.target.common.TargetCreaturePermanent; */ public class TangleAngler extends CardImpl { - public TangleAngler(UUID ownerId) { - super(ownerId, 128, "Tangle Angler", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{3}{G}"); - this.expansionSetCode = "SOM"; - this.subtype.add("Horror"); - this.color.setGreen(true); - this.power = new MageInt(1); - this.toughness = new MageInt(5); + public TangleAngler(UUID ownerId) { + super(ownerId, 128, "Tangle Angler", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{3}{G}"); + this.expansionSetCode = "SOM"; + this.subtype.add("Horror"); + this.color.setGreen(true); + this.power = new MageInt(1); + this.toughness = new MageInt(5); - this.addAbility(InfectAbility.getInstance()); - Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new MustBlockSourceTargetEffect(), new ManaCostsImpl("{G}")); - ability.addTarget(new TargetCreaturePermanent()); - this.addAbility(ability); - } + this.addAbility(InfectAbility.getInstance()); + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new MustBlockSourceTargetEffect(), new ManaCostsImpl("{G}")); + ability.addTarget(new TargetCreaturePermanent()); + this.addAbility(ability); + } - public TangleAngler(final TangleAngler card) { - super(card); - } + public TangleAngler(final TangleAngler card) { + super(card); + } - @Override - public TangleAngler copy() { - return new TangleAngler(this); - } + @Override + public TangleAngler copy() { + return new TangleAngler(this); + } } \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/scarsofmirrodin/TelJiladDefiance.java b/Mage.Sets/src/mage/sets/scarsofmirrodin/TelJiladDefiance.java index 3d4841c5f0..c3e46d04a3 100644 --- a/Mage.Sets/src/mage/sets/scarsofmirrodin/TelJiladDefiance.java +++ b/Mage.Sets/src/mage/sets/scarsofmirrodin/TelJiladDefiance.java @@ -44,22 +44,22 @@ import java.util.UUID; */ public class TelJiladDefiance extends CardImpl { - public TelJiladDefiance(UUID ownerId) { - super(ownerId, 129, "Tel-Jilad Defiance", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{1}{G}"); - this.expansionSetCode = "SOM"; - this.color.setGreen(true); - this.getSpellAbility().addEffect(new GainProtectionFromTypeTargetEffect(Constants.Duration.EndOfTurn, new FilterArtifactCard("artifacts"))); - this.getSpellAbility().addTarget(new TargetCreaturePermanent()); - this.getSpellAbility().addEffect(new DrawCardControllerEffect(1)); - } + public TelJiladDefiance(UUID ownerId) { + super(ownerId, 129, "Tel-Jilad Defiance", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{1}{G}"); + this.expansionSetCode = "SOM"; + this.color.setGreen(true); + this.getSpellAbility().addEffect(new GainProtectionFromTypeTargetEffect(Constants.Duration.EndOfTurn, new FilterArtifactCard("artifacts"))); + this.getSpellAbility().addTarget(new TargetCreaturePermanent()); + this.getSpellAbility().addEffect(new DrawCardControllerEffect(1)); + } - public TelJiladDefiance(final TelJiladDefiance card) { - super(card); - } + public TelJiladDefiance(final TelJiladDefiance card) { + super(card); + } - @Override - public TelJiladDefiance copy() { - return new TelJiladDefiance(this); - } + @Override + public TelJiladDefiance copy() { + return new TelJiladDefiance(this); + } } diff --git a/Mage.Sets/src/mage/sets/scarsofmirrodin/TelJiladFallen.java b/Mage.Sets/src/mage/sets/scarsofmirrodin/TelJiladFallen.java index 8a93db2452..24a19360e5 100644 --- a/Mage.Sets/src/mage/sets/scarsofmirrodin/TelJiladFallen.java +++ b/Mage.Sets/src/mage/sets/scarsofmirrodin/TelJiladFallen.java @@ -48,11 +48,11 @@ public class TelJiladFallen extends CardImpl { this.expansionSetCode = "SOM"; this.subtype.add("Elf"); this.subtype.add("Warrior"); - this.color.setGreen(true); + this.color.setGreen(true); this.power = new MageInt(3); this.toughness = new MageInt(1); - this.addAbility(InfectAbility.getInstance()); - this.addAbility(new ProtectionAbility(new FilterArtifactCard("artifacts"))); + this.addAbility(InfectAbility.getInstance()); + this.addAbility(new ProtectionAbility(new FilterArtifactCard("artifacts"))); } public TelJiladFallen (final TelJiladFallen card) { diff --git a/Mage.Sets/src/mage/sets/scarsofmirrodin/TemperedSteel.java b/Mage.Sets/src/mage/sets/scarsofmirrodin/TemperedSteel.java index 1a7b4d6d71..06e3b78d6a 100644 --- a/Mage.Sets/src/mage/sets/scarsofmirrodin/TemperedSteel.java +++ b/Mage.Sets/src/mage/sets/scarsofmirrodin/TemperedSteel.java @@ -55,7 +55,7 @@ public class TemperedSteel extends CardImpl { public TemperedSteel (UUID ownerId) { super(ownerId, 24, "Tempered Steel", Rarity.RARE, new CardType[]{CardType.ENCHANTMENT}, "{1}{W}{W}"); this.expansionSetCode = "SOM"; - this.color.setWhite(true); + this.color.setWhite(true); this.addAbility(new SimpleStaticAbility(Constants.Zone.BATTLEFIELD, new BoostControlledEffect(2, 2, Duration.WhileOnBattlefield, filter, false))); } diff --git a/Mage.Sets/src/mage/sets/scarsofmirrodin/ThroneofGeth.java b/Mage.Sets/src/mage/sets/scarsofmirrodin/ThroneofGeth.java index 572997b0fa..4f4af272a8 100644 --- a/Mage.Sets/src/mage/sets/scarsofmirrodin/ThroneofGeth.java +++ b/Mage.Sets/src/mage/sets/scarsofmirrodin/ThroneofGeth.java @@ -49,10 +49,10 @@ import mage.target.common.TargetControlledPermanent; public class ThroneofGeth extends CardImpl { private static FilterControlledPermanent filter = new FilterControlledPermanent("an artifact"); - static { - filter.getCardType().add(CardType.ARTIFACT); - filter.setScopeCardType(Filter.ComparisonScope.Any); - } + static { + filter.getCardType().add(CardType.ARTIFACT); + filter.setScopeCardType(Filter.ComparisonScope.Any); + } public ThroneofGeth (UUID ownerId) { super(ownerId, 211, "Throne of Geth", Rarity.UNCOMMON, new CardType[]{CardType.ARTIFACT}, "{2}"); diff --git a/Mage.Sets/src/mage/sets/scarsofmirrodin/Thrummingbird.java b/Mage.Sets/src/mage/sets/scarsofmirrodin/Thrummingbird.java index 3c192a0d0e..469d7e7da9 100644 --- a/Mage.Sets/src/mage/sets/scarsofmirrodin/Thrummingbird.java +++ b/Mage.Sets/src/mage/sets/scarsofmirrodin/Thrummingbird.java @@ -43,26 +43,26 @@ import mage.cards.CardImpl; */ public class Thrummingbird extends CardImpl { - public Thrummingbird(UUID ownerId) { - super(ownerId, 47, "Thrummingbird", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{1}{U}"); - this.expansionSetCode = "SOM"; - this.subtype.add("Bird"); - this.subtype.add("Horror"); - - this.color.setBlue(true); - this.power = new MageInt(1); - this.toughness = new MageInt(1); - - this.addAbility(FlyingAbility.getInstance()); + public Thrummingbird(UUID ownerId) { + super(ownerId, 47, "Thrummingbird", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{1}{U}"); + this.expansionSetCode = "SOM"; + this.subtype.add("Bird"); + this.subtype.add("Horror"); + + this.color.setBlue(true); + this.power = new MageInt(1); + this.toughness = new MageInt(1); + + this.addAbility(FlyingAbility.getInstance()); this.addAbility(new DealsCombatDamageToAPlayerTriggeredAbility(new ProliferateEffect(), false)); - } + } - public Thrummingbird(final Thrummingbird card) { - super(card); - } + public Thrummingbird(final Thrummingbird card) { + super(card); + } - @Override - public Thrummingbird copy() { - return new Thrummingbird(this); - } + @Override + public Thrummingbird copy() { + return new Thrummingbird(this); + } } diff --git a/Mage.Sets/src/mage/sets/scarsofmirrodin/TrigonOfCorruption.java b/Mage.Sets/src/mage/sets/scarsofmirrodin/TrigonOfCorruption.java index 5f9213a844..27b2c9930e 100644 --- a/Mage.Sets/src/mage/sets/scarsofmirrodin/TrigonOfCorruption.java +++ b/Mage.Sets/src/mage/sets/scarsofmirrodin/TrigonOfCorruption.java @@ -60,23 +60,23 @@ public class TrigonOfCorruption extends CardImpl { public TrigonOfCorruption (UUID ownerId) { super(ownerId, 213, "Trigon of Corruption", Rarity.UNCOMMON, new CardType[]{CardType.ARTIFACT}, "{4}"); this.expansionSetCode = "SOM"; - + this.addAbility(new EntersBattlefieldAbility(new AddCountersSourceEffect(new ChargeCounter(3)), "")); - Costs costs = new CostsImpl(); - costs.add(new RemoveCountersSourceCost(CounterType.CHARGE.createInstance())); - costs.add(new TapSourceCost()); - Effect putCounterEffect = new AddCountersTargetEffect(CounterType.M1M1.createInstance()); - Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, putCounterEffect, costs); + Costs costs = new CostsImpl(); + costs.add(new RemoveCountersSourceCost(CounterType.CHARGE.createInstance())); + costs.add(new TapSourceCost()); + Effect putCounterEffect = new AddCountersTargetEffect(CounterType.M1M1.createInstance()); + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, putCounterEffect, costs); ability.addManaCost(new GenericManaCost(2)); - Target target = new TargetCreaturePermanent(); + Target target = new TargetCreaturePermanent(); target.setRequired(true); ability.addTarget(target); - this.addAbility(ability); + this.addAbility(ability); Ability ability2 = new SimpleActivatedAbility(Zone.BATTLEFIELD, new AddCountersSourceEffect(CounterType.CHARGE.createInstance()), new TapSourceCost()); ability2.addManaCost(new ManaCostsImpl("{B}{B}")); - this.addAbility(ability2); + this.addAbility(ability2); } public TrigonOfCorruption (final TrigonOfCorruption card) { diff --git a/Mage.Sets/src/mage/sets/scarsofmirrodin/TrigonOfInfestation.java b/Mage.Sets/src/mage/sets/scarsofmirrodin/TrigonOfInfestation.java index 88cb2da0ab..36e4db55aa 100644 --- a/Mage.Sets/src/mage/sets/scarsofmirrodin/TrigonOfInfestation.java +++ b/Mage.Sets/src/mage/sets/scarsofmirrodin/TrigonOfInfestation.java @@ -54,33 +54,33 @@ import mage.abilities.costs.mana.GenericManaCost; */ public class TrigonOfInfestation extends CardImpl { - private static InsectInfectToken insectToken = new InsectInfectToken(); + private static InsectInfectToken insectToken = new InsectInfectToken(); - public TrigonOfInfestation(UUID ownerId) { - super(ownerId, 214, "Trigon of Infestation", Rarity.UNCOMMON, new CardType[]{CardType.ARTIFACT}, "{4}"); - this.expansionSetCode = "SOM"; + public TrigonOfInfestation(UUID ownerId) { + super(ownerId, 214, "Trigon of Infestation", Rarity.UNCOMMON, new CardType[]{CardType.ARTIFACT}, "{4}"); + this.expansionSetCode = "SOM"; - this.addAbility(new EntersBattlefieldAbility(new AddCountersSourceEffect(new ChargeCounter(3)), "")); + this.addAbility(new EntersBattlefieldAbility(new AddCountersSourceEffect(new ChargeCounter(3)), "")); - Costs costs = new CostsImpl(); - costs.add(new RemoveCountersSourceCost(CounterType.CHARGE.createInstance())); - costs.add(new TapSourceCost()); + Costs costs = new CostsImpl(); + costs.add(new RemoveCountersSourceCost(CounterType.CHARGE.createInstance())); + costs.add(new TapSourceCost()); Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new CreateTokenEffect(insectToken), costs); ability.addManaCost(new GenericManaCost(2)); - this.addAbility(ability); + this.addAbility(ability); Ability ability2 = new SimpleActivatedAbility(Zone.BATTLEFIELD, new AddCountersSourceEffect(CounterType.CHARGE.createInstance()), new TapSourceCost()); ability2.addManaCost(new ManaCostsImpl("{G}{G}")); - this.addAbility(ability2); - } + this.addAbility(ability2); + } - public TrigonOfInfestation(final TrigonOfInfestation card) { - super(card); - } + public TrigonOfInfestation(final TrigonOfInfestation card) { + super(card); + } - @Override - public TrigonOfInfestation copy() { - return new TrigonOfInfestation(this); - } + @Override + public TrigonOfInfestation copy() { + return new TrigonOfInfestation(this); + } } diff --git a/Mage.Sets/src/mage/sets/scarsofmirrodin/TrigonOfMending.java b/Mage.Sets/src/mage/sets/scarsofmirrodin/TrigonOfMending.java index 91ddf867d2..97356b71a2 100644 --- a/Mage.Sets/src/mage/sets/scarsofmirrodin/TrigonOfMending.java +++ b/Mage.Sets/src/mage/sets/scarsofmirrodin/TrigonOfMending.java @@ -53,31 +53,31 @@ import mage.abilities.costs.mana.GenericManaCost; */ public class TrigonOfMending extends CardImpl { - public TrigonOfMending(UUID ownerId) { - super(ownerId, 215, "Trigon of Mending", Rarity.UNCOMMON, new CardType[]{CardType.ARTIFACT}, "{2}"); - this.expansionSetCode = "SOM"; + public TrigonOfMending(UUID ownerId) { + super(ownerId, 215, "Trigon of Mending", Rarity.UNCOMMON, new CardType[]{CardType.ARTIFACT}, "{2}"); + this.expansionSetCode = "SOM"; - this.addAbility(new EntersBattlefieldAbility(new AddCountersSourceEffect(new ChargeCounter(3)), "")); + this.addAbility(new EntersBattlefieldAbility(new AddCountersSourceEffect(new ChargeCounter(3)), "")); - Costs costs = new CostsImpl(); - costs.add(new RemoveCountersSourceCost(CounterType.CHARGE.createInstance())); - costs.add(new TapSourceCost()); + Costs costs = new CostsImpl(); + costs.add(new RemoveCountersSourceCost(CounterType.CHARGE.createInstance())); + costs.add(new TapSourceCost()); Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new GainLifeEffect(3), costs); ability.addManaCost(new GenericManaCost(2)); - this.addAbility(ability); + this.addAbility(ability); Ability ability2 = new SimpleActivatedAbility(Zone.BATTLEFIELD, new AddCountersSourceEffect(CounterType.CHARGE.createInstance()), new TapSourceCost()); ability2.addManaCost(new ManaCostsImpl("{W}{W}")); - this.addAbility(ability2); - } + this.addAbility(ability2); + } - public TrigonOfMending(final TrigonOfMending card) { - super(card); - } + public TrigonOfMending(final TrigonOfMending card) { + super(card); + } - @Override - public TrigonOfMending copy() { - return new TrigonOfMending(this); - } + @Override + public TrigonOfMending copy() { + return new TrigonOfMending(this); + } } diff --git a/Mage.Sets/src/mage/sets/scarsofmirrodin/TrigonOfRage.java b/Mage.Sets/src/mage/sets/scarsofmirrodin/TrigonOfRage.java index 2538f84ad3..ad4f76fb2d 100644 --- a/Mage.Sets/src/mage/sets/scarsofmirrodin/TrigonOfRage.java +++ b/Mage.Sets/src/mage/sets/scarsofmirrodin/TrigonOfRage.java @@ -57,35 +57,35 @@ import mage.abilities.costs.mana.GenericManaCost; */ public class TrigonOfRage extends CardImpl { - public TrigonOfRage(UUID ownerId) { - super(ownerId, 216, "Trigon of Rage", Rarity.UNCOMMON, new CardType[]{CardType.ARTIFACT}, "{2}"); - this.expansionSetCode = "SOM"; + public TrigonOfRage(UUID ownerId) { + super(ownerId, 216, "Trigon of Rage", Rarity.UNCOMMON, new CardType[]{CardType.ARTIFACT}, "{2}"); + this.expansionSetCode = "SOM"; - this.addAbility(new EntersBattlefieldAbility(new AddCountersSourceEffect(new ChargeCounter(3)), "")); + this.addAbility(new EntersBattlefieldAbility(new AddCountersSourceEffect(new ChargeCounter(3)), "")); - Costs costs = new CostsImpl(); - costs.add(new RemoveCountersSourceCost(CounterType.CHARGE.createInstance())); - costs.add(new TapSourceCost()); - Effect pumpEffect = new BoostTargetEffect(3, 0, Duration.EndOfTurn); - Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, pumpEffect, costs); + Costs costs = new CostsImpl(); + costs.add(new RemoveCountersSourceCost(CounterType.CHARGE.createInstance())); + costs.add(new TapSourceCost()); + Effect pumpEffect = new BoostTargetEffect(3, 0, Duration.EndOfTurn); + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, pumpEffect, costs); ability.addManaCost(new GenericManaCost(2)); - Target target = new TargetCreaturePermanent(); - target.setRequired(true); - ability.addTarget(target); - this.addAbility(ability); + Target target = new TargetCreaturePermanent(); + target.setRequired(true); + ability.addTarget(target); + this.addAbility(ability); Ability ability2 = new SimpleActivatedAbility(Zone.BATTLEFIELD, new AddCountersSourceEffect(CounterType.CHARGE.createInstance()), new TapSourceCost()); ability2.addManaCost(new ManaCostsImpl("{R}{R}")); - this.addAbility(ability2); - } + this.addAbility(ability2); + } - public TrigonOfRage(final TrigonOfRage card) { - super(card); - } + public TrigonOfRage(final TrigonOfRage card) { + super(card); + } - @Override - public TrigonOfRage copy() { - return new TrigonOfRage(this); - } + @Override + public TrigonOfRage copy() { + return new TrigonOfRage(this); + } } diff --git a/Mage.Sets/src/mage/sets/scarsofmirrodin/TrigonOfThought.java b/Mage.Sets/src/mage/sets/scarsofmirrodin/TrigonOfThought.java index 48bde89343..d85dde4235 100644 --- a/Mage.Sets/src/mage/sets/scarsofmirrodin/TrigonOfThought.java +++ b/Mage.Sets/src/mage/sets/scarsofmirrodin/TrigonOfThought.java @@ -53,31 +53,31 @@ import mage.abilities.costs.mana.GenericManaCost; */ public class TrigonOfThought extends CardImpl { - public TrigonOfThought(UUID ownerId) { - super(ownerId, 217, "Trigon of Thought", Rarity.UNCOMMON, new CardType[]{CardType.ARTIFACT}, "{5}"); - this.expansionSetCode = "SOM"; + public TrigonOfThought(UUID ownerId) { + super(ownerId, 217, "Trigon of Thought", Rarity.UNCOMMON, new CardType[]{CardType.ARTIFACT}, "{5}"); + this.expansionSetCode = "SOM"; - this.addAbility(new EntersBattlefieldAbility(new AddCountersSourceEffect(new ChargeCounter(3)), "")); + this.addAbility(new EntersBattlefieldAbility(new AddCountersSourceEffect(new ChargeCounter(3)), "")); - Costs costs = new CostsImpl(); - costs.add(new RemoveCountersSourceCost(CounterType.CHARGE.createInstance())); - costs.add(new TapSourceCost()); + Costs costs = new CostsImpl(); + costs.add(new RemoveCountersSourceCost(CounterType.CHARGE.createInstance())); + costs.add(new TapSourceCost()); Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DrawCardControllerEffect(1), costs); ability.addManaCost(new GenericManaCost(2)); - this.addAbility(ability); + this.addAbility(ability); Ability ability2 = new SimpleActivatedAbility(Zone.BATTLEFIELD, new AddCountersSourceEffect(CounterType.CHARGE.createInstance()), new TapSourceCost()); ability2.addManaCost(new ManaCostsImpl("{U}{U}")); - this.addAbility(ability2); - } + this.addAbility(ability2); + } - public TrigonOfThought(final TrigonOfThought card) { - super(card); - } + public TrigonOfThought(final TrigonOfThought card) { + super(card); + } - @Override - public TrigonOfThought copy() { - return new TrigonOfThought(this); - } + @Override + public TrigonOfThought copy() { + return new TrigonOfThought(this); + } } diff --git a/Mage.Sets/src/mage/sets/scarsofmirrodin/TrinketMage.java b/Mage.Sets/src/mage/sets/scarsofmirrodin/TrinketMage.java index 84f89ed5b6..40dc5f7ea2 100644 --- a/Mage.Sets/src/mage/sets/scarsofmirrodin/TrinketMage.java +++ b/Mage.Sets/src/mage/sets/scarsofmirrodin/TrinketMage.java @@ -46,34 +46,34 @@ import java.util.UUID; */ public class TrinketMage extends CardImpl { - private static FilterCard filter = new FilterCard("an artifact card with converted mana cost 1 or less"); + private static FilterCard filter = new FilterCard("an artifact card with converted mana cost 1 or less"); - static { - filter.getCardType().add(CardType.ARTIFACT); - filter.setConvertedManaCost(2); - filter.setConvertedManaCostComparison(Filter.ComparisonType.LessThan); - } + static { + filter.getCardType().add(CardType.ARTIFACT); + filter.setConvertedManaCost(2); + filter.setConvertedManaCostComparison(Filter.ComparisonType.LessThan); + } - public TrinketMage(UUID ownerId) { - super(ownerId, 48, "Trinket Mage", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{2}{U}"); - this.expansionSetCode = "SOM"; - this.subtype.add("Human"); - this.subtype.add("Wizard"); - this.color.setBlue(true); - this.power = new MageInt(2); - this.toughness = new MageInt(2); - TargetCardInLibrary target = new TargetCardInLibrary(0, 1, filter); - SearchEffect effect = new SearchLibraryRevealPutInHandEffect(target, false); - this.addAbility(new EntersBattlefieldTriggeredAbility(effect, true)); - } + public TrinketMage(UUID ownerId) { + super(ownerId, 48, "Trinket Mage", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{2}{U}"); + this.expansionSetCode = "SOM"; + this.subtype.add("Human"); + this.subtype.add("Wizard"); + this.color.setBlue(true); + this.power = new MageInt(2); + this.toughness = new MageInt(2); + TargetCardInLibrary target = new TargetCardInLibrary(0, 1, filter); + SearchEffect effect = new SearchLibraryRevealPutInHandEffect(target, false); + this.addAbility(new EntersBattlefieldTriggeredAbility(effect, true)); + } - public TrinketMage(final TrinketMage card) { - super(card); - } + public TrinketMage(final TrinketMage card) { + super(card); + } - @Override - public TrinketMage copy() { - return new TrinketMage(this); - } + @Override + public TrinketMage copy() { + return new TrinketMage(this); + } } diff --git a/Mage.Sets/src/mage/sets/scarsofmirrodin/TrueConviction.java b/Mage.Sets/src/mage/sets/scarsofmirrodin/TrueConviction.java index edbe464bb4..4a2e93501d 100644 --- a/Mage.Sets/src/mage/sets/scarsofmirrodin/TrueConviction.java +++ b/Mage.Sets/src/mage/sets/scarsofmirrodin/TrueConviction.java @@ -50,10 +50,10 @@ public class TrueConviction extends CardImpl { public TrueConviction (UUID ownerId) { super(ownerId, 25, "True Conviction", Rarity.RARE, new CardType[]{CardType.ENCHANTMENT}, "{3}{W}{W}{W}"); this.expansionSetCode = "SOM"; - - this.color.setWhite(true); - this.addAbility(new SimpleStaticAbility(Constants.Zone.BATTLEFIELD, new GainAbilityControlledEffect(DoubleStrikeAbility.getInstance(), Duration.WhileOnBattlefield, new FilterCreaturePermanent()))); - this.addAbility(new SimpleStaticAbility(Constants.Zone.BATTLEFIELD, new GainAbilityControlledEffect(LifelinkAbility.getInstance(), Duration.WhileOnBattlefield, new FilterCreaturePermanent()))); + + this.color.setWhite(true); + this.addAbility(new SimpleStaticAbility(Constants.Zone.BATTLEFIELD, new GainAbilityControlledEffect(DoubleStrikeAbility.getInstance(), Duration.WhileOnBattlefield, new FilterCreaturePermanent()))); + this.addAbility(new SimpleStaticAbility(Constants.Zone.BATTLEFIELD, new GainAbilityControlledEffect(LifelinkAbility.getInstance(), Duration.WhileOnBattlefield, new FilterCreaturePermanent()))); } public TrueConviction (final TrueConviction card) { diff --git a/Mage.Sets/src/mage/sets/scarsofmirrodin/TurnAside.java b/Mage.Sets/src/mage/sets/scarsofmirrodin/TurnAside.java index 8c241a8140..98068751f4 100644 --- a/Mage.Sets/src/mage/sets/scarsofmirrodin/TurnAside.java +++ b/Mage.Sets/src/mage/sets/scarsofmirrodin/TurnAside.java @@ -51,125 +51,125 @@ import java.util.UUID; */ public class TurnAside extends CardImpl { - private static FilterSpell filter = new FilterSpell("spell that targets a permanent you control"); + private static FilterSpell filter = new FilterSpell("spell that targets a permanent you control"); - public TurnAside(UUID ownerId) { - super(ownerId, 49, "Turn Aside", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{U}"); - this.expansionSetCode = "SOM"; - this.color.setBlue(true); - this.getSpellAbility().addEffect(new CounterTargetEffect()); - this.getSpellAbility().addTarget(new CustomTargetSpell(filter)); - } + public TurnAside(UUID ownerId) { + super(ownerId, 49, "Turn Aside", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{U}"); + this.expansionSetCode = "SOM"; + this.color.setBlue(true); + this.getSpellAbility().addEffect(new CounterTargetEffect()); + this.getSpellAbility().addTarget(new CustomTargetSpell(filter)); + } - public TurnAside(final TurnAside card) { - super(card); - } + public TurnAside(final TurnAside card) { + super(card); + } - @Override - public TurnAside copy() { - return new TurnAside(this); - } + @Override + public TurnAside copy() { + return new TurnAside(this); + } - private class CustomTargetSpell extends TargetObject { + private class CustomTargetSpell extends TargetObject { - protected FilterSpell filter; + protected FilterSpell filter; - public CustomTargetSpell() { - this(1, 1, new FilterSpell()); - } + public CustomTargetSpell() { + this(1, 1, new FilterSpell()); + } - public CustomTargetSpell(FilterSpell filter) { - this(1, 1, filter); - } + public CustomTargetSpell(FilterSpell filter) { + this(1, 1, filter); + } - public CustomTargetSpell(int numTargets, FilterSpell filter) { - this(numTargets, numTargets, filter); - } + public CustomTargetSpell(int numTargets, FilterSpell filter) { + this(numTargets, numTargets, filter); + } - public CustomTargetSpell(int minNumTargets, int maxNumTargets, FilterSpell filter) { - this.minNumberOfTargets = minNumTargets; - this.maxNumberOfTargets = maxNumTargets; - this.zone = Constants.Zone.STACK; - this.filter = filter; - this.targetName = filter.getMessage(); - } + public CustomTargetSpell(int minNumTargets, int maxNumTargets, FilterSpell filter) { + this.minNumberOfTargets = minNumTargets; + this.maxNumberOfTargets = maxNumTargets; + this.zone = Constants.Zone.STACK; + this.filter = filter; + this.targetName = filter.getMessage(); + } - public CustomTargetSpell(final CustomTargetSpell target) { - super(target); - this.filter = target.filter.copy(); - } + public CustomTargetSpell(final CustomTargetSpell target) { + super(target); + this.filter = target.filter.copy(); + } - @Override - public boolean canChoose(UUID sourceId, UUID sourceControllerId, Game game) { - return canChoose(sourceControllerId, game); - } + @Override + public boolean canChoose(UUID sourceId, UUID sourceControllerId, Game game) { + return canChoose(sourceControllerId, game); + } - @Override - public Set possibleTargets(UUID sourceId, UUID sourceControllerId, Game game) { - return possibleTargets(sourceControllerId, game); - } + @Override + public Set possibleTargets(UUID sourceId, UUID sourceControllerId, Game game) { + return possibleTargets(sourceControllerId, game); + } - @Override - public boolean canTarget(UUID id, Ability source, Game game) { - if (super.canTarget(id, source, game)) { - if (targetsMyPermanent(id, source.getControllerId(), game)) { - return true; - } - } - return false; - } + @Override + public boolean canTarget(UUID id, Ability source, Game game) { + if (super.canTarget(id, source, game)) { + if (targetsMyPermanent(id, source.getControllerId(), game)) { + return true; + } + } + return false; + } - @Override - public boolean canChoose(UUID sourceControllerId, Game game) { - int count = 0; - for (StackObject stackObject : game.getStack()) { - if (stackObject instanceof Spell && game.getPlayer(sourceControllerId).getInRange().contains(stackObject.getControllerId()) && filter.match((Spell) stackObject, game)) { - if (targetsMyPermanent(stackObject.getId(), sourceControllerId, game)) { - count++; - if (count >= this.minNumberOfTargets) - return true; - } - } - } - return false; - } + @Override + public boolean canChoose(UUID sourceControllerId, Game game) { + int count = 0; + for (StackObject stackObject : game.getStack()) { + if (stackObject instanceof Spell && game.getPlayer(sourceControllerId).getInRange().contains(stackObject.getControllerId()) && filter.match((Spell) stackObject, game)) { + if (targetsMyPermanent(stackObject.getId(), sourceControllerId, game)) { + count++; + if (count >= this.minNumberOfTargets) + return true; + } + } + } + return false; + } - @Override - public Set possibleTargets(UUID sourceControllerId, Game game) { - Set possibleTargets = new HashSet(); - for (StackObject stackObject : game.getStack()) { - if (stackObject instanceof Spell && game.getPlayer(sourceControllerId).getInRange().contains(stackObject.getControllerId()) && filter.match((Spell) stackObject, game)) { - if (targetsMyPermanent(stackObject.getId(), sourceControllerId, game)) { + @Override + public Set possibleTargets(UUID sourceControllerId, Game game) { + Set possibleTargets = new HashSet(); + for (StackObject stackObject : game.getStack()) { + if (stackObject instanceof Spell && game.getPlayer(sourceControllerId).getInRange().contains(stackObject.getControllerId()) && filter.match((Spell) stackObject, game)) { + if (targetsMyPermanent(stackObject.getId(), sourceControllerId, game)) { - possibleTargets.add(stackObject.getId()); - } - } - } - return possibleTargets; - } + possibleTargets.add(stackObject.getId()); + } + } + } + return possibleTargets; + } - @Override - public Filter getFilter() { - return filter; - } + @Override + public Filter getFilter() { + return filter; + } - private boolean targetsMyPermanent(UUID id, UUID controllerId, Game game) { - StackObject spell = game.getStack().getStackObject(id); - if (spell != null) { - Ability ability = spell.getStackAbility(); - for (UUID permanentId : ability.getTargets().get(0).getTargets()) { - Permanent permanent = game.getPermanent(permanentId); - if (permanent != null && permanent.getControllerId().equals(controllerId)) { - return true; - } - } - } - return false; - } + private boolean targetsMyPermanent(UUID id, UUID controllerId, Game game) { + StackObject spell = game.getStack().getStackObject(id); + if (spell != null) { + Ability ability = spell.getStackAbility(); + for (UUID permanentId : ability.getTargets().get(0).getTargets()) { + Permanent permanent = game.getPermanent(permanentId); + if (permanent != null && permanent.getControllerId().equals(controllerId)) { + return true; + } + } + } + return false; + } - @Override - public CustomTargetSpell copy() { - return new CustomTargetSpell(this); - } - } + @Override + public CustomTargetSpell copy() { + return new CustomTargetSpell(this); + } + } } diff --git a/Mage.Sets/src/mage/sets/scarsofmirrodin/TurnToSlag.java b/Mage.Sets/src/mage/sets/scarsofmirrodin/TurnToSlag.java index a659a8577a..afa8d5423b 100644 --- a/Mage.Sets/src/mage/sets/scarsofmirrodin/TurnToSlag.java +++ b/Mage.Sets/src/mage/sets/scarsofmirrodin/TurnToSlag.java @@ -51,7 +51,7 @@ public class TurnToSlag extends CardImpl { public TurnToSlag (UUID ownerId) { super(ownerId, 106, "Turn to Slag", Rarity.COMMON, new CardType[]{CardType.SORCERY}, "{3}{R}{R}"); this.expansionSetCode = "SOM"; - this.color.setRed(true); + this.color.setRed(true); this.getSpellAbility().addEffect(new TurnToSlagEffect()); this.getSpellAbility().addTarget(new TargetCreaturePermanent()); } @@ -83,11 +83,11 @@ class TurnToSlagEffect extends OneShotEffect { if (target != null) { List attachments = new ArrayList(); for (UUID uuid : target.getAttachments()) { - Permanent attached = game.getBattlefield().getPermanent(uuid); - if (attached.getSubtype().contains("Equipment")) { + Permanent attached = game.getBattlefield().getPermanent(uuid); + if (attached.getSubtype().contains("Equipment")) { attachments.add(attached); - } - } + } + } for (Permanent p : attachments) { p.destroy(source.getId(), game, false); } diff --git a/Mage.Sets/src/mage/sets/scarsofmirrodin/TwistedImage.java b/Mage.Sets/src/mage/sets/scarsofmirrodin/TwistedImage.java index 0fbc284195..e495325874 100644 --- a/Mage.Sets/src/mage/sets/scarsofmirrodin/TwistedImage.java +++ b/Mage.Sets/src/mage/sets/scarsofmirrodin/TwistedImage.java @@ -47,10 +47,10 @@ public class TwistedImage extends CardImpl { public TwistedImage (UUID ownerId) { super(ownerId, 50, "Twisted Image", Rarity.UNCOMMON, new CardType[]{CardType.INSTANT}, "{U}"); this.expansionSetCode = "SOM"; - this.color.setBlue(true); - this.getSpellAbility().addEffect(new SwitchPowerToughnessTargetEffect(Constants.Duration.EndOfTurn)); - this.getSpellAbility().addEffect(new DrawCardControllerEffect(1)); - this.getSpellAbility().addTarget(new TargetCreaturePermanent()); + this.color.setBlue(true); + this.getSpellAbility().addEffect(new SwitchPowerToughnessTargetEffect(Constants.Duration.EndOfTurn)); + this.getSpellAbility().addEffect(new DrawCardControllerEffect(1)); + this.getSpellAbility().addTarget(new TargetCreaturePermanent()); } public TwistedImage (final TwistedImage card) { diff --git a/Mage.Sets/src/mage/sets/scarsofmirrodin/UntamedMight.java b/Mage.Sets/src/mage/sets/scarsofmirrodin/UntamedMight.java index fe6a63cec5..c3e53754e9 100644 --- a/Mage.Sets/src/mage/sets/scarsofmirrodin/UntamedMight.java +++ b/Mage.Sets/src/mage/sets/scarsofmirrodin/UntamedMight.java @@ -43,21 +43,21 @@ import java.util.UUID; */ public class UntamedMight extends CardImpl { - public UntamedMight(UUID ownerId) { - super(ownerId, 131, "Untamed Might", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{X}{G}"); - this.expansionSetCode = "SOM"; - this.color.setGreen(true); - this.getSpellAbility().addTarget(new TargetCreaturePermanent()); - this.getSpellAbility().addEffect(new BoostTargetEffect(new ManacostVariableValue(), new ManacostVariableValue(), Constants.Duration.EndOfTurn)); - } + public UntamedMight(UUID ownerId) { + super(ownerId, 131, "Untamed Might", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{X}{G}"); + this.expansionSetCode = "SOM"; + this.color.setGreen(true); + this.getSpellAbility().addTarget(new TargetCreaturePermanent()); + this.getSpellAbility().addEffect(new BoostTargetEffect(new ManacostVariableValue(), new ManacostVariableValue(), Constants.Duration.EndOfTurn)); + } - public UntamedMight(final UntamedMight card) { - super(card); - } + public UntamedMight(final UntamedMight card) { + super(card); + } - @Override - public UntamedMight copy() { - return new UntamedMight(this); - } + @Override + public UntamedMight copy() { + return new UntamedMight(this); + } } diff --git a/Mage.Sets/src/mage/sets/scarsofmirrodin/VaultSkyward.java b/Mage.Sets/src/mage/sets/scarsofmirrodin/VaultSkyward.java index 64e1b40c5a..49f0391f60 100644 --- a/Mage.Sets/src/mage/sets/scarsofmirrodin/VaultSkyward.java +++ b/Mage.Sets/src/mage/sets/scarsofmirrodin/VaultSkyward.java @@ -47,7 +47,7 @@ public class VaultSkyward extends CardImpl { public VaultSkyward (UUID ownerId) { super(ownerId, 51, "Vault Skyward", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{U}"); this.expansionSetCode = "SOM"; - this.color.setBlue(true); + this.color.setBlue(true); this.getSpellAbility().addEffect(new GainAbilityTargetEffect(FlyingAbility.getInstance(), Duration.EndOfTurn)); this.getSpellAbility().addEffect(new UntapTargetEffect()); this.getSpellAbility().addTarget(new TargetCreaturePermanent()); diff --git a/Mage.Sets/src/mage/sets/scarsofmirrodin/VedalkenCertarch.java b/Mage.Sets/src/mage/sets/scarsofmirrodin/VedalkenCertarch.java index a40759b81a..2d0ba5ab93 100644 --- a/Mage.Sets/src/mage/sets/scarsofmirrodin/VedalkenCertarch.java +++ b/Mage.Sets/src/mage/sets/scarsofmirrodin/VedalkenCertarch.java @@ -62,7 +62,7 @@ public class VedalkenCertarch extends CardImpl { this.expansionSetCode = "SOM"; this.subtype.add("Vedalken"); this.subtype.add("Wizard"); - this.color.setBlue(true); + this.color.setBlue(true); this.power = new MageInt(1); this.toughness = new MageInt(1); Ability ability = new MetalcraftActivatedAbility(Zone.BATTLEFIELD, new TapTargetEffect(), new TapSourceCost()); diff --git a/Mage.Sets/src/mage/sets/scarsofmirrodin/VenserTheSojourner.java b/Mage.Sets/src/mage/sets/scarsofmirrodin/VenserTheSojourner.java index 39b9fe854d..ffda6eadd0 100644 --- a/Mage.Sets/src/mage/sets/scarsofmirrodin/VenserTheSojourner.java +++ b/Mage.Sets/src/mage/sets/scarsofmirrodin/VenserTheSojourner.java @@ -66,75 +66,75 @@ import java.util.UUID; */ public class VenserTheSojourner extends CardImpl { - public VenserTheSojourner(UUID ownerId) { - super(ownerId, 135, "Venser, the Sojourner", Rarity.MYTHIC, new CardType[]{CardType.PLANESWALKER}, "{3}{W}{U}"); - this.expansionSetCode = "SOM"; - this.subtype.add("Venser"); - this.color.setWhite(true); - this.color.setBlue(true); - this.addAbility(new EntersBattlefieldAbility(new AddCountersSourceEffect(CounterType.LOYALTY.createInstance(3)), null)); + public VenserTheSojourner(UUID ownerId) { + super(ownerId, 135, "Venser, the Sojourner", Rarity.MYTHIC, new CardType[]{CardType.PLANESWALKER}, "{3}{W}{U}"); + this.expansionSetCode = "SOM"; + this.subtype.add("Venser"); + this.color.setWhite(true); + this.color.setBlue(true); + this.addAbility(new EntersBattlefieldAbility(new AddCountersSourceEffect(CounterType.LOYALTY.createInstance(3)), null)); - // +2: Exile target permanent you own. Return it to the battlefield under your control at the beginning of the next end step. - LoyaltyAbility ability1 = new LoyaltyAbility(new VenserTheSojournerEffect(), 2); - ability1.addTarget(new TargetControlledPermanent()); - this.addAbility(ability1); + // +2: Exile target permanent you own. Return it to the battlefield under your control at the beginning of the next end step. + LoyaltyAbility ability1 = new LoyaltyAbility(new VenserTheSojournerEffect(), 2); + ability1.addTarget(new TargetControlledPermanent()); + this.addAbility(ability1); - //TODO: Venser's second ability doesn't lock in what it applies to. That's because the effect states a true thing about creatures, - // but doesn't actually change the characteristics of those creatures. As a result, all creatures are unblockable that turn, including creatures you don't control, creatures that weren't on the battlefield at the time the ability resolved, and creatures that have lost all abilities. - // -1: Creatures are unblockable this turn. - this.addAbility(new LoyaltyAbility(new GainAbilityAllEffect(UnblockableAbility.getInstance(), Constants.Duration.EndOfTurn, new FilterCreaturePermanent()), -1)); + //TODO: Venser's second ability doesn't lock in what it applies to. That's because the effect states a true thing about creatures, + // but doesn't actually change the characteristics of those creatures. As a result, all creatures are unblockable that turn, including creatures you don't control, creatures that weren't on the battlefield at the time the ability resolved, and creatures that have lost all abilities. + // -1: Creatures are unblockable this turn. + this.addAbility(new LoyaltyAbility(new GainAbilityAllEffect(UnblockableAbility.getInstance(), Constants.Duration.EndOfTurn, new FilterCreaturePermanent()), -1)); - // -8: You get an emblem with "Whenever you cast a spell, exile target permanent." - LoyaltyAbility ability2 = new LoyaltyAbility(new GetEmblemEffect(new VenserTheSojournerEmblem()), -8); - this.addAbility(ability2); - } + // -8: You get an emblem with "Whenever you cast a spell, exile target permanent." + LoyaltyAbility ability2 = new LoyaltyAbility(new GetEmblemEffect(new VenserTheSojournerEmblem()), -8); + this.addAbility(ability2); + } - public VenserTheSojourner(final VenserTheSojourner card) { - super(card); - } + public VenserTheSojourner(final VenserTheSojourner card) { + super(card); + } - @Override - public VenserTheSojourner copy() { - return new VenserTheSojourner(this); - } + @Override + public VenserTheSojourner copy() { + return new VenserTheSojourner(this); + } } class VenserTheSojournerEffect extends OneShotEffect { - private static final String effectText = "Exile target permanent you own. Return it to the battlefield under your control at the beginning of the next end step"; + private static final String effectText = "Exile target permanent you own. Return it to the battlefield under your control at the beginning of the next end step"; - VenserTheSojournerEffect() { - super(Constants.Outcome.Benefit); - staticText = effectText; - } + VenserTheSojournerEffect() { + super(Constants.Outcome.Benefit); + staticText = effectText; + } - VenserTheSojournerEffect(VenserTheSojournerEffect effect) { - super(effect); - } + VenserTheSojournerEffect(VenserTheSojournerEffect effect) { + super(effect); + } - @Override - public boolean apply(Game game, Ability source) { - if (getTargetPointer().getFirst(game, source) != null) { - Permanent permanent = game.getPermanent(getTargetPointer().getFirst(game, source)); - if (permanent != null) { - if (permanent.moveToExile(source.getSourceId(), "Venser, the Sojourner", source.getSourceId(), game)) { - //create delayed triggered ability - AtEndOfTurnDelayedTriggeredAbility delayedAbility = new AtEndOfTurnDelayedTriggeredAbility(new ReturnFromExileEffect(source.getSourceId(), Zone.BATTLEFIELD)); - delayedAbility.setSourceId(source.getSourceId()); - delayedAbility.setControllerId(source.getControllerId()); - game.addDelayedTriggeredAbility(delayedAbility); - return true; - } - } - } - return false; - } + @Override + public boolean apply(Game game, Ability source) { + if (getTargetPointer().getFirst(game, source) != null) { + Permanent permanent = game.getPermanent(getTargetPointer().getFirst(game, source)); + if (permanent != null) { + if (permanent.moveToExile(source.getSourceId(), "Venser, the Sojourner", source.getSourceId(), game)) { + //create delayed triggered ability + AtEndOfTurnDelayedTriggeredAbility delayedAbility = new AtEndOfTurnDelayedTriggeredAbility(new ReturnFromExileEffect(source.getSourceId(), Zone.BATTLEFIELD)); + delayedAbility.setSourceId(source.getSourceId()); + delayedAbility.setControllerId(source.getControllerId()); + game.addDelayedTriggeredAbility(delayedAbility); + return true; + } + } + } + return false; + } - @Override - public VenserTheSojournerEffect copy() { - return new VenserTheSojournerEffect(this); - } + @Override + public VenserTheSojournerEffect copy() { + return new VenserTheSojournerEffect(this); + } } @@ -143,13 +143,13 @@ class VenserTheSojournerEffect extends OneShotEffect { */ class VenserTheSojournerEmblem extends Emblem { - public VenserTheSojournerEmblem() { - Ability ability = new VenserTheSojournerSpellCastTriggeredAbility(new ExileTargetEffect(), false); - Target target = new TargetPermanent(); - target.setRequired(true); - ability.addTarget(target); - this.getAbilities().add(ability); - } + public VenserTheSojournerEmblem() { + Ability ability = new VenserTheSojournerSpellCastTriggeredAbility(new ExileTargetEffect(), false); + Target target = new TargetPermanent(); + target.setRequired(true); + ability.addTarget(target); + this.getAbilities().add(ability); + } } class VenserTheSojournerSpellCastTriggeredAbility extends TriggeredAbilityImpl { diff --git a/Mage.Sets/src/mage/sets/scarsofmirrodin/VensersJournal.java b/Mage.Sets/src/mage/sets/scarsofmirrodin/VensersJournal.java index 5d4fa00f1c..cc9b453934 100644 --- a/Mage.Sets/src/mage/sets/scarsofmirrodin/VensersJournal.java +++ b/Mage.Sets/src/mage/sets/scarsofmirrodin/VensersJournal.java @@ -51,11 +51,11 @@ public class VensersJournal extends CardImpl { this.expansionSetCode = "SOM"; // You have no maximum hand size. - Effect effect = new MaximumHandSizeControllerEffect(Integer.MAX_VALUE, Constants.Duration.WhileOnBattlefield, false); - this.addAbility(new SimpleStaticAbility(Constants.Zone.BATTLEFIELD, effect)); + Effect effect = new MaximumHandSizeControllerEffect(Integer.MAX_VALUE, Constants.Duration.WhileOnBattlefield, false); + this.addAbility(new SimpleStaticAbility(Constants.Zone.BATTLEFIELD, effect)); // At the beginning of your upkeep, you gain 1 life for each card in your hand. - this.addAbility(new BeginningOfUpkeepTriggeredAbility(new GainLifeEffect(new CardsInControllerHandCount()), Constants.TargetController.YOU, false)); + this.addAbility(new BeginningOfUpkeepTriggeredAbility(new GainLifeEffect(new CardsInControllerHandCount()), Constants.TargetController.YOU, false)); } public VensersJournal(final VensersJournal card) { diff --git a/Mage.Sets/src/mage/sets/scarsofmirrodin/VigilForTheLost.java b/Mage.Sets/src/mage/sets/scarsofmirrodin/VigilForTheLost.java index 7a9d821b37..a58e1fe364 100644 --- a/Mage.Sets/src/mage/sets/scarsofmirrodin/VigilForTheLost.java +++ b/Mage.Sets/src/mage/sets/scarsofmirrodin/VigilForTheLost.java @@ -54,7 +54,7 @@ public class VigilForTheLost extends CardImpl { public VigilForTheLost (UUID ownerId) { super(ownerId, 26, "Vigil for the Lost", Rarity.UNCOMMON, new CardType[]{CardType.ENCHANTMENT}, "{3}{W}"); this.expansionSetCode = "SOM"; - this.color.setWhite(true); + this.color.setWhite(true); this.addAbility(new VigilForTheLostTriggeredAbility()); } diff --git a/Mage.Sets/src/mage/sets/scarsofmirrodin/ViridianRevel.java b/Mage.Sets/src/mage/sets/scarsofmirrodin/ViridianRevel.java index 268c8c3899..bfbea5762c 100644 --- a/Mage.Sets/src/mage/sets/scarsofmirrodin/ViridianRevel.java +++ b/Mage.Sets/src/mage/sets/scarsofmirrodin/ViridianRevel.java @@ -50,8 +50,8 @@ public class ViridianRevel extends CardImpl { public ViridianRevel (UUID ownerId) { super(ownerId, 132, "Viridian Revel", Rarity.UNCOMMON, new CardType[]{CardType.ENCHANTMENT}, "{1}{G}{G}"); this.expansionSetCode = "SOM"; - this.color.setGreen(true); - this.addAbility(new ViridianRevelTriggeredAbility()); + this.color.setGreen(true); + this.addAbility(new ViridianRevelTriggeredAbility()); } public ViridianRevel (final ViridianRevel card) { @@ -65,32 +65,32 @@ public class ViridianRevel extends CardImpl { } class ViridianRevelTriggeredAbility extends TriggeredAbilityImpl { - ViridianRevelTriggeredAbility() { - super(Constants.Zone.BATTLEFIELD, new DrawCardControllerEffect(1), true); - } + ViridianRevelTriggeredAbility() { + super(Constants.Zone.BATTLEFIELD, new DrawCardControllerEffect(1), true); + } - ViridianRevelTriggeredAbility(final ViridianRevelTriggeredAbility ability) { - super(ability); - } + ViridianRevelTriggeredAbility(final ViridianRevelTriggeredAbility ability) { + super(ability); + } - @Override - public ViridianRevelTriggeredAbility copy() { - return new ViridianRevelTriggeredAbility(this); - } + @Override + public ViridianRevelTriggeredAbility copy() { + return new ViridianRevelTriggeredAbility(this); + } - @Override - public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == GameEvent.EventType.ZONE_CHANGE && ((ZoneChangeEvent)event).isDiesEvent()) { + @Override + public boolean checkTrigger(GameEvent event, Game game) { + if (event.getType() == GameEvent.EventType.ZONE_CHANGE && ((ZoneChangeEvent)event).isDiesEvent()) { Card card = game.getCard(event.getTargetId()); if (card != null && card.getCardType().contains(CardType.ARTIFACT)) { return true; } - } - return false; - } + } + return false; + } - @Override - public String getRule() { - return "Whenever an artifact is put into an opponent's graveyard from the battlefield, you may draw a card."; - } + @Override + public String getRule() { + return "Whenever an artifact is put into an opponent's graveyard from the battlefield, you may draw a card."; + } } \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/scarsofmirrodin/VolitionReins.java b/Mage.Sets/src/mage/sets/scarsofmirrodin/VolitionReins.java index 87892e6725..7900b5309c 100644 --- a/Mage.Sets/src/mage/sets/scarsofmirrodin/VolitionReins.java +++ b/Mage.Sets/src/mage/sets/scarsofmirrodin/VolitionReins.java @@ -51,59 +51,59 @@ import java.util.UUID; */ public class VolitionReins extends CardImpl { - public VolitionReins(UUID ownerId) { - super(ownerId, 53, "Volition Reins", Rarity.UNCOMMON, new CardType[]{CardType.ENCHANTMENT}, "{3}{U}{U}{U}"); - this.expansionSetCode = "SOM"; - this.subtype.add("Aura"); - this.color.setBlue(true); + public VolitionReins(UUID ownerId) { + super(ownerId, 53, "Volition Reins", Rarity.UNCOMMON, new CardType[]{CardType.ENCHANTMENT}, "{3}{U}{U}{U}"); + this.expansionSetCode = "SOM"; + this.subtype.add("Aura"); + this.color.setBlue(true); - TargetPermanent auraTarget = new TargetPermanent(); - this.getSpellAbility().addTarget(auraTarget); - this.getSpellAbility().addEffect(new AttachEffect(Constants.Outcome.Detriment)); - Ability ability = new EnchantAbility(auraTarget.getTargetName()); - this.addAbility(ability); - this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new ControlEnchantedEffect())); - this.addAbility(new EntersBattlefieldTriggeredAbility(new UntapVolitionReinsEffect())); - } + TargetPermanent auraTarget = new TargetPermanent(); + this.getSpellAbility().addTarget(auraTarget); + this.getSpellAbility().addEffect(new AttachEffect(Constants.Outcome.Detriment)); + Ability ability = new EnchantAbility(auraTarget.getTargetName()); + this.addAbility(ability); + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new ControlEnchantedEffect())); + this.addAbility(new EntersBattlefieldTriggeredAbility(new UntapVolitionReinsEffect())); + } - public VolitionReins(final VolitionReins card) { - super(card); - } + public VolitionReins(final VolitionReins card) { + super(card); + } - @Override - public VolitionReins copy() { - return new VolitionReins(this); - } + @Override + public VolitionReins copy() { + return new VolitionReins(this); + } - public class UntapVolitionReinsEffect extends OneShotEffect { + public class UntapVolitionReinsEffect extends OneShotEffect { - public UntapVolitionReinsEffect() { - super(Constants.Outcome.Untap); - staticText = "if enchanted permanent is tapped, untap it"; - } + public UntapVolitionReinsEffect() { + super(Constants.Outcome.Untap); + staticText = "if enchanted permanent is tapped, untap it"; + } - public UntapVolitionReinsEffect(final UntapVolitionReinsEffect effect) { - super(effect); - } + public UntapVolitionReinsEffect(final UntapVolitionReinsEffect effect) { + super(effect); + } - @Override - public UntapVolitionReinsEffect copy() { - return new UntapVolitionReinsEffect(this); - } + @Override + public UntapVolitionReinsEffect copy() { + return new UntapVolitionReinsEffect(this); + } - @Override - public boolean apply(Game game, Ability source) { - Permanent enchantment = game.getPermanent(source.getSourceId()); - if (enchantment != null && enchantment.getAttachedTo() != null) { - Permanent permanent = game.getPermanent(enchantment.getAttachedTo()); - if (permanent != null && permanent.isTapped()) { - permanent.untap(game); - return true; - } - } - return false; - } + @Override + public boolean apply(Game game, Ability source) { + Permanent enchantment = game.getPermanent(source.getSourceId()); + if (enchantment != null && enchantment.getAttachedTo() != null) { + Permanent permanent = game.getPermanent(enchantment.getAttachedTo()); + if (permanent != null && permanent.isTapped()) { + permanent.untap(game); + return true; + } + } + return false; + } - } + } } diff --git a/Mage.Sets/src/mage/sets/scarsofmirrodin/VulshokHeartstoker.java b/Mage.Sets/src/mage/sets/scarsofmirrodin/VulshokHeartstoker.java index 283ca310a4..2a59676d6b 100644 --- a/Mage.Sets/src/mage/sets/scarsofmirrodin/VulshokHeartstoker.java +++ b/Mage.Sets/src/mage/sets/scarsofmirrodin/VulshokHeartstoker.java @@ -50,7 +50,7 @@ public class VulshokHeartstoker extends CardImpl { this.expansionSetCode = "SOM"; this.subtype.add("Human"); this.subtype.add("Shaman"); - this.color.setRed(true); + this.color.setRed(true); this.power = new MageInt(2); this.toughness = new MageInt(2); Ability ability = new EntersBattlefieldTriggeredAbility(new BoostTargetEffect(2, 0, Duration.EndOfTurn)); diff --git a/Mage.Sets/src/mage/sets/scarsofmirrodin/WhitesunsPassage.java b/Mage.Sets/src/mage/sets/scarsofmirrodin/WhitesunsPassage.java index f42f597e10..f0646eff09 100644 --- a/Mage.Sets/src/mage/sets/scarsofmirrodin/WhitesunsPassage.java +++ b/Mage.Sets/src/mage/sets/scarsofmirrodin/WhitesunsPassage.java @@ -44,7 +44,7 @@ public class WhitesunsPassage extends CardImpl { public WhitesunsPassage (UUID ownerId) { super(ownerId, 27, "Whitesun's Passage", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{1}{W}"); this.expansionSetCode = "SOM"; - this.color.setWhite(true); + this.color.setWhite(true); this.getSpellAbility().addEffect(new GainLifeEffect(5)); } diff --git a/Mage.Sets/src/mage/sets/scarsofmirrodin/WithstandDeath.java b/Mage.Sets/src/mage/sets/scarsofmirrodin/WithstandDeath.java index 6b581cc917..b258da3eba 100644 --- a/Mage.Sets/src/mage/sets/scarsofmirrodin/WithstandDeath.java +++ b/Mage.Sets/src/mage/sets/scarsofmirrodin/WithstandDeath.java @@ -46,7 +46,7 @@ public class WithstandDeath extends CardImpl { public WithstandDeath (UUID ownerId) { super(ownerId, 134, "Withstand Death", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{G}"); this.expansionSetCode = "SOM"; - this.color.setGreen(true); + this.color.setGreen(true); this.getSpellAbility().addEffect(new GainAbilityTargetEffect(IndestructibleAbility.getInstance(), Duration.EndOfTurn)); this.getSpellAbility().addTarget(new TargetCreaturePermanent()); } diff --git a/Mage.Sets/src/mage/sets/scarsofmirrodin/WurmcoilEngine.java b/Mage.Sets/src/mage/sets/scarsofmirrodin/WurmcoilEngine.java index e9082cfec7..753d75c9b8 100644 --- a/Mage.Sets/src/mage/sets/scarsofmirrodin/WurmcoilEngine.java +++ b/Mage.Sets/src/mage/sets/scarsofmirrodin/WurmcoilEngine.java @@ -76,9 +76,9 @@ class Wurm1Token extends Token { super("Wurm", "a 3/3 colorless Wurm artifact creature token with deathtouch"); cardType.add(CardType.ARTIFACT); cardType.add(CardType.CREATURE); - subtype.add("Wurm"); - power = new MageInt(3); - toughness = new MageInt(3); + subtype.add("Wurm"); + power = new MageInt(3); + toughness = new MageInt(3); this.addAbility(DeathtouchAbility.getInstance()); } } @@ -88,9 +88,9 @@ class Wurm2Token extends Token { super("Wurm", "a 3/3 colorless Wurm artifact creature token with lifelink"); cardType.add(CardType.ARTIFACT); cardType.add(CardType.CREATURE); - subtype.add("Wurm"); - power = new MageInt(3); - toughness = new MageInt(3); + subtype.add("Wurm"); + power = new MageInt(3); + toughness = new MageInt(3); this.addAbility(LifelinkAbility.getInstance()); setTokenType(2); // for image diff --git a/Mage.Sets/src/mage/sets/shadowmoor/CrimsonWisps.java b/Mage.Sets/src/mage/sets/shadowmoor/CrimsonWisps.java index 872adff863..274693bf6f 100644 --- a/Mage.Sets/src/mage/sets/shadowmoor/CrimsonWisps.java +++ b/Mage.Sets/src/mage/sets/shadowmoor/CrimsonWisps.java @@ -50,7 +50,7 @@ public class CrimsonWisps extends CardImpl { public CrimsonWisps (UUID ownerId) { super(ownerId, 88, "Crimson Wisps", Rarity.UNCOMMON, new CardType[]{CardType.INSTANT}, "{R}"); this.expansionSetCode = "SHM"; - this.color.setRed(true); + this.color.setRed(true); // Target creature becomes red and gains haste until end of turn. this.getSpellAbility().addTarget(new TargetCreaturePermanent()); this.getSpellAbility().addEffect(new SetCardColorTargetEffect(ObjectColor.RED, Constants.Duration.EndOfTurn)); diff --git a/Mage.Sets/src/mage/sets/shadowmoor/LeechriddenSwamp.java b/Mage.Sets/src/mage/sets/shadowmoor/LeechriddenSwamp.java index 52689cb93d..28a61608cc 100644 --- a/Mage.Sets/src/mage/sets/shadowmoor/LeechriddenSwamp.java +++ b/Mage.Sets/src/mage/sets/shadowmoor/LeechriddenSwamp.java @@ -62,10 +62,10 @@ public class LeechriddenSwamp extends CardImpl { // ({tap}: Add {B} to your mana pool.) this.addAbility(new SimpleManaAbility(Constants.Zone.BATTLEFIELD, new BasicManaEffect(Mana.BlackMana), new TapSourceCost())); - + // Leechridden Swamp enters the battlefield tapped. this.addAbility(new EntersBattlefieldTappedAbility()); - + // {B}, {tap}: Each opponent loses 1 life. Activate this ability only if you control two or more black permanents. Ability ability = new SimpleActivatedAbility(Constants.Zone.BATTLEFIELD, new LeechriddenSwampLoseLifeEffect(), new ManaCostsImpl("{B}")); ability.addCost(new ControlTwoOrMoreBlackPermanentsCost()); @@ -83,7 +83,7 @@ public class LeechriddenSwamp extends CardImpl { } class ControlTwoOrMoreBlackPermanentsCost extends CostImpl { - + private static final FilterControlledPermanent filter = new FilterControlledPermanent(); static { @@ -123,26 +123,26 @@ class LeechriddenSwampLoseLifeEffect extends OneShotEffect { this.toughness = new MageInt(2); // {X}, {tap}: You gain X life. - Ability ability = new SimpleActivatedAbility(Constants.Zone.BATTLEFIELD, new GainLifeEffect(new ManacostVariableValue()), new ManaCostsImpl("{X}")); - ability.addCost(new TapSourceCost()); - this.addAbility(ability); + Ability ability = new SimpleActivatedAbility(Constants.Zone.BATTLEFIELD, new GainLifeEffect(new ManacostVariableValue()), new ManaCostsImpl("{X}")); + ability.addCost(new TapSourceCost()); + this.addAbility(ability); } public OracleOfNectars(final OracleOfNectars card) { diff --git a/Mage.Sets/src/mage/sets/shardsofalara/AjaniVengeant.java b/Mage.Sets/src/mage/sets/shardsofalara/AjaniVengeant.java index dfa0e2f931..42b724685d 100644 --- a/Mage.Sets/src/mage/sets/shardsofalara/AjaniVengeant.java +++ b/Mage.Sets/src/mage/sets/shardsofalara/AjaniVengeant.java @@ -57,39 +57,39 @@ public class AjaniVengeant extends CardImpl { filter.getCardType().add(CardType.LAND); } - public AjaniVengeant(UUID ownerId) { - super(ownerId, 154, "Ajani Vengeant", Rarity.MYTHIC, new CardType[]{CardType.PLANESWALKER}, "{2}{R}{W}"); - this.expansionSetCode = "ALA"; - this.subtype.add("Ajani"); - this.color.setRed(true); - this.color.setWhite(true); - this.addAbility(new EntersBattlefieldAbility(new AddCountersSourceEffect(CounterType.LOYALTY.createInstance(3)), "")); + public AjaniVengeant(UUID ownerId) { + super(ownerId, 154, "Ajani Vengeant", Rarity.MYTHIC, new CardType[]{CardType.PLANESWALKER}, "{2}{R}{W}"); + this.expansionSetCode = "ALA"; + this.subtype.add("Ajani"); + this.color.setRed(true); + this.color.setWhite(true); + this.addAbility(new EntersBattlefieldAbility(new AddCountersSourceEffect(CounterType.LOYALTY.createInstance(3)), "")); - LoyaltyAbility ability1 = new LoyaltyAbility(new SkipNextUntapTargetEffect(), 1); - ability1.addTarget(new TargetPermanent()); - this.addAbility(ability1); + LoyaltyAbility ability1 = new LoyaltyAbility(new SkipNextUntapTargetEffect(), 1); + ability1.addTarget(new TargetPermanent()); + this.addAbility(ability1); - Effects effects1 = new Effects(); - effects1.add(new DamageTargetEffect(3)); - effects1.add(new GainLifeEffect(3)); - LoyaltyAbility ability2 = new LoyaltyAbility(effects1, -2); - ability2.addTarget(new TargetCreatureOrPlayer()); - this.addAbility(ability2); + Effects effects1 = new Effects(); + effects1.add(new DamageTargetEffect(3)); + effects1.add(new GainLifeEffect(3)); + LoyaltyAbility ability2 = new LoyaltyAbility(effects1, -2); + ability2.addTarget(new TargetCreatureOrPlayer()); + this.addAbility(ability2); - LoyaltyAbility ability3 = new LoyaltyAbility(new DestroyAllControlledTargetEffect(filter), -7); - ability3.addTarget(new TargetPlayer()); - this.addAbility(ability3); + LoyaltyAbility ability3 = new LoyaltyAbility(new DestroyAllControlledTargetEffect(filter), -7); + ability3.addTarget(new TargetPlayer()); + this.addAbility(ability3); - } + } - public AjaniVengeant(final AjaniVengeant card) { - super(card); - } + public AjaniVengeant(final AjaniVengeant card) { + super(card); + } - @Override - public AjaniVengeant copy() { - return new AjaniVengeant(this); - } + @Override + public AjaniVengeant copy() { + return new AjaniVengeant(this); + } } diff --git a/Mage.Sets/src/mage/sets/shardsofalara/Angelsong.java b/Mage.Sets/src/mage/sets/shardsofalara/Angelsong.java index 7cd5503e2a..925275fa1d 100644 --- a/Mage.Sets/src/mage/sets/shardsofalara/Angelsong.java +++ b/Mage.Sets/src/mage/sets/shardsofalara/Angelsong.java @@ -43,21 +43,21 @@ import mage.cards.CardImpl; */ public class Angelsong extends CardImpl { - public Angelsong(UUID ownerId) { - super(ownerId, 4, "Angelsong", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{1}{W}"); - this.expansionSetCode = "ALA"; - this.color.setWhite(true); - this.getSpellAbility().addEffect(new PreventAllDamageEffect(Duration.EndOfTurn, true)); - this.addAbility(new CyclingAbility(new ManaCostsImpl("{2}"))); - } + public Angelsong(UUID ownerId) { + super(ownerId, 4, "Angelsong", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{1}{W}"); + this.expansionSetCode = "ALA"; + this.color.setWhite(true); + this.getSpellAbility().addEffect(new PreventAllDamageEffect(Duration.EndOfTurn, true)); + this.addAbility(new CyclingAbility(new ManaCostsImpl("{2}"))); + } - public Angelsong(final Angelsong card) { - super(card); - } + public Angelsong(final Angelsong card) { + super(card); + } - @Override - public Angelsong copy() { - return new Angelsong(this); - } + @Override + public Angelsong copy() { + return new Angelsong(this); + } } diff --git a/Mage.Sets/src/mage/sets/shardsofalara/BattlegraceAngel.java b/Mage.Sets/src/mage/sets/shardsofalara/BattlegraceAngel.java index b4d1c3b11e..52f271efdf 100644 --- a/Mage.Sets/src/mage/sets/shardsofalara/BattlegraceAngel.java +++ b/Mage.Sets/src/mage/sets/shardsofalara/BattlegraceAngel.java @@ -78,35 +78,35 @@ public class BattlegraceAngel extends CardImpl { class BattlegraceAngelAbility extends TriggeredAbilityImpl { - public BattlegraceAngelAbility() { - super(Zone.BATTLEFIELD, new GainAbilityTargetEffect(LifelinkAbility.getInstance(), Duration.EndOfTurn)); - } + public BattlegraceAngelAbility() { + super(Zone.BATTLEFIELD, new GainAbilityTargetEffect(LifelinkAbility.getInstance(), Duration.EndOfTurn)); + } - public BattlegraceAngelAbility(final BattlegraceAngelAbility ability) { - super(ability); - } + public BattlegraceAngelAbility(final BattlegraceAngelAbility ability) { + super(ability); + } - @Override - public BattlegraceAngelAbility copy() { - return new BattlegraceAngelAbility(this); - } + @Override + public BattlegraceAngelAbility copy() { + return new BattlegraceAngelAbility(this); + } - @Override - public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == GameEvent.EventType.DECLARED_ATTACKERS && game.getActivePlayerId().equals(this.controllerId) ) { - if (game.getCombat().attacksAlone()) { - TargetCreaturePermanent target = new TargetCreaturePermanent(); - this.addTarget(target); - this.getTargets().get(0).add(game.getCombat().getAttackers().get(0),game); - return true; - } - } - return false; - } + @Override + public boolean checkTrigger(GameEvent event, Game game) { + if (event.getType() == GameEvent.EventType.DECLARED_ATTACKERS && game.getActivePlayerId().equals(this.controllerId) ) { + if (game.getCombat().attacksAlone()) { + TargetCreaturePermanent target = new TargetCreaturePermanent(); + this.addTarget(target); + this.getTargets().get(0).add(game.getCombat().getAttackers().get(0),game); + return true; + } + } + return false; + } - @Override - public String getRule() { - return "Whenever a creature you control attacks alone, it gains lifelink until end of turn."; - } + @Override + public String getRule() { + return "Whenever a creature you control attacks alone, it gains lifelink until end of turn."; + } } diff --git a/Mage.Sets/src/mage/sets/shardsofalara/Blightning.java b/Mage.Sets/src/mage/sets/shardsofalara/Blightning.java index ab44787ac2..4285a5eb5a 100644 --- a/Mage.Sets/src/mage/sets/shardsofalara/Blightning.java +++ b/Mage.Sets/src/mage/sets/shardsofalara/Blightning.java @@ -42,22 +42,22 @@ import mage.target.TargetPlayer; */ public class Blightning extends CardImpl { - public Blightning(UUID ownerId) { - super(ownerId, 156, "Blightning", Rarity.COMMON, new CardType[]{CardType.SORCERY}, "{1}{B}{R}"); - this.expansionSetCode = "ALA"; - this.color.setBlack(true); - this.color.setRed(true); - this.getSpellAbility().addTarget(new TargetPlayer()); - this.getSpellAbility().addEffect(new DamageTargetEffect(3)); - this.getSpellAbility().addEffect(new DiscardTargetEffect(2)); - } + public Blightning(UUID ownerId) { + super(ownerId, 156, "Blightning", Rarity.COMMON, new CardType[]{CardType.SORCERY}, "{1}{B}{R}"); + this.expansionSetCode = "ALA"; + this.color.setBlack(true); + this.color.setRed(true); + this.getSpellAbility().addTarget(new TargetPlayer()); + this.getSpellAbility().addEffect(new DamageTargetEffect(3)); + this.getSpellAbility().addEffect(new DiscardTargetEffect(2)); + } - public Blightning(final Blightning card) { - super(card); - } + public Blightning(final Blightning card) { + super(card); + } - @Override - public Blightning copy() { - return new Blightning(this); - } + @Override + public Blightning copy() { + return new Blightning(this); + } } diff --git a/Mage.Sets/src/mage/sets/shardsofalara/BroodmateDragon.java b/Mage.Sets/src/mage/sets/shardsofalara/BroodmateDragon.java index d75addb3e8..85d4cbcbc9 100644 --- a/Mage.Sets/src/mage/sets/shardsofalara/BroodmateDragon.java +++ b/Mage.Sets/src/mage/sets/shardsofalara/BroodmateDragon.java @@ -44,29 +44,29 @@ import mage.game.permanent.token.DragonToken; */ public class BroodmateDragon extends CardImpl { - private static DragonToken dragonToken = new DragonToken(); + private static DragonToken dragonToken = new DragonToken(); - public BroodmateDragon(UUID ownerId) { - super(ownerId, 160, "Broodmate Dragon", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{3}{B}{R}{G}"); - this.expansionSetCode = "ALA"; - this.subtype.add("Dragon"); - this.color.setRed(true); - this.color.setGreen(true); - this.color.setBlack(true); - this.power = new MageInt(4); - this.toughness = new MageInt(4); + public BroodmateDragon(UUID ownerId) { + super(ownerId, 160, "Broodmate Dragon", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{3}{B}{R}{G}"); + this.expansionSetCode = "ALA"; + this.subtype.add("Dragon"); + this.color.setRed(true); + this.color.setGreen(true); + this.color.setBlack(true); + this.power = new MageInt(4); + this.toughness = new MageInt(4); - this.addAbility(new EntersBattlefieldTriggeredAbility(new CreateTokenEffect(dragonToken), false)); - this.addAbility(FlyingAbility.getInstance()); - } + this.addAbility(new EntersBattlefieldTriggeredAbility(new CreateTokenEffect(dragonToken), false)); + this.addAbility(FlyingAbility.getInstance()); + } - public BroodmateDragon(final BroodmateDragon card) { - super(card); - } + public BroodmateDragon(final BroodmateDragon card) { + super(card); + } - @Override - public BroodmateDragon copy() { - return new BroodmateDragon(this); - } + @Override + public BroodmateDragon copy() { + return new BroodmateDragon(this); + } } diff --git a/Mage.Sets/src/mage/sets/shardsofalara/BullCerodon.java b/Mage.Sets/src/mage/sets/shardsofalara/BullCerodon.java index 639cb0bb82..0099935d69 100644 --- a/Mage.Sets/src/mage/sets/shardsofalara/BullCerodon.java +++ b/Mage.Sets/src/mage/sets/shardsofalara/BullCerodon.java @@ -46,8 +46,8 @@ public class BullCerodon extends CardImpl { super(ownerId, 161, "Bull Cerodon", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{4}{R}{W}"); this.expansionSetCode = "ALA"; this.subtype.add("Beast"); - this.color.setRed(true); - this.color.setWhite(true); + this.color.setRed(true); + this.color.setWhite(true); this.power = new MageInt(5); this.toughness = new MageInt(5); this.addAbility(VigilanceAbility.getInstance()); diff --git a/Mage.Sets/src/mage/sets/shardsofalara/Cancel.java b/Mage.Sets/src/mage/sets/shardsofalara/Cancel.java index af5ec8f8ec..c31c1ec1dc 100644 --- a/Mage.Sets/src/mage/sets/shardsofalara/Cancel.java +++ b/Mage.Sets/src/mage/sets/shardsofalara/Cancel.java @@ -36,19 +36,19 @@ import java.util.UUID; */ public class Cancel extends mage.sets.tenth.Cancel { - public Cancel(UUID ownerId) { - super(ownerId); - this.cardNumber = 33; - this.expansionSetCode = "ALA"; - } + public Cancel(UUID ownerId) { + super(ownerId); + this.cardNumber = 33; + this.expansionSetCode = "ALA"; + } - public Cancel(final Cancel card) { - super(card); - } + public Cancel(final Cancel card) { + super(card); + } - @Override - public Cancel copy() { - return new Cancel(this); - } + @Override + public Cancel copy() { + return new Cancel(this); + } } diff --git a/Mage.Sets/src/mage/sets/shardsofalara/CatharticAdept.java b/Mage.Sets/src/mage/sets/shardsofalara/CatharticAdept.java index 88f06e791f..4b7ae81426 100644 --- a/Mage.Sets/src/mage/sets/shardsofalara/CatharticAdept.java +++ b/Mage.Sets/src/mage/sets/shardsofalara/CatharticAdept.java @@ -53,7 +53,7 @@ public class CatharticAdept extends CardImpl { this.color.setBlue(true); this.power = new MageInt(1); this.toughness = new MageInt(1); - + SimpleActivatedAbility ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new PutLibraryIntoGraveTargetEffect(1), new TapSourceCost()); diff --git a/Mage.Sets/src/mage/sets/shardsofalara/CavernThoctar.java b/Mage.Sets/src/mage/sets/shardsofalara/CavernThoctar.java index d77cb053d0..bf494c1803 100644 --- a/Mage.Sets/src/mage/sets/shardsofalara/CavernThoctar.java +++ b/Mage.Sets/src/mage/sets/shardsofalara/CavernThoctar.java @@ -49,7 +49,7 @@ public class CavernThoctar extends CardImpl { super(ownerId, 125, "Cavern Thoctar", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{5}{G}"); this.expansionSetCode = "ALA"; this.subtype.add("Beast"); - this.color.setGreen(true); + this.color.setGreen(true); this.power = new MageInt(5); this.toughness = new MageInt(5); this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new BoostSourceEffect(1, 0, Duration.EndOfTurn), new ManaCostsImpl("{1}{R}"))); diff --git a/Mage.Sets/src/mage/sets/shardsofalara/CourtArchers.java b/Mage.Sets/src/mage/sets/shardsofalara/CourtArchers.java index b9097d2321..abd554ff25 100644 --- a/Mage.Sets/src/mage/sets/shardsofalara/CourtArchers.java +++ b/Mage.Sets/src/mage/sets/shardsofalara/CourtArchers.java @@ -47,7 +47,7 @@ public class CourtArchers extends CardImpl { this.expansionSetCode = "ALA"; this.subtype.add("Human"); this.subtype.add("Archer"); - this.color.setGreen(true); + this.color.setGreen(true); this.power = new MageInt(1); this.toughness = new MageInt(3); this.addAbility(ReachAbility.getInstance()); diff --git a/Mage.Sets/src/mage/sets/shardsofalara/CradleOfVitality.java b/Mage.Sets/src/mage/sets/shardsofalara/CradleOfVitality.java index 4b02222741..863236791d 100644 --- a/Mage.Sets/src/mage/sets/shardsofalara/CradleOfVitality.java +++ b/Mage.Sets/src/mage/sets/shardsofalara/CradleOfVitality.java @@ -74,41 +74,41 @@ public class CradleOfVitality extends CardImpl { class CradleOfVitalityGainLifeTriggeredAbility extends TriggeredAbilityImpl { - - public CradleOfVitalityGainLifeTriggeredAbility() { - super(Zone.BATTLEFIELD, new CradleOfVitalityEffect(), false); - addManaCost(new ManaCostsImpl("{1}{W}")); - } - public CradleOfVitalityGainLifeTriggeredAbility(final CradleOfVitalityGainLifeTriggeredAbility ability) { - super(ability); - } + public CradleOfVitalityGainLifeTriggeredAbility() { + super(Zone.BATTLEFIELD, new CradleOfVitalityEffect(), false); + addManaCost(new ManaCostsImpl("{1}{W}")); + } - @Override - public CradleOfVitalityGainLifeTriggeredAbility copy() { - return new CradleOfVitalityGainLifeTriggeredAbility(this); - } + public CradleOfVitalityGainLifeTriggeredAbility(final CradleOfVitalityGainLifeTriggeredAbility ability) { + super(ability); + } - @Override - public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == EventType.GAINED_LIFE && event.getPlayerId().equals(this.controllerId)) { - this.getEffects().get(0).setValue("amount", event.getAmount()); - return true; - } - return false; - } + @Override + public CradleOfVitalityGainLifeTriggeredAbility copy() { + return new CradleOfVitalityGainLifeTriggeredAbility(this); + } - @Override - public String getRule() { - return "Whenever you gain life, you may pay {1}{W}. If you do, put a +1/+1 counter on target creature for each 1 life you gained"; - } + @Override + public boolean checkTrigger(GameEvent event, Game game) { + if (event.getType() == EventType.GAINED_LIFE && event.getPlayerId().equals(this.controllerId)) { + this.getEffects().get(0).setValue("amount", event.getAmount()); + return true; + } + return false; + } + + @Override + public String getRule() { + return "Whenever you gain life, you may pay {1}{W}. If you do, put a +1/+1 counter on target creature for each 1 life you gained"; + } } class CradleOfVitalityEffect extends OneShotEffect { public CradleOfVitalityEffect() { - super(Outcome.Benefit); - staticText = "Put a +1/+1 counter on target creature for each 1 life you gained"; + super(Outcome.Benefit); + staticText = "Put a +1/+1 counter on target creature for each 1 life you gained"; } public CradleOfVitalityEffect(final CradleOfVitalityEffect effect) { @@ -122,13 +122,13 @@ class CradleOfVitalityEffect extends OneShotEffect { @Override public boolean apply(Game game, Ability source) { - int affectedTargets = 0; - Integer amount = (Integer) getValue("amount"); - for (UUID uuid : targetPointer.getTargets(game, source)) { - Permanent permanent = game.getPermanent(uuid); - permanent.addCounters(CounterType.P1P1.createInstance(amount), game); - affectedTargets ++; - } - return affectedTargets > 0; + int affectedTargets = 0; + Integer amount = (Integer) getValue("amount"); + for (UUID uuid : targetPointer.getTargets(game, source)) { + Permanent permanent = game.getPermanent(uuid); + permanent.addCounters(CounterType.P1P1.createInstance(amount), game); + affectedTargets ++; + } + return affectedTargets > 0; } } diff --git a/Mage.Sets/src/mage/sets/shardsofalara/CrumblingNecropolis.java b/Mage.Sets/src/mage/sets/shardsofalara/CrumblingNecropolis.java index 34fbac7d2e..ffca9b4d64 100644 --- a/Mage.Sets/src/mage/sets/shardsofalara/CrumblingNecropolis.java +++ b/Mage.Sets/src/mage/sets/shardsofalara/CrumblingNecropolis.java @@ -43,22 +43,22 @@ import mage.cards.CardImpl; */ public class CrumblingNecropolis extends CardImpl { - public CrumblingNecropolis(UUID ownerId) { - super(ownerId, 222, "Crumbling Necropolis", Rarity.UNCOMMON, new CardType[]{CardType.LAND}, null); - this.expansionSetCode = "ALA"; - this.addAbility(new EntersBattlefieldTappedAbility()); - this.addAbility(new RedManaAbility()); - this.addAbility(new BlueManaAbility()); - this.addAbility(new BlackManaAbility()); - } + public CrumblingNecropolis(UUID ownerId) { + super(ownerId, 222, "Crumbling Necropolis", Rarity.UNCOMMON, new CardType[]{CardType.LAND}, null); + this.expansionSetCode = "ALA"; + this.addAbility(new EntersBattlefieldTappedAbility()); + this.addAbility(new RedManaAbility()); + this.addAbility(new BlueManaAbility()); + this.addAbility(new BlackManaAbility()); + } - public CrumblingNecropolis(final CrumblingNecropolis card) { - super(card); - } + public CrumblingNecropolis(final CrumblingNecropolis card) { + super(card); + } - @Override - public CrumblingNecropolis copy() { - return new CrumblingNecropolis(this); - } + @Override + public CrumblingNecropolis copy() { + return new CrumblingNecropolis(this); + } } diff --git a/Mage.Sets/src/mage/sets/shardsofalara/ElspethKnightErrant.java b/Mage.Sets/src/mage/sets/shardsofalara/ElspethKnightErrant.java index 52277c46c7..faf6f0ada3 100644 --- a/Mage.Sets/src/mage/sets/shardsofalara/ElspethKnightErrant.java +++ b/Mage.Sets/src/mage/sets/shardsofalara/ElspethKnightErrant.java @@ -61,71 +61,71 @@ import mage.target.common.TargetCreaturePermanent; */ public class ElspethKnightErrant extends CardImpl { - private static SoldierToken soldierToken = new SoldierToken(); + private static SoldierToken soldierToken = new SoldierToken(); - public ElspethKnightErrant(UUID ownerId) { - super(ownerId, 9, "Elspeth, Knight-Errant", Rarity.MYTHIC, new CardType[]{CardType.PLANESWALKER}, "{2}{W}{W}"); - this.expansionSetCode = "ALA"; - this.subtype.add("Elspeth"); - this.color.setWhite(true); - this.addAbility(new EntersBattlefieldAbility(new AddCountersSourceEffect(CounterType.LOYALTY.createInstance(4)), "")); + public ElspethKnightErrant(UUID ownerId) { + super(ownerId, 9, "Elspeth, Knight-Errant", Rarity.MYTHIC, new CardType[]{CardType.PLANESWALKER}, "{2}{W}{W}"); + this.expansionSetCode = "ALA"; + this.subtype.add("Elspeth"); + this.color.setWhite(true); + this.addAbility(new EntersBattlefieldAbility(new AddCountersSourceEffect(CounterType.LOYALTY.createInstance(4)), "")); - this.addAbility(new LoyaltyAbility(new CreateTokenEffect(soldierToken), 1)); + this.addAbility(new LoyaltyAbility(new CreateTokenEffect(soldierToken), 1)); - Effects effects1 = new Effects(); - effects1.add(new BoostTargetEffect(3, 3, Duration.EndOfTurn)); - effects1.add(new GainAbilityTargetEffect(FlyingAbility.getInstance(), Duration.EndOfTurn)); - LoyaltyAbility ability1 = new LoyaltyAbility(effects1, 1); - ability1.addTarget(new TargetCreaturePermanent()); - this.addAbility(ability1); + Effects effects1 = new Effects(); + effects1.add(new BoostTargetEffect(3, 3, Duration.EndOfTurn)); + effects1.add(new GainAbilityTargetEffect(FlyingAbility.getInstance(), Duration.EndOfTurn)); + LoyaltyAbility ability1 = new LoyaltyAbility(effects1, 1); + ability1.addTarget(new TargetCreaturePermanent()); + this.addAbility(ability1); - this.addAbility(new LoyaltyAbility(new ElspethKnightErrantEffect(), -8)); + this.addAbility(new LoyaltyAbility(new ElspethKnightErrantEffect(), -8)); - } + } - public ElspethKnightErrant(final ElspethKnightErrant card) { - super(card); - } + public ElspethKnightErrant(final ElspethKnightErrant card) { + super(card); + } - @Override - public ElspethKnightErrant copy() { - return new ElspethKnightErrant(this); - } + @Override + public ElspethKnightErrant copy() { + return new ElspethKnightErrant(this); + } } class ElspethKnightErrantEffect extends ContinuousEffectImpl { - private static final FilterPermanent filter = new FilterPermanent("artifacts, creatures, enchantments and lands"); + private static final FilterPermanent filter = new FilterPermanent("artifacts, creatures, enchantments and lands"); - static { - filter.getCardType().add(CardType.ARTIFACT); - filter.getCardType().add(CardType.CREATURE); - filter.getCardType().add(CardType.ENCHANTMENT); - filter.getCardType().add(CardType.LAND); - filter.setScopeCardType(ComparisonScope.Any); - } + static { + filter.getCardType().add(CardType.ARTIFACT); + filter.getCardType().add(CardType.CREATURE); + filter.getCardType().add(CardType.ENCHANTMENT); + filter.getCardType().add(CardType.LAND); + filter.setScopeCardType(ComparisonScope.Any); + } - public ElspethKnightErrantEffect() { - super(Duration.EndOfGame, Layer.RulesEffects, SubLayer.NA, Outcome.AddAbility); - staticText = "For the rest of the game artifacts, creature, enchantments and lands you control are indestructible"; - } + public ElspethKnightErrantEffect() { + super(Duration.EndOfGame, Layer.RulesEffects, SubLayer.NA, Outcome.AddAbility); + staticText = "For the rest of the game artifacts, creature, enchantments and lands you control are indestructible"; + } - public ElspethKnightErrantEffect(final ElspethKnightErrantEffect effect) { - super(effect); - } + public ElspethKnightErrantEffect(final ElspethKnightErrantEffect effect) { + super(effect); + } - @Override - public boolean apply(Game game, Ability source) { - for (Permanent perm: game.getBattlefield().getAllActivePermanents(filter, source.getControllerId(), game)) { - perm.addAbility(IndestructibleAbility.getInstance(), game); - } - return true; - } + @Override + public boolean apply(Game game, Ability source) { + for (Permanent perm: game.getBattlefield().getAllActivePermanents(filter, source.getControllerId(), game)) { + perm.addAbility(IndestructibleAbility.getInstance(), game); + } + return true; + } - @Override - public ElspethKnightErrantEffect copy() { - return new ElspethKnightErrantEffect(this); - } + @Override + public ElspethKnightErrantEffect copy() { + return new ElspethKnightErrantEffect(this); + } } \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/shardsofalara/ElvishVisionary.java b/Mage.Sets/src/mage/sets/shardsofalara/ElvishVisionary.java index 8f60ea73c2..e3de46156c 100644 --- a/Mage.Sets/src/mage/sets/shardsofalara/ElvishVisionary.java +++ b/Mage.Sets/src/mage/sets/shardsofalara/ElvishVisionary.java @@ -47,7 +47,7 @@ public class ElvishVisionary extends CardImpl { this.expansionSetCode = "ALA"; this.subtype.add("Elf"); this.subtype.add("Shaman"); - this.color.setGreen(true); + this.color.setGreen(true); this.power = new MageInt(1); this.toughness = new MageInt(1); this.addAbility(new EntersBattlefieldTriggeredAbility(new DrawCardControllerEffect(1))); diff --git a/Mage.Sets/src/mage/sets/shardsofalara/Excommunicate.java b/Mage.Sets/src/mage/sets/shardsofalara/Excommunicate.java index 40d0bcde48..08f7cd7017 100644 --- a/Mage.Sets/src/mage/sets/shardsofalara/Excommunicate.java +++ b/Mage.Sets/src/mage/sets/shardsofalara/Excommunicate.java @@ -41,20 +41,20 @@ import mage.target.common.TargetCreaturePermanent; */ public class Excommunicate extends CardImpl { - public Excommunicate(UUID ownerId) { - super(ownerId, 11, "Excommunicate", Rarity.COMMON, new CardType[]{CardType.SORCERY}, "{2}{W}"); - this.expansionSetCode = "ALA"; - this.color.setWhite(true); - this.getSpellAbility().addTarget(new TargetCreaturePermanent()); - this.getSpellAbility().addEffect(new PutOnLibraryTargetEffect(true)); - } + public Excommunicate(UUID ownerId) { + super(ownerId, 11, "Excommunicate", Rarity.COMMON, new CardType[]{CardType.SORCERY}, "{2}{W}"); + this.expansionSetCode = "ALA"; + this.color.setWhite(true); + this.getSpellAbility().addTarget(new TargetCreaturePermanent()); + this.getSpellAbility().addEffect(new PutOnLibraryTargetEffect(true)); + } - public Excommunicate(final Excommunicate card) { - super(card); - } + public Excommunicate(final Excommunicate card) { + super(card); + } - @Override - public Excommunicate copy() { - return new Excommunicate(this); - } + @Override + public Excommunicate copy() { + return new Excommunicate(this); + } } diff --git a/Mage.Sets/src/mage/sets/shardsofalara/FlameblastDragon.java b/Mage.Sets/src/mage/sets/shardsofalara/FlameblastDragon.java index cf6a21a0f3..cdcc365884 100644 --- a/Mage.Sets/src/mage/sets/shardsofalara/FlameblastDragon.java +++ b/Mage.Sets/src/mage/sets/shardsofalara/FlameblastDragon.java @@ -58,7 +58,7 @@ public class FlameblastDragon extends CardImpl { this.color.setRed(true); this.power = new MageInt(5); this.toughness = new MageInt(5); - this.addAbility(FlyingAbility.getInstance()); + this.addAbility(FlyingAbility.getInstance()); Ability ability = new AttacksTriggeredAbility(new FlameblastDragonEffect(), false); ability.addTarget(new TargetCreatureOrPlayer()); this.addAbility(ability); @@ -93,7 +93,7 @@ class FlameblastDragonEffect extends OneShotEffect { cost.clearPaid(); if (cost.pay(source, game, source.getId(), source.getControllerId(), false)) { int costX = cost.getX(); - Permanent permanent = game.getPermanent(source.getFirstTarget()); + Permanent permanent = game.getPermanent(source.getFirstTarget()); if (permanent != null) { permanent.damage(costX, source.getId(), game, true, false); return true; diff --git a/Mage.Sets/src/mage/sets/shardsofalara/Forest1.java b/Mage.Sets/src/mage/sets/shardsofalara/Forest1.java index 8824d52388..d2dbdcbac1 100644 --- a/Mage.Sets/src/mage/sets/shardsofalara/Forest1.java +++ b/Mage.Sets/src/mage/sets/shardsofalara/Forest1.java @@ -36,18 +36,18 @@ import java.util.UUID; */ public class Forest1 extends mage.cards.basiclands.Forest { - public Forest1(UUID ownerId) { - super(ownerId, 246); - this.expansionSetCode = "ALA"; - } + public Forest1(UUID ownerId) { + super(ownerId, 246); + this.expansionSetCode = "ALA"; + } - public Forest1(final Forest1 card) { - super(card); - } + public Forest1(final Forest1 card) { + super(card); + } - @Override - public Forest1 copy() { - return new Forest1(this); - } + @Override + public Forest1 copy() { + return new Forest1(this); + } } diff --git a/Mage.Sets/src/mage/sets/shardsofalara/Forest2.java b/Mage.Sets/src/mage/sets/shardsofalara/Forest2.java index 90451774c9..51ff5f7e3d 100644 --- a/Mage.Sets/src/mage/sets/shardsofalara/Forest2.java +++ b/Mage.Sets/src/mage/sets/shardsofalara/Forest2.java @@ -36,18 +36,18 @@ import java.util.UUID; */ public class Forest2 extends mage.cards.basiclands.Forest { - public Forest2(UUID ownerId) { - super(ownerId, 247); - this.expansionSetCode = "ALA"; - } + public Forest2(UUID ownerId) { + super(ownerId, 247); + this.expansionSetCode = "ALA"; + } - public Forest2(final Forest2 card) { - super(card); - } + public Forest2(final Forest2 card) { + super(card); + } - @Override - public Forest2 copy() { - return new Forest2(this); - } + @Override + public Forest2 copy() { + return new Forest2(this); + } } diff --git a/Mage.Sets/src/mage/sets/shardsofalara/Forest3.java b/Mage.Sets/src/mage/sets/shardsofalara/Forest3.java index 47828954d9..210fe53fca 100644 --- a/Mage.Sets/src/mage/sets/shardsofalara/Forest3.java +++ b/Mage.Sets/src/mage/sets/shardsofalara/Forest3.java @@ -36,18 +36,18 @@ import java.util.UUID; */ public class Forest3 extends mage.cards.basiclands.Forest { - public Forest3(UUID ownerId) { - super(ownerId, 248); - this.expansionSetCode = "ALA"; - } + public Forest3(UUID ownerId) { + super(ownerId, 248); + this.expansionSetCode = "ALA"; + } - public Forest3(final Forest3 card) { - super(card); - } + public Forest3(final Forest3 card) { + super(card); + } - @Override - public Forest3 copy() { - return new Forest3(this); - } + @Override + public Forest3 copy() { + return new Forest3(this); + } } diff --git a/Mage.Sets/src/mage/sets/shardsofalara/Forest4.java b/Mage.Sets/src/mage/sets/shardsofalara/Forest4.java index 89b6a9cd7c..981af5908a 100644 --- a/Mage.Sets/src/mage/sets/shardsofalara/Forest4.java +++ b/Mage.Sets/src/mage/sets/shardsofalara/Forest4.java @@ -36,18 +36,18 @@ import java.util.UUID; */ public class Forest4 extends mage.cards.basiclands.Forest { - public Forest4(UUID ownerId) { - super(ownerId, 249); - this.expansionSetCode = "ALA"; - } + public Forest4(UUID ownerId) { + super(ownerId, 249); + this.expansionSetCode = "ALA"; + } - public Forest4(final Forest4 card) { - super(card); - } + public Forest4(final Forest4 card) { + super(card); + } - @Override - public Forest4 copy() { - return new Forest4(this); - } + @Override + public Forest4 copy() { + return new Forest4(this); + } } diff --git a/Mage.Sets/src/mage/sets/shardsofalara/Godsire.java b/Mage.Sets/src/mage/sets/shardsofalara/Godsire.java index d91d26d74a..7f625e560a 100644 --- a/Mage.Sets/src/mage/sets/shardsofalara/Godsire.java +++ b/Mage.Sets/src/mage/sets/shardsofalara/Godsire.java @@ -51,13 +51,13 @@ public class Godsire extends CardImpl { super(ownerId, 170, "Godsire", Rarity.MYTHIC, new CardType[]{CardType.CREATURE}, "{4}{R}{G}{G}{W}"); this.expansionSetCode = "ALA"; this.subtype.add("Beast"); - this.color.setRed(true); - this.color.setGreen(true); - this.color.setWhite(true); + this.color.setRed(true); + this.color.setGreen(true); + this.color.setWhite(true); this.power = new MageInt(8); this.toughness = new MageInt(8); - this.addAbility(VigilanceAbility.getInstance()); - this.addAbility(new SimpleActivatedAbility(Constants.Zone.BATTLEFIELD, new CreateTokenEffect(new BeastToken()), new TapSourceCost())); + this.addAbility(VigilanceAbility.getInstance()); + this.addAbility(new SimpleActivatedAbility(Constants.Zone.BATTLEFIELD, new CreateTokenEffect(new BeastToken()), new TapSourceCost())); } public Godsire (final Godsire card) { @@ -72,14 +72,14 @@ public class Godsire extends CardImpl { } class BeastToken extends Token { - BeastToken() { - super("Beast", "an 8/8 Beast creature token that's red, green, and white"); - cardType.add(CardType.CREATURE); - color.setGreen(true); - color.setWhite(true); - color.setRed(true); - subtype.add("Beast"); - power = new MageInt(8); - toughness = new MageInt(8); - } + BeastToken() { + super("Beast", "an 8/8 Beast creature token that's red, green, and white"); + cardType.add(CardType.CREATURE); + color.setGreen(true); + color.setWhite(true); + color.setRed(true); + subtype.add("Beast"); + power = new MageInt(8); + toughness = new MageInt(8); + } } \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/shardsofalara/Godtoucher.java b/Mage.Sets/src/mage/sets/shardsofalara/Godtoucher.java index 4f51481537..216c7bd931 100644 --- a/Mage.Sets/src/mage/sets/shardsofalara/Godtoucher.java +++ b/Mage.Sets/src/mage/sets/shardsofalara/Godtoucher.java @@ -90,7 +90,7 @@ class GodtoucherEffect extends PreventionEffectImpl { public GodtoucherEffect(Duration duration) { super(duration); - staticText = "Prevent all damage that would be dealt to target creature with power 5 or greater this turn"; + staticText = "Prevent all damage that would be dealt to target creature with power 5 or greater this turn"; } public GodtoucherEffect(final GodtoucherEffect effect) { diff --git a/Mage.Sets/src/mage/sets/shardsofalara/HellkiteOverlord.java b/Mage.Sets/src/mage/sets/shardsofalara/HellkiteOverlord.java index fceb59176f..dc521663dc 100644 --- a/Mage.Sets/src/mage/sets/shardsofalara/HellkiteOverlord.java +++ b/Mage.Sets/src/mage/sets/shardsofalara/HellkiteOverlord.java @@ -53,9 +53,9 @@ public class HellkiteOverlord extends CardImpl { super(ownerId, 172, "Hellkite Overlord", Rarity.MYTHIC, new CardType[]{CardType.CREATURE}, "{4}{B}{R}{R}{G}"); this.expansionSetCode = "ALA"; this.subtype.add("Dragon"); - this.color.setBlack(true); - this.color.setRed(true); - this.color.setGreen(true); + this.color.setBlack(true); + this.color.setRed(true); + this.color.setGreen(true); this.power = new MageInt(8); this.toughness = new MageInt(8); this.addAbility(FlyingAbility.getInstance()); diff --git a/Mage.Sets/src/mage/sets/shardsofalara/HellsThunder.java b/Mage.Sets/src/mage/sets/shardsofalara/HellsThunder.java index 12ef2a64fa..bbfdcdd630 100644 --- a/Mage.Sets/src/mage/sets/shardsofalara/HellsThunder.java +++ b/Mage.Sets/src/mage/sets/shardsofalara/HellsThunder.java @@ -47,28 +47,28 @@ import mage.game.events.GameEvent.EventType; */ public class HellsThunder extends CardImpl { - public HellsThunder(UUID ownerId) { - super(ownerId, 103, "Hell's Thunder", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{1}{R}{R}"); - this.expansionSetCode = "ALA"; - this.subtype.add("Elemental"); - this.color.setRed(true); - this.power = new MageInt(4); - this.toughness = new MageInt(4); + public HellsThunder(UUID ownerId) { + super(ownerId, 103, "Hell's Thunder", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{1}{R}{R}"); + this.expansionSetCode = "ALA"; + this.subtype.add("Elemental"); + this.color.setRed(true); + this.power = new MageInt(4); + this.toughness = new MageInt(4); - this.addAbility(FlyingAbility.getInstance()); - this.addAbility(HasteAbility.getInstance()); - this.addAbility(new OnEventTriggeredAbility(EventType.END_TURN_STEP_PRE, "beginning of the end step", true, new SacrificeSourceEffect())); - this.addAbility(new UnearthAbility(new ManaCostsImpl("{4}{R}"))); + this.addAbility(FlyingAbility.getInstance()); + this.addAbility(HasteAbility.getInstance()); + this.addAbility(new OnEventTriggeredAbility(EventType.END_TURN_STEP_PRE, "beginning of the end step", true, new SacrificeSourceEffect())); + this.addAbility(new UnearthAbility(new ManaCostsImpl("{4}{R}"))); - } + } - public HellsThunder(final HellsThunder card) { - super(card); - } + public HellsThunder(final HellsThunder card) { + super(card); + } - @Override - public HellsThunder copy() { - return new HellsThunder(this); - } + @Override + public HellsThunder copy() { + return new HellsThunder(this); + } } diff --git a/Mage.Sets/src/mage/sets/shardsofalara/Island1.java b/Mage.Sets/src/mage/sets/shardsofalara/Island1.java index 9c1e75a86d..46056249d7 100644 --- a/Mage.Sets/src/mage/sets/shardsofalara/Island1.java +++ b/Mage.Sets/src/mage/sets/shardsofalara/Island1.java @@ -36,18 +36,18 @@ import java.util.UUID; */ public class Island1 extends mage.cards.basiclands.Island { - public Island1(UUID ownerId) { - super(ownerId, 234); - this.expansionSetCode = "ALA"; - } + public Island1(UUID ownerId) { + super(ownerId, 234); + this.expansionSetCode = "ALA"; + } - public Island1(final Island1 card) { - super(card); - } + public Island1(final Island1 card) { + super(card); + } - @Override - public Island1 copy() { - return new Island1(this); - } + @Override + public Island1 copy() { + return new Island1(this); + } } diff --git a/Mage.Sets/src/mage/sets/shardsofalara/Island2.java b/Mage.Sets/src/mage/sets/shardsofalara/Island2.java index 6d2b7a3fae..2c90b4a858 100644 --- a/Mage.Sets/src/mage/sets/shardsofalara/Island2.java +++ b/Mage.Sets/src/mage/sets/shardsofalara/Island2.java @@ -36,18 +36,18 @@ import java.util.UUID; */ public class Island2 extends mage.cards.basiclands.Island { - public Island2(UUID ownerId) { - super(ownerId, 235); - this.expansionSetCode = "ALA"; - } + public Island2(UUID ownerId) { + super(ownerId, 235); + this.expansionSetCode = "ALA"; + } - public Island2(final Island2 card) { - super(card); - } + public Island2(final Island2 card) { + super(card); + } - @Override - public Island2 copy() { - return new Island2(this); - } + @Override + public Island2 copy() { + return new Island2(this); + } } diff --git a/Mage.Sets/src/mage/sets/shardsofalara/Island3.java b/Mage.Sets/src/mage/sets/shardsofalara/Island3.java index f52aee00ce..5904d5c2d0 100644 --- a/Mage.Sets/src/mage/sets/shardsofalara/Island3.java +++ b/Mage.Sets/src/mage/sets/shardsofalara/Island3.java @@ -36,18 +36,18 @@ import java.util.UUID; */ public class Island3 extends mage.cards.basiclands.Island { - public Island3(UUID ownerId) { - super(ownerId, 236); - this.expansionSetCode = "ALA"; - } + public Island3(UUID ownerId) { + super(ownerId, 236); + this.expansionSetCode = "ALA"; + } - public Island3(final Island3 card) { - super(card); - } + public Island3(final Island3 card) { + super(card); + } - @Override - public Island3 copy() { - return new Island3(this); - } + @Override + public Island3 copy() { + return new Island3(this); + } } diff --git a/Mage.Sets/src/mage/sets/shardsofalara/Island4.java b/Mage.Sets/src/mage/sets/shardsofalara/Island4.java index 16e8dde02b..5ba6c0adbc 100644 --- a/Mage.Sets/src/mage/sets/shardsofalara/Island4.java +++ b/Mage.Sets/src/mage/sets/shardsofalara/Island4.java @@ -36,18 +36,18 @@ import java.util.UUID; */ public class Island4 extends mage.cards.basiclands.Island { - public Island4(UUID ownerId) { - super(ownerId, 237); - this.expansionSetCode = "ALA"; - } + public Island4(UUID ownerId) { + super(ownerId, 237); + this.expansionSetCode = "ALA"; + } - public Island4(final Island4 card) { - super(card); - } + public Island4(final Island4 card) { + super(card); + } - @Override - public Island4 copy() { - return new Island4(this); - } + @Override + public Island4 copy() { + return new Island4(this); + } } diff --git a/Mage.Sets/src/mage/sets/shardsofalara/JhessianInfiltrator.java b/Mage.Sets/src/mage/sets/shardsofalara/JhessianInfiltrator.java index 5dff9fa8da..e4736c2edd 100644 --- a/Mage.Sets/src/mage/sets/shardsofalara/JhessianInfiltrator.java +++ b/Mage.Sets/src/mage/sets/shardsofalara/JhessianInfiltrator.java @@ -46,8 +46,8 @@ public class JhessianInfiltrator extends CardImpl { this.expansionSetCode = "ALA"; this.subtype.add("Human"); this.subtype.add("Rogue"); - this.color.setGreen(true); - this.color.setBlue(true); + this.color.setGreen(true); + this.color.setBlue(true); this.power = new MageInt(2); this.toughness = new MageInt(2); this.addAbility(UnblockableAbility.getInstance()); diff --git a/Mage.Sets/src/mage/sets/shardsofalara/JundBattlemage.java b/Mage.Sets/src/mage/sets/shardsofalara/JundBattlemage.java index 0b8d297d40..2fb89a8f2e 100644 --- a/Mage.Sets/src/mage/sets/shardsofalara/JundBattlemage.java +++ b/Mage.Sets/src/mage/sets/shardsofalara/JundBattlemage.java @@ -54,7 +54,7 @@ public class JundBattlemage extends CardImpl { this.expansionSetCode = "ALA"; this.subtype.add("Human"); this.subtype.add("Shaman"); - this.color.setRed(true); + this.color.setRed(true); this.power = new MageInt(2); this.toughness = new MageInt(2); Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new LoseLifeTargetEffect(1), new ManaCostsImpl("{B}")); diff --git a/Mage.Sets/src/mage/sets/shardsofalara/JundPanorama.java b/Mage.Sets/src/mage/sets/shardsofalara/JundPanorama.java index 264840786a..fd869f7464 100644 --- a/Mage.Sets/src/mage/sets/shardsofalara/JundPanorama.java +++ b/Mage.Sets/src/mage/sets/shardsofalara/JundPanorama.java @@ -62,24 +62,24 @@ public class JundPanorama extends CardImpl { filter.setScopeSubtype(Filter.ComparisonScope.Any); } - public JundPanorama(UUID ownerId) { - super(ownerId, 225, "Jund Panorama", Rarity.COMMON, new CardType[]{CardType.LAND}, null); - this.expansionSetCode = "ALA"; - this.addAbility(new ColorlessManaAbility()); - TargetCardInLibrary target = new TargetCardInLibrary(filter); + public JundPanorama(UUID ownerId) { + super(ownerId, 225, "Jund Panorama", Rarity.COMMON, new CardType[]{CardType.LAND}, null); + this.expansionSetCode = "ALA"; + this.addAbility(new ColorlessManaAbility()); + TargetCardInLibrary target = new TargetCardInLibrary(filter); Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new SearchLibraryPutInPlayEffect(target, true, Outcome.PutLandInPlay), new GenericManaCost(1)); ability.addCost(new TapSourceCost()); ability.addCost(new SacrificeSourceCost()); this.addAbility(ability); - } + } - public JundPanorama(final JundPanorama card) { - super(card); - } + public JundPanorama(final JundPanorama card) { + super(card); + } - @Override - public JundPanorama copy() { - return new JundPanorama(this); - } + @Override + public JundPanorama copy() { + return new JundPanorama(this); + } } diff --git a/Mage.Sets/src/mage/sets/shardsofalara/JungleWeaver.java b/Mage.Sets/src/mage/sets/shardsofalara/JungleWeaver.java index 166d691ccd..b2d4ae9021 100644 --- a/Mage.Sets/src/mage/sets/shardsofalara/JungleWeaver.java +++ b/Mage.Sets/src/mage/sets/shardsofalara/JungleWeaver.java @@ -47,7 +47,7 @@ public class JungleWeaver extends CardImpl { super(ownerId, 134, "Jungle Weaver", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{5}{G}{G}"); this.expansionSetCode = "ALA"; this.subtype.add("Spider"); - this.color.setGreen(true); + this.color.setGreen(true); this.power = new MageInt(5); this.toughness = new MageInt(6); this.addAbility(ReachAbility.getInstance()); diff --git a/Mage.Sets/src/mage/sets/shardsofalara/KnightOfTheSkywardEye.java b/Mage.Sets/src/mage/sets/shardsofalara/KnightOfTheSkywardEye.java index e9e765372c..987fe79477 100644 --- a/Mage.Sets/src/mage/sets/shardsofalara/KnightOfTheSkywardEye.java +++ b/Mage.Sets/src/mage/sets/shardsofalara/KnightOfTheSkywardEye.java @@ -45,7 +45,7 @@ import mage.cards.CardImpl; */ public class KnightOfTheSkywardEye extends CardImpl { - public KnightOfTheSkywardEye(UUID ownerId) { + public KnightOfTheSkywardEye(UUID ownerId) { super(ownerId, 15, "Knight of the Skyward Eye", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{1}{W}"); this.expansionSetCode = "ALA"; this.subtype.add("Human"); @@ -57,7 +57,7 @@ public class KnightOfTheSkywardEye extends CardImpl { // {3}{G}: Knight of the Skyward Eye gets +3/+3 until end of turn. Activate this ability only once each turn. this.addAbility(new ActivateOncePerTurnActivatedAbility(Zone.BATTLEFIELD, new BoostSourceEffect(3, 3, Duration.EndOfTurn), new ManaCostsImpl("{3}{G}"))); - + } public KnightOfTheSkywardEye(final KnightOfTheSkywardEye card) { diff --git a/Mage.Sets/src/mage/sets/shardsofalara/KnightOfTheWhiteOrchid.java b/Mage.Sets/src/mage/sets/shardsofalara/KnightOfTheWhiteOrchid.java index b67e47a734..0de98d8dc4 100644 --- a/Mage.Sets/src/mage/sets/shardsofalara/KnightOfTheWhiteOrchid.java +++ b/Mage.Sets/src/mage/sets/shardsofalara/KnightOfTheWhiteOrchid.java @@ -50,63 +50,63 @@ import java.util.UUID; */ public class KnightOfTheWhiteOrchid extends CardImpl { - public KnightOfTheWhiteOrchid(UUID ownerId) { - super(ownerId, 16, "Knight of the White Orchid", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{W}{W}"); - this.expansionSetCode = "ALA"; - this.subtype.add("Human"); - this.subtype.add("Knight"); - this.color.setWhite(true); - this.power = new MageInt(2); - this.toughness = new MageInt(2); + public KnightOfTheWhiteOrchid(UUID ownerId) { + super(ownerId, 16, "Knight of the White Orchid", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{W}{W}"); + this.expansionSetCode = "ALA"; + this.subtype.add("Human"); + this.subtype.add("Knight"); + this.color.setWhite(true); + this.power = new MageInt(2); + this.toughness = new MageInt(2); - this.addAbility(new KnightOfTheWhiteOrchidAbility()); - this.addAbility(FirstStrikeAbility.getInstance()); - } + this.addAbility(new KnightOfTheWhiteOrchidAbility()); + this.addAbility(FirstStrikeAbility.getInstance()); + } - public KnightOfTheWhiteOrchid(final KnightOfTheWhiteOrchid card) { - super(card); - } + public KnightOfTheWhiteOrchid(final KnightOfTheWhiteOrchid card) { + super(card); + } - @Override - public KnightOfTheWhiteOrchid copy() { - return new KnightOfTheWhiteOrchid(this); - } + @Override + public KnightOfTheWhiteOrchid copy() { + return new KnightOfTheWhiteOrchid(this); + } } class KnightOfTheWhiteOrchidAbility extends ZoneChangeTriggeredAbility { - private static final FilterCard filter1 = new FilterCard("Plains"); - private static final FilterLandPermanent filter2 = new FilterLandPermanent(); + private static final FilterCard filter1 = new FilterCard("Plains"); + private static final FilterLandPermanent filter2 = new FilterLandPermanent(); - static { - filter1.getName().add("Plains"); - } + static { + filter1.getName().add("Plains"); + } - public KnightOfTheWhiteOrchidAbility() { - super(Zone.BATTLEFIELD, null, "When {this} enters the battlefield, if an opponent controls more lands than you, you may ", true); - TargetCardInLibrary target = new TargetCardInLibrary(filter1); - addEffect(new SearchLibraryPutInPlayEffect(target, false, Outcome.PutLandInPlay)); - } + public KnightOfTheWhiteOrchidAbility() { + super(Zone.BATTLEFIELD, null, "When {this} enters the battlefield, if an opponent controls more lands than you, you may ", true); + TargetCardInLibrary target = new TargetCardInLibrary(filter1); + addEffect(new SearchLibraryPutInPlayEffect(target, false, Outcome.PutLandInPlay)); + } - public KnightOfTheWhiteOrchidAbility(final KnightOfTheWhiteOrchidAbility ability) { - super(ability); - } + public KnightOfTheWhiteOrchidAbility(final KnightOfTheWhiteOrchidAbility ability) { + super(ability); + } - @Override - public KnightOfTheWhiteOrchidAbility copy() { - return new KnightOfTheWhiteOrchidAbility(this); - } + @Override + public KnightOfTheWhiteOrchidAbility copy() { + return new KnightOfTheWhiteOrchidAbility(this); + } - @Override - public boolean checkInterveningIfClause(Game game) { - int numLands = game.getBattlefield().countAll(filter2, this.controllerId, game); - for (UUID opponentId: game.getOpponents(this.controllerId)) { - if (numLands < game.getBattlefield().countAll(filter2, opponentId, game)) { - return true; - } - } - return false; - } + @Override + public boolean checkInterveningIfClause(Game game) { + int numLands = game.getBattlefield().countAll(filter2, this.controllerId, game); + for (UUID opponentId: game.getOpponents(this.controllerId)) { + if (numLands < game.getBattlefield().countAll(filter2, opponentId, game)) { + return true; + } + } + return false; + } } \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/shardsofalara/LightningTalons.java b/Mage.Sets/src/mage/sets/shardsofalara/LightningTalons.java index 47112ecf02..14250031e0 100644 --- a/Mage.Sets/src/mage/sets/shardsofalara/LightningTalons.java +++ b/Mage.Sets/src/mage/sets/shardsofalara/LightningTalons.java @@ -56,13 +56,13 @@ public class LightningTalons extends CardImpl { super(ownerId, 107, "Lightning Talons", Rarity.COMMON, new CardType[]{CardType.ENCHANTMENT}, "{2}{R}"); this.expansionSetCode = "ALA"; this.subtype.add("Aura"); - this.color.setRed(true); + this.color.setRed(true); TargetPermanent auraTarget = new TargetCreaturePermanent(); - this.getSpellAbility().addTarget(auraTarget); - this.getSpellAbility().addEffect(new AttachEffect(Constants.Outcome.BoostCreature)); - Ability ability = new EnchantAbility(auraTarget.getTargetName()); - this.addAbility(ability); + this.getSpellAbility().addTarget(auraTarget); + this.getSpellAbility().addEffect(new AttachEffect(Constants.Outcome.BoostCreature)); + Ability ability = new EnchantAbility(auraTarget.getTargetName()); + this.addAbility(ability); this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostEnchantedEffect(3, 0, Duration.WhileOnBattlefield))); this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityAttachedEffect(FirstStrikeAbility.getInstance(), Constants.AttachmentType.AURA))); diff --git a/Mage.Sets/src/mage/sets/shardsofalara/Mountain1.java b/Mage.Sets/src/mage/sets/shardsofalara/Mountain1.java index 344663df2f..d2de29e3fe 100644 --- a/Mage.Sets/src/mage/sets/shardsofalara/Mountain1.java +++ b/Mage.Sets/src/mage/sets/shardsofalara/Mountain1.java @@ -36,18 +36,18 @@ import java.util.UUID; */ public class Mountain1 extends mage.cards.basiclands.Mountain { - public Mountain1(UUID ownerId) { - super(ownerId, 242); - this.expansionSetCode = "ALA"; - } + public Mountain1(UUID ownerId) { + super(ownerId, 242); + this.expansionSetCode = "ALA"; + } - public Mountain1(final Mountain1 card) { - super(card); - } + public Mountain1(final Mountain1 card) { + super(card); + } - @Override - public Mountain1 copy() { - return new Mountain1(this); - } + @Override + public Mountain1 copy() { + return new Mountain1(this); + } } diff --git a/Mage.Sets/src/mage/sets/shardsofalara/Mountain2.java b/Mage.Sets/src/mage/sets/shardsofalara/Mountain2.java index fbc64077aa..f74ea9b795 100644 --- a/Mage.Sets/src/mage/sets/shardsofalara/Mountain2.java +++ b/Mage.Sets/src/mage/sets/shardsofalara/Mountain2.java @@ -36,18 +36,18 @@ import java.util.UUID; */ public class Mountain2 extends mage.cards.basiclands.Mountain { - public Mountain2(UUID ownerId) { - super(ownerId, 243); - this.expansionSetCode = "ALA"; - } + public Mountain2(UUID ownerId) { + super(ownerId, 243); + this.expansionSetCode = "ALA"; + } - public Mountain2(final Mountain2 card) { - super(card); - } + public Mountain2(final Mountain2 card) { + super(card); + } - @Override - public Mountain2 copy() { - return new Mountain2(this); - } + @Override + public Mountain2 copy() { + return new Mountain2(this); + } } diff --git a/Mage.Sets/src/mage/sets/shardsofalara/Mountain3.java b/Mage.Sets/src/mage/sets/shardsofalara/Mountain3.java index 5beff96d0c..5ee616840a 100644 --- a/Mage.Sets/src/mage/sets/shardsofalara/Mountain3.java +++ b/Mage.Sets/src/mage/sets/shardsofalara/Mountain3.java @@ -36,18 +36,18 @@ import java.util.UUID; */ public class Mountain3 extends mage.cards.basiclands.Mountain { - public Mountain3(UUID ownerId) { - super(ownerId, 244); - this.expansionSetCode = "ALA"; - } + public Mountain3(UUID ownerId) { + super(ownerId, 244); + this.expansionSetCode = "ALA"; + } - public Mountain3(final Mountain3 card) { - super(card); - } + public Mountain3(final Mountain3 card) { + super(card); + } - @Override - public Mountain3 copy() { - return new Mountain3(this); - } + @Override + public Mountain3 copy() { + return new Mountain3(this); + } } diff --git a/Mage.Sets/src/mage/sets/shardsofalara/Mountain4.java b/Mage.Sets/src/mage/sets/shardsofalara/Mountain4.java index 2281d9e784..57968488f1 100644 --- a/Mage.Sets/src/mage/sets/shardsofalara/Mountain4.java +++ b/Mage.Sets/src/mage/sets/shardsofalara/Mountain4.java @@ -36,18 +36,18 @@ import java.util.UUID; */ public class Mountain4 extends mage.cards.basiclands.Mountain { - public Mountain4(UUID ownerId) { - super(ownerId, 245); - this.expansionSetCode = "ALA"; - } + public Mountain4(UUID ownerId) { + super(ownerId, 245); + this.expansionSetCode = "ALA"; + } - public Mountain4(final Mountain4 card) { - super(card); - } + public Mountain4(final Mountain4 card) { + super(card); + } - @Override - public Mountain4 copy() { - return new Mountain4(this); - } + @Override + public Mountain4 copy() { + return new Mountain4(this); + } } diff --git a/Mage.Sets/src/mage/sets/shardsofalara/Naturalize.java b/Mage.Sets/src/mage/sets/shardsofalara/Naturalize.java index 5725c29785..566e755671 100644 --- a/Mage.Sets/src/mage/sets/shardsofalara/Naturalize.java +++ b/Mage.Sets/src/mage/sets/shardsofalara/Naturalize.java @@ -36,19 +36,19 @@ import java.util.UUID; */ public class Naturalize extends mage.sets.magic2010.Naturalize { - public Naturalize(UUID ownerId) { - super(ownerId); - this.cardNumber = 141; - this.expansionSetCode = "ALA"; - } + public Naturalize(UUID ownerId) { + super(ownerId); + this.cardNumber = 141; + this.expansionSetCode = "ALA"; + } - public Naturalize(final Naturalize card) { - super(card); - } + public Naturalize(final Naturalize card) { + super(card); + } - @Override - public Naturalize copy() { - return new Naturalize(this); - } + @Override + public Naturalize copy() { + return new Naturalize(this); + } } \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/shardsofalara/NayaBattlemage.java b/Mage.Sets/src/mage/sets/shardsofalara/NayaBattlemage.java index 8ec876a2ab..1c2c844e3e 100644 --- a/Mage.Sets/src/mage/sets/shardsofalara/NayaBattlemage.java +++ b/Mage.Sets/src/mage/sets/shardsofalara/NayaBattlemage.java @@ -54,7 +54,7 @@ public class NayaBattlemage extends CardImpl { this.expansionSetCode = "ALA"; this.subtype.add("Human"); this.subtype.add("Shaman"); - this.color.setGreen(true); + this.color.setGreen(true); this.power = new MageInt(2); this.toughness = new MageInt(2); Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new BoostTargetEffect(2, 0, Duration.EndOfTurn), new ManaCostsImpl("{R}")); diff --git a/Mage.Sets/src/mage/sets/shardsofalara/OblivionRing.java b/Mage.Sets/src/mage/sets/shardsofalara/OblivionRing.java index d7e6c21353..30b825436f 100644 --- a/Mage.Sets/src/mage/sets/shardsofalara/OblivionRing.java +++ b/Mage.Sets/src/mage/sets/shardsofalara/OblivionRing.java @@ -54,30 +54,30 @@ public class OblivionRing extends CardImpl { anotherNonlandPermanent.setAnother(true); } - public OblivionRing(UUID ownerId) { - super(ownerId, 20, "Oblivion Ring", Rarity.COMMON, new CardType[]{CardType.ENCHANTMENT}, "{2}{W}"); - this.expansionSetCode = "ALA"; - this.color.setWhite(true); + public OblivionRing(UUID ownerId) { + super(ownerId, 20, "Oblivion Ring", Rarity.COMMON, new CardType[]{CardType.ENCHANTMENT}, "{2}{W}"); + this.expansionSetCode = "ALA"; + this.color.setWhite(true); // When Oblivion Ring enters the battlefield, exile another target nonland permanent. Ability ability1 = new EntersBattlefieldTriggeredAbility(new ExileTargetForSourceEffect( "Oblivion Ring exile"), false); - Target target = new TargetPermanent(anotherNonlandPermanent); + Target target = new TargetPermanent(anotherNonlandPermanent); target.setRequired(true); ability1.addTarget(target); - this.addAbility(ability1); + this.addAbility(ability1); // When Oblivion Ring leaves the battlefield, return the exiled card to the battlefield under its owner's control. Ability ability2 = new LeavesBattlefieldTriggeredAbility(new ReturnFromExileForSourceEffect(Zone.BATTLEFIELD), false); - this.addAbility(ability2); - } + this.addAbility(ability2); + } - public OblivionRing(final OblivionRing card) { - super(card); - } + public OblivionRing(final OblivionRing card) { + super(card); + } - @Override - public OblivionRing copy() { - return new OblivionRing(this); - } + @Override + public OblivionRing copy() { + return new OblivionRing(this); + } } diff --git a/Mage.Sets/src/mage/sets/shardsofalara/Plains1.java b/Mage.Sets/src/mage/sets/shardsofalara/Plains1.java index 3b0441c3ed..c4635453d9 100644 --- a/Mage.Sets/src/mage/sets/shardsofalara/Plains1.java +++ b/Mage.Sets/src/mage/sets/shardsofalara/Plains1.java @@ -36,18 +36,18 @@ import java.util.UUID; */ public class Plains1 extends mage.cards.basiclands.Plains { - public Plains1(UUID ownerId) { - super(ownerId, 230); - this.expansionSetCode = "ALA"; - } + public Plains1(UUID ownerId) { + super(ownerId, 230); + this.expansionSetCode = "ALA"; + } - public Plains1(final Plains1 card) { - super(card); - } + public Plains1(final Plains1 card) { + super(card); + } - @Override - public Plains1 copy() { - return new Plains1(this); - } + @Override + public Plains1 copy() { + return new Plains1(this); + } } diff --git a/Mage.Sets/src/mage/sets/shardsofalara/Plains2.java b/Mage.Sets/src/mage/sets/shardsofalara/Plains2.java index befdf3be46..f4ffef5500 100644 --- a/Mage.Sets/src/mage/sets/shardsofalara/Plains2.java +++ b/Mage.Sets/src/mage/sets/shardsofalara/Plains2.java @@ -36,18 +36,18 @@ import java.util.UUID; */ public class Plains2 extends mage.cards.basiclands.Plains { - public Plains2(UUID ownerId) { - super(ownerId, 231); - this.expansionSetCode = "ALA"; - } + public Plains2(UUID ownerId) { + super(ownerId, 231); + this.expansionSetCode = "ALA"; + } - public Plains2(final Plains2 card) { - super(card); - } + public Plains2(final Plains2 card) { + super(card); + } - @Override - public Plains2 copy() { - return new Plains2(this); - } + @Override + public Plains2 copy() { + return new Plains2(this); + } } diff --git a/Mage.Sets/src/mage/sets/shardsofalara/Plains3.java b/Mage.Sets/src/mage/sets/shardsofalara/Plains3.java index 9e3bc5ae94..6a9c37a03d 100644 --- a/Mage.Sets/src/mage/sets/shardsofalara/Plains3.java +++ b/Mage.Sets/src/mage/sets/shardsofalara/Plains3.java @@ -36,18 +36,18 @@ import java.util.UUID; */ public class Plains3 extends mage.cards.basiclands.Plains { - public Plains3(UUID ownerId) { - super(ownerId, 232); - this.expansionSetCode = "ALA"; - } + public Plains3(UUID ownerId) { + super(ownerId, 232); + this.expansionSetCode = "ALA"; + } - public Plains3(final Plains3 card) { - super(card); - } + public Plains3(final Plains3 card) { + super(card); + } - @Override - public Plains3 copy() { - return new Plains3(this); - } + @Override + public Plains3 copy() { + return new Plains3(this); + } } diff --git a/Mage.Sets/src/mage/sets/shardsofalara/Plains4.java b/Mage.Sets/src/mage/sets/shardsofalara/Plains4.java index b275dcfaf0..eae666a735 100644 --- a/Mage.Sets/src/mage/sets/shardsofalara/Plains4.java +++ b/Mage.Sets/src/mage/sets/shardsofalara/Plains4.java @@ -36,18 +36,18 @@ import java.util.UUID; */ public class Plains4 extends mage.cards.basiclands.Plains { - public Plains4(UUID ownerId) { - super(ownerId, 233); - this.expansionSetCode = "ALA"; - } + public Plains4(UUID ownerId) { + super(ownerId, 233); + this.expansionSetCode = "ALA"; + } - public Plains4(final Plains4 card) { - super(card); - } + public Plains4(final Plains4 card) { + super(card); + } - @Override - public Plains4 copy() { - return new Plains4(this); - } + @Override + public Plains4 copy() { + return new Plains4(this); + } } diff --git a/Mage.Sets/src/mage/sets/shardsofalara/RafiqOfTheMany.java b/Mage.Sets/src/mage/sets/shardsofalara/RafiqOfTheMany.java index 5b1a8e6b0c..5668c481fb 100644 --- a/Mage.Sets/src/mage/sets/shardsofalara/RafiqOfTheMany.java +++ b/Mage.Sets/src/mage/sets/shardsofalara/RafiqOfTheMany.java @@ -50,62 +50,62 @@ import mage.target.common.TargetCreaturePermanent; */ public class RafiqOfTheMany extends CardImpl { - public RafiqOfTheMany(UUID ownerId) { - super(ownerId, 185, "Rafiq of the Many", Rarity.MYTHIC, new CardType[]{CardType.CREATURE}, "{1}{G}{W}{U}"); - this.expansionSetCode = "ALA"; - this.color.setGreen(true); - this.color.setWhite(true); - this.color.setBlue(true); - this.supertype.add("Legendary"); - this.subtype.add("Human"); - this.subtype.add("Knight"); - this.power = new MageInt(3); - this.toughness = new MageInt(3); - this.addAbility(new ExaltedAbility()); - this.addAbility(new RafiqOfTheManyAbility()); - } + public RafiqOfTheMany(UUID ownerId) { + super(ownerId, 185, "Rafiq of the Many", Rarity.MYTHIC, new CardType[]{CardType.CREATURE}, "{1}{G}{W}{U}"); + this.expansionSetCode = "ALA"; + this.color.setGreen(true); + this.color.setWhite(true); + this.color.setBlue(true); + this.supertype.add("Legendary"); + this.subtype.add("Human"); + this.subtype.add("Knight"); + this.power = new MageInt(3); + this.toughness = new MageInt(3); + this.addAbility(new ExaltedAbility()); + this.addAbility(new RafiqOfTheManyAbility()); + } - public RafiqOfTheMany(final RafiqOfTheMany card) { - super(card); - } + public RafiqOfTheMany(final RafiqOfTheMany card) { + super(card); + } - @Override - public RafiqOfTheMany copy() { - return new RafiqOfTheMany(this); - } + @Override + public RafiqOfTheMany copy() { + return new RafiqOfTheMany(this); + } } class RafiqOfTheManyAbility extends TriggeredAbilityImpl { - public RafiqOfTheManyAbility() { - super(Zone.BATTLEFIELD, new GainAbilityTargetEffect(DoubleStrikeAbility.getInstance(), Duration.EndOfTurn)); - } + public RafiqOfTheManyAbility() { + super(Zone.BATTLEFIELD, new GainAbilityTargetEffect(DoubleStrikeAbility.getInstance(), Duration.EndOfTurn)); + } - public RafiqOfTheManyAbility(final RafiqOfTheManyAbility ability) { - super(ability); - } + public RafiqOfTheManyAbility(final RafiqOfTheManyAbility ability) { + super(ability); + } - @Override - public RafiqOfTheManyAbility copy() { - return new RafiqOfTheManyAbility(this); - } + @Override + public RafiqOfTheManyAbility copy() { + return new RafiqOfTheManyAbility(this); + } - @Override - public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == EventType.DECLARED_ATTACKERS && game.getActivePlayerId().equals(this.controllerId) ) { - if (game.getCombat().attacksAlone()) { - this.addTarget(new TargetCreaturePermanent()); - getTargets().get(0).add(game.getCombat().getAttackers().get(0), game); - return true; - } - } - return false; - } + @Override + public boolean checkTrigger(GameEvent event, Game game) { + if (event.getType() == EventType.DECLARED_ATTACKERS && game.getActivePlayerId().equals(this.controllerId) ) { + if (game.getCombat().attacksAlone()) { + this.addTarget(new TargetCreaturePermanent()); + getTargets().get(0).add(game.getCombat().getAttackers().get(0), game); + return true; + } + } + return false; + } - @Override - public String getRule() { - return "Whenever a creature you control attacks alone, it gains double strike until end of turn."; - } + @Override + public String getRule() { + return "Whenever a creature you control attacks alone, it gains double strike until end of turn."; + } } diff --git a/Mage.Sets/src/mage/sets/shardsofalara/RangerOfEos.java b/Mage.Sets/src/mage/sets/shardsofalara/RangerOfEos.java index 897bd4e365..ca2a2e64e5 100644 --- a/Mage.Sets/src/mage/sets/shardsofalara/RangerOfEos.java +++ b/Mage.Sets/src/mage/sets/shardsofalara/RangerOfEos.java @@ -45,34 +45,34 @@ import mage.target.common.TargetCardInLibrary; */ public class RangerOfEos extends CardImpl { - private static final FilterCard filter = new FilterCard("creature cards with converted mana cost 1 or less"); + private static final FilterCard filter = new FilterCard("creature cards with converted mana cost 1 or less"); - static { - filter.getCardType().add(CardType.CREATURE); - filter.setConvertedManaCost(2); - filter.setConvertedManaCostComparison(ComparisonType.LessThan); - } + static { + filter.getCardType().add(CardType.CREATURE); + filter.setConvertedManaCost(2); + filter.setConvertedManaCostComparison(ComparisonType.LessThan); + } - public RangerOfEos(UUID ownerId) { - super(ownerId, 21, "Ranger of Eos", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{3}{W}"); - this.expansionSetCode = "ALA"; - this.color.setWhite(true); - this.subtype.add("Human"); - this.subtype.add("Soldier"); - this.power = new MageInt(3); - this.toughness = new MageInt(2); + public RangerOfEos(UUID ownerId) { + super(ownerId, 21, "Ranger of Eos", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{3}{W}"); + this.expansionSetCode = "ALA"; + this.color.setWhite(true); + this.subtype.add("Human"); + this.subtype.add("Soldier"); + this.power = new MageInt(3); + this.toughness = new MageInt(2); - TargetCardInLibrary target = new TargetCardInLibrary(0, 2, filter); - this.addAbility(new EntersBattlefieldTriggeredAbility(new SearchLibraryRevealPutInHandEffect(target, false), true)); - } + TargetCardInLibrary target = new TargetCardInLibrary(0, 2, filter); + this.addAbility(new EntersBattlefieldTriggeredAbility(new SearchLibraryRevealPutInHandEffect(target, false), true)); + } - public RangerOfEos(final RangerOfEos card) { - super(card); - } + public RangerOfEos(final RangerOfEos card) { + super(card); + } - @Override - public RangerOfEos copy() { - return new RangerOfEos(this); - } + @Override + public RangerOfEos copy() { + return new RangerOfEos(this); + } } diff --git a/Mage.Sets/src/mage/sets/shardsofalara/RhoxCharger.java b/Mage.Sets/src/mage/sets/shardsofalara/RhoxCharger.java index 23603e66d4..bdf75df27c 100644 --- a/Mage.Sets/src/mage/sets/shardsofalara/RhoxCharger.java +++ b/Mage.Sets/src/mage/sets/shardsofalara/RhoxCharger.java @@ -47,7 +47,7 @@ public class RhoxCharger extends CardImpl { this.expansionSetCode = "ALA"; this.subtype.add("Rhino"); this.subtype.add("Soldier"); - this.color.setGreen(true); + this.color.setGreen(true); this.power = new MageInt(3); this.toughness = new MageInt(3); this.addAbility(TrampleAbility.getInstance()); diff --git a/Mage.Sets/src/mage/sets/shardsofalara/RhoxWarMonk.java b/Mage.Sets/src/mage/sets/shardsofalara/RhoxWarMonk.java index 8e028a4f20..599b76e2e9 100644 --- a/Mage.Sets/src/mage/sets/shardsofalara/RhoxWarMonk.java +++ b/Mage.Sets/src/mage/sets/shardsofalara/RhoxWarMonk.java @@ -41,27 +41,27 @@ import mage.cards.CardImpl; */ public class RhoxWarMonk extends CardImpl { - public RhoxWarMonk(UUID ownerId) { - super(ownerId, 188, "Rhox War Monk", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{G}{W}{U}"); - this.expansionSetCode = "ALA"; - this.subtype.add("Rhino"); - this.subtype.add("Monk"); - this.color.setWhite(true); - this.color.setBlue(true); - this.color.setGreen(true); - this.power = new MageInt(3); - this.toughness = new MageInt(4); + public RhoxWarMonk(UUID ownerId) { + super(ownerId, 188, "Rhox War Monk", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{G}{W}{U}"); + this.expansionSetCode = "ALA"; + this.subtype.add("Rhino"); + this.subtype.add("Monk"); + this.color.setWhite(true); + this.color.setBlue(true); + this.color.setGreen(true); + this.power = new MageInt(3); + this.toughness = new MageInt(4); - this.addAbility(LifelinkAbility.getInstance()); - } + this.addAbility(LifelinkAbility.getInstance()); + } - public RhoxWarMonk(final RhoxWarMonk card) { - super(card); - } + public RhoxWarMonk(final RhoxWarMonk card) { + super(card); + } - @Override - public RhoxWarMonk copy() { - return new RhoxWarMonk(this); - } + @Override + public RhoxWarMonk copy() { + return new RhoxWarMonk(this); + } } diff --git a/Mage.Sets/src/mage/sets/shardsofalara/SarkhanVol.java b/Mage.Sets/src/mage/sets/shardsofalara/SarkhanVol.java index 30809188a5..5a5f6fc3d0 100644 --- a/Mage.Sets/src/mage/sets/shardsofalara/SarkhanVol.java +++ b/Mage.Sets/src/mage/sets/shardsofalara/SarkhanVol.java @@ -54,39 +54,39 @@ import mage.target.common.TargetCreaturePermanent; */ public class SarkhanVol extends CardImpl { - private static DragonToken dragonToken = new DragonToken(); + private static DragonToken dragonToken = new DragonToken(); - public SarkhanVol(UUID ownerId) { - super(ownerId, 191, "Sarkhan Vol", Rarity.MYTHIC, new CardType[]{CardType.PLANESWALKER}, "{2}{R}{G}"); - this.expansionSetCode = "ALA"; - this.subtype.add("Sarkhan"); - this.color.setRed(true); - this.color.setGreen(true); - this.addAbility(new EntersBattlefieldAbility(new AddCountersSourceEffect(CounterType.LOYALTY.createInstance(4)), "")); + public SarkhanVol(UUID ownerId) { + super(ownerId, 191, "Sarkhan Vol", Rarity.MYTHIC, new CardType[]{CardType.PLANESWALKER}, "{2}{R}{G}"); + this.expansionSetCode = "ALA"; + this.subtype.add("Sarkhan"); + this.color.setRed(true); + this.color.setGreen(true); + this.addAbility(new EntersBattlefieldAbility(new AddCountersSourceEffect(CounterType.LOYALTY.createInstance(4)), "")); - Effects effects1 = new Effects(); - effects1.add(new BoostControlledEffect(1, 1, Duration.EndOfTurn)); - effects1.add(new GainAbilityControlledEffect(HasteAbility.getInstance(), Duration.EndOfTurn, new FilterCreaturePermanent())); - this.addAbility(new LoyaltyAbility(effects1, 1)); + Effects effects1 = new Effects(); + effects1.add(new BoostControlledEffect(1, 1, Duration.EndOfTurn)); + effects1.add(new GainAbilityControlledEffect(HasteAbility.getInstance(), Duration.EndOfTurn, new FilterCreaturePermanent())); + this.addAbility(new LoyaltyAbility(effects1, 1)); - Effects effects2 = new Effects(); - effects2.add(new GainControlTargetEffect(Duration.EndOfTurn)); - effects2.add(new UntapTargetEffect()); - effects2.add(new GainAbilityTargetEffect(HasteAbility.getInstance(), Duration.EndOfTurn)); + Effects effects2 = new Effects(); + effects2.add(new GainControlTargetEffect(Duration.EndOfTurn)); + effects2.add(new UntapTargetEffect()); + effects2.add(new GainAbilityTargetEffect(HasteAbility.getInstance(), Duration.EndOfTurn)); - LoyaltyAbility ability = new LoyaltyAbility(effects2, -2); - ability.addTarget(new TargetCreaturePermanent()); - this.addAbility(ability); + LoyaltyAbility ability = new LoyaltyAbility(effects2, -2); + ability.addTarget(new TargetCreaturePermanent()); + this.addAbility(ability); - this.addAbility(new LoyaltyAbility(new CreateTokenEffect(dragonToken), -6)); - } + this.addAbility(new LoyaltyAbility(new CreateTokenEffect(dragonToken), -6)); + } - public SarkhanVol(final SarkhanVol card) { - super(card); - } + public SarkhanVol(final SarkhanVol card) { + super(card); + } - @Override - public SarkhanVol copy() { - return new SarkhanVol(this); - } + @Override + public SarkhanVol copy() { + return new SarkhanVol(this); + } } diff --git a/Mage.Sets/src/mage/sets/shardsofalara/SavageHunger.java b/Mage.Sets/src/mage/sets/shardsofalara/SavageHunger.java index df1d5979df..5d6bd1b563 100644 --- a/Mage.Sets/src/mage/sets/shardsofalara/SavageHunger.java +++ b/Mage.Sets/src/mage/sets/shardsofalara/SavageHunger.java @@ -57,12 +57,12 @@ public class SavageHunger extends CardImpl { super(ownerId, 147, "Savage Hunger", Rarity.COMMON, new CardType[]{CardType.ENCHANTMENT}, "{2}{G}"); this.expansionSetCode = "ALA"; this.subtype.add("Aura"); - this.color.setGreen(true); + this.color.setGreen(true); TargetPermanent auraTarget = new TargetCreaturePermanent(); - this.getSpellAbility().addTarget(auraTarget); - this.getSpellAbility().addEffect(new AttachEffect(Constants.Outcome.BoostCreature)); - this.addAbility(new EnchantAbility(auraTarget.getTargetName())); + this.getSpellAbility().addTarget(auraTarget); + this.getSpellAbility().addEffect(new AttachEffect(Constants.Outcome.BoostCreature)); + this.addAbility(new EnchantAbility(auraTarget.getTargetName())); SimpleStaticAbility ability = new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostEnchantedEffect(1, 0, Duration.WhileOnBattlefield)); ability.addEffect(new GainAbilityAttachedEffect(TrampleAbility.getInstance(), Constants.AttachmentType.AURA)); diff --git a/Mage.Sets/src/mage/sets/shardsofalara/SavageLands.java b/Mage.Sets/src/mage/sets/shardsofalara/SavageLands.java index eb61db0261..443f5ba245 100644 --- a/Mage.Sets/src/mage/sets/shardsofalara/SavageLands.java +++ b/Mage.Sets/src/mage/sets/shardsofalara/SavageLands.java @@ -43,22 +43,22 @@ import mage.cards.CardImpl; */ public class SavageLands extends CardImpl { - public SavageLands(UUID ownerId) { - super(ownerId, 228, "Savage Lands", Rarity.UNCOMMON, new CardType[]{CardType.LAND}, null); - this.expansionSetCode = "ALA"; - this.addAbility(new EntersBattlefieldTappedAbility()); - this.addAbility(new RedManaAbility()); - this.addAbility(new GreenManaAbility()); - this.addAbility(new BlackManaAbility()); - } + public SavageLands(UUID ownerId) { + super(ownerId, 228, "Savage Lands", Rarity.UNCOMMON, new CardType[]{CardType.LAND}, null); + this.expansionSetCode = "ALA"; + this.addAbility(new EntersBattlefieldTappedAbility()); + this.addAbility(new RedManaAbility()); + this.addAbility(new GreenManaAbility()); + this.addAbility(new BlackManaAbility()); + } - public SavageLands(final SavageLands card) { - super(card); - } + public SavageLands(final SavageLands card) { + super(card); + } - @Override - public SavageLands copy() { - return new SavageLands(this); - } + @Override + public SavageLands copy() { + return new SavageLands(this); + } } diff --git a/Mage.Sets/src/mage/sets/shardsofalara/SproutingThrinax.java b/Mage.Sets/src/mage/sets/shardsofalara/SproutingThrinax.java index 65c105cee1..09eb175faa 100644 --- a/Mage.Sets/src/mage/sets/shardsofalara/SproutingThrinax.java +++ b/Mage.Sets/src/mage/sets/shardsofalara/SproutingThrinax.java @@ -43,29 +43,29 @@ import mage.game.permanent.token.SaprolingToken; */ public class SproutingThrinax extends CardImpl { - private static SaprolingToken saprolingToken = new SaprolingToken(); + private static SaprolingToken saprolingToken = new SaprolingToken(); - public SproutingThrinax(UUID ownerId) { - super(ownerId, 197, "Sprouting Thrinax", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{B}{R}{G}"); - this.expansionSetCode = "ALA"; - this.color.setBlack(true); - this.color.setRed(true); - this.color.setGreen(true); - this.subtype.add("Lizard"); - this.power = new MageInt(3); - this.toughness = new MageInt(3); + public SproutingThrinax(UUID ownerId) { + super(ownerId, 197, "Sprouting Thrinax", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{B}{R}{G}"); + this.expansionSetCode = "ALA"; + this.color.setBlack(true); + this.color.setRed(true); + this.color.setGreen(true); + this.subtype.add("Lizard"); + this.power = new MageInt(3); + this.toughness = new MageInt(3); - this.addAbility(new DiesTriggeredAbility(new CreateTokenEffect(saprolingToken, 3), false)); - } + this.addAbility(new DiesTriggeredAbility(new CreateTokenEffect(saprolingToken, 3), false)); + } - public SproutingThrinax(final SproutingThrinax card) { - super(card); - } + public SproutingThrinax(final SproutingThrinax card) { + super(card); + } - @Override - public SproutingThrinax copy() { - return new SproutingThrinax(this); - } + @Override + public SproutingThrinax copy() { + return new SproutingThrinax(this); + } } diff --git a/Mage.Sets/src/mage/sets/shardsofalara/Swamp1.java b/Mage.Sets/src/mage/sets/shardsofalara/Swamp1.java index b263faab89..dcec87fb85 100644 --- a/Mage.Sets/src/mage/sets/shardsofalara/Swamp1.java +++ b/Mage.Sets/src/mage/sets/shardsofalara/Swamp1.java @@ -36,18 +36,18 @@ import java.util.UUID; */ public class Swamp1 extends mage.cards.basiclands.Swamp { - public Swamp1(UUID ownerId) { - super(ownerId, 238); - this.expansionSetCode = "ALA"; - } + public Swamp1(UUID ownerId) { + super(ownerId, 238); + this.expansionSetCode = "ALA"; + } - public Swamp1(final Swamp1 card) { - super(card); - } + public Swamp1(final Swamp1 card) { + super(card); + } - @Override - public Swamp1 copy() { - return new Swamp1(this); - } + @Override + public Swamp1 copy() { + return new Swamp1(this); + } } diff --git a/Mage.Sets/src/mage/sets/shardsofalara/Swamp2.java b/Mage.Sets/src/mage/sets/shardsofalara/Swamp2.java index 8b1e00ff80..268a414a86 100644 --- a/Mage.Sets/src/mage/sets/shardsofalara/Swamp2.java +++ b/Mage.Sets/src/mage/sets/shardsofalara/Swamp2.java @@ -36,18 +36,18 @@ import java.util.UUID; */ public class Swamp2 extends mage.cards.basiclands.Swamp { - public Swamp2(UUID ownerId) { - super(ownerId, 239); - this.expansionSetCode = "ALA"; - } + public Swamp2(UUID ownerId) { + super(ownerId, 239); + this.expansionSetCode = "ALA"; + } - public Swamp2(final Swamp2 card) { - super(card); - } + public Swamp2(final Swamp2 card) { + super(card); + } - @Override - public Swamp2 copy() { - return new Swamp2(this); - } + @Override + public Swamp2 copy() { + return new Swamp2(this); + } } \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/shardsofalara/Swamp3.java b/Mage.Sets/src/mage/sets/shardsofalara/Swamp3.java index ebb277d219..f75e94bf66 100644 --- a/Mage.Sets/src/mage/sets/shardsofalara/Swamp3.java +++ b/Mage.Sets/src/mage/sets/shardsofalara/Swamp3.java @@ -36,18 +36,18 @@ import java.util.UUID; */ public class Swamp3 extends mage.cards.basiclands.Swamp { - public Swamp3(UUID ownerId) { - super(ownerId, 240); - this.expansionSetCode = "ALA"; - } + public Swamp3(UUID ownerId) { + super(ownerId, 240); + this.expansionSetCode = "ALA"; + } - public Swamp3(final Swamp3 card) { - super(card); - } + public Swamp3(final Swamp3 card) { + super(card); + } - @Override - public Swamp3 copy() { - return new Swamp3(this); - } + @Override + public Swamp3 copy() { + return new Swamp3(this); + } } \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/shardsofalara/Swamp4.java b/Mage.Sets/src/mage/sets/shardsofalara/Swamp4.java index 459c9c1d85..08c2d2e997 100644 --- a/Mage.Sets/src/mage/sets/shardsofalara/Swamp4.java +++ b/Mage.Sets/src/mage/sets/shardsofalara/Swamp4.java @@ -36,18 +36,18 @@ import java.util.UUID; */ public class Swamp4 extends mage.cards.basiclands.Swamp { - public Swamp4(UUID ownerId) { - super(ownerId, 241); - this.expansionSetCode = "ALA"; - } + public Swamp4(UUID ownerId) { + super(ownerId, 241); + this.expansionSetCode = "ALA"; + } - public Swamp4(final Swamp4 card) { - super(card); - } + public Swamp4(final Swamp4 card) { + super(card); + } - @Override - public Swamp4 copy() { - return new Swamp4(this); - } + @Override + public Swamp4 copy() { + return new Swamp4(this); + } } diff --git a/Mage.Sets/src/mage/sets/shardsofalara/ViolentUltimatum.java b/Mage.Sets/src/mage/sets/shardsofalara/ViolentUltimatum.java index 89b66a621a..a12e03f041 100644 --- a/Mage.Sets/src/mage/sets/shardsofalara/ViolentUltimatum.java +++ b/Mage.Sets/src/mage/sets/shardsofalara/ViolentUltimatum.java @@ -45,9 +45,9 @@ public class ViolentUltimatum extends CardImpl { public ViolentUltimatum (UUID ownerId) { super(ownerId, 206, "Violent Ultimatum", Rarity.RARE, new CardType[]{CardType.SORCERY}, "{B}{B}{R}{R}{R}{G}{G}"); this.expansionSetCode = "ALA"; - this.color.setBlack(true); - this.color.setRed(true); - this.color.setGreen(true); + this.color.setBlack(true); + this.color.setRed(true); + this.color.setGreen(true); this.getSpellAbility().addEffect(new DestroyTargetEffect()); this.getSpellAbility().addTarget(new TargetPermanent(3, 3, new FilterPermanent(), false)); } diff --git a/Mage.Sets/src/mage/sets/shardsofalara/WaveskimmerAven.java b/Mage.Sets/src/mage/sets/shardsofalara/WaveskimmerAven.java index 96a435ef71..098b014721 100644 --- a/Mage.Sets/src/mage/sets/shardsofalara/WaveskimmerAven.java +++ b/Mage.Sets/src/mage/sets/shardsofalara/WaveskimmerAven.java @@ -47,9 +47,9 @@ public class WaveskimmerAven extends CardImpl { this.expansionSetCode = "ALA"; this.subtype.add("Bird"); this.subtype.add("Soldier"); - this.color.setGreen(true); - this.color.setWhite(true); - this.color.setBlue(true); + this.color.setGreen(true); + this.color.setWhite(true); + this.color.setBlue(true); this.power = new MageInt(2 ); this.toughness = new MageInt(4); this.addAbility(FlyingAbility.getInstance()); diff --git a/Mage.Sets/src/mage/sets/shardsofalara/WildNacatl.java b/Mage.Sets/src/mage/sets/shardsofalara/WildNacatl.java index 59cdb4c790..84c1483b6f 100644 --- a/Mage.Sets/src/mage/sets/shardsofalara/WildNacatl.java +++ b/Mage.Sets/src/mage/sets/shardsofalara/WildNacatl.java @@ -45,34 +45,34 @@ import mage.filter.FilterPermanent; */ public class WildNacatl extends CardImpl { - private static final FilterPermanent filter1 = new FilterPermanent("Mountain"); - private static final FilterPermanent filter2 = new FilterPermanent("Plains"); + private static final FilterPermanent filter1 = new FilterPermanent("Mountain"); + private static final FilterPermanent filter2 = new FilterPermanent("Plains"); - static { - filter1.getSubtype().add("Mountain"); - filter1.setScopeSubtype(ComparisonScope.Any); - filter2.getSubtype().add("Plains"); - filter2.setScopeSubtype(ComparisonScope.Any); - } + static { + filter1.getSubtype().add("Mountain"); + filter1.setScopeSubtype(ComparisonScope.Any); + filter2.getSubtype().add("Plains"); + filter2.setScopeSubtype(ComparisonScope.Any); + } - public WildNacatl(UUID ownerId) { - super(ownerId, 152, "Wild Nacatl", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{G}"); - this.expansionSetCode = "ALA"; - this.color.setGreen(true); - this.subtype.add("Cat"); - this.subtype.add("Warrior"); - this.power = new MageInt(1); - this.toughness = new MageInt(1); - this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostSourceWhileControlsEffect(filter1, 1, 1))); - this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostSourceWhileControlsEffect(filter2, 1, 1))); - } + public WildNacatl(UUID ownerId) { + super(ownerId, 152, "Wild Nacatl", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{G}"); + this.expansionSetCode = "ALA"; + this.color.setGreen(true); + this.subtype.add("Cat"); + this.subtype.add("Warrior"); + this.power = new MageInt(1); + this.toughness = new MageInt(1); + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostSourceWhileControlsEffect(filter1, 1, 1))); + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostSourceWhileControlsEffect(filter2, 1, 1))); + } - public WildNacatl(final WildNacatl card) { - super(card); - } + public WildNacatl(final WildNacatl card) { + super(card); + } - @Override - public WildNacatl copy() { - return new WildNacatl(this); - } + @Override + public WildNacatl copy() { + return new WildNacatl(this); + } } diff --git a/Mage.Sets/src/mage/sets/shardsofalara/WoollyThoctar.java b/Mage.Sets/src/mage/sets/shardsofalara/WoollyThoctar.java index 8d4943510c..417a1f2672 100644 --- a/Mage.Sets/src/mage/sets/shardsofalara/WoollyThoctar.java +++ b/Mage.Sets/src/mage/sets/shardsofalara/WoollyThoctar.java @@ -40,24 +40,24 @@ import mage.cards.CardImpl; */ public class WoollyThoctar extends CardImpl { - public WoollyThoctar(UUID ownerId) { - super(ownerId, 209, "Woolly Thoctar", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{R}{G}{W}"); - this.expansionSetCode = "ALA"; - this.color.setRed(true); - this.color.setGreen(true); - this.color.setWhite(true); - this.subtype.add("Beast"); - this.power = new MageInt(5); - this.toughness = new MageInt(4); - } + public WoollyThoctar(UUID ownerId) { + super(ownerId, 209, "Woolly Thoctar", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{R}{G}{W}"); + this.expansionSetCode = "ALA"; + this.color.setRed(true); + this.color.setGreen(true); + this.color.setWhite(true); + this.subtype.add("Beast"); + this.power = new MageInt(5); + this.toughness = new MageInt(4); + } - public WoollyThoctar(final WoollyThoctar card) { - super(card); - } + public WoollyThoctar(final WoollyThoctar card) { + super(card); + } - @Override - public WoollyThoctar copy() { - return new WoollyThoctar(this); - } + @Override + public WoollyThoctar copy() { + return new WoollyThoctar(this); + } } diff --git a/Mage.Sets/src/mage/sets/tempest/CrownOfFlames.java b/Mage.Sets/src/mage/sets/tempest/CrownOfFlames.java index 7781a4c761..fb3a58a9c9 100644 --- a/Mage.Sets/src/mage/sets/tempest/CrownOfFlames.java +++ b/Mage.Sets/src/mage/sets/tempest/CrownOfFlames.java @@ -55,10 +55,10 @@ public class CrownOfFlames extends CardImpl { this.subtype.add("Aura"); this.color.setRed(true); TargetPermanent auraTarget = new TargetCreaturePermanent(); - this.getSpellAbility().addTarget(auraTarget); - this.getSpellAbility().addEffect(new AttachEffect(Constants.Outcome.AddAbility)); - Ability ability = new EnchantAbility(auraTarget.getTargetName()); - this.addAbility(ability); + this.getSpellAbility().addTarget(auraTarget); + this.getSpellAbility().addEffect(new AttachEffect(Constants.Outcome.AddAbility)); + Ability ability = new EnchantAbility(auraTarget.getTargetName()); + this.addAbility(ability); this.addAbility(new SimpleActivatedAbility(Constants.Zone.BATTLEFIELD, new BoostEnchantedEffect(1, 0, Constants.Duration.EndOfTurn), new ColoredManaCost(Constants.ColoredManaSymbol.R))); this.addAbility(new SimpleActivatedAbility(Constants.Zone.BATTLEFIELD, new ReturnToHandSourceEffect(), new ColoredManaCost(Constants.ColoredManaSymbol.R))); } diff --git a/Mage.Sets/src/mage/sets/tempest/HerosResolve.java b/Mage.Sets/src/mage/sets/tempest/HerosResolve.java index e5306622bf..eae8659f76 100644 --- a/Mage.Sets/src/mage/sets/tempest/HerosResolve.java +++ b/Mage.Sets/src/mage/sets/tempest/HerosResolve.java @@ -53,11 +53,11 @@ public class HerosResolve extends CardImpl { this.subtype.add("Aura"); this.color.setWhite(true); TargetPermanent auraTarget = new TargetCreaturePermanent(); - this.getSpellAbility().addTarget(auraTarget); - this.getSpellAbility().addEffect(new AttachEffect(Constants.Outcome.BoostCreature)); - Ability ability = new EnchantAbility(auraTarget.getTargetName()); - this.addAbility(ability); - this.addAbility(new SimpleStaticAbility(Constants.Zone.BATTLEFIELD, new BoostEnchantedEffect(1, 5, Constants.Duration.WhileOnBattlefield))); + this.getSpellAbility().addTarget(auraTarget); + this.getSpellAbility().addEffect(new AttachEffect(Constants.Outcome.BoostCreature)); + Ability ability = new EnchantAbility(auraTarget.getTargetName()); + this.addAbility(ability); + this.addAbility(new SimpleStaticAbility(Constants.Zone.BATTLEFIELD, new BoostEnchantedEffect(1, 5, Constants.Duration.WhileOnBattlefield))); } public HerosResolve(final HerosResolve card) { diff --git a/Mage.Sets/src/mage/sets/tempest/Opportunist.java b/Mage.Sets/src/mage/sets/tempest/Opportunist.java index c414c33c3e..2b33308bc0 100644 --- a/Mage.Sets/src/mage/sets/tempest/Opportunist.java +++ b/Mage.Sets/src/mage/sets/tempest/Opportunist.java @@ -62,7 +62,7 @@ public class Opportunist extends CardImpl { this.color.setRed(true); this.power = new MageInt(2); this.toughness = new MageInt(2); - + // {T}: Opportunist deals 1 damage to target creature that was dealt damage this turn. Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DamageTargetEffect(1), new TapSourceCost()); ability.addTarget(new TargetCreaturePermanent(filter)); diff --git a/Mage.Sets/src/mage/sets/tempest/Propaganda.java b/Mage.Sets/src/mage/sets/tempest/Propaganda.java index 089106e161..bb25d89494 100644 --- a/Mage.Sets/src/mage/sets/tempest/Propaganda.java +++ b/Mage.Sets/src/mage/sets/tempest/Propaganda.java @@ -51,7 +51,7 @@ public class Propaganda extends CardImpl { public Propaganda (UUID ownerId) { super(ownerId, 80, "Propaganda", Rarity.UNCOMMON, new CardType[]{CardType.ENCHANTMENT}, "{2}{U}"); this.expansionSetCode = "TMP"; - this.color.setBlue(true); + this.color.setBlue(true); this.addAbility(new SimpleStaticAbility(Constants.Zone.BATTLEFIELD, new PropagandaReplacementEffect())); } @@ -67,53 +67,53 @@ public class Propaganda extends CardImpl { class PropagandaReplacementEffect extends ReplacementEffectImpl { - private static final String effectText = "Creatures can't attack you unless their controller pays {2} for each creature he or she controls that's attacking you"; + private static final String effectText = "Creatures can't attack you unless their controller pays {2} for each creature he or she controls that's attacking you"; - PropagandaReplacementEffect ( ) { - super(Constants.Duration.WhileOnBattlefield, Constants.Outcome.Neutral); - staticText = effectText; - } + PropagandaReplacementEffect ( ) { + super(Constants.Duration.WhileOnBattlefield, Constants.Outcome.Neutral); + staticText = effectText; + } - PropagandaReplacementEffect ( PropagandaReplacementEffect effect ) { - super(effect); - } + PropagandaReplacementEffect ( PropagandaReplacementEffect effect ) { + super(effect); + } - @Override - public boolean apply(Game game, Ability source) { - throw new UnsupportedOperationException("Not supported."); - } + @Override + public boolean apply(Game game, Ability source) { + throw new UnsupportedOperationException("Not supported."); + } - @Override - public boolean replaceEvent(GameEvent event, Ability source, Game game) { - if ( event.getType() == GameEvent.EventType.DECLARE_ATTACKER) { - Player player = game.getPlayer(event.getPlayerId()); + @Override + public boolean replaceEvent(GameEvent event, Ability source, Game game) { + if ( event.getType() == GameEvent.EventType.DECLARE_ATTACKER) { + Player player = game.getPlayer(event.getPlayerId()); - if ( player != null ) { - ManaCostsImpl propagandaTax = new ManaCostsImpl("{2}"); - if ( propagandaTax.canPay(source.getSourceId(), event.getPlayerId(), game) && - player.chooseUse(Constants.Outcome.Neutral, "Pay {2} to declare attacker?", game) ) - { - if (propagandaTax.payOrRollback(source, game, this.getId(), event.getPlayerId()) ) { - return false; - } - } - } - return true; - } - return false; - } + if ( player != null ) { + ManaCostsImpl propagandaTax = new ManaCostsImpl("{2}"); + if ( propagandaTax.canPay(source.getSourceId(), event.getPlayerId(), game) && + player.chooseUse(Constants.Outcome.Neutral, "Pay {2} to declare attacker?", game) ) + { + if (propagandaTax.payOrRollback(source, game, this.getId(), event.getPlayerId()) ) { + return false; + } + } + } + return true; + } + return false; + } - @Override - public boolean applies(GameEvent event, Ability source, Game game) { - if ( event.getType() == GameEvent.EventType.DECLARE_ATTACKER ) { - return true; - } - return false; - } + @Override + public boolean applies(GameEvent event, Ability source, Game game) { + if ( event.getType() == GameEvent.EventType.DECLARE_ATTACKER ) { + return true; + } + return false; + } - @Override - public PropagandaReplacementEffect copy() { - return new PropagandaReplacementEffect(this); - } + @Override + public PropagandaReplacementEffect copy() { + return new PropagandaReplacementEffect(this); + } } diff --git a/Mage.Sets/src/mage/sets/tempest/ShimmeringWings.java b/Mage.Sets/src/mage/sets/tempest/ShimmeringWings.java index 1709127552..51c6356a6a 100644 --- a/Mage.Sets/src/mage/sets/tempest/ShimmeringWings.java +++ b/Mage.Sets/src/mage/sets/tempest/ShimmeringWings.java @@ -57,11 +57,11 @@ public class ShimmeringWings extends CardImpl { this.subtype.add("Aura"); this.color.setBlue(true); TargetPermanent auraTarget = new TargetCreaturePermanent(); - this.getSpellAbility().addTarget(auraTarget); - this.getSpellAbility().addEffect(new AttachEffect(Constants.Outcome.BoostCreature)); - Ability ability = new EnchantAbility(auraTarget.getTargetName()); - this.addAbility(ability); - this.addAbility(new SimpleStaticAbility(Constants.Zone.BATTLEFIELD, new GainAbilityAttachedEffect(FlyingAbility.getInstance(), Constants.AttachmentType.AURA))); + this.getSpellAbility().addTarget(auraTarget); + this.getSpellAbility().addEffect(new AttachEffect(Constants.Outcome.BoostCreature)); + Ability ability = new EnchantAbility(auraTarget.getTargetName()); + this.addAbility(ability); + this.addAbility(new SimpleStaticAbility(Constants.Zone.BATTLEFIELD, new GainAbilityAttachedEffect(FlyingAbility.getInstance(), Constants.AttachmentType.AURA))); this.addAbility(new SimpleActivatedAbility(Constants.Zone.BATTLEFIELD, new ReturnToHandSourceEffect(), new ColoredManaCost(Constants.ColoredManaSymbol.U))); } diff --git a/Mage.Sets/src/mage/sets/tempest/StalkingStones.java b/Mage.Sets/src/mage/sets/tempest/StalkingStones.java index 2804481071..e7d5c53fa2 100644 --- a/Mage.Sets/src/mage/sets/tempest/StalkingStones.java +++ b/Mage.Sets/src/mage/sets/tempest/StalkingStones.java @@ -66,12 +66,12 @@ public class StalkingStones extends CardImpl { class StalkingStonesToken extends Token { - public StalkingStonesToken() { - super("Elemental", "3/3 Elemental artifact"); - this.cardType.add(CardType.CREATURE); - this.cardType.add(CardType.ARTIFACT); + public StalkingStonesToken() { + super("Elemental", "3/3 Elemental artifact"); + this.cardType.add(CardType.CREATURE); + this.cardType.add(CardType.ARTIFACT); - this.power = new MageInt(3); - this.toughness = new MageInt(3); - } + this.power = new MageInt(3); + this.toughness = new MageInt(3); + } } diff --git a/Mage.Sets/src/mage/sets/tenth/AngelsFeather.java b/Mage.Sets/src/mage/sets/tenth/AngelsFeather.java index 6762fdfc08..b9144735fb 100644 --- a/Mage.Sets/src/mage/sets/tenth/AngelsFeather.java +++ b/Mage.Sets/src/mage/sets/tenth/AngelsFeather.java @@ -46,52 +46,52 @@ import mage.game.stack.Spell; */ public class AngelsFeather extends CardImpl { - public AngelsFeather(UUID ownerId) { - super(ownerId, 311, "Angel's Feather", Rarity.UNCOMMON, new CardType[]{CardType.ARTIFACT}, "{2}"); - this.expansionSetCode = "10E"; - this.addAbility(new AngelsFeatherAbility()); - } + public AngelsFeather(UUID ownerId) { + super(ownerId, 311, "Angel's Feather", Rarity.UNCOMMON, new CardType[]{CardType.ARTIFACT}, "{2}"); + this.expansionSetCode = "10E"; + this.addAbility(new AngelsFeatherAbility()); + } - public AngelsFeather(final AngelsFeather card) { - super(card); - } + public AngelsFeather(final AngelsFeather card) { + super(card); + } - @Override - public AngelsFeather copy() { - return new AngelsFeather(this); - } + @Override + public AngelsFeather copy() { + return new AngelsFeather(this); + } } class AngelsFeatherAbility extends TriggeredAbilityImpl { - public AngelsFeatherAbility() { - super(Zone.BATTLEFIELD, new GainLifeEffect(1), true); - } + public AngelsFeatherAbility() { + super(Zone.BATTLEFIELD, new GainLifeEffect(1), true); + } - public AngelsFeatherAbility(final AngelsFeatherAbility ability) { - super(ability); - } + public AngelsFeatherAbility(final AngelsFeatherAbility ability) { + super(ability); + } - @Override - public AngelsFeatherAbility copy() { - return new AngelsFeatherAbility(this); - } + @Override + public AngelsFeatherAbility copy() { + return new AngelsFeatherAbility(this); + } - @Override - public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == EventType.SPELL_CAST) { - Spell spell = game.getStack().getSpell(event.getTargetId()); - if (spell != null && spell.getColor().isWhite()) { - return true; - } - } - return false; - } + @Override + public boolean checkTrigger(GameEvent event, Game game) { + if (event.getType() == EventType.SPELL_CAST) { + Spell spell = game.getStack().getSpell(event.getTargetId()); + if (spell != null && spell.getColor().isWhite()) { + return true; + } + } + return false; + } - @Override - public String getRule() { - return "Whenever a player casts a white spell, you may gain 1 life."; - } + @Override + public String getRule() { + return "Whenever a player casts a white spell, you may gain 1 life."; + } } diff --git a/Mage.Sets/src/mage/sets/tenth/ArcaneTeachings.java b/Mage.Sets/src/mage/sets/tenth/ArcaneTeachings.java index 32d25038ca..be14f85cec 100644 --- a/Mage.Sets/src/mage/sets/tenth/ArcaneTeachings.java +++ b/Mage.Sets/src/mage/sets/tenth/ArcaneTeachings.java @@ -58,11 +58,11 @@ public class ArcaneTeachings extends CardImpl { this.subtype.add("Aura"); this.color.setRed(true); TargetPermanent auraTarget = new TargetCreaturePermanent(); - this.getSpellAbility().addTarget(auraTarget); - this.getSpellAbility().addEffect(new AttachEffect(Constants.Outcome.BoostCreature)); - Ability ability = new EnchantAbility(auraTarget.getTargetName()); - this.addAbility(ability); - this.addAbility(new SimpleStaticAbility(Constants.Zone.BATTLEFIELD, new BoostEnchantedEffect(2, 2, Constants.Duration.WhileOnBattlefield))); + this.getSpellAbility().addTarget(auraTarget); + this.getSpellAbility().addEffect(new AttachEffect(Constants.Outcome.BoostCreature)); + Ability ability = new EnchantAbility(auraTarget.getTargetName()); + this.addAbility(ability); + this.addAbility(new SimpleStaticAbility(Constants.Zone.BATTLEFIELD, new BoostEnchantedEffect(2, 2, Constants.Duration.WhileOnBattlefield))); Ability gainedAbility = new SimpleActivatedAbility(Constants.Zone.BATTLEFIELD, new DamageTargetEffect(1), new TapSourceCost()); gainedAbility.addTarget(new TargetCreatureOrPlayer()); this.addAbility(new SimpleStaticAbility(Constants.Zone.BATTLEFIELD, new GainAbilityAttachedEffect(gainedAbility, Constants.AttachmentType.AURA))); diff --git a/Mage.Sets/src/mage/sets/tenth/Assassinate.java b/Mage.Sets/src/mage/sets/tenth/Assassinate.java index 9c1c21211e..06332c98ba 100644 --- a/Mage.Sets/src/mage/sets/tenth/Assassinate.java +++ b/Mage.Sets/src/mage/sets/tenth/Assassinate.java @@ -42,29 +42,29 @@ import mage.target.common.TargetCreaturePermanent; */ public class Assassinate extends CardImpl { - private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("tapped creature"); + private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("tapped creature"); - static { - filter.setTapped(true); - filter.setUseTapped(true); - } + static { + filter.setTapped(true); + filter.setUseTapped(true); + } - public Assassinate(UUID ownerId) { - super(ownerId, 128, "Assassinate", Rarity.COMMON, new CardType[]{CardType.SORCERY}, "{2}{B}"); - this.expansionSetCode = "10E"; - this.color.setBlack(true); - this.getSpellAbility().addTarget(new TargetCreaturePermanent(filter)); - this.getSpellAbility().addEffect(new DestroyTargetEffect()); + public Assassinate(UUID ownerId) { + super(ownerId, 128, "Assassinate", Rarity.COMMON, new CardType[]{CardType.SORCERY}, "{2}{B}"); + this.expansionSetCode = "10E"; + this.color.setBlack(true); + this.getSpellAbility().addTarget(new TargetCreaturePermanent(filter)); + this.getSpellAbility().addEffect(new DestroyTargetEffect()); - } + } - public Assassinate(final Assassinate card) { - super(card); - } + public Assassinate(final Assassinate card) { + super(card); + } - @Override - public Assassinate copy() { - return new Assassinate(this); - } + @Override + public Assassinate copy() { + return new Assassinate(this); + } } diff --git a/Mage.Sets/src/mage/sets/tenth/BirdsOfParadise.java b/Mage.Sets/src/mage/sets/tenth/BirdsOfParadise.java index a985e2b039..d2530c28e6 100644 --- a/Mage.Sets/src/mage/sets/tenth/BirdsOfParadise.java +++ b/Mage.Sets/src/mage/sets/tenth/BirdsOfParadise.java @@ -42,26 +42,26 @@ import mage.cards.CardImpl; */ public class BirdsOfParadise extends CardImpl { - public BirdsOfParadise(UUID ownerId) { - super(ownerId, 252, "Birds of Paradise", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{G}"); - this.expansionSetCode = "10E"; - this.subtype.add("Bird"); + public BirdsOfParadise(UUID ownerId) { + super(ownerId, 252, "Birds of Paradise", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{G}"); + this.expansionSetCode = "10E"; + this.subtype.add("Bird"); - this.color.setGreen(true); - this.power = new MageInt(0); - this.toughness = new MageInt(1); + this.color.setGreen(true); + this.power = new MageInt(0); + this.toughness = new MageInt(1); - this.addAbility(FlyingAbility.getInstance()); + this.addAbility(FlyingAbility.getInstance()); this.addAbility(new AnyColorManaAbility()); - } + } - public BirdsOfParadise(final BirdsOfParadise card) { - super(card); - } + public BirdsOfParadise(final BirdsOfParadise card) { + super(card); + } - @Override - public BirdsOfParadise copy() { - return new BirdsOfParadise(this); - } + @Override + public BirdsOfParadise copy() { + return new BirdsOfParadise(this); + } } diff --git a/Mage.Sets/src/mage/sets/tenth/BlanchwoodArmor.java b/Mage.Sets/src/mage/sets/tenth/BlanchwoodArmor.java index 00d75cc311..2ffd677e2a 100644 --- a/Mage.Sets/src/mage/sets/tenth/BlanchwoodArmor.java +++ b/Mage.Sets/src/mage/sets/tenth/BlanchwoodArmor.java @@ -61,11 +61,11 @@ public class BlanchwoodArmor extends CardImpl { this.subtype.add("Aura"); this.color.setGreen(true); TargetPermanent auraTarget = new TargetCreaturePermanent(); - this.getSpellAbility().addTarget(auraTarget); - this.getSpellAbility().addEffect(new AttachEffect(Constants.Outcome.BoostCreature)); - Ability ability = new EnchantAbility(auraTarget.getTargetName()); - this.addAbility(ability); - this.addAbility(new SimpleStaticAbility(Constants.Zone.BATTLEFIELD, new BoostEnchantedEffect(new PermanentsOnBattlefieldCount(filter), new PermanentsOnBattlefieldCount(filter), Constants.Duration.WhileOnBattlefield))); + this.getSpellAbility().addTarget(auraTarget); + this.getSpellAbility().addEffect(new AttachEffect(Constants.Outcome.BoostCreature)); + Ability ability = new EnchantAbility(auraTarget.getTargetName()); + this.addAbility(ability); + this.addAbility(new SimpleStaticAbility(Constants.Zone.BATTLEFIELD, new BoostEnchantedEffect(new PermanentsOnBattlefieldCount(filter), new PermanentsOnBattlefieldCount(filter), Constants.Duration.WhileOnBattlefield))); } public BlanchwoodArmor(final BlanchwoodArmor card) { diff --git a/Mage.Sets/src/mage/sets/tenth/Cancel.java b/Mage.Sets/src/mage/sets/tenth/Cancel.java index 26a8361196..07d07c2e0b 100644 --- a/Mage.Sets/src/mage/sets/tenth/Cancel.java +++ b/Mage.Sets/src/mage/sets/tenth/Cancel.java @@ -41,21 +41,21 @@ import mage.target.TargetSpell; */ public class Cancel extends CardImpl { - public Cancel(UUID ownerId) { - super(ownerId, 71, "Cancel", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{1}{U}{U}"); - this.expansionSetCode = "10E"; - this.color.setBlue(true); - this.getSpellAbility().addTarget(new TargetSpell()); - this.getSpellAbility().addEffect(new CounterTargetEffect()); - } + public Cancel(UUID ownerId) { + super(ownerId, 71, "Cancel", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{1}{U}{U}"); + this.expansionSetCode = "10E"; + this.color.setBlue(true); + this.getSpellAbility().addTarget(new TargetSpell()); + this.getSpellAbility().addEffect(new CounterTargetEffect()); + } - public Cancel(final Cancel card) { - super(card); - } + public Cancel(final Cancel card) { + super(card); + } - @Override - public Cancel copy() { - return new Cancel(this); - } + @Override + public Cancel copy() { + return new Cancel(this); + } } diff --git a/Mage.Sets/src/mage/sets/tenth/Clone.java b/Mage.Sets/src/mage/sets/tenth/Clone.java index 3718225a8d..f88dfc2b40 100644 --- a/Mage.Sets/src/mage/sets/tenth/Clone.java +++ b/Mage.Sets/src/mage/sets/tenth/Clone.java @@ -44,25 +44,25 @@ import mage.cards.CardImpl; */ public class Clone extends CardImpl { - public Clone(UUID ownerId) { - super(ownerId, 73, "Clone", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{3}{U}"); - this.expansionSetCode = "10E"; - this.color.setBlue(true); - this.subtype.add("Shapeshifter"); - this.power = new MageInt(0); - this.toughness = new MageInt(0); + public Clone(UUID ownerId) { + super(ownerId, 73, "Clone", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{3}{U}"); + this.expansionSetCode = "10E"; + this.color.setBlue(true); + this.subtype.add("Shapeshifter"); + this.power = new MageInt(0); + this.toughness = new MageInt(0); - Ability ability = new EntersBattlefieldAbility(new EntersBattlefieldEffect(new CopyPermanentEffect()), "You may have {this} enter the battlefield as a copy of any creature on the battlefield"); - this.addAbility(ability); - } + Ability ability = new EntersBattlefieldAbility(new EntersBattlefieldEffect(new CopyPermanentEffect()), "You may have {this} enter the battlefield as a copy of any creature on the battlefield"); + this.addAbility(ability); + } - public Clone(final Clone card) { - super(card); - } + public Clone(final Clone card) { + super(card); + } - @Override - public Clone copy() { - return new Clone(this); - } + @Override + public Clone copy() { + return new Clone(this); + } } diff --git a/Mage.Sets/src/mage/sets/tenth/CloudElemental.java b/Mage.Sets/src/mage/sets/tenth/CloudElemental.java index c9402b769b..2229777e05 100644 --- a/Mage.Sets/src/mage/sets/tenth/CloudElemental.java +++ b/Mage.Sets/src/mage/sets/tenth/CloudElemental.java @@ -47,7 +47,7 @@ public class CloudElemental extends CardImpl { super(ownerId, 74, "Cloud Elemental", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{2}{U}"); this.expansionSetCode = "10E"; this.subtype.add("Elemental"); - + this.color.setBlue(true); this.power = new MageInt(2); this.toughness = new MageInt(3); diff --git a/Mage.Sets/src/mage/sets/tenth/Condemn.java b/Mage.Sets/src/mage/sets/tenth/Condemn.java index 8ca5e99a78..3910c0c39f 100644 --- a/Mage.Sets/src/mage/sets/tenth/Condemn.java +++ b/Mage.Sets/src/mage/sets/tenth/Condemn.java @@ -49,55 +49,55 @@ import mage.target.common.TargetAttackingCreature; */ public class Condemn extends CardImpl { - public Condemn(UUID ownerId) { - super(ownerId, 13, "Condemn", Rarity.UNCOMMON, new CardType[]{CardType.INSTANT}, "{W}"); - this.expansionSetCode = "10E"; - this.color.setWhite(true); + public Condemn(UUID ownerId) { + super(ownerId, 13, "Condemn", Rarity.UNCOMMON, new CardType[]{CardType.INSTANT}, "{W}"); + this.expansionSetCode = "10E"; + this.color.setWhite(true); // Put target attacking creature on the bottom of its owner's library. - this.getSpellAbility().addTarget(new TargetAttackingCreature()); - this.getSpellAbility().addEffect(new PutOnLibraryTargetEffect(false)); + this.getSpellAbility().addTarget(new TargetAttackingCreature()); + this.getSpellAbility().addEffect(new PutOnLibraryTargetEffect(false)); // Its controller gains life equal to its toughness. - this.getSpellAbility().addEffect(new CondemnEffect()); + this.getSpellAbility().addEffect(new CondemnEffect()); - } + } - public Condemn(final Condemn card) { - super(card); - } + public Condemn(final Condemn card) { + super(card); + } - @Override - public Condemn copy() { - return new Condemn(this); - } + @Override + public Condemn copy() { + return new Condemn(this); + } } class CondemnEffect extends OneShotEffect { - public CondemnEffect() { - super(Outcome.GainLife); - staticText = "Its controller gains life equal to its toughness"; - } + public CondemnEffect() { + super(Outcome.GainLife); + staticText = "Its controller gains life equal to its toughness"; + } - public CondemnEffect(final CondemnEffect effect) { - super(effect); - } + public CondemnEffect(final CondemnEffect effect) { + super(effect); + } - @Override - public CondemnEffect copy() { - return new CondemnEffect(this); - } + @Override + public CondemnEffect copy() { + return new CondemnEffect(this); + } - @Override - public boolean apply(Game game, Ability source) { - Permanent permanent = (Permanent)game.getLastKnownInformation(source.getFirstTarget(), Constants.Zone.BATTLEFIELD); - if (permanent != null) { - Player player = game.getPlayer(permanent.getControllerId()); - if (player != null) { - player.gainLife(permanent.getToughness().getValue(), game); - } - } - return false; - } + @Override + public boolean apply(Game game, Ability source) { + Permanent permanent = (Permanent)game.getLastKnownInformation(source.getFirstTarget(), Constants.Zone.BATTLEFIELD); + if (permanent != null) { + Player player = game.getPlayer(permanent.getControllerId()); + if (player != null) { + player.gainLife(permanent.getToughness().getValue(), game); + } + } + return false; + } } diff --git a/Mage.Sets/src/mage/sets/tenth/Deathmark.java b/Mage.Sets/src/mage/sets/tenth/Deathmark.java index c4453c6599..e842f51a38 100644 --- a/Mage.Sets/src/mage/sets/tenth/Deathmark.java +++ b/Mage.Sets/src/mage/sets/tenth/Deathmark.java @@ -43,30 +43,30 @@ import mage.target.common.TargetCreaturePermanent; */ public class Deathmark extends CardImpl { - private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("green or white creature"); + private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("green or white creature"); - static { - filter.getColor().setGreen(true); - filter.getColor().setWhite(true); - filter.setUseColor(true); - filter.setScopeColor(Filter.ComparisonScope.Any); - } + static { + filter.getColor().setGreen(true); + filter.getColor().setWhite(true); + filter.setUseColor(true); + filter.setScopeColor(Filter.ComparisonScope.Any); + } - public Deathmark(UUID ownerId) { - super(ownerId, 134, "Deathmark", Rarity.UNCOMMON, new CardType[]{CardType.SORCERY}, "{B}"); - this.expansionSetCode = "10E"; - this.color.setBlack(true); - this.getSpellAbility().addTarget(new TargetCreaturePermanent(filter)); - this.getSpellAbility().addEffect(new DestroyTargetEffect()); - } + public Deathmark(UUID ownerId) { + super(ownerId, 134, "Deathmark", Rarity.UNCOMMON, new CardType[]{CardType.SORCERY}, "{B}"); + this.expansionSetCode = "10E"; + this.color.setBlack(true); + this.getSpellAbility().addTarget(new TargetCreaturePermanent(filter)); + this.getSpellAbility().addEffect(new DestroyTargetEffect()); + } - public Deathmark(final Deathmark card) { - super(card); - } + public Deathmark(final Deathmark card) { + super(card); + } - @Override - public Deathmark copy() { - return new Deathmark(this); - } + @Override + public Deathmark copy() { + return new Deathmark(this); + } } diff --git a/Mage.Sets/src/mage/sets/tenth/Demolish.java b/Mage.Sets/src/mage/sets/tenth/Demolish.java index 57b187455e..70ea584c1c 100644 --- a/Mage.Sets/src/mage/sets/tenth/Demolish.java +++ b/Mage.Sets/src/mage/sets/tenth/Demolish.java @@ -43,29 +43,29 @@ import mage.target.TargetPermanent; */ public class Demolish extends CardImpl { - private static final FilterPermanent filter = new FilterPermanent("artifact or land"); + private static final FilterPermanent filter = new FilterPermanent("artifact or land"); - static { - filter.getCardType().add(CardType.ARTIFACT); - filter.getCardType().add(CardType.LAND); - filter.setScopeCardType(ComparisonScope.Any); - } + static { + filter.getCardType().add(CardType.ARTIFACT); + filter.getCardType().add(CardType.LAND); + filter.setScopeCardType(ComparisonScope.Any); + } - public Demolish(UUID ownerId) { - super(ownerId, 196, "Demolish", Rarity.COMMON, new CardType[]{CardType.SORCERY}, "{3}{R}"); - this.expansionSetCode = "10E"; - this.color.setRed(true); - this.getSpellAbility().addTarget(new TargetPermanent(filter)); - this.getSpellAbility().addEffect(new DestroyTargetEffect()); - } + public Demolish(UUID ownerId) { + super(ownerId, 196, "Demolish", Rarity.COMMON, new CardType[]{CardType.SORCERY}, "{3}{R}"); + this.expansionSetCode = "10E"; + this.color.setRed(true); + this.getSpellAbility().addTarget(new TargetPermanent(filter)); + this.getSpellAbility().addEffect(new DestroyTargetEffect()); + } - public Demolish(final Demolish card) { - super(card); - } + public Demolish(final Demolish card) { + super(card); + } - @Override - public Demolish copy() { - return new Demolish(this); - } + @Override + public Demolish copy() { + return new Demolish(this); + } } diff --git a/Mage.Sets/src/mage/sets/tenth/DemonsHorn.java b/Mage.Sets/src/mage/sets/tenth/DemonsHorn.java index a001641e6a..070134b9cd 100644 --- a/Mage.Sets/src/mage/sets/tenth/DemonsHorn.java +++ b/Mage.Sets/src/mage/sets/tenth/DemonsHorn.java @@ -46,52 +46,52 @@ import mage.game.stack.Spell; */ public class DemonsHorn extends CardImpl { - public DemonsHorn(UUID ownerId) { - super(ownerId, 320, "Demon's Horn", Rarity.UNCOMMON, new CardType[]{CardType.ARTIFACT}, "{2}"); - this.expansionSetCode = "10E"; - this.addAbility(new DemonsHornAbility()); - } + public DemonsHorn(UUID ownerId) { + super(ownerId, 320, "Demon's Horn", Rarity.UNCOMMON, new CardType[]{CardType.ARTIFACT}, "{2}"); + this.expansionSetCode = "10E"; + this.addAbility(new DemonsHornAbility()); + } - public DemonsHorn(final DemonsHorn card) { - super(card); - } + public DemonsHorn(final DemonsHorn card) { + super(card); + } - @Override - public DemonsHorn copy() { - return new DemonsHorn(this); - } + @Override + public DemonsHorn copy() { + return new DemonsHorn(this); + } } class DemonsHornAbility extends TriggeredAbilityImpl { - public DemonsHornAbility() { - super(Zone.BATTLEFIELD, new GainLifeEffect(1), true); - } + public DemonsHornAbility() { + super(Zone.BATTLEFIELD, new GainLifeEffect(1), true); + } - public DemonsHornAbility(final DemonsHornAbility ability) { - super(ability); - } + public DemonsHornAbility(final DemonsHornAbility ability) { + super(ability); + } - @Override - public DemonsHornAbility copy() { - return new DemonsHornAbility(this); - } + @Override + public DemonsHornAbility copy() { + return new DemonsHornAbility(this); + } - @Override - public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == EventType.SPELL_CAST) { - Spell spell = game.getStack().getSpell(event.getTargetId()); - if (spell != null && spell.getColor().isBlack()) { - return true; - } - } - return false; - } + @Override + public boolean checkTrigger(GameEvent event, Game game) { + if (event.getType() == EventType.SPELL_CAST) { + Spell spell = game.getStack().getSpell(event.getTargetId()); + if (spell != null && spell.getColor().isBlack()) { + return true; + } + } + return false; + } - @Override - public String getRule() { - return "Whenever a player casts a black spell, you may gain 1 life."; - } + @Override + public String getRule() { + return "Whenever a player casts a black spell, you may gain 1 life."; + } } diff --git a/Mage.Sets/src/mage/sets/tenth/Demystify.java b/Mage.Sets/src/mage/sets/tenth/Demystify.java index 57dd3ee4d6..491c6b8ca7 100644 --- a/Mage.Sets/src/mage/sets/tenth/Demystify.java +++ b/Mage.Sets/src/mage/sets/tenth/Demystify.java @@ -53,7 +53,7 @@ public class Demystify extends CardImpl { public Demystify (UUID ownerId) { super(ownerId, 14, "Demystify", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{W}"); this.expansionSetCode = "10E"; - this.color.setWhite(true); + this.color.setWhite(true); this.getSpellAbility().addEffect(new DestroyTargetEffect()); this.getSpellAbility().addTarget(new TargetPermanent(filter)); } diff --git a/Mage.Sets/src/mage/sets/tenth/DiabolicTutor.java b/Mage.Sets/src/mage/sets/tenth/DiabolicTutor.java index 3d73258f1b..4e3b355774 100644 --- a/Mage.Sets/src/mage/sets/tenth/DiabolicTutor.java +++ b/Mage.Sets/src/mage/sets/tenth/DiabolicTutor.java @@ -49,12 +49,12 @@ public class DiabolicTutor extends CardImpl { this.getSpellAbility().addEffect(new SearchLibraryPutInHandEffect(target)); } - public DiabolicTutor(final DiabolicTutor card) { - super(card); - } + public DiabolicTutor(final DiabolicTutor card) { + super(card); + } - @Override - public DiabolicTutor copy() { - return new DiabolicTutor(this); - } + @Override + public DiabolicTutor copy() { + return new DiabolicTutor(this); + } } diff --git a/Mage.Sets/src/mage/sets/tenth/Discombobulate.java b/Mage.Sets/src/mage/sets/tenth/Discombobulate.java index e89047548b..85670063cf 100644 --- a/Mage.Sets/src/mage/sets/tenth/Discombobulate.java +++ b/Mage.Sets/src/mage/sets/tenth/Discombobulate.java @@ -42,23 +42,23 @@ import mage.target.TargetSpell; */ public class Discombobulate extends CardImpl { - public Discombobulate(UUID ownerId) { - super(ownerId, 81, "Discombobulate", Rarity.UNCOMMON, new CardType[]{CardType.INSTANT}, "{2}{U}{U}"); - this.expansionSetCode = "10E"; - this.color.setBlue(true); + public Discombobulate(UUID ownerId) { + super(ownerId, 81, "Discombobulate", Rarity.UNCOMMON, new CardType[]{CardType.INSTANT}, "{2}{U}{U}"); + this.expansionSetCode = "10E"; + this.color.setBlue(true); // Counter target spell. Look at the top four cards of your library, then put them back in any order. - this.getSpellAbility().addTarget(new TargetSpell()); - this.getSpellAbility().addEffect(new CounterTargetEffect()); + this.getSpellAbility().addTarget(new TargetSpell()); + this.getSpellAbility().addEffect(new CounterTargetEffect()); this.getSpellAbility().addEffect(new LookLibraryControllerEffect(4)); - } + } - public Discombobulate(final Discombobulate card) { - super(card); - } + public Discombobulate(final Discombobulate card) { + super(card); + } - @Override - public Discombobulate copy() { - return new Discombobulate(this); - } + @Override + public Discombobulate copy() { + return new Discombobulate(this); + } } diff --git a/Mage.Sets/src/mage/sets/tenth/Distress.java b/Mage.Sets/src/mage/sets/tenth/Distress.java index 1b62b01480..f9bab57ef3 100644 --- a/Mage.Sets/src/mage/sets/tenth/Distress.java +++ b/Mage.Sets/src/mage/sets/tenth/Distress.java @@ -47,69 +47,69 @@ import java.util.UUID; */ public class Distress extends CardImpl { - public Distress(UUID ownerId) { - super(ownerId, 136, "Distress", Rarity.COMMON, new CardType[]{CardType.SORCERY}, "{B}{B}"); - this.expansionSetCode = "10E"; + public Distress(UUID ownerId) { + super(ownerId, 136, "Distress", Rarity.COMMON, new CardType[]{CardType.SORCERY}, "{B}{B}"); + this.expansionSetCode = "10E"; - this.color.setBlack(true); + this.color.setBlack(true); - // Target player reveals his or her hand. You choose a nonland card from it. That player discards that card. - this.getSpellAbility().addTarget(new TargetPlayer()); - this.getSpellAbility().addEffect(new DistressEffect()); - } + // Target player reveals his or her hand. You choose a nonland card from it. That player discards that card. + this.getSpellAbility().addTarget(new TargetPlayer()); + this.getSpellAbility().addEffect(new DistressEffect()); + } - public Distress(final Distress card) { - super(card); - } + public Distress(final Distress card) { + super(card); + } - @Override - public Distress copy() { - return new Distress(this); - } + @Override + public Distress copy() { + return new Distress(this); + } } class DistressEffect extends OneShotEffect { - private static final FilterCard filter = new FilterCard("nonland card"); + private static final FilterCard filter = new FilterCard("nonland card"); - static { - filter.getNotCardType().add(CardType.LAND); - } + static { + filter.getNotCardType().add(CardType.LAND); + } - public DistressEffect() { - super(Constants.Outcome.Discard); - staticText = "Target player reveals his or her hand. You choose a nonland card from it. That player discards that card"; - } + public DistressEffect() { + super(Constants.Outcome.Discard); + staticText = "Target player reveals his or her hand. You choose a nonland card from it. That player discards that card"; + } - public DistressEffect(final DistressEffect effect) { - super(effect); - } + public DistressEffect(final DistressEffect effect) { + super(effect); + } - @Override - public boolean apply(Game game, Ability source) { - Player player = game.getPlayer(source.getFirstTarget()); - if (player != null) { - player.revealCards("Distress", player.getHand(), game); - Player you = game.getPlayer(source.getControllerId()); - if (you != null) { - TargetCard target = new TargetCard(Constants.Zone.PICK, filter); - target.setRequired(true); - if (you.choose(Constants.Outcome.Benefit, player.getHand(), target, game)) { - Card card = player.getHand().get(target.getFirstTarget(), game); - if (card != null) { - return player.discard(card, source, game); - } - } - } - return true; - } - return false; - } + @Override + public boolean apply(Game game, Ability source) { + Player player = game.getPlayer(source.getFirstTarget()); + if (player != null) { + player.revealCards("Distress", player.getHand(), game); + Player you = game.getPlayer(source.getControllerId()); + if (you != null) { + TargetCard target = new TargetCard(Constants.Zone.PICK, filter); + target.setRequired(true); + if (you.choose(Constants.Outcome.Benefit, player.getHand(), target, game)) { + Card card = player.getHand().get(target.getFirstTarget(), game); + if (card != null) { + return player.discard(card, source, game); + } + } + } + return true; + } + return false; + } - @Override - public DistressEffect copy() { - return new DistressEffect(this); - } + @Override + public DistressEffect copy() { + return new DistressEffect(this); + } } diff --git a/Mage.Sets/src/mage/sets/tenth/DragonRoost.java b/Mage.Sets/src/mage/sets/tenth/DragonRoost.java index 547d843cec..5e36b0cfd1 100644 --- a/Mage.Sets/src/mage/sets/tenth/DragonRoost.java +++ b/Mage.Sets/src/mage/sets/tenth/DragonRoost.java @@ -65,14 +65,14 @@ public class DragonRoost extends CardImpl { } class DragonToken2 extends Token { - DragonToken2() { - super("Dragon", "5/5 red Dragon creature token with flying"); - cardType.add(CardType.CREATURE); - color = ObjectColor.RED; - subtype.add("Dragon"); - power = new MageInt(5); - toughness = new MageInt(5); - addAbility(FlyingAbility.getInstance()); - } + DragonToken2() { + super("Dragon", "5/5 red Dragon creature token with flying"); + cardType.add(CardType.CREATURE); + color = ObjectColor.RED; + subtype.add("Dragon"); + power = new MageInt(5); + toughness = new MageInt(5); + addAbility(FlyingAbility.getInstance()); + } } diff --git a/Mage.Sets/src/mage/sets/tenth/DragonsClaw.java b/Mage.Sets/src/mage/sets/tenth/DragonsClaw.java index 9a0f6773dd..ff4458ca55 100644 --- a/Mage.Sets/src/mage/sets/tenth/DragonsClaw.java +++ b/Mage.Sets/src/mage/sets/tenth/DragonsClaw.java @@ -46,52 +46,52 @@ import mage.game.stack.Spell; */ public class DragonsClaw extends CardImpl { - public DragonsClaw(UUID ownerId) { - super(ownerId, 322, "Dragon's Claw", Rarity.UNCOMMON, new CardType[]{CardType.ARTIFACT}, "{2}"); - this.expansionSetCode = "10E"; - this.addAbility(new DragonsClawAbility()); - } + public DragonsClaw(UUID ownerId) { + super(ownerId, 322, "Dragon's Claw", Rarity.UNCOMMON, new CardType[]{CardType.ARTIFACT}, "{2}"); + this.expansionSetCode = "10E"; + this.addAbility(new DragonsClawAbility()); + } - public DragonsClaw(final DragonsClaw card) { - super(card); - } + public DragonsClaw(final DragonsClaw card) { + super(card); + } - @Override - public DragonsClaw copy() { - return new DragonsClaw(this); - } + @Override + public DragonsClaw copy() { + return new DragonsClaw(this); + } } class DragonsClawAbility extends TriggeredAbilityImpl { - public DragonsClawAbility() { - super(Zone.BATTLEFIELD, new GainLifeEffect(1), true); - } + public DragonsClawAbility() { + super(Zone.BATTLEFIELD, new GainLifeEffect(1), true); + } - public DragonsClawAbility(final DragonsClawAbility ability) { - super(ability); - } + public DragonsClawAbility(final DragonsClawAbility ability) { + super(ability); + } - @Override - public DragonsClawAbility copy() { - return new DragonsClawAbility(this); - } + @Override + public DragonsClawAbility copy() { + return new DragonsClawAbility(this); + } - @Override - public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == EventType.SPELL_CAST) { - Spell spell = game.getStack().getSpell(event.getTargetId()); - if (spell != null && spell.getColor().isRed()) { - return true; - } - } - return false; - } + @Override + public boolean checkTrigger(GameEvent event, Game game) { + if (event.getType() == EventType.SPELL_CAST) { + Spell spell = game.getStack().getSpell(event.getTargetId()); + if (spell != null && spell.getColor().isRed()) { + return true; + } + } + return false; + } - @Override - public String getRule() { - return "Whenever a player casts a red spell, you may gain 1 life."; - } + @Override + public String getRule() { + return "Whenever a player casts a red spell, you may gain 1 life."; + } } diff --git a/Mage.Sets/src/mage/sets/tenth/EarthElemental.java b/Mage.Sets/src/mage/sets/tenth/EarthElemental.java index ceaad318c8..3b8975d99f 100644 --- a/Mage.Sets/src/mage/sets/tenth/EarthElemental.java +++ b/Mage.Sets/src/mage/sets/tenth/EarthElemental.java @@ -44,7 +44,7 @@ public class EarthElemental extends CardImpl { super(ownerId, 199, "Earth Elemental", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{3}{R}{R}"); this.expansionSetCode = "10E"; this.subtype.add("Elemental"); - this.color.setRed(true); + this.color.setRed(true); this.power = new MageInt(4); this.toughness = new MageInt(5); } diff --git a/Mage.Sets/src/mage/sets/tenth/FaerieConclave.java b/Mage.Sets/src/mage/sets/tenth/FaerieConclave.java index bdb07f418f..021f77c8c7 100644 --- a/Mage.Sets/src/mage/sets/tenth/FaerieConclave.java +++ b/Mage.Sets/src/mage/sets/tenth/FaerieConclave.java @@ -75,7 +75,7 @@ class FaerieConclaveToken extends Token { this.subtype.add("Faerie"); color = ObjectColor.BLUE; power = new MageInt(2); - toughness = new MageInt(1); + toughness = new MageInt(1); this.addAbility(FlyingAbility.getInstance()); } } diff --git a/Mage.Sets/src/mage/sets/tenth/Fear.java b/Mage.Sets/src/mage/sets/tenth/Fear.java index f86098cda9..ac6538e8dc 100644 --- a/Mage.Sets/src/mage/sets/tenth/Fear.java +++ b/Mage.Sets/src/mage/sets/tenth/Fear.java @@ -57,9 +57,9 @@ public class Fear extends CardImpl { // Enchant creature TargetPermanent auraTarget = new TargetCreaturePermanent(); - this.getSpellAbility().addTarget(auraTarget); - this.getSpellAbility().addEffect(new AttachEffect(Constants.Outcome.BoostCreature)); - Ability ability = new EnchantAbility(auraTarget.getTargetName()); + this.getSpellAbility().addTarget(auraTarget); + this.getSpellAbility().addEffect(new AttachEffect(Constants.Outcome.BoostCreature)); + Ability ability = new EnchantAbility(auraTarget.getTargetName()); this.addAbility(ability); // Enchanted creature has fear. this.addAbility(new SimpleStaticAbility(Constants.Zone.BATTLEFIELD, new GainAbilityAttachedEffect(FearAbility.getInstance(), Constants.AttachmentType.AURA))); diff --git a/Mage.Sets/src/mage/sets/tenth/Flashfreeze.java b/Mage.Sets/src/mage/sets/tenth/Flashfreeze.java index fabfacc11e..3fcd36beba 100644 --- a/Mage.Sets/src/mage/sets/tenth/Flashfreeze.java +++ b/Mage.Sets/src/mage/sets/tenth/Flashfreeze.java @@ -43,30 +43,30 @@ import mage.target.TargetSpell; */ public class Flashfreeze extends CardImpl { - private static final FilterSpell filter = new FilterSpell("red or green spell"); + private static final FilterSpell filter = new FilterSpell("red or green spell"); - static { - filter.getColor().setRed(true); - filter.getColor().setGreen(true); - filter.setScopeColor(ComparisonScope.Any); - filter.setUseColor(true); - } + static { + filter.getColor().setRed(true); + filter.getColor().setGreen(true); + filter.setScopeColor(ComparisonScope.Any); + filter.setUseColor(true); + } - public Flashfreeze(UUID ownerId) { - super(ownerId, 84, "Flashfreeze", Rarity.UNCOMMON, new CardType[]{CardType.INSTANT}, "{1}{U}"); - this.expansionSetCode = "10E"; - this.color.setBlue(true); - this.getSpellAbility().addTarget(new TargetSpell(filter)); - this.getSpellAbility().addEffect(new CounterTargetEffect()); - } + public Flashfreeze(UUID ownerId) { + super(ownerId, 84, "Flashfreeze", Rarity.UNCOMMON, new CardType[]{CardType.INSTANT}, "{1}{U}"); + this.expansionSetCode = "10E"; + this.color.setBlue(true); + this.getSpellAbility().addTarget(new TargetSpell(filter)); + this.getSpellAbility().addEffect(new CounterTargetEffect()); + } - public Flashfreeze(final Flashfreeze card) { - super(card); - } + public Flashfreeze(final Flashfreeze card) { + super(card); + } - @Override - public Flashfreeze copy() { - return new Flashfreeze(this); - } + @Override + public Flashfreeze copy() { + return new Flashfreeze(this); + } } diff --git a/Mage.Sets/src/mage/sets/tenth/ForbiddingWatchtower.java b/Mage.Sets/src/mage/sets/tenth/ForbiddingWatchtower.java index afc01909d8..754c8642ab 100644 --- a/Mage.Sets/src/mage/sets/tenth/ForbiddingWatchtower.java +++ b/Mage.Sets/src/mage/sets/tenth/ForbiddingWatchtower.java @@ -74,6 +74,6 @@ class ForbiddingWatchtowerToken extends Token { this.subtype.add("Soldier"); color = ObjectColor.WHITE; power = new MageInt(1); - toughness = new MageInt(5); + toughness = new MageInt(5); } } diff --git a/Mage.Sets/src/mage/sets/tenth/Forest1.java b/Mage.Sets/src/mage/sets/tenth/Forest1.java index 4d53a4e8c9..d537163d9f 100644 --- a/Mage.Sets/src/mage/sets/tenth/Forest1.java +++ b/Mage.Sets/src/mage/sets/tenth/Forest1.java @@ -36,18 +36,18 @@ import java.util.UUID; */ public class Forest1 extends mage.cards.basiclands.Forest { - public Forest1(UUID ownerId) { - super(ownerId, 380); - this.expansionSetCode = "10E"; - } + public Forest1(UUID ownerId) { + super(ownerId, 380); + this.expansionSetCode = "10E"; + } - public Forest1(final Forest1 card) { - super(card); - } + public Forest1(final Forest1 card) { + super(card); + } - @Override - public Forest1 copy() { - return new Forest1(this); - } + @Override + public Forest1 copy() { + return new Forest1(this); + } } diff --git a/Mage.Sets/src/mage/sets/tenth/Forest2.java b/Mage.Sets/src/mage/sets/tenth/Forest2.java index 7677c15f6e..4a86399e97 100644 --- a/Mage.Sets/src/mage/sets/tenth/Forest2.java +++ b/Mage.Sets/src/mage/sets/tenth/Forest2.java @@ -36,18 +36,18 @@ import java.util.UUID; */ public class Forest2 extends mage.cards.basiclands.Forest { - public Forest2(UUID ownerId) { - super(ownerId, 381); - this.expansionSetCode = "10E"; - } + public Forest2(UUID ownerId) { + super(ownerId, 381); + this.expansionSetCode = "10E"; + } - public Forest2(final Forest2 card) { - super(card); - } + public Forest2(final Forest2 card) { + super(card); + } - @Override - public Forest2 copy() { - return new Forest2(this); - } + @Override + public Forest2 copy() { + return new Forest2(this); + } } diff --git a/Mage.Sets/src/mage/sets/tenth/Forest3.java b/Mage.Sets/src/mage/sets/tenth/Forest3.java index df7cfcd6f2..15246b3642 100644 --- a/Mage.Sets/src/mage/sets/tenth/Forest3.java +++ b/Mage.Sets/src/mage/sets/tenth/Forest3.java @@ -36,18 +36,18 @@ import java.util.UUID; */ public class Forest3 extends mage.cards.basiclands.Forest { - public Forest3(UUID ownerId) { - super(ownerId, 382); - this.expansionSetCode = "10E"; - } + public Forest3(UUID ownerId) { + super(ownerId, 382); + this.expansionSetCode = "10E"; + } - public Forest3(final Forest3 card) { - super(card); - } + public Forest3(final Forest3 card) { + super(card); + } - @Override - public Forest3 copy() { - return new Forest3(this); - } + @Override + public Forest3 copy() { + return new Forest3(this); + } } diff --git a/Mage.Sets/src/mage/sets/tenth/Forest4.java b/Mage.Sets/src/mage/sets/tenth/Forest4.java index 97f59ae796..9a0805b2f9 100644 --- a/Mage.Sets/src/mage/sets/tenth/Forest4.java +++ b/Mage.Sets/src/mage/sets/tenth/Forest4.java @@ -36,18 +36,18 @@ import java.util.UUID; */ public class Forest4 extends mage.cards.basiclands.Forest { - public Forest4(UUID ownerId) { - super(ownerId, 383); - this.expansionSetCode = "10E"; - } + public Forest4(UUID ownerId) { + super(ownerId, 383); + this.expansionSetCode = "10E"; + } - public Forest4(final Forest4 card) { - super(card); - } + public Forest4(final Forest4 card) { + super(card); + } - @Override - public Forest4 copy() { - return new Forest4(this); - } + @Override + public Forest4 copy() { + return new Forest4(this); + } } diff --git a/Mage.Sets/src/mage/sets/tenth/GiantGrowth.java b/Mage.Sets/src/mage/sets/tenth/GiantGrowth.java index d47951e644..a691457539 100644 --- a/Mage.Sets/src/mage/sets/tenth/GiantGrowth.java +++ b/Mage.Sets/src/mage/sets/tenth/GiantGrowth.java @@ -42,20 +42,20 @@ import mage.target.common.TargetCreaturePermanent; */ public class GiantGrowth extends CardImpl { - public GiantGrowth(UUID ownerId) { - super(ownerId, 266, "Giant Growth", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{G}"); - this.expansionSetCode = "10E"; - this.color.setGreen(true); - this.getSpellAbility().addTarget(new TargetCreaturePermanent()); - this.getSpellAbility().addEffect(new BoostTargetEffect(3, 3, Duration.EndOfTurn)); - } + public GiantGrowth(UUID ownerId) { + super(ownerId, 266, "Giant Growth", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{G}"); + this.expansionSetCode = "10E"; + this.color.setGreen(true); + this.getSpellAbility().addTarget(new TargetCreaturePermanent()); + this.getSpellAbility().addEffect(new BoostTargetEffect(3, 3, Duration.EndOfTurn)); + } - public GiantGrowth(final GiantGrowth card) { - super(card); - } + public GiantGrowth(final GiantGrowth card) { + super(card); + } - @Override - public GiantGrowth copy() { - return new GiantGrowth(this); - } + @Override + public GiantGrowth copy() { + return new GiantGrowth(this); + } } diff --git a/Mage.Sets/src/mage/sets/tenth/GiantSpider.java b/Mage.Sets/src/mage/sets/tenth/GiantSpider.java index b49b105760..b1f29d5f37 100644 --- a/Mage.Sets/src/mage/sets/tenth/GiantSpider.java +++ b/Mage.Sets/src/mage/sets/tenth/GiantSpider.java @@ -41,24 +41,24 @@ import mage.cards.CardImpl; */ public class GiantSpider extends CardImpl { - public GiantSpider(UUID ownerId) { - super(ownerId, 267, "Giant Spider", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{3}{G}"); - this.expansionSetCode = "10E"; - this.subtype.add("Spider"); - this.color.setGreen(true); - this.power = new MageInt(2); - this.toughness = new MageInt(4); + public GiantSpider(UUID ownerId) { + super(ownerId, 267, "Giant Spider", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{3}{G}"); + this.expansionSetCode = "10E"; + this.subtype.add("Spider"); + this.color.setGreen(true); + this.power = new MageInt(2); + this.toughness = new MageInt(4); - this.addAbility(ReachAbility.getInstance()); - } + this.addAbility(ReachAbility.getInstance()); + } - public GiantSpider(final GiantSpider card) { - super(card); - } + public GiantSpider(final GiantSpider card) { + super(card); + } - @Override - public GiantSpider copy() { - return new GiantSpider(this); - } + @Override + public GiantSpider copy() { + return new GiantSpider(this); + } } diff --git a/Mage.Sets/src/mage/sets/tenth/GoblinPiker.java b/Mage.Sets/src/mage/sets/tenth/GoblinPiker.java index 45f83a9a4d..a034605ad1 100644 --- a/Mage.Sets/src/mage/sets/tenth/GoblinPiker.java +++ b/Mage.Sets/src/mage/sets/tenth/GoblinPiker.java @@ -40,24 +40,24 @@ import mage.cards.CardImpl; */ public class GoblinPiker extends CardImpl { - public GoblinPiker(UUID ownerId) { - super(ownerId, 209, "Goblin Piker", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{1}{R}"); - this.expansionSetCode = "10E"; - this.subtype.add("Goblin"); - this.subtype.add("Warrier"); - this.color.setRed(true); - this.power = new MageInt(2); - this.toughness = new MageInt(1); + public GoblinPiker(UUID ownerId) { + super(ownerId, 209, "Goblin Piker", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{1}{R}"); + this.expansionSetCode = "10E"; + this.subtype.add("Goblin"); + this.subtype.add("Warrier"); + this.color.setRed(true); + this.power = new MageInt(2); + this.toughness = new MageInt(1); - } + } - public GoblinPiker(final GoblinPiker card) { - super(card); - } + public GoblinPiker(final GoblinPiker card) { + super(card); + } - @Override - public GoblinPiker copy() { - return new GoblinPiker(this); - } + @Override + public GoblinPiker copy() { + return new GoblinPiker(this); + } } diff --git a/Mage.Sets/src/mage/sets/tenth/Gravedigger.java b/Mage.Sets/src/mage/sets/tenth/Gravedigger.java index 048f370693..0e507b2ce6 100644 --- a/Mage.Sets/src/mage/sets/tenth/Gravedigger.java +++ b/Mage.Sets/src/mage/sets/tenth/Gravedigger.java @@ -45,26 +45,26 @@ import mage.target.common.TargetCardInYourGraveyard; */ public class Gravedigger extends CardImpl { - public Gravedigger(UUID ownerId) { - super(ownerId, 146, "Gravedigger", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{3}{B}"); - this.expansionSetCode = "10E"; - this.subtype.add("Zombie"); - this.color.setBlack(true); - this.power = new MageInt(2); - this.toughness = new MageInt(2); + public Gravedigger(UUID ownerId) { + super(ownerId, 146, "Gravedigger", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{3}{B}"); + this.expansionSetCode = "10E"; + this.subtype.add("Zombie"); + this.color.setBlack(true); + this.power = new MageInt(2); + this.toughness = new MageInt(2); - Ability ability = new EntersBattlefieldTriggeredAbility(new ReturnToHandTargetEffect(), true); - ability.addTarget(new TargetCardInYourGraveyard(new FilterCreatureCard("creature card from your graveyard"))); - this.addAbility(ability); - } + Ability ability = new EntersBattlefieldTriggeredAbility(new ReturnToHandTargetEffect(), true); + ability.addTarget(new TargetCardInYourGraveyard(new FilterCreatureCard("creature card from your graveyard"))); + this.addAbility(ability); + } - public Gravedigger(final Gravedigger card) { - super(card); - } + public Gravedigger(final Gravedigger card) { + super(card); + } - @Override - public Gravedigger copy() { - return new Gravedigger(this); - } + @Override + public Gravedigger copy() { + return new Gravedigger(this); + } } diff --git a/Mage.Sets/src/mage/sets/tenth/HolyStrength.java b/Mage.Sets/src/mage/sets/tenth/HolyStrength.java index 89c808f273..1e58e7a249 100644 --- a/Mage.Sets/src/mage/sets/tenth/HolyStrength.java +++ b/Mage.Sets/src/mage/sets/tenth/HolyStrength.java @@ -49,26 +49,26 @@ import mage.target.common.TargetCreaturePermanent; */ public class HolyStrength extends CardImpl { - public HolyStrength(UUID ownerId) { - super(ownerId, 22, "Holy Strength", Rarity.COMMON, new CardType[]{CardType.ENCHANTMENT}, "{W}"); - this.expansionSetCode = "10E"; - this.color.setWhite(true); - this.subtype.add("Aura"); + public HolyStrength(UUID ownerId) { + super(ownerId, 22, "Holy Strength", Rarity.COMMON, new CardType[]{CardType.ENCHANTMENT}, "{W}"); + this.expansionSetCode = "10E"; + this.color.setWhite(true); + this.subtype.add("Aura"); - TargetPermanent auraTarget = new TargetCreaturePermanent(); - this.getSpellAbility().addTarget(auraTarget); - this.getSpellAbility().addEffect(new AttachEffect(Outcome.BoostCreature)); - Ability ability = new EnchantAbility(auraTarget.getTargetName()); - this.addAbility(ability); - this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostEnchantedEffect(1, 2, Duration.WhileOnBattlefield))); - } + TargetPermanent auraTarget = new TargetCreaturePermanent(); + this.getSpellAbility().addTarget(auraTarget); + this.getSpellAbility().addEffect(new AttachEffect(Outcome.BoostCreature)); + Ability ability = new EnchantAbility(auraTarget.getTargetName()); + this.addAbility(ability); + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostEnchantedEffect(1, 2, Duration.WhileOnBattlefield))); + } - public HolyStrength(final HolyStrength card) { - super(card); - } + public HolyStrength(final HolyStrength card) { + super(card); + } - @Override - public HolyStrength copy() { - return new HolyStrength(this); - } + @Override + public HolyStrength copy() { + return new HolyStrength(this); + } } diff --git a/Mage.Sets/src/mage/sets/tenth/Incinerate.java b/Mage.Sets/src/mage/sets/tenth/Incinerate.java index 52b9428f85..3d9bdf2f6f 100644 --- a/Mage.Sets/src/mage/sets/tenth/Incinerate.java +++ b/Mage.Sets/src/mage/sets/tenth/Incinerate.java @@ -56,7 +56,7 @@ public class Incinerate extends CardImpl { this.getSpellAbility().addEffect(new DamageTargetEffect(3)); this.getSpellAbility().addTarget(new TargetCreatureOrPlayer()); - this.getSpellAbility().addEffect(new IncinerateEffect()); + this.getSpellAbility().addEffect(new IncinerateEffect()); this.addWatcher(new DamagedByWatcher()); } @@ -72,38 +72,38 @@ public class Incinerate extends CardImpl { class IncinerateEffect extends ReplacementEffectImpl { - public IncinerateEffect() { - super(Duration.EndOfTurn, Outcome.Detriment); - staticText = "A creature dealt damage this way can't be regenerated this turn"; - } + public IncinerateEffect() { + super(Duration.EndOfTurn, Outcome.Detriment); + staticText = "A creature dealt damage this way can't be regenerated this turn"; + } - public IncinerateEffect(final IncinerateEffect effect) { - super(effect); - } + public IncinerateEffect(final IncinerateEffect effect) { + super(effect); + } - @Override - public IncinerateEffect copy() { - return new IncinerateEffect(this); - } + @Override + public IncinerateEffect copy() { + return new IncinerateEffect(this); + } - @Override - public boolean apply(Game game, Ability source) { - return true; - } - - @Override - public boolean replaceEvent(GameEvent event, Ability source, Game game) { + @Override + public boolean apply(Game game, Ability source) { return true; - } + } - @Override - public boolean applies(GameEvent event, Ability source, Game game) { - if (event.getType() == EventType.REGENERATE) { + @Override + public boolean replaceEvent(GameEvent event, Ability source, Game game) { + return true; + } + + @Override + public boolean applies(GameEvent event, Ability source, Game game) { + if (event.getType() == EventType.REGENERATE) { DamagedByWatcher watcher = (DamagedByWatcher) game.getState().getWatchers().get("DamagedByWatcher", source.getSourceId()); if (watcher != null) return watcher.damagedCreatures.contains(event.getTargetId()); - } - return false; - } + } + return false; + } } diff --git a/Mage.Sets/src/mage/sets/tenth/Island1.java b/Mage.Sets/src/mage/sets/tenth/Island1.java index 74962891b3..27143d1a99 100644 --- a/Mage.Sets/src/mage/sets/tenth/Island1.java +++ b/Mage.Sets/src/mage/sets/tenth/Island1.java @@ -36,18 +36,18 @@ import java.util.UUID; */ public class Island1 extends mage.cards.basiclands.Island { - public Island1(UUID ownerId) { - super(ownerId, 368); - this.expansionSetCode = "10E"; - } + public Island1(UUID ownerId) { + super(ownerId, 368); + this.expansionSetCode = "10E"; + } - public Island1(final Island1 card) { - super(card); - } + public Island1(final Island1 card) { + super(card); + } - @Override - public Island1 copy() { - return new Island1(this); - } + @Override + public Island1 copy() { + return new Island1(this); + } } diff --git a/Mage.Sets/src/mage/sets/tenth/Island2.java b/Mage.Sets/src/mage/sets/tenth/Island2.java index 4b527f02bf..ca4024c7f0 100644 --- a/Mage.Sets/src/mage/sets/tenth/Island2.java +++ b/Mage.Sets/src/mage/sets/tenth/Island2.java @@ -36,18 +36,18 @@ import java.util.UUID; */ public class Island2 extends mage.cards.basiclands.Island { - public Island2(UUID ownerId) { - super(ownerId, 369); - this.expansionSetCode = "10E"; - } + public Island2(UUID ownerId) { + super(ownerId, 369); + this.expansionSetCode = "10E"; + } - public Island2(final Island2 card) { - super(card); - } + public Island2(final Island2 card) { + super(card); + } - @Override - public Island2 copy() { - return new Island2(this); - } + @Override + public Island2 copy() { + return new Island2(this); + } } diff --git a/Mage.Sets/src/mage/sets/tenth/Island3.java b/Mage.Sets/src/mage/sets/tenth/Island3.java index d2d0bde122..0458b212d8 100644 --- a/Mage.Sets/src/mage/sets/tenth/Island3.java +++ b/Mage.Sets/src/mage/sets/tenth/Island3.java @@ -36,18 +36,18 @@ import java.util.UUID; */ public class Island3 extends mage.cards.basiclands.Island { - public Island3(UUID ownerId) { - super(ownerId, 370); - this.expansionSetCode = "10E"; - } + public Island3(UUID ownerId) { + super(ownerId, 370); + this.expansionSetCode = "10E"; + } - public Island3(final Island3 card) { - super(card); - } + public Island3(final Island3 card) { + super(card); + } - @Override - public Island3 copy() { - return new Island3(this); - } + @Override + public Island3 copy() { + return new Island3(this); + } } diff --git a/Mage.Sets/src/mage/sets/tenth/Island4.java b/Mage.Sets/src/mage/sets/tenth/Island4.java index a34d60994d..d5058d3c04 100644 --- a/Mage.Sets/src/mage/sets/tenth/Island4.java +++ b/Mage.Sets/src/mage/sets/tenth/Island4.java @@ -36,18 +36,18 @@ import java.util.UUID; */ public class Island4 extends mage.cards.basiclands.Island { - public Island4(UUID ownerId) { - super(ownerId, 371); - this.expansionSetCode = "10E"; - } + public Island4(UUID ownerId) { + super(ownerId, 371); + this.expansionSetCode = "10E"; + } - public Island4(final Island4 card) { - super(card); - } + public Island4(final Island4 card) { + super(card); + } - @Override - public Island4 copy() { - return new Island4(this); - } + @Override + public Island4 copy() { + return new Island4(this); + } } diff --git a/Mage.Sets/src/mage/sets/tenth/Juggernaut.java b/Mage.Sets/src/mage/sets/tenth/Juggernaut.java index f362f1ba20..139b9e212a 100644 --- a/Mage.Sets/src/mage/sets/tenth/Juggernaut.java +++ b/Mage.Sets/src/mage/sets/tenth/Juggernaut.java @@ -47,68 +47,68 @@ import mage.game.permanent.Permanent; */ public class Juggernaut extends CardImpl { - public Juggernaut(UUID ownerId) { - super(ownerId, 328, "Juggernaut", Rarity.UNCOMMON, new CardType[]{CardType.ARTIFACT, CardType.CREATURE}, "{4}"); - this.expansionSetCode = "10E"; - this.subtype.add("Juggernaut"); - this.power = new MageInt(5); - this.toughness = new MageInt(3); + public Juggernaut(UUID ownerId) { + super(ownerId, 328, "Juggernaut", Rarity.UNCOMMON, new CardType[]{CardType.ARTIFACT, CardType.CREATURE}, "{4}"); + this.expansionSetCode = "10E"; + this.subtype.add("Juggernaut"); + this.power = new MageInt(5); + this.toughness = new MageInt(3); - this.addAbility(new AttacksEachTurnStaticAbility()); - this.addAbility(new JuggernautAbility()); - } + this.addAbility(new AttacksEachTurnStaticAbility()); + this.addAbility(new JuggernautAbility()); + } - public Juggernaut(final Juggernaut card) { - super(card); - } + public Juggernaut(final Juggernaut card) { + super(card); + } - @Override - public Juggernaut copy() { - return new Juggernaut(this); - } + @Override + public Juggernaut copy() { + return new Juggernaut(this); + } } class JuggernautAbility extends EvasionAbility { - public JuggernautAbility() { - this.addEffect(new JuggernautEffect()); - } + public JuggernautAbility() { + this.addEffect(new JuggernautEffect()); + } - public JuggernautAbility(final JuggernautAbility ability) { - super(ability); - } + public JuggernautAbility(final JuggernautAbility ability) { + super(ability); + } - @Override - public String getRule() { - return "{this} can't be blocked by Walls."; - } + @Override + public String getRule() { + return "{this} can't be blocked by Walls."; + } - @Override - public JuggernautAbility copy() { - return new JuggernautAbility(this); - } + @Override + public JuggernautAbility copy() { + return new JuggernautAbility(this); + } } class JuggernautEffect extends CantBlockSourceEffect { - public JuggernautEffect() { - super(Duration.WhileOnBattlefield); - } + public JuggernautEffect() { + super(Duration.WhileOnBattlefield); + } - public JuggernautEffect(final JuggernautEffect effect) { - super(effect); - } + public JuggernautEffect(final JuggernautEffect effect) { + super(effect); + } - @Override - public boolean canBeBlocked(Permanent attacker, Permanent blocker, Ability source, Game game) { - return !blocker.hasSubtype("Wall"); - } + @Override + public boolean canBeBlocked(Permanent attacker, Permanent blocker, Ability source, Game game) { + return !blocker.hasSubtype("Wall"); + } - @Override - public JuggernautEffect copy() { - return new JuggernautEffect(this); - } + @Override + public JuggernautEffect copy() { + return new JuggernautEffect(this); + } } diff --git a/Mage.Sets/src/mage/sets/tenth/KrakensEye.java b/Mage.Sets/src/mage/sets/tenth/KrakensEye.java index d8d39d4e01..ccea0fbbd2 100644 --- a/Mage.Sets/src/mage/sets/tenth/KrakensEye.java +++ b/Mage.Sets/src/mage/sets/tenth/KrakensEye.java @@ -46,52 +46,52 @@ import mage.game.stack.Spell; */ public class KrakensEye extends CardImpl { - public KrakensEye(UUID ownerId) { - super(ownerId, 329, "Kraken's Eye", Rarity.UNCOMMON, new CardType[]{CardType.ARTIFACT}, "{2}"); - this.expansionSetCode = "10E"; - this.addAbility(new KrakensEyeAbility()); - } + public KrakensEye(UUID ownerId) { + super(ownerId, 329, "Kraken's Eye", Rarity.UNCOMMON, new CardType[]{CardType.ARTIFACT}, "{2}"); + this.expansionSetCode = "10E"; + this.addAbility(new KrakensEyeAbility()); + } - public KrakensEye(final KrakensEye card) { - super(card); - } + public KrakensEye(final KrakensEye card) { + super(card); + } - @Override - public KrakensEye copy() { - return new KrakensEye(this); - } + @Override + public KrakensEye copy() { + return new KrakensEye(this); + } } class KrakensEyeAbility extends TriggeredAbilityImpl { - public KrakensEyeAbility() { - super(Zone.BATTLEFIELD, new GainLifeEffect(1), true); - } + public KrakensEyeAbility() { + super(Zone.BATTLEFIELD, new GainLifeEffect(1), true); + } - public KrakensEyeAbility(final KrakensEyeAbility ability) { - super(ability); - } + public KrakensEyeAbility(final KrakensEyeAbility ability) { + super(ability); + } - @Override - public KrakensEyeAbility copy() { - return new KrakensEyeAbility(this); - } + @Override + public KrakensEyeAbility copy() { + return new KrakensEyeAbility(this); + } - @Override - public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == EventType.SPELL_CAST) { - Spell spell = game.getStack().getSpell(event.getTargetId()); - if (spell != null && spell.getColor().isBlue()) { - return true; - } - } - return false; - } + @Override + public boolean checkTrigger(GameEvent event, Game game) { + if (event.getType() == EventType.SPELL_CAST) { + Spell spell = game.getStack().getSpell(event.getTargetId()); + if (spell != null && spell.getColor().isBlue()) { + return true; + } + } + return false; + } - @Override - public String getRule() { - return "Whenever a player casts a blue spell, you may gain 1 life."; - } + @Override + public String getRule() { + return "Whenever a player casts a blue spell, you may gain 1 life."; + } } diff --git a/Mage.Sets/src/mage/sets/tenth/LavaAxe.java b/Mage.Sets/src/mage/sets/tenth/LavaAxe.java index 7be785bc6d..714888b24c 100644 --- a/Mage.Sets/src/mage/sets/tenth/LavaAxe.java +++ b/Mage.Sets/src/mage/sets/tenth/LavaAxe.java @@ -41,20 +41,20 @@ import mage.target.TargetPlayer; */ public class LavaAxe extends CardImpl { - public LavaAxe(UUID ownerId) { - super(ownerId, 215, "Lava Axe", Rarity.COMMON, new CardType[]{CardType.SORCERY}, "{4}{R}"); - this.expansionSetCode = "10E"; - this.color.setRed(true); - this.getSpellAbility().addTarget(new TargetPlayer()); - this.getSpellAbility().addEffect(new DamageTargetEffect(5)); - } + public LavaAxe(UUID ownerId) { + super(ownerId, 215, "Lava Axe", Rarity.COMMON, new CardType[]{CardType.SORCERY}, "{4}{R}"); + this.expansionSetCode = "10E"; + this.color.setRed(true); + this.getSpellAbility().addTarget(new TargetPlayer()); + this.getSpellAbility().addEffect(new DamageTargetEffect(5)); + } - public LavaAxe(final LavaAxe card) { - super(card); - } + public LavaAxe(final LavaAxe card) { + super(card); + } - @Override - public LavaAxe copy() { - return new LavaAxe(this); - } + @Override + public LavaAxe copy() { + return new LavaAxe(this); + } } diff --git a/Mage.Sets/src/mage/sets/tenth/LightningElemental.java b/Mage.Sets/src/mage/sets/tenth/LightningElemental.java index df5b3e11cf..e749c41b41 100644 --- a/Mage.Sets/src/mage/sets/tenth/LightningElemental.java +++ b/Mage.Sets/src/mage/sets/tenth/LightningElemental.java @@ -45,7 +45,7 @@ public class LightningElemental extends CardImpl { super(ownerId, 217, "Lightning Elemental", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{3}{R}"); this.expansionSetCode = "10E"; this.subtype.add("Elemental"); - this.color.setRed(true); + this.color.setRed(true); this.power = new MageInt(4); this.toughness = new MageInt(1); this.addAbility(HasteAbility.getInstance()); diff --git a/Mage.Sets/src/mage/sets/tenth/LlanowarElves.java b/Mage.Sets/src/mage/sets/tenth/LlanowarElves.java index 886abe7380..1771d3f80c 100644 --- a/Mage.Sets/src/mage/sets/tenth/LlanowarElves.java +++ b/Mage.Sets/src/mage/sets/tenth/LlanowarElves.java @@ -41,24 +41,24 @@ import mage.cards.CardImpl; */ public class LlanowarElves extends CardImpl { - public LlanowarElves(UUID ownerId) { - super(ownerId, 274, "Llanowar Elves", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{G}"); - this.expansionSetCode = "10E"; - this.subtype.add("Elf"); - this.subtype.add("Druid"); - this.color.setGreen(true); - this.power = new MageInt(1); - this.toughness = new MageInt(1); - this.addAbility(new GreenManaAbility()); - } + public LlanowarElves(UUID ownerId) { + super(ownerId, 274, "Llanowar Elves", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{G}"); + this.expansionSetCode = "10E"; + this.subtype.add("Elf"); + this.subtype.add("Druid"); + this.color.setGreen(true); + this.power = new MageInt(1); + this.toughness = new MageInt(1); + this.addAbility(new GreenManaAbility()); + } - public LlanowarElves(final LlanowarElves card) { - super(card); - } + public LlanowarElves(final LlanowarElves card) { + super(card); + } - @Override - public LlanowarElves copy() { - return new LlanowarElves(this); - } + @Override + public LlanowarElves copy() { + return new LlanowarElves(this); + } } diff --git a/Mage.Sets/src/mage/sets/tenth/LoyalSentry.java b/Mage.Sets/src/mage/sets/tenth/LoyalSentry.java index 765cc75fe2..f467632e26 100644 --- a/Mage.Sets/src/mage/sets/tenth/LoyalSentry.java +++ b/Mage.Sets/src/mage/sets/tenth/LoyalSentry.java @@ -52,11 +52,11 @@ public class LoyalSentry extends CardImpl { this.expansionSetCode = "10E"; this.subtype.add("Human"); this.subtype.add("Soldier"); - - this.color.setWhite(true); + + this.color.setWhite(true); this.power = new MageInt(1); this.toughness = new MageInt(1); - + this.addAbility(new BlocksTriggeredAbility(new LoyalSentryEffect(), false, true)); } diff --git a/Mage.Sets/src/mage/sets/tenth/Manabarbs.java b/Mage.Sets/src/mage/sets/tenth/Manabarbs.java index f39222fc53..5d6cbe50c6 100644 --- a/Mage.Sets/src/mage/sets/tenth/Manabarbs.java +++ b/Mage.Sets/src/mage/sets/tenth/Manabarbs.java @@ -69,38 +69,38 @@ public class Manabarbs extends CardImpl { class ManabarbsTriggeredAbility extends TriggeredAbilityImpl { - private static final String staticText = "Whenever a player taps a land for mana, Manabarbs deals 1 damage to that player."; + private static final String staticText = "Whenever a player taps a land for mana, Manabarbs deals 1 damage to that player."; - public ManabarbsTriggeredAbility() { - super(Zone.BATTLEFIELD, new DamageTargetEffect(1)); - } + public ManabarbsTriggeredAbility() { + super(Zone.BATTLEFIELD, new DamageTargetEffect(1)); + } - public ManabarbsTriggeredAbility(ManabarbsTriggeredAbility ability) { - super(ability); - } + public ManabarbsTriggeredAbility(ManabarbsTriggeredAbility ability) { + super(ability); + } - @Override - public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == GameEvent.EventType.TAPPED_FOR_MANA) { - Permanent permanent = game.getPermanent(event.getSourceId()); - if (permanent == null) { - permanent = (Permanent) game.getLastKnownInformation(event.getSourceId(), Zone.BATTLEFIELD); - } - if (permanent != null && permanent.getCardType().contains(CardType.LAND)) { - getEffects().get(0).setTargetPointer(new FixedTarget(permanent.getControllerId())); - return true; - } - } - return false; - } + @Override + public boolean checkTrigger(GameEvent event, Game game) { + if (event.getType() == GameEvent.EventType.TAPPED_FOR_MANA) { + Permanent permanent = game.getPermanent(event.getSourceId()); + if (permanent == null) { + permanent = (Permanent) game.getLastKnownInformation(event.getSourceId(), Zone.BATTLEFIELD); + } + if (permanent != null && permanent.getCardType().contains(CardType.LAND)) { + getEffects().get(0).setTargetPointer(new FixedTarget(permanent.getControllerId())); + return true; + } + } + return false; + } - @Override - public ManabarbsTriggeredAbility copy() { - return new ManabarbsTriggeredAbility(this); - } + @Override + public ManabarbsTriggeredAbility copy() { + return new ManabarbsTriggeredAbility(this); + } - @Override - public String getRule() { - return staticText; - } + @Override + public String getRule() { + return staticText; + } } diff --git a/Mage.Sets/src/mage/sets/tenth/Megrim.java b/Mage.Sets/src/mage/sets/tenth/Megrim.java index dfc8e0cb51..8e83165013 100644 --- a/Mage.Sets/src/mage/sets/tenth/Megrim.java +++ b/Mage.Sets/src/mage/sets/tenth/Megrim.java @@ -49,7 +49,7 @@ public class Megrim extends CardImpl { public Megrim (UUID ownerId) { super(ownerId, 157, "Megrim", Rarity.UNCOMMON, new CardType[]{CardType.ENCHANTMENT}, "{2}{B}"); this.expansionSetCode = "10E"; - this.color.setBlack(true); + this.color.setBlack(true); this.addAbility(new MergimTriggeredAbility()); } diff --git a/Mage.Sets/src/mage/sets/tenth/MindRot.java b/Mage.Sets/src/mage/sets/tenth/MindRot.java index 106825a43f..7f30d77bc8 100644 --- a/Mage.Sets/src/mage/sets/tenth/MindRot.java +++ b/Mage.Sets/src/mage/sets/tenth/MindRot.java @@ -49,12 +49,12 @@ public class MindRot extends CardImpl { this.getSpellAbility().addEffect(new DiscardTargetEffect(2)); } - public MindRot(final MindRot card) { - super(card); - } + public MindRot(final MindRot card) { + super(card); + } - @Override - public MindRot copy() { - return new MindRot(this); - } + @Override + public MindRot copy() { + return new MindRot(this); + } } diff --git a/Mage.Sets/src/mage/sets/tenth/Mountain1.java b/Mage.Sets/src/mage/sets/tenth/Mountain1.java index 2afca25798..247e402fb1 100644 --- a/Mage.Sets/src/mage/sets/tenth/Mountain1.java +++ b/Mage.Sets/src/mage/sets/tenth/Mountain1.java @@ -36,18 +36,18 @@ import java.util.UUID; */ public class Mountain1 extends mage.cards.basiclands.Mountain { - public Mountain1(UUID ownerId) { - super(ownerId, 376); - this.expansionSetCode = "10E"; - } + public Mountain1(UUID ownerId) { + super(ownerId, 376); + this.expansionSetCode = "10E"; + } - public Mountain1(final Mountain1 card) { - super(card); - } + public Mountain1(final Mountain1 card) { + super(card); + } - @Override - public Mountain1 copy() { - return new Mountain1(this); - } + @Override + public Mountain1 copy() { + return new Mountain1(this); + } } diff --git a/Mage.Sets/src/mage/sets/tenth/Mountain2.java b/Mage.Sets/src/mage/sets/tenth/Mountain2.java index 9e9620bd82..af84a825a1 100644 --- a/Mage.Sets/src/mage/sets/tenth/Mountain2.java +++ b/Mage.Sets/src/mage/sets/tenth/Mountain2.java @@ -36,18 +36,18 @@ import java.util.UUID; */ public class Mountain2 extends mage.cards.basiclands.Mountain { - public Mountain2(UUID ownerId) { - super(ownerId, 377); - this.expansionSetCode = "10E"; - } + public Mountain2(UUID ownerId) { + super(ownerId, 377); + this.expansionSetCode = "10E"; + } - public Mountain2(final Mountain2 card) { - super(card); - } + public Mountain2(final Mountain2 card) { + super(card); + } - @Override - public Mountain2 copy() { - return new Mountain2(this); - } + @Override + public Mountain2 copy() { + return new Mountain2(this); + } } diff --git a/Mage.Sets/src/mage/sets/tenth/Mountain3.java b/Mage.Sets/src/mage/sets/tenth/Mountain3.java index bf71bc6068..08391e190a 100644 --- a/Mage.Sets/src/mage/sets/tenth/Mountain3.java +++ b/Mage.Sets/src/mage/sets/tenth/Mountain3.java @@ -36,18 +36,18 @@ import java.util.UUID; */ public class Mountain3 extends mage.cards.basiclands.Mountain { - public Mountain3(UUID ownerId) { - super(ownerId, 378); - this.expansionSetCode = "10E"; - } + public Mountain3(UUID ownerId) { + super(ownerId, 378); + this.expansionSetCode = "10E"; + } - public Mountain3(final Mountain3 card) { - super(card); - } + public Mountain3(final Mountain3 card) { + super(card); + } - @Override - public Mountain3 copy() { - return new Mountain3(this); - } + @Override + public Mountain3 copy() { + return new Mountain3(this); + } } diff --git a/Mage.Sets/src/mage/sets/tenth/Mountain4.java b/Mage.Sets/src/mage/sets/tenth/Mountain4.java index 885352917c..55d0f29352 100644 --- a/Mage.Sets/src/mage/sets/tenth/Mountain4.java +++ b/Mage.Sets/src/mage/sets/tenth/Mountain4.java @@ -36,18 +36,18 @@ import java.util.UUID; */ public class Mountain4 extends mage.cards.basiclands.Mountain { - public Mountain4(UUID ownerId) { - super(ownerId, 379); - this.expansionSetCode = "10E"; - } + public Mountain4(UUID ownerId) { + super(ownerId, 379); + this.expansionSetCode = "10E"; + } - public Mountain4(final Mountain4 card) { - super(card); - } + public Mountain4(final Mountain4 card) { + super(card); + } - @Override - public Mountain4 copy() { - return new Mountain4(this); - } + @Override + public Mountain4 copy() { + return new Mountain4(this); + } } diff --git a/Mage.Sets/src/mage/sets/tenth/Naturalize.java b/Mage.Sets/src/mage/sets/tenth/Naturalize.java index 8a6e9d5af0..0e17bd89fa 100644 --- a/Mage.Sets/src/mage/sets/tenth/Naturalize.java +++ b/Mage.Sets/src/mage/sets/tenth/Naturalize.java @@ -43,28 +43,28 @@ import mage.target.TargetPermanent; */ public class Naturalize extends CardImpl { - private static final FilterPermanent filter = new FilterPermanent("artifact or enchantment"); + private static final FilterPermanent filter = new FilterPermanent("artifact or enchantment"); - static { - filter.getCardType().add(CardType.ARTIFACT); - filter.getCardType().add(CardType.ENCHANTMENT); - filter.setScopeCardType(ComparisonScope.Any); - } + static { + filter.getCardType().add(CardType.ARTIFACT); + filter.getCardType().add(CardType.ENCHANTMENT); + filter.setScopeCardType(ComparisonScope.Any); + } - public Naturalize(UUID ownerId){ - super(ownerId, 282, "Naturalize", Rarity.COMMON, new CardType[]{CardType.INSTANT},"{1}{G}"); - this.expansionSetCode = "10E"; - this.color.setGreen(true); - this.getSpellAbility().addTarget(new TargetPermanent(filter)); - this.getSpellAbility().addEffect(new DestroyTargetEffect()); - } + public Naturalize(UUID ownerId){ + super(ownerId, 282, "Naturalize", Rarity.COMMON, new CardType[]{CardType.INSTANT},"{1}{G}"); + this.expansionSetCode = "10E"; + this.color.setGreen(true); + this.getSpellAbility().addTarget(new TargetPermanent(filter)); + this.getSpellAbility().addEffect(new DestroyTargetEffect()); + } - public Naturalize(final Naturalize card) { - super(card); - } + public Naturalize(final Naturalize card) { + super(card); + } - @Override - public Naturalize copy() { - return new Naturalize(this); - } + @Override + public Naturalize copy() { + return new Naturalize(this); + } } diff --git a/Mage.Sets/src/mage/sets/tenth/Ornithopter.java b/Mage.Sets/src/mage/sets/tenth/Ornithopter.java index 19c1fe028d..8ab7b2920f 100644 --- a/Mage.Sets/src/mage/sets/tenth/Ornithopter.java +++ b/Mage.Sets/src/mage/sets/tenth/Ornithopter.java @@ -41,23 +41,23 @@ import mage.cards.CardImpl; */ public class Ornithopter extends CardImpl { - public Ornithopter(UUID ownerId) { - super(ownerId, 336, "Ornithopter", Rarity.COMMON, new CardType[]{CardType.CREATURE, CardType.ARTIFACT}, "{0}"); - this.expansionSetCode = "10E"; - this.subtype.add("Thopter"); - this.power = new MageInt(0); - this.toughness = new MageInt(2); + public Ornithopter(UUID ownerId) { + super(ownerId, 336, "Ornithopter", Rarity.COMMON, new CardType[]{CardType.CREATURE, CardType.ARTIFACT}, "{0}"); + this.expansionSetCode = "10E"; + this.subtype.add("Thopter"); + this.power = new MageInt(0); + this.toughness = new MageInt(2); - this.addAbility(FlyingAbility.getInstance()); - } + this.addAbility(FlyingAbility.getInstance()); + } - public Ornithopter(final Ornithopter card) { - super(card); - } + public Ornithopter(final Ornithopter card) { + super(card); + } - @Override - public Ornithopter copy() { - return new Ornithopter(this); - } + @Override + public Ornithopter copy() { + return new Ornithopter(this); + } } diff --git a/Mage.Sets/src/mage/sets/tenth/Pacifism.java b/Mage.Sets/src/mage/sets/tenth/Pacifism.java index 9830bbe5b7..7457660c01 100644 --- a/Mage.Sets/src/mage/sets/tenth/Pacifism.java +++ b/Mage.Sets/src/mage/sets/tenth/Pacifism.java @@ -51,63 +51,63 @@ import mage.target.common.TargetCreaturePermanent; */ public class Pacifism extends CardImpl { - public Pacifism(UUID ownerId) { - super(ownerId, 31, "Pacifism", Rarity.COMMON, new CardType[]{CardType.ENCHANTMENT}, "{1}{W}"); - this.expansionSetCode = "10E"; - this.color.setWhite(true); - this.subtype.add("Aura"); + public Pacifism(UUID ownerId) { + super(ownerId, 31, "Pacifism", Rarity.COMMON, new CardType[]{CardType.ENCHANTMENT}, "{1}{W}"); + this.expansionSetCode = "10E"; + this.color.setWhite(true); + this.subtype.add("Aura"); - TargetPermanent auraTarget = new TargetCreaturePermanent(); - this.getSpellAbility().addTarget(auraTarget); - this.getSpellAbility().addEffect(new AttachEffect(Outcome.Removal)); - Ability ability = new EnchantAbility(auraTarget.getTargetName()); - this.addAbility(ability); - this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new PacifismEffect())); + TargetPermanent auraTarget = new TargetCreaturePermanent(); + this.getSpellAbility().addTarget(auraTarget); + this.getSpellAbility().addEffect(new AttachEffect(Outcome.Removal)); + Ability ability = new EnchantAbility(auraTarget.getTargetName()); + this.addAbility(ability); + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new PacifismEffect())); - } + } - public Pacifism(final Pacifism card) { - super(card); - } + public Pacifism(final Pacifism card) { + super(card); + } - @Override - public Pacifism copy() { - return new Pacifism(this); - } + @Override + public Pacifism copy() { + return new Pacifism(this); + } } class PacifismEffect extends RestrictionEffect { - public PacifismEffect() { - super(Duration.WhileOnBattlefield); - staticText = "Enchanted creature can't attack or block"; - } + public PacifismEffect() { + super(Duration.WhileOnBattlefield); + staticText = "Enchanted creature can't attack or block"; + } - public PacifismEffect(final PacifismEffect effect) { - super(effect); - } + public PacifismEffect(final PacifismEffect effect) { + super(effect); + } - @Override - public boolean applies(Permanent permanent, Ability source, Game game) { - if (permanent.getAttachments().contains((source.getSourceId()))) { - return true; - } - return false; - } + @Override + public boolean applies(Permanent permanent, Ability source, Game game) { + if (permanent.getAttachments().contains((source.getSourceId()))) { + return true; + } + return false; + } - @Override - public boolean canAttack(Game game) { - return false; - } + @Override + public boolean canAttack(Game game) { + return false; + } - @Override - public boolean canBlock(Permanent attacker, Permanent blocker, Ability source, Game game) { - return false; - } + @Override + public boolean canBlock(Permanent attacker, Permanent blocker, Ability source, Game game) { + return false; + } - @Override - public PacifismEffect copy() { - return new PacifismEffect(this); - } + @Override + public PacifismEffect copy() { + return new PacifismEffect(this); + } } diff --git a/Mage.Sets/src/mage/sets/tenth/PhyrexianRager.java b/Mage.Sets/src/mage/sets/tenth/PhyrexianRager.java index c8726ca79d..b13ae7b25a 100644 --- a/Mage.Sets/src/mage/sets/tenth/PhyrexianRager.java +++ b/Mage.Sets/src/mage/sets/tenth/PhyrexianRager.java @@ -48,7 +48,7 @@ public class PhyrexianRager extends CardImpl { super(ownerId, 167, "Phyrexian Rager", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{2}{B}"); this.expansionSetCode = "10E"; this.subtype.add("Horror"); - this.color.setBlack(true); + this.color.setBlack(true); this.power = new MageInt(2); this.toughness = new MageInt(2); Ability ability = new EntersBattlefieldTriggeredAbility(new DrawCardControllerEffect(1), false); diff --git a/Mage.Sets/src/mage/sets/tenth/Plains1.java b/Mage.Sets/src/mage/sets/tenth/Plains1.java index ca1ac03419..10406347fb 100644 --- a/Mage.Sets/src/mage/sets/tenth/Plains1.java +++ b/Mage.Sets/src/mage/sets/tenth/Plains1.java @@ -36,18 +36,18 @@ import java.util.UUID; */ public class Plains1 extends mage.cards.basiclands.Plains { - public Plains1(UUID ownerId) { - super(ownerId, 364); - this.expansionSetCode = "10E"; - } + public Plains1(UUID ownerId) { + super(ownerId, 364); + this.expansionSetCode = "10E"; + } - public Plains1(final Plains1 card) { - super(card); - } + public Plains1(final Plains1 card) { + super(card); + } - @Override - public Plains1 copy() { - return new Plains1(this); - } + @Override + public Plains1 copy() { + return new Plains1(this); + } } diff --git a/Mage.Sets/src/mage/sets/tenth/Plains2.java b/Mage.Sets/src/mage/sets/tenth/Plains2.java index 597eef3c5b..cbd274166a 100644 --- a/Mage.Sets/src/mage/sets/tenth/Plains2.java +++ b/Mage.Sets/src/mage/sets/tenth/Plains2.java @@ -36,18 +36,18 @@ import java.util.UUID; */ public class Plains2 extends mage.cards.basiclands.Plains { - public Plains2(UUID ownerId) { - super(ownerId, 365); - this.expansionSetCode = "10E"; - } + public Plains2(UUID ownerId) { + super(ownerId, 365); + this.expansionSetCode = "10E"; + } - public Plains2(final Plains2 card) { - super(card); - } + public Plains2(final Plains2 card) { + super(card); + } - @Override - public Plains2 copy() { - return new Plains2(this); - } + @Override + public Plains2 copy() { + return new Plains2(this); + } } diff --git a/Mage.Sets/src/mage/sets/tenth/Plains3.java b/Mage.Sets/src/mage/sets/tenth/Plains3.java index 7071a0786a..33347b67c3 100644 --- a/Mage.Sets/src/mage/sets/tenth/Plains3.java +++ b/Mage.Sets/src/mage/sets/tenth/Plains3.java @@ -36,18 +36,18 @@ import java.util.UUID; */ public class Plains3 extends mage.cards.basiclands.Plains { - public Plains3(UUID ownerId) { - super(ownerId, 366); - this.expansionSetCode = "10E"; - } + public Plains3(UUID ownerId) { + super(ownerId, 366); + this.expansionSetCode = "10E"; + } - public Plains3(final Plains3 card) { - super(card); - } + public Plains3(final Plains3 card) { + super(card); + } - @Override - public Plains3 copy() { - return new Plains3(this); - } + @Override + public Plains3 copy() { + return new Plains3(this); + } } diff --git a/Mage.Sets/src/mage/sets/tenth/Plains4.java b/Mage.Sets/src/mage/sets/tenth/Plains4.java index a6dcce9dc7..82dbaae825 100644 --- a/Mage.Sets/src/mage/sets/tenth/Plains4.java +++ b/Mage.Sets/src/mage/sets/tenth/Plains4.java @@ -36,18 +36,18 @@ import java.util.UUID; */ public class Plains4 extends mage.cards.basiclands.Plains { - public Plains4(UUID ownerId) { - super(ownerId, 367); - this.expansionSetCode = "10E"; - } + public Plains4(UUID ownerId) { + super(ownerId, 367); + this.expansionSetCode = "10E"; + } - public Plains4(final Plains4 card) { - super(card); - } + public Plains4(final Plains4 card) { + super(card); + } - @Override - public Plains4 copy() { - return new Plains4(this); - } + @Override + public Plains4 copy() { + return new Plains4(this); + } } diff --git a/Mage.Sets/src/mage/sets/tenth/PlatinumAngel.java b/Mage.Sets/src/mage/sets/tenth/PlatinumAngel.java index c75416a41d..3d92bc6689 100644 --- a/Mage.Sets/src/mage/sets/tenth/PlatinumAngel.java +++ b/Mage.Sets/src/mage/sets/tenth/PlatinumAngel.java @@ -50,61 +50,61 @@ import mage.game.events.GameEvent.EventType; */ public class PlatinumAngel extends CardImpl { - public PlatinumAngel(UUID ownerId) { - super(ownerId, 339, "Platinum Angel", Rarity.RARE, new CardType[]{CardType.ARTIFACT, CardType.CREATURE}, "{7}"); - this.expansionSetCode = "10E"; - this.subtype.add("Angel"); - this.power = new MageInt(4); - this.toughness = new MageInt(4); + public PlatinumAngel(UUID ownerId) { + super(ownerId, 339, "Platinum Angel", Rarity.RARE, new CardType[]{CardType.ARTIFACT, CardType.CREATURE}, "{7}"); + this.expansionSetCode = "10E"; + this.subtype.add("Angel"); + this.power = new MageInt(4); + this.toughness = new MageInt(4); - this.addAbility(FlyingAbility.getInstance()); - this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new PlatinumAngelEffect())); - } + this.addAbility(FlyingAbility.getInstance()); + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new PlatinumAngelEffect())); + } - public PlatinumAngel(final PlatinumAngel card) { - super(card); - } + public PlatinumAngel(final PlatinumAngel card) { + super(card); + } - @Override - public PlatinumAngel copy() { - return new PlatinumAngel(this); - } + @Override + public PlatinumAngel copy() { + return new PlatinumAngel(this); + } - class PlatinumAngelEffect extends ReplacementEffectImpl { + class PlatinumAngelEffect extends ReplacementEffectImpl { - public PlatinumAngelEffect() { - super(Duration.WhileOnBattlefield, Outcome.Benefit); - staticText = "You can't lose the game and your opponents can't win the game"; - } + public PlatinumAngelEffect() { + super(Duration.WhileOnBattlefield, Outcome.Benefit); + staticText = "You can't lose the game and your opponents can't win the game"; + } - public PlatinumAngelEffect(final PlatinumAngelEffect effect) { - super(effect); - } + public PlatinumAngelEffect(final PlatinumAngelEffect effect) { + super(effect); + } - @Override - public PlatinumAngelEffect copy() { - return new PlatinumAngelEffect(this); - } + @Override + public PlatinumAngelEffect copy() { + return new PlatinumAngelEffect(this); + } - @Override - public boolean apply(Game game, Ability source) { - return true; - } + @Override + public boolean apply(Game game, Ability source) { + return true; + } - @Override - public boolean replaceEvent(GameEvent event, Ability source, Game game) { - return true; - } + @Override + public boolean replaceEvent(GameEvent event, Ability source, Game game) { + return true; + } - @Override - public boolean applies(GameEvent event, Ability source, Game game) { - if ((event.getType() == EventType.WINS && game.getOpponents(source.getControllerId()).contains(event.getPlayerId())) || - (event.getType() == EventType.LOSES && event.getPlayerId().equals(source.getControllerId()))) { - return true; - } - return false; - } + @Override + public boolean applies(GameEvent event, Ability source, Game game) { + if ((event.getType() == EventType.WINS && game.getOpponents(source.getControllerId()).contains(event.getPlayerId())) || + (event.getType() == EventType.LOSES && event.getPlayerId().equals(source.getControllerId()))) { + return true; + } + return false; + } - } + } } diff --git a/Mage.Sets/src/mage/sets/tenth/ProdigalPyromancer.java b/Mage.Sets/src/mage/sets/tenth/ProdigalPyromancer.java index 4e98b4fefb..b0e33d7b34 100644 --- a/Mage.Sets/src/mage/sets/tenth/ProdigalPyromancer.java +++ b/Mage.Sets/src/mage/sets/tenth/ProdigalPyromancer.java @@ -46,27 +46,27 @@ import mage.target.common.TargetCreatureOrPlayer; */ public class ProdigalPyromancer extends CardImpl { - public ProdigalPyromancer(UUID ownerId) { - super(ownerId, 221, "Prodigal Pyromancer", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{2}{R}"); - this.expansionSetCode = "10E"; - this.subtype.add("Human"); - this.subtype.add("Wizard"); - this.color.setRed(true); - this.power = new MageInt(1); - this.toughness = new MageInt(1); + public ProdigalPyromancer(UUID ownerId) { + super(ownerId, 221, "Prodigal Pyromancer", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{2}{R}"); + this.expansionSetCode = "10E"; + this.subtype.add("Human"); + this.subtype.add("Wizard"); + this.color.setRed(true); + this.power = new MageInt(1); + this.toughness = new MageInt(1); - Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DamageTargetEffect(1), new TapSourceCost()); - ability.addTarget(new TargetCreatureOrPlayer()); - this.addAbility(ability); - } + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DamageTargetEffect(1), new TapSourceCost()); + ability.addTarget(new TargetCreatureOrPlayer()); + this.addAbility(ability); + } - public ProdigalPyromancer(final ProdigalPyromancer card) { - super(card); - } + public ProdigalPyromancer(final ProdigalPyromancer card) { + super(card); + } - @Override - public ProdigalPyromancer copy() { - return new ProdigalPyromancer(this); - } + @Override + public ProdigalPyromancer copy() { + return new ProdigalPyromancer(this); + } } diff --git a/Mage.Sets/src/mage/sets/tenth/Pyroclasm.java b/Mage.Sets/src/mage/sets/tenth/Pyroclasm.java index 4a31ee2db7..08aaabe603 100644 --- a/Mage.Sets/src/mage/sets/tenth/Pyroclasm.java +++ b/Mage.Sets/src/mage/sets/tenth/Pyroclasm.java @@ -41,19 +41,19 @@ import mage.filter.common.FilterCreaturePermanent; */ public class Pyroclasm extends CardImpl { - public Pyroclasm(UUID ownerId) { - super(ownerId, 222, "Pyroclasm", Rarity.UNCOMMON, new CardType[]{CardType.SORCERY}, "{1}{R}"); - this.expansionSetCode = "10E"; - this.color.setRed(true); - this.getSpellAbility().addEffect(new DamageAllEffect(2, new FilterCreaturePermanent())); - } + public Pyroclasm(UUID ownerId) { + super(ownerId, 222, "Pyroclasm", Rarity.UNCOMMON, new CardType[]{CardType.SORCERY}, "{1}{R}"); + this.expansionSetCode = "10E"; + this.color.setRed(true); + this.getSpellAbility().addEffect(new DamageAllEffect(2, new FilterCreaturePermanent())); + } - public Pyroclasm(final Pyroclasm card) { - super(card); - } + public Pyroclasm(final Pyroclasm card) { + super(card); + } - @Override - public Pyroclasm copy() { - return new Pyroclasm(this); - } + @Override + public Pyroclasm copy() { + return new Pyroclasm(this); + } } diff --git a/Mage.Sets/src/mage/sets/tenth/RavenousRats.java b/Mage.Sets/src/mage/sets/tenth/RavenousRats.java index c832847b7c..66c310224a 100644 --- a/Mage.Sets/src/mage/sets/tenth/RavenousRats.java +++ b/Mage.Sets/src/mage/sets/tenth/RavenousRats.java @@ -48,7 +48,7 @@ public class RavenousRats extends CardImpl { super(ownerId, 171, "Ravenous Rats", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{1}{B}"); this.expansionSetCode = "10E"; this.subtype.add("Rat"); - this.color.setBlack(true); + this.color.setBlack(true); this.power = new MageInt(1); this.toughness = new MageInt(1); Ability ability = new EntersBattlefieldTriggeredAbility(new DiscardTargetEffect(1)); diff --git a/Mage.Sets/src/mage/sets/tenth/RazormaneMasticore.java b/Mage.Sets/src/mage/sets/tenth/RazormaneMasticore.java index e1ed4760af..da2d266dfa 100644 --- a/Mage.Sets/src/mage/sets/tenth/RazormaneMasticore.java +++ b/Mage.Sets/src/mage/sets/tenth/RazormaneMasticore.java @@ -59,10 +59,10 @@ public class RazormaneMasticore extends CardImpl { // First strike this.addAbility(FirstStrikeAbility.getInstance()); - + // At the beginning of your upkeep, sacrifice Razormane Masticore unless you discard a card. this.addAbility(new BeginningOfUpkeepTriggeredAbility(Constants.Zone.BATTLEFIELD, new SacrificeSourceUnlessPaysEffect(new DiscardTargetCost(new TargetCardInHand())), Constants.TargetController.YOU, false)); - + // At the beginning of your draw step, you may have Razormane Masticore deal 3 damage to target creature. Ability ability = new BeginningOfDrawTriggeredAbility(Constants.Zone.BATTLEFIELD, new DamageTargetEffect(3), Constants.TargetController.YOU, true); ability.addTarget(new TargetCreaturePermanent()); diff --git a/Mage.Sets/src/mage/sets/tenth/RelentlessRats.java b/Mage.Sets/src/mage/sets/tenth/RelentlessRats.java index 86a0af7c80..b303c5c657 100644 --- a/Mage.Sets/src/mage/sets/tenth/RelentlessRats.java +++ b/Mage.Sets/src/mage/sets/tenth/RelentlessRats.java @@ -51,61 +51,61 @@ import mage.game.permanent.Permanent; */ public class RelentlessRats extends CardImpl { - private final static FilterCreaturePermanent filter = new FilterCreaturePermanent(); - - static { - filter.getName().add("Relentless Rats"); - } + private final static FilterCreaturePermanent filter = new FilterCreaturePermanent(); - public RelentlessRats(UUID ownerId) { - super(ownerId, 173, "Relentless Rats", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{1}{B}{B}"); - this.expansionSetCode = "10E"; - this.subtype.add("Rat"); - this.color.setBlack(true); - this.power = new MageInt(2); - this.toughness = new MageInt(2); + static { + filter.getName().add("Relentless Rats"); + } - this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new RelentlessRatsEffect())); - } + public RelentlessRats(UUID ownerId) { + super(ownerId, 173, "Relentless Rats", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{1}{B}{B}"); + this.expansionSetCode = "10E"; + this.subtype.add("Rat"); + this.color.setBlack(true); + this.power = new MageInt(2); + this.toughness = new MageInt(2); - public RelentlessRats(final RelentlessRats card) { - super(card); - } + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new RelentlessRatsEffect())); + } - @Override - public RelentlessRats copy() { - return new RelentlessRats(this); - } - - class RelentlessRatsEffect extends ContinuousEffectImpl { + public RelentlessRats(final RelentlessRats card) { + super(card); + } - public RelentlessRatsEffect() { - super(Duration.WhileOnBattlefield, Layer.PTChangingEffects_7, SubLayer.ModifyPT_7c, Outcome.BoostCreature); - staticText = "{this} gets +1/+1 for each other creature on the battlefield named Relentless Rats"; - } + @Override + public RelentlessRats copy() { + return new RelentlessRats(this); + } - public RelentlessRatsEffect(final RelentlessRatsEffect effect) { - super(effect); - } + class RelentlessRatsEffect extends ContinuousEffectImpl { - @Override - public RelentlessRatsEffect copy() { - return new RelentlessRatsEffect(this); - } + public RelentlessRatsEffect() { + super(Duration.WhileOnBattlefield, Layer.PTChangingEffects_7, SubLayer.ModifyPT_7c, Outcome.BoostCreature); + staticText = "{this} gets +1/+1 for each other creature on the battlefield named Relentless Rats"; + } - @Override - public boolean apply(Game game, Ability source) { - int count = game.getBattlefield().count(filter, source.getControllerId(), game) - 1; - if (count > 0) { - Permanent target = (Permanent) game.getPermanent(source.getSourceId()); - if (target != null) { - target.addPower(count); - target.addToughness(count); - return true; - } - } - return false; - } + public RelentlessRatsEffect(final RelentlessRatsEffect effect) { + super(effect); + } - } + @Override + public RelentlessRatsEffect copy() { + return new RelentlessRatsEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + int count = game.getBattlefield().count(filter, source.getControllerId(), game) - 1; + if (count > 0) { + Permanent target = (Permanent) game.getPermanent(source.getSourceId()); + if (target != null) { + target.addPower(count); + target.addToughness(count); + return true; + } + } + return false; + } + + } } diff --git a/Mage.Sets/src/mage/sets/tenth/RobeOfMirrors.java b/Mage.Sets/src/mage/sets/tenth/RobeOfMirrors.java index eb7688826a..c891fdb320 100644 --- a/Mage.Sets/src/mage/sets/tenth/RobeOfMirrors.java +++ b/Mage.Sets/src/mage/sets/tenth/RobeOfMirrors.java @@ -54,11 +54,11 @@ public class RobeOfMirrors extends CardImpl { this.subtype.add("Aura"); this.color.setBlue(true); TargetPermanent auraTarget = new TargetCreaturePermanent(); - this.getSpellAbility().addTarget(auraTarget); - this.getSpellAbility().addEffect(new AttachEffect(Constants.Outcome.AddAbility)); - Ability ability = new EnchantAbility(auraTarget.getTargetName()); - this.addAbility(ability); - this.addAbility(new SimpleStaticAbility(Constants.Zone.BATTLEFIELD, new GainAbilityAttachedEffect(ShroudAbility.getInstance(), Constants.AttachmentType.AURA))); + this.getSpellAbility().addTarget(auraTarget); + this.getSpellAbility().addEffect(new AttachEffect(Constants.Outcome.AddAbility)); + Ability ability = new EnchantAbility(auraTarget.getTargetName()); + this.addAbility(ability); + this.addAbility(new SimpleStaticAbility(Constants.Zone.BATTLEFIELD, new GainAbilityAttachedEffect(ShroudAbility.getInstance(), Constants.AttachmentType.AURA))); } public RobeOfMirrors(final RobeOfMirrors card) { diff --git a/Mage.Sets/src/mage/sets/tenth/RoyalAssassin.java b/Mage.Sets/src/mage/sets/tenth/RoyalAssassin.java index 033cdf05e1..7d3caf89d2 100644 --- a/Mage.Sets/src/mage/sets/tenth/RoyalAssassin.java +++ b/Mage.Sets/src/mage/sets/tenth/RoyalAssassin.java @@ -49,10 +49,10 @@ public class RoyalAssassin extends CardImpl { private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("tapped creature"); - static { - filter.setUseTapped(true); - filter.setTapped(true); - } + static { + filter.setUseTapped(true); + filter.setTapped(true); + } public RoyalAssassin(UUID ownerId){ super(ownerId, 174, "Royal Assassin", Rarity.RARE, new CardType[]{CardType.CREATURE},"{1}{B}{B}"); @@ -63,17 +63,17 @@ public class RoyalAssassin extends CardImpl { this.power = new MageInt(1); this.toughness = new MageInt(1); - Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DestroyTargetEffect(), new TapSourceCost()); - ability.addTarget(new TargetCreaturePermanent(filter)); + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DestroyTargetEffect(), new TapSourceCost()); + ability.addTarget(new TargetCreaturePermanent(filter)); this.addAbility(ability); } - public RoyalAssassin(final RoyalAssassin card) { - super(card); - } + public RoyalAssassin(final RoyalAssassin card) { + super(card); + } - @Override - public RoyalAssassin copy() { - return new RoyalAssassin(this); - } + @Override + public RoyalAssassin copy() { + return new RoyalAssassin(this); + } } diff --git a/Mage.Sets/src/mage/sets/tenth/Scalpelexis.java b/Mage.Sets/src/mage/sets/tenth/Scalpelexis.java index 5ca20b1964..e913c6509e 100644 --- a/Mage.Sets/src/mage/sets/tenth/Scalpelexis.java +++ b/Mage.Sets/src/mage/sets/tenth/Scalpelexis.java @@ -60,7 +60,7 @@ public class Scalpelexis extends CardImpl { // Flying this.addAbility(FlyingAbility.getInstance()); - + // Whenever Scalpelexis deals combat damage to a player, that player exiles the top four cards of his or her library. If two or more of those cards have the same name, repeat this process. this.addAbility(new DealsCombatDamageToAPlayerTriggeredAbility(new ScalpelexisEffect(), false, true)); } @@ -76,7 +76,7 @@ public class Scalpelexis extends CardImpl { } class ScalpelexisEffect extends OneShotEffect { - + public ScalpelexisEffect() { super(Constants.Outcome.Exile); this.staticText = "that player exiles the top four cards of his or her library. If two or more of those cards have the same name, repeat this process"; @@ -90,13 +90,13 @@ class ScalpelexisEffect extends OneShotEffect { public ScalpelexisEffect copy() { return new ScalpelexisEffect(this); } - + @Override public boolean apply(Game game, Ability source) { Player player = game.getPlayer(targetPointer.getFirst(game, source)); List namesFiltered = new ArrayList(); boolean doneOnce = false; - + while (checkDuplicatedNames(namesFiltered) || !doneOnce) { doneOnce = true; namesFiltered.clear(); @@ -111,9 +111,9 @@ class ScalpelexisEffect extends OneShotEffect { } return true; } - + public boolean checkDuplicatedNames(List string) { - for (int i = 0; i < string.size()-1; i++) { + for (int i = 0; i < string.size()-1; i++) { String stringToCheck = string.get(i); if(stringToCheck == null) continue; //empty ignore for (int j = i+1; j < string.size(); j++) { @@ -122,7 +122,7 @@ class ScalpelexisEffect extends OneShotEffect { return true; } } - } - return false; + } + return false; } } \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/tenth/SengirVampire.java b/Mage.Sets/src/mage/sets/tenth/SengirVampire.java index 9f90e33762..4545174095 100644 --- a/Mage.Sets/src/mage/sets/tenth/SengirVampire.java +++ b/Mage.Sets/src/mage/sets/tenth/SengirVampire.java @@ -43,29 +43,29 @@ import java.util.UUID; */ public class SengirVampire extends CardImpl { - public SengirVampire(UUID ownerId) { - super(ownerId, 176, "Sengir Vampire", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{3}{B}{B}"); - this.expansionSetCode = "10E"; - this.subtype.add("Vampire"); + public SengirVampire(UUID ownerId) { + super(ownerId, 176, "Sengir Vampire", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{3}{B}{B}"); + this.expansionSetCode = "10E"; + this.subtype.add("Vampire"); - this.color.setBlack(true); - this.power = new MageInt(4); - this.toughness = new MageInt(4); + this.color.setBlack(true); + this.power = new MageInt(4); + this.toughness = new MageInt(4); - this.addAbility(FlyingAbility.getInstance()); + this.addAbility(FlyingAbility.getInstance()); - // Whenever a creature dealt damage by Sengir Vampire this turn dies, put a +1/+1 counter on Sengir Vampire. - this.addAbility(new DiesAndDealtDamageThisTurnTriggeredAbility(new AddCountersSourceEffect(CounterType.P1P1.createInstance()), false)); - } + // Whenever a creature dealt damage by Sengir Vampire this turn dies, put a +1/+1 counter on Sengir Vampire. + this.addAbility(new DiesAndDealtDamageThisTurnTriggeredAbility(new AddCountersSourceEffect(CounterType.P1P1.createInstance()), false)); + } - public SengirVampire(final SengirVampire card) { - super(card); - } + public SengirVampire(final SengirVampire card) { + super(card); + } - @Override - public SengirVampire copy() { - return new SengirVampire(this); - } + @Override + public SengirVampire copy() { + return new SengirVampire(this); + } } diff --git a/Mage.Sets/src/mage/sets/tenth/SerraAngel.java b/Mage.Sets/src/mage/sets/tenth/SerraAngel.java index 0eb9025e09..54494ef429 100644 --- a/Mage.Sets/src/mage/sets/tenth/SerraAngel.java +++ b/Mage.Sets/src/mage/sets/tenth/SerraAngel.java @@ -42,25 +42,25 @@ import mage.cards.CardImpl; */ public class SerraAngel extends CardImpl { - public SerraAngel(UUID ownerId) { - super(ownerId, 39, "Serra Angel", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{3}{W}{W}"); - this.expansionSetCode = "10E"; - this.subtype.add("Angel"); - this.color.setWhite(true); - this.power = new MageInt(4); - this.toughness = new MageInt(4); + public SerraAngel(UUID ownerId) { + super(ownerId, 39, "Serra Angel", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{3}{W}{W}"); + this.expansionSetCode = "10E"; + this.subtype.add("Angel"); + this.color.setWhite(true); + this.power = new MageInt(4); + this.toughness = new MageInt(4); - this.addAbility(FlyingAbility.getInstance()); - this.addAbility(VigilanceAbility.getInstance()); - } + this.addAbility(FlyingAbility.getInstance()); + this.addAbility(VigilanceAbility.getInstance()); + } - public SerraAngel(final SerraAngel card) { - super(card); - } + public SerraAngel(final SerraAngel card) { + super(card); + } - @Override - public SerraAngel copy() { - return new SerraAngel(this); - } + @Override + public SerraAngel copy() { + return new SerraAngel(this); + } } diff --git a/Mage.Sets/src/mage/sets/tenth/SerrasEmbrace.java b/Mage.Sets/src/mage/sets/tenth/SerrasEmbrace.java index 2f69443813..de55368074 100644 --- a/Mage.Sets/src/mage/sets/tenth/SerrasEmbrace.java +++ b/Mage.Sets/src/mage/sets/tenth/SerrasEmbrace.java @@ -56,11 +56,11 @@ public class SerrasEmbrace extends CardImpl { this.subtype.add("Aura"); this.color.setWhite(true); TargetPermanent auraTarget = new TargetCreaturePermanent(); - this.getSpellAbility().addTarget(auraTarget); - this.getSpellAbility().addEffect(new AttachEffect(Constants.Outcome.BoostCreature)); - Ability ability = new EnchantAbility(auraTarget.getTargetName()); - this.addAbility(ability); - this.addAbility(new SimpleStaticAbility(Constants.Zone.BATTLEFIELD, new BoostEnchantedEffect(2, 2, Constants.Duration.WhileOnBattlefield))); + this.getSpellAbility().addTarget(auraTarget); + this.getSpellAbility().addEffect(new AttachEffect(Constants.Outcome.BoostCreature)); + Ability ability = new EnchantAbility(auraTarget.getTargetName()); + this.addAbility(ability); + this.addAbility(new SimpleStaticAbility(Constants.Zone.BATTLEFIELD, new BoostEnchantedEffect(2, 2, Constants.Duration.WhileOnBattlefield))); this.addAbility(new SimpleStaticAbility(Constants.Zone.BATTLEFIELD, new GainAbilityAttachedEffect(FlyingAbility.getInstance(), Constants.AttachmentType.AURA))); this.addAbility(new SimpleStaticAbility(Constants.Zone.BATTLEFIELD, new GainAbilityAttachedEffect(VigilanceAbility.getInstance(), Constants.AttachmentType.AURA))); } diff --git a/Mage.Sets/src/mage/sets/tenth/SeveredLegion.java b/Mage.Sets/src/mage/sets/tenth/SeveredLegion.java index d3b961e742..286744c9ce 100644 --- a/Mage.Sets/src/mage/sets/tenth/SeveredLegion.java +++ b/Mage.Sets/src/mage/sets/tenth/SeveredLegion.java @@ -45,7 +45,7 @@ public class SeveredLegion extends CardImpl { super(ownerId, 177, "Severed Legion", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{1}{B}{B}"); this.expansionSetCode = "10E"; this.subtype.add("Zombie"); - this.color.setBlack(true); + this.color.setBlack(true); this.power = new MageInt(2); this.toughness = new MageInt(2); this.addAbility(FearAbility.getInstance()); diff --git a/Mage.Sets/src/mage/sets/tenth/Shock.java b/Mage.Sets/src/mage/sets/tenth/Shock.java index f9f177609b..50ac79e835 100644 --- a/Mage.Sets/src/mage/sets/tenth/Shock.java +++ b/Mage.Sets/src/mage/sets/tenth/Shock.java @@ -44,7 +44,7 @@ public class Shock extends CardImpl { public Shock (UUID ownerId) { super(ownerId, 232, "Shock", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{R}"); this.expansionSetCode = "10E"; - this.color.setRed(true); + this.color.setRed(true); this.getSpellAbility().addEffect(new DamageTargetEffect(2)); this.getSpellAbility().addTarget(new TargetCreatureOrPlayer()); } diff --git a/Mage.Sets/src/mage/sets/tenth/SpawningPool.java b/Mage.Sets/src/mage/sets/tenth/SpawningPool.java index cb875c916c..28fce25c01 100644 --- a/Mage.Sets/src/mage/sets/tenth/SpawningPool.java +++ b/Mage.Sets/src/mage/sets/tenth/SpawningPool.java @@ -76,7 +76,7 @@ class SkeletonToken extends Token { this.subtype.add("Skeleton"); color = ObjectColor.BLACK; power = new MageInt(1); - toughness = new MageInt(1); + toughness = new MageInt(1); this.addAbility(new SimpleActivatedAbility(Constants.Zone.BATTLEFIELD, new RegenerateSourceEffect(), new ColoredManaCost(Constants.ColoredManaSymbol.B))); } } \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/tenth/SpinedWurm.java b/Mage.Sets/src/mage/sets/tenth/SpinedWurm.java index a4970d170e..769195d8ed 100644 --- a/Mage.Sets/src/mage/sets/tenth/SpinedWurm.java +++ b/Mage.Sets/src/mage/sets/tenth/SpinedWurm.java @@ -40,23 +40,23 @@ import mage.cards.CardImpl; */ public class SpinedWurm extends CardImpl { - public SpinedWurm(UUID ownerId) { - super(ownerId, 298, "Spined Wurm", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{4}{G}"); - this.expansionSetCode = "10E"; - this.subtype.add("Wurm"); - this.color.setGreen(true); - this.power = new MageInt(5); - this.toughness = new MageInt(4); + public SpinedWurm(UUID ownerId) { + super(ownerId, 298, "Spined Wurm", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{4}{G}"); + this.expansionSetCode = "10E"; + this.subtype.add("Wurm"); + this.color.setGreen(true); + this.power = new MageInt(5); + this.toughness = new MageInt(4); - } + } - public SpinedWurm(final SpinedWurm card) { - super(card); - } + public SpinedWurm(final SpinedWurm card) { + super(card); + } - @Override - public SpinedWurm copy() { - return new SpinedWurm(this); - } + @Override + public SpinedWurm copy() { + return new SpinedWurm(this); + } } diff --git a/Mage.Sets/src/mage/sets/tenth/Swamp1.java b/Mage.Sets/src/mage/sets/tenth/Swamp1.java index 33a797e2aa..c78b951f7d 100644 --- a/Mage.Sets/src/mage/sets/tenth/Swamp1.java +++ b/Mage.Sets/src/mage/sets/tenth/Swamp1.java @@ -36,18 +36,18 @@ import java.util.UUID; */ public class Swamp1 extends mage.cards.basiclands.Swamp { - public Swamp1(UUID ownerId) { - super(ownerId, 372); - this.expansionSetCode = "10E"; - } + public Swamp1(UUID ownerId) { + super(ownerId, 372); + this.expansionSetCode = "10E"; + } - public Swamp1(final Swamp1 card) { - super(card); - } + public Swamp1(final Swamp1 card) { + super(card); + } - @Override - public Swamp1 copy() { - return new Swamp1(this); - } + @Override + public Swamp1 copy() { + return new Swamp1(this); + } } diff --git a/Mage.Sets/src/mage/sets/tenth/Swamp2.java b/Mage.Sets/src/mage/sets/tenth/Swamp2.java index fe40dea5c4..3094fcd3c0 100644 --- a/Mage.Sets/src/mage/sets/tenth/Swamp2.java +++ b/Mage.Sets/src/mage/sets/tenth/Swamp2.java @@ -36,18 +36,18 @@ import java.util.UUID; */ public class Swamp2 extends mage.cards.basiclands.Swamp { - public Swamp2(UUID ownerId) { - super(ownerId, 373); - this.expansionSetCode = "10E"; - } + public Swamp2(UUID ownerId) { + super(ownerId, 373); + this.expansionSetCode = "10E"; + } - public Swamp2(final Swamp2 card) { - super(card); - } + public Swamp2(final Swamp2 card) { + super(card); + } - @Override - public Swamp2 copy() { - return new Swamp2(this); - } + @Override + public Swamp2 copy() { + return new Swamp2(this); + } } \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/tenth/Swamp3.java b/Mage.Sets/src/mage/sets/tenth/Swamp3.java index febf540b69..a8d6e00b0f 100644 --- a/Mage.Sets/src/mage/sets/tenth/Swamp3.java +++ b/Mage.Sets/src/mage/sets/tenth/Swamp3.java @@ -36,18 +36,18 @@ import java.util.UUID; */ public class Swamp3 extends mage.cards.basiclands.Swamp { - public Swamp3(UUID ownerId) { - super(ownerId, 374); - this.expansionSetCode = "10E"; - } + public Swamp3(UUID ownerId) { + super(ownerId, 374); + this.expansionSetCode = "10E"; + } - public Swamp3(final Swamp3 card) { - super(card); - } + public Swamp3(final Swamp3 card) { + super(card); + } - @Override - public Swamp3 copy() { - return new Swamp3(this); - } + @Override + public Swamp3 copy() { + return new Swamp3(this); + } } diff --git a/Mage.Sets/src/mage/sets/tenth/Swamp4.java b/Mage.Sets/src/mage/sets/tenth/Swamp4.java index dbea9ac088..079cf334a3 100644 --- a/Mage.Sets/src/mage/sets/tenth/Swamp4.java +++ b/Mage.Sets/src/mage/sets/tenth/Swamp4.java @@ -36,18 +36,18 @@ import java.util.UUID; */ public class Swamp4 extends mage.cards.basiclands.Swamp { - public Swamp4(UUID ownerId) { - super(ownerId, 375); - this.expansionSetCode = "10E"; - } + public Swamp4(UUID ownerId) { + super(ownerId, 375); + this.expansionSetCode = "10E"; + } - public Swamp4(final Swamp4 card) { - super(card); - } + public Swamp4(final Swamp4 card) { + super(card); + } - @Override - public Swamp4 copy() { - return new Swamp4(this); - } + @Override + public Swamp4 copy() { + return new Swamp4(this); + } } diff --git a/Mage.Sets/src/mage/sets/tenth/TerramorphicExpanse.java b/Mage.Sets/src/mage/sets/tenth/TerramorphicExpanse.java index 2f4a83afa0..6db280dd7c 100644 --- a/Mage.Sets/src/mage/sets/tenth/TerramorphicExpanse.java +++ b/Mage.Sets/src/mage/sets/tenth/TerramorphicExpanse.java @@ -47,40 +47,40 @@ import mage.target.common.TargetCardInLibrary; */ public class TerramorphicExpanse extends CardImpl { - public TerramorphicExpanse(UUID ownerId) { - super(ownerId, 360, "Terramorphic Expanse", Rarity.COMMON, new CardType[]{CardType.LAND}, null); - this.expansionSetCode = "10E"; - this.addAbility(new TerramorphicExpanseAbility()); - } + public TerramorphicExpanse(UUID ownerId) { + super(ownerId, 360, "Terramorphic Expanse", Rarity.COMMON, new CardType[]{CardType.LAND}, null); + this.expansionSetCode = "10E"; + this.addAbility(new TerramorphicExpanseAbility()); + } - public TerramorphicExpanse(final TerramorphicExpanse card) { - super(card); - } + public TerramorphicExpanse(final TerramorphicExpanse card) { + super(card); + } - @Override - public TerramorphicExpanse copy() { - return new TerramorphicExpanse(this); - } + @Override + public TerramorphicExpanse copy() { + return new TerramorphicExpanse(this); + } } class TerramorphicExpanseAbility extends ActivatedAbilityImpl { - public TerramorphicExpanseAbility() { - super(Zone.BATTLEFIELD, null); - addCost(new TapSourceCost()); - addCost(new SacrificeSourceCost()); - TargetCardInLibrary target = new TargetCardInLibrary(new FilterBasicLandCard()); - addEffect(new SearchLibraryPutInPlayEffect(target, true, Outcome.PutLandInPlay)); - } + public TerramorphicExpanseAbility() { + super(Zone.BATTLEFIELD, null); + addCost(new TapSourceCost()); + addCost(new SacrificeSourceCost()); + TargetCardInLibrary target = new TargetCardInLibrary(new FilterBasicLandCard()); + addEffect(new SearchLibraryPutInPlayEffect(target, true, Outcome.PutLandInPlay)); + } - public TerramorphicExpanseAbility(final TerramorphicExpanseAbility ability) { - super(ability); - } + public TerramorphicExpanseAbility(final TerramorphicExpanseAbility ability) { + super(ability); + } - @Override - public TerramorphicExpanseAbility copy() { - return new TerramorphicExpanseAbility(this); - } + @Override + public TerramorphicExpanseAbility copy() { + return new TerramorphicExpanseAbility(this); + } } diff --git a/Mage.Sets/src/mage/sets/tenth/TheHive.java b/Mage.Sets/src/mage/sets/tenth/TheHive.java index ba97095b4a..add45917e1 100644 --- a/Mage.Sets/src/mage/sets/tenth/TheHive.java +++ b/Mage.Sets/src/mage/sets/tenth/TheHive.java @@ -73,7 +73,7 @@ class WaspToken extends Token { cardType.add(CardType.CREATURE); this.subtype.add("Insect"); power = new MageInt(1); - toughness = new MageInt(1); + toughness = new MageInt(1); this.addAbility(FlyingAbility.getInstance()); } } \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/tenth/Traumatize.java b/Mage.Sets/src/mage/sets/tenth/Traumatize.java index c164ef8d45..cad78b9819 100644 --- a/Mage.Sets/src/mage/sets/tenth/Traumatize.java +++ b/Mage.Sets/src/mage/sets/tenth/Traumatize.java @@ -47,54 +47,54 @@ import mage.target.TargetPlayer; */ public class Traumatize extends CardImpl { - public Traumatize(UUID ownerId) { - super(ownerId, 119, "Traumatize", Rarity.RARE, new CardType[]{CardType.SORCERY}, "{3}{U}{U}"); - this.expansionSetCode = "10E"; - this.color.setBlue(true); - this.getSpellAbility().addTarget(new TargetPlayer()); - this.getSpellAbility().addEffect(new TraumatizeEffect()); - } + public Traumatize(UUID ownerId) { + super(ownerId, 119, "Traumatize", Rarity.RARE, new CardType[]{CardType.SORCERY}, "{3}{U}{U}"); + this.expansionSetCode = "10E"; + this.color.setBlue(true); + this.getSpellAbility().addTarget(new TargetPlayer()); + this.getSpellAbility().addEffect(new TraumatizeEffect()); + } - public Traumatize(final Traumatize card) { - super(card); - } + public Traumatize(final Traumatize card) { + super(card); + } - @Override - public Traumatize copy() { - return new Traumatize(this); - } + @Override + public Traumatize copy() { + return new Traumatize(this); + } } class TraumatizeEffect extends OneShotEffect { - public TraumatizeEffect() { - super(Outcome.Detriment); - staticText = "Target player puts the top half of his or her library, rounded down, into his or her graveyard"; - } + public TraumatizeEffect() { + super(Outcome.Detriment); + staticText = "Target player puts the top half of his or her library, rounded down, into his or her graveyard"; + } - public TraumatizeEffect(final TraumatizeEffect effect) { - super(effect); - } + public TraumatizeEffect(final TraumatizeEffect effect) { + super(effect); + } - @Override - public boolean apply(Game game, Ability source) { - Player player = game.getPlayer(source.getFirstTarget()); - Card card; - int amount = player.getLibrary().size() / 2; - for (int i = 0; i < amount; i++) { - card = player.getLibrary().removeFromTop(game); - if (card != null) { - card.moveToZone(Zone.GRAVEYARD, source.getId(), game, false); - } else { - break; - } - } - return true; - } + @Override + public boolean apply(Game game, Ability source) { + Player player = game.getPlayer(source.getFirstTarget()); + Card card; + int amount = player.getLibrary().size() / 2; + for (int i = 0; i < amount; i++) { + card = player.getLibrary().removeFromTop(game); + if (card != null) { + card.moveToZone(Zone.GRAVEYARD, source.getId(), game, false); + } else { + break; + } + } + return true; + } - @Override - public TraumatizeEffect copy() { - return new TraumatizeEffect(this); - } + @Override + public TraumatizeEffect copy() { + return new TraumatizeEffect(this); + } } \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/tenth/TreetopVillage.java b/Mage.Sets/src/mage/sets/tenth/TreetopVillage.java index 7ee87554f8..e0e9ecb53b 100644 --- a/Mage.Sets/src/mage/sets/tenth/TreetopVillage.java +++ b/Mage.Sets/src/mage/sets/tenth/TreetopVillage.java @@ -75,7 +75,7 @@ class ApeToken extends Token { this.subtype.add("Ape"); color = ObjectColor.GREEN; power = new MageInt(3); - toughness = new MageInt(3); + toughness = new MageInt(3); this.addAbility(TrampleAbility.getInstance()); } } \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/tenth/TrollAscetic.java b/Mage.Sets/src/mage/sets/tenth/TrollAscetic.java index 9f44aaadd0..ea44fcbbed 100644 --- a/Mage.Sets/src/mage/sets/tenth/TrollAscetic.java +++ b/Mage.Sets/src/mage/sets/tenth/TrollAscetic.java @@ -38,7 +38,7 @@ public class TrollAscetic extends mage.sets.mirrodin.TrollAscetic { public TrollAscetic (UUID ownerId) { super(ownerId); - this.cardNumber = 305; + this.cardNumber = 305; this.expansionSetCode = "10E"; } diff --git a/Mage.Sets/src/mage/sets/tenth/Unsummon.java b/Mage.Sets/src/mage/sets/tenth/Unsummon.java index 8fc36d0a2c..4c7b320950 100644 --- a/Mage.Sets/src/mage/sets/tenth/Unsummon.java +++ b/Mage.Sets/src/mage/sets/tenth/Unsummon.java @@ -41,20 +41,20 @@ import mage.target.common.TargetCreaturePermanent; */ public class Unsummon extends CardImpl { - public Unsummon(UUID ownerId) { - super(ownerId, 122, "Unsummon", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{U}"); - this.expansionSetCode = "10E"; - this.color.setBlue(true); - this.getSpellAbility().addTarget(new TargetCreaturePermanent()); - this.getSpellAbility().addEffect(new ReturnToHandTargetEffect()); - } + public Unsummon(UUID ownerId) { + super(ownerId, 122, "Unsummon", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{U}"); + this.expansionSetCode = "10E"; + this.color.setBlue(true); + this.getSpellAbility().addTarget(new TargetCreaturePermanent()); + this.getSpellAbility().addEffect(new ReturnToHandTargetEffect()); + } - public Unsummon(final Unsummon card) { - super(card); - } + public Unsummon(final Unsummon card) { + super(card); + } - @Override - public Unsummon copy() { - return new Unsummon(this); - } + @Override + public Unsummon copy() { + return new Unsummon(this); + } } diff --git a/Mage.Sets/src/mage/sets/tenth/WhispersilkCloak.java b/Mage.Sets/src/mage/sets/tenth/WhispersilkCloak.java index f02912101c..058727d007 100644 --- a/Mage.Sets/src/mage/sets/tenth/WhispersilkCloak.java +++ b/Mage.Sets/src/mage/sets/tenth/WhispersilkCloak.java @@ -50,22 +50,22 @@ import mage.cards.CardImpl; */ public class WhispersilkCloak extends CardImpl { - public WhispersilkCloak(UUID ownerId) { - super(ownerId, 345, "Whispersilk Cloak", Rarity.UNCOMMON, new CardType[]{CardType.ARTIFACT}, "{3}"); - this.expansionSetCode = "10E"; - this.subtype.add("Equipment"); - this.addAbility(new EquipAbility(Outcome.AddAbility, new GenericManaCost(2))); - this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityAttachedEffect(UnblockableAbility.getInstance(), AttachmentType.EQUIPMENT))); - this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityAttachedEffect(ShroudAbility.getInstance(), AttachmentType.EQUIPMENT))); - } + public WhispersilkCloak(UUID ownerId) { + super(ownerId, 345, "Whispersilk Cloak", Rarity.UNCOMMON, new CardType[]{CardType.ARTIFACT}, "{3}"); + this.expansionSetCode = "10E"; + this.subtype.add("Equipment"); + this.addAbility(new EquipAbility(Outcome.AddAbility, new GenericManaCost(2))); + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityAttachedEffect(UnblockableAbility.getInstance(), AttachmentType.EQUIPMENT))); + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityAttachedEffect(ShroudAbility.getInstance(), AttachmentType.EQUIPMENT))); + } - protected WhispersilkCloak(WhispersilkCloak me) { - super(me); - } + protected WhispersilkCloak(WhispersilkCloak me) { + super(me); + } - @Override - public WhispersilkCloak copy() { - return new WhispersilkCloak(this); - } + @Override + public WhispersilkCloak copy() { + return new WhispersilkCloak(this); + } } diff --git a/Mage.Sets/src/mage/sets/tenth/WildGriffin.java b/Mage.Sets/src/mage/sets/tenth/WildGriffin.java index cef0ede888..f65f5fe01f 100644 --- a/Mage.Sets/src/mage/sets/tenth/WildGriffin.java +++ b/Mage.Sets/src/mage/sets/tenth/WildGriffin.java @@ -41,24 +41,24 @@ import mage.cards.CardImpl; */ public class WildGriffin extends CardImpl { - public WildGriffin(UUID ownerId) { - super(ownerId, 59, "Wild Griffin", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{2}{W}"); - this.expansionSetCode = "10E"; - this.subtype.add("Griffin"); - this.color.setWhite(true); - this.power = new MageInt(2); - this.toughness = new MageInt(2); + public WildGriffin(UUID ownerId) { + super(ownerId, 59, "Wild Griffin", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{2}{W}"); + this.expansionSetCode = "10E"; + this.subtype.add("Griffin"); + this.color.setWhite(true); + this.power = new MageInt(2); + this.toughness = new MageInt(2); - this.addAbility(FlyingAbility.getInstance()); - } + this.addAbility(FlyingAbility.getInstance()); + } - public WildGriffin(final WildGriffin card) { - super(card); - } + public WildGriffin(final WildGriffin card) { + super(card); + } - @Override - public WildGriffin copy() { - return new WildGriffin(this); - } + @Override + public WildGriffin copy() { + return new WildGriffin(this); + } } diff --git a/Mage.Sets/src/mage/sets/tenth/WindbornMuse.java b/Mage.Sets/src/mage/sets/tenth/WindbornMuse.java index e49e583f7c..8f2607bbdc 100644 --- a/Mage.Sets/src/mage/sets/tenth/WindbornMuse.java +++ b/Mage.Sets/src/mage/sets/tenth/WindbornMuse.java @@ -73,53 +73,53 @@ public class WindbornMuse extends CardImpl { class WindbornMuseReplacementEffect extends ReplacementEffectImpl { - private static final String effectText = "Creatures can't attack you unless their controller pays {2} for each creature he or she controls that's attacking you"; + private static final String effectText = "Creatures can't attack you unless their controller pays {2} for each creature he or she controls that's attacking you"; - WindbornMuseReplacementEffect ( ) { - super(Constants.Duration.WhileOnBattlefield, Constants.Outcome.Benefit); - staticText = effectText; - } + WindbornMuseReplacementEffect ( ) { + super(Constants.Duration.WhileOnBattlefield, Constants.Outcome.Benefit); + staticText = effectText; + } - WindbornMuseReplacementEffect ( WindbornMuseReplacementEffect effect ) { - super(effect); - } + WindbornMuseReplacementEffect ( WindbornMuseReplacementEffect effect ) { + super(effect); + } - @Override - public boolean apply(Game game, Ability source) { - throw new UnsupportedOperationException("Not supported."); - } + @Override + public boolean apply(Game game, Ability source) { + throw new UnsupportedOperationException("Not supported."); + } - @Override - public boolean replaceEvent(GameEvent event, Ability source, Game game) { - if ( event.getType() == GameEvent.EventType.DECLARE_ATTACKER) { - Player player = game.getPlayer(event.getPlayerId()); - if ( player != null && event.getTargetId().equals(source.getControllerId())) { - ManaCostsImpl propagandaTax = new ManaCostsImpl("{2}"); - if ( propagandaTax.canPay(source.getSourceId(), event.getPlayerId(), game) && - player.chooseUse(Constants.Outcome.Benefit, "Pay {2} to declare attacker?", game) ) - { - if (propagandaTax.payOrRollback(source, game, this.getId(), event.getPlayerId())) { - return false; - } - } - } - return true; - } - return false; - } + @Override + public boolean replaceEvent(GameEvent event, Ability source, Game game) { + if ( event.getType() == GameEvent.EventType.DECLARE_ATTACKER) { + Player player = game.getPlayer(event.getPlayerId()); + if ( player != null && event.getTargetId().equals(source.getControllerId())) { + ManaCostsImpl propagandaTax = new ManaCostsImpl("{2}"); + if ( propagandaTax.canPay(source.getSourceId(), event.getPlayerId(), game) && + player.chooseUse(Constants.Outcome.Benefit, "Pay {2} to declare attacker?", game) ) + { + if (propagandaTax.payOrRollback(source, game, this.getId(), event.getPlayerId())) { + return false; + } + } + } + return true; + } + return false; + } - @Override - public boolean applies(GameEvent event, Ability source, Game game) { - if ( event.getType() == GameEvent.EventType.DECLARE_ATTACKER && event.getTargetId().equals(source.getControllerId()) ) { - return true; - } - return false; - } + @Override + public boolean applies(GameEvent event, Ability source, Game game) { + if ( event.getType() == GameEvent.EventType.DECLARE_ATTACKER && event.getTargetId().equals(source.getControllerId()) ) { + return true; + } + return false; + } - @Override - public WindbornMuseReplacementEffect copy() { - return new WindbornMuseReplacementEffect(this); - } + @Override + public WindbornMuseReplacementEffect copy() { + return new WindbornMuseReplacementEffect(this); + } } diff --git a/Mage.Sets/src/mage/sets/tenth/WurmsTooth.java b/Mage.Sets/src/mage/sets/tenth/WurmsTooth.java index a2669c5142..64d145f3d1 100644 --- a/Mage.Sets/src/mage/sets/tenth/WurmsTooth.java +++ b/Mage.Sets/src/mage/sets/tenth/WurmsTooth.java @@ -46,52 +46,52 @@ import mage.game.stack.Spell; */ public class WurmsTooth extends CardImpl { - public WurmsTooth(UUID ownerId) { - super(ownerId, 346, "Wurm's Tooth", Rarity.UNCOMMON, new CardType[]{CardType.ARTIFACT}, "{2}"); - this.expansionSetCode = "10E"; - this.addAbility(new WurmsToothAbility()); - } + public WurmsTooth(UUID ownerId) { + super(ownerId, 346, "Wurm's Tooth", Rarity.UNCOMMON, new CardType[]{CardType.ARTIFACT}, "{2}"); + this.expansionSetCode = "10E"; + this.addAbility(new WurmsToothAbility()); + } - public WurmsTooth(final WurmsTooth card) { - super(card); - } + public WurmsTooth(final WurmsTooth card) { + super(card); + } - @Override - public WurmsTooth copy() { - return new WurmsTooth(this); - } + @Override + public WurmsTooth copy() { + return new WurmsTooth(this); + } } class WurmsToothAbility extends TriggeredAbilityImpl { - public WurmsToothAbility() { - super(Zone.BATTLEFIELD, new GainLifeEffect(1), true); - } + public WurmsToothAbility() { + super(Zone.BATTLEFIELD, new GainLifeEffect(1), true); + } - public WurmsToothAbility(final WurmsToothAbility ability) { - super(ability); - } + public WurmsToothAbility(final WurmsToothAbility ability) { + super(ability); + } - @Override - public WurmsToothAbility copy() { - return new WurmsToothAbility(this); - } + @Override + public WurmsToothAbility copy() { + return new WurmsToothAbility(this); + } - @Override - public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == EventType.SPELL_CAST) { - Spell spell = game.getStack().getSpell(event.getTargetId()); - if (spell != null && spell.getColor().isGreen()) { - return true; - } - } - return false; - } + @Override + public boolean checkTrigger(GameEvent event, Game game) { + if (event.getType() == EventType.SPELL_CAST) { + Spell spell = game.getStack().getSpell(event.getTargetId()); + if (spell != null && spell.getColor().isGreen()) { + return true; + } + } + return false; + } - @Override - public String getRule() { - return "Whenever a player casts a green spell, you may gain 1 life."; - } + @Override + public String getRule() { + return "Whenever a player casts a green spell, you may gain 1 life."; + } } diff --git a/Mage.Sets/src/mage/sets/timeshifted/AkromaAngelOfWrath.java b/Mage.Sets/src/mage/sets/timeshifted/AkromaAngelOfWrath.java index 24a34a031f..911583ac93 100644 --- a/Mage.Sets/src/mage/sets/timeshifted/AkromaAngelOfWrath.java +++ b/Mage.Sets/src/mage/sets/timeshifted/AkromaAngelOfWrath.java @@ -45,13 +45,13 @@ public class AkromaAngelOfWrath extends CardImpl { private static FilterCard filter2 = new FilterCard("Red"); static { - filter.setUseColor(true); - filter.getColor().setBlack(true); - filter.setScopeColor(Filter.ComparisonScope.Any); + filter.setUseColor(true); + filter.getColor().setBlack(true); + filter.setScopeColor(Filter.ComparisonScope.Any); filter2.setUseColor(true); - filter2.getColor().setRed(true); - filter2.setScopeColor(Filter.ComparisonScope.Any); + filter2.getColor().setRed(true); + filter2.setScopeColor(Filter.ComparisonScope.Any); } public AkromaAngelOfWrath(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/timeshifted/SolkanarTheSwampKing.java b/Mage.Sets/src/mage/sets/timeshifted/SolkanarTheSwampKing.java index 7cc91a2099..7935f80a69 100644 --- a/Mage.Sets/src/mage/sets/timeshifted/SolkanarTheSwampKing.java +++ b/Mage.Sets/src/mage/sets/timeshifted/SolkanarTheSwampKing.java @@ -77,33 +77,33 @@ public class SolkanarTheSwampKing extends CardImpl { class SolkanarTheSwampKingAbility extends TriggeredAbilityImpl { - public SolkanarTheSwampKingAbility() { - super(Constants.Zone.BATTLEFIELD, new GainLifeEffect(1), false); - } + public SolkanarTheSwampKingAbility() { + super(Constants.Zone.BATTLEFIELD, new GainLifeEffect(1), false); + } - public SolkanarTheSwampKingAbility(final SolkanarTheSwampKingAbility ability) { - super(ability); - } + public SolkanarTheSwampKingAbility(final SolkanarTheSwampKingAbility ability) { + super(ability); + } - @Override - public SolkanarTheSwampKingAbility copy() { - return new SolkanarTheSwampKingAbility(this); - } + @Override + public SolkanarTheSwampKingAbility copy() { + return new SolkanarTheSwampKingAbility(this); + } - @Override - public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == GameEvent.EventType.SPELL_CAST) { - Spell spell = game.getStack().getSpell(event.getTargetId()); - if (spell != null && spell.getColor().isBlack()) { - return true; - } - } - return false; - } + @Override + public boolean checkTrigger(GameEvent event, Game game) { + if (event.getType() == GameEvent.EventType.SPELL_CAST) { + Spell spell = game.getStack().getSpell(event.getTargetId()); + if (spell != null && spell.getColor().isBlack()) { + return true; + } + } + return false; + } - @Override - public String getRule() { - return "Whenever a player casts a black spell, you gain 1 life."; - } + @Override + public String getRule() { + return "Whenever a player casts a black spell, you gain 1 life."; + } } diff --git a/Mage.Sets/src/mage/sets/timeshifted/WhirlingDervish.java b/Mage.Sets/src/mage/sets/timeshifted/WhirlingDervish.java index ce927364f0..385b0cd64c 100644 --- a/Mage.Sets/src/mage/sets/timeshifted/WhirlingDervish.java +++ b/Mage.Sets/src/mage/sets/timeshifted/WhirlingDervish.java @@ -56,7 +56,7 @@ public class WhirlingDervish extends CardImpl { filter.setColor(ObjectColor.BLACK); filter.setUseColor(true); } - + public WhirlingDervish(UUID ownerId) { super(ownerId, 90, "Whirling Dervish", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{G}{G}"); this.expansionSetCode = "TSB"; @@ -66,12 +66,12 @@ public class WhirlingDervish extends CardImpl { this.color.setGreen(true); this.power = new MageInt(1); this.toughness = new MageInt(1); - + // Protection from black this.addAbility(new ProtectionAbility(filter)); // At the beginning of each end step, if Whirling Dervish dealt damage to an opponent this turn, put a +1/+1 counter on it. TriggeredAbility triggered = new OnEventTriggeredAbility(GameEvent.EventType.END_TURN_STEP_PRE, "beginning of each end step", true, new AddCountersSourceEffect(CounterType.P1P1.createInstance())); - this.addAbility(new ConditionalTriggeredAbility(triggered, new DealtDamageToAnOpponent(), ruleText)); + this.addAbility(new ConditionalTriggeredAbility(triggered, new DealtDamageToAnOpponent(), ruleText)); } public WhirlingDervish(final WhirlingDervish card) { diff --git a/Mage.Sets/src/mage/sets/timespiral/UrzasFactory.java b/Mage.Sets/src/mage/sets/timespiral/UrzasFactory.java index 63132e7fec..3973769f86 100644 --- a/Mage.Sets/src/mage/sets/timespiral/UrzasFactory.java +++ b/Mage.Sets/src/mage/sets/timespiral/UrzasFactory.java @@ -76,8 +76,8 @@ class AssemblyWorkerToken extends Token { super("Assembly-Worker", "a 2/2 colorless Assembly-Worker artifact creature token"); cardType.add(CardType.ARTIFACT); cardType.add(CardType.CREATURE); - subtype.add("Assembly-Worker"); - power = new MageInt(2); - toughness = new MageInt(2); + subtype.add("Assembly-Worker"); + power = new MageInt(2); + toughness = new MageInt(2); } } diff --git a/Mage.Sets/src/mage/sets/tokens/EmptyToken.java b/Mage.Sets/src/mage/sets/tokens/EmptyToken.java index 3885d64895..773c0fb56e 100644 --- a/Mage.Sets/src/mage/sets/tokens/EmptyToken.java +++ b/Mage.Sets/src/mage/sets/tokens/EmptyToken.java @@ -34,7 +34,7 @@ import mage.game.permanent.token.Token; */ public class EmptyToken extends Token { - public EmptyToken() { - super("", ""); - } + public EmptyToken() { + super("", ""); + } } \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/urzassaga/AbsoluteGrace.java b/Mage.Sets/src/mage/sets/urzassaga/AbsoluteGrace.java index 92791a1f7b..ba79655ea6 100644 --- a/Mage.Sets/src/mage/sets/urzassaga/AbsoluteGrace.java +++ b/Mage.Sets/src/mage/sets/urzassaga/AbsoluteGrace.java @@ -48,29 +48,29 @@ import mage.filter.common.FilterCreaturePermanent; */ public class AbsoluteGrace extends CardImpl { - private static final FilterCard filter = new FilterCard("Black"); + private static final FilterCard filter = new FilterCard("Black"); - static { - filter.setUseColor(true); - filter.getColor().setBlack(true); - filter.setScopeColor(ComparisonScope.Any); - } + static { + filter.setUseColor(true); + filter.getColor().setBlack(true); + filter.setScopeColor(ComparisonScope.Any); + } - public AbsoluteGrace(UUID ownerId) { - super(ownerId, 1, "Absolute Grace", Rarity.UNCOMMON, new CardType[]{CardType.ENCHANTMENT}, "{1}{W}"); - this.expansionSetCode = "USG"; - this.color.setWhite(true); - Ability ability = new ProtectionAbility(filter); + public AbsoluteGrace(UUID ownerId) { + super(ownerId, 1, "Absolute Grace", Rarity.UNCOMMON, new CardType[]{CardType.ENCHANTMENT}, "{1}{W}"); + this.expansionSetCode = "USG"; + this.color.setWhite(true); + Ability ability = new ProtectionAbility(filter); this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityAllEffect(ability, Duration.WhileOnBattlefield, new FilterCreaturePermanent(), false))); - } + } - public AbsoluteGrace(final AbsoluteGrace card) { - super(card); - } + public AbsoluteGrace(final AbsoluteGrace card) { + super(card); + } - @Override - public AbsoluteGrace copy() { - return new AbsoluteGrace(this); - } + @Override + public AbsoluteGrace copy() { + return new AbsoluteGrace(this); + } } \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/urzassaga/AbsoluteLaw.java b/Mage.Sets/src/mage/sets/urzassaga/AbsoluteLaw.java index 1e6cb4da05..b687584cd7 100644 --- a/Mage.Sets/src/mage/sets/urzassaga/AbsoluteLaw.java +++ b/Mage.Sets/src/mage/sets/urzassaga/AbsoluteLaw.java @@ -48,29 +48,29 @@ import mage.filter.common.FilterCreaturePermanent; */ public class AbsoluteLaw extends CardImpl { - private static final FilterCard filter = new FilterCard("Red"); + private static final FilterCard filter = new FilterCard("Red"); - static { - filter.setUseColor(true); - filter.getColor().setRed(true); - filter.setScopeColor(ComparisonScope.Any); - } + static { + filter.setUseColor(true); + filter.getColor().setRed(true); + filter.setScopeColor(ComparisonScope.Any); + } - public AbsoluteLaw(UUID ownerId) { - super(ownerId, 2, "Absolute Law", Rarity.UNCOMMON, new CardType[]{CardType.ENCHANTMENT}, "{1}{W}"); - this.expansionSetCode = "USG"; - this.color.setWhite(true); - Ability ability = new ProtectionAbility(filter); + public AbsoluteLaw(UUID ownerId) { + super(ownerId, 2, "Absolute Law", Rarity.UNCOMMON, new CardType[]{CardType.ENCHANTMENT}, "{1}{W}"); + this.expansionSetCode = "USG"; + this.color.setWhite(true); + Ability ability = new ProtectionAbility(filter); this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityAllEffect(ability, Duration.WhileOnBattlefield, new FilterCreaturePermanent(), false))); - } + } - public AbsoluteLaw(final AbsoluteLaw card) { - super(card); - } + public AbsoluteLaw(final AbsoluteLaw card) { + super(card); + } - @Override - public AbsoluteLaw copy() { - return new AbsoluteLaw(this); - } + @Override + public AbsoluteLaw copy() { + return new AbsoluteLaw(this); + } } \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/urzassaga/AbyssalHorror.java b/Mage.Sets/src/mage/sets/urzassaga/AbyssalHorror.java index a530366893..9125bcff80 100644 --- a/Mage.Sets/src/mage/sets/urzassaga/AbyssalHorror.java +++ b/Mage.Sets/src/mage/sets/urzassaga/AbyssalHorror.java @@ -49,7 +49,7 @@ public class AbyssalHorror extends CardImpl { super(ownerId, 115, "Abyssal Horror", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{4}{B}{B}"); this.expansionSetCode = "USG"; this.subtype.add("Horror"); - this.color.setBlack(true); + this.color.setBlack(true); this.power = new MageInt(2); this.toughness = new MageInt(2); this.addAbility(FlyingAbility.getInstance()); diff --git a/Mage.Sets/src/mage/sets/urzassaga/AlbinoTroll.java b/Mage.Sets/src/mage/sets/urzassaga/AlbinoTroll.java index 73806efb00..a9db87e640 100644 --- a/Mage.Sets/src/mage/sets/urzassaga/AlbinoTroll.java +++ b/Mage.Sets/src/mage/sets/urzassaga/AlbinoTroll.java @@ -52,7 +52,7 @@ public class AlbinoTroll extends CardImpl{ this.color.setGreen(true); this.power = new MageInt(3); this.toughness = new MageInt(3); - this.addAbility(new EchoAbility("{1}{G}")); + this.addAbility(new EchoAbility("{1}{G}")); this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new RegenerateSourceEffect(), new ManaCostsImpl("{1}{G}"))); } diff --git a/Mage.Sets/src/mage/sets/urzassaga/AngelicChorus.java b/Mage.Sets/src/mage/sets/urzassaga/AngelicChorus.java index 007de41729..bbb7a43f02 100644 --- a/Mage.Sets/src/mage/sets/urzassaga/AngelicChorus.java +++ b/Mage.Sets/src/mage/sets/urzassaga/AngelicChorus.java @@ -87,8 +87,8 @@ class AngelicChorusTriggeredAbility extends TriggeredAbilityImpl { int amount = creature.getToughness().getValue(); Player player = game.getPlayer(source.getControllerId()); if (player != null) { - player.gainLife(amount, game); + player.gainLife(amount, game); } return true; } diff --git a/Mage.Sets/src/mage/sets/urzassaga/AngelicPage.java b/Mage.Sets/src/mage/sets/urzassaga/AngelicPage.java index 90140935e4..a1298f6bd9 100644 --- a/Mage.Sets/src/mage/sets/urzassaga/AngelicPage.java +++ b/Mage.Sets/src/mage/sets/urzassaga/AngelicPage.java @@ -65,7 +65,7 @@ public class AngelicPage extends CardImpl { this.color.setWhite(true); this.power = new MageInt(1); this.toughness = new MageInt(1); - + this.addAbility(FlyingAbility.getInstance()); //{T}: Target attacking or blocking creature gets +1/+1 until end of turn. diff --git a/Mage.Sets/src/mage/sets/urzassaga/ArgothianElder.java b/Mage.Sets/src/mage/sets/urzassaga/ArgothianElder.java index 7041acabb2..19b541e5d8 100644 --- a/Mage.Sets/src/mage/sets/urzassaga/ArgothianElder.java +++ b/Mage.Sets/src/mage/sets/urzassaga/ArgothianElder.java @@ -47,26 +47,26 @@ import mage.target.common.TargetLandPermanent; */ public class ArgothianElder extends CardImpl { - public ArgothianElder(UUID ownerId) { - super(ownerId, 233, "Argothian Elder", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{3}{G}"); - this.expansionSetCode = "USG"; - this.subtype.add("Elf"); - this.subtype.add("Druid"); - this.color.setGreen(true); - this.power = new MageInt(2); - this.toughness = new MageInt(2); - Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new UntapTargetEffect(), new TapSourceCost()); - ability.addTarget(new TargetLandPermanent(2)); + public ArgothianElder(UUID ownerId) { + super(ownerId, 233, "Argothian Elder", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{3}{G}"); + this.expansionSetCode = "USG"; + this.subtype.add("Elf"); + this.subtype.add("Druid"); + this.color.setGreen(true); + this.power = new MageInt(2); + this.toughness = new MageInt(2); + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new UntapTargetEffect(), new TapSourceCost()); + ability.addTarget(new TargetLandPermanent(2)); this.addAbility(ability); } - public ArgothianElder(final ArgothianElder card) { - super(card); - } + public ArgothianElder(final ArgothianElder card) { + super(card); + } - @Override - public ArgothianElder copy() { - return new ArgothianElder(this); - } + @Override + public ArgothianElder copy() { + return new ArgothianElder(this); + } } diff --git a/Mage.Sets/src/mage/sets/urzassaga/Bedlam.java b/Mage.Sets/src/mage/sets/urzassaga/Bedlam.java index b62cd840f3..ad2ebfbc5b 100644 --- a/Mage.Sets/src/mage/sets/urzassaga/Bedlam.java +++ b/Mage.Sets/src/mage/sets/urzassaga/Bedlam.java @@ -47,7 +47,7 @@ public class Bedlam extends CardImpl { public Bedlam (UUID ownerId) { super(ownerId, 175, "Bedlam", Rarity.RARE, new CardType[]{CardType.ENCHANTMENT}, "{2}{R}{R}"); this.expansionSetCode = "USG"; - this.color.setRed(true); + this.color.setRed(true); this.getSpellAbility().addEffect(new BedlamEffect()); } diff --git a/Mage.Sets/src/mage/sets/urzassaga/BloodVassal.java b/Mage.Sets/src/mage/sets/urzassaga/BloodVassal.java index cac9681ac8..fafbdb6c75 100644 --- a/Mage.Sets/src/mage/sets/urzassaga/BloodVassal.java +++ b/Mage.Sets/src/mage/sets/urzassaga/BloodVassal.java @@ -52,7 +52,7 @@ public class BloodVassal extends CardImpl { this.color.setBlack(true); this.power = new MageInt(2); this.toughness = new MageInt(2); - + this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new BasicManaEffect(new Mana(0, 0, 0, 0, 2, 0, 0)), new SacrificeSourceCost())); } diff --git a/Mage.Sets/src/mage/sets/urzassaga/CacklingFiend.java b/Mage.Sets/src/mage/sets/urzassaga/CacklingFiend.java index b986105379..6a56160a09 100644 --- a/Mage.Sets/src/mage/sets/urzassaga/CacklingFiend.java +++ b/Mage.Sets/src/mage/sets/urzassaga/CacklingFiend.java @@ -47,52 +47,52 @@ import mage.players.Player; */ public class CacklingFiend extends CardImpl { - public CacklingFiend(UUID ownerId) { - super(ownerId, 121, "Cackling Fiend", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{2}{B}{B}"); - this.expansionSetCode = "USG"; - this.subtype.add("Zombie"); - this.color.setBlack(true); - this.power = new MageInt(2); - this.toughness = new MageInt(1); + public CacklingFiend(UUID ownerId) { + super(ownerId, 121, "Cackling Fiend", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{2}{B}{B}"); + this.expansionSetCode = "USG"; + this.subtype.add("Zombie"); + this.color.setBlack(true); + this.power = new MageInt(2); + this.toughness = new MageInt(1); - this.addAbility(FlyingAbility.getInstance()); - this.addAbility(new EntersBattlefieldTriggeredAbility(new CacklingFiendEffect(), false)); - } + this.addAbility(FlyingAbility.getInstance()); + this.addAbility(new EntersBattlefieldTriggeredAbility(new CacklingFiendEffect(), false)); + } - public CacklingFiend(final CacklingFiend card) { - super(card); - } + public CacklingFiend(final CacklingFiend card) { + super(card); + } - @Override - public CacklingFiend copy() { - return new CacklingFiend(this); - } + @Override + public CacklingFiend copy() { + return new CacklingFiend(this); + } } class CacklingFiendEffect extends OneShotEffect { - public CacklingFiendEffect() { - super(Outcome.Discard); - staticText = "each opponent discards a card"; - } + public CacklingFiendEffect() { + super(Outcome.Discard); + staticText = "each opponent discards a card"; + } - public CacklingFiendEffect(final CacklingFiendEffect effect) { - super(effect); - } + public CacklingFiendEffect(final CacklingFiendEffect effect) { + super(effect); + } - @Override - public boolean apply(Game game, Ability source) { - for (UUID playerId: game.getOpponents(source.getControllerId())) { - Player player = game.getPlayer(playerId); - player.discard(1, source, game); - } - return true; - } + @Override + public boolean apply(Game game, Ability source) { + for (UUID playerId: game.getOpponents(source.getControllerId())) { + Player player = game.getPlayer(playerId); + player.discard(1, source, game); + } + return true; + } - @Override - public CacklingFiendEffect copy() { - return new CacklingFiendEffect(this); - } + @Override + public CacklingFiendEffect copy() { + return new CacklingFiendEffect(this); + } } \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/urzassaga/CitanulCentaurs.java b/Mage.Sets/src/mage/sets/urzassaga/CitanulCentaurs.java index ab6f5878d7..c56988f979 100644 --- a/Mage.Sets/src/mage/sets/urzassaga/CitanulCentaurs.java +++ b/Mage.Sets/src/mage/sets/urzassaga/CitanulCentaurs.java @@ -49,9 +49,9 @@ public class CitanulCentaurs extends CardImpl{ this.color.setGreen(true); this.power = new MageInt(6); this.toughness = new MageInt(3); - - this.addAbility(ShroudAbility.getInstance()); - this.addAbility(new EchoAbility("{3}{G}")); + + this.addAbility(ShroudAbility.getInstance()); + this.addAbility(new EchoAbility("{3}{G}")); } public CitanulCentaurs(final CitanulCentaurs card) { diff --git a/Mage.Sets/src/mage/sets/urzassaga/CradleGuard.java b/Mage.Sets/src/mage/sets/urzassaga/CradleGuard.java index b0a6252709..17232d012f 100644 --- a/Mage.Sets/src/mage/sets/urzassaga/CradleGuard.java +++ b/Mage.Sets/src/mage/sets/urzassaga/CradleGuard.java @@ -49,9 +49,9 @@ public class CradleGuard extends CardImpl{ this.color.setGreen(true); this.power = new MageInt(4); this.toughness = new MageInt(4); - - this.addAbility(TrampleAbility.getInstance()); - this.addAbility(new EchoAbility("{1}{G}{G}")); + + this.addAbility(TrampleAbility.getInstance()); + this.addAbility(new EchoAbility("{1}{G}{G}")); } public CradleGuard(final CradleGuard card) { diff --git a/Mage.Sets/src/mage/sets/urzassaga/CraterHellion.java b/Mage.Sets/src/mage/sets/urzassaga/CraterHellion.java index dd183e5f1a..771a82cef8 100644 --- a/Mage.Sets/src/mage/sets/urzassaga/CraterHellion.java +++ b/Mage.Sets/src/mage/sets/urzassaga/CraterHellion.java @@ -57,11 +57,11 @@ public class CraterHellion extends CardImpl{ this.color.setRed(true); this.power = new MageInt(6); this.toughness = new MageInt(6); - - this.addAbility(new EchoAbility("{4}{R}{R}")); - - //When Crater Hellion enters the battlefield, it deals 4 damage to each other creature. - this.addAbility(new EntersBattlefieldTriggeredAbility(new CraterHellionEffect(), false)); + + this.addAbility(new EchoAbility("{4}{R}{R}")); + + //When Crater Hellion enters the battlefield, it deals 4 damage to each other creature. + this.addAbility(new EntersBattlefieldTriggeredAbility(new CraterHellionEffect(), false)); } public CraterHellion(final CraterHellion card) { @@ -77,22 +77,22 @@ public class CraterHellion extends CardImpl{ class CraterHellionEffect extends OneShotEffect { - public CraterHellionEffect() { - super(Outcome.Damage); + public CraterHellionEffect() { + super(Outcome.Damage); staticText = "it deals 4 damage to each other creature"; - } + } - public CraterHellionEffect(final CraterHellionEffect effect) { - super(effect); - } + public CraterHellionEffect(final CraterHellionEffect effect) { + super(effect); + } - @Override - public CraterHellionEffect copy() { - return new CraterHellionEffect(this); - } + @Override + public CraterHellionEffect copy() { + return new CraterHellionEffect(this); + } - @Override - public boolean apply(Game game, Ability source) { + @Override + public boolean apply(Game game, Ability source) { List permanents = game.getBattlefield().getActivePermanents(new FilterCreaturePermanent(), source.getControllerId(), game); for (Permanent permanent: permanents) { if(!permanent.getId().equals(source.getSourceId())) { @@ -100,5 +100,5 @@ class CraterHellionEffect extends OneShotEffect { } } return true; - } + } } \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/urzassaga/DiscipleOfLaw.java b/Mage.Sets/src/mage/sets/urzassaga/DiscipleOfLaw.java index 5dc240e9e9..3ec29f316c 100644 --- a/Mage.Sets/src/mage/sets/urzassaga/DiscipleOfLaw.java +++ b/Mage.Sets/src/mage/sets/urzassaga/DiscipleOfLaw.java @@ -45,33 +45,33 @@ import mage.filter.FilterCard; */ public class DiscipleOfLaw extends CardImpl { - private static final FilterCard filter = new FilterCard("Red"); + private static final FilterCard filter = new FilterCard("Red"); - static { - filter.setUseColor(true); - filter.getColor().setRed(true); - filter.setScopeColor(ComparisonScope.Any); - } + static { + filter.setUseColor(true); + filter.getColor().setRed(true); + filter.setScopeColor(ComparisonScope.Any); + } - public DiscipleOfLaw(UUID ownerId) { - super(ownerId, 11, "Disciple Of Law", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{1}{W}"); - this.expansionSetCode = "USG"; - this.subtype.add("Human"); - this.subtype.add("Cleric"); - this.color.setWhite(true); - this.power = new MageInt(1); - this.toughness = new MageInt(2); - this.addAbility(new ProtectionAbility(filter)); + public DiscipleOfLaw(UUID ownerId) { + super(ownerId, 11, "Disciple Of Law", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{1}{W}"); + this.expansionSetCode = "USG"; + this.subtype.add("Human"); + this.subtype.add("Cleric"); + this.color.setWhite(true); + this.power = new MageInt(1); + this.toughness = new MageInt(2); + this.addAbility(new ProtectionAbility(filter)); this.addAbility(new CyclingAbility(new ManaCostsImpl("{2}"))); } - public DiscipleOfLaw(final DiscipleOfLaw card) { - super(card); - } + public DiscipleOfLaw(final DiscipleOfLaw card) { + super(card); + } - @Override - public DiscipleOfLaw copy() { - return new DiscipleOfLaw(this); - } + @Override + public DiscipleOfLaw copy() { + return new DiscipleOfLaw(this); + } } diff --git a/Mage.Sets/src/mage/sets/urzassaga/EasternPaladin.java b/Mage.Sets/src/mage/sets/urzassaga/EasternPaladin.java index 2af6105826..dcb4d06153 100644 --- a/Mage.Sets/src/mage/sets/urzassaga/EasternPaladin.java +++ b/Mage.Sets/src/mage/sets/urzassaga/EasternPaladin.java @@ -50,35 +50,35 @@ import mage.target.common.TargetCreaturePermanent; */ public class EasternPaladin extends CardImpl { - private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("green creature"); + private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("green creature"); - static { - filter.getColor().setGreen(true); - filter.setUseColor(true); - filter.setScopeColor(Filter.ComparisonScope.Any); - } + static { + filter.getColor().setGreen(true); + filter.setUseColor(true); + filter.setScopeColor(Filter.ComparisonScope.Any); + } - public EasternPaladin(UUID ownerId) { - super(ownerId, 133, "Eastern Paladin", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{2}{B}{B}"); - this.expansionSetCode = "USG"; - this.subtype.add("Zombie"); - this.subtype.add("Knight"); - this.color.setBlack(true); - this.power = new MageInt(3); - this.toughness = new MageInt(3); - Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DestroyTargetEffect(), new ManaCostsImpl("{B}{B}")); - ability.addTarget(new TargetCreaturePermanent(filter)); + public EasternPaladin(UUID ownerId) { + super(ownerId, 133, "Eastern Paladin", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{2}{B}{B}"); + this.expansionSetCode = "USG"; + this.subtype.add("Zombie"); + this.subtype.add("Knight"); + this.color.setBlack(true); + this.power = new MageInt(3); + this.toughness = new MageInt(3); + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DestroyTargetEffect(), new ManaCostsImpl("{B}{B}")); + ability.addTarget(new TargetCreaturePermanent(filter)); ability.addCost(new TapSourceCost()); this.addAbility(ability); } - public EasternPaladin(final EasternPaladin card) { - super(card); - } + public EasternPaladin(final EasternPaladin card) { + super(card); + } - @Override - public EasternPaladin copy() { - return new EasternPaladin(this); - } + @Override + public EasternPaladin copy() { + return new EasternPaladin(this); + } } diff --git a/Mage.Sets/src/mage/sets/urzassaga/Forest1.java b/Mage.Sets/src/mage/sets/urzassaga/Forest1.java index b5f72fce2c..d215294cf3 100644 --- a/Mage.Sets/src/mage/sets/urzassaga/Forest1.java +++ b/Mage.Sets/src/mage/sets/urzassaga/Forest1.java @@ -36,18 +36,18 @@ import java.util.UUID; */ public class Forest1 extends mage.cards.basiclands.Forest { - public Forest1(UUID ownerId) { - super(ownerId, 347); - this.expansionSetCode = "USG"; - } + public Forest1(UUID ownerId) { + super(ownerId, 347); + this.expansionSetCode = "USG"; + } - public Forest1(final Forest1 card) { - super(card); - } + public Forest1(final Forest1 card) { + super(card); + } - @Override - public Forest1 copy() { - return new Forest1(this); - } + @Override + public Forest1 copy() { + return new Forest1(this); + } } diff --git a/Mage.Sets/src/mage/sets/urzassaga/Forest2.java b/Mage.Sets/src/mage/sets/urzassaga/Forest2.java index 00a49fa11c..f12fefe659 100644 --- a/Mage.Sets/src/mage/sets/urzassaga/Forest2.java +++ b/Mage.Sets/src/mage/sets/urzassaga/Forest2.java @@ -36,18 +36,18 @@ import java.util.UUID; */ public class Forest2 extends mage.cards.basiclands.Forest { - public Forest2(UUID ownerId) { - super(ownerId, 348); - this.expansionSetCode = "USG"; - } + public Forest2(UUID ownerId) { + super(ownerId, 348); + this.expansionSetCode = "USG"; + } - public Forest2(final Forest2 card) { - super(card); - } + public Forest2(final Forest2 card) { + super(card); + } - @Override - public Forest2 copy() { - return new Forest2(this); - } + @Override + public Forest2 copy() { + return new Forest2(this); + } } diff --git a/Mage.Sets/src/mage/sets/urzassaga/Forest3.java b/Mage.Sets/src/mage/sets/urzassaga/Forest3.java index 915809a726..b7784c4b38 100644 --- a/Mage.Sets/src/mage/sets/urzassaga/Forest3.java +++ b/Mage.Sets/src/mage/sets/urzassaga/Forest3.java @@ -36,18 +36,18 @@ import java.util.UUID; */ public class Forest3 extends mage.cards.basiclands.Forest { - public Forest3(UUID ownerId) { - super(ownerId, 349); - this.expansionSetCode = "USG"; - } + public Forest3(UUID ownerId) { + super(ownerId, 349); + this.expansionSetCode = "USG"; + } - public Forest3(final Forest3 card) { - super(card); - } + public Forest3(final Forest3 card) { + super(card); + } - @Override - public Forest3 copy() { - return new Forest3(this); - } + @Override + public Forest3 copy() { + return new Forest3(this); + } } diff --git a/Mage.Sets/src/mage/sets/urzassaga/Forest4.java b/Mage.Sets/src/mage/sets/urzassaga/Forest4.java index a3abd36c92..195a07ebbe 100644 --- a/Mage.Sets/src/mage/sets/urzassaga/Forest4.java +++ b/Mage.Sets/src/mage/sets/urzassaga/Forest4.java @@ -36,18 +36,18 @@ import java.util.UUID; */ public class Forest4 extends mage.cards.basiclands.Forest { - public Forest4(UUID ownerId) { - super(ownerId, 350); - this.expansionSetCode = "USG"; - } + public Forest4(UUID ownerId) { + super(ownerId, 350); + this.expansionSetCode = "USG"; + } - public Forest4(final Forest4 card) { - super(card); - } + public Forest4(final Forest4 card) { + super(card); + } - @Override - public Forest4 copy() { - return new Forest4(this); - } + @Override + public Forest4 copy() { + return new Forest4(this); + } } diff --git a/Mage.Sets/src/mage/sets/urzassaga/GoblinPatrol.java b/Mage.Sets/src/mage/sets/urzassaga/GoblinPatrol.java index 8d730ee38d..d6f45fbed0 100644 --- a/Mage.Sets/src/mage/sets/urzassaga/GoblinPatrol.java +++ b/Mage.Sets/src/mage/sets/urzassaga/GoblinPatrol.java @@ -48,8 +48,8 @@ public class GoblinPatrol extends CardImpl{ this.color.setRed(true); this.power = new MageInt(2); this.toughness = new MageInt(1); - - this.addAbility(new EchoAbility("{R}")); + + this.addAbility(new EchoAbility("{R}")); } public GoblinPatrol(final GoblinPatrol card) { diff --git a/Mage.Sets/src/mage/sets/urzassaga/GoblinWarBuggy.java b/Mage.Sets/src/mage/sets/urzassaga/GoblinWarBuggy.java index 661c99e0b3..e36253259b 100644 --- a/Mage.Sets/src/mage/sets/urzassaga/GoblinWarBuggy.java +++ b/Mage.Sets/src/mage/sets/urzassaga/GoblinWarBuggy.java @@ -49,9 +49,9 @@ public class GoblinWarBuggy extends CardImpl{ this.color.setRed(true); this.power = new MageInt(2); this.toughness = new MageInt(2); - - this.addAbility(HasteAbility.getInstance()); - this.addAbility(new EchoAbility("{1}{R}")); + + this.addAbility(HasteAbility.getInstance()); + this.addAbility(new EchoAbility("{1}{R}")); } public GoblinWarBuggy(final GoblinWarBuggy card) { diff --git a/Mage.Sets/src/mage/sets/urzassaga/Guma.java b/Mage.Sets/src/mage/sets/urzassaga/Guma.java index 37e6a3c219..3db35ad581 100644 --- a/Mage.Sets/src/mage/sets/urzassaga/Guma.java +++ b/Mage.Sets/src/mage/sets/urzassaga/Guma.java @@ -43,31 +43,31 @@ import mage.filter.FilterCard; */ public class Guma extends CardImpl { - private static final FilterCard filter = new FilterCard("Blue"); + private static final FilterCard filter = new FilterCard("Blue"); - static { - filter.setUseColor(true); - filter.getColor().setBlue(true); - filter.setScopeColor(ComparisonScope.Any); - } + static { + filter.setUseColor(true); + filter.getColor().setBlue(true); + filter.setScopeColor(ComparisonScope.Any); + } - public Guma(UUID ownerId) { - super(ownerId, 197, "Guma", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{2}{R}"); - this.expansionSetCode = "USG"; - this.subtype.add("Cat"); - this.color.setRed(true); - this.power = new MageInt(2); - this.toughness = new MageInt(2); - this.addAbility(new ProtectionAbility(filter)); + public Guma(UUID ownerId) { + super(ownerId, 197, "Guma", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{2}{R}"); + this.expansionSetCode = "USG"; + this.subtype.add("Cat"); + this.color.setRed(true); + this.power = new MageInt(2); + this.toughness = new MageInt(2); + this.addAbility(new ProtectionAbility(filter)); } - public Guma(final Guma card) { - super(card); - } + public Guma(final Guma card) { + super(card); + } - @Override - public Guma copy() { - return new Guma(this); - } + @Override + public Guma copy() { + return new Guma(this); + } } diff --git a/Mage.Sets/src/mage/sets/urzassaga/HeraldOfSerra.java b/Mage.Sets/src/mage/sets/urzassaga/HeraldOfSerra.java index fbb95dd450..8be2836598 100644 --- a/Mage.Sets/src/mage/sets/urzassaga/HeraldOfSerra.java +++ b/Mage.Sets/src/mage/sets/urzassaga/HeraldOfSerra.java @@ -50,10 +50,10 @@ public class HeraldOfSerra extends CardImpl{ this.color.setWhite(true); this.power = new MageInt(3); this.toughness = new MageInt(4); - - this.addAbility(FlyingAbility.getInstance()); - this.addAbility(VigilanceAbility.getInstance()); - this.addAbility(new EchoAbility("{2}{W}{W}")); + + this.addAbility(FlyingAbility.getInstance()); + this.addAbility(VigilanceAbility.getInstance()); + this.addAbility(new EchoAbility("{2}{W}{W}")); } public HeraldOfSerra(final HeraldOfSerra card) { diff --git a/Mage.Sets/src/mage/sets/urzassaga/Island1.java b/Mage.Sets/src/mage/sets/urzassaga/Island1.java index 32686b5143..c683aac805 100644 --- a/Mage.Sets/src/mage/sets/urzassaga/Island1.java +++ b/Mage.Sets/src/mage/sets/urzassaga/Island1.java @@ -36,18 +36,18 @@ import java.util.UUID; */ public class Island1 extends mage.cards.basiclands.Island { - public Island1(UUID ownerId) { - super(ownerId, 335); - this.expansionSetCode = "USG"; - } + public Island1(UUID ownerId) { + super(ownerId, 335); + this.expansionSetCode = "USG"; + } - public Island1(final Island1 card) { - super(card); - } + public Island1(final Island1 card) { + super(card); + } - @Override - public Island1 copy() { - return new Island1(this); - } + @Override + public Island1 copy() { + return new Island1(this); + } } diff --git a/Mage.Sets/src/mage/sets/urzassaga/Island2.java b/Mage.Sets/src/mage/sets/urzassaga/Island2.java index 4f2d9a859f..1862964c6d 100644 --- a/Mage.Sets/src/mage/sets/urzassaga/Island2.java +++ b/Mage.Sets/src/mage/sets/urzassaga/Island2.java @@ -36,18 +36,18 @@ import java.util.UUID; */ public class Island2 extends mage.cards.basiclands.Island { - public Island2(UUID ownerId) { - super(ownerId, 336); - this.expansionSetCode = "USG"; - } + public Island2(UUID ownerId) { + super(ownerId, 336); + this.expansionSetCode = "USG"; + } - public Island2(final Island2 card) { - super(card); - } + public Island2(final Island2 card) { + super(card); + } - @Override - public Island2 copy() { - return new Island2(this); - } + @Override + public Island2 copy() { + return new Island2(this); + } } diff --git a/Mage.Sets/src/mage/sets/urzassaga/Island3.java b/Mage.Sets/src/mage/sets/urzassaga/Island3.java index 070e4e7b42..4277cfdaa3 100644 --- a/Mage.Sets/src/mage/sets/urzassaga/Island3.java +++ b/Mage.Sets/src/mage/sets/urzassaga/Island3.java @@ -36,18 +36,18 @@ import java.util.UUID; */ public class Island3 extends mage.cards.basiclands.Island { - public Island3(UUID ownerId) { - super(ownerId, 337); - this.expansionSetCode = "USG"; - } + public Island3(UUID ownerId) { + super(ownerId, 337); + this.expansionSetCode = "USG"; + } - public Island3(final Island3 card) { - super(card); - } + public Island3(final Island3 card) { + super(card); + } - @Override - public Island3 copy() { - return new Island3(this); - } + @Override + public Island3 copy() { + return new Island3(this); + } } diff --git a/Mage.Sets/src/mage/sets/urzassaga/Island4.java b/Mage.Sets/src/mage/sets/urzassaga/Island4.java index 5a373c6cec..9e3464cb43 100644 --- a/Mage.Sets/src/mage/sets/urzassaga/Island4.java +++ b/Mage.Sets/src/mage/sets/urzassaga/Island4.java @@ -36,18 +36,18 @@ import java.util.UUID; */ public class Island4 extends mage.cards.basiclands.Island { - public Island4(UUID ownerId) { - super(ownerId, 338); - this.expansionSetCode = "USG"; - } + public Island4(UUID ownerId) { + super(ownerId, 338); + this.expansionSetCode = "USG"; + } - public Island4(final Island4 card) { - super(card); - } + public Island4(final Island4 card) { + super(card); + } - @Override - public Island4 copy() { - return new Island4(this); - } + @Override + public Island4 copy() { + return new Island4(this); + } } diff --git a/Mage.Sets/src/mage/sets/urzassaga/LightningDragon.java b/Mage.Sets/src/mage/sets/urzassaga/LightningDragon.java index 4950de93f0..ac5bb219ec 100644 --- a/Mage.Sets/src/mage/sets/urzassaga/LightningDragon.java +++ b/Mage.Sets/src/mage/sets/urzassaga/LightningDragon.java @@ -55,10 +55,10 @@ public class LightningDragon extends CardImpl{ this.color.setRed(true); this.power = new MageInt(4); this.toughness = new MageInt(4); - - this.addAbility(FlyingAbility.getInstance()); - this.addAbility(new EchoAbility("{2}{R}{R}")); - this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new BoostSourceEffect(1, 0, Duration.EndOfTurn), new ColoredManaCost(ColoredManaSymbol.R))); + + this.addAbility(FlyingAbility.getInstance()); + this.addAbility(new EchoAbility("{2}{R}{R}")); + this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new BoostSourceEffect(1, 0, Duration.EndOfTurn), new ColoredManaCost(ColoredManaSymbol.R))); } public LightningDragon(final LightningDragon card) { diff --git a/Mage.Sets/src/mage/sets/urzassaga/Mountain1.java b/Mage.Sets/src/mage/sets/urzassaga/Mountain1.java index d4461e8026..7d9282e9b9 100644 --- a/Mage.Sets/src/mage/sets/urzassaga/Mountain1.java +++ b/Mage.Sets/src/mage/sets/urzassaga/Mountain1.java @@ -36,18 +36,18 @@ import java.util.UUID; */ public class Mountain1 extends mage.cards.basiclands.Mountain { - public Mountain1(UUID ownerId) { - super(ownerId, 343); - this.expansionSetCode = "USG"; - } + public Mountain1(UUID ownerId) { + super(ownerId, 343); + this.expansionSetCode = "USG"; + } - public Mountain1(final Mountain1 card) { - super(card); - } + public Mountain1(final Mountain1 card) { + super(card); + } - @Override - public Mountain1 copy() { - return new Mountain1(this); - } + @Override + public Mountain1 copy() { + return new Mountain1(this); + } } diff --git a/Mage.Sets/src/mage/sets/urzassaga/Mountain2.java b/Mage.Sets/src/mage/sets/urzassaga/Mountain2.java index 0282c62b77..6797420274 100644 --- a/Mage.Sets/src/mage/sets/urzassaga/Mountain2.java +++ b/Mage.Sets/src/mage/sets/urzassaga/Mountain2.java @@ -36,18 +36,18 @@ import java.util.UUID; */ public class Mountain2 extends mage.cards.basiclands.Mountain { - public Mountain2(UUID ownerId) { - super(ownerId, 344); - this.expansionSetCode = "USG"; - } + public Mountain2(UUID ownerId) { + super(ownerId, 344); + this.expansionSetCode = "USG"; + } - public Mountain2(final Mountain2 card) { - super(card); - } + public Mountain2(final Mountain2 card) { + super(card); + } - @Override - public Mountain2 copy() { - return new Mountain2(this); - } + @Override + public Mountain2 copy() { + return new Mountain2(this); + } } diff --git a/Mage.Sets/src/mage/sets/urzassaga/Mountain3.java b/Mage.Sets/src/mage/sets/urzassaga/Mountain3.java index 9b77f7c754..34d9308b68 100644 --- a/Mage.Sets/src/mage/sets/urzassaga/Mountain3.java +++ b/Mage.Sets/src/mage/sets/urzassaga/Mountain3.java @@ -36,18 +36,18 @@ import java.util.UUID; */ public class Mountain3 extends mage.cards.basiclands.Mountain { - public Mountain3(UUID ownerId) { - super(ownerId, 345); - this.expansionSetCode = "USG"; - } + public Mountain3(UUID ownerId) { + super(ownerId, 345); + this.expansionSetCode = "USG"; + } - public Mountain3(final Mountain3 card) { - super(card); - } + public Mountain3(final Mountain3 card) { + super(card); + } - @Override - public Mountain3 copy() { - return new Mountain3(this); - } + @Override + public Mountain3 copy() { + return new Mountain3(this); + } } diff --git a/Mage.Sets/src/mage/sets/urzassaga/Mountain4.java b/Mage.Sets/src/mage/sets/urzassaga/Mountain4.java index 06fdd247dd..c24f58274d 100644 --- a/Mage.Sets/src/mage/sets/urzassaga/Mountain4.java +++ b/Mage.Sets/src/mage/sets/urzassaga/Mountain4.java @@ -36,18 +36,18 @@ import java.util.UUID; */ public class Mountain4 extends mage.cards.basiclands.Mountain { - public Mountain4(UUID ownerId) { - super(ownerId, 346); - this.expansionSetCode = "USG"; - } + public Mountain4(UUID ownerId) { + super(ownerId, 346); + this.expansionSetCode = "USG"; + } - public Mountain4(final Mountain4 card) { - super(card); - } + public Mountain4(final Mountain4 card) { + super(card); + } - @Override - public Mountain4 copy() { - return new Mountain4(this); - } + @Override + public Mountain4 copy() { + return new Mountain4(this); + } } diff --git a/Mage.Sets/src/mage/sets/urzassaga/Plains1.java b/Mage.Sets/src/mage/sets/urzassaga/Plains1.java index 4c8216b848..716336ef54 100644 --- a/Mage.Sets/src/mage/sets/urzassaga/Plains1.java +++ b/Mage.Sets/src/mage/sets/urzassaga/Plains1.java @@ -36,18 +36,18 @@ import java.util.UUID; */ public class Plains1 extends mage.cards.basiclands.Plains { - public Plains1(UUID ownerId) { - super(ownerId, 331); - this.expansionSetCode = "USG"; - } + public Plains1(UUID ownerId) { + super(ownerId, 331); + this.expansionSetCode = "USG"; + } - public Plains1(final Plains1 card) { - super(card); - } + public Plains1(final Plains1 card) { + super(card); + } - @Override - public Plains1 copy() { - return new Plains1(this); - } + @Override + public Plains1 copy() { + return new Plains1(this); + } } diff --git a/Mage.Sets/src/mage/sets/urzassaga/Plains2.java b/Mage.Sets/src/mage/sets/urzassaga/Plains2.java index b2bc568414..195317879d 100644 --- a/Mage.Sets/src/mage/sets/urzassaga/Plains2.java +++ b/Mage.Sets/src/mage/sets/urzassaga/Plains2.java @@ -36,18 +36,18 @@ import java.util.UUID; */ public class Plains2 extends mage.cards.basiclands.Plains { - public Plains2(UUID ownerId) { - super(ownerId, 332); - this.expansionSetCode = "USG"; - } + public Plains2(UUID ownerId) { + super(ownerId, 332); + this.expansionSetCode = "USG"; + } - public Plains2(final Plains2 card) { - super(card); - } + public Plains2(final Plains2 card) { + super(card); + } - @Override - public Plains2 copy() { - return new Plains2(this); - } + @Override + public Plains2 copy() { + return new Plains2(this); + } } diff --git a/Mage.Sets/src/mage/sets/urzassaga/Plains3.java b/Mage.Sets/src/mage/sets/urzassaga/Plains3.java index a3856c282b..77651306d1 100644 --- a/Mage.Sets/src/mage/sets/urzassaga/Plains3.java +++ b/Mage.Sets/src/mage/sets/urzassaga/Plains3.java @@ -36,18 +36,18 @@ import java.util.UUID; */ public class Plains3 extends mage.cards.basiclands.Plains { - public Plains3(UUID ownerId) { - super(ownerId, 333); - this.expansionSetCode = "USG"; - } + public Plains3(UUID ownerId) { + super(ownerId, 333); + this.expansionSetCode = "USG"; + } - public Plains3(final Plains3 card) { - super(card); - } + public Plains3(final Plains3 card) { + super(card); + } - @Override - public Plains3 copy() { - return new Plains3(this); - } + @Override + public Plains3 copy() { + return new Plains3(this); + } } diff --git a/Mage.Sets/src/mage/sets/urzassaga/Plains4.java b/Mage.Sets/src/mage/sets/urzassaga/Plains4.java index b26e5031d2..681a55d45a 100644 --- a/Mage.Sets/src/mage/sets/urzassaga/Plains4.java +++ b/Mage.Sets/src/mage/sets/urzassaga/Plains4.java @@ -36,18 +36,18 @@ import java.util.UUID; */ public class Plains4 extends mage.cards.basiclands.Plains { - public Plains4(UUID ownerId) { - super(ownerId, 334); - this.expansionSetCode = "USG"; - } + public Plains4(UUID ownerId) { + super(ownerId, 334); + this.expansionSetCode = "USG"; + } - public Plains4(final Plains4 card) { - super(card); - } + public Plains4(final Plains4 card) { + super(card); + } - @Override - public Plains4 copy() { - return new Plains4(this); - } + @Override + public Plains4 copy() { + return new Plains4(this); + } } diff --git a/Mage.Sets/src/mage/sets/urzassaga/PouncingJaguar.java b/Mage.Sets/src/mage/sets/urzassaga/PouncingJaguar.java index d5881466a4..3e52e47f46 100644 --- a/Mage.Sets/src/mage/sets/urzassaga/PouncingJaguar.java +++ b/Mage.Sets/src/mage/sets/urzassaga/PouncingJaguar.java @@ -48,8 +48,8 @@ public class PouncingJaguar extends CardImpl{ this.color.setGreen(true); this.power = new MageInt(2); this.toughness = new MageInt(2); - - this.addAbility(new EchoAbility("{G}")); + + this.addAbility(new EchoAbility("{G}")); } public PouncingJaguar(final PouncingJaguar card) { diff --git a/Mage.Sets/src/mage/sets/urzassaga/PriestOfTitania.java b/Mage.Sets/src/mage/sets/urzassaga/PriestOfTitania.java index 3ed3301ffa..988aa26db0 100644 --- a/Mage.Sets/src/mage/sets/urzassaga/PriestOfTitania.java +++ b/Mage.Sets/src/mage/sets/urzassaga/PriestOfTitania.java @@ -44,30 +44,30 @@ import mage.filter.common.FilterCreaturePermanent; */ public class PriestOfTitania extends CardImpl { - private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("Elf creatures"); + private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("Elf creatures"); - static { - filter.getSubtype().add("Elf"); - } + static { + filter.getSubtype().add("Elf"); + } - public PriestOfTitania(UUID ownerId) { - super(ownerId, 270, "Priest of Titania", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{1}{G}"); - this.expansionSetCode = "USG"; - this.subtype.add("Elf"); - this.subtype.add("Druid"); - this.color.setGreen(true); - this.power = new MageInt(1); - this.toughness = new MageInt(1); + public PriestOfTitania(UUID ownerId) { + super(ownerId, 270, "Priest of Titania", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{1}{G}"); + this.expansionSetCode = "USG"; + this.subtype.add("Elf"); + this.subtype.add("Druid"); + this.color.setGreen(true); + this.power = new MageInt(1); + this.toughness = new MageInt(1); this.addAbility(new DynamicManaAbility(Mana.GreenMana, new PermanentsOnBattlefieldCount(filter))); - } + } - public PriestOfTitania(final PriestOfTitania card) { - super(card); - } + public PriestOfTitania(final PriestOfTitania card) { + super(card); + } - @Override - public PriestOfTitania copy() { - return new PriestOfTitania(this); - } + @Override + public PriestOfTitania copy() { + return new PriestOfTitania(this); + } } diff --git a/Mage.Sets/src/mage/sets/urzassaga/Rejuvenate.java b/Mage.Sets/src/mage/sets/urzassaga/Rejuvenate.java index fb528a56f6..91bf788d6a 100644 --- a/Mage.Sets/src/mage/sets/urzassaga/Rejuvenate.java +++ b/Mage.Sets/src/mage/sets/urzassaga/Rejuvenate.java @@ -45,7 +45,7 @@ public class Rejuvenate extends CardImpl { public Rejuvenate (UUID ownerId) { super(ownerId, 271, "Rejuvenate", Rarity.COMMON, new CardType[]{CardType.SORCERY}, "{3}{G}"); this.expansionSetCode = "USG"; - this.color.setGreen(true); + this.color.setGreen(true); this.getSpellAbility().addEffect(new GainLifeEffect(6)); this.addAbility(new CyclingAbility(new ManaCostsImpl("{2}"))); } diff --git a/Mage.Sets/src/mage/sets/urzassaga/ShivanRaptor.java b/Mage.Sets/src/mage/sets/urzassaga/ShivanRaptor.java index f1b8758580..a7a5b39652 100644 --- a/Mage.Sets/src/mage/sets/urzassaga/ShivanRaptor.java +++ b/Mage.Sets/src/mage/sets/urzassaga/ShivanRaptor.java @@ -50,10 +50,10 @@ public class ShivanRaptor extends CardImpl{ this.color.setRed(true); this.power = new MageInt(3); this.toughness = new MageInt(1); - - this.addAbility(FirstStrikeAbility.getInstance()); - this.addAbility(HasteAbility.getInstance()); - this.addAbility(new EchoAbility("{2}{R}")); + + this.addAbility(FirstStrikeAbility.getInstance()); + this.addAbility(HasteAbility.getInstance()); + this.addAbility(new EchoAbility("{2}{R}")); } public ShivanRaptor(final ShivanRaptor card) { diff --git a/Mage.Sets/src/mage/sets/urzassaga/SilentAttendant.java b/Mage.Sets/src/mage/sets/urzassaga/SilentAttendant.java index 3639998fd1..063120cbc2 100644 --- a/Mage.Sets/src/mage/sets/urzassaga/SilentAttendant.java +++ b/Mage.Sets/src/mage/sets/urzassaga/SilentAttendant.java @@ -47,11 +47,11 @@ public class SilentAttendant extends CardImpl { public SilentAttendant (UUID ownerId) { super(ownerId, 51, "Silent Attendant", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{2}{W}"); this.expansionSetCode = "USG"; - this.subtype.add("Human"); - this.subtype.add("Cleric"); - this.color.setWhite(true); - this.power = new MageInt(0); - this.toughness = new MageInt(2); + this.subtype.add("Human"); + this.subtype.add("Cleric"); + this.color.setWhite(true); + this.power = new MageInt(0); + this.toughness = new MageInt(2); this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new GainLifeEffect(1), new TapSourceCost())); } diff --git a/Mage.Sets/src/mage/sets/urzassaga/StrokeOfGenius.java b/Mage.Sets/src/mage/sets/urzassaga/StrokeOfGenius.java index 58dae84a5b..df9dd064fe 100644 --- a/Mage.Sets/src/mage/sets/urzassaga/StrokeOfGenius.java +++ b/Mage.Sets/src/mage/sets/urzassaga/StrokeOfGenius.java @@ -45,7 +45,7 @@ public class StrokeOfGenius extends CardImpl { public StrokeOfGenius (UUID ownerId) { super(ownerId, 100, "Stroke Of Genius", Rarity.RARE, new CardType[]{CardType.INSTANT}, "{X}{2}{U}"); this.expansionSetCode = "USG"; - this.color.setBlue(true); + this.color.setBlue(true); this.getSpellAbility().addEffect(new DrawCardTargetEffect(new ManacostVariableValue())); this.getSpellAbility().addTarget(new TargetPlayer()); } diff --git a/Mage.Sets/src/mage/sets/urzassaga/Swamp1.java b/Mage.Sets/src/mage/sets/urzassaga/Swamp1.java index b0ef56319e..5d9b36ba0a 100644 --- a/Mage.Sets/src/mage/sets/urzassaga/Swamp1.java +++ b/Mage.Sets/src/mage/sets/urzassaga/Swamp1.java @@ -36,18 +36,18 @@ import java.util.UUID; */ public class Swamp1 extends mage.cards.basiclands.Swamp { - public Swamp1(UUID ownerId) { - super(ownerId, 339); - this.expansionSetCode = "USG"; - } + public Swamp1(UUID ownerId) { + super(ownerId, 339); + this.expansionSetCode = "USG"; + } - public Swamp1(final Swamp1 card) { - super(card); - } + public Swamp1(final Swamp1 card) { + super(card); + } - @Override - public Swamp1 copy() { - return new Swamp1(this); - } + @Override + public Swamp1 copy() { + return new Swamp1(this); + } } diff --git a/Mage.Sets/src/mage/sets/urzassaga/Swamp2.java b/Mage.Sets/src/mage/sets/urzassaga/Swamp2.java index 0b31573996..2e7d65932d 100644 --- a/Mage.Sets/src/mage/sets/urzassaga/Swamp2.java +++ b/Mage.Sets/src/mage/sets/urzassaga/Swamp2.java @@ -36,18 +36,18 @@ import java.util.UUID; */ public class Swamp2 extends mage.cards.basiclands.Swamp { - public Swamp2(UUID ownerId) { - super(ownerId, 340); - this.expansionSetCode = "USG"; - } + public Swamp2(UUID ownerId) { + super(ownerId, 340); + this.expansionSetCode = "USG"; + } - public Swamp2(final Swamp2 card) { - super(card); - } + public Swamp2(final Swamp2 card) { + super(card); + } - @Override - public Swamp2 copy() { - return new Swamp2(this); - } + @Override + public Swamp2 copy() { + return new Swamp2(this); + } } diff --git a/Mage.Sets/src/mage/sets/urzassaga/Swamp3.java b/Mage.Sets/src/mage/sets/urzassaga/Swamp3.java index f936f52310..d07b76a666 100644 --- a/Mage.Sets/src/mage/sets/urzassaga/Swamp3.java +++ b/Mage.Sets/src/mage/sets/urzassaga/Swamp3.java @@ -36,18 +36,18 @@ import java.util.UUID; */ public class Swamp3 extends mage.cards.basiclands.Swamp { - public Swamp3(UUID ownerId) { - super(ownerId, 341); - this.expansionSetCode = "USG"; - } + public Swamp3(UUID ownerId) { + super(ownerId, 341); + this.expansionSetCode = "USG"; + } - public Swamp3(final Swamp3 card) { - super(card); - } + public Swamp3(final Swamp3 card) { + super(card); + } - @Override - public Swamp3 copy() { - return new Swamp3(this); - } + @Override + public Swamp3 copy() { + return new Swamp3(this); + } } diff --git a/Mage.Sets/src/mage/sets/urzassaga/Swamp4.java b/Mage.Sets/src/mage/sets/urzassaga/Swamp4.java index 80b389b545..aa31a2e474 100644 --- a/Mage.Sets/src/mage/sets/urzassaga/Swamp4.java +++ b/Mage.Sets/src/mage/sets/urzassaga/Swamp4.java @@ -36,18 +36,18 @@ import java.util.UUID; */ public class Swamp4 extends mage.cards.basiclands.Swamp { - public Swamp4(UUID ownerId) { - super(ownerId, 342); - this.expansionSetCode = "USG"; - } + public Swamp4(UUID ownerId) { + super(ownerId, 342); + this.expansionSetCode = "USG"; + } - public Swamp4(final Swamp4 card) { - super(card); - } + public Swamp4(final Swamp4 card) { + super(card); + } - @Override - public Swamp4 copy() { - return new Swamp4(this); - } + @Override + public Swamp4 copy() { + return new Swamp4(this); + } } diff --git a/Mage.Sets/src/mage/sets/urzassaga/TreefolkSeedlings.java b/Mage.Sets/src/mage/sets/urzassaga/TreefolkSeedlings.java index d21f2d81ee..49b447f130 100644 --- a/Mage.Sets/src/mage/sets/urzassaga/TreefolkSeedlings.java +++ b/Mage.Sets/src/mage/sets/urzassaga/TreefolkSeedlings.java @@ -57,7 +57,7 @@ public class TreefolkSeedlings extends CardImpl { super(ownerId, 278, "Treefolk Seedlings", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{2}{G}"); this.expansionSetCode = "USG"; this.subtype.add("Treefolk"); - this.color.setGreen(true); + this.color.setGreen(true); this.power = new MageInt(2); this.toughness = new MageInt(0); diff --git a/Mage.Sets/src/mage/sets/urzassaga/ViashinoOutrider.java b/Mage.Sets/src/mage/sets/urzassaga/ViashinoOutrider.java index fba732e531..4079d8f066 100644 --- a/Mage.Sets/src/mage/sets/urzassaga/ViashinoOutrider.java +++ b/Mage.Sets/src/mage/sets/urzassaga/ViashinoOutrider.java @@ -48,8 +48,8 @@ public class ViashinoOutrider extends CardImpl{ this.color.setRed(true); this.power = new MageInt(4); this.toughness = new MageInt(3); - - this.addAbility(new EchoAbility("{2}{R}")); + + this.addAbility(new EchoAbility("{2}{R}")); } public ViashinoOutrider(final ViashinoOutrider card) { diff --git a/Mage.Sets/src/mage/sets/urzassaga/VoiceOfGrace.java b/Mage.Sets/src/mage/sets/urzassaga/VoiceOfGrace.java index 718a55811d..7185e2f38f 100644 --- a/Mage.Sets/src/mage/sets/urzassaga/VoiceOfGrace.java +++ b/Mage.Sets/src/mage/sets/urzassaga/VoiceOfGrace.java @@ -45,32 +45,32 @@ import mage.filter.FilterCard; */ public class VoiceOfGrace extends CardImpl { - private static final FilterCard filter = new FilterCard("Black"); + private static final FilterCard filter = new FilterCard("Black"); - static { - filter.setUseColor(true); - filter.getColor().setBlack(true); - filter.setScopeColor(ComparisonScope.Any); - } + static { + filter.setUseColor(true); + filter.getColor().setBlack(true); + filter.setScopeColor(ComparisonScope.Any); + } - public VoiceOfGrace(UUID ownerId) { - super(ownerId, 54, "Voice Of Grace", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{3}{W}"); - this.expansionSetCode = "USG"; - this.subtype.add("Angel"); - this.color.setWhite(true); - this.power = new MageInt(2); - this.toughness = new MageInt(2); + public VoiceOfGrace(UUID ownerId) { + super(ownerId, 54, "Voice Of Grace", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{3}{W}"); + this.expansionSetCode = "USG"; + this.subtype.add("Angel"); + this.color.setWhite(true); + this.power = new MageInt(2); + this.toughness = new MageInt(2); this.addAbility(FlyingAbility.getInstance()); - this.addAbility(new ProtectionAbility(filter)); + this.addAbility(new ProtectionAbility(filter)); } - public VoiceOfGrace(final VoiceOfGrace card) { - super(card); - } + public VoiceOfGrace(final VoiceOfGrace card) { + super(card); + } - @Override - public VoiceOfGrace copy() { - return new VoiceOfGrace(this); - } + @Override + public VoiceOfGrace copy() { + return new VoiceOfGrace(this); + } } diff --git a/Mage.Sets/src/mage/sets/urzassaga/VoiceOfLaw.java b/Mage.Sets/src/mage/sets/urzassaga/VoiceOfLaw.java index dbc2b4c486..c130bfce44 100644 --- a/Mage.Sets/src/mage/sets/urzassaga/VoiceOfLaw.java +++ b/Mage.Sets/src/mage/sets/urzassaga/VoiceOfLaw.java @@ -44,32 +44,32 @@ import mage.filter.FilterCard; */ public class VoiceOfLaw extends CardImpl { - private static final FilterCard filter = new FilterCard("Red"); + private static final FilterCard filter = new FilterCard("Red"); - static { - filter.setUseColor(true); - filter.getColor().setRed(true); - filter.setScopeColor(ComparisonScope.Any); - } + static { + filter.setUseColor(true); + filter.getColor().setRed(true); + filter.setScopeColor(ComparisonScope.Any); + } - public VoiceOfLaw(UUID ownerId) { - super(ownerId, 55, "Voice Of Law", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{3}{W}"); - this.expansionSetCode = "USG"; - this.subtype.add("Angel"); - this.color.setWhite(true); - this.power = new MageInt(2); - this.toughness = new MageInt(2); + public VoiceOfLaw(UUID ownerId) { + super(ownerId, 55, "Voice Of Law", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{3}{W}"); + this.expansionSetCode = "USG"; + this.subtype.add("Angel"); + this.color.setWhite(true); + this.power = new MageInt(2); + this.toughness = new MageInt(2); this.addAbility(FlyingAbility.getInstance()); - this.addAbility(new ProtectionAbility(filter)); + this.addAbility(new ProtectionAbility(filter)); } - public VoiceOfLaw(final VoiceOfLaw card) { - super(card); - } + public VoiceOfLaw(final VoiceOfLaw card) { + super(card); + } - @Override - public VoiceOfLaw copy() { - return new VoiceOfLaw(this); - } + @Override + public VoiceOfLaw copy() { + return new VoiceOfLaw(this); + } } diff --git a/Mage.Sets/src/mage/sets/urzassaga/VugLizard.java b/Mage.Sets/src/mage/sets/urzassaga/VugLizard.java index 049a1e20ba..850ce2ada7 100644 --- a/Mage.Sets/src/mage/sets/urzassaga/VugLizard.java +++ b/Mage.Sets/src/mage/sets/urzassaga/VugLizard.java @@ -49,9 +49,9 @@ public class VugLizard extends CardImpl{ this.color.setRed(true); this.power = new MageInt(3); this.toughness = new MageInt(4); - - this.addAbility(new MountainwalkAbility()); - this.addAbility(new EchoAbility("{1}{R}{R}")); + + this.addAbility(new MountainwalkAbility()); + this.addAbility(new EchoAbility("{1}{R}{R}")); } public VugLizard(final VugLizard card) { diff --git a/Mage.Sets/src/mage/sets/urzassaga/WesternPaladin.java b/Mage.Sets/src/mage/sets/urzassaga/WesternPaladin.java index af601715a5..25071a2ec3 100644 --- a/Mage.Sets/src/mage/sets/urzassaga/WesternPaladin.java +++ b/Mage.Sets/src/mage/sets/urzassaga/WesternPaladin.java @@ -50,35 +50,35 @@ import mage.target.common.TargetCreaturePermanent; */ public class WesternPaladin extends CardImpl { - private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("white creature"); + private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("white creature"); - static { - filter.getColor().setWhite(true); - filter.setUseColor(true); - filter.setScopeColor(Filter.ComparisonScope.Any); - } + static { + filter.getColor().setWhite(true); + filter.setUseColor(true); + filter.setScopeColor(Filter.ComparisonScope.Any); + } - public WesternPaladin(UUID ownerId) { - super(ownerId, 168, "Western Paladin", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{2}{B}{B}"); - this.expansionSetCode = "USG"; - this.subtype.add("Zombie"); - this.subtype.add("Knight"); - this.color.setBlack(true); - this.power = new MageInt(3); - this.toughness = new MageInt(3); - Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DestroyTargetEffect(), new ManaCostsImpl("{B}{B}")); - ability.addTarget(new TargetCreaturePermanent(filter)); + public WesternPaladin(UUID ownerId) { + super(ownerId, 168, "Western Paladin", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{2}{B}{B}"); + this.expansionSetCode = "USG"; + this.subtype.add("Zombie"); + this.subtype.add("Knight"); + this.color.setBlack(true); + this.power = new MageInt(3); + this.toughness = new MageInt(3); + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DestroyTargetEffect(), new ManaCostsImpl("{B}{B}")); + ability.addTarget(new TargetCreaturePermanent(filter)); ability.addCost(new TapSourceCost()); this.addAbility(ability); } - public WesternPaladin(final WesternPaladin card) { - super(card); - } + public WesternPaladin(final WesternPaladin card) { + super(card); + } - @Override - public WesternPaladin copy() { - return new WesternPaladin(this); - } + @Override + public WesternPaladin copy() { + return new WesternPaladin(this); + } } diff --git a/Mage.Sets/src/mage/sets/urzassaga/WindingWurm.java b/Mage.Sets/src/mage/sets/urzassaga/WindingWurm.java index c0a44ea2f3..3e10660594 100644 --- a/Mage.Sets/src/mage/sets/urzassaga/WindingWurm.java +++ b/Mage.Sets/src/mage/sets/urzassaga/WindingWurm.java @@ -48,8 +48,8 @@ public class WindingWurm extends CardImpl{ this.color.setGreen(true); this.power = new MageInt(6); this.toughness = new MageInt(6); - - this.addAbility(new EchoAbility("{4}{G}")); + + this.addAbility(new EchoAbility("{4}{G}")); } public WindingWurm(final WindingWurm card) { diff --git a/Mage.Sets/src/mage/sets/urzassaga/WornPowerstone.java b/Mage.Sets/src/mage/sets/urzassaga/WornPowerstone.java index b89e7e3aac..2ffbf30f1a 100644 --- a/Mage.Sets/src/mage/sets/urzassaga/WornPowerstone.java +++ b/Mage.Sets/src/mage/sets/urzassaga/WornPowerstone.java @@ -46,7 +46,7 @@ public class WornPowerstone extends CardImpl { public WornPowerstone (UUID ownerId) { super(ownerId, 318, "Worn Powerstone", Rarity.UNCOMMON, new CardType[]{CardType.ARTIFACT}, "{3}"); this.expansionSetCode = "USG"; - this.addAbility(new EntersBattlefieldTappedAbility()); + this.addAbility(new EntersBattlefieldTappedAbility()); this.addAbility(new WornPowerstoneAbility()); } diff --git a/Mage.Sets/src/mage/sets/urzassaga/ZephidsEmbrace.java b/Mage.Sets/src/mage/sets/urzassaga/ZephidsEmbrace.java index 08346df999..913f3aa2e7 100644 --- a/Mage.Sets/src/mage/sets/urzassaga/ZephidsEmbrace.java +++ b/Mage.Sets/src/mage/sets/urzassaga/ZephidsEmbrace.java @@ -55,80 +55,80 @@ import mage.target.common.TargetCreaturePermanent; */ public class ZephidsEmbrace extends CardImpl { - public ZephidsEmbrace(UUID ownerId) { - super(ownerId, 114, "Zephid's Embrace", Rarity.UNCOMMON, new CardType[]{CardType.ENCHANTMENT}, "{2}{U}{U}"); - this.expansionSetCode = "USG"; - this.color.setBlue(true); - this.subtype.add("Aura"); + public ZephidsEmbrace(UUID ownerId) { + super(ownerId, 114, "Zephid's Embrace", Rarity.UNCOMMON, new CardType[]{CardType.ENCHANTMENT}, "{2}{U}{U}"); + this.expansionSetCode = "USG"; + this.color.setBlue(true); + this.subtype.add("Aura"); - TargetPermanent auraTarget = new TargetCreaturePermanent(); - this.getSpellAbility().addTarget(auraTarget); - this.getSpellAbility().addEffect(new AttachEffect(Outcome.Detriment)); - Ability ability = new EnchantAbility(auraTarget.getTargetName()); - this.addAbility(ability); - this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new ZephidsEmbraceEffect())); - } + TargetPermanent auraTarget = new TargetCreaturePermanent(); + this.getSpellAbility().addTarget(auraTarget); + this.getSpellAbility().addEffect(new AttachEffect(Outcome.Detriment)); + Ability ability = new EnchantAbility(auraTarget.getTargetName()); + this.addAbility(ability); + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new ZephidsEmbraceEffect())); + } - public ZephidsEmbrace(final ZephidsEmbrace card) { - super(card); - } + public ZephidsEmbrace(final ZephidsEmbrace card) { + super(card); + } - @Override - public ZephidsEmbrace copy() { - return new ZephidsEmbrace(this); - } + @Override + public ZephidsEmbrace copy() { + return new ZephidsEmbrace(this); + } } class ZephidsEmbraceEffect extends ContinuousEffectImpl { - public ZephidsEmbraceEffect() { - super(Duration.WhileOnBattlefield, Outcome.Detriment); - staticText = "Enchanted creature gets +2/+2 and has flying and shroud"; - } + public ZephidsEmbraceEffect() { + super(Duration.WhileOnBattlefield, Outcome.Detriment); + staticText = "Enchanted creature gets +2/+2 and has flying and shroud"; + } - public ZephidsEmbraceEffect(final ZephidsEmbraceEffect effect) { - super(effect); - } + public ZephidsEmbraceEffect(final ZephidsEmbraceEffect effect) { + super(effect); + } - @Override - public ZephidsEmbraceEffect copy() { - return new ZephidsEmbraceEffect(this); - } + @Override + public ZephidsEmbraceEffect copy() { + return new ZephidsEmbraceEffect(this); + } - @Override - public boolean apply(Layer layer, SubLayer sublayer, Ability source, Game game) { - Permanent enchantment = game.getPermanent(source.getSourceId()); - if (enchantment != null && enchantment.getAttachedTo() != null) { - Permanent creature = game.getPermanent(enchantment.getAttachedTo()); - if (creature != null) { - switch (layer) { - case PTChangingEffects_7: - if (sublayer == SubLayer.ModifyPT_7c) { - creature.addPower(2); - creature.addToughness(2); - } - break; - case AbilityAddingRemovingEffects_6: - if (sublayer == SubLayer.NA) { - creature.addAbility(FlyingAbility.getInstance(), game); - creature.addAbility(ShroudAbility.getInstance(), game); - } - break; - } - return true; - } - } - return false; - } + @Override + public boolean apply(Layer layer, SubLayer sublayer, Ability source, Game game) { + Permanent enchantment = game.getPermanent(source.getSourceId()); + if (enchantment != null && enchantment.getAttachedTo() != null) { + Permanent creature = game.getPermanent(enchantment.getAttachedTo()); + if (creature != null) { + switch (layer) { + case PTChangingEffects_7: + if (sublayer == SubLayer.ModifyPT_7c) { + creature.addPower(2); + creature.addToughness(2); + } + break; + case AbilityAddingRemovingEffects_6: + if (sublayer == SubLayer.NA) { + creature.addAbility(FlyingAbility.getInstance(), game); + creature.addAbility(ShroudAbility.getInstance(), game); + } + break; + } + return true; + } + } + return false; + } - @Override - public boolean apply(Game game, Ability source) { - return false; - } + @Override + public boolean apply(Game game, Ability source) { + return false; + } - @Override - public boolean hasLayer(Layer layer) { - return layer == Layer.AbilityAddingRemovingEffects_6 || layer == Layer.PTChangingEffects_7; - } + @Override + public boolean hasLayer(Layer layer) { + return layer == Layer.AbilityAddingRemovingEffects_6 || layer == Layer.PTChangingEffects_7; + } } \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/worldwake/ArborElf.java b/Mage.Sets/src/mage/sets/worldwake/ArborElf.java index 3f0e4fbfc9..2ceab27786 100644 --- a/Mage.Sets/src/mage/sets/worldwake/ArborElf.java +++ b/Mage.Sets/src/mage/sets/worldwake/ArborElf.java @@ -48,34 +48,34 @@ import mage.target.common.TargetLandPermanent; */ public class ArborElf extends CardImpl { - private static final FilterLandPermanent filter = new FilterLandPermanent(); + private static final FilterLandPermanent filter = new FilterLandPermanent(); - static { - filter.getSubtype().add("Forest"); + static { + filter.getSubtype().add("Forest"); filter.setScopeSubtype(Filter.ComparisonScope.Any); - } + } - public ArborElf(UUID ownerId) { - super(ownerId, 95, "Arbor Elf", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{G}"); - this.expansionSetCode = "WWK"; - this.subtype.add("Elf"); - this.subtype.add("Druid"); - this.color.setGreen(true); - this.power = new MageInt(1); - this.toughness = new MageInt(1); - Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new UntapTargetEffect(), new TapSourceCost()); - TargetLandPermanent target = new TargetLandPermanent(filter); - ability.addTarget(target); - this.addAbility(ability); - } + public ArborElf(UUID ownerId) { + super(ownerId, 95, "Arbor Elf", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{G}"); + this.expansionSetCode = "WWK"; + this.subtype.add("Elf"); + this.subtype.add("Druid"); + this.color.setGreen(true); + this.power = new MageInt(1); + this.toughness = new MageInt(1); + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new UntapTargetEffect(), new TapSourceCost()); + TargetLandPermanent target = new TargetLandPermanent(filter); + ability.addTarget(target); + this.addAbility(ability); + } - public ArborElf(final ArborElf card) { - super(card); - } + public ArborElf(final ArborElf card) { + super(card); + } - @Override - public ArborElf copy() { - return new ArborElf(this); - } + @Override + public ArborElf copy() { + return new ArborElf(this); + } } diff --git a/Mage.Sets/src/mage/sets/worldwake/AvengerOfZendikar.java b/Mage.Sets/src/mage/sets/worldwake/AvengerOfZendikar.java index e3d91d40d6..574b59d1c1 100644 --- a/Mage.Sets/src/mage/sets/worldwake/AvengerOfZendikar.java +++ b/Mage.Sets/src/mage/sets/worldwake/AvengerOfZendikar.java @@ -63,7 +63,7 @@ public class AvengerOfZendikar extends CardImpl { this.expansionSetCode = "WWK"; this.subtype.add("Elemental"); - this.color.setGreen(true); + this.color.setGreen(true); this.power = new MageInt(5); this.toughness = new MageInt(5); diff --git a/Mage.Sets/src/mage/sets/worldwake/BasiliskCollar.java b/Mage.Sets/src/mage/sets/worldwake/BasiliskCollar.java index 2d3124b57f..6232b41fc5 100644 --- a/Mage.Sets/src/mage/sets/worldwake/BasiliskCollar.java +++ b/Mage.Sets/src/mage/sets/worldwake/BasiliskCollar.java @@ -49,21 +49,21 @@ import mage.cards.CardImpl; */ public class BasiliskCollar extends CardImpl { - public BasiliskCollar(UUID ownerId) { - super(ownerId, 122, "Basilisk Collar", Rarity.RARE, new CardType[]{CardType.ARTIFACT}, "{1}"); - this.expansionSetCode = "WWK"; - this.subtype.add("Equipment"); - this.addAbility(new EquipAbility(Outcome.AddAbility, new GenericManaCost(2))); - this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityAttachedEffect(LifelinkAbility.getInstance(), Constants.AttachmentType.EQUIPMENT))); - this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityAttachedEffect(DeathtouchAbility.getInstance(), Constants.AttachmentType.EQUIPMENT))); - } + public BasiliskCollar(UUID ownerId) { + super(ownerId, 122, "Basilisk Collar", Rarity.RARE, new CardType[]{CardType.ARTIFACT}, "{1}"); + this.expansionSetCode = "WWK"; + this.subtype.add("Equipment"); + this.addAbility(new EquipAbility(Outcome.AddAbility, new GenericManaCost(2))); + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityAttachedEffect(LifelinkAbility.getInstance(), Constants.AttachmentType.EQUIPMENT))); + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityAttachedEffect(DeathtouchAbility.getInstance(), Constants.AttachmentType.EQUIPMENT))); + } - public BasiliskCollar(final BasiliskCollar card) { - super(card); - } + public BasiliskCollar(final BasiliskCollar card) { + super(card); + } - @Override - public BasiliskCollar copy() { - return new BasiliskCollar(this); - } + @Override + public BasiliskCollar copy() { + return new BasiliskCollar(this); + } } diff --git a/Mage.Sets/src/mage/sets/worldwake/BattleHurda.java b/Mage.Sets/src/mage/sets/worldwake/BattleHurda.java index b3dffa0f48..5b84921924 100644 --- a/Mage.Sets/src/mage/sets/worldwake/BattleHurda.java +++ b/Mage.Sets/src/mage/sets/worldwake/BattleHurda.java @@ -45,7 +45,7 @@ public class BattleHurda extends CardImpl { super(ownerId, 4, "Battle Hurda", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{4}{W}"); this.expansionSetCode = "WWK"; this.subtype.add("Giant"); - this.color.setWhite(true); + this.color.setWhite(true); this.power = new MageInt(3); this.toughness = new MageInt(3); this.addAbility(FirstStrikeAbility.getInstance()); diff --git a/Mage.Sets/src/mage/sets/worldwake/BestialMenace.java b/Mage.Sets/src/mage/sets/worldwake/BestialMenace.java index 657f21bf72..5e5715ac23 100644 --- a/Mage.Sets/src/mage/sets/worldwake/BestialMenace.java +++ b/Mage.Sets/src/mage/sets/worldwake/BestialMenace.java @@ -43,22 +43,22 @@ import mage.game.permanent.token.WolfToken; */ public class BestialMenace extends CardImpl { - public BestialMenace(UUID ownerId) { - super(ownerId, 97, "Bestial Menace", Rarity.UNCOMMON, new CardType[]{CardType.SORCERY}, "{3}{G}{G}"); - this.expansionSetCode = "WWK"; - this.color.setGreen(true); - this.getSpellAbility().addEffect(new CreateTokenEffect(new SnakeToken())); - this.getSpellAbility().addEffect(new CreateTokenEffect(new WolfToken())); - this.getSpellAbility().addEffect(new CreateTokenEffect(new ElephantToken())); - } + public BestialMenace(UUID ownerId) { + super(ownerId, 97, "Bestial Menace", Rarity.UNCOMMON, new CardType[]{CardType.SORCERY}, "{3}{G}{G}"); + this.expansionSetCode = "WWK"; + this.color.setGreen(true); + this.getSpellAbility().addEffect(new CreateTokenEffect(new SnakeToken())); + this.getSpellAbility().addEffect(new CreateTokenEffect(new WolfToken())); + this.getSpellAbility().addEffect(new CreateTokenEffect(new ElephantToken())); + } - public BestialMenace(final BestialMenace card) { - super(card); - } + public BestialMenace(final BestialMenace card) { + super(card); + } - @Override - public BestialMenace copy() { - return new BestialMenace(this); - } + @Override + public BestialMenace copy() { + return new BestialMenace(this); + } } diff --git a/Mage.Sets/src/mage/sets/worldwake/BloodhuskRitualist.java b/Mage.Sets/src/mage/sets/worldwake/BloodhuskRitualist.java index 4802a82ede..e57657e4da 100644 --- a/Mage.Sets/src/mage/sets/worldwake/BloodhuskRitualist.java +++ b/Mage.Sets/src/mage/sets/worldwake/BloodhuskRitualist.java @@ -51,14 +51,14 @@ public class BloodhuskRitualist extends CardImpl { this.expansionSetCode = "WWK"; this.subtype.add("Vampire"); this.subtype.add("Shaman"); - this.color.setBlack(true); + this.color.setBlack(true); this.power = new MageInt(2); this.toughness = new MageInt(2); MultikickerAbility ability = new MultikickerAbility(new DiscardTargetEffect(1), false); ability.addTarget(new TargetOpponent()); - ability.addManaCost(new ColoredManaCost(Constants.ColoredManaSymbol.B)); - this.addAbility(ability); + ability.addManaCost(new ColoredManaCost(Constants.ColoredManaSymbol.B)); + this.addAbility(ability); } public BloodhuskRitualist (final BloodhuskRitualist card) { diff --git a/Mage.Sets/src/mage/sets/worldwake/BrinkOfDisaster.java b/Mage.Sets/src/mage/sets/worldwake/BrinkOfDisaster.java index 5709b97924..32ae0b63d8 100644 --- a/Mage.Sets/src/mage/sets/worldwake/BrinkOfDisaster.java +++ b/Mage.Sets/src/mage/sets/worldwake/BrinkOfDisaster.java @@ -51,13 +51,13 @@ import mage.target.targetpointer.FixedTarget; */ public class BrinkOfDisaster extends CardImpl { - private static FilterPermanent filter = new FilterPermanent(); + private static FilterPermanent filter = new FilterPermanent(); - static { - filter.getCardType().add(CardType.CREATURE); - filter.getCardType().add(CardType.LAND); - filter.setScopeCardType(Filter.ComparisonScope.Any); - } + static { + filter.getCardType().add(CardType.CREATURE); + filter.getCardType().add(CardType.LAND); + filter.setScopeCardType(Filter.ComparisonScope.Any); + } public BrinkOfDisaster(UUID ownerId) { super(ownerId, 52, "Brink of Disaster", Rarity.COMMON, new CardType[]{CardType.ENCHANTMENT}, "{2}{B}{B}"); @@ -67,12 +67,12 @@ public class BrinkOfDisaster extends CardImpl { this.color.setBlack(true); // Enchant creature or land - TargetPermanent auraTarget = new TargetPermanent(); - this.getSpellAbility().addTarget(auraTarget); - this.getSpellAbility().addEffect(new AttachEffect(Constants.Outcome.AddAbility)); + TargetPermanent auraTarget = new TargetPermanent(); + this.getSpellAbility().addTarget(auraTarget); + this.getSpellAbility().addEffect(new AttachEffect(Constants.Outcome.AddAbility)); // When enchanted permanent becomes tapped, destroy it. - this.addAbility(new EnchantedBecomesTappedTriggeredAbility(new DestroyTargetEffect())); + this.addAbility(new EnchantedBecomesTappedTriggeredAbility(new DestroyTargetEffect())); } public BrinkOfDisaster(final BrinkOfDisaster card) { @@ -102,16 +102,16 @@ class EnchantedBecomesTappedTriggeredAbility extends TriggeredAbilityImpl { public BullRush (UUID ownerId) { super(ownerId, 73, "Bull Rush", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{R}"); this.expansionSetCode = "WWK"; - this.color.setRed(true); + this.color.setRed(true); this.getSpellAbility().addEffect(new BoostTargetEffect(2, 0, Duration.EndOfTurn)); this.getSpellAbility().addTarget(new TargetCreaturePermanent()); } diff --git a/Mage.Sets/src/mage/sets/worldwake/CelestialColonnade.java b/Mage.Sets/src/mage/sets/worldwake/CelestialColonnade.java index 57947e2cff..ee31d7390d 100644 --- a/Mage.Sets/src/mage/sets/worldwake/CelestialColonnade.java +++ b/Mage.Sets/src/mage/sets/worldwake/CelestialColonnade.java @@ -51,38 +51,38 @@ import mage.game.permanent.token.Token; */ public class CelestialColonnade extends CardImpl { - public CelestialColonnade(UUID ownerId) { - super(ownerId, 133, "Celestial Colonnade", Rarity.RARE, new CardType[]{CardType.LAND}, null); - this.expansionSetCode = "WWK"; - this.addAbility(new EntersBattlefieldTappedAbility()); - this.addAbility(new BlueManaAbility()); - this.addAbility(new WhiteManaAbility()); - this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new BecomesCreatureSourceEffect(new CelestialColonnadeToken(), "land", Duration.EndOfTurn), new ManaCostsImpl("{3}{W}{U}"))); - } + public CelestialColonnade(UUID ownerId) { + super(ownerId, 133, "Celestial Colonnade", Rarity.RARE, new CardType[]{CardType.LAND}, null); + this.expansionSetCode = "WWK"; + this.addAbility(new EntersBattlefieldTappedAbility()); + this.addAbility(new BlueManaAbility()); + this.addAbility(new WhiteManaAbility()); + this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new BecomesCreatureSourceEffect(new CelestialColonnadeToken(), "land", Duration.EndOfTurn), new ManaCostsImpl("{3}{W}{U}"))); + } - public CelestialColonnade(final CelestialColonnade card) { - super(card); - } + public CelestialColonnade(final CelestialColonnade card) { + super(card); + } - @Override - public CelestialColonnade copy() { - return new CelestialColonnade(this); - } + @Override + public CelestialColonnade copy() { + return new CelestialColonnade(this); + } } class CelestialColonnadeToken extends Token { - public CelestialColonnadeToken() { - super("", "4/4 white and blue Elemental creature with flying and vigilance"); - cardType.add(CardType.CREATURE); - subtype.add("Elemental"); - color.setBlue(true); - color.setWhite(true); - power = new MageInt(4); - toughness = new MageInt(4); - addAbility(FlyingAbility.getInstance()); - addAbility(VigilanceAbility.getInstance()); - } + public CelestialColonnadeToken() { + super("", "4/4 white and blue Elemental creature with flying and vigilance"); + cardType.add(CardType.CREATURE); + subtype.add("Elemental"); + color.setBlue(true); + color.setWhite(true); + power = new MageInt(4); + toughness = new MageInt(4); + addAbility(FlyingAbility.getInstance()); + addAbility(VigilanceAbility.getInstance()); + } } diff --git a/Mage.Sets/src/mage/sets/worldwake/ClawsOfValakut.java b/Mage.Sets/src/mage/sets/worldwake/ClawsOfValakut.java index 87079a17ba..90f62e439c 100644 --- a/Mage.Sets/src/mage/sets/worldwake/ClawsOfValakut.java +++ b/Mage.Sets/src/mage/sets/worldwake/ClawsOfValakut.java @@ -55,21 +55,21 @@ public class ClawsOfValakut extends CardImpl { private static final FilterLandPermanent filter = new FilterLandPermanent("Mountain you control"); - static { - filter.getSubtype().add("Mountain"); + static { + filter.getSubtype().add("Mountain"); filter.setTargetController(Constants.TargetController.YOU); - } + } public ClawsOfValakut (UUID ownerId) { super(ownerId, 75, "Claws of Valakut", Rarity.COMMON, new CardType[]{CardType.ENCHANTMENT}, "{1}{R}{R}"); this.expansionSetCode = "WWK"; this.subtype.add("Aura"); - this.color.setRed(true); + this.color.setRed(true); TargetPermanent auraTarget = new TargetCreaturePermanent(); - this.getSpellAbility().addTarget(auraTarget); - this.getSpellAbility().addEffect(new AttachEffect(Constants.Outcome.BoostCreature)); - this.addAbility(new EnchantAbility(auraTarget.getTargetName())); + this.getSpellAbility().addTarget(auraTarget); + this.getSpellAbility().addEffect(new AttachEffect(Constants.Outcome.BoostCreature)); + this.addAbility(new EnchantAbility(auraTarget.getTargetName())); SimpleStaticAbility ability = new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostEnchantedEffect(new PermanentsOnBattlefieldCount(filter, 1), new PermanentsOnBattlefieldCount(filter, 0), Duration.WhileOnBattlefield)); diff --git a/Mage.Sets/src/mage/sets/worldwake/CosisRavager.java b/Mage.Sets/src/mage/sets/worldwake/CosisRavager.java index 31871b2974..c8a5da0be1 100644 --- a/Mage.Sets/src/mage/sets/worldwake/CosisRavager.java +++ b/Mage.Sets/src/mage/sets/worldwake/CosisRavager.java @@ -48,7 +48,7 @@ public class CosisRavager extends CardImpl { super(ownerId, 77, "Cosi's Ravager", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{3}{R}"); this.expansionSetCode = "WWK"; this.subtype.add("Elemental"); - this.color.setRed(true); + this.color.setRed(true); this.power = new MageInt(2); this.toughness = new MageInt(2); Ability ability = new LandfallAbility(new DamageTargetEffect(1), false); diff --git a/Mage.Sets/src/mage/sets/worldwake/CreepingTarPit.java b/Mage.Sets/src/mage/sets/worldwake/CreepingTarPit.java index bd9e732d73..22e7b0bdd0 100644 --- a/Mage.Sets/src/mage/sets/worldwake/CreepingTarPit.java +++ b/Mage.Sets/src/mage/sets/worldwake/CreepingTarPit.java @@ -78,7 +78,7 @@ class CreepingTarPitToken extends Token { color.setBlue(true); color.setBlack(true); power = new MageInt(3); - toughness = new MageInt(2); + toughness = new MageInt(2); this.addAbility(UnblockableAbility.getInstance()); } } diff --git a/Mage.Sets/src/mage/sets/worldwake/CunningSparkmage.java b/Mage.Sets/src/mage/sets/worldwake/CunningSparkmage.java index 0d0e63ee20..8214dbbce8 100644 --- a/Mage.Sets/src/mage/sets/worldwake/CunningSparkmage.java +++ b/Mage.Sets/src/mage/sets/worldwake/CunningSparkmage.java @@ -52,7 +52,7 @@ public class CunningSparkmage extends CardImpl { this.expansionSetCode = "WWK"; this.subtype.add("Human"); this.subtype.add("Shaman"); - this.color.setRed(true); + this.color.setRed(true); this.power = new MageInt(0); this.toughness = new MageInt(1); this.addAbility(HasteAbility.getInstance()); diff --git a/Mage.Sets/src/mage/sets/worldwake/DreadStatuary.java b/Mage.Sets/src/mage/sets/worldwake/DreadStatuary.java index 8db4f07f98..29964db711 100644 --- a/Mage.Sets/src/mage/sets/worldwake/DreadStatuary.java +++ b/Mage.Sets/src/mage/sets/worldwake/DreadStatuary.java @@ -47,33 +47,33 @@ import mage.game.permanent.token.Token; */ public class DreadStatuary extends CardImpl { - public DreadStatuary(UUID ownerId) { - super(ownerId, 135, "Dread Statuary", Rarity.UNCOMMON, new CardType[]{CardType.LAND}, null); - this.expansionSetCode = "WWK"; - this.addAbility(new ColorlessManaAbility()); - this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new BecomesCreatureSourceEffect(new DreadStatuaryToken(), "land", Duration.EndOfTurn), new ManaCostsImpl("{4}"))); - } + public DreadStatuary(UUID ownerId) { + super(ownerId, 135, "Dread Statuary", Rarity.UNCOMMON, new CardType[]{CardType.LAND}, null); + this.expansionSetCode = "WWK"; + this.addAbility(new ColorlessManaAbility()); + this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new BecomesCreatureSourceEffect(new DreadStatuaryToken(), "land", Duration.EndOfTurn), new ManaCostsImpl("{4}"))); + } - public DreadStatuary(final DreadStatuary card) { - super(card); - } + public DreadStatuary(final DreadStatuary card) { + super(card); + } - @Override - public DreadStatuary copy() { - return new DreadStatuary(this); - } + @Override + public DreadStatuary copy() { + return new DreadStatuary(this); + } } class DreadStatuaryToken extends Token { - public DreadStatuaryToken() { - super("", "4/2 Golem artifact creature"); - cardType.add(CardType.CREATURE); - cardType.add(CardType.ARTIFACT); - subtype.add("Golem"); - power = new MageInt(4); - toughness = new MageInt(2); - } + public DreadStatuaryToken() { + super("", "4/2 Golem artifact creature"); + cardType.add(CardType.CREATURE); + cardType.add(CardType.ARTIFACT); + subtype.add("Golem"); + power = new MageInt(4); + toughness = new MageInt(2); + } } diff --git a/Mage.Sets/src/mage/sets/worldwake/EverflowingChalice.java b/Mage.Sets/src/mage/sets/worldwake/EverflowingChalice.java index 8cebc3f4cd..07965c9c57 100644 --- a/Mage.Sets/src/mage/sets/worldwake/EverflowingChalice.java +++ b/Mage.Sets/src/mage/sets/worldwake/EverflowingChalice.java @@ -53,10 +53,10 @@ import java.util.UUID; public class EverflowingChalice extends CardImpl { protected static final String rule = "Everflowing Chalice enters the battlefield with a charge counter on it for each time it was kicked"; - - public EverflowingChalice(UUID ownerId) { - super(ownerId, 123, "Everflowing Chalice", Rarity.UNCOMMON, new CardType[]{CardType.ARTIFACT}, "{0}"); - this.expansionSetCode = "WWK"; + + public EverflowingChalice(UUID ownerId) { + super(ownerId, 123, "Everflowing Chalice", Rarity.UNCOMMON, new CardType[]{CardType.ARTIFACT}, "{0}"); + this.expansionSetCode = "WWK"; // Everflowing Chalice enters the battlefield with a charge counter on it for each time it was kicked. Ability ability1 = new EntersBattlefieldAbility(new EverflowingChaliceAddCountersEffect()); @@ -64,20 +64,20 @@ public class EverflowingChalice extends CardImpl { // Multikicker {2} (You may pay an additional {2} any number of times as you cast this spell.) MultikickerAbility ability = new MultikickerAbility(new EmptyEffect(rule), false); - ability.addManaCost(new GenericManaCost(2)); - this.addAbility(ability); + ability.addManaCost(new GenericManaCost(2)); + this.addAbility(ability); this.addAbility(new DynamicManaAbility(Mana.ColorlessMana, new CountersCount(CounterType.CHARGE))); - } + } - public EverflowingChalice(final EverflowingChalice card) { - super(card); - } + public EverflowingChalice(final EverflowingChalice card) { + super(card); + } - @Override - public EverflowingChalice copy() { - return new EverflowingChalice(this); - } + @Override + public EverflowingChalice copy() { + return new EverflowingChalice(this); + } } diff --git a/Mage.Sets/src/mage/sets/worldwake/Explore.java b/Mage.Sets/src/mage/sets/worldwake/Explore.java index f76f63d6b5..2109a9061c 100644 --- a/Mage.Sets/src/mage/sets/worldwake/Explore.java +++ b/Mage.Sets/src/mage/sets/worldwake/Explore.java @@ -43,21 +43,21 @@ import mage.cards.CardImpl; */ public class Explore extends CardImpl { - public Explore(UUID ownerId) { - super(ownerId, 99, "Explore", Rarity.COMMON, new CardType[]{CardType.SORCERY}, "{1}{G}"); - this.expansionSetCode = "WWK"; - this.color.setGreen(true); - - this.getSpellAbility().addEffect(new PlayAdditionalLandsControllerEffect(1, Duration.EndOfTurn)); - this.getSpellAbility().addEffect(new DrawCardControllerEffect(1)); - } + public Explore(UUID ownerId) { + super(ownerId, 99, "Explore", Rarity.COMMON, new CardType[]{CardType.SORCERY}, "{1}{G}"); + this.expansionSetCode = "WWK"; + this.color.setGreen(true); - public Explore(final Explore card) { - super(card); - } + this.getSpellAbility().addEffect(new PlayAdditionalLandsControllerEffect(1, Duration.EndOfTurn)); + this.getSpellAbility().addEffect(new DrawCardControllerEffect(1)); + } - @Override - public Explore copy() { - return new Explore(this); - } + public Explore(final Explore card) { + super(card); + } + + @Override + public Explore copy() { + return new Explore(this); + } } \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/worldwake/EyeOfUgin.java b/Mage.Sets/src/mage/sets/worldwake/EyeOfUgin.java index 3588917a34..42f8b76586 100644 --- a/Mage.Sets/src/mage/sets/worldwake/EyeOfUgin.java +++ b/Mage.Sets/src/mage/sets/worldwake/EyeOfUgin.java @@ -55,13 +55,13 @@ import mage.target.common.TargetCardInLibrary; */ public class EyeOfUgin extends CardImpl { - private static final FilterCreatureCard filter; + private static final FilterCreatureCard filter; - static { - filter = new FilterCreatureCard(); - filter.setColorless(true); - filter.setUseColorless(true); - } + static { + filter = new FilterCreatureCard(); + filter.setColorless(true); + filter.setUseColorless(true); + } public EyeOfUgin (UUID ownerId) { super(ownerId, 136, "Eye of Ugin", Rarity.MYTHIC, new CardType[]{CardType.LAND}, null); @@ -69,9 +69,9 @@ public class EyeOfUgin extends CardImpl { this.supertype.add("Legendary"); this.subtype.add("Land"); - this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new EyeOfUginCostReductionEffect())); - Ability searchAbility = new SimpleActivatedAbility(Zone.BATTLEFIELD, new SearchLibraryRevealPutInHandEffect(new TargetCardInLibrary(filter)), new TapSourceCost()); - searchAbility.addCost(new ManaCostsImpl("{7}")); + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new EyeOfUginCostReductionEffect())); + Ability searchAbility = new SimpleActivatedAbility(Zone.BATTLEFIELD, new SearchLibraryRevealPutInHandEffect(new TargetCardInLibrary(filter)), new TapSourceCost()); + searchAbility.addCost(new ManaCostsImpl("{7}")); this.addAbility(searchAbility); } @@ -87,44 +87,44 @@ public class EyeOfUgin extends CardImpl { class EyeOfUginCostReductionEffect extends CostModificationEffectImpl { - private static final String effectText = "Colorless Eldrazi spells you cast cost {2} less to cast"; + private static final String effectText = "Colorless Eldrazi spells you cast cost {2} less to cast"; - EyeOfUginCostReductionEffect ( ) { - super(Duration.WhileOnBattlefield, Outcome.Benefit); - staticText = effectText; - } + EyeOfUginCostReductionEffect ( ) { + super(Duration.WhileOnBattlefield, Outcome.Benefit); + staticText = effectText; + } - EyeOfUginCostReductionEffect(EyeOfUginCostReductionEffect effect) { - super(effect); - } + EyeOfUginCostReductionEffect(EyeOfUginCostReductionEffect effect) { + super(effect); + } - @Override - public boolean apply(Game game, Ability source, Ability abilityToModify) { - SpellAbility spellAbility = (SpellAbility)abilityToModify; - int previousCost = spellAbility.getManaCostsToPay().convertedManaCost(); - int adjustedCost = 0; - if ( (previousCost - 2) > 0 ) { - adjustedCost = previousCost - 2; - } - spellAbility.getManaCostsToPay().load("{" + adjustedCost + "}"); + @Override + public boolean apply(Game game, Ability source, Ability abilityToModify) { + SpellAbility spellAbility = (SpellAbility)abilityToModify; + int previousCost = spellAbility.getManaCostsToPay().convertedManaCost(); + int adjustedCost = 0; + if ( (previousCost - 2) > 0 ) { + adjustedCost = previousCost - 2; + } + spellAbility.getManaCostsToPay().load("{" + adjustedCost + "}"); - return true; - } - - @Override - public boolean applies(Ability abilityToModify, Ability source, Game game) { - if ( abilityToModify instanceof SpellAbility ) { - Card sourceCard = game.getCard(((SpellAbility)abilityToModify).getSourceId()); - if ( sourceCard != null && sourceCard.hasSubtype("Eldrazi") && sourceCard.getOwnerId().equals(source.getControllerId()) ) { - return true; - } - } - return false; - } + return true; + } - @Override - public EyeOfUginCostReductionEffect copy() { - return new EyeOfUginCostReductionEffect(this); - } + @Override + public boolean applies(Ability abilityToModify, Ability source, Game game) { + if ( abilityToModify instanceof SpellAbility ) { + Card sourceCard = game.getCard(((SpellAbility)abilityToModify).getSourceId()); + if ( sourceCard != null && sourceCard.hasSubtype("Eldrazi") && sourceCard.getOwnerId().equals(source.getControllerId()) ) { + return true; + } + } + return false; + } + + @Override + public EyeOfUginCostReductionEffect copy() { + return new EyeOfUginCostReductionEffect(this); + } } diff --git a/Mage.Sets/src/mage/sets/worldwake/FledglingGriffin.java b/Mage.Sets/src/mage/sets/worldwake/FledglingGriffin.java index 71b8c78a4e..4f0b48f7a9 100644 --- a/Mage.Sets/src/mage/sets/worldwake/FledglingGriffin.java +++ b/Mage.Sets/src/mage/sets/worldwake/FledglingGriffin.java @@ -48,7 +48,7 @@ public class FledglingGriffin extends CardImpl { super(ownerId, 5, "Fledgling Griffin", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{1}{W}"); this.expansionSetCode = "WWK"; this.subtype.add("Griffin"); - this.color.setWhite(true); + this.color.setWhite(true); this.power = new MageInt(2); this.toughness = new MageInt(2); this.addAbility(new LandfallAbility(new GainAbilitySourceEffect(FlyingAbility.getInstance(), Duration.EndOfTurn), false)); diff --git a/Mage.Sets/src/mage/sets/worldwake/GoblinRoughrider.java b/Mage.Sets/src/mage/sets/worldwake/GoblinRoughrider.java index 760e610615..3cfbcf01d3 100644 --- a/Mage.Sets/src/mage/sets/worldwake/GoblinRoughrider.java +++ b/Mage.Sets/src/mage/sets/worldwake/GoblinRoughrider.java @@ -45,7 +45,7 @@ public class GoblinRoughrider extends CardImpl { this.expansionSetCode = "WWK"; this.subtype.add("Goblin"); this.subtype.add("Knight"); - this.color.setRed(true); + this.color.setRed(true); this.power = new MageInt(3); this.toughness = new MageInt(2); } diff --git a/Mage.Sets/src/mage/sets/worldwake/GoliathSphinx.java b/Mage.Sets/src/mage/sets/worldwake/GoliathSphinx.java index 2b3fc2f99d..689dacbb7a 100644 --- a/Mage.Sets/src/mage/sets/worldwake/GoliathSphinx.java +++ b/Mage.Sets/src/mage/sets/worldwake/GoliathSphinx.java @@ -45,7 +45,7 @@ public class GoliathSphinx extends CardImpl { super(ownerId, 28, "Goliath Sphinx", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{5}{U}{U}"); this.expansionSetCode = "WWK"; this.subtype.add("Sphinx"); - this.color.setBlue(true); + this.color.setBlue(true); this.power = new MageInt(8); this.toughness = new MageInt(7); this.addAbility(FlyingAbility.getInstance()); diff --git a/Mage.Sets/src/mage/sets/worldwake/GrapplerSpider.java b/Mage.Sets/src/mage/sets/worldwake/GrapplerSpider.java index 9ec17c801f..e57771a50d 100644 --- a/Mage.Sets/src/mage/sets/worldwake/GrapplerSpider.java +++ b/Mage.Sets/src/mage/sets/worldwake/GrapplerSpider.java @@ -45,7 +45,7 @@ public class GrapplerSpider extends CardImpl { super(ownerId, 102, "Grappler Spider", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{1}{G}"); this.expansionSetCode = "WWK"; this.subtype.add("Spider"); - this.color.setGreen(true); + this.color.setGreen(true); this.power = new MageInt(2); this.toughness = new MageInt(1); this.addAbility(ReachAbility.getInstance()); diff --git a/Mage.Sets/src/mage/sets/worldwake/Groundswell.java b/Mage.Sets/src/mage/sets/worldwake/Groundswell.java index cc76c4e5f4..06d2f68513 100644 --- a/Mage.Sets/src/mage/sets/worldwake/Groundswell.java +++ b/Mage.Sets/src/mage/sets/worldwake/Groundswell.java @@ -51,45 +51,45 @@ import mage.watchers.common.LandfallWatcher; */ public class Groundswell extends CardImpl { - public Groundswell(UUID ownerId) { - super(ownerId, 104, "Groundswell", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{G}"); - this.expansionSetCode = "WWK"; - this.color.setGreen(true); - - this.getSpellAbility().addTarget(new TargetCreaturePermanent()); - this.getSpellAbility().addEffect(new GroundswellEffect(Duration.EndOfTurn)); - - this.addWatcher(new LandfallWatcher()); - } + public Groundswell(UUID ownerId) { + super(ownerId, 104, "Groundswell", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{G}"); + this.expansionSetCode = "WWK"; + this.color.setGreen(true); - public Groundswell(final Groundswell card) { - super(card); - } + this.getSpellAbility().addTarget(new TargetCreaturePermanent()); + this.getSpellAbility().addEffect(new GroundswellEffect(Duration.EndOfTurn)); - @Override - public Groundswell copy() { - return new Groundswell(this); - } + this.addWatcher(new LandfallWatcher()); + } + + public Groundswell(final Groundswell card) { + super(card); + } + + @Override + public Groundswell copy() { + return new Groundswell(this); + } } class GroundswellEffect extends ContinuousEffectImpl { - public GroundswellEffect(Duration duration) { - super(duration, Layer.PTChangingEffects_7, SubLayer.ModifyPT_7c, Outcome.BoostCreature); - staticText = "Target creature gets +2/+2 until end of turn.\nLandfall - If you had a land enter the battlefield under your control this turn, that creature gets +4/+4 until end of turn instead"; - } + public GroundswellEffect(Duration duration) { + super(duration, Layer.PTChangingEffects_7, SubLayer.ModifyPT_7c, Outcome.BoostCreature); + staticText = "Target creature gets +2/+2 until end of turn.\nLandfall - If you had a land enter the battlefield under your control this turn, that creature gets +4/+4 until end of turn instead"; + } - public GroundswellEffect(final GroundswellEffect effect) { - super(effect); - } + public GroundswellEffect(final GroundswellEffect effect) { + super(effect); + } - @Override - public GroundswellEffect copy() { - return new GroundswellEffect(this); - } + @Override + public GroundswellEffect copy() { + return new GroundswellEffect(this); + } - @Override - public boolean apply(Game game, Ability source) { + @Override + public boolean apply(Game game, Ability source) { Watcher watcher = game.getState().getWatchers().get("LandPlayed", source.getControllerId()); Permanent target = (Permanent) game.getPermanent(source.getFirstTarget()); if (target != null) { @@ -103,7 +103,7 @@ class GroundswellEffect extends ContinuousEffectImpl { } return true; } - return false; - } + return false; + } } diff --git a/Mage.Sets/src/mage/sets/worldwake/HalimarDepths.java b/Mage.Sets/src/mage/sets/worldwake/HalimarDepths.java index 855ed82682..5eeb422662 100644 --- a/Mage.Sets/src/mage/sets/worldwake/HalimarDepths.java +++ b/Mage.Sets/src/mage/sets/worldwake/HalimarDepths.java @@ -43,23 +43,23 @@ import mage.cards.CardImpl; */ public class HalimarDepths extends CardImpl { - public HalimarDepths(UUID ownerId) { - super(ownerId, 137, "Halimar Depths", Rarity.COMMON, new CardType[]{CardType.LAND}, null); - this.expansionSetCode = "WWK"; + public HalimarDepths(UUID ownerId) { + super(ownerId, 137, "Halimar Depths", Rarity.COMMON, new CardType[]{CardType.LAND}, null); + this.expansionSetCode = "WWK"; // Halimar Depths enters the battlefield tapped. this.addAbility(new EntersBattlefieldTappedAbility()); // When Halimar Depths enters the battlefield, look at the top three cards of your library, then put them back in any order. - this.addAbility(new EntersBattlefieldTriggeredAbility(new LookLibraryControllerEffect(3))); - this.addAbility(new BlueManaAbility()); - } + this.addAbility(new EntersBattlefieldTriggeredAbility(new LookLibraryControllerEffect(3))); + this.addAbility(new BlueManaAbility()); + } - public HalimarDepths(final HalimarDepths card) { - super(card); - } + public HalimarDepths(final HalimarDepths card) { + super(card); + } - @Override - public HalimarDepths copy() { - return new HalimarDepths(this); - } + @Override + public HalimarDepths copy() { + return new HalimarDepths(this); + } } diff --git a/Mage.Sets/src/mage/sets/worldwake/HalimarExcavator.java b/Mage.Sets/src/mage/sets/worldwake/HalimarExcavator.java index dd2f0eb27c..8909ed067b 100644 --- a/Mage.Sets/src/mage/sets/worldwake/HalimarExcavator.java +++ b/Mage.Sets/src/mage/sets/worldwake/HalimarExcavator.java @@ -52,7 +52,7 @@ public class HalimarExcavator extends CardImpl { static { filter.getSubtype().add("Ally"); - filter.setScopeSubtype(Filter.ComparisonScope.Any); + filter.setScopeSubtype(Filter.ComparisonScope.Any); filter.setTargetController(TargetController.YOU); } diff --git a/Mage.Sets/src/mage/sets/worldwake/HammerOfRuin.java b/Mage.Sets/src/mage/sets/worldwake/HammerOfRuin.java index 83a3157adb..6fd97282b9 100644 --- a/Mage.Sets/src/mage/sets/worldwake/HammerOfRuin.java +++ b/Mage.Sets/src/mage/sets/worldwake/HammerOfRuin.java @@ -102,7 +102,7 @@ class HammerOfRuinTriggeredAbility extends TriggeredAbilityImpl { super(ownerId, 30, "Horizon Drake", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{1}{U}{U}"); this.expansionSetCode = "WWK"; this.subtype.add("Drake"); - this.color.setBlue(true); + this.color.setBlue(true); this.power = new MageInt(3); this.toughness = new MageInt(1); this.addAbility(FlyingAbility.getInstance()); diff --git a/Mage.Sets/src/mage/sets/worldwake/IonasJudgment.java b/Mage.Sets/src/mage/sets/worldwake/IonasJudgment.java index 1bb045ac2c..63fe5c8ff2 100644 --- a/Mage.Sets/src/mage/sets/worldwake/IonasJudgment.java +++ b/Mage.Sets/src/mage/sets/worldwake/IonasJudgment.java @@ -53,10 +53,10 @@ public class IonasJudgment extends CardImpl { public IonasJudgment (UUID ownerId) { super(ownerId, 8, "Iona's Judgment", Rarity.COMMON, new CardType[]{CardType.SORCERY}, "{4}{W}"); this.expansionSetCode = "WWK"; - this.color.setWhite(true); + this.color.setWhite(true); this.getSpellAbility().addEffect(new ExileTargetEffect()); this.getSpellAbility().addTarget(new TargetPermanent(filter)); - + } public IonasJudgment (final IonasJudgment card) { diff --git a/Mage.Sets/src/mage/sets/worldwake/JagwaspSwarm.java b/Mage.Sets/src/mage/sets/worldwake/JagwaspSwarm.java index 95b341d0df..54152de2e3 100644 --- a/Mage.Sets/src/mage/sets/worldwake/JagwaspSwarm.java +++ b/Mage.Sets/src/mage/sets/worldwake/JagwaspSwarm.java @@ -45,7 +45,7 @@ public class JagwaspSwarm extends CardImpl { super(ownerId, 58, "Jagwasp Swarm", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{3}{B}"); this.expansionSetCode = "WWK"; this.subtype.add("Insect"); - this.color.setBlack(true); + this.color.setBlack(true); this.power = new MageInt(3); this.toughness = new MageInt(2); this.addAbility(FlyingAbility.getInstance()); diff --git a/Mage.Sets/src/mage/sets/worldwake/JoinTheRanks.java b/Mage.Sets/src/mage/sets/worldwake/JoinTheRanks.java index 85107cf526..3afa5d6f71 100644 --- a/Mage.Sets/src/mage/sets/worldwake/JoinTheRanks.java +++ b/Mage.Sets/src/mage/sets/worldwake/JoinTheRanks.java @@ -44,7 +44,7 @@ public class JoinTheRanks extends CardImpl { public JoinTheRanks (UUID ownerId) { super(ownerId, 9, "Join the Ranks", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{3}{W}"); this.expansionSetCode = "WWK"; - this.color.setWhite(true); + this.color.setWhite(true); this.getSpellAbility().addEffect(new CreateTokenEffect(new SoldierToken(), 2)); } diff --git a/Mage.Sets/src/mage/sets/worldwake/KalastriaHighborn.java b/Mage.Sets/src/mage/sets/worldwake/KalastriaHighborn.java index c9b984718e..8c88aedfda 100644 --- a/Mage.Sets/src/mage/sets/worldwake/KalastriaHighborn.java +++ b/Mage.Sets/src/mage/sets/worldwake/KalastriaHighborn.java @@ -51,78 +51,78 @@ import java.util.UUID; */ public class KalastriaHighborn extends CardImpl { - public KalastriaHighborn(UUID ownerId) { - super(ownerId, 59, "Kalastria Highborn", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{B}{B}"); - this.expansionSetCode = "WWK"; - this.subtype.add("Vampire"); - this.subtype.add("Shaman"); + public KalastriaHighborn(UUID ownerId) { + super(ownerId, 59, "Kalastria Highborn", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{B}{B}"); + this.expansionSetCode = "WWK"; + this.subtype.add("Vampire"); + this.subtype.add("Shaman"); - this.color.setBlack(true); - this.power = new MageInt(2); - this.toughness = new MageInt(2); + this.color.setBlack(true); + this.power = new MageInt(2); + this.toughness = new MageInt(2); - this.addAbility(new KalastriaHighbornTriggeredAbility()); - } + this.addAbility(new KalastriaHighbornTriggeredAbility()); + } - public KalastriaHighborn(final KalastriaHighborn card) { - super(card); - } + public KalastriaHighborn(final KalastriaHighborn card) { + super(card); + } - @Override - public KalastriaHighborn copy() { - return new KalastriaHighborn(this); - } + @Override + public KalastriaHighborn copy() { + return new KalastriaHighborn(this); + } } class KalastriaHighbornTriggeredAbility extends TriggeredAbilityImpl { - KalastriaHighbornTriggeredAbility ( ) { - super(Zone.ALL, new LoseLifeTargetEffect(2), false); - this.addCost(new ManaCostsImpl("{B}")); - this.addTarget(new TargetPlayer()); - this.getEffects().add(new GainLifeEffect(2)); - } + KalastriaHighbornTriggeredAbility ( ) { + super(Zone.ALL, new LoseLifeTargetEffect(2), false); + this.addCost(new ManaCostsImpl("{B}")); + this.addTarget(new TargetPlayer()); + this.getEffects().add(new GainLifeEffect(2)); + } - KalastriaHighbornTriggeredAbility ( KalastriaHighbornTriggeredAbility ability ) { - super(ability); - } + KalastriaHighbornTriggeredAbility ( KalastriaHighbornTriggeredAbility ability ) { + super(ability); + } - @Override - public KalastriaHighbornTriggeredAbility copy() { - return new KalastriaHighbornTriggeredAbility(this); - } + @Override + public KalastriaHighbornTriggeredAbility copy() { + return new KalastriaHighbornTriggeredAbility(this); + } - @Override - public boolean checkTrigger(GameEvent event, Game game) { - if ( event.getType() == EventType.ZONE_CHANGE ) { + @Override + public boolean checkTrigger(GameEvent event, Game game) { + if ( event.getType() == EventType.ZONE_CHANGE ) { - // ayrat: make sure Kalastria Highborn is on battlefield - UUID sourceId = getSourceId(); - if (game.getPermanent(sourceId) == null) { - // or it is being removed - if (game.getLastKnownInformation(sourceId, Zone.BATTLEFIELD) == null) { - return false; - } - } + // ayrat: make sure Kalastria Highborn is on battlefield + UUID sourceId = getSourceId(); + if (game.getPermanent(sourceId) == null) { + // or it is being removed + if (game.getLastKnownInformation(sourceId, Zone.BATTLEFIELD) == null) { + return false; + } + } - ZoneChangeEvent zEvent = (ZoneChangeEvent)event; - Permanent permanent = zEvent.getTarget(); - - if (permanent != null && - zEvent.getToZone() == Zone.GRAVEYARD && - zEvent.getFromZone() == Zone.BATTLEFIELD && - (permanent.getControllerId().equals(this.getControllerId()) && - permanent.hasSubtype("Vampire") || permanent.getId().equals(this.getSourceId()))) - { - return true; - } - } - return false; - } + ZoneChangeEvent zEvent = (ZoneChangeEvent)event; + Permanent permanent = zEvent.getTarget(); - @Override - public String getRule() { - return "Whenever {this} or another Vampire you control is put" - + " into a graveyard from the battlefield, you may pay {B}. If you" - + " do, target player loses 2 life and you gain 2 life."; - } + if (permanent != null && + zEvent.getToZone() == Zone.GRAVEYARD && + zEvent.getFromZone() == Zone.BATTLEFIELD && + (permanent.getControllerId().equals(this.getControllerId()) && + permanent.hasSubtype("Vampire") || permanent.getId().equals(this.getSourceId()))) + { + return true; + } + } + return false; + } + + @Override + public String getRule() { + return "Whenever {this} or another Vampire you control is put" + + " into a graveyard from the battlefield, you may pay {B}. If you" + + " do, target player loses 2 life and you gain 2 life."; + } } diff --git a/Mage.Sets/src/mage/sets/worldwake/KhalniGarden.java b/Mage.Sets/src/mage/sets/worldwake/KhalniGarden.java index e4d21aea68..162f6283d4 100644 --- a/Mage.Sets/src/mage/sets/worldwake/KhalniGarden.java +++ b/Mage.Sets/src/mage/sets/worldwake/KhalniGarden.java @@ -44,21 +44,21 @@ import mage.game.permanent.token.PlantToken; */ public class KhalniGarden extends CardImpl { - public KhalniGarden(UUID ownerId) { - super(ownerId, 138, "Khalni Garden", Rarity.COMMON, new CardType[]{CardType.LAND}, null); - this.expansionSetCode = "WWK"; - this.addAbility(new EntersBattlefieldTappedAbility()); - this.addAbility(new EntersBattlefieldTriggeredAbility(new CreateTokenEffect(new PlantToken()), false)); - this.addAbility(new GreenManaAbility()); - } + public KhalniGarden(UUID ownerId) { + super(ownerId, 138, "Khalni Garden", Rarity.COMMON, new CardType[]{CardType.LAND}, null); + this.expansionSetCode = "WWK"; + this.addAbility(new EntersBattlefieldTappedAbility()); + this.addAbility(new EntersBattlefieldTriggeredAbility(new CreateTokenEffect(new PlantToken()), false)); + this.addAbility(new GreenManaAbility()); + } - public KhalniGarden(final KhalniGarden card) { - super(card); - } + public KhalniGarden(final KhalniGarden card) { + super(card); + } - @Override - public KhalniGarden copy() { - return new KhalniGarden(this); - } + @Override + public KhalniGarden copy() { + return new KhalniGarden(this); + } } diff --git a/Mage.Sets/src/mage/sets/worldwake/Kitesail.java b/Mage.Sets/src/mage/sets/worldwake/Kitesail.java index 8f0e568acc..61fd3d6207 100644 --- a/Mage.Sets/src/mage/sets/worldwake/Kitesail.java +++ b/Mage.Sets/src/mage/sets/worldwake/Kitesail.java @@ -52,8 +52,8 @@ public class Kitesail extends CardImpl { this.subtype.add("Equipment"); this.addAbility(new SimpleStaticAbility(Constants.Zone.BATTLEFIELD, new BoostEquippedEffect(1, 0))); - this.addAbility(new SimpleStaticAbility(Constants.Zone.BATTLEFIELD, new GainAbilityAttachedEffect(FlyingAbility.getInstance(), Constants.AttachmentType.EQUIPMENT))); - this.addAbility(new EquipAbility(Constants.Outcome.AddAbility, new GenericManaCost(2))); + this.addAbility(new SimpleStaticAbility(Constants.Zone.BATTLEFIELD, new GainAbilityAttachedEffect(FlyingAbility.getInstance(), Constants.AttachmentType.EQUIPMENT))); + this.addAbility(new EquipAbility(Constants.Outcome.AddAbility, new GenericManaCost(2))); } public Kitesail(final Kitesail card) { diff --git a/Mage.Sets/src/mage/sets/worldwake/KorFirewalker.java b/Mage.Sets/src/mage/sets/worldwake/KorFirewalker.java index 3bb790e3f8..73d9aeb462 100644 --- a/Mage.Sets/src/mage/sets/worldwake/KorFirewalker.java +++ b/Mage.Sets/src/mage/sets/worldwake/KorFirewalker.java @@ -52,8 +52,8 @@ public class KorFirewalker extends CardImpl { static { filter.setUseColor(true); - filter.getColor().setRed(true); - filter.setScopeColor(ComparisonScope.Any); + filter.getColor().setRed(true); + filter.setScopeColor(ComparisonScope.Any); } public KorFirewalker (UUID ownerId) { @@ -61,12 +61,12 @@ public class KorFirewalker extends CardImpl { this.expansionSetCode = "WWK"; this.subtype.add("Kor"); this.subtype.add("Soldier"); - this.color.setWhite(true); - this.color.setWhite(true); + this.color.setWhite(true); + this.color.setWhite(true); this.power = new MageInt(2); this.toughness = new MageInt(2); - this.addAbility(new ProtectionAbility(filter)); + this.addAbility(new ProtectionAbility(filter)); this.addAbility(new KorFirewalkerAbility()); } @@ -84,32 +84,32 @@ public class KorFirewalker extends CardImpl { class KorFirewalkerAbility extends TriggeredAbilityImpl { - public KorFirewalkerAbility() { - super(Zone.BATTLEFIELD, new GainLifeEffect(1), true); - } + public KorFirewalkerAbility() { + super(Zone.BATTLEFIELD, new GainLifeEffect(1), true); + } - public KorFirewalkerAbility(final KorFirewalkerAbility ability) { - super(ability); - } + public KorFirewalkerAbility(final KorFirewalkerAbility ability) { + super(ability); + } - @Override - public KorFirewalkerAbility copy() { - return new KorFirewalkerAbility(this); - } + @Override + public KorFirewalkerAbility copy() { + return new KorFirewalkerAbility(this); + } - @Override - public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == GameEvent.EventType.SPELL_CAST) { - Spell spell = game.getStack().getSpell(event.getTargetId()); - if (spell != null && spell.getColor().isRed()) { - return true; - } - } - return false; - } + @Override + public boolean checkTrigger(GameEvent event, Game game) { + if (event.getType() == GameEvent.EventType.SPELL_CAST) { + Spell spell = game.getStack().getSpell(event.getTargetId()); + if (spell != null && spell.getColor().isRed()) { + return true; + } + } + return false; + } - @Override - public String getRule() { - return "Whenever a player casts a red spell, you may gain 1 life."; - } + @Override + public String getRule() { + return "Whenever a player casts a red spell, you may gain 1 life."; + } } \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/worldwake/LavaclawReaches.java b/Mage.Sets/src/mage/sets/worldwake/LavaclawReaches.java index 4dcf159d09..8516ac9fb5 100644 --- a/Mage.Sets/src/mage/sets/worldwake/LavaclawReaches.java +++ b/Mage.Sets/src/mage/sets/worldwake/LavaclawReaches.java @@ -52,37 +52,37 @@ import mage.game.permanent.token.Token; */ public class LavaclawReaches extends CardImpl { - public LavaclawReaches(UUID ownerId) { - super(ownerId, 139, "Lavaclaw Reaches", Rarity.RARE, new CardType[]{CardType.LAND}, null); - this.expansionSetCode = "WWK"; - this.addAbility(new EntersBattlefieldTappedAbility()); - this.addAbility(new BlackManaAbility()); - this.addAbility(new RedManaAbility()); - this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new BecomesCreatureSourceEffect(new LavaclawReachesToken(), "land", Duration.EndOfTurn), new ManaCostsImpl("{1}{B}{R}"))); - } + public LavaclawReaches(UUID ownerId) { + super(ownerId, 139, "Lavaclaw Reaches", Rarity.RARE, new CardType[]{CardType.LAND}, null); + this.expansionSetCode = "WWK"; + this.addAbility(new EntersBattlefieldTappedAbility()); + this.addAbility(new BlackManaAbility()); + this.addAbility(new RedManaAbility()); + this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new BecomesCreatureSourceEffect(new LavaclawReachesToken(), "land", Duration.EndOfTurn), new ManaCostsImpl("{1}{B}{R}"))); + } - public LavaclawReaches(final LavaclawReaches card) { - super(card); - } + public LavaclawReaches(final LavaclawReaches card) { + super(card); + } - @Override - public LavaclawReaches copy() { - return new LavaclawReaches(this); - } + @Override + public LavaclawReaches copy() { + return new LavaclawReaches(this); + } } class LavaclawReachesToken extends Token { - public LavaclawReachesToken() { - super("", "2/2 black and red Elemental creature with \"{X}: This creature gets +X/+0 until end of turn.\""); - cardType.add(CardType.CREATURE); - subtype.add("Elemental"); - color.setRed(true); - color.setBlack(true); - power = new MageInt(2); - toughness = new MageInt(2); - addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new BoostSourceEffect(new ManacostVariableValue(), new StaticValue(0), Duration.EndOfTurn), new ManaCostsImpl("{X}"))); - } + public LavaclawReachesToken() { + super("", "2/2 black and red Elemental creature with \"{X}: This creature gets +X/+0 until end of turn.\""); + cardType.add(CardType.CREATURE); + subtype.add("Elemental"); + color.setRed(true); + color.setBlack(true); + power = new MageInt(2); + toughness = new MageInt(2); + addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new BoostSourceEffect(new ManacostVariableValue(), new StaticValue(0), Duration.EndOfTurn), new ManaCostsImpl("{X}"))); + } } diff --git a/Mage.Sets/src/mage/sets/worldwake/LeatherbackBaloth.java b/Mage.Sets/src/mage/sets/worldwake/LeatherbackBaloth.java index dd871973b2..b50a1debe5 100644 --- a/Mage.Sets/src/mage/sets/worldwake/LeatherbackBaloth.java +++ b/Mage.Sets/src/mage/sets/worldwake/LeatherbackBaloth.java @@ -44,7 +44,7 @@ public class LeatherbackBaloth extends CardImpl { super(ownerId, 107, "Leatherback Baloth", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{G}{G}{G}"); this.expansionSetCode = "WWK"; this.subtype.add("Beast"); - this.color.setGreen(true); + this.color.setGreen(true); this.power = new MageInt(4); this.toughness = new MageInt(5); } diff --git a/Mage.Sets/src/mage/sets/worldwake/MarshThreader.java b/Mage.Sets/src/mage/sets/worldwake/MarshThreader.java index 4edb849db3..81b7dd2951 100644 --- a/Mage.Sets/src/mage/sets/worldwake/MarshThreader.java +++ b/Mage.Sets/src/mage/sets/worldwake/MarshThreader.java @@ -46,7 +46,7 @@ public class MarshThreader extends CardImpl { this.expansionSetCode = "WWK"; this.subtype.add("Kor"); this.subtype.add("Scout"); - this.color.setWhite(true); + this.color.setWhite(true); this.power = new MageInt(2); this.toughness = new MageInt(1); this.addAbility(new SwampwalkAbility()); diff --git a/Mage.Sets/src/mage/sets/worldwake/NaturesClaim.java b/Mage.Sets/src/mage/sets/worldwake/NaturesClaim.java index ba0f00faf6..e925865238 100644 --- a/Mage.Sets/src/mage/sets/worldwake/NaturesClaim.java +++ b/Mage.Sets/src/mage/sets/worldwake/NaturesClaim.java @@ -59,7 +59,7 @@ public class NaturesClaim extends CardImpl { public NaturesClaim (UUID ownerId) { super(ownerId, 108, "Nature's Claim", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{G}"); this.expansionSetCode = "WWK"; - this.color.setGreen(true); + this.color.setGreen(true); this.getSpellAbility().addEffect(new DestroyTargetEffect()); this.getSpellAbility().addEffect(new NaturesClaimEffect()); this.getSpellAbility().addTarget(new TargetPermanent(filter)); diff --git a/Mage.Sets/src/mage/sets/worldwake/PilgrimsEye.java b/Mage.Sets/src/mage/sets/worldwake/PilgrimsEye.java index 7654979c83..8deb4c7b31 100644 --- a/Mage.Sets/src/mage/sets/worldwake/PilgrimsEye.java +++ b/Mage.Sets/src/mage/sets/worldwake/PilgrimsEye.java @@ -48,7 +48,7 @@ public class PilgrimsEye extends CardImpl { static { filter.getSupertype().add("Basic"); - filter.getCardType().add(CardType.LAND); + filter.getCardType().add(CardType.LAND); } public PilgrimsEye (UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/worldwake/PulseTracker.java b/Mage.Sets/src/mage/sets/worldwake/PulseTracker.java index abb8e53060..89b3edf384 100644 --- a/Mage.Sets/src/mage/sets/worldwake/PulseTracker.java +++ b/Mage.Sets/src/mage/sets/worldwake/PulseTracker.java @@ -46,58 +46,58 @@ import mage.players.Players; */ public class PulseTracker extends CardImpl { - public PulseTracker(UUID ownerId) { - super(ownerId, 62, "Pulse Tracker", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{B}"); - this.expansionSetCode = "WWK"; - this.subtype.add("Vampire"); - this.subtype.add("Rogue"); + public PulseTracker(UUID ownerId) { + super(ownerId, 62, "Pulse Tracker", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{B}"); + this.expansionSetCode = "WWK"; + this.subtype.add("Vampire"); + this.subtype.add("Rogue"); - this.color.setBlack(true); - this.power = new MageInt(1); - this.toughness = new MageInt(1); + this.color.setBlack(true); + this.power = new MageInt(1); + this.toughness = new MageInt(1); - this.addAbility(new AttacksTriggeredAbility(new PulseTrackerLoseLifeEffect(), false)); - } + this.addAbility(new AttacksTriggeredAbility(new PulseTrackerLoseLifeEffect(), false)); + } - public PulseTracker(final PulseTracker card) { - super(card); - } + public PulseTracker(final PulseTracker card) { + super(card); + } - @Override - public PulseTracker copy() { - return new PulseTracker(this); - } + @Override + public PulseTracker copy() { + return new PulseTracker(this); + } } class PulseTrackerLoseLifeEffect extends OneShotEffect { - private static final String effectText = "each opponent loses 1 life"; + private static final String effectText = "each opponent loses 1 life"; - PulseTrackerLoseLifeEffect ( ) { - super(Outcome.Damage); - staticText = effectText; - } + PulseTrackerLoseLifeEffect ( ) { + super(Outcome.Damage); + staticText = effectText; + } - PulseTrackerLoseLifeEffect ( PulseTrackerLoseLifeEffect effect ) { - super(effect); - } + PulseTrackerLoseLifeEffect ( PulseTrackerLoseLifeEffect effect ) { + super(effect); + } - @Override - public boolean apply(Game game, Ability source) { - Players players = game.getPlayers(); + @Override + public boolean apply(Game game, Ability source) { + Players players = game.getPlayers(); - for ( Player player : players.values() ) { - if ( !player.getId().equals(source.getControllerId()) ) { - player.loseLife(1, game); - } - } + for ( Player player : players.values() ) { + if ( !player.getId().equals(source.getControllerId()) ) { + player.loseLife(1, game); + } + } - return true; - } + return true; + } - @Override - public PulseTrackerLoseLifeEffect copy() { - return new PulseTrackerLoseLifeEffect(this); - } + @Override + public PulseTrackerLoseLifeEffect copy() { + return new PulseTrackerLoseLifeEffect(this); + } } diff --git a/Mage.Sets/src/mage/sets/worldwake/RagingRavine.java b/Mage.Sets/src/mage/sets/worldwake/RagingRavine.java index 178eda7873..aadb606481 100644 --- a/Mage.Sets/src/mage/sets/worldwake/RagingRavine.java +++ b/Mage.Sets/src/mage/sets/worldwake/RagingRavine.java @@ -52,36 +52,36 @@ import mage.game.permanent.token.Token; */ public class RagingRavine extends CardImpl { - public RagingRavine(UUID ownerId) { - super(ownerId, 141, "Raging Ravine", Rarity.RARE, new CardType[]{CardType.LAND}, null); - this.expansionSetCode = "WWK"; - this.addAbility(new EntersBattlefieldTappedAbility()); - this.addAbility(new GreenManaAbility()); - this.addAbility(new RedManaAbility()); - this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new BecomesCreatureSourceEffect(new RagingRavineToken(), "land", Duration.EndOfTurn), new ManaCostsImpl("{2}{R}{G}"))); - } + public RagingRavine(UUID ownerId) { + super(ownerId, 141, "Raging Ravine", Rarity.RARE, new CardType[]{CardType.LAND}, null); + this.expansionSetCode = "WWK"; + this.addAbility(new EntersBattlefieldTappedAbility()); + this.addAbility(new GreenManaAbility()); + this.addAbility(new RedManaAbility()); + this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new BecomesCreatureSourceEffect(new RagingRavineToken(), "land", Duration.EndOfTurn), new ManaCostsImpl("{2}{R}{G}"))); + } - public RagingRavine(final RagingRavine card) { - super(card); - } + public RagingRavine(final RagingRavine card) { + super(card); + } - @Override - public RagingRavine copy() { - return new RagingRavine(this); - } + @Override + public RagingRavine copy() { + return new RagingRavine(this); + } } class RagingRavineToken extends Token { - public RagingRavineToken() { - super("", "3/3 red and green Elemental creature with \"Whenever this creature attacks, put a +1/+1 counter on it.\""); - cardType.add(CardType.CREATURE); - subtype.add("Elemental"); - color.setRed(true); - color.setGreen(true); - power = new MageInt(3); - toughness = new MageInt(3); - addAbility(new AttacksTriggeredAbility(new AddCountersSourceEffect(CounterType.P1P1.createInstance()), false)); - } + public RagingRavineToken() { + super("", "3/3 red and green Elemental creature with \"Whenever this creature attacks, put a +1/+1 counter on it.\""); + cardType.add(CardType.CREATURE); + subtype.add("Elemental"); + color.setRed(true); + color.setGreen(true); + power = new MageInt(3); + toughness = new MageInt(3); + addAbility(new AttacksTriggeredAbility(new AddCountersSourceEffect(CounterType.P1P1.createInstance()), false)); + } } diff --git a/Mage.Sets/src/mage/sets/worldwake/SearingBlaze.java b/Mage.Sets/src/mage/sets/worldwake/SearingBlaze.java index e0d955dc90..c786970224 100644 --- a/Mage.Sets/src/mage/sets/worldwake/SearingBlaze.java +++ b/Mage.Sets/src/mage/sets/worldwake/SearingBlaze.java @@ -56,48 +56,48 @@ import mage.watchers.common.LandfallWatcher; */ public class SearingBlaze extends CardImpl { - public SearingBlaze(UUID ownerId) { - super(ownerId, 90, "Searing Blaze", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{R}{R}"); - this.expansionSetCode = "WWK"; - this.color.setRed(true); + public SearingBlaze(UUID ownerId) { + super(ownerId, 90, "Searing Blaze", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{R}{R}"); + this.expansionSetCode = "WWK"; + this.color.setRed(true); - // Searing Blaze deals 1 damage to target player and 1 damage to target creature that player controls. - // Landfall - If you had a land enter the battlefield under your control this turn, Searing Blaze deals 3 damage to that player and 3 damage to that creature instead. - this.getSpellAbility().addTarget(new TargetPlayer()); - this.getSpellAbility().addTarget(new SearingBlazeTarget()); - this.getSpellAbility().addEffect(new SearingBlazeEffect()); - this.addWatcher(new LandfallWatcher()); - } + // Searing Blaze deals 1 damage to target player and 1 damage to target creature that player controls. + // Landfall - If you had a land enter the battlefield under your control this turn, Searing Blaze deals 3 damage to that player and 3 damage to that creature instead. + this.getSpellAbility().addTarget(new TargetPlayer()); + this.getSpellAbility().addTarget(new SearingBlazeTarget()); + this.getSpellAbility().addEffect(new SearingBlazeEffect()); + this.addWatcher(new LandfallWatcher()); + } - public SearingBlaze(final SearingBlaze card) { - super(card); - } + public SearingBlaze(final SearingBlaze card) { + super(card); + } - @Override - public SearingBlaze copy() { - return new SearingBlaze(this); - } + @Override + public SearingBlaze copy() { + return new SearingBlaze(this); + } } class SearingBlazeEffect extends OneShotEffect { - public SearingBlazeEffect() { - super(Outcome.Damage); - staticText = "{this} deals 1 damage to target player and 1 damage to target creature that player controls. \nLandfall - If you had a land enter the battlefield under your control this turn, {this} deals 3 damage to that player and 3 damage to that creature instead"; - } + public SearingBlazeEffect() { + super(Outcome.Damage); + staticText = "{this} deals 1 damage to target player and 1 damage to target creature that player controls. \nLandfall - If you had a land enter the battlefield under your control this turn, {this} deals 3 damage to that player and 3 damage to that creature instead"; + } - public SearingBlazeEffect(final SearingBlazeEffect effect) { - super(effect); - } + public SearingBlazeEffect(final SearingBlazeEffect effect) { + super(effect); + } - @Override - public SearingBlazeEffect copy() { - return new SearingBlazeEffect(this); - } + @Override + public SearingBlazeEffect copy() { + return new SearingBlazeEffect(this); + } - @Override - public boolean apply(Game game, Ability source) { + @Override + public boolean apply(Game game, Ability source) { Watcher watcher = game.getState().getWatchers().get("LandPlayed", source.getControllerId()); Player player = game.getPlayer(source.getTargets().get(0).getFirstTarget()); Permanent creature = game.getPermanent(source.getTargets().get(1).getFirstTarget()); @@ -118,7 +118,7 @@ class SearingBlazeEffect extends OneShotEffect { } } return true; - } + } } diff --git a/Mage.Sets/src/mage/sets/worldwake/SejiriSteppe.java b/Mage.Sets/src/mage/sets/worldwake/SejiriSteppe.java index bade206c33..5c777b8558 100644 --- a/Mage.Sets/src/mage/sets/worldwake/SejiriSteppe.java +++ b/Mage.Sets/src/mage/sets/worldwake/SejiriSteppe.java @@ -46,24 +46,24 @@ import mage.target.common.TargetControlledCreaturePermanent; */ public class SejiriSteppe extends CardImpl { - public SejiriSteppe(UUID ownerId) { - super(ownerId, 142, "Sejiri Steppe", Rarity.COMMON, new CardType[]{CardType.LAND}, null); - this.expansionSetCode = "WWK"; - this.addAbility(new EntersBattlefieldTappedAbility()); - EntersBattlefieldTriggeredAbility ability = new EntersBattlefieldTriggeredAbility(new GainProtectionFromColorTargetEffect(Duration.EndOfTurn), false); - ability.addTarget(new TargetControlledCreaturePermanent()); - ability.addChoice(new ChoiceColor()); - this.addAbility(ability); - this.addAbility(new WhiteManaAbility()); - } + public SejiriSteppe(UUID ownerId) { + super(ownerId, 142, "Sejiri Steppe", Rarity.COMMON, new CardType[]{CardType.LAND}, null); + this.expansionSetCode = "WWK"; + this.addAbility(new EntersBattlefieldTappedAbility()); + EntersBattlefieldTriggeredAbility ability = new EntersBattlefieldTriggeredAbility(new GainProtectionFromColorTargetEffect(Duration.EndOfTurn), false); + ability.addTarget(new TargetControlledCreaturePermanent()); + ability.addChoice(new ChoiceColor()); + this.addAbility(ability); + this.addAbility(new WhiteManaAbility()); + } - public SejiriSteppe(final SejiriSteppe card) { - super(card); - } + public SejiriSteppe(final SejiriSteppe card) { + super(card); + } - @Override - public SejiriSteppe copy() { - return new SejiriSteppe(this); - } + @Override + public SejiriSteppe copy() { + return new SejiriSteppe(this); + } } diff --git a/Mage.Sets/src/mage/sets/worldwake/SnappingCreeper.java b/Mage.Sets/src/mage/sets/worldwake/SnappingCreeper.java index 8d1d3e3028..2f97c520f6 100644 --- a/Mage.Sets/src/mage/sets/worldwake/SnappingCreeper.java +++ b/Mage.Sets/src/mage/sets/worldwake/SnappingCreeper.java @@ -48,7 +48,7 @@ public class SnappingCreeper extends CardImpl { super(ownerId, 112, "Snapping Creeper", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{2}{G}"); this.expansionSetCode = "WWK"; this.subtype.add("Plant"); - this.color.setGreen(true); + this.color.setGreen(true); this.power = new MageInt(2); this.toughness = new MageInt(3); this.addAbility(new LandfallAbility(new GainAbilitySourceEffect(VigilanceAbility.getInstance(), Duration.EndOfTurn), false)); diff --git a/Mage.Sets/src/mage/sets/worldwake/StirringWildwood.java b/Mage.Sets/src/mage/sets/worldwake/StirringWildwood.java index 527b4fe88f..9b92a27434 100644 --- a/Mage.Sets/src/mage/sets/worldwake/StirringWildwood.java +++ b/Mage.Sets/src/mage/sets/worldwake/StirringWildwood.java @@ -50,37 +50,37 @@ import mage.game.permanent.token.Token; */ public class StirringWildwood extends CardImpl { - public StirringWildwood(UUID ownerId) { - super(ownerId, 144, "Stirring Wildwood", Rarity.RARE, new CardType[]{CardType.LAND}, null); - this.expansionSetCode = "WWK"; - this.addAbility(new EntersBattlefieldTappedAbility()); - this.addAbility(new GreenManaAbility()); - this.addAbility(new WhiteManaAbility()); - this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new BecomesCreatureSourceEffect(new StirringWildwoodToken(), "land", Duration.EndOfTurn), new ManaCostsImpl("{1}{G}{W}"))); - } + public StirringWildwood(UUID ownerId) { + super(ownerId, 144, "Stirring Wildwood", Rarity.RARE, new CardType[]{CardType.LAND}, null); + this.expansionSetCode = "WWK"; + this.addAbility(new EntersBattlefieldTappedAbility()); + this.addAbility(new GreenManaAbility()); + this.addAbility(new WhiteManaAbility()); + this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new BecomesCreatureSourceEffect(new StirringWildwoodToken(), "land", Duration.EndOfTurn), new ManaCostsImpl("{1}{G}{W}"))); + } - public StirringWildwood(final StirringWildwood card) { - super(card); - } + public StirringWildwood(final StirringWildwood card) { + super(card); + } - @Override - public StirringWildwood copy() { - return new StirringWildwood(this); - } + @Override + public StirringWildwood copy() { + return new StirringWildwood(this); + } } class StirringWildwoodToken extends Token { - public StirringWildwoodToken() { - super("", "3/4 green and white Elemental creature with reach"); - cardType.add(CardType.CREATURE); - subtype.add("Elemental"); - color.setGreen(true); - color.setWhite(true); - power = new MageInt(3); - toughness = new MageInt(4); - addAbility(ReachAbility.getInstance()); - } + public StirringWildwoodToken() { + super("", "3/4 green and white Elemental creature with reach"); + cardType.add(CardType.CREATURE); + subtype.add("Elemental"); + color.setGreen(true); + color.setWhite(true); + power = new MageInt(3); + toughness = new MageInt(4); + addAbility(ReachAbility.getInstance()); + } } diff --git a/Mage.Sets/src/mage/sets/worldwake/StoneforgeMystic.java b/Mage.Sets/src/mage/sets/worldwake/StoneforgeMystic.java index f6d5c0b78f..0e198b89eb 100644 --- a/Mage.Sets/src/mage/sets/worldwake/StoneforgeMystic.java +++ b/Mage.Sets/src/mage/sets/worldwake/StoneforgeMystic.java @@ -51,40 +51,40 @@ import java.util.UUID; */ public class StoneforgeMystic extends CardImpl { - private static final FilterCard filter = new FilterCard("an Equipment card"); + private static final FilterCard filter = new FilterCard("an Equipment card"); - static { - filter.getCardType().add(CardType.ARTIFACT); - filter.getSubtype().add("Equipment"); - } + static { + filter.getCardType().add(CardType.ARTIFACT); + filter.getSubtype().add("Equipment"); + } - public StoneforgeMystic(UUID ownerId) { - super(ownerId, 20, "Stoneforge Mystic", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{1}{W}"); - this.expansionSetCode = "WWK"; - this.color.setWhite(true); - this.subtype.add("Kor"); - this.subtype.add("Artificer"); - this.power = new MageInt(1); - this.toughness = new MageInt(2); + public StoneforgeMystic(UUID ownerId) { + super(ownerId, 20, "Stoneforge Mystic", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{1}{W}"); + this.expansionSetCode = "WWK"; + this.color.setWhite(true); + this.subtype.add("Kor"); + this.subtype.add("Artificer"); + this.power = new MageInt(1); + this.toughness = new MageInt(2); - // When Stoneforge Mystic enters the battlefield, you may search your library for an Equipment card, reveal it, put it into your hand, then shuffle your library. + // When Stoneforge Mystic enters the battlefield, you may search your library for an Equipment card, reveal it, put it into your hand, then shuffle your library. TargetCardInLibrary target = new TargetCardInLibrary(1, 1, filter); - this.addAbility(new EntersBattlefieldTriggeredAbility(new SearchLibraryRevealPutInHandEffect(target), true)); + this.addAbility(new EntersBattlefieldTriggeredAbility(new SearchLibraryRevealPutInHandEffect(target), true)); // {1}{W}, {T}: You may put an Equipment card from your hand onto the battlefield. - SimpleActivatedAbility ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new PlayTargetWithoutPayingManaEffect(), new ManaCostsImpl("{1}{W}")); - ability.addCost(new TapSourceCost()); - ability.addTarget(new TargetCardInHand(0, 1, filter)); - this.addAbility(ability); - } + SimpleActivatedAbility ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new PlayTargetWithoutPayingManaEffect(), new ManaCostsImpl("{1}{W}")); + ability.addCost(new TapSourceCost()); + ability.addTarget(new TargetCardInHand(0, 1, filter)); + this.addAbility(ability); + } - public StoneforgeMystic(final StoneforgeMystic card) { - super(card); - } + public StoneforgeMystic(final StoneforgeMystic card) { + super(card); + } - @Override - public StoneforgeMystic copy() { - return new StoneforgeMystic(this); - } + @Override + public StoneforgeMystic copy() { + return new StoneforgeMystic(this); + } } diff --git a/Mage.Sets/src/mage/sets/worldwake/StrengthOfTheTajuru.java b/Mage.Sets/src/mage/sets/worldwake/StrengthOfTheTajuru.java index cf8369b0d5..812d3d5f8c 100644 --- a/Mage.Sets/src/mage/sets/worldwake/StrengthOfTheTajuru.java +++ b/Mage.Sets/src/mage/sets/worldwake/StrengthOfTheTajuru.java @@ -58,7 +58,7 @@ public class StrengthOfTheTajuru extends CardImpl { //MultikickerAbility ability = new MultikickerAbility(new EmptyEffect(""), false); //ability.addManaCost(new GenericManaCost(1)); //this.addAbility(ability); - + this.addAbility(new SimpleStaticAbility(Constants.Zone.ALL, new EmptyEffect("Multikicker {1}"))); // Choose target creature, then choose another target creature for each time Strength of the Tajuru was kicked. Put X +1/+1 counters on each of them. diff --git a/Mage.Sets/src/mage/sets/worldwake/TectonicEdge.java b/Mage.Sets/src/mage/sets/worldwake/TectonicEdge.java index 860d78b8a6..3d32287c47 100644 --- a/Mage.Sets/src/mage/sets/worldwake/TectonicEdge.java +++ b/Mage.Sets/src/mage/sets/worldwake/TectonicEdge.java @@ -54,62 +54,62 @@ import java.util.UUID; */ public class TectonicEdge extends CardImpl { - public TectonicEdge(UUID ownerId) { - super(ownerId, 145, "Tectonic Edge", Rarity.UNCOMMON, new CardType[]{CardType.LAND}, null); - this.expansionSetCode = "WWK"; - this.addAbility(new ColorlessManaAbility()); - Costs costs = new CostsImpl(); - costs.add(new TapSourceCost()); - costs.add(new SacrificeSourceCost()); - costs.add(new TectonicEdgeCost()); - Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DestroyTargetEffect(), costs); - ability.addTarget(new TargetNonBasicLandPermanent()); - ability.addManaCost(new GenericManaCost(1)); - this.addAbility(ability); - } + public TectonicEdge(UUID ownerId) { + super(ownerId, 145, "Tectonic Edge", Rarity.UNCOMMON, new CardType[]{CardType.LAND}, null); + this.expansionSetCode = "WWK"; + this.addAbility(new ColorlessManaAbility()); + Costs costs = new CostsImpl(); + costs.add(new TapSourceCost()); + costs.add(new SacrificeSourceCost()); + costs.add(new TectonicEdgeCost()); + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DestroyTargetEffect(), costs); + ability.addTarget(new TargetNonBasicLandPermanent()); + ability.addManaCost(new GenericManaCost(1)); + this.addAbility(ability); + } - public TectonicEdge(final TectonicEdge card) { - super(card); - } + public TectonicEdge(final TectonicEdge card) { + super(card); + } - @Override - public TectonicEdge copy() { - return new TectonicEdge(this); - } + @Override + public TectonicEdge copy() { + return new TectonicEdge(this); + } } class TectonicEdgeCost extends CostImpl { - FilterLandPermanent filter = new FilterLandPermanent(); + FilterLandPermanent filter = new FilterLandPermanent(); - public TectonicEdgeCost() { - this.text = "Activate this ability only if an opponent controls four or more lands"; - } + public TectonicEdgeCost() { + this.text = "Activate this ability only if an opponent controls four or more lands"; + } - public TectonicEdgeCost(final TectonicEdgeCost cost) { - super(cost); - } + public TectonicEdgeCost(final TectonicEdgeCost cost) { + super(cost); + } - @Override - public TectonicEdgeCost copy() { - return new TectonicEdgeCost(this); - } + @Override + public TectonicEdgeCost copy() { + return new TectonicEdgeCost(this); + } - @Override - public boolean canPay(UUID sourceId, UUID controllerId, Game game) { - for (UUID opponentId: game.getOpponents(controllerId)) { - if (game.getBattlefield().countAll(filter, opponentId, game) > 3) { - return true; - } - } - return false; - } + @Override + public boolean canPay(UUID sourceId, UUID controllerId, Game game) { + for (UUID opponentId: game.getOpponents(controllerId)) { + if (game.getBattlefield().countAll(filter, opponentId, game) > 3) { + return true; + } + } + return false; + } - @Override - public boolean pay(Ability ability, Game game, UUID sourceId, UUID controllerId, boolean noMana) { - this.paid = true; - return paid; - } + @Override + public boolean pay(Ability ability, Game game, UUID sourceId, UUID controllerId, boolean noMana) { + this.paid = true; + return paid; + } } diff --git a/Mage.Sets/src/mage/sets/worldwake/TideforceElemental.java b/Mage.Sets/src/mage/sets/worldwake/TideforceElemental.java index 30b036534c..872d38c347 100644 --- a/Mage.Sets/src/mage/sets/worldwake/TideforceElemental.java +++ b/Mage.Sets/src/mage/sets/worldwake/TideforceElemental.java @@ -49,7 +49,7 @@ import mage.target.common.TargetCreaturePermanent; * @author Loki */ public class TideforceElemental extends CardImpl { - + // private final static String text = "You may tap or untap another target creature"; private final static FilterCreaturePermanent filter = new FilterCreaturePermanent("another creature"); diff --git a/Mage.Sets/src/mage/sets/worldwake/Twitch.java b/Mage.Sets/src/mage/sets/worldwake/Twitch.java index 0201cffe53..9f81dc8e6f 100644 --- a/Mage.Sets/src/mage/sets/worldwake/Twitch.java +++ b/Mage.Sets/src/mage/sets/worldwake/Twitch.java @@ -42,7 +42,7 @@ import mage.target.TargetPermanent; * @author jeffwadsworth */ public class Twitch extends CardImpl { - + private final static FilterPermanent filter = new FilterPermanent("artifact, creature, or land"); static { diff --git a/Mage.Sets/src/mage/sets/worldwake/VeteransReflexes.java b/Mage.Sets/src/mage/sets/worldwake/VeteransReflexes.java index 75ed453a3e..75517baff6 100644 --- a/Mage.Sets/src/mage/sets/worldwake/VeteransReflexes.java +++ b/Mage.Sets/src/mage/sets/worldwake/VeteransReflexes.java @@ -46,7 +46,7 @@ public class VeteransReflexes extends CardImpl { public VeteransReflexes (UUID ownerId) { super(ownerId, 23, "Veteran's Reflexes", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{W}"); this.expansionSetCode = "WWK"; - this.color.setWhite(true); + this.color.setWhite(true); this.getSpellAbility().addEffect(new BoostTargetEffect(1, 1, Duration.EndOfTurn)); this.getSpellAbility().addEffect(new UntapTargetEffect()); this.getSpellAbility().addTarget(new TargetCreaturePermanent()); diff --git a/Mage.Sets/src/mage/sets/worldwake/WolfbriarElemental.java b/Mage.Sets/src/mage/sets/worldwake/WolfbriarElemental.java index 925ca24291..40b72455f9 100644 --- a/Mage.Sets/src/mage/sets/worldwake/WolfbriarElemental.java +++ b/Mage.Sets/src/mage/sets/worldwake/WolfbriarElemental.java @@ -45,26 +45,26 @@ import mage.game.permanent.token.WolfToken; */ public class WolfbriarElemental extends CardImpl { - public WolfbriarElemental(UUID ownerId) { - super(ownerId, 118, "Wolfbriar Elemental", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{2}{G}{G}"); - this.expansionSetCode = "WWK"; - this.subtype.add("Elemental"); - this.color.setGreen(true); - this.power = new MageInt(4); - this.toughness = new MageInt(4); + public WolfbriarElemental(UUID ownerId) { + super(ownerId, 118, "Wolfbriar Elemental", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{2}{G}{G}"); + this.expansionSetCode = "WWK"; + this.subtype.add("Elemental"); + this.color.setGreen(true); + this.power = new MageInt(4); + this.toughness = new MageInt(4); - MultikickerAbility ability = new MultikickerAbility(new CreateTokenEffect(new WolfToken()), false); - ability.addManaCost(new ColoredManaCost(ColoredManaSymbol.G)); - this.addAbility(ability); - } + MultikickerAbility ability = new MultikickerAbility(new CreateTokenEffect(new WolfToken()), false); + ability.addManaCost(new ColoredManaCost(ColoredManaSymbol.G)); + this.addAbility(ability); + } - public WolfbriarElemental(final WolfbriarElemental card) { - super(card); - } + public WolfbriarElemental(final WolfbriarElemental card) { + super(card); + } - @Override - public WolfbriarElemental copy() { - return new WolfbriarElemental(this); - } + @Override + public WolfbriarElemental copy() { + return new WolfbriarElemental(this); + } } diff --git a/Mage.Sets/src/mage/sets/zendikar/AdventuringGear.java b/Mage.Sets/src/mage/sets/zendikar/AdventuringGear.java index 8e0bd530e6..3fa733bd6f 100644 --- a/Mage.Sets/src/mage/sets/zendikar/AdventuringGear.java +++ b/Mage.Sets/src/mage/sets/zendikar/AdventuringGear.java @@ -49,56 +49,56 @@ import mage.target.common.TargetCreaturePermanent; */ public class AdventuringGear extends CardImpl { - public AdventuringGear(UUID ownerId) { - super(ownerId, 195, "Adventuring Gear", Rarity.COMMON, new CardType[]{CardType.ARTIFACT}, "{1}"); - this.expansionSetCode = "ZEN"; - this.subtype.add("Equipment"); - this.addAbility(new EquipAbility(Outcome.BoostCreature, new GenericManaCost(1))); - this.addAbility(new AdventuringGearAbility()); - } + public AdventuringGear(UUID ownerId) { + super(ownerId, 195, "Adventuring Gear", Rarity.COMMON, new CardType[]{CardType.ARTIFACT}, "{1}"); + this.expansionSetCode = "ZEN"; + this.subtype.add("Equipment"); + this.addAbility(new EquipAbility(Outcome.BoostCreature, new GenericManaCost(1))); + this.addAbility(new AdventuringGearAbility()); + } - public AdventuringGear(final AdventuringGear card) { - super(card); - } + public AdventuringGear(final AdventuringGear card) { + super(card); + } - @Override - public AdventuringGear copy() { - return new AdventuringGear(this); - } + @Override + public AdventuringGear copy() { + return new AdventuringGear(this); + } } class AdventuringGearAbility extends LandfallAbility { - public AdventuringGearAbility() { - super(null, false); - this.addEffect(new BoostTargetEffect(2, 2, Duration.EndOfTurn)); - this.addTarget(new TargetCreaturePermanent()); - } + public AdventuringGearAbility() { + super(null, false); + this.addEffect(new BoostTargetEffect(2, 2, Duration.EndOfTurn)); + this.addTarget(new TargetCreaturePermanent()); + } - public AdventuringGearAbility(final AdventuringGearAbility ability) { - super(ability); - } + public AdventuringGearAbility(final AdventuringGearAbility ability) { + super(ability); + } - @Override - public boolean checkTrigger(GameEvent event, Game game) { - if (super.checkTrigger(event, game)) { - Permanent equipment = game.getPermanent(this.sourceId); - if (equipment != null && equipment.getAttachedTo() != null) { - Permanent creature = game.getPermanent(equipment.getAttachedTo()); - if (creature != null) { - this.getTargets().get(0).clearChosen(); - this.getTargets().get(0).add(creature.getId(), game); - return true; - } - } - } - return false; - } + @Override + public boolean checkTrigger(GameEvent event, Game game) { + if (super.checkTrigger(event, game)) { + Permanent equipment = game.getPermanent(this.sourceId); + if (equipment != null && equipment.getAttachedTo() != null) { + Permanent creature = game.getPermanent(equipment.getAttachedTo()); + if (creature != null) { + this.getTargets().get(0).clearChosen(); + this.getTargets().get(0).add(creature.getId(), game); + return true; + } + } + } + return false; + } - @Override - public AdventuringGearAbility copy() { - return new AdventuringGearAbility(this); - } + @Override + public AdventuringGearAbility copy() { + return new AdventuringGearAbility(this); + } } \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/zendikar/AridMesa.java b/Mage.Sets/src/mage/sets/zendikar/AridMesa.java index 964f90c3f0..95186e90b5 100644 --- a/Mage.Sets/src/mage/sets/zendikar/AridMesa.java +++ b/Mage.Sets/src/mage/sets/zendikar/AridMesa.java @@ -40,19 +40,19 @@ import mage.cards.CardImpl; */ public class AridMesa extends CardImpl { - public AridMesa(UUID ownerId) { - super(ownerId, 211, "Arid Mesa", Rarity.RARE, new CardType[]{CardType.LAND}, null); - this.expansionSetCode = "ZEN"; - this.addAbility(new FetchLandActivatedAbility(new String[] {"Mountain", "Plains"})); - } + public AridMesa(UUID ownerId) { + super(ownerId, 211, "Arid Mesa", Rarity.RARE, new CardType[]{CardType.LAND}, null); + this.expansionSetCode = "ZEN"; + this.addAbility(new FetchLandActivatedAbility(new String[] {"Mountain", "Plains"})); + } - public AridMesa(final AridMesa card) { - super(card); - } + public AridMesa(final AridMesa card) { + super(card); + } - @Override - public AridMesa copy() { - return new AridMesa(this); - } + @Override + public AridMesa copy() { + return new AridMesa(this); + } } diff --git a/Mage.Sets/src/mage/sets/zendikar/BeastmasterAscension.java b/Mage.Sets/src/mage/sets/zendikar/BeastmasterAscension.java index fc89c71247..0c23da30f7 100644 --- a/Mage.Sets/src/mage/sets/zendikar/BeastmasterAscension.java +++ b/Mage.Sets/src/mage/sets/zendikar/BeastmasterAscension.java @@ -50,49 +50,49 @@ import java.util.UUID; */ public class BeastmasterAscension extends CardImpl { - public BeastmasterAscension(UUID ownerId) { - super(ownerId, 159, "Beastmaster Ascension", Rarity.RARE, new CardType[]{CardType.ENCHANTMENT}, "{2}{G}"); - this.expansionSetCode = "ZEN"; - this.color.setGreen(true); + public BeastmasterAscension(UUID ownerId) { + super(ownerId, 159, "Beastmaster Ascension", Rarity.RARE, new CardType[]{CardType.ENCHANTMENT}, "{2}{G}"); + this.expansionSetCode = "ZEN"; + this.color.setGreen(true); - this.addAbility(new AttacksCreatureYourControlTriggeredAbility(new AddCountersSourceEffect(CounterType.QUEST.createInstance()), true)); - this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BeastmasterAscensionEffect())); - } + this.addAbility(new AttacksCreatureYourControlTriggeredAbility(new AddCountersSourceEffect(CounterType.QUEST.createInstance()), true)); + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BeastmasterAscensionEffect())); + } - public BeastmasterAscension(final BeastmasterAscension card) { - super(card); - } + public BeastmasterAscension(final BeastmasterAscension card) { + super(card); + } - @Override - public BeastmasterAscension copy() { - return new BeastmasterAscension(this); - } + @Override + public BeastmasterAscension copy() { + return new BeastmasterAscension(this); + } } class BeastmasterAscensionEffect extends BoostControlledEffect { - public BeastmasterAscensionEffect() { - super(5, 5, Duration.WhileOnBattlefield); - staticText = "As long as {this} has seven or more quest counters on it, creatures you control get +5/+5"; - } + public BeastmasterAscensionEffect() { + super(5, 5, Duration.WhileOnBattlefield); + staticText = "As long as {this} has seven or more quest counters on it, creatures you control get +5/+5"; + } - public BeastmasterAscensionEffect(final BeastmasterAscensionEffect effect) { - super(effect); - } + public BeastmasterAscensionEffect(final BeastmasterAscensionEffect effect) { + super(effect); + } - @Override - public boolean apply(Game game, Ability source) { - Permanent permanent = game.getPermanent(source.getSourceId()); - if (permanent != null && permanent.getCounters().getCount(CounterType.QUEST) > 6) { - super.apply(game, source); - } - return false; - } + @Override + public boolean apply(Game game, Ability source) { + Permanent permanent = game.getPermanent(source.getSourceId()); + if (permanent != null && permanent.getCounters().getCount(CounterType.QUEST) > 6) { + super.apply(game, source); + } + return false; + } - @Override - public BeastmasterAscensionEffect copy() { - return new BeastmasterAscensionEffect(this); - } + @Override + public BeastmasterAscensionEffect copy() { + return new BeastmasterAscensionEffect(this); + } } \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/zendikar/BladeOfTheBloodchief.java b/Mage.Sets/src/mage/sets/zendikar/BladeOfTheBloodchief.java index 9ac377de50..0d418df4d3 100644 --- a/Mage.Sets/src/mage/sets/zendikar/BladeOfTheBloodchief.java +++ b/Mage.Sets/src/mage/sets/zendikar/BladeOfTheBloodchief.java @@ -51,17 +51,17 @@ import mage.game.permanent.Permanent; * @author mamaurer, nantuko */ public class BladeOfTheBloodchief extends CardImpl { - - public BladeOfTheBloodchief ( UUID ownerId ) { - super(ownerId, 196, "Blade of the Bloodchief", Rarity.RARE, new CardType[]{CardType.ARTIFACT}, "{1}"); + + public BladeOfTheBloodchief ( UUID ownerId ) { + super(ownerId, 196, "Blade of the Bloodchief", Rarity.RARE, new CardType[]{CardType.ARTIFACT}, "{1}"); this.expansionSetCode = "ZEN"; - this.getSubtype().add("Equipment"); - - this.addAbility(new EquipAbility(Constants.Outcome.AddAbility, new GenericManaCost(1))); - this.addAbility(new BladeOfTheBloodChiefTriggeredAbility()); - } - - public BladeOfTheBloodchief(final BladeOfTheBloodchief card) { + this.getSubtype().add("Equipment"); + + this.addAbility(new EquipAbility(Constants.Outcome.AddAbility, new GenericManaCost(1))); + this.addAbility(new BladeOfTheBloodChiefTriggeredAbility()); + } + + public BladeOfTheBloodchief(final BladeOfTheBloodchief card) { super(card); } @@ -72,75 +72,75 @@ public class BladeOfTheBloodchief extends CardImpl { } class BladeOfTheBloodChiefTriggeredAbility extends TriggeredAbilityImpl { - - private static final String text = "Whenever a creature dies, put a +1/+1 counter on equipped " - + "creature. If equipped creature is a Vampire, put two +1/+1 counters on it instead."; - - BladeOfTheBloodChiefTriggeredAbility ( ) { - super(Zone.BATTLEFIELD, new BladeOfTheBloodchiefEffect()); - } - - BladeOfTheBloodChiefTriggeredAbility ( final BladeOfTheBloodChiefTriggeredAbility ability ) { - super(ability); - } - - @Override - public boolean checkTrigger(GameEvent event, Game game) { - if ( event.getType() == EventType.ZONE_CHANGE ) { - ZoneChangeEvent zEvent = (ZoneChangeEvent)event; - if ( zEvent.getFromZone() == Zone.BATTLEFIELD && zEvent.getToZone() == Zone.GRAVEYARD ) { - Permanent p = (Permanent) game.getLastKnownInformation(event.getTargetId(), Constants.Zone.BATTLEFIELD); + + private static final String text = "Whenever a creature dies, put a +1/+1 counter on equipped " + + "creature. If equipped creature is a Vampire, put two +1/+1 counters on it instead."; + + BladeOfTheBloodChiefTriggeredAbility ( ) { + super(Zone.BATTLEFIELD, new BladeOfTheBloodchiefEffect()); + } + + BladeOfTheBloodChiefTriggeredAbility ( final BladeOfTheBloodChiefTriggeredAbility ability ) { + super(ability); + } + + @Override + public boolean checkTrigger(GameEvent event, Game game) { + if ( event.getType() == EventType.ZONE_CHANGE ) { + ZoneChangeEvent zEvent = (ZoneChangeEvent)event; + if ( zEvent.getFromZone() == Zone.BATTLEFIELD && zEvent.getToZone() == Zone.GRAVEYARD ) { + Permanent p = (Permanent) game.getLastKnownInformation(event.getTargetId(), Constants.Zone.BATTLEFIELD); if (p != null && p.getCardType().contains(CardType.CREATURE)) { - Permanent enchantment = game.getPermanent(getSourceId()); - if (enchantment != null && enchantment.getAttachedTo() != null) { - return true; - } - } - } - } - return false; - } + Permanent enchantment = game.getPermanent(getSourceId()); + if (enchantment != null && enchantment.getAttachedTo() != null) { + return true; + } + } + } + } + return false; + } - @Override - public BladeOfTheBloodChiefTriggeredAbility copy() { - return new BladeOfTheBloodChiefTriggeredAbility(this); - } + @Override + public BladeOfTheBloodChiefTriggeredAbility copy() { + return new BladeOfTheBloodChiefTriggeredAbility(this); + } - @Override - public String getRule() { - return text; - } + @Override + public String getRule() { + return text; + } } class BladeOfTheBloodchiefEffect extends OneShotEffect { - BladeOfTheBloodchiefEffect ( ) { - super(Outcome.BoostCreature); - } - - BladeOfTheBloodchiefEffect ( final BladeOfTheBloodchiefEffect ability ) { - super(ability); - } - - @Override - public boolean apply(Game game, Ability source) { - Permanent enchantment = game.getPermanent(source.getSourceId()); - if (enchantment != null && enchantment.getAttachedTo() != null) { - Permanent creature = game.getPermanent(enchantment.getAttachedTo()); - if (creature != null) { - if ( creature.hasSubtype("Vampire") ) { - creature.addCounters(new PlusOneCounter(2), game); - } - else { - creature.addCounters(new PlusOneCounter(1), game); - } - } - } - return true; - } - - @Override - public BladeOfTheBloodchiefEffect copy() { - return new BladeOfTheBloodchiefEffect(this); - } + BladeOfTheBloodchiefEffect ( ) { + super(Outcome.BoostCreature); + } + + BladeOfTheBloodchiefEffect ( final BladeOfTheBloodchiefEffect ability ) { + super(ability); + } + + @Override + public boolean apply(Game game, Ability source) { + Permanent enchantment = game.getPermanent(source.getSourceId()); + if (enchantment != null && enchantment.getAttachedTo() != null) { + Permanent creature = game.getPermanent(enchantment.getAttachedTo()); + if (creature != null) { + if ( creature.hasSubtype("Vampire") ) { + creature.addCounters(new PlusOneCounter(2), game); + } + else { + creature.addCounters(new PlusOneCounter(1), game); + } + } + } + return true; + } + + @Override + public BladeOfTheBloodchiefEffect copy() { + return new BladeOfTheBloodchiefEffect(this); + } } diff --git a/Mage.Sets/src/mage/sets/zendikar/BladetuskBoar.java b/Mage.Sets/src/mage/sets/zendikar/BladetuskBoar.java index e71c41036b..eb9aa8b109 100644 --- a/Mage.Sets/src/mage/sets/zendikar/BladetuskBoar.java +++ b/Mage.Sets/src/mage/sets/zendikar/BladetuskBoar.java @@ -45,7 +45,7 @@ public class BladetuskBoar extends CardImpl { super(ownerId, 118, "Bladetusk Boar", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{3}{R}"); this.expansionSetCode = "ZEN"; this.subtype.add("Boar"); - this.color.setRed(true); + this.color.setRed(true); this.power = new MageInt(3); this.toughness = new MageInt(2); this.addAbility(IntimidateAbility.getInstance()); diff --git a/Mage.Sets/src/mage/sets/zendikar/Bloodghast.java b/Mage.Sets/src/mage/sets/zendikar/Bloodghast.java index 1c1c4aef64..cabbcb2ceb 100644 --- a/Mage.Sets/src/mage/sets/zendikar/Bloodghast.java +++ b/Mage.Sets/src/mage/sets/zendikar/Bloodghast.java @@ -50,30 +50,30 @@ import mage.cards.CardImpl; */ public class Bloodghast extends CardImpl { - public Bloodghast(UUID ownerId) { - super(ownerId, 83, "Bloodghast", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{B}{B}"); - this.expansionSetCode = "ZEN"; - this.subtype.add("Vampire"); - this.subtype.add("Spirit"); + public Bloodghast(UUID ownerId) { + super(ownerId, 83, "Bloodghast", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{B}{B}"); + this.expansionSetCode = "ZEN"; + this.subtype.add("Vampire"); + this.subtype.add("Spirit"); - this.color.setBlack(true); - this.power = new MageInt(2); - this.toughness = new MageInt(1); + this.color.setBlack(true); + this.power = new MageInt(2); + this.toughness = new MageInt(1); - this.addAbility(CantBlockAbility.getInstance()); - this.addAbility(new LandfallAbility(Zone.GRAVEYARD, new ReturnSourceFromGraveyardToBattlefieldEffect(), true)); - ContinuousEffect effect = new GainAbilitySourceEffect(HasteAbility.getInstance(), Duration.WhileOnBattlefield); + this.addAbility(CantBlockAbility.getInstance()); + this.addAbility(new LandfallAbility(Zone.GRAVEYARD, new ReturnSourceFromGraveyardToBattlefieldEffect(), true)); + ContinuousEffect effect = new GainAbilitySourceEffect(HasteAbility.getInstance(), Duration.WhileOnBattlefield); this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new ConditionalContinousEffect(effect, new TenOrLessLifeCondition(TenOrLessLifeCondition.CheckType.AN_OPPONENT), "Bloodghast has haste as long as an opponent has 10 or less life."))); - } + } - public Bloodghast(final Bloodghast card) { - super(card); - } + public Bloodghast(final Bloodghast card) { + super(card); + } - @Override - public Bloodghast copy() { - return new Bloodghast(this); - } + @Override + public Bloodghast copy() { + return new Bloodghast(this); + } } \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/zendikar/BogTatters.java b/Mage.Sets/src/mage/sets/zendikar/BogTatters.java index f7809c472e..f78514f3df 100644 --- a/Mage.Sets/src/mage/sets/zendikar/BogTatters.java +++ b/Mage.Sets/src/mage/sets/zendikar/BogTatters.java @@ -45,7 +45,7 @@ public class BogTatters extends CardImpl { super(ownerId, 84, "Bog Tatters", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{4}{B}"); this.expansionSetCode = "ZEN"; this.subtype.add("Wraith"); - this.color.setBlack(true); + this.color.setBlack(true); this.power = new MageInt(4); this.toughness = new MageInt(2); this.addAbility(new SwampwalkAbility()); diff --git a/Mage.Sets/src/mage/sets/zendikar/BraveTheElements.java b/Mage.Sets/src/mage/sets/zendikar/BraveTheElements.java index 4aef29356f..9ebbd3bb7c 100644 --- a/Mage.Sets/src/mage/sets/zendikar/BraveTheElements.java +++ b/Mage.Sets/src/mage/sets/zendikar/BraveTheElements.java @@ -48,62 +48,62 @@ import mage.game.Game; */ public class BraveTheElements extends CardImpl { - public BraveTheElements(UUID ownerId) { - super(ownerId, 4, "Brave the Elements", Rarity.UNCOMMON, new CardType[]{CardType.INSTANT}, "{W}"); - this.expansionSetCode = "ZEN"; - this.color.setWhite(true); - this.getSpellAbility().addChoice(new ChoiceColor()); - this.getSpellAbility().addEffect(new BraveTheElementsEffect()); - } + public BraveTheElements(UUID ownerId) { + super(ownerId, 4, "Brave the Elements", Rarity.UNCOMMON, new CardType[]{CardType.INSTANT}, "{W}"); + this.expansionSetCode = "ZEN"; + this.color.setWhite(true); + this.getSpellAbility().addChoice(new ChoiceColor()); + this.getSpellAbility().addEffect(new BraveTheElementsEffect()); + } - public BraveTheElements(final BraveTheElements card) { - super(card); - } + public BraveTheElements(final BraveTheElements card) { + super(card); + } - @Override - public BraveTheElements copy() { - return new BraveTheElements(this); - } + @Override + public BraveTheElements copy() { + return new BraveTheElements(this); + } } class BraveTheElementsEffect extends GainAbilityControlledEffect { - private static final FilterCreaturePermanent filter1 = new FilterCreaturePermanent(); + private static final FilterCreaturePermanent filter1 = new FilterCreaturePermanent(); - static { - filter1.setUseColor(true); - filter1.getColor().setWhite(true); - filter1.setScopeColor(ComparisonScope.Any); - } + static { + filter1.setUseColor(true); + filter1.getColor().setWhite(true); + filter1.setScopeColor(ComparisonScope.Any); + } - FilterCard filter2; + FilterCard filter2; - public BraveTheElementsEffect() { - super(new ProtectionAbility(new FilterCard()), Duration.EndOfTurn, filter1); - filter2 = (FilterCard)((ProtectionAbility)ability).getFilter(); - filter2.setUseColor(true); - filter2.setScopeColor(ComparisonScope.Any); - staticText = "Choose a color. White creatures you control gain protection from the chosen color until end of turn"; - } + public BraveTheElementsEffect() { + super(new ProtectionAbility(new FilterCard()), Duration.EndOfTurn, filter1); + filter2 = (FilterCard)((ProtectionAbility)ability).getFilter(); + filter2.setUseColor(true); + filter2.setScopeColor(ComparisonScope.Any); + staticText = "Choose a color. White creatures you control gain protection from the chosen color until end of turn"; + } - public BraveTheElementsEffect(final BraveTheElementsEffect effect) { - super(effect); - this.filter2 = effect.filter2.copy(); - } + public BraveTheElementsEffect(final BraveTheElementsEffect effect) { + super(effect); + this.filter2 = effect.filter2.copy(); + } - @Override - public BraveTheElementsEffect copy() { - return new BraveTheElementsEffect(this); - } + @Override + public BraveTheElementsEffect copy() { + return new BraveTheElementsEffect(this); + } - @Override - public boolean apply(Game game, Ability source) { - ChoiceColor choice = (ChoiceColor) source.getChoices().get(0); - filter2.setColor(choice.getColor()); - filter2.setMessage(choice.getChoice()); - ability = new ProtectionAbility(new FilterCard(filter2)); - return super.apply(game, source); - } + @Override + public boolean apply(Game game, Ability source) { + ChoiceColor choice = (ChoiceColor) source.getChoices().get(0); + filter2.setColor(choice.getColor()); + filter2.setMessage(choice.getChoice()); + ability = new ProtectionAbility(new FilterCard(filter2)); + return super.apply(game, source); + } } \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/zendikar/BurstLightning.java b/Mage.Sets/src/mage/sets/zendikar/BurstLightning.java index e09458cb96..441deb907b 100644 --- a/Mage.Sets/src/mage/sets/zendikar/BurstLightning.java +++ b/Mage.Sets/src/mage/sets/zendikar/BurstLightning.java @@ -44,23 +44,23 @@ import mage.target.common.TargetCreatureOrPlayer; */ public class BurstLightning extends CardImpl { - public BurstLightning(UUID ownerId) { - super(ownerId, 119, "Burst Lightning", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{R}"); - this.expansionSetCode = "ZEN"; - this.color.setRed(true); + public BurstLightning(UUID ownerId) { + super(ownerId, 119, "Burst Lightning", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{R}"); + this.expansionSetCode = "ZEN"; + this.color.setRed(true); this.getSpellAbility().addOptionalCost(new KickerManaCost("{4}")); 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")); - } + } - public BurstLightning(final BurstLightning card) { - super(card); - } + public BurstLightning(final BurstLightning card) { + super(card); + } - @Override - public BurstLightning copy() { - return new BurstLightning(this); - } + @Override + public BurstLightning copy() { + return new BurstLightning(this); + } } diff --git a/Mage.Sets/src/mage/sets/zendikar/Cancel.java b/Mage.Sets/src/mage/sets/zendikar/Cancel.java index e015d14105..7e2c5e7447 100644 --- a/Mage.Sets/src/mage/sets/zendikar/Cancel.java +++ b/Mage.Sets/src/mage/sets/zendikar/Cancel.java @@ -36,19 +36,19 @@ import java.util.UUID; */ public class Cancel extends mage.sets.tenth.Cancel { - public Cancel(UUID ownerId) { - super(ownerId); - this.cardNumber = 44; - this.expansionSetCode = "ZEN"; - } + public Cancel(UUID ownerId) { + super(ownerId); + this.cardNumber = 44; + this.expansionSetCode = "ZEN"; + } - public Cancel(final Cancel card) { - super(card); - } + public Cancel(final Cancel card) { + super(card); + } - @Override - public Cancel copy() { - return new Cancel(this); - } + @Override + public Cancel copy() { + return new Cancel(this); + } } \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/zendikar/CelestialMantle.java b/Mage.Sets/src/mage/sets/zendikar/CelestialMantle.java index 22e275c322..7fcb53ce30 100644 --- a/Mage.Sets/src/mage/sets/zendikar/CelestialMantle.java +++ b/Mage.Sets/src/mage/sets/zendikar/CelestialMantle.java @@ -60,14 +60,14 @@ public class CelestialMantle extends CardImpl { super(ownerId, 6, "Celestial Mantle", Rarity.RARE, new CardType[]{CardType.ENCHANTMENT}, "{3}{W}{W}{W}"); this.expansionSetCode = "ZEN"; this.subtype.add("Aura"); - this.color.setWhite(true); + this.color.setWhite(true); TargetPermanent auraTarget = new TargetCreaturePermanent(); - this.getSpellAbility().addTarget(auraTarget); - this.getSpellAbility().addEffect(new AttachEffect(Constants.Outcome.BoostCreature)); - Ability ability = new EnchantAbility(auraTarget.getTargetName()); - this.addAbility(ability); - this.addAbility(new SimpleStaticAbility(Constants.Zone.BATTLEFIELD, new BoostEnchantedEffect(3, 3, Constants.Duration.WhileOnBattlefield))); + this.getSpellAbility().addTarget(auraTarget); + this.getSpellAbility().addEffect(new AttachEffect(Constants.Outcome.BoostCreature)); + Ability ability = new EnchantAbility(auraTarget.getTargetName()); + this.addAbility(ability); + this.addAbility(new SimpleStaticAbility(Constants.Zone.BATTLEFIELD, new BoostEnchantedEffect(3, 3, Constants.Duration.WhileOnBattlefield))); this.addAbility(new CelestialMantleAbility()); } @@ -104,7 +104,7 @@ class CelestialMantleAbility extends TriggeredAbilityImpl { - public ConquerorsPledge(UUID ownerId) { - super(ownerId, 8, "Conqueror's Pledge", Rarity.RARE, new CardType[]{CardType.SORCERY}, "{2}{W}{W}{W}"); - this.expansionSetCode = "ZEN"; - this.color.setWhite(true); + public ConquerorsPledge(UUID ownerId) { + super(ownerId, 8, "Conqueror's Pledge", Rarity.RARE, new CardType[]{CardType.SORCERY}, "{2}{W}{W}{W}"); + this.expansionSetCode = "ZEN"; + this.color.setWhite(true); this.getSpellAbility().addOptionalCost(new KickerManaCost("{6}")); this.getSpellAbility().addEffect(new ConditionalOneShotEffect(new CreateTokenEffect(new KorSoldierToken(), 12), new CreateTokenEffect(new KorSoldierToken(), 6), KickedCondition.getInstance(), "Put six 1/1 white Kor Soldier creature tokens onto the battlefield. If {this} was kicked, put twelve of those tokens onto the battlefield instead")); - } + } - public ConquerorsPledge(final ConquerorsPledge card) { - super(card); - } + public ConquerorsPledge(final ConquerorsPledge card) { + super(card); + } - @Override - public ConquerorsPledge copy() { - return new ConquerorsPledge(this); - } + @Override + public ConquerorsPledge copy() { + return new ConquerorsPledge(this); + } } class KorSoldierToken extends Token { - public KorSoldierToken() { - super("Kor Soldier", "1/1 white Kor Soldier creature token"); - cardType.add(CardType.CREATURE); - color.setWhite(true); - subtype.add("Kor"); - subtype.add("Soldier"); - power = new MageInt(1); - toughness = new MageInt(1); - } + public KorSoldierToken() { + super("Kor Soldier", "1/1 white Kor Soldier creature token"); + cardType.add(CardType.CREATURE); + color.setWhite(true); + subtype.add("Kor"); + subtype.add("Soldier"); + power = new MageInt(1); + toughness = new MageInt(1); + } } diff --git a/Mage.Sets/src/mage/sets/zendikar/DayOfJudgment.java b/Mage.Sets/src/mage/sets/zendikar/DayOfJudgment.java index ab81915e7e..2df4d7440a 100644 --- a/Mage.Sets/src/mage/sets/zendikar/DayOfJudgment.java +++ b/Mage.Sets/src/mage/sets/zendikar/DayOfJudgment.java @@ -41,20 +41,20 @@ import mage.filter.common.FilterCreaturePermanent; */ public class DayOfJudgment extends CardImpl { - public DayOfJudgment(UUID ownerId) { - super(ownerId, 9, "Day of Judgment", Rarity.RARE, new CardType[]{CardType.SORCERY}, "{2}{W}{W}"); - this.expansionSetCode = "ZEN"; - this.color.setWhite(true); - this.getSpellAbility().addEffect(new DestroyAllEffect(new FilterCreaturePermanent())); - } + public DayOfJudgment(UUID ownerId) { + super(ownerId, 9, "Day of Judgment", Rarity.RARE, new CardType[]{CardType.SORCERY}, "{2}{W}{W}"); + this.expansionSetCode = "ZEN"; + this.color.setWhite(true); + this.getSpellAbility().addEffect(new DestroyAllEffect(new FilterCreaturePermanent())); + } - public DayOfJudgment(final DayOfJudgment card) { - super(card); - } + public DayOfJudgment(final DayOfJudgment card) { + super(card); + } - @Override - public DayOfJudgment copy() { - return new DayOfJudgment(this); - } + @Override + public DayOfJudgment copy() { + return new DayOfJudgment(this); + } } diff --git a/Mage.Sets/src/mage/sets/zendikar/Demolish.java b/Mage.Sets/src/mage/sets/zendikar/Demolish.java index 2c6a717033..5b7ac3f617 100644 --- a/Mage.Sets/src/mage/sets/zendikar/Demolish.java +++ b/Mage.Sets/src/mage/sets/zendikar/Demolish.java @@ -36,19 +36,19 @@ import java.util.UUID; */ public class Demolish extends mage.sets.tenth.Demolish { - public Demolish(UUID ownerId) { - super(ownerId); - this.cardNumber = 121; - this.expansionSetCode = "ZEN"; - } + public Demolish(UUID ownerId) { + super(ownerId); + this.cardNumber = 121; + this.expansionSetCode = "ZEN"; + } - public Demolish(final Demolish card) { - super(card); - } + public Demolish(final Demolish card) { + super(card); + } - @Override - public Demolish copy() { - return new Demolish(this); - } + @Override + public Demolish copy() { + return new Demolish(this); + } } \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/zendikar/DevoutLightcaster.java b/Mage.Sets/src/mage/sets/zendikar/DevoutLightcaster.java index c17416d1dd..963e7dc3ea 100644 --- a/Mage.Sets/src/mage/sets/zendikar/DevoutLightcaster.java +++ b/Mage.Sets/src/mage/sets/zendikar/DevoutLightcaster.java @@ -52,7 +52,7 @@ public class DevoutLightcaster extends CardImpl { static { filterProtection.setUseColor(true); filterProtection.getColor().setBlack(true); - filterProtection.setScopeColor(ComparisonScope.Any); + filterProtection.setScopeColor(ComparisonScope.Any); filterTarget.setUseColor(true); filterTarget.getColor().setBlack(true); } diff --git a/Mage.Sets/src/mage/sets/zendikar/EldraziMonument.java b/Mage.Sets/src/mage/sets/zendikar/EldraziMonument.java index 3443b709f4..0dc3994d14 100644 --- a/Mage.Sets/src/mage/sets/zendikar/EldraziMonument.java +++ b/Mage.Sets/src/mage/sets/zendikar/EldraziMonument.java @@ -57,61 +57,61 @@ import mage.target.common.TargetControlledPermanent; */ public class EldraziMonument extends CardImpl { - public EldraziMonument(UUID ownerId) { - super(ownerId, 199, "Eldrazi Monument", Rarity.MYTHIC, new CardType[]{CardType.ARTIFACT}, "{5}"); - this.expansionSetCode = "ZEN"; - this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostControlledEffect(1, 1, Duration.WhileOnBattlefield, new FilterCreaturePermanent(), false))); - this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityControlledEffect(FlyingAbility.getInstance(), Duration.WhileOnBattlefield, new FilterCreaturePermanent()))); - this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityControlledEffect(IndestructibleAbility.getInstance(), Duration.WhileOnBattlefield, new FilterCreaturePermanent()))); - this.addAbility(new OnEventTriggeredAbility(EventType.UPKEEP_STEP_PRE, "beginning of your upkeep", new EldraziMonumentEffect())); - } + public EldraziMonument(UUID ownerId) { + super(ownerId, 199, "Eldrazi Monument", Rarity.MYTHIC, new CardType[]{CardType.ARTIFACT}, "{5}"); + this.expansionSetCode = "ZEN"; + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostControlledEffect(1, 1, Duration.WhileOnBattlefield, new FilterCreaturePermanent(), false))); + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityControlledEffect(FlyingAbility.getInstance(), Duration.WhileOnBattlefield, new FilterCreaturePermanent()))); + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityControlledEffect(IndestructibleAbility.getInstance(), Duration.WhileOnBattlefield, new FilterCreaturePermanent()))); + this.addAbility(new OnEventTriggeredAbility(EventType.UPKEEP_STEP_PRE, "beginning of your upkeep", new EldraziMonumentEffect())); + } - public EldraziMonument(final EldraziMonument card) { - super(card); - } + public EldraziMonument(final EldraziMonument card) { + super(card); + } - @Override - public EldraziMonument copy() { - return new EldraziMonument(this); - } + @Override + public EldraziMonument copy() { + return new EldraziMonument(this); + } } class EldraziMonumentEffect extends OneShotEffect { - public EldraziMonumentEffect() { - super(Outcome.Sacrifice); - staticText = "sacrifice a creature. If you can't, sacrifice {this}"; - } + public EldraziMonumentEffect() { + super(Outcome.Sacrifice); + staticText = "sacrifice a creature. If you can't, sacrifice {this}"; + } - public EldraziMonumentEffect(final EldraziMonumentEffect ability) { - super(ability); - } + public EldraziMonumentEffect(final EldraziMonumentEffect ability) { + super(ability); + } - @Override - public EldraziMonumentEffect copy() { - return new EldraziMonumentEffect(this); - } + @Override + public EldraziMonumentEffect copy() { + return new EldraziMonumentEffect(this); + } - @Override - public boolean apply(Game game, Ability source) { - TargetControlledPermanent target = new TargetControlledCreaturePermanent(); - target.setRequired(true); - Player player = game.getPlayer(source.getControllerId()); - if (target.canChoose(source.getControllerId(), game)) { - player.choose(this.outcome, target, source.getSourceId(), game); - Permanent permanent = game.getPermanent(target.getFirstTarget()); - if (permanent != null) { - return permanent.sacrifice(source.getSourceId(), game); - } - } - Permanent permanent = game.getPermanent(source.getSourceId()); - if (permanent != null) { - return permanent.sacrifice(source.getSourceId(), game); - } - return false; + @Override + public boolean apply(Game game, Ability source) { + TargetControlledPermanent target = new TargetControlledCreaturePermanent(); + target.setRequired(true); + Player player = game.getPlayer(source.getControllerId()); + if (target.canChoose(source.getControllerId(), game)) { + player.choose(this.outcome, target, source.getSourceId(), game); + Permanent permanent = game.getPermanent(target.getFirstTarget()); + if (permanent != null) { + return permanent.sacrifice(source.getSourceId(), game); + } + } + Permanent permanent = game.getPermanent(source.getSourceId()); + if (permanent != null) { + return permanent.sacrifice(source.getSourceId(), game); + } + return false; - } + } } diff --git a/Mage.Sets/src/mage/sets/zendikar/EmeriaAngel.java b/Mage.Sets/src/mage/sets/zendikar/EmeriaAngel.java index 1fbed693d1..8affae6547 100644 --- a/Mage.Sets/src/mage/sets/zendikar/EmeriaAngel.java +++ b/Mage.Sets/src/mage/sets/zendikar/EmeriaAngel.java @@ -44,38 +44,38 @@ import mage.game.permanent.token.Token; */ public class EmeriaAngel extends CardImpl { - public EmeriaAngel(UUID ownerId) { - super(ownerId, 11, "Emeria Angel", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{2}{W}{W}"); - this.expansionSetCode = "ZEN"; - this.subtype.add("Angel"); - this.color.setWhite(true); - this.power = new MageInt(3); - this.toughness = new MageInt(3); + public EmeriaAngel(UUID ownerId) { + super(ownerId, 11, "Emeria Angel", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{2}{W}{W}"); + this.expansionSetCode = "ZEN"; + this.subtype.add("Angel"); + this.color.setWhite(true); + this.power = new MageInt(3); + this.toughness = new MageInt(3); - this.addAbility(FlyingAbility.getInstance()); - this.addAbility(new LandfallAbility(new CreateTokenEffect(new BirdToken()), true)); - } + this.addAbility(FlyingAbility.getInstance()); + this.addAbility(new LandfallAbility(new CreateTokenEffect(new BirdToken()), true)); + } - public EmeriaAngel(final EmeriaAngel card) { - super(card); - } + public EmeriaAngel(final EmeriaAngel card) { + super(card); + } - @Override - public EmeriaAngel copy() { - return new EmeriaAngel(this); - } + @Override + public EmeriaAngel copy() { + return new EmeriaAngel(this); + } } class BirdToken extends Token { - public BirdToken() { - super("Bird", "1/1 white Bird creature token with flying"); - cardType.add(CardType.CREATURE); - color.setWhite(true); - subtype.add("Bird"); - power = new MageInt(1); - toughness = new MageInt(1); - addAbility(FlyingAbility.getInstance()); - } + public BirdToken() { + super("Bird", "1/1 white Bird creature token with flying"); + cardType.add(CardType.CREATURE); + color.setWhite(true); + subtype.add("Bird"); + power = new MageInt(1); + toughness = new MageInt(1); + addAbility(FlyingAbility.getInstance()); + } } \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/zendikar/EmeriaTheSkyRuin.java b/Mage.Sets/src/mage/sets/zendikar/EmeriaTheSkyRuin.java index f36516f474..63f6271ae9 100644 --- a/Mage.Sets/src/mage/sets/zendikar/EmeriaTheSkyRuin.java +++ b/Mage.Sets/src/mage/sets/zendikar/EmeriaTheSkyRuin.java @@ -103,10 +103,10 @@ class EmeriaTheSkyRuinTriggeredAbility extends TriggeredAbilityImpl= 7; + return game.getBattlefield().countAll(filter, this.controllerId, game) >= 7; } @Override diff --git a/Mage.Sets/src/mage/sets/zendikar/Forest1.java b/Mage.Sets/src/mage/sets/zendikar/Forest1.java index fbe796073c..e652ff9ecc 100644 --- a/Mage.Sets/src/mage/sets/zendikar/Forest1.java +++ b/Mage.Sets/src/mage/sets/zendikar/Forest1.java @@ -36,18 +36,18 @@ import java.util.UUID; */ public class Forest1 extends mage.cards.basiclands.Forest { - public Forest1(UUID ownerId) { - super(ownerId, 246); - this.expansionSetCode = "ZEN"; - } + public Forest1(UUID ownerId) { + super(ownerId, 246); + this.expansionSetCode = "ZEN"; + } - public Forest1(final Forest1 card) { - super(card); - } + public Forest1(final Forest1 card) { + super(card); + } - @Override - public Forest1 copy() { - return new Forest1(this); - } + @Override + public Forest1 copy() { + return new Forest1(this); + } } \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/zendikar/Forest2.java b/Mage.Sets/src/mage/sets/zendikar/Forest2.java index 8ff76a4bc4..85e7a205ce 100644 --- a/Mage.Sets/src/mage/sets/zendikar/Forest2.java +++ b/Mage.Sets/src/mage/sets/zendikar/Forest2.java @@ -36,18 +36,18 @@ import java.util.UUID; */ public class Forest2 extends mage.cards.basiclands.Forest { - public Forest2(UUID ownerId) { - super(ownerId, 247); - this.expansionSetCode = "ZEN"; - } + public Forest2(UUID ownerId) { + super(ownerId, 247); + this.expansionSetCode = "ZEN"; + } - public Forest2(final Forest2 card) { - super(card); - } + public Forest2(final Forest2 card) { + super(card); + } - @Override - public Forest2 copy() { - return new Forest2(this); - } + @Override + public Forest2 copy() { + return new Forest2(this); + } } \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/zendikar/Forest3.java b/Mage.Sets/src/mage/sets/zendikar/Forest3.java index 7f61244b49..945157ad0c 100644 --- a/Mage.Sets/src/mage/sets/zendikar/Forest3.java +++ b/Mage.Sets/src/mage/sets/zendikar/Forest3.java @@ -36,18 +36,18 @@ import java.util.UUID; */ public class Forest3 extends mage.cards.basiclands.Forest { - public Forest3(UUID ownerId) { - super(ownerId, 248); - this.expansionSetCode = "ZEN"; - } + public Forest3(UUID ownerId) { + super(ownerId, 248); + this.expansionSetCode = "ZEN"; + } - public Forest3(final Forest3 card) { - super(card); - } + public Forest3(final Forest3 card) { + super(card); + } - @Override - public Forest3 copy() { - return new Forest3(this); - } + @Override + public Forest3 copy() { + return new Forest3(this); + } } \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/zendikar/Forest4.java b/Mage.Sets/src/mage/sets/zendikar/Forest4.java index c92a75776f..d27e5503d8 100644 --- a/Mage.Sets/src/mage/sets/zendikar/Forest4.java +++ b/Mage.Sets/src/mage/sets/zendikar/Forest4.java @@ -36,18 +36,18 @@ import java.util.UUID; */ public class Forest4 extends mage.cards.basiclands.Forest { - public Forest4(UUID ownerId) { - super(ownerId, 249); - this.expansionSetCode = "ZEN"; - } + public Forest4(UUID ownerId) { + super(ownerId, 249); + this.expansionSetCode = "ZEN"; + } - public Forest4(final Forest4 card) { - super(card); - } + public Forest4(final Forest4 card) { + super(card); + } - @Override - public Forest4 copy() { - return new Forest4(this); - } + @Override + public Forest4 copy() { + return new Forest4(this); + } } \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/zendikar/Forest5.java b/Mage.Sets/src/mage/sets/zendikar/Forest5.java index 1901950b30..7e77d17566 100644 --- a/Mage.Sets/src/mage/sets/zendikar/Forest5.java +++ b/Mage.Sets/src/mage/sets/zendikar/Forest5.java @@ -36,18 +36,18 @@ import java.util.UUID; */ public class Forest5 extends mage.cards.basiclands.Forest { - public Forest5(UUID ownerId) { - super(ownerId, 266); - this.expansionSetCode = "ZEN"; - } + public Forest5(UUID ownerId) { + super(ownerId, 266); + this.expansionSetCode = "ZEN"; + } - public Forest5(final Forest5 card) { - super(card); - } + public Forest5(final Forest5 card) { + super(card); + } - @Override - public Forest5 copy() { - return new Forest5(this); - } + @Override + public Forest5 copy() { + return new Forest5(this); + } } \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/zendikar/Forest6.java b/Mage.Sets/src/mage/sets/zendikar/Forest6.java index 108098d514..4b75eef2c1 100644 --- a/Mage.Sets/src/mage/sets/zendikar/Forest6.java +++ b/Mage.Sets/src/mage/sets/zendikar/Forest6.java @@ -36,18 +36,18 @@ import java.util.UUID; */ public class Forest6 extends mage.cards.basiclands.Forest { - public Forest6(UUID ownerId) { - super(ownerId, 267); - this.expansionSetCode = "ZEN"; - } + public Forest6(UUID ownerId) { + super(ownerId, 267); + this.expansionSetCode = "ZEN"; + } - public Forest6(final Forest6 card) { - super(card); - } + public Forest6(final Forest6 card) { + super(card); + } - @Override - public Forest6 copy() { - return new Forest6(this); - } + @Override + public Forest6 copy() { + return new Forest6(this); + } } \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/zendikar/Forest7.java b/Mage.Sets/src/mage/sets/zendikar/Forest7.java index a28cc80372..fc2904ed42 100644 --- a/Mage.Sets/src/mage/sets/zendikar/Forest7.java +++ b/Mage.Sets/src/mage/sets/zendikar/Forest7.java @@ -36,18 +36,18 @@ import java.util.UUID; */ public class Forest7 extends mage.cards.basiclands.Forest { - public Forest7(UUID ownerId) { - super(ownerId, 268); - this.expansionSetCode = "ZEN"; - } + public Forest7(UUID ownerId) { + super(ownerId, 268); + this.expansionSetCode = "ZEN"; + } - public Forest7(final Forest7 card) { - super(card); - } + public Forest7(final Forest7 card) { + super(card); + } - @Override - public Forest7 copy() { - return new Forest7(this); - } + @Override + public Forest7 copy() { + return new Forest7(this); + } } \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/zendikar/Forest8.java b/Mage.Sets/src/mage/sets/zendikar/Forest8.java index fae5c79d74..f8e31635fe 100644 --- a/Mage.Sets/src/mage/sets/zendikar/Forest8.java +++ b/Mage.Sets/src/mage/sets/zendikar/Forest8.java @@ -36,18 +36,18 @@ import java.util.UUID; */ public class Forest8 extends mage.cards.basiclands.Forest { - public Forest8(UUID ownerId) { - super(ownerId, 269); - this.expansionSetCode = "ZEN"; - } + public Forest8(UUID ownerId) { + super(ownerId, 269); + this.expansionSetCode = "ZEN"; + } - public Forest8(final Forest8 card) { - super(card); - } + public Forest8(final Forest8 card) { + super(card); + } - @Override - public Forest8 copy() { - return new Forest8(this); - } + @Override + public Forest8 copy() { + return new Forest8(this); + } } \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/zendikar/FrontierGuide.java b/Mage.Sets/src/mage/sets/zendikar/FrontierGuide.java index fff0d6cfbd..694edb19db 100644 --- a/Mage.Sets/src/mage/sets/zendikar/FrontierGuide.java +++ b/Mage.Sets/src/mage/sets/zendikar/FrontierGuide.java @@ -62,7 +62,7 @@ public class FrontierGuide extends CardImpl { new SearchLibraryPutInPlayEffect(new TargetCardInLibrary(filter), true), new ManaCostsImpl("{3}{G}")); ability.addCost(new TapSourceCost()); - this.addAbility(ability); + this.addAbility(ability); } public FrontierGuide(final FrontierGuide card) { diff --git a/Mage.Sets/src/mage/sets/zendikar/GatekeeperOfMalakir.java b/Mage.Sets/src/mage/sets/zendikar/GatekeeperOfMalakir.java index 59a4dad943..0efff7a6c6 100644 --- a/Mage.Sets/src/mage/sets/zendikar/GatekeeperOfMalakir.java +++ b/Mage.Sets/src/mage/sets/zendikar/GatekeeperOfMalakir.java @@ -48,40 +48,40 @@ import java.util.UUID; */ public class GatekeeperOfMalakir extends CardImpl { - private static final FilterControlledPermanent filter; + private static final FilterControlledPermanent filter; - static { - filter = new FilterControlledPermanent(); - filter.getCardType().add(CardType.CREATURE); - filter.setMessage(" a creature"); - } + static { + filter = new FilterControlledPermanent(); + filter.getCardType().add(CardType.CREATURE); + filter.setMessage(" a creature"); + } - public GatekeeperOfMalakir(UUID ownerId) { - super(ownerId, 89, "Gatekeeper of Malakir", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{B}{B}"); - this.expansionSetCode = "ZEN"; - this.subtype.add("Vampire"); - this.subtype.add("Warrior"); + public GatekeeperOfMalakir(UUID ownerId) { + super(ownerId, 89, "Gatekeeper of Malakir", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{B}{B}"); + this.expansionSetCode = "ZEN"; + this.subtype.add("Vampire"); + this.subtype.add("Warrior"); - this.color.setBlack(true); - this.power = new MageInt(2); - this.toughness = new MageInt(2); + this.color.setBlack(true); + this.power = new MageInt(2); + this.toughness = new MageInt(2); this.getSpellAbility().addOptionalCost(new KickerManaCost("{B}")); - EntersBattlefieldTriggeredAbility ability = - new EntersBattlefieldTriggeredAbility(new SacrificeEffect(filter, 1, "target player")); + 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.getInstance(), "When {this} enters the battlefield, if it was kicked, target player sacrifices a creature"); conditionalAbility.addTarget(new TargetPlayer()); this.addAbility(conditionalAbility); - } + } - public GatekeeperOfMalakir(final GatekeeperOfMalakir card) { - super(card); - } + public GatekeeperOfMalakir(final GatekeeperOfMalakir card) { + super(card); + } - @Override - public GatekeeperOfMalakir copy() { - return new GatekeeperOfMalakir(this); - } + @Override + public GatekeeperOfMalakir copy() { + return new GatekeeperOfMalakir(this); + } } diff --git a/Mage.Sets/src/mage/sets/zendikar/GoblinGuide.java b/Mage.Sets/src/mage/sets/zendikar/GoblinGuide.java index c6ec4c82a0..3b3ed2e82c 100644 --- a/Mage.Sets/src/mage/sets/zendikar/GoblinGuide.java +++ b/Mage.Sets/src/mage/sets/zendikar/GoblinGuide.java @@ -51,62 +51,62 @@ import mage.players.Player; */ public class GoblinGuide extends CardImpl { - public GoblinGuide(UUID ownerId) { - super(ownerId, 126, "Goblin Guide", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{R}"); - this.expansionSetCode = "ZEN"; - this.color.setRed(true); - this.subtype.add("Goblin"); - this.subtype.add("Scout"); - this.power = new MageInt(2); - this.toughness = new MageInt(2); - this.addAbility(HasteAbility.getInstance()); - this.addAbility(new AttacksTriggeredAbility(new GoblinGuideEffect(), false)); - } + public GoblinGuide(UUID ownerId) { + super(ownerId, 126, "Goblin Guide", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{R}"); + this.expansionSetCode = "ZEN"; + this.color.setRed(true); + this.subtype.add("Goblin"); + this.subtype.add("Scout"); + this.power = new MageInt(2); + this.toughness = new MageInt(2); + this.addAbility(HasteAbility.getInstance()); + this.addAbility(new AttacksTriggeredAbility(new GoblinGuideEffect(), false)); + } - public GoblinGuide(final GoblinGuide card) { - super(card); - } + public GoblinGuide(final GoblinGuide card) { + super(card); + } - @Override - public GoblinGuide copy() { - return new GoblinGuide(this); - } + @Override + public GoblinGuide copy() { + return new GoblinGuide(this); + } } class GoblinGuideEffect extends OneShotEffect { - public GoblinGuideEffect() { - super(Outcome.DrawCard); - staticText = "defending player reveals the top card of his or her library. If it's a land card, that player puts it into his or her hand"; - } + public GoblinGuideEffect() { + super(Outcome.DrawCard); + staticText = "defending player reveals the top card of his or her library. If it's a land card, that player puts it into his or her hand"; + } - public GoblinGuideEffect(final GoblinGuideEffect effect) { - super(effect); - } + public GoblinGuideEffect(final GoblinGuideEffect effect) { + super(effect); + } - @Override - public GoblinGuideEffect copy() { - return new GoblinGuideEffect(this); - } + @Override + public GoblinGuideEffect copy() { + return new GoblinGuideEffect(this); + } - @Override - public boolean apply(Game game, Ability source) { - UUID defenderId = game.getCombat().getDefendingPlayer(source.getSourceId()); - Player defender = game.getPlayer(defenderId); - if (defender != null) { - Cards cards = new CardsImpl(); - Card card = defender.getLibrary().getFromTop(game); - if (card != null) { - cards.add(card); - defender.revealCards("Goblin Guide", cards, game); - if (card.getCardType().contains(CardType.LAND)) { - defender.getLibrary().removeFromTop(game); - card.moveToZone(Zone.HAND, source.getId(), game, true); - } - } - } - return false; - } + @Override + public boolean apply(Game game, Ability source) { + UUID defenderId = game.getCombat().getDefendingPlayer(source.getSourceId()); + Player defender = game.getPlayer(defenderId); + if (defender != null) { + Cards cards = new CardsImpl(); + Card card = defender.getLibrary().getFromTop(game); + if (card != null) { + cards.add(card); + defender.revealCards("Goblin Guide", cards, game); + if (card.getCardType().contains(CardType.LAND)) { + defender.getLibrary().removeFromTop(game); + card.moveToZone(Zone.HAND, source.getId(), game, true); + } + } + } + return false; + } } \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/zendikar/GoblinRuinblaster.java b/Mage.Sets/src/mage/sets/zendikar/GoblinRuinblaster.java index 36cfa6c920..16b2116bee 100644 --- a/Mage.Sets/src/mage/sets/zendikar/GoblinRuinblaster.java +++ b/Mage.Sets/src/mage/sets/zendikar/GoblinRuinblaster.java @@ -51,30 +51,30 @@ import mage.target.common.TargetNonBasicLandPermanent; */ public class GoblinRuinblaster extends CardImpl { - public GoblinRuinblaster(UUID ownerId) { - super(ownerId, 127, "Goblin Ruinblaster", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{2}{R}"); - this.expansionSetCode = "ZEN"; - this.color.setRed(true); - this.subtype.add("Goblin"); - this.subtype.add("Shaman"); - this.power = new MageInt(2); - this.toughness = new MageInt(1); - this.addAbility(HasteAbility.getInstance()); - Ability ability1 = new EntersBattlefieldTriggeredAbility(new DestroyTargetEffect()); - ability1.addTarget(new TargetNonBasicLandPermanent()); - KickerAbility ability2 = new KickerAbility(new GainAbilitySourceEffect(ability1, Duration.WhileOnBattlefield), false); - ability2.addManaCost(new ColoredManaCost(ColoredManaSymbol.R)); - this.addAbility(ability2); + public GoblinRuinblaster(UUID ownerId) { + super(ownerId, 127, "Goblin Ruinblaster", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{2}{R}"); + this.expansionSetCode = "ZEN"; + this.color.setRed(true); + this.subtype.add("Goblin"); + this.subtype.add("Shaman"); + this.power = new MageInt(2); + this.toughness = new MageInt(1); + this.addAbility(HasteAbility.getInstance()); + Ability ability1 = new EntersBattlefieldTriggeredAbility(new DestroyTargetEffect()); + ability1.addTarget(new TargetNonBasicLandPermanent()); + KickerAbility ability2 = new KickerAbility(new GainAbilitySourceEffect(ability1, Duration.WhileOnBattlefield), false); + ability2.addManaCost(new ColoredManaCost(ColoredManaSymbol.R)); + this.addAbility(ability2); - } + } - public GoblinRuinblaster(final GoblinRuinblaster card) { - super(card); - } + public GoblinRuinblaster(final GoblinRuinblaster card) { + super(card); + } - @Override - public GoblinRuinblaster copy() { - return new GoblinRuinblaster(this); - } + @Override + public GoblinRuinblaster copy() { + return new GoblinRuinblaster(this); + } } diff --git a/Mage.Sets/src/mage/sets/zendikar/HagraDiabolist.java b/Mage.Sets/src/mage/sets/zendikar/HagraDiabolist.java index 8829f9ec7a..6a3c141809 100644 --- a/Mage.Sets/src/mage/sets/zendikar/HagraDiabolist.java +++ b/Mage.Sets/src/mage/sets/zendikar/HagraDiabolist.java @@ -52,8 +52,8 @@ public class HagraDiabolist extends CardImpl { static { filter.getSubtype().add("Ally"); - filter.setScopeSubtype(Filter.ComparisonScope.Any); - filter.setTargetController(Constants.TargetController.YOU); + filter.setScopeSubtype(Filter.ComparisonScope.Any); + filter.setTargetController(Constants.TargetController.YOU); } public HagraDiabolist(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/zendikar/Harrow.java b/Mage.Sets/src/mage/sets/zendikar/Harrow.java index 523cd67c52..18c510bb38 100644 --- a/Mage.Sets/src/mage/sets/zendikar/Harrow.java +++ b/Mage.Sets/src/mage/sets/zendikar/Harrow.java @@ -45,29 +45,29 @@ import mage.target.common.TargetControlledPermanent; * @author Viserion */ public class Harrow extends CardImpl { - - private static final FilterControlledPermanent filter = new FilterControlledPermanent("a land."); - - static{ - filter.getCardType().add(CardType.LAND); - } - public Harrow(UUID ownerId){ - super(ownerId, 165, "Harrow", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{2}{G}"); - this.expansionSetCode = "ZEN"; - this.color.setGreen(true); - - this.getSpellAbility().addCost(new SacrificeTargetCost(new TargetControlledPermanent(filter))); - TargetCardInLibrary target = new TargetCardInLibrary(0, 2, new FilterBasicLandCard()); - this.getSpellAbility().addEffect(new SearchLibraryPutInPlayEffect(target, false, Outcome.PutLandInPlay)); - } + private static final FilterControlledPermanent filter = new FilterControlledPermanent("a land."); - public Harrow(final Harrow card) { - super(card); - } + static{ + filter.getCardType().add(CardType.LAND); + } - @Override - public Harrow copy() { - return new Harrow(this); - } + public Harrow(UUID ownerId){ + super(ownerId, 165, "Harrow", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{2}{G}"); + this.expansionSetCode = "ZEN"; + this.color.setGreen(true); + + this.getSpellAbility().addCost(new SacrificeTargetCost(new TargetControlledPermanent(filter))); + TargetCardInLibrary target = new TargetCardInLibrary(0, 2, new FilterBasicLandCard()); + this.getSpellAbility().addEffect(new SearchLibraryPutInPlayEffect(target, false, Outcome.PutLandInPlay)); + } + + public Harrow(final Harrow card) { + super(card); + } + + @Override + public Harrow copy() { + return new Harrow(this); + } } diff --git a/Mage.Sets/src/mage/sets/zendikar/HighlandBerserker.java b/Mage.Sets/src/mage/sets/zendikar/HighlandBerserker.java index 577721bbad..af73f7fbf5 100644 --- a/Mage.Sets/src/mage/sets/zendikar/HighlandBerserker.java +++ b/Mage.Sets/src/mage/sets/zendikar/HighlandBerserker.java @@ -51,8 +51,8 @@ public class HighlandBerserker extends CardImpl { static { filter.getSubtype().add("Ally"); - filter.setScopeSubtype(Filter.ComparisonScope.Any); - filter.setTargetController(Constants.TargetController.YOU); + filter.setScopeSubtype(Filter.ComparisonScope.Any); + filter.setTargetController(Constants.TargetController.YOU); } public HighlandBerserker(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/zendikar/IntoTheRoil.java b/Mage.Sets/src/mage/sets/zendikar/IntoTheRoil.java index 5bd29898b7..c6a824835c 100644 --- a/Mage.Sets/src/mage/sets/zendikar/IntoTheRoil.java +++ b/Mage.Sets/src/mage/sets/zendikar/IntoTheRoil.java @@ -44,24 +44,24 @@ import mage.target.common.TargetNonlandPermanent; */ public class IntoTheRoil extends CardImpl { - public IntoTheRoil(UUID ownerId) { - super(ownerId, 48, "Into the Roil", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{1}{U}"); - this.expansionSetCode = "ZEN"; - this.color.setBlue(true); - this.getSpellAbility().addTarget(new TargetNonlandPermanent()); - this.getSpellAbility().addEffect(new ReturnToHandTargetEffect()); - KickerAbility ability = new KickerAbility(new DrawCardControllerEffect(1), false); - ability.addManaCost(new ManaCostsImpl("{1}{U}")); - this.addAbility(ability); - } + public IntoTheRoil(UUID ownerId) { + super(ownerId, 48, "Into the Roil", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{1}{U}"); + this.expansionSetCode = "ZEN"; + this.color.setBlue(true); + this.getSpellAbility().addTarget(new TargetNonlandPermanent()); + this.getSpellAbility().addEffect(new ReturnToHandTargetEffect()); + KickerAbility ability = new KickerAbility(new DrawCardControllerEffect(1), false); + ability.addManaCost(new ManaCostsImpl("{1}{U}")); + this.addAbility(ability); + } - public IntoTheRoil(final IntoTheRoil card) { - super(card); - } + public IntoTheRoil(final IntoTheRoil card) { + super(card); + } - @Override - public IntoTheRoil copy() { - return new IntoTheRoil(this); - } + @Override + public IntoTheRoil copy() { + return new IntoTheRoil(this); + } } diff --git a/Mage.Sets/src/mage/sets/zendikar/Island1.java b/Mage.Sets/src/mage/sets/zendikar/Island1.java index cdd330e29e..07cae71f78 100644 --- a/Mage.Sets/src/mage/sets/zendikar/Island1.java +++ b/Mage.Sets/src/mage/sets/zendikar/Island1.java @@ -36,18 +36,18 @@ import java.util.UUID; */ public class Island1 extends mage.cards.basiclands.Island { - public Island1(UUID ownerId) { - super(ownerId, 234); - this.expansionSetCode = "ZEN"; - } + public Island1(UUID ownerId) { + super(ownerId, 234); + this.expansionSetCode = "ZEN"; + } - public Island1(final Island1 card) { - super(card); - } + public Island1(final Island1 card) { + super(card); + } - @Override - public Island1 copy() { - return new Island1(this); - } + @Override + public Island1 copy() { + return new Island1(this); + } } diff --git a/Mage.Sets/src/mage/sets/zendikar/Island2.java b/Mage.Sets/src/mage/sets/zendikar/Island2.java index 78fa641a4d..e048d0a5c0 100644 --- a/Mage.Sets/src/mage/sets/zendikar/Island2.java +++ b/Mage.Sets/src/mage/sets/zendikar/Island2.java @@ -36,18 +36,18 @@ import java.util.UUID; */ public class Island2 extends mage.cards.basiclands.Island { - public Island2(UUID ownerId) { - super(ownerId, 235); - this.expansionSetCode = "ZEN"; - } + public Island2(UUID ownerId) { + super(ownerId, 235); + this.expansionSetCode = "ZEN"; + } - public Island2(final Island2 card) { - super(card); - } + public Island2(final Island2 card) { + super(card); + } - @Override - public Island2 copy() { - return new Island2(this); - } + @Override + public Island2 copy() { + return new Island2(this); + } } diff --git a/Mage.Sets/src/mage/sets/zendikar/Island3.java b/Mage.Sets/src/mage/sets/zendikar/Island3.java index 378952cf94..927af5ca21 100644 --- a/Mage.Sets/src/mage/sets/zendikar/Island3.java +++ b/Mage.Sets/src/mage/sets/zendikar/Island3.java @@ -36,18 +36,18 @@ import java.util.UUID; */ public class Island3 extends mage.cards.basiclands.Island { - public Island3(UUID ownerId) { - super(ownerId, 236); - this.expansionSetCode = "ZEN"; - } + public Island3(UUID ownerId) { + super(ownerId, 236); + this.expansionSetCode = "ZEN"; + } - public Island3(final Island3 card) { - super(card); - } + public Island3(final Island3 card) { + super(card); + } - @Override - public Island3 copy() { - return new Island3(this); - } + @Override + public Island3 copy() { + return new Island3(this); + } } diff --git a/Mage.Sets/src/mage/sets/zendikar/Island4.java b/Mage.Sets/src/mage/sets/zendikar/Island4.java index 26a35a9ba5..7d8fca5d2e 100644 --- a/Mage.Sets/src/mage/sets/zendikar/Island4.java +++ b/Mage.Sets/src/mage/sets/zendikar/Island4.java @@ -36,18 +36,18 @@ import java.util.UUID; */ public class Island4 extends mage.cards.basiclands.Island { - public Island4(UUID ownerId) { - super(ownerId, 237); - this.expansionSetCode = "ZEN"; - } + public Island4(UUID ownerId) { + super(ownerId, 237); + this.expansionSetCode = "ZEN"; + } - public Island4(final Island4 card) { - super(card); - } + public Island4(final Island4 card) { + super(card); + } - @Override - public Island4 copy() { - return new Island4(this); - } + @Override + public Island4 copy() { + return new Island4(this); + } } diff --git a/Mage.Sets/src/mage/sets/zendikar/Island5.java b/Mage.Sets/src/mage/sets/zendikar/Island5.java index 6efb91dd5f..9b80b64363 100644 --- a/Mage.Sets/src/mage/sets/zendikar/Island5.java +++ b/Mage.Sets/src/mage/sets/zendikar/Island5.java @@ -36,18 +36,18 @@ import java.util.UUID; */ public class Island5 extends mage.cards.basiclands.Island { - public Island5(UUID ownerId) { - super(ownerId, 254); - this.expansionSetCode = "ZEN"; - } + public Island5(UUID ownerId) { + super(ownerId, 254); + this.expansionSetCode = "ZEN"; + } - public Island5(final Island5 card) { - super(card); - } + public Island5(final Island5 card) { + super(card); + } - @Override - public Island5 copy() { - return new Island5(this); - } + @Override + public Island5 copy() { + return new Island5(this); + } } diff --git a/Mage.Sets/src/mage/sets/zendikar/Island6.java b/Mage.Sets/src/mage/sets/zendikar/Island6.java index 1ee3ba9f7c..728f2cf1d2 100644 --- a/Mage.Sets/src/mage/sets/zendikar/Island6.java +++ b/Mage.Sets/src/mage/sets/zendikar/Island6.java @@ -36,18 +36,18 @@ import java.util.UUID; */ public class Island6 extends mage.cards.basiclands.Island { - public Island6(UUID ownerId) { - super(ownerId, 255); - this.expansionSetCode = "ZEN"; - } + public Island6(UUID ownerId) { + super(ownerId, 255); + this.expansionSetCode = "ZEN"; + } - public Island6(final Island6 card) { - super(card); - } + public Island6(final Island6 card) { + super(card); + } - @Override - public Island6 copy() { - return new Island6(this); - } + @Override + public Island6 copy() { + return new Island6(this); + } } diff --git a/Mage.Sets/src/mage/sets/zendikar/Island7.java b/Mage.Sets/src/mage/sets/zendikar/Island7.java index 346228613e..c61fde7ce6 100644 --- a/Mage.Sets/src/mage/sets/zendikar/Island7.java +++ b/Mage.Sets/src/mage/sets/zendikar/Island7.java @@ -36,18 +36,18 @@ import java.util.UUID; */ public class Island7 extends mage.cards.basiclands.Island { - public Island7(UUID ownerId) { - super(ownerId, 256); - this.expansionSetCode = "ZEN"; - } + public Island7(UUID ownerId) { + super(ownerId, 256); + this.expansionSetCode = "ZEN"; + } - public Island7(final Island7 card) { - super(card); - } + public Island7(final Island7 card) { + super(card); + } - @Override - public Island7 copy() { - return new Island7(this); - } + @Override + public Island7 copy() { + return new Island7(this); + } } diff --git a/Mage.Sets/src/mage/sets/zendikar/Island8.java b/Mage.Sets/src/mage/sets/zendikar/Island8.java index 5af8145b54..f0386368b2 100644 --- a/Mage.Sets/src/mage/sets/zendikar/Island8.java +++ b/Mage.Sets/src/mage/sets/zendikar/Island8.java @@ -36,18 +36,18 @@ import java.util.UUID; */ public class Island8 extends mage.cards.basiclands.Island { - public Island8(UUID ownerId) { - super(ownerId, 257); - this.expansionSetCode = "ZEN"; - } + public Island8(UUID ownerId) { + super(ownerId, 257); + this.expansionSetCode = "ZEN"; + } - public Island8(final Island8 card) { - super(card); - } + public Island8(final Island8 card) { + super(card); + } - @Override - public Island8 copy() { - return new Island8(this); - } + @Override + public Island8 copy() { + return new Island8(this); + } } diff --git a/Mage.Sets/src/mage/sets/zendikar/JoragaBard.java b/Mage.Sets/src/mage/sets/zendikar/JoragaBard.java index 846f3b570b..5e7a65b4eb 100644 --- a/Mage.Sets/src/mage/sets/zendikar/JoragaBard.java +++ b/Mage.Sets/src/mage/sets/zendikar/JoragaBard.java @@ -51,8 +51,8 @@ public class JoragaBard extends CardImpl { static { filter.getSubtype().add("Ally"); - filter.setScopeSubtype(Filter.ComparisonScope.Any); - filter.setTargetController(Constants.TargetController.YOU); + filter.setScopeSubtype(Filter.ComparisonScope.Any); + filter.setTargetController(Constants.TargetController.YOU); } public JoragaBard(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/zendikar/KabiraCrossroads.java b/Mage.Sets/src/mage/sets/zendikar/KabiraCrossroads.java index c9ebbe63b1..3c5027a4c2 100644 --- a/Mage.Sets/src/mage/sets/zendikar/KabiraCrossroads.java +++ b/Mage.Sets/src/mage/sets/zendikar/KabiraCrossroads.java @@ -43,21 +43,21 @@ import mage.cards.CardImpl; */ public class KabiraCrossroads extends CardImpl { - public KabiraCrossroads(UUID ownerId) { - super(ownerId, 216, "Kabira Crossroads", Rarity.COMMON, new CardType[]{CardType.LAND}, null); - this.expansionSetCode = "ZEN"; - this.addAbility(new EntersBattlefieldTappedAbility()); - this.addAbility(new EntersBattlefieldTriggeredAbility(new GainLifeEffect(2), false)); - this.addAbility(new WhiteManaAbility()); - } + public KabiraCrossroads(UUID ownerId) { + super(ownerId, 216, "Kabira Crossroads", Rarity.COMMON, new CardType[]{CardType.LAND}, null); + this.expansionSetCode = "ZEN"; + this.addAbility(new EntersBattlefieldTappedAbility()); + this.addAbility(new EntersBattlefieldTriggeredAbility(new GainLifeEffect(2), false)); + this.addAbility(new WhiteManaAbility()); + } - public KabiraCrossroads(final KabiraCrossroads card) { - super(card); - } + public KabiraCrossroads(final KabiraCrossroads card) { + super(card); + } + + @Override + public KabiraCrossroads copy() { + return new KabiraCrossroads(this); + } - @Override - public KabiraCrossroads copy() { - return new KabiraCrossroads(this); - } - } diff --git a/Mage.Sets/src/mage/sets/zendikar/KazuulWarlord.java b/Mage.Sets/src/mage/sets/zendikar/KazuulWarlord.java index a2ccdfeb75..348312ef81 100644 --- a/Mage.Sets/src/mage/sets/zendikar/KazuulWarlord.java +++ b/Mage.Sets/src/mage/sets/zendikar/KazuulWarlord.java @@ -50,7 +50,7 @@ public class KazuulWarlord extends CardImpl { static { filter.getSubtype().add("Ally"); - filter.setScopeSubtype(Filter.ComparisonScope.Any); + filter.setScopeSubtype(Filter.ComparisonScope.Any); filter.setTargetController(TargetController.YOU); } diff --git a/Mage.Sets/src/mage/sets/zendikar/KhalniGem.java b/Mage.Sets/src/mage/sets/zendikar/KhalniGem.java index b6419b7252..2ae681bdf0 100644 --- a/Mage.Sets/src/mage/sets/zendikar/KhalniGem.java +++ b/Mage.Sets/src/mage/sets/zendikar/KhalniGem.java @@ -53,26 +53,26 @@ import mage.target.common.TargetControlledPermanent; */ public class KhalniGem extends CardImpl { - private static final FilterControlledPermanent filter; + private static final FilterControlledPermanent filter; - static { - filter = new FilterControlledPermanent("land you control"); - filter.getCardType().add(CardType.LAND); - } + static { + filter = new FilterControlledPermanent("land you control"); + filter.getCardType().add(CardType.LAND); + } public KhalniGem (UUID ownerId) { super(ownerId, 205, "Khalni Gem", Rarity.UNCOMMON, new CardType[]{CardType.ARTIFACT}, "{4}"); this.expansionSetCode = "ZEN"; - + Ability etbAbility = new EntersBattlefieldTriggeredAbility(new KhalniGemReturnToHandTargetEffect()); - Target target = new TargetControlledPermanent(2, 2, filter, false); - etbAbility.addTarget(target); - this.addAbility(etbAbility); - this.addAbility(new SimpleManaAbility(Zone.BATTLEFIELD, new BasicManaEffect(new Mana(2, 0, 0, 0, 0, 0, 0)), new TapSourceCost())); - this.addAbility(new SimpleManaAbility(Zone.BATTLEFIELD, new BasicManaEffect(new Mana(0, 2, 0, 0, 0, 0, 0)), new TapSourceCost())); - this.addAbility(new SimpleManaAbility(Zone.BATTLEFIELD, new BasicManaEffect(new Mana(0, 0, 2, 0, 0, 0, 0)), new TapSourceCost())); - this.addAbility(new SimpleManaAbility(Zone.BATTLEFIELD, new BasicManaEffect(new Mana(0, 0, 0, 2, 0, 0, 0)), new TapSourceCost())); - this.addAbility(new SimpleManaAbility(Zone.BATTLEFIELD, new BasicManaEffect(new Mana(0, 0, 0, 0, 2, 0, 0)), new TapSourceCost())); + Target target = new TargetControlledPermanent(2, 2, filter, false); + etbAbility.addTarget(target); + this.addAbility(etbAbility); + this.addAbility(new SimpleManaAbility(Zone.BATTLEFIELD, new BasicManaEffect(new Mana(2, 0, 0, 0, 0, 0, 0)), new TapSourceCost())); + this.addAbility(new SimpleManaAbility(Zone.BATTLEFIELD, new BasicManaEffect(new Mana(0, 2, 0, 0, 0, 0, 0)), new TapSourceCost())); + this.addAbility(new SimpleManaAbility(Zone.BATTLEFIELD, new BasicManaEffect(new Mana(0, 0, 2, 0, 0, 0, 0)), new TapSourceCost())); + this.addAbility(new SimpleManaAbility(Zone.BATTLEFIELD, new BasicManaEffect(new Mana(0, 0, 0, 2, 0, 0, 0)), new TapSourceCost())); + this.addAbility(new SimpleManaAbility(Zone.BATTLEFIELD, new BasicManaEffect(new Mana(0, 0, 0, 0, 2, 0, 0)), new TapSourceCost())); } public KhalniGem (final KhalniGem card) { @@ -88,31 +88,31 @@ public class KhalniGem extends CardImpl { class KhalniGemReturnToHandTargetEffect extends OneShotEffect { - private static final String effectText = "return two lands you control to their owner's hand"; + private static final String effectText = "return two lands you control to their owner's hand"; - KhalniGemReturnToHandTargetEffect ( ) { - super(Outcome.ReturnToHand); - staticText = effectText; - } + KhalniGemReturnToHandTargetEffect ( ) { + super(Outcome.ReturnToHand); + staticText = effectText; + } - KhalniGemReturnToHandTargetEffect ( KhalniGemReturnToHandTargetEffect effect ) { - super(effect); - } + KhalniGemReturnToHandTargetEffect ( KhalniGemReturnToHandTargetEffect effect ) { + super(effect); + } - @Override - public boolean apply(Game game, Ability source) { - for ( UUID target : targetPointer.getTargets(game, source) ) { - Permanent permanent = game.getPermanent(target); - if ( permanent != null ) { - permanent.moveToZone(Zone.HAND, source.getId(), game, true); - } - } - return true; - } + @Override + public boolean apply(Game game, Ability source) { + for ( UUID target : targetPointer.getTargets(game, source) ) { + Permanent permanent = game.getPermanent(target); + if ( permanent != null ) { + permanent.moveToZone(Zone.HAND, source.getId(), game, true); + } + } + return true; + } - @Override - public KhalniGemReturnToHandTargetEffect copy() { - return new KhalniGemReturnToHandTargetEffect(this); - } + @Override + public KhalniGemReturnToHandTargetEffect copy() { + return new KhalniGemReturnToHandTargetEffect(this); + } } diff --git a/Mage.Sets/src/mage/sets/zendikar/KhalniHeartExpedition.java b/Mage.Sets/src/mage/sets/zendikar/KhalniHeartExpedition.java index faa3d8d0f4..673aab68ec 100644 --- a/Mage.Sets/src/mage/sets/zendikar/KhalniHeartExpedition.java +++ b/Mage.Sets/src/mage/sets/zendikar/KhalniHeartExpedition.java @@ -51,26 +51,26 @@ import mage.target.common.TargetCardInLibrary; */ public class KhalniHeartExpedition extends CardImpl { - public KhalniHeartExpedition(UUID ownerId) { - super(ownerId, 167, "Khalni Heart Expedition", Rarity.COMMON, new CardType[]{CardType.ENCHANTMENT}, "{1}{G}"); - this.expansionSetCode = "ZEN"; - this.color.setGreen(true); + public KhalniHeartExpedition(UUID ownerId) { + super(ownerId, 167, "Khalni Heart Expedition", Rarity.COMMON, new CardType[]{CardType.ENCHANTMENT}, "{1}{G}"); + this.expansionSetCode = "ZEN"; + this.color.setGreen(true); - this.addAbility(new LandfallAbility(new AddCountersSourceEffect(new QuestCounter()), true)); + this.addAbility(new LandfallAbility(new AddCountersSourceEffect(new QuestCounter()), true)); TargetCardInLibrary target = new TargetCardInLibrary(0, 2, new FilterBasicLandCard()); SimpleActivatedAbility ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new SearchLibraryPutInPlayEffect(target, true, Outcome.PutLandInPlay), new RemoveCountersSourceCost(CounterType.QUEST.createInstance(3))); ability.addCost(new SacrificeSourceCost()); this.addAbility(ability); - } + } - public KhalniHeartExpedition(final KhalniHeartExpedition card) { - super(card); - } + public KhalniHeartExpedition(final KhalniHeartExpedition card) { + super(card); + } - @Override - public KhalniHeartExpedition copy() { - return new KhalniHeartExpedition(this); - } + @Override + public KhalniHeartExpedition copy() { + return new KhalniHeartExpedition(this); + } } diff --git a/Mage.Sets/src/mage/sets/zendikar/KorSanctifiers.java b/Mage.Sets/src/mage/sets/zendikar/KorSanctifiers.java index 8f860de1e0..9475b6a8d8 100644 --- a/Mage.Sets/src/mage/sets/zendikar/KorSanctifiers.java +++ b/Mage.Sets/src/mage/sets/zendikar/KorSanctifiers.java @@ -61,7 +61,7 @@ public class KorSanctifiers extends CardImpl { this.expansionSetCode = "ZEN"; this.subtype.add("Kor"); this.subtype.add("Cleric"); - this.color.setWhite(true); + this.color.setWhite(true); this.power = new MageInt(2); this.toughness = new MageInt(3); this.getSpellAbility().addOptionalCost(new KickerManaCost("{W}")); diff --git a/Mage.Sets/src/mage/sets/zendikar/KorSkyfisher.java b/Mage.Sets/src/mage/sets/zendikar/KorSkyfisher.java index feb9849f74..9cbda3d21a 100644 --- a/Mage.Sets/src/mage/sets/zendikar/KorSkyfisher.java +++ b/Mage.Sets/src/mage/sets/zendikar/KorSkyfisher.java @@ -51,14 +51,14 @@ public class KorSkyfisher extends CardImpl { this.expansionSetCode = "ZEN"; this.subtype.add("Kor"); this.subtype.add("Soldier"); - this.color.setWhite(true); + this.color.setWhite(true); this.power = new MageInt(2); this.toughness = new MageInt(3); this.addAbility(FlyingAbility.getInstance()); Ability ability = new EntersBattlefieldTriggeredAbility(new ReturnToHandTargetEffect(), false); - Target target = new TargetControlledPermanent(); - target.setRequired(true); - target.setNotTarget(true); + Target target = new TargetControlledPermanent(); + target.setRequired(true); + target.setNotTarget(true); ability.addTarget(target); this.addAbility(ability); } diff --git a/Mage.Sets/src/mage/sets/zendikar/KrakenHatchling.java b/Mage.Sets/src/mage/sets/zendikar/KrakenHatchling.java index 02234f6052..068a3bcf08 100644 --- a/Mage.Sets/src/mage/sets/zendikar/KrakenHatchling.java +++ b/Mage.Sets/src/mage/sets/zendikar/KrakenHatchling.java @@ -40,23 +40,23 @@ import mage.cards.CardImpl; */ public class KrakenHatchling extends CardImpl { - public KrakenHatchling(UUID ownerId) { - super(ownerId, 50, "Kraken Hatchling", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{U}"); - this.expansionSetCode = "ZEN"; - this.subtype.add("Kraken"); - this.color.setBlue(true); - this.power = new MageInt(0); - this.toughness = new MageInt(4); + public KrakenHatchling(UUID ownerId) { + super(ownerId, 50, "Kraken Hatchling", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{U}"); + this.expansionSetCode = "ZEN"; + this.subtype.add("Kraken"); + this.color.setBlue(true); + this.power = new MageInt(0); + this.toughness = new MageInt(4); - } + } - public KrakenHatchling(final KrakenHatchling card) { - super(card); - } + public KrakenHatchling(final KrakenHatchling card) { + super(card); + } - @Override - public KrakenHatchling copy() { - return new KrakenHatchling(this); - } + @Override + public KrakenHatchling copy() { + return new KrakenHatchling(this); + } } diff --git a/Mage.Sets/src/mage/sets/zendikar/LotusCobra.java b/Mage.Sets/src/mage/sets/zendikar/LotusCobra.java index f9a536e9ba..8e6fee8771 100644 --- a/Mage.Sets/src/mage/sets/zendikar/LotusCobra.java +++ b/Mage.Sets/src/mage/sets/zendikar/LotusCobra.java @@ -43,27 +43,27 @@ import mage.choices.ChoiceColor; */ public class LotusCobra extends CardImpl { - public LotusCobra(UUID ownerId) { - super(ownerId, 168, "Lotus Cobra", Rarity.MYTHIC, new CardType[]{CardType.CREATURE}, "{1}{G}"); - this.expansionSetCode = "ZEN"; - this.subtype.add("Snake"); - - this.color.setGreen(true); - this.power = new MageInt(2); - this.toughness = new MageInt(1); + public LotusCobra(UUID ownerId) { + super(ownerId, 168, "Lotus Cobra", Rarity.MYTHIC, new CardType[]{CardType.CREATURE}, "{1}{G}"); + this.expansionSetCode = "ZEN"; + this.subtype.add("Snake"); - LandfallAbility ability = new LandfallAbility(new AddManaOfAnyColorEffect(), false); - ability.addChoice(new ChoiceColor()); - this.addAbility(ability); - } + this.color.setGreen(true); + this.power = new MageInt(2); + this.toughness = new MageInt(1); - public LotusCobra(final LotusCobra card) { - super(card); - } + LandfallAbility ability = new LandfallAbility(new AddManaOfAnyColorEffect(), false); + ability.addChoice(new ChoiceColor()); + this.addAbility(ability); + } - @Override - public LotusCobra copy() { - return new LotusCobra(this); - } + public LotusCobra(final LotusCobra card) { + super(card); + } + + @Override + public LotusCobra copy() { + return new LotusCobra(this); + } } diff --git a/Mage.Sets/src/mage/sets/zendikar/MakindiShieldmate.java b/Mage.Sets/src/mage/sets/zendikar/MakindiShieldmate.java index f6683436e6..627b428b5c 100644 --- a/Mage.Sets/src/mage/sets/zendikar/MakindiShieldmate.java +++ b/Mage.Sets/src/mage/sets/zendikar/MakindiShieldmate.java @@ -54,7 +54,7 @@ public class MakindiShieldmate extends CardImpl { this.power = new MageInt(0); this.toughness = new MageInt(3); - this.addAbility(DefenderAbility.getInstance()); + this.addAbility(DefenderAbility.getInstance()); this.addAbility(new AllyEntersBattlefieldTriggeredAbility(new AddCountersSourceEffect(CounterType.P1P1.createInstance()), true)); } diff --git a/Mage.Sets/src/mage/sets/zendikar/MarkOfMutiny.java b/Mage.Sets/src/mage/sets/zendikar/MarkOfMutiny.java index 752965e689..7ea43f9dc9 100644 --- a/Mage.Sets/src/mage/sets/zendikar/MarkOfMutiny.java +++ b/Mage.Sets/src/mage/sets/zendikar/MarkOfMutiny.java @@ -50,13 +50,13 @@ public class MarkOfMutiny extends CardImpl { public MarkOfMutiny (UUID ownerId) { super(ownerId, 137, "Mark of Mutiny", Rarity.UNCOMMON, new CardType[]{CardType.SORCERY}, "{2}{R}"); this.expansionSetCode = "ZEN"; - - this.color.setRed(true); - this.getSpellAbility().addTarget(new TargetCreaturePermanent()); + + this.color.setRed(true); + this.getSpellAbility().addTarget(new TargetCreaturePermanent()); this.getSpellAbility().addEffect(new GainControlTargetEffect(Duration.EndOfTurn)); - this.getSpellAbility().addEffect(new AddCountersTargetEffect(new PlusOneCounter())); - this.getSpellAbility().addEffect(new GainAbilityTargetEffect(HasteAbility.getInstance(), Duration.EndOfTurn)); - this.getSpellAbility().addEffect(new UntapTargetEffect()); + this.getSpellAbility().addEffect(new AddCountersTargetEffect(new PlusOneCounter())); + this.getSpellAbility().addEffect(new GainAbilityTargetEffect(HasteAbility.getInstance(), Duration.EndOfTurn)); + this.getSpellAbility().addEffect(new UntapTargetEffect()); } public MarkOfMutiny (final MarkOfMutiny card) { diff --git a/Mage.Sets/src/mage/sets/zendikar/MarshFlats.java b/Mage.Sets/src/mage/sets/zendikar/MarshFlats.java index 12624ff9e6..fbf2b61ecd 100644 --- a/Mage.Sets/src/mage/sets/zendikar/MarshFlats.java +++ b/Mage.Sets/src/mage/sets/zendikar/MarshFlats.java @@ -40,19 +40,19 @@ import mage.cards.CardImpl; */ public class MarshFlats extends CardImpl { - public MarshFlats(UUID ownerId) { - super(ownerId, 219, "Marsh Flats", Rarity.RARE, new CardType[]{CardType.LAND}, null); - this.expansionSetCode = "ZEN"; - this.addAbility(new FetchLandActivatedAbility(new String[] {"Swamp", "Plains"})); - } + public MarshFlats(UUID ownerId) { + super(ownerId, 219, "Marsh Flats", Rarity.RARE, new CardType[]{CardType.LAND}, null); + this.expansionSetCode = "ZEN"; + this.addAbility(new FetchLandActivatedAbility(new String[] {"Swamp", "Plains"})); + } - public MarshFlats(final MarshFlats card) { - super(card); - } + public MarshFlats(final MarshFlats card) { + super(card); + } - @Override - public MarshFlats copy() { - return new MarshFlats(this); - } + @Override + public MarshFlats copy() { + return new MarshFlats(this); + } } diff --git a/Mage.Sets/src/mage/sets/zendikar/MindbreakTrap.java b/Mage.Sets/src/mage/sets/zendikar/MindbreakTrap.java index e3fc0ed647..dbb787ad5c 100644 --- a/Mage.Sets/src/mage/sets/zendikar/MindbreakTrap.java +++ b/Mage.Sets/src/mage/sets/zendikar/MindbreakTrap.java @@ -56,7 +56,7 @@ import mage.watchers.WatcherImpl; public class MindbreakTrap extends CardImpl { private static final FilterSpell filter = new FilterSpell("spell to exile"); - + public MindbreakTrap(UUID ownerId) { super(ownerId, 57, "Mindbreak Trap", Rarity.MYTHIC, new CardType[]{CardType.INSTANT}, "{2}{U}{U}"); this.expansionSetCode = "ZEN"; @@ -172,21 +172,21 @@ class MindbreakEffect extends OneShotEffect{ @Override public boolean apply(Game game, Ability source) { int affectedTargets = 0; - if (targetPointer.getTargets(game, source).size() > 0) { - for (UUID spellId : targetPointer.getTargets(game, source)) { - Spell spell = game.getStack().getSpell(spellId); - if (spell != null) { - spell.moveToExile(null, null, source.getId(), game); - affectedTargets++; - } - } - } - return affectedTargets > 0; + if (targetPointer.getTargets(game, source).size() > 0) { + for (UUID spellId : targetPointer.getTargets(game, source)) { + Spell spell = game.getStack().getSpell(spellId); + if (spell != null) { + spell.moveToExile(null, null, source.getId(), game); + affectedTargets++; + } + } + } + return affectedTargets > 0; } @Override public MindbreakEffect copy() { return new MindbreakEffect(this); } - + } \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/zendikar/MistyRainforest.java b/Mage.Sets/src/mage/sets/zendikar/MistyRainforest.java index a2ca71e338..f7330cdb90 100644 --- a/Mage.Sets/src/mage/sets/zendikar/MistyRainforest.java +++ b/Mage.Sets/src/mage/sets/zendikar/MistyRainforest.java @@ -40,19 +40,19 @@ import mage.cards.CardImpl; */ public class MistyRainforest extends CardImpl { - public MistyRainforest(UUID ownerId) { - super(ownerId, 220, "Misty Rainforest", Rarity.RARE, new CardType[]{CardType.LAND}, null); - this.expansionSetCode = "ZEN"; - this.addAbility(new FetchLandActivatedAbility(new String[] {"Forest", "Island"})); - } + public MistyRainforest(UUID ownerId) { + super(ownerId, 220, "Misty Rainforest", Rarity.RARE, new CardType[]{CardType.LAND}, null); + this.expansionSetCode = "ZEN"; + this.addAbility(new FetchLandActivatedAbility(new String[] {"Forest", "Island"})); + } - public MistyRainforest(final MistyRainforest card) { - super(card); - } + public MistyRainforest(final MistyRainforest card) { + super(card); + } - @Override - public MistyRainforest copy() { - return new MistyRainforest(this); - } + @Override + public MistyRainforest copy() { + return new MistyRainforest(this); + } } diff --git a/Mage.Sets/src/mage/sets/zendikar/Mountain1.java b/Mage.Sets/src/mage/sets/zendikar/Mountain1.java index caf2186865..db56ae4753 100644 --- a/Mage.Sets/src/mage/sets/zendikar/Mountain1.java +++ b/Mage.Sets/src/mage/sets/zendikar/Mountain1.java @@ -36,18 +36,18 @@ import java.util.UUID; */ public class Mountain1 extends mage.cards.basiclands.Mountain { - public Mountain1(UUID ownerId) { - super(ownerId, 242); - this.expansionSetCode = "ZEN"; - } + public Mountain1(UUID ownerId) { + super(ownerId, 242); + this.expansionSetCode = "ZEN"; + } - public Mountain1(final Mountain1 card) { - super(card); - } + public Mountain1(final Mountain1 card) { + super(card); + } - @Override - public Mountain1 copy() { - return new Mountain1(this); - } + @Override + public Mountain1 copy() { + return new Mountain1(this); + } } diff --git a/Mage.Sets/src/mage/sets/zendikar/Mountain2.java b/Mage.Sets/src/mage/sets/zendikar/Mountain2.java index febfd9e070..481fd4a3d5 100644 --- a/Mage.Sets/src/mage/sets/zendikar/Mountain2.java +++ b/Mage.Sets/src/mage/sets/zendikar/Mountain2.java @@ -36,18 +36,18 @@ import java.util.UUID; */ public class Mountain2 extends mage.cards.basiclands.Mountain { - public Mountain2(UUID ownerId) { - super(ownerId, 243); - this.expansionSetCode = "ZEN"; - } + public Mountain2(UUID ownerId) { + super(ownerId, 243); + this.expansionSetCode = "ZEN"; + } - public Mountain2(final Mountain2 card) { - super(card); - } + public Mountain2(final Mountain2 card) { + super(card); + } - @Override - public Mountain2 copy() { - return new Mountain2(this); - } + @Override + public Mountain2 copy() { + return new Mountain2(this); + } } diff --git a/Mage.Sets/src/mage/sets/zendikar/Mountain3.java b/Mage.Sets/src/mage/sets/zendikar/Mountain3.java index 290639247f..84127eee56 100644 --- a/Mage.Sets/src/mage/sets/zendikar/Mountain3.java +++ b/Mage.Sets/src/mage/sets/zendikar/Mountain3.java @@ -36,18 +36,18 @@ import java.util.UUID; */ public class Mountain3 extends mage.cards.basiclands.Mountain { - public Mountain3(UUID ownerId) { - super(ownerId, 244); - this.expansionSetCode = "ZEN"; - } + public Mountain3(UUID ownerId) { + super(ownerId, 244); + this.expansionSetCode = "ZEN"; + } - public Mountain3(final Mountain3 card) { - super(card); - } + public Mountain3(final Mountain3 card) { + super(card); + } - @Override - public Mountain3 copy() { - return new Mountain3(this); - } + @Override + public Mountain3 copy() { + return new Mountain3(this); + } } diff --git a/Mage.Sets/src/mage/sets/zendikar/Mountain4.java b/Mage.Sets/src/mage/sets/zendikar/Mountain4.java index b8c6574b8e..7cc370f32a 100644 --- a/Mage.Sets/src/mage/sets/zendikar/Mountain4.java +++ b/Mage.Sets/src/mage/sets/zendikar/Mountain4.java @@ -36,18 +36,18 @@ import java.util.UUID; */ public class Mountain4 extends mage.cards.basiclands.Mountain { - public Mountain4(UUID ownerId) { - super(ownerId, 245); - this.expansionSetCode = "ZEN"; - } + public Mountain4(UUID ownerId) { + super(ownerId, 245); + this.expansionSetCode = "ZEN"; + } - public Mountain4(final Mountain4 card) { - super(card); - } + public Mountain4(final Mountain4 card) { + super(card); + } - @Override - public Mountain4 copy() { - return new Mountain4(this); - } + @Override + public Mountain4 copy() { + return new Mountain4(this); + } } diff --git a/Mage.Sets/src/mage/sets/zendikar/Mountain5.java b/Mage.Sets/src/mage/sets/zendikar/Mountain5.java index 8a436d09c2..2e071ffcee 100644 --- a/Mage.Sets/src/mage/sets/zendikar/Mountain5.java +++ b/Mage.Sets/src/mage/sets/zendikar/Mountain5.java @@ -36,18 +36,18 @@ import java.util.UUID; */ public class Mountain5 extends mage.cards.basiclands.Mountain { - public Mountain5(UUID ownerId) { - super(ownerId, 262); - this.expansionSetCode = "ZEN"; - } + public Mountain5(UUID ownerId) { + super(ownerId, 262); + this.expansionSetCode = "ZEN"; + } - public Mountain5(final Mountain5 card) { - super(card); - } + public Mountain5(final Mountain5 card) { + super(card); + } - @Override - public Mountain5 copy() { - return new Mountain5(this); - } + @Override + public Mountain5 copy() { + return new Mountain5(this); + } } diff --git a/Mage.Sets/src/mage/sets/zendikar/Mountain6.java b/Mage.Sets/src/mage/sets/zendikar/Mountain6.java index 58c909a5f0..369a6f53fb 100644 --- a/Mage.Sets/src/mage/sets/zendikar/Mountain6.java +++ b/Mage.Sets/src/mage/sets/zendikar/Mountain6.java @@ -36,18 +36,18 @@ import java.util.UUID; */ public class Mountain6 extends mage.cards.basiclands.Mountain { - public Mountain6(UUID ownerId) { - super(ownerId, 263); - this.expansionSetCode = "ZEN"; - } + public Mountain6(UUID ownerId) { + super(ownerId, 263); + this.expansionSetCode = "ZEN"; + } - public Mountain6(final Mountain6 card) { - super(card); - } + public Mountain6(final Mountain6 card) { + super(card); + } - @Override - public Mountain6 copy() { - return new Mountain6(this); - } + @Override + public Mountain6 copy() { + return new Mountain6(this); + } } diff --git a/Mage.Sets/src/mage/sets/zendikar/Mountain7.java b/Mage.Sets/src/mage/sets/zendikar/Mountain7.java index cdf18ecc53..233a7739f3 100644 --- a/Mage.Sets/src/mage/sets/zendikar/Mountain7.java +++ b/Mage.Sets/src/mage/sets/zendikar/Mountain7.java @@ -36,18 +36,18 @@ import java.util.UUID; */ public class Mountain7 extends mage.cards.basiclands.Mountain { - public Mountain7(UUID ownerId) { - super(ownerId, 264); - this.expansionSetCode = "ZEN"; - } + public Mountain7(UUID ownerId) { + super(ownerId, 264); + this.expansionSetCode = "ZEN"; + } - public Mountain7(final Mountain7 card) { - super(card); - } + public Mountain7(final Mountain7 card) { + super(card); + } - @Override - public Mountain7 copy() { - return new Mountain7(this); - } + @Override + public Mountain7 copy() { + return new Mountain7(this); + } } diff --git a/Mage.Sets/src/mage/sets/zendikar/Mountain8.java b/Mage.Sets/src/mage/sets/zendikar/Mountain8.java index fcb084d929..373a138adc 100644 --- a/Mage.Sets/src/mage/sets/zendikar/Mountain8.java +++ b/Mage.Sets/src/mage/sets/zendikar/Mountain8.java @@ -36,18 +36,18 @@ import java.util.UUID; */ public class Mountain8 extends mage.cards.basiclands.Mountain { - public Mountain8(UUID ownerId) { - super(ownerId, 265); - this.expansionSetCode = "ZEN"; - } + public Mountain8(UUID ownerId) { + super(ownerId, 265); + this.expansionSetCode = "ZEN"; + } - public Mountain8(final Mountain8 card) { - super(card); - } + public Mountain8(final Mountain8 card) { + super(card); + } - @Override - public Mountain8 copy() { - return new Mountain8(this); - } + @Override + public Mountain8 copy() { + return new Mountain8(this); + } } diff --git a/Mage.Sets/src/mage/sets/zendikar/MurasaPyromancer.java b/Mage.Sets/src/mage/sets/zendikar/MurasaPyromancer.java index 46dc69a42a..5fd84a5a5e 100644 --- a/Mage.Sets/src/mage/sets/zendikar/MurasaPyromancer.java +++ b/Mage.Sets/src/mage/sets/zendikar/MurasaPyromancer.java @@ -52,8 +52,8 @@ public class MurasaPyromancer extends CardImpl { static { filter.getSubtype().add("Ally"); - filter.setScopeSubtype(Filter.ComparisonScope.Any); - filter.setTargetController(Constants.TargetController.YOU); + filter.setScopeSubtype(Filter.ComparisonScope.Any); + filter.setTargetController(Constants.TargetController.YOU); } public MurasaPyromancer(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/zendikar/NissaRevane.java b/Mage.Sets/src/mage/sets/zendikar/NissaRevane.java index a0f0ba471b..314824098f 100644 --- a/Mage.Sets/src/mage/sets/zendikar/NissaRevane.java +++ b/Mage.Sets/src/mage/sets/zendikar/NissaRevane.java @@ -51,74 +51,74 @@ import mage.target.common.TargetCardInLibrary; */ public class NissaRevane extends CardImpl { - private static final FilterCard nissasChosenFilter = new FilterCard(); - private static final FilterCard elfFilter = new FilterCard(); + private static final FilterCard nissasChosenFilter = new FilterCard(); + private static final FilterCard elfFilter = new FilterCard(); - static { - nissasChosenFilter.getName().add("Nissa's Chosen"); - nissasChosenFilter.setMessage("card named Nissa's Chosen"); - elfFilter.getSubtype().add("Elf"); - elfFilter.setMessage("Elf creature cards"); - } + static { + nissasChosenFilter.getName().add("Nissa's Chosen"); + nissasChosenFilter.setMessage("card named Nissa's Chosen"); + elfFilter.getSubtype().add("Elf"); + elfFilter.setMessage("Elf creature cards"); + } - public NissaRevane(UUID ownerId) { - super(ownerId, 170, "Nissa Revane", Rarity.MYTHIC, new CardType[]{ CardType.PLANESWALKER }, "{2}{G}{G}"); - this.expansionSetCode = "ZEN"; - this.subtype.add("Nissa"); - this.addAbility(new EntersBattlefieldAbility(new AddCountersSourceEffect(CounterType.LOYALTY.createInstance(2)), "")); + public NissaRevane(UUID ownerId) { + super(ownerId, 170, "Nissa Revane", Rarity.MYTHIC, new CardType[]{ CardType.PLANESWALKER }, "{2}{G}{G}"); + this.expansionSetCode = "ZEN"; + this.subtype.add("Nissa"); + this.addAbility(new EntersBattlefieldAbility(new AddCountersSourceEffect(CounterType.LOYALTY.createInstance(2)), "")); - this.color.setGreen(true); + this.color.setGreen(true); - LoyaltyAbility ability1 = new LoyaltyAbility(new SearchLibraryPutInPlayEffect(new TargetCardInLibrary(1, nissasChosenFilter)), 1); - this.addAbility(ability1); + LoyaltyAbility ability1 = new LoyaltyAbility(new SearchLibraryPutInPlayEffect(new TargetCardInLibrary(1, nissasChosenFilter)), 1); + this.addAbility(ability1); - LoyaltyAbility ability2 = new LoyaltyAbility(new NissaRevaneGainLifeEffect(), 1); - this.addAbility(ability2); + LoyaltyAbility ability2 = new LoyaltyAbility(new NissaRevaneGainLifeEffect(), 1); + this.addAbility(ability2); - LoyaltyAbility ability3 = new LoyaltyAbility(new SearchLibraryPutInPlayEffect(new TargetCardInLibrary(0, Integer.MAX_VALUE, elfFilter)), -7); - this.addAbility(ability3); - } + LoyaltyAbility ability3 = new LoyaltyAbility(new SearchLibraryPutInPlayEffect(new TargetCardInLibrary(0, Integer.MAX_VALUE, elfFilter)), -7); + this.addAbility(ability3); + } - public NissaRevane(final NissaRevane card) { - super(card); - } + public NissaRevane(final NissaRevane card) { + super(card); + } - @Override - public NissaRevane copy() { - return new NissaRevane(this); - } + @Override + public NissaRevane copy() { + return new NissaRevane(this); + } } class NissaRevaneGainLifeEffect extends OneShotEffect { - private static final FilterControlledCreaturePermanent filter = new FilterControlledCreaturePermanent(); + private static final FilterControlledCreaturePermanent filter = new FilterControlledCreaturePermanent(); - static { - filter.getSubtype().add("Elf"); - } + static { + filter.getSubtype().add("Elf"); + } - public NissaRevaneGainLifeEffect() { - super(Outcome.GainLife); - staticText = "You gain 2 life for each Elf you control"; - } + public NissaRevaneGainLifeEffect() { + super(Outcome.GainLife); + staticText = "You gain 2 life for each Elf you control"; + } - public NissaRevaneGainLifeEffect(final NissaRevaneGainLifeEffect effect) { - super(effect); - } + public NissaRevaneGainLifeEffect(final NissaRevaneGainLifeEffect effect) { + super(effect); + } - @Override - public NissaRevaneGainLifeEffect copy() { - return new NissaRevaneGainLifeEffect(this); - } + @Override + public NissaRevaneGainLifeEffect copy() { + return new NissaRevaneGainLifeEffect(this); + } - @Override - public boolean apply(Game game, Ability source) { - Player player = game.getPlayer(source.getControllerId()); - int life = 2 * game.getBattlefield().countAll(filter, game); - if (player != null) { - player.gainLife(life, game); - } - return true; - } + @Override + public boolean apply(Game game, Ability source) { + Player player = game.getPlayer(source.getControllerId()); + int life = 2 * game.getBattlefield().countAll(filter, game); + if (player != null) { + player.gainLife(life, game); + } + return true; + } } diff --git a/Mage.Sets/src/mage/sets/zendikar/NissasChosen.java b/Mage.Sets/src/mage/sets/zendikar/NissasChosen.java index f42363abb1..2e0eb1e502 100644 --- a/Mage.Sets/src/mage/sets/zendikar/NissasChosen.java +++ b/Mage.Sets/src/mage/sets/zendikar/NissasChosen.java @@ -50,72 +50,72 @@ import mage.game.events.ZoneChangeEvent; */ public class NissasChosen extends CardImpl { - public NissasChosen(UUID ownerId) { - super(ownerId, 171, "Nissa's Chosen", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{G}{G}"); - this.expansionSetCode = "ZEN"; - this.subtype.add("Elf"); - this.subtype.add("Warrior"); + public NissasChosen(UUID ownerId) { + super(ownerId, 171, "Nissa's Chosen", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{G}{G}"); + this.expansionSetCode = "ZEN"; + this.subtype.add("Elf"); + this.subtype.add("Warrior"); - this.color.setGreen(true); - this.power = new MageInt(2); - this.toughness = new MageInt(3); + this.color.setGreen(true); + this.power = new MageInt(2); + this.toughness = new MageInt(3); - this.addAbility(new SimpleStaticAbility(Zone.ALL, new NissasChosenEffect())); - } + this.addAbility(new SimpleStaticAbility(Zone.ALL, new NissasChosenEffect())); + } - public NissasChosen(final NissasChosen card) { - super(card); - } + public NissasChosen(final NissasChosen card) { + super(card); + } - @Override - public NissasChosen copy() { - return new NissasChosen(this); - } + @Override + public NissasChosen copy() { + return new NissasChosen(this); + } } class NissasChosenEffect extends ReplacementEffectImpl { - boolean onTop = false; + boolean onTop = false; - public NissasChosenEffect() { - super(Duration.WhileOnBattlefield, Outcome.Benefit); - staticText = "If {this} would be put into a graveyard from the battlefield, put it on the bottom of its owner's library instead"; - } + public NissasChosenEffect() { + super(Duration.WhileOnBattlefield, Outcome.Benefit); + staticText = "If {this} would be put into a graveyard from the battlefield, put it on the bottom of its owner's library instead"; + } - public NissasChosenEffect(final NissasChosenEffect effect) { - super(effect); - this.onTop = effect.onTop; - } + public NissasChosenEffect(final NissasChosenEffect effect) { + super(effect); + this.onTop = effect.onTop; + } - @Override - public NissasChosenEffect copy() { - return new NissasChosenEffect(this); - } + @Override + public NissasChosenEffect copy() { + return new NissasChosenEffect(this); + } - @Override - public boolean apply(Game game, Ability source) { - return false; - } + @Override + public boolean apply(Game game, Ability source) { + return false; + } - @Override - public boolean replaceEvent(GameEvent event, Ability source, Game game) { - Card card = game.getCard(event.getTargetId()); - if ( card != null && event.getTargetId().equals(source.getSourceId()) ) { - return card.moveToZone(Zone.LIBRARY, source.getId(), game, onTop); - } - return false; - } + @Override + public boolean replaceEvent(GameEvent event, Ability source, Game game) { + Card card = game.getCard(event.getTargetId()); + if ( card != null && event.getTargetId().equals(source.getSourceId()) ) { + return card.moveToZone(Zone.LIBRARY, source.getId(), game, onTop); + } + return false; + } - @Override - public boolean applies(GameEvent event, Ability source, Game game) { - if ( event.getType() == EventType.ZONE_CHANGE ) - { + @Override + public boolean applies(GameEvent event, Ability source, Game game) { + if ( event.getType() == EventType.ZONE_CHANGE ) + { ZoneChangeEvent zEvent = (ZoneChangeEvent)event; if ( zEvent.getFromZone() == Zone.BATTLEFIELD && zEvent.getToZone() == Zone.GRAVEYARD ) { return true; } - } - return false; - } + } + return false; + } } \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/zendikar/ObNixilisTheFallen.java b/Mage.Sets/src/mage/sets/zendikar/ObNixilisTheFallen.java index f28f762115..54f2f05e91 100644 --- a/Mage.Sets/src/mage/sets/zendikar/ObNixilisTheFallen.java +++ b/Mage.Sets/src/mage/sets/zendikar/ObNixilisTheFallen.java @@ -50,7 +50,7 @@ public class ObNixilisTheFallen extends CardImpl { public ObNixilisTheFallen (UUID ownerId) { super(ownerId, 107, "Ob Nixilis, the Fallen", Rarity.MYTHIC, new CardType[]{CardType.CREATURE}, "{3}{B}{B}"); this.expansionSetCode = "ZEN"; - this.supertype.add("Legendary"); + this.supertype.add("Legendary"); this.subtype.add("Demon"); this.color.setBlack(true); this.power = new MageInt(3); diff --git a/Mage.Sets/src/mage/sets/zendikar/OnduCleric.java b/Mage.Sets/src/mage/sets/zendikar/OnduCleric.java index 8fc394fcf5..0218a187ee 100644 --- a/Mage.Sets/src/mage/sets/zendikar/OnduCleric.java +++ b/Mage.Sets/src/mage/sets/zendikar/OnduCleric.java @@ -50,8 +50,8 @@ public class OnduCleric extends CardImpl { static { filter.getSubtype().add("Ally"); - filter.setScopeSubtype(Filter.ComparisonScope.Any); - filter.setTargetController(Constants.TargetController.YOU); + filter.setScopeSubtype(Filter.ComparisonScope.Any); + filter.setTargetController(Constants.TargetController.YOU); } public OnduCleric(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/zendikar/OracleOfMulDaya.java b/Mage.Sets/src/mage/sets/zendikar/OracleOfMulDaya.java index cf1c812844..bc8de67d90 100644 --- a/Mage.Sets/src/mage/sets/zendikar/OracleOfMulDaya.java +++ b/Mage.Sets/src/mage/sets/zendikar/OracleOfMulDaya.java @@ -54,59 +54,59 @@ import java.util.UUID; */ public class OracleOfMulDaya extends CardImpl { - public OracleOfMulDaya(UUID ownerId) { - super(ownerId, 172, "Oracle of Mul Daya", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{3}{G}"); - this.expansionSetCode = "ZEN"; - this.subtype.add("Elf"); - this.subtype.add("Shaman"); - this.color.setGreen(true); + public OracleOfMulDaya(UUID ownerId) { + super(ownerId, 172, "Oracle of Mul Daya", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{3}{G}"); + this.expansionSetCode = "ZEN"; + this.subtype.add("Elf"); + this.subtype.add("Shaman"); + this.color.setGreen(true); - this.power = new MageInt(2); - this.toughness = new MageInt(2); + this.power = new MageInt(2); + this.toughness = new MageInt(2); - // You may play an additional land on each of your turns. - this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new OracleOfMulDayaEffect1())); - // Play with the top card of your library revealed. - this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new PlayWithTheTopCardRevealedEffect())); - // You may play the top card of your library if it's a land card. - this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new PlayTheTopCardEffect(new FilterLandCard()))); - } + // You may play an additional land on each of your turns. + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new OracleOfMulDayaEffect1())); + // Play with the top card of your library revealed. + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new PlayWithTheTopCardRevealedEffect())); + // You may play the top card of your library if it's a land card. + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new PlayTheTopCardEffect(new FilterLandCard()))); + } - public OracleOfMulDaya(final OracleOfMulDaya card) { - super(card); - } + public OracleOfMulDaya(final OracleOfMulDaya card) { + super(card); + } - @Override - public OracleOfMulDaya copy() { - return new OracleOfMulDaya(this); - } + @Override + public OracleOfMulDaya copy() { + return new OracleOfMulDaya(this); + } } class OracleOfMulDayaEffect1 extends ContinuousEffectImpl { - public OracleOfMulDayaEffect1() { - super(Duration.WhileOnBattlefield, Layer.PlayerEffects, SubLayer.NA, Outcome.PutLandInPlay); - staticText = "You may play an additional land on each of your turns"; - } + public OracleOfMulDayaEffect1() { + super(Duration.WhileOnBattlefield, Layer.PlayerEffects, SubLayer.NA, Outcome.PutLandInPlay); + staticText = "You may play an additional land on each of your turns"; + } - public OracleOfMulDayaEffect1(final OracleOfMulDayaEffect1 effect) { - super(effect); - } + public OracleOfMulDayaEffect1(final OracleOfMulDayaEffect1 effect) { + super(effect); + } - @Override - public boolean apply(Game game, Ability source) { - Player player = game.getPlayer(source.getControllerId()); - if (player != null) { - player.setLandsPerTurn(player.getLandsPerTurn() + 1); - return true; - } - return false; - } + @Override + public boolean apply(Game game, Ability source) { + Player player = game.getPlayer(source.getControllerId()); + if (player != null) { + player.setLandsPerTurn(player.getLandsPerTurn() + 1); + return true; + } + return false; + } - @Override - public OracleOfMulDayaEffect1 copy() { - return new OracleOfMulDayaEffect1(this); - } + @Override + public OracleOfMulDayaEffect1 copy() { + return new OracleOfMulDayaEffect1(this); + } } \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/zendikar/OranRiefTheVastwood.java b/Mage.Sets/src/mage/sets/zendikar/OranRiefTheVastwood.java index e6966e108a..dce09d577a 100644 --- a/Mage.Sets/src/mage/sets/zendikar/OranRiefTheVastwood.java +++ b/Mage.Sets/src/mage/sets/zendikar/OranRiefTheVastwood.java @@ -52,54 +52,54 @@ import mage.game.permanent.Permanent; */ public class OranRiefTheVastwood extends CardImpl { - public OranRiefTheVastwood(UUID ownerId) { - super(ownerId, 221, "Oran-Rief, the Vastwood", Rarity.RARE, new CardType[]{CardType.LAND}, null); - this.expansionSetCode = "ZEN"; - this.addAbility(new EntersBattlefieldTappedAbility()); - this.addAbility(new GreenManaAbility()); - this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new OranRiefTheVastwoodEffect(), new TapSourceCost())); - } + public OranRiefTheVastwood(UUID ownerId) { + super(ownerId, 221, "Oran-Rief, the Vastwood", Rarity.RARE, new CardType[]{CardType.LAND}, null); + this.expansionSetCode = "ZEN"; + this.addAbility(new EntersBattlefieldTappedAbility()); + this.addAbility(new GreenManaAbility()); + this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new OranRiefTheVastwoodEffect(), new TapSourceCost())); + } - public OranRiefTheVastwood(final OranRiefTheVastwood card) { - super(card); - } + public OranRiefTheVastwood(final OranRiefTheVastwood card) { + super(card); + } - @Override - public OranRiefTheVastwood copy() { - return new OranRiefTheVastwood(this); - } + @Override + public OranRiefTheVastwood copy() { + return new OranRiefTheVastwood(this); + } } class OranRiefTheVastwoodEffect extends OneShotEffect { - public OranRiefTheVastwoodEffect() { - super(Outcome.BoostCreature); - staticText = "Put a +1/+1 counter on each green creature that entered the battlefield this turn"; - } + public OranRiefTheVastwoodEffect() { + super(Outcome.BoostCreature); + staticText = "Put a +1/+1 counter on each green creature that entered the battlefield this turn"; + } - public OranRiefTheVastwoodEffect(final OranRiefTheVastwoodEffect effect) { - super(effect); - } + public OranRiefTheVastwoodEffect(final OranRiefTheVastwoodEffect effect) { + super(effect); + } - @Override - public OranRiefTheVastwoodEffect copy() { - return new OranRiefTheVastwoodEffect(this); - } + @Override + public OranRiefTheVastwoodEffect copy() { + return new OranRiefTheVastwoodEffect(this); + } - @Override - public boolean apply(Game game, Ability source) { - FilterPermanent filter = new FilterPermanent(); - filter.getCardType().add(CardType.CREATURE); - filter.getColor().setGreen(true); + @Override + public boolean apply(Game game, Ability source) { + FilterPermanent filter = new FilterPermanent(); + filter.getCardType().add(CardType.CREATURE); + filter.getColor().setGreen(true); filter.setScopeColor(Filter.ComparisonScope.Any); - filter.setUseColor(true); - for (Permanent permanent: game.getBattlefield().getActivePermanents(filter, source.getControllerId(), game)) { - if (permanent.getTurnsOnBattlefield() == 0) { - permanent.addCounters(CounterType.P1P1.createInstance(), game); - } - } - return true; - } + filter.setUseColor(true); + for (Permanent permanent: game.getBattlefield().getActivePermanents(filter, source.getControllerId(), game)) { + if (permanent.getTurnsOnBattlefield() == 0) { + permanent.addCounters(CounterType.P1P1.createInstance(), game); + } + } + return true; + } } \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/zendikar/Plains1.java b/Mage.Sets/src/mage/sets/zendikar/Plains1.java index 8c00153ac2..54057b9cd0 100644 --- a/Mage.Sets/src/mage/sets/zendikar/Plains1.java +++ b/Mage.Sets/src/mage/sets/zendikar/Plains1.java @@ -36,18 +36,18 @@ import java.util.UUID; */ public class Plains1 extends mage.cards.basiclands.Plains { - public Plains1(UUID ownerId) { - super(ownerId, 230); - this.expansionSetCode = "ZEN"; - } + public Plains1(UUID ownerId) { + super(ownerId, 230); + this.expansionSetCode = "ZEN"; + } - public Plains1(final Plains1 card) { - super(card); - } + public Plains1(final Plains1 card) { + super(card); + } - @Override - public Plains1 copy() { - return new Plains1(this); - } + @Override + public Plains1 copy() { + return new Plains1(this); + } } diff --git a/Mage.Sets/src/mage/sets/zendikar/Plains2.java b/Mage.Sets/src/mage/sets/zendikar/Plains2.java index 89b8b65903..4411aa944f 100644 --- a/Mage.Sets/src/mage/sets/zendikar/Plains2.java +++ b/Mage.Sets/src/mage/sets/zendikar/Plains2.java @@ -36,18 +36,18 @@ import java.util.UUID; */ public class Plains2 extends mage.cards.basiclands.Plains { - public Plains2(UUID ownerId) { - super(ownerId, 231); - this.expansionSetCode = "ZEN"; - } + public Plains2(UUID ownerId) { + super(ownerId, 231); + this.expansionSetCode = "ZEN"; + } - public Plains2(final Plains2 card) { - super(card); - } + public Plains2(final Plains2 card) { + super(card); + } - @Override - public Plains2 copy() { - return new Plains2(this); - } + @Override + public Plains2 copy() { + return new Plains2(this); + } } diff --git a/Mage.Sets/src/mage/sets/zendikar/Plains3.java b/Mage.Sets/src/mage/sets/zendikar/Plains3.java index b541bf5547..61dcf9a75c 100644 --- a/Mage.Sets/src/mage/sets/zendikar/Plains3.java +++ b/Mage.Sets/src/mage/sets/zendikar/Plains3.java @@ -36,18 +36,18 @@ import java.util.UUID; */ public class Plains3 extends mage.cards.basiclands.Plains { - public Plains3(UUID ownerId) { - super(ownerId, 232); - this.expansionSetCode = "ZEN"; - } + public Plains3(UUID ownerId) { + super(ownerId, 232); + this.expansionSetCode = "ZEN"; + } - public Plains3(final Plains3 card) { - super(card); - } + public Plains3(final Plains3 card) { + super(card); + } - @Override - public Plains3 copy() { - return new Plains3(this); - } + @Override + public Plains3 copy() { + return new Plains3(this); + } } diff --git a/Mage.Sets/src/mage/sets/zendikar/Plains4.java b/Mage.Sets/src/mage/sets/zendikar/Plains4.java index 4525d3de6f..550a872419 100644 --- a/Mage.Sets/src/mage/sets/zendikar/Plains4.java +++ b/Mage.Sets/src/mage/sets/zendikar/Plains4.java @@ -36,18 +36,18 @@ import java.util.UUID; */ public class Plains4 extends mage.cards.basiclands.Plains { - public Plains4(UUID ownerId) { - super(ownerId, 233); - this.expansionSetCode = "ZEN"; - } + public Plains4(UUID ownerId) { + super(ownerId, 233); + this.expansionSetCode = "ZEN"; + } - public Plains4(final Plains4 card) { - super(card); - } + public Plains4(final Plains4 card) { + super(card); + } - @Override - public Plains4 copy() { - return new Plains4(this); - } + @Override + public Plains4 copy() { + return new Plains4(this); + } } diff --git a/Mage.Sets/src/mage/sets/zendikar/Plains5.java b/Mage.Sets/src/mage/sets/zendikar/Plains5.java index 26e446ca93..238a21899c 100644 --- a/Mage.Sets/src/mage/sets/zendikar/Plains5.java +++ b/Mage.Sets/src/mage/sets/zendikar/Plains5.java @@ -36,18 +36,18 @@ import java.util.UUID; */ public class Plains5 extends mage.cards.basiclands.Plains { - public Plains5(UUID ownerId) { - super(ownerId, 250); - this.expansionSetCode = "ZEN"; - } + public Plains5(UUID ownerId) { + super(ownerId, 250); + this.expansionSetCode = "ZEN"; + } - public Plains5(final Plains5 card) { - super(card); - } + public Plains5(final Plains5 card) { + super(card); + } - @Override - public Plains5 copy() { - return new Plains5(this); - } + @Override + public Plains5 copy() { + return new Plains5(this); + } } diff --git a/Mage.Sets/src/mage/sets/zendikar/Plains6.java b/Mage.Sets/src/mage/sets/zendikar/Plains6.java index 6c4ab4e5a8..830ef28fff 100644 --- a/Mage.Sets/src/mage/sets/zendikar/Plains6.java +++ b/Mage.Sets/src/mage/sets/zendikar/Plains6.java @@ -36,18 +36,18 @@ import java.util.UUID; */ public class Plains6 extends mage.cards.basiclands.Plains { - public Plains6(UUID ownerId) { - super(ownerId, 251); - this.expansionSetCode = "ZEN"; - } + public Plains6(UUID ownerId) { + super(ownerId, 251); + this.expansionSetCode = "ZEN"; + } - public Plains6(final Plains6 card) { - super(card); - } + public Plains6(final Plains6 card) { + super(card); + } - @Override - public Plains6 copy() { - return new Plains6(this); - } + @Override + public Plains6 copy() { + return new Plains6(this); + } } diff --git a/Mage.Sets/src/mage/sets/zendikar/Plains7.java b/Mage.Sets/src/mage/sets/zendikar/Plains7.java index 4f77ef8eec..c5bfc4813f 100644 --- a/Mage.Sets/src/mage/sets/zendikar/Plains7.java +++ b/Mage.Sets/src/mage/sets/zendikar/Plains7.java @@ -36,18 +36,18 @@ import java.util.UUID; */ public class Plains7 extends mage.cards.basiclands.Plains { - public Plains7(UUID ownerId) { - super(ownerId, 252); - this.expansionSetCode = "ZEN"; - } + public Plains7(UUID ownerId) { + super(ownerId, 252); + this.expansionSetCode = "ZEN"; + } - public Plains7(final Plains7 card) { - super(card); - } + public Plains7(final Plains7 card) { + super(card); + } - @Override - public Plains7 copy() { - return new Plains7(this); - } + @Override + public Plains7 copy() { + return new Plains7(this); + } } diff --git a/Mage.Sets/src/mage/sets/zendikar/Plains8.java b/Mage.Sets/src/mage/sets/zendikar/Plains8.java index 0f824093c7..d206c13782 100644 --- a/Mage.Sets/src/mage/sets/zendikar/Plains8.java +++ b/Mage.Sets/src/mage/sets/zendikar/Plains8.java @@ -36,18 +36,18 @@ import java.util.UUID; */ public class Plains8 extends mage.cards.basiclands.Plains { - public Plains8(UUID ownerId) { - super(ownerId, 253); - this.expansionSetCode = "ZEN"; - } + public Plains8(UUID ownerId) { + super(ownerId, 253); + this.expansionSetCode = "ZEN"; + } - public Plains8(final Plains8 card) { - super(card); - } + public Plains8(final Plains8 card) { + super(card); + } - @Override - public Plains8 copy() { - return new Plains8(this); - } + @Override + public Plains8 copy() { + return new Plains8(this); + } } diff --git a/Mage.Sets/src/mage/sets/zendikar/PlatedGeopede.java b/Mage.Sets/src/mage/sets/zendikar/PlatedGeopede.java index 825b5c024e..e3c9440c98 100644 --- a/Mage.Sets/src/mage/sets/zendikar/PlatedGeopede.java +++ b/Mage.Sets/src/mage/sets/zendikar/PlatedGeopede.java @@ -48,7 +48,7 @@ public class PlatedGeopede extends CardImpl { super(ownerId, 141, "Plated Geopede", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{1}{R}"); this.expansionSetCode = "ZEN"; this.subtype.add("Insect"); - this.color.setRed(true); + this.color.setRed(true); this.power = new MageInt(1); this.toughness = new MageInt(1); this.addAbility(FirstStrikeAbility.getInstance()); diff --git a/Mage.Sets/src/mage/sets/zendikar/PrimalBellow.java b/Mage.Sets/src/mage/sets/zendikar/PrimalBellow.java index 6f1614b18c..4658bf29d0 100644 --- a/Mage.Sets/src/mage/sets/zendikar/PrimalBellow.java +++ b/Mage.Sets/src/mage/sets/zendikar/PrimalBellow.java @@ -49,7 +49,7 @@ public class PrimalBellow extends CardImpl { static { filter.getSubtype().add("Forest"); filter.setTargetController(TargetController.YOU); - + } public PrimalBellow(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/zendikar/PyromancerAscension.java b/Mage.Sets/src/mage/sets/zendikar/PyromancerAscension.java index eb30e1b163..40f91dc442 100644 --- a/Mage.Sets/src/mage/sets/zendikar/PyromancerAscension.java +++ b/Mage.Sets/src/mage/sets/zendikar/PyromancerAscension.java @@ -52,121 +52,121 @@ import mage.target.TargetSpell; * @author nantuko */ public class PyromancerAscension extends CardImpl { - - public PyromancerAscension(UUID ownerId) { - super(ownerId, 143, "Pyromancer Ascension", Rarity.RARE, new CardType[] { CardType.ENCHANTMENT }, "{1}{R}"); - this.expansionSetCode = "ZEN"; - this.color.setRed(true); - this.addAbility(new PyromancerAscensionQuestTriggeredAbility()); - this.addAbility(new PyromancerAscensionCopyTriggeredAbility()); - } - public PyromancerAscension(final PyromancerAscension card) { - super(card); - } + public PyromancerAscension(UUID ownerId) { + super(ownerId, 143, "Pyromancer Ascension", Rarity.RARE, new CardType[] { CardType.ENCHANTMENT }, "{1}{R}"); + this.expansionSetCode = "ZEN"; + this.color.setRed(true); + this.addAbility(new PyromancerAscensionQuestTriggeredAbility()); + this.addAbility(new PyromancerAscensionCopyTriggeredAbility()); + } - @Override - public PyromancerAscension copy() { - return new PyromancerAscension(this); - } + public PyromancerAscension(final PyromancerAscension card) { + super(card); + } + + @Override + public PyromancerAscension copy() { + return new PyromancerAscension(this); + } } class PyromancerAscensionQuestTriggeredAbility extends TriggeredAbilityImpl { - - PyromancerAscensionQuestTriggeredAbility() { - super(Constants.Zone.BATTLEFIELD, new AddCountersSourceEffect(CounterType.QUEST.createInstance()), true); - } - PyromancerAscensionQuestTriggeredAbility(final PyromancerAscensionQuestTriggeredAbility ability) { - super(ability); - } + PyromancerAscensionQuestTriggeredAbility() { + super(Constants.Zone.BATTLEFIELD, new AddCountersSourceEffect(CounterType.QUEST.createInstance()), true); + } - @Override - public PyromancerAscensionQuestTriggeredAbility copy() { - return new PyromancerAscensionQuestTriggeredAbility(this); - } + PyromancerAscensionQuestTriggeredAbility(final PyromancerAscensionQuestTriggeredAbility ability) { + super(ability); + } - @Override - public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == GameEvent.EventType.SPELL_CAST && event.getPlayerId().equals(this.getControllerId())) { - Spell spell = game.getStack().getSpell(event.getTargetId()); - if (isControlledInstantOrSorcery(spell)) { - Card sourceCard = game.getCard(spell.getSourceId()); - if (sourceCard != null) { - for (UUID uuid : game.getPlayer(this.getControllerId()).getGraveyard()) { - if (!uuid.equals(sourceCard.getId())) { - Card card = game.getCard(uuid); - if (card != null && card.getName().equals(sourceCard.getName())) { - return true; - } - } - } - } - } - } - return false; - } - - private boolean isControlledInstantOrSorcery(Spell spell) { - return spell != null && - (spell.getControllerId().equals(this.getControllerId())) && - (spell.getCardType().contains(CardType.INSTANT) || spell.getCardType().contains(CardType.SORCERY)); - } + @Override + public PyromancerAscensionQuestTriggeredAbility copy() { + return new PyromancerAscensionQuestTriggeredAbility(this); + } - @Override - public String getRule() { - return "Whenever you cast an instant or sorcery spell that has the same name as a card in your graveyard, you may put a quest counter on {this}."; - } + @Override + public boolean checkTrigger(GameEvent event, Game game) { + if (event.getType() == GameEvent.EventType.SPELL_CAST && event.getPlayerId().equals(this.getControllerId())) { + Spell spell = game.getStack().getSpell(event.getTargetId()); + if (isControlledInstantOrSorcery(spell)) { + Card sourceCard = game.getCard(spell.getSourceId()); + if (sourceCard != null) { + for (UUID uuid : game.getPlayer(this.getControllerId()).getGraveyard()) { + if (!uuid.equals(sourceCard.getId())) { + Card card = game.getCard(uuid); + if (card != null && card.getName().equals(sourceCard.getName())) { + return true; + } + } + } + } + } + } + return false; + } + + private boolean isControlledInstantOrSorcery(Spell spell) { + return spell != null && + (spell.getControllerId().equals(this.getControllerId())) && + (spell.getCardType().contains(CardType.INSTANT) || spell.getCardType().contains(CardType.SORCERY)); + } + + @Override + public String getRule() { + return "Whenever you cast an instant or sorcery spell that has the same name as a card in your graveyard, you may put a quest counter on {this}."; + } } class PyromancerAscensionCopyTriggeredAbility extends TriggeredAbilityImpl { - - private static FilterSpell filter = new FilterSpell(); - - static { - filter.getCardType().add(CardType.INSTANT); - filter.getCardType().add(CardType.SORCERY); - filter.setScopeCardType(ComparisonScope.Any); - } - - PyromancerAscensionCopyTriggeredAbility() { - super(Constants.Zone.BATTLEFIELD, new CopyTargetSpellEffect(), true); - this.addTarget(new TargetSpell(filter)); - } - PyromancerAscensionCopyTriggeredAbility(final PyromancerAscensionCopyTriggeredAbility ability) { - super(ability); - } + private static FilterSpell filter = new FilterSpell(); - @Override - public PyromancerAscensionCopyTriggeredAbility copy() { - return new PyromancerAscensionCopyTriggeredAbility(this); - } + static { + filter.getCardType().add(CardType.INSTANT); + filter.getCardType().add(CardType.SORCERY); + filter.setScopeCardType(ComparisonScope.Any); + } - @Override - public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == GameEvent.EventType.SPELL_CAST && event.getPlayerId().equals(this.getControllerId())) { - Spell spell = game.getStack().getSpell(event.getTargetId()); - if (isControlledInstantOrSorcery(spell)) { - Permanent permanent = game.getBattlefield().getPermanent(this.getSourceId()); - if (permanent != null && permanent.getCounters().getCount(CounterType.QUEST) >= 2) { - this.getTargets().get(0).add(spell.getId(), game); - return true; - } - } - } - return false; - } - - private boolean isControlledInstantOrSorcery(Spell spell) { - return spell != null && - (spell.getControllerId().equals(this.getControllerId())) && - (spell.getCardType().contains(CardType.INSTANT) || spell.getCardType().contains(CardType.SORCERY)); - } + PyromancerAscensionCopyTriggeredAbility() { + super(Constants.Zone.BATTLEFIELD, new CopyTargetSpellEffect(), true); + this.addTarget(new TargetSpell(filter)); + } - @Override - public String getRule() { - return "Whenever you cast an instant or sorcery spell while {this} has two or more quest counters on it, you may copy that spell. You may choose new targets for the copy."; - } + PyromancerAscensionCopyTriggeredAbility(final PyromancerAscensionCopyTriggeredAbility ability) { + super(ability); + } + + @Override + public PyromancerAscensionCopyTriggeredAbility copy() { + return new PyromancerAscensionCopyTriggeredAbility(this); + } + + @Override + public boolean checkTrigger(GameEvent event, Game game) { + if (event.getType() == GameEvent.EventType.SPELL_CAST && event.getPlayerId().equals(this.getControllerId())) { + Spell spell = game.getStack().getSpell(event.getTargetId()); + if (isControlledInstantOrSorcery(spell)) { + Permanent permanent = game.getBattlefield().getPermanent(this.getSourceId()); + if (permanent != null && permanent.getCounters().getCount(CounterType.QUEST) >= 2) { + this.getTargets().get(0).add(spell.getId(), game); + return true; + } + } + } + return false; + } + + private boolean isControlledInstantOrSorcery(Spell spell) { + return spell != null && + (spell.getControllerId().equals(this.getControllerId())) && + (spell.getCardType().contains(CardType.INSTANT) || spell.getCardType().contains(CardType.SORCERY)); + } + + @Override + public String getRule() { + return "Whenever you cast an instant or sorcery spell while {this} has two or more quest counters on it, you may copy that spell. You may choose new targets for the copy."; + } } diff --git a/Mage.Sets/src/mage/sets/zendikar/QuestForTheHolyRelic.java b/Mage.Sets/src/mage/sets/zendikar/QuestForTheHolyRelic.java index 90c158834b..34b12a80e6 100644 --- a/Mage.Sets/src/mage/sets/zendikar/QuestForTheHolyRelic.java +++ b/Mage.Sets/src/mage/sets/zendikar/QuestForTheHolyRelic.java @@ -65,7 +65,7 @@ public class QuestForTheHolyRelic extends CardImpl { filter.getCardType().add(CardType.CREATURE); filter.setScopeCardType(Filter.ComparisonScope.Any); } - + public QuestForTheHolyRelic(UUID ownerId) { super(ownerId, 33, "Quest for the Holy Relic", Rarity.UNCOMMON, new CardType[]{CardType.ENCHANTMENT}, "{W}"); this.expansionSetCode = "ZEN"; diff --git a/Mage.Sets/src/mage/sets/zendikar/RampagingBaloths.java b/Mage.Sets/src/mage/sets/zendikar/RampagingBaloths.java index c83e4b8bc1..62c05591e4 100644 --- a/Mage.Sets/src/mage/sets/zendikar/RampagingBaloths.java +++ b/Mage.Sets/src/mage/sets/zendikar/RampagingBaloths.java @@ -44,35 +44,35 @@ import mage.game.permanent.token.Token; */ public class RampagingBaloths extends CardImpl { - public RampagingBaloths(UUID ownerId) { - super(ownerId, 178, "Rampaging Baloths", Rarity.MYTHIC, new CardType[]{CardType.CREATURE}, "{4}{G}{G}"); - this.expansionSetCode = "ZEN"; - this.subtype.add("Beast"); - this.color.setGreen(true); - this.power = new MageInt(6); - this.toughness = new MageInt(6); - this.addAbility(TrampleAbility.getInstance()); - this.addAbility(new LandfallAbility(new CreateTokenEffect(new RampagingBalothsToken()), true)); - } + public RampagingBaloths(UUID ownerId) { + super(ownerId, 178, "Rampaging Baloths", Rarity.MYTHIC, new CardType[]{CardType.CREATURE}, "{4}{G}{G}"); + this.expansionSetCode = "ZEN"; + this.subtype.add("Beast"); + this.color.setGreen(true); + this.power = new MageInt(6); + this.toughness = new MageInt(6); + this.addAbility(TrampleAbility.getInstance()); + this.addAbility(new LandfallAbility(new CreateTokenEffect(new RampagingBalothsToken()), true)); + } - public RampagingBaloths(final RampagingBaloths card) { - super(card); - } + public RampagingBaloths(final RampagingBaloths card) { + super(card); + } - @Override - public RampagingBaloths copy() { - return new RampagingBaloths(this); - } + @Override + public RampagingBaloths copy() { + return new RampagingBaloths(this); + } } class RampagingBalothsToken extends Token { - public RampagingBalothsToken() { - super("Beast", "4/4 green Beast creature token"); - cardType.add(CardType.CREATURE); - subtype.add("Beast"); - power = new MageInt(4); - toughness = new MageInt(4); - } + public RampagingBalothsToken() { + super("Beast", "4/4 green Beast creature token"); + cardType.add(CardType.CREATURE); + subtype.add("Beast"); + power = new MageInt(4); + toughness = new MageInt(4); + } } \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/zendikar/RiverBoa.java b/Mage.Sets/src/mage/sets/zendikar/RiverBoa.java index 9a14a3844c..9c43611d10 100644 --- a/Mage.Sets/src/mage/sets/zendikar/RiverBoa.java +++ b/Mage.Sets/src/mage/sets/zendikar/RiverBoa.java @@ -45,24 +45,24 @@ import mage.cards.CardImpl; */ public class RiverBoa extends CardImpl { - public RiverBoa(UUID ownerId) { - super(ownerId, 180, "River Boa", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{1}{G}"); - this.expansionSetCode = "ZEN"; - this.color.setGreen(true); - this.subtype.add("Snake"); - this.power = new MageInt(2); - this.toughness = new MageInt(1); - this.addAbility(new IslandwalkAbility()); - this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new RegenerateSourceEffect(), new ManaCostsImpl("{G}"))); - } + public RiverBoa(UUID ownerId) { + super(ownerId, 180, "River Boa", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{1}{G}"); + this.expansionSetCode = "ZEN"; + this.color.setGreen(true); + this.subtype.add("Snake"); + this.power = new MageInt(2); + this.toughness = new MageInt(1); + this.addAbility(new IslandwalkAbility()); + this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new RegenerateSourceEffect(), new ManaCostsImpl("{G}"))); + } - public RiverBoa(final RiverBoa card) { - super(card); - } + public RiverBoa(final RiverBoa card) { + super(card); + } - @Override - public RiverBoa copy() { - return new RiverBoa(this); - } + @Override + public RiverBoa copy() { + return new RiverBoa(this); + } } diff --git a/Mage.Sets/src/mage/sets/zendikar/ScaldingTarn.java b/Mage.Sets/src/mage/sets/zendikar/ScaldingTarn.java index 5c1ae35f9a..b997244af5 100644 --- a/Mage.Sets/src/mage/sets/zendikar/ScaldingTarn.java +++ b/Mage.Sets/src/mage/sets/zendikar/ScaldingTarn.java @@ -40,20 +40,20 @@ import mage.cards.CardImpl; */ public class ScaldingTarn extends CardImpl { - public ScaldingTarn(UUID ownerId) { - super(ownerId, 223, "Scalding Tarn", Rarity.RARE, new CardType[]{CardType.LAND}, null); - this.expansionSetCode = "ZEN"; - this.addAbility(new FetchLandActivatedAbility(new String[] {"Island", "Mountain"})); - } + public ScaldingTarn(UUID ownerId) { + super(ownerId, 223, "Scalding Tarn", Rarity.RARE, new CardType[]{CardType.LAND}, null); + this.expansionSetCode = "ZEN"; + this.addAbility(new FetchLandActivatedAbility(new String[] {"Island", "Mountain"})); + } - public ScaldingTarn(final ScaldingTarn card) { - super(card); - } + public ScaldingTarn(final ScaldingTarn card) { + super(card); + } - @Override - public ScaldingTarn copy() { - return new ScaldingTarn(this); - } + @Override + public ScaldingTarn copy() { + return new ScaldingTarn(this); + } } diff --git a/Mage.Sets/src/mage/sets/zendikar/ScuteMob.java b/Mage.Sets/src/mage/sets/zendikar/ScuteMob.java index cb438cd109..1db81873bc 100644 --- a/Mage.Sets/src/mage/sets/zendikar/ScuteMob.java +++ b/Mage.Sets/src/mage/sets/zendikar/ScuteMob.java @@ -48,59 +48,59 @@ import mage.game.events.GameEvent.EventType; */ public class ScuteMob extends CardImpl { - public ScuteMob(UUID ownerId) { - super(ownerId, 182, "Scute Mob", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{G}"); - this.expansionSetCode = "ZEN"; - this.color.setGreen(true); - this.subtype.add("Insect"); - this.power = new MageInt(1); - this.toughness = new MageInt(1); - this.addAbility(new ScuteMobAbility()); - } + public ScuteMob(UUID ownerId) { + super(ownerId, 182, "Scute Mob", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{G}"); + this.expansionSetCode = "ZEN"; + this.color.setGreen(true); + this.subtype.add("Insect"); + this.power = new MageInt(1); + this.toughness = new MageInt(1); + this.addAbility(new ScuteMobAbility()); + } - public ScuteMob(final ScuteMob card) { - super(card); - } + public ScuteMob(final ScuteMob card) { + super(card); + } - @Override - public ScuteMob copy() { - return new ScuteMob(this); - } + @Override + public ScuteMob copy() { + return new ScuteMob(this); + } } class ScuteMobAbility extends TriggeredAbilityImpl { - private FilterLandPermanent filter = new FilterLandPermanent(); + private FilterLandPermanent filter = new FilterLandPermanent(); - public ScuteMobAbility() { - super(Zone.BATTLEFIELD, new AddCountersSourceEffect(CounterType.P1P1.createInstance(4))); - } + public ScuteMobAbility() { + super(Zone.BATTLEFIELD, new AddCountersSourceEffect(CounterType.P1P1.createInstance(4))); + } - public ScuteMobAbility(final ScuteMobAbility ability) { - super(ability); - } + public ScuteMobAbility(final ScuteMobAbility ability) { + super(ability); + } - @Override - public ScuteMobAbility copy() { - return new ScuteMobAbility(this); - } + @Override + public ScuteMobAbility copy() { + return new ScuteMobAbility(this); + } - @Override - public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == EventType.UPKEEP_STEP_PRE && event.getPlayerId().equals(this.controllerId)) { - return true; - } - return false; - } + @Override + public boolean checkTrigger(GameEvent event, Game game) { + if (event.getType() == EventType.UPKEEP_STEP_PRE && event.getPlayerId().equals(this.controllerId)) { + return true; + } + return false; + } - @Override - public boolean checkInterveningIfClause(Game game) { - return game.getBattlefield().countAll(filter, this.controllerId, game) >= 5; - } + @Override + public boolean checkInterveningIfClause(Game game) { + return game.getBattlefield().countAll(filter, this.controllerId, game) >= 5; + } - @Override - public String getRule() { - return "At the beginning of your upkeep, if you control five or more lands, put four +1/+1 counters on {this}."; - } + @Override + public String getRule() { + return "At the beginning of your upkeep, if you control five or more lands, put four +1/+1 counters on {this}."; + } } \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/zendikar/SeascapeAerialist.java b/Mage.Sets/src/mage/sets/zendikar/SeascapeAerialist.java index d5b91b0517..0fe1846dc9 100644 --- a/Mage.Sets/src/mage/sets/zendikar/SeascapeAerialist.java +++ b/Mage.Sets/src/mage/sets/zendikar/SeascapeAerialist.java @@ -52,7 +52,7 @@ public class SeascapeAerialist extends CardImpl { static { filter.getSubtype().add("Ally"); filter.setScopeSubtype(Filter.ComparisonScope.Any); - filter.setTargetController(Constants.TargetController.YOU); + filter.setTargetController(Constants.TargetController.YOU); } public SeascapeAerialist(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/zendikar/SejiriRefuge.java b/Mage.Sets/src/mage/sets/zendikar/SejiriRefuge.java index 683f98344c..4a3939e203 100644 --- a/Mage.Sets/src/mage/sets/zendikar/SejiriRefuge.java +++ b/Mage.Sets/src/mage/sets/zendikar/SejiriRefuge.java @@ -44,21 +44,21 @@ import mage.cards.CardImpl; */ public class SejiriRefuge extends CardImpl { - public SejiriRefuge(UUID ownerId) { - super(ownerId, 224, "Sejiri Refuge", Rarity.UNCOMMON, new CardType[]{CardType.LAND}, null); - this.expansionSetCode = "ZEN"; - this.addAbility(new EntersBattlefieldTappedAbility()); - this.addAbility(new EntersBattlefieldTriggeredAbility(new GainLifeEffect(1), false)); - this.addAbility(new WhiteManaAbility()); - this.addAbility(new BlueManaAbility()); - } + public SejiriRefuge(UUID ownerId) { + super(ownerId, 224, "Sejiri Refuge", Rarity.UNCOMMON, new CardType[]{CardType.LAND}, null); + this.expansionSetCode = "ZEN"; + this.addAbility(new EntersBattlefieldTappedAbility()); + this.addAbility(new EntersBattlefieldTriggeredAbility(new GainLifeEffect(1), false)); + this.addAbility(new WhiteManaAbility()); + this.addAbility(new BlueManaAbility()); + } - public SejiriRefuge(final SejiriRefuge card) { - super(card); - } + public SejiriRefuge(final SejiriRefuge card) { + super(card); + } - @Override - public SejiriRefuge copy() { - return new SejiriRefuge(this); - } + @Override + public SejiriRefuge copy() { + return new SejiriRefuge(this); + } } diff --git a/Mage.Sets/src/mage/sets/zendikar/SorinMarkov.java b/Mage.Sets/src/mage/sets/zendikar/SorinMarkov.java index 805fee7383..9d6555dc9a 100644 --- a/Mage.Sets/src/mage/sets/zendikar/SorinMarkov.java +++ b/Mage.Sets/src/mage/sets/zendikar/SorinMarkov.java @@ -61,23 +61,23 @@ public class SorinMarkov extends CardImpl { this.color.setBlack(true); - this.addAbility(new EntersBattlefieldAbility(new AddCountersSourceEffect(CounterType.LOYALTY.createInstance(4)))); + this.addAbility(new EntersBattlefieldAbility(new AddCountersSourceEffect(CounterType.LOYALTY.createInstance(4)))); // +2: Sorin Markov deals 2 damage to target creature or player and you gain 2 life. - LoyaltyAbility ability1 = new LoyaltyAbility(new DamageTargetEffect(2), 2); - ability1.addEffect(new GainLifeEffect(2)); - ability1.addTarget(new TargetCreatureOrPlayer()); - this.addAbility(ability1); + LoyaltyAbility ability1 = new LoyaltyAbility(new DamageTargetEffect(2), 2); + ability1.addEffect(new GainLifeEffect(2)); + ability1.addTarget(new TargetCreatureOrPlayer()); + this.addAbility(ability1); // -3: Target opponent's life total becomes 10. - LoyaltyAbility ability2 = new LoyaltyAbility(new SorinMarkovEffect(), -3); - ability2.addTarget(new TargetOpponent()); - this.addAbility(ability2); + LoyaltyAbility ability2 = new LoyaltyAbility(new SorinMarkovEffect(), -3); + ability2.addTarget(new TargetOpponent()); + this.addAbility(ability2); // -7: You control target player during that player's next turn. - LoyaltyAbility ability3 = new LoyaltyAbility(new ControlTargetPlayerNextTurnEffect(), -7); - ability3.addTarget(new TargetPlayer()); - this.addAbility(ability3); + LoyaltyAbility ability3 = new LoyaltyAbility(new ControlTargetPlayerNextTurnEffect(), -7); + ability3.addTarget(new TargetPlayer()); + this.addAbility(ability3); } public SorinMarkov(final SorinMarkov card) { @@ -92,27 +92,27 @@ public class SorinMarkov extends CardImpl { class SorinMarkovEffect extends OneShotEffect { - public SorinMarkovEffect() { - super(Constants.Outcome.Benefit); - staticText = "Target opponent's life total becomes 10"; - } + public SorinMarkovEffect() { + super(Constants.Outcome.Benefit); + staticText = "Target opponent's life total becomes 10"; + } - public SorinMarkovEffect(SorinMarkovEffect effect) { - super(effect); - } + public SorinMarkovEffect(SorinMarkovEffect effect) { + super(effect); + } - @Override - public boolean apply(Game game, Ability source) { - Player player = game.getPlayer(targetPointer.getFirst(game, source)); - if (player != null) { - player.setLife(10, game); - return true; - } - return false; - } + @Override + public boolean apply(Game game, Ability source) { + Player player = game.getPlayer(targetPointer.getFirst(game, source)); + if (player != null) { + player.setLife(10, game); + return true; + } + return false; + } - @Override - public SorinMarkovEffect copy() { - return new SorinMarkovEffect(this); - } + @Override + public SorinMarkovEffect copy() { + return new SorinMarkovEffect(this); + } } diff --git a/Mage.Sets/src/mage/sets/zendikar/SpreadingSeas.java b/Mage.Sets/src/mage/sets/zendikar/SpreadingSeas.java index 339a2b5833..a0592965ed 100644 --- a/Mage.Sets/src/mage/sets/zendikar/SpreadingSeas.java +++ b/Mage.Sets/src/mage/sets/zendikar/SpreadingSeas.java @@ -56,82 +56,82 @@ import mage.target.common.TargetLandPermanent; */ public class SpreadingSeas extends CardImpl { - public SpreadingSeas(UUID ownerId) { - super(ownerId, 70, "Spreading Seas", Rarity.COMMON, new CardType[]{CardType.ENCHANTMENT}, "{1}{U}"); - this.expansionSetCode = "ZEN"; - this.color.setBlue(true); - this.subtype.add("Aura"); + public SpreadingSeas(UUID ownerId) { + super(ownerId, 70, "Spreading Seas", Rarity.COMMON, new CardType[]{CardType.ENCHANTMENT}, "{1}{U}"); + this.expansionSetCode = "ZEN"; + this.color.setBlue(true); + this.subtype.add("Aura"); - TargetPermanent auraTarget = new TargetLandPermanent(); - this.getSpellAbility().addTarget(auraTarget); - this.getSpellAbility().addEffect(new AttachEffect(Outcome.Detriment)); - Ability ability = new EnchantAbility(auraTarget.getTargetName()); - this.addAbility(ability); - this.addAbility(new EntersBattlefieldTriggeredAbility(new DrawCardControllerEffect(1), false)); - this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new SpreadingSeasEffect())); + TargetPermanent auraTarget = new TargetLandPermanent(); + this.getSpellAbility().addTarget(auraTarget); + this.getSpellAbility().addEffect(new AttachEffect(Outcome.Detriment)); + Ability ability = new EnchantAbility(auraTarget.getTargetName()); + this.addAbility(ability); + this.addAbility(new EntersBattlefieldTriggeredAbility(new DrawCardControllerEffect(1), false)); + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new SpreadingSeasEffect())); - } + } - public SpreadingSeas(final SpreadingSeas card) { - super(card); - } + public SpreadingSeas(final SpreadingSeas card) { + super(card); + } - @Override - public SpreadingSeas copy() { - return new SpreadingSeas(this); - } + @Override + public SpreadingSeas copy() { + return new SpreadingSeas(this); + } } class SpreadingSeasEffect extends ContinuousEffectImpl { - public SpreadingSeasEffect() { - super(Duration.WhileOnBattlefield, Outcome.Detriment); - staticText = "Enchanted land is an Island"; - } + public SpreadingSeasEffect() { + super(Duration.WhileOnBattlefield, Outcome.Detriment); + staticText = "Enchanted land is an Island"; + } - public SpreadingSeasEffect(final SpreadingSeasEffect effect) { - super(effect); - } + public SpreadingSeasEffect(final SpreadingSeasEffect effect) { + super(effect); + } - @Override - public SpreadingSeasEffect copy() { - return new SpreadingSeasEffect(this); - } + @Override + public SpreadingSeasEffect copy() { + return new SpreadingSeasEffect(this); + } - @Override - public boolean apply(Layer layer, SubLayer sublayer, Ability source, Game game) { - Permanent enchantment = game.getPermanent(source.getSourceId()); - if (enchantment != null && enchantment.getAttachedTo() != null) { - Permanent land = game.getPermanent(enchantment.getAttachedTo()); - if (land != null) { - switch (layer) { - case TypeChangingEffects_4: - if (sublayer == SubLayer.NA) { - land.getSubtype().clear(); - land.getSubtype().add("Island"); - } - break; - case AbilityAddingRemovingEffects_6: - if (sublayer == SubLayer.NA) { - land.getAbilities().clear(); - land.addAbility(new BlueManaAbility(), game); - } - break; - } - return true; - } - } - return false; - } + @Override + public boolean apply(Layer layer, SubLayer sublayer, Ability source, Game game) { + Permanent enchantment = game.getPermanent(source.getSourceId()); + if (enchantment != null && enchantment.getAttachedTo() != null) { + Permanent land = game.getPermanent(enchantment.getAttachedTo()); + if (land != null) { + switch (layer) { + case TypeChangingEffects_4: + if (sublayer == SubLayer.NA) { + land.getSubtype().clear(); + land.getSubtype().add("Island"); + } + break; + case AbilityAddingRemovingEffects_6: + if (sublayer == SubLayer.NA) { + land.getAbilities().clear(); + land.addAbility(new BlueManaAbility(), game); + } + break; + } + return true; + } + } + return false; + } - @Override - public boolean apply(Game game, Ability source) { - return false; - } + @Override + public boolean apply(Game game, Ability source) { + return false; + } - @Override - public boolean hasLayer(Layer layer) { - return layer == Layer.AbilityAddingRemovingEffects_6 || layer == Layer.TypeChangingEffects_4; - } + @Override + public boolean hasLayer(Layer layer) { + return layer == Layer.AbilityAddingRemovingEffects_6 || layer == Layer.TypeChangingEffects_4; + } } \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/zendikar/SteppeLynx.java b/Mage.Sets/src/mage/sets/zendikar/SteppeLynx.java index 0e4735d90b..7408b12631 100644 --- a/Mage.Sets/src/mage/sets/zendikar/SteppeLynx.java +++ b/Mage.Sets/src/mage/sets/zendikar/SteppeLynx.java @@ -43,24 +43,24 @@ import mage.cards.CardImpl; */ public class SteppeLynx extends CardImpl { - public SteppeLynx(UUID ownerId) { - super(ownerId, 36, "Steppe Lynx", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{W}"); - this.expansionSetCode = "ZEN"; - this.subtype.add("Cat"); - this.color.setWhite(true); - this.power = new MageInt(0); - this.toughness = new MageInt(1); + public SteppeLynx(UUID ownerId) { + super(ownerId, 36, "Steppe Lynx", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{W}"); + this.expansionSetCode = "ZEN"; + this.subtype.add("Cat"); + this.color.setWhite(true); + this.power = new MageInt(0); + this.toughness = new MageInt(1); - this.addAbility(new LandfallAbility(new BoostSourceEffect(2, 2, Duration.EndOfTurn), false)); - } + this.addAbility(new LandfallAbility(new BoostSourceEffect(2, 2, Duration.EndOfTurn), false)); + } - public SteppeLynx(final SteppeLynx card) { - super(card); - } + public SteppeLynx(final SteppeLynx card) { + super(card); + } - @Override - public SteppeLynx copy() { - return new SteppeLynx(this); - } + @Override + public SteppeLynx copy() { + return new SteppeLynx(this); + } } diff --git a/Mage.Sets/src/mage/sets/zendikar/SunspringExpedition.java b/Mage.Sets/src/mage/sets/zendikar/SunspringExpedition.java index cad809b6db..eb18b14ea4 100644 --- a/Mage.Sets/src/mage/sets/zendikar/SunspringExpedition.java +++ b/Mage.Sets/src/mage/sets/zendikar/SunspringExpedition.java @@ -51,26 +51,26 @@ import mage.counters.common.QuestCounter; */ public class SunspringExpedition extends CardImpl { - public SunspringExpedition(UUID ownerId) { - super(ownerId, 37, "Sunspring Expedition", Rarity.COMMON, new CardType[]{CardType.ENCHANTMENT}, "{W}"); - this.expansionSetCode = "ZEN"; - this.color.setWhite(true); + public SunspringExpedition(UUID ownerId) { + super(ownerId, 37, "Sunspring Expedition", Rarity.COMMON, new CardType[]{CardType.ENCHANTMENT}, "{W}"); + this.expansionSetCode = "ZEN"; + this.color.setWhite(true); - this.addAbility(new LandfallAbility(new AddCountersSourceEffect(new QuestCounter()), true)); - Costs costs = new CostsImpl(); - costs.add(new RemoveCountersSourceCost(CounterType.QUEST.createInstance(3))); - costs.add(new SacrificeSourceCost()); - ActivatedAbility ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new GainLifeEffect(8), costs); - this.addAbility(ability); - } + this.addAbility(new LandfallAbility(new AddCountersSourceEffect(new QuestCounter()), true)); + Costs costs = new CostsImpl(); + costs.add(new RemoveCountersSourceCost(CounterType.QUEST.createInstance(3))); + costs.add(new SacrificeSourceCost()); + ActivatedAbility ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new GainLifeEffect(8), costs); + this.addAbility(ability); + } - public SunspringExpedition(final SunspringExpedition card) { - super(card); - } + public SunspringExpedition(final SunspringExpedition card) { + super(card); + } - @Override - public SunspringExpedition copy() { - return new SunspringExpedition(this); - } + @Override + public SunspringExpedition copy() { + return new SunspringExpedition(this); + } } diff --git a/Mage.Sets/src/mage/sets/zendikar/Swamp1.java b/Mage.Sets/src/mage/sets/zendikar/Swamp1.java index f106c9fb5a..4c874ddcdf 100644 --- a/Mage.Sets/src/mage/sets/zendikar/Swamp1.java +++ b/Mage.Sets/src/mage/sets/zendikar/Swamp1.java @@ -36,18 +36,18 @@ import java.util.UUID; */ public class Swamp1 extends mage.cards.basiclands.Swamp { - public Swamp1(UUID ownerId) { - super(ownerId, 238); - this.expansionSetCode = "ZEN"; - } + public Swamp1(UUID ownerId) { + super(ownerId, 238); + this.expansionSetCode = "ZEN"; + } - public Swamp1(final Swamp1 card) { - super(card); - } + public Swamp1(final Swamp1 card) { + super(card); + } - @Override - public Swamp1 copy() { - return new Swamp1(this); - } + @Override + public Swamp1 copy() { + return new Swamp1(this); + } } diff --git a/Mage.Sets/src/mage/sets/zendikar/Swamp2.java b/Mage.Sets/src/mage/sets/zendikar/Swamp2.java index dfea7c4c0a..db4208b575 100644 --- a/Mage.Sets/src/mage/sets/zendikar/Swamp2.java +++ b/Mage.Sets/src/mage/sets/zendikar/Swamp2.java @@ -36,18 +36,18 @@ import java.util.UUID; */ public class Swamp2 extends mage.cards.basiclands.Swamp { - public Swamp2(UUID ownerId) { - super(ownerId, 239); - this.expansionSetCode = "ZEN"; - } + public Swamp2(UUID ownerId) { + super(ownerId, 239); + this.expansionSetCode = "ZEN"; + } - public Swamp2(final Swamp2 card) { - super(card); - } + public Swamp2(final Swamp2 card) { + super(card); + } - @Override - public Swamp2 copy() { - return new Swamp2(this); - } + @Override + public Swamp2 copy() { + return new Swamp2(this); + } } diff --git a/Mage.Sets/src/mage/sets/zendikar/Swamp3.java b/Mage.Sets/src/mage/sets/zendikar/Swamp3.java index 8571c6ced7..4f347cdcbb 100644 --- a/Mage.Sets/src/mage/sets/zendikar/Swamp3.java +++ b/Mage.Sets/src/mage/sets/zendikar/Swamp3.java @@ -36,18 +36,18 @@ import java.util.UUID; */ public class Swamp3 extends mage.cards.basiclands.Swamp { - public Swamp3(UUID ownerId) { - super(ownerId, 240); - this.expansionSetCode = "ZEN"; - } + public Swamp3(UUID ownerId) { + super(ownerId, 240); + this.expansionSetCode = "ZEN"; + } - public Swamp3(final Swamp3 card) { - super(card); - } + public Swamp3(final Swamp3 card) { + super(card); + } - @Override - public Swamp3 copy() { - return new Swamp3(this); - } + @Override + public Swamp3 copy() { + return new Swamp3(this); + } } diff --git a/Mage.Sets/src/mage/sets/zendikar/Swamp4.java b/Mage.Sets/src/mage/sets/zendikar/Swamp4.java index ade1909403..ffa875496b 100644 --- a/Mage.Sets/src/mage/sets/zendikar/Swamp4.java +++ b/Mage.Sets/src/mage/sets/zendikar/Swamp4.java @@ -36,18 +36,18 @@ import java.util.UUID; */ public class Swamp4 extends mage.cards.basiclands.Swamp { - public Swamp4(UUID ownerId) { - super(ownerId, 241); - this.expansionSetCode = "ZEN"; - } + public Swamp4(UUID ownerId) { + super(ownerId, 241); + this.expansionSetCode = "ZEN"; + } - public Swamp4(final Swamp4 card) { - super(card); - } + public Swamp4(final Swamp4 card) { + super(card); + } - @Override - public Swamp4 copy() { - return new Swamp4(this); - } + @Override + public Swamp4 copy() { + return new Swamp4(this); + } } diff --git a/Mage.Sets/src/mage/sets/zendikar/Swamp5.java b/Mage.Sets/src/mage/sets/zendikar/Swamp5.java index 5415a8f101..29b3846132 100644 --- a/Mage.Sets/src/mage/sets/zendikar/Swamp5.java +++ b/Mage.Sets/src/mage/sets/zendikar/Swamp5.java @@ -36,18 +36,18 @@ import java.util.UUID; */ public class Swamp5 extends mage.cards.basiclands.Swamp { - public Swamp5(UUID ownerId) { - super(ownerId, 258); - this.expansionSetCode = "ZEN"; - } + public Swamp5(UUID ownerId) { + super(ownerId, 258); + this.expansionSetCode = "ZEN"; + } - public Swamp5(final Swamp5 card) { - super(card); - } + public Swamp5(final Swamp5 card) { + super(card); + } - @Override - public Swamp5 copy() { - return new Swamp5(this); - } + @Override + public Swamp5 copy() { + return new Swamp5(this); + } } diff --git a/Mage.Sets/src/mage/sets/zendikar/Swamp6.java b/Mage.Sets/src/mage/sets/zendikar/Swamp6.java index dc85557ca6..57131ecf34 100644 --- a/Mage.Sets/src/mage/sets/zendikar/Swamp6.java +++ b/Mage.Sets/src/mage/sets/zendikar/Swamp6.java @@ -36,18 +36,18 @@ import java.util.UUID; */ public class Swamp6 extends mage.cards.basiclands.Swamp { - public Swamp6(UUID ownerId) { - super(ownerId, 259); - this.expansionSetCode = "ZEN"; - } + public Swamp6(UUID ownerId) { + super(ownerId, 259); + this.expansionSetCode = "ZEN"; + } - public Swamp6(final Swamp6 card) { - super(card); - } + public Swamp6(final Swamp6 card) { + super(card); + } - @Override - public Swamp6 copy() { - return new Swamp6(this); - } + @Override + public Swamp6 copy() { + return new Swamp6(this); + } } diff --git a/Mage.Sets/src/mage/sets/zendikar/Swamp7.java b/Mage.Sets/src/mage/sets/zendikar/Swamp7.java index c884dc6a6a..0d1df52624 100644 --- a/Mage.Sets/src/mage/sets/zendikar/Swamp7.java +++ b/Mage.Sets/src/mage/sets/zendikar/Swamp7.java @@ -36,18 +36,18 @@ import java.util.UUID; */ public class Swamp7 extends mage.cards.basiclands.Swamp { - public Swamp7(UUID ownerId) { - super(ownerId, 260); - this.expansionSetCode = "ZEN"; - } + public Swamp7(UUID ownerId) { + super(ownerId, 260); + this.expansionSetCode = "ZEN"; + } - public Swamp7(final Swamp7 card) { - super(card); - } + public Swamp7(final Swamp7 card) { + super(card); + } - @Override - public Swamp7 copy() { - return new Swamp7(this); - } + @Override + public Swamp7 copy() { + return new Swamp7(this); + } } diff --git a/Mage.Sets/src/mage/sets/zendikar/Swamp8.java b/Mage.Sets/src/mage/sets/zendikar/Swamp8.java index ed2387ed54..63c864369c 100644 --- a/Mage.Sets/src/mage/sets/zendikar/Swamp8.java +++ b/Mage.Sets/src/mage/sets/zendikar/Swamp8.java @@ -36,18 +36,18 @@ import java.util.UUID; */ public class Swamp8 extends mage.cards.basiclands.Swamp { - public Swamp8(UUID ownerId) { - super(ownerId, 261); - this.expansionSetCode = "ZEN"; - } + public Swamp8(UUID ownerId) { + super(ownerId, 261); + this.expansionSetCode = "ZEN"; + } - public Swamp8(final Swamp8 card) { - super(card); - } + public Swamp8(final Swamp8 card) { + super(card); + } - @Override - public Swamp8 copy() { - return new Swamp8(this); - } + @Override + public Swamp8 copy() { + return new Swamp8(this); + } } diff --git a/Mage.Sets/src/mage/sets/zendikar/TajuruArcher.java b/Mage.Sets/src/mage/sets/zendikar/TajuruArcher.java index 1b0a8a59e9..5c9fbab0a7 100644 --- a/Mage.Sets/src/mage/sets/zendikar/TajuruArcher.java +++ b/Mage.Sets/src/mage/sets/zendikar/TajuruArcher.java @@ -54,8 +54,8 @@ public class TajuruArcher extends CardImpl { static { filter.getSubtype().add("Ally"); - filter.setScopeSubtype(Filter.ComparisonScope.Any); - filter.setTargetController(Constants.TargetController.YOU); + filter.setScopeSubtype(Filter.ComparisonScope.Any); + filter.setTargetController(Constants.TargetController.YOU); filterTarget.getAbilities().add(FlyingAbility.getInstance()); } diff --git a/Mage.Sets/src/mage/sets/zendikar/TeeteringPeaks.java b/Mage.Sets/src/mage/sets/zendikar/TeeteringPeaks.java index 6de4cb0cc9..7aeff411a5 100644 --- a/Mage.Sets/src/mage/sets/zendikar/TeeteringPeaks.java +++ b/Mage.Sets/src/mage/sets/zendikar/TeeteringPeaks.java @@ -46,23 +46,23 @@ import mage.target.common.TargetCreaturePermanent; */ public class TeeteringPeaks extends CardImpl { - public TeeteringPeaks(UUID ownerId) { - super(ownerId, 226, "Teetering Peaks", Rarity.COMMON, new CardType[]{CardType.LAND}, null); - this.expansionSetCode = "ZEN"; - this.addAbility(new EntersBattlefieldTappedAbility()); - Ability ability = new EntersBattlefieldTriggeredAbility(new BoostTargetEffect(2, 0, Duration.EndOfTurn), false); - ability.addTarget(new TargetCreaturePermanent()); - this.addAbility(ability); - this.addAbility(new RedManaAbility()); - } + public TeeteringPeaks(UUID ownerId) { + super(ownerId, 226, "Teetering Peaks", Rarity.COMMON, new CardType[]{CardType.LAND}, null); + this.expansionSetCode = "ZEN"; + this.addAbility(new EntersBattlefieldTappedAbility()); + Ability ability = new EntersBattlefieldTriggeredAbility(new BoostTargetEffect(2, 0, Duration.EndOfTurn), false); + ability.addTarget(new TargetCreaturePermanent()); + this.addAbility(ability); + this.addAbility(new RedManaAbility()); + } - public TeeteringPeaks(final TeeteringPeaks card) { - super(card); - } + public TeeteringPeaks(final TeeteringPeaks card) { + super(card); + } - @Override - public TeeteringPeaks copy() { - return new TeeteringPeaks(this); - } + @Override + public TeeteringPeaks copy() { + return new TeeteringPeaks(this); + } } diff --git a/Mage.Sets/src/mage/sets/zendikar/TimbermawLarva.java b/Mage.Sets/src/mage/sets/zendikar/TimbermawLarva.java index d9bedcf945..e5c917bead 100644 --- a/Mage.Sets/src/mage/sets/zendikar/TimbermawLarva.java +++ b/Mage.Sets/src/mage/sets/zendikar/TimbermawLarva.java @@ -50,7 +50,7 @@ public class TimbermawLarva extends CardImpl { static { filter.getSubtype().add("Forest"); filter.setTargetController(TargetController.YOU); - + } public TimbermawLarva(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/zendikar/TrustyMachete.java b/Mage.Sets/src/mage/sets/zendikar/TrustyMachete.java index e632b61c54..55aa4fcfcc 100644 --- a/Mage.Sets/src/mage/sets/zendikar/TrustyMachete.java +++ b/Mage.Sets/src/mage/sets/zendikar/TrustyMachete.java @@ -51,7 +51,7 @@ public class TrustyMachete extends CardImpl { this.expansionSetCode = "ZEN"; this.subtype.add("Equipment"); this.addAbility(new EquipAbility(Constants.Outcome.AddAbility, new GenericManaCost(2))); - this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostEquippedEffect(2, 1))); + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostEquippedEffect(2, 1))); } public TrustyMachete (final TrustyMachete card) { diff --git a/Mage.Sets/src/mage/sets/zendikar/ValakutTheMoltenPinnacle.java b/Mage.Sets/src/mage/sets/zendikar/ValakutTheMoltenPinnacle.java index 8119e2d07c..d5c0c5da5c 100644 --- a/Mage.Sets/src/mage/sets/zendikar/ValakutTheMoltenPinnacle.java +++ b/Mage.Sets/src/mage/sets/zendikar/ValakutTheMoltenPinnacle.java @@ -51,68 +51,68 @@ import mage.target.common.TargetCreatureOrPlayer; * @author Viserion */ public class ValakutTheMoltenPinnacle extends CardImpl { - - static final FilterLandPermanent filter = new FilterLandPermanent("Mountain"); - static { - filter.getSubtype().add("Mountain"); - filter.setScopeSubtype(ComparisonScope.Any); - } - - public ValakutTheMoltenPinnacle(UUID ownerId) { - super(ownerId, 228, "Valakut, the Molten Pinnacle", Rarity.RARE, new CardType[]{CardType.LAND}, null); - this.expansionSetCode = "ZEN"; - this.addAbility(new EntersBattlefieldTappedAbility()); - this.addAbility(new ValakutTheMoltenPinnacleTriggeredAbility()); - this.addAbility(new RedManaAbility()); + static final FilterLandPermanent filter = new FilterLandPermanent("Mountain"); - } + static { + filter.getSubtype().add("Mountain"); + filter.setScopeSubtype(ComparisonScope.Any); + } - public ValakutTheMoltenPinnacle(final ValakutTheMoltenPinnacle card) { - super(card); - } + public ValakutTheMoltenPinnacle(UUID ownerId) { + super(ownerId, 228, "Valakut, the Molten Pinnacle", Rarity.RARE, new CardType[]{CardType.LAND}, null); + this.expansionSetCode = "ZEN"; + this.addAbility(new EntersBattlefieldTappedAbility()); + this.addAbility(new ValakutTheMoltenPinnacleTriggeredAbility()); + this.addAbility(new RedManaAbility()); - @Override - public ValakutTheMoltenPinnacle copy() { - return new ValakutTheMoltenPinnacle(this); - } + } + + public ValakutTheMoltenPinnacle(final ValakutTheMoltenPinnacle card) { + super(card); + } + + @Override + public ValakutTheMoltenPinnacle copy() { + return new ValakutTheMoltenPinnacle(this); + } } class ValakutTheMoltenPinnacleTriggeredAbility extends TriggeredAbilityImpl { - ValakutTheMoltenPinnacleTriggeredAbility () { - super(Zone.BATTLEFIELD, new DamageTargetEffect(3)); - this.addTarget(new TargetCreatureOrPlayer()); - } + ValakutTheMoltenPinnacleTriggeredAbility () { + super(Zone.BATTLEFIELD, new DamageTargetEffect(3)); + this.addTarget(new TargetCreatureOrPlayer()); + } - ValakutTheMoltenPinnacleTriggeredAbility(ValakutTheMoltenPinnacleTriggeredAbility ability) { - super(ability); - } + ValakutTheMoltenPinnacleTriggeredAbility(ValakutTheMoltenPinnacleTriggeredAbility ability) { + super(ability); + } - @Override - public boolean checkTrigger(GameEvent event, Game game) { - - if (event.getType() == EventType.ZONE_CHANGE && ((ZoneChangeEvent)event).getToZone() == Zone.BATTLEFIELD) { - Permanent permanent = game.getPermanent(event.getTargetId()); - if (permanent.getCardType().contains(CardType.LAND) && permanent.getControllerId().equals(this.controllerId)) { - if(permanent.hasSubtype("Mountain")){ - - int count = game.getBattlefield().count(ValakutTheMoltenPinnacle.filter, permanent.getControllerId(), game); - - if(count > 5){ - return true; - } - } - } - } - return false; - } - @Override - public ValakutTheMoltenPinnacleTriggeredAbility copy() { - return new ValakutTheMoltenPinnacleTriggeredAbility(this); - } - - @Override + @Override + public boolean checkTrigger(GameEvent event, Game game) { + + if (event.getType() == EventType.ZONE_CHANGE && ((ZoneChangeEvent)event).getToZone() == Zone.BATTLEFIELD) { + Permanent permanent = game.getPermanent(event.getTargetId()); + if (permanent.getCardType().contains(CardType.LAND) && permanent.getControllerId().equals(this.controllerId)) { + if(permanent.hasSubtype("Mountain")){ + + int count = game.getBattlefield().count(ValakutTheMoltenPinnacle.filter, permanent.getControllerId(), game); + + if(count > 5){ + return true; + } + } + } + } + return false; + } + @Override + public ValakutTheMoltenPinnacleTriggeredAbility copy() { + return new ValakutTheMoltenPinnacleTriggeredAbility(this); + } + + @Override public String getRule() { return "Whenever a Mountain enters the battlefield under your control, if you control at least five other Mountains, you may have {this} deal 3 damage to target creature or player."; } diff --git a/Mage.Sets/src/mage/sets/zendikar/VampireHexmage.java b/Mage.Sets/src/mage/sets/zendikar/VampireHexmage.java index cbe67f2852..323eae0cdd 100644 --- a/Mage.Sets/src/mage/sets/zendikar/VampireHexmage.java +++ b/Mage.Sets/src/mage/sets/zendikar/VampireHexmage.java @@ -50,66 +50,66 @@ import mage.target.TargetPermanent; */ public class VampireHexmage extends CardImpl { - public VampireHexmage(UUID ownerId) { - super(ownerId, 114, "Vampire Hexmage", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{B}{B}"); - this.expansionSetCode = "ZEN"; - this.subtype.add("Vampire"); - this.subtype.add("Shaman"); + public VampireHexmage(UUID ownerId) { + super(ownerId, 114, "Vampire Hexmage", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{B}{B}"); + this.expansionSetCode = "ZEN"; + this.subtype.add("Vampire"); + this.subtype.add("Shaman"); - this.color.setBlack(true); - this.power = new MageInt(2); - this.toughness = new MageInt(1); + this.color.setBlack(true); + this.power = new MageInt(2); + this.toughness = new MageInt(1); - this.addAbility(FirstStrikeAbility.getInstance()); - - SimpleActivatedAbility vampireHexmageAbility = new SimpleActivatedAbility(Zone.BATTLEFIELD, new VampireHexmageEffect(), new SacrificeSourceCost()); - vampireHexmageAbility.addTarget(new TargetPermanent()); - this.addAbility(vampireHexmageAbility); - } + this.addAbility(FirstStrikeAbility.getInstance()); - public VampireHexmage(final VampireHexmage card) { - super(card); - } + SimpleActivatedAbility vampireHexmageAbility = new SimpleActivatedAbility(Zone.BATTLEFIELD, new VampireHexmageEffect(), new SacrificeSourceCost()); + vampireHexmageAbility.addTarget(new TargetPermanent()); + this.addAbility(vampireHexmageAbility); + } - @Override - public VampireHexmage copy() { - return new VampireHexmage(this); - } + public VampireHexmage(final VampireHexmage card) { + super(card); + } + + @Override + public VampireHexmage copy() { + return new VampireHexmage(this); + } } class VampireHexmageEffect extends OneShotEffect { - VampireHexmageEffect ( ) { - super(Outcome.Benefit); - staticText = "Remove all counters from target permanent"; - } + VampireHexmageEffect ( ) { + super(Outcome.Benefit); + staticText = "Remove all counters from target permanent"; + } - VampireHexmageEffect ( VampireHexmageEffect effect ) { - super(effect); - } + VampireHexmageEffect ( VampireHexmageEffect effect ) { + super(effect); + } - @Override - public VampireHexmageEffect copy() { - return new VampireHexmageEffect(this); - } + @Override + public VampireHexmageEffect copy() { + return new VampireHexmageEffect(this); + } - @Override - public boolean apply(Game game, Ability source) { - TargetPermanent target = (TargetPermanent)source.getTargets().get(0); + @Override + public boolean apply(Game game, Ability source) { + TargetPermanent target = (TargetPermanent)source.getTargets().get(0); - Permanent permanent = game.getPermanent(target.getFirstTarget()); + Permanent permanent = game.getPermanent(target.getFirstTarget()); - if (permanent != null) { - String[] counterNames = permanent.getCounters().keySet().toArray(new String[0]); + if (permanent != null) { + String[] counterNames = permanent.getCounters().keySet().toArray(new String[0]); - for (String counterName : counterNames) { - permanent.getCounters().remove(counterName); - } + for (String counterName : counterNames) { + permanent.getCounters().remove(counterName); + } - return true; - } + return true; + } - return false; - } + return false; + } } diff --git a/Mage.Sets/src/mage/sets/zendikar/VampireLacerator.java b/Mage.Sets/src/mage/sets/zendikar/VampireLacerator.java index f5a2acae57..ac0a56f6be 100644 --- a/Mage.Sets/src/mage/sets/zendikar/VampireLacerator.java +++ b/Mage.Sets/src/mage/sets/zendikar/VampireLacerator.java @@ -45,28 +45,28 @@ import mage.cards.CardImpl; */ public class VampireLacerator extends CardImpl { - public VampireLacerator(UUID ownerId) { - super(ownerId, 115, "Vampire Lacerator", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{B}"); - this.expansionSetCode = "ZEN"; - this.subtype.add("Vampire"); - this.subtype.add("Warrior"); - this.color.setBlack(true); - this.power = new MageInt(2); - this.toughness = new MageInt(2); + public VampireLacerator(UUID ownerId) { + super(ownerId, 115, "Vampire Lacerator", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{B}"); + this.expansionSetCode = "ZEN"; + this.subtype.add("Vampire"); + this.subtype.add("Warrior"); + this.color.setBlack(true); + this.power = new MageInt(2); + this.toughness = new MageInt(2); this.addAbility(new BeginningOfUpkeepTriggeredAbility( new ConditionalOneShotEffect( - new LoseLifeSourceEffect(1), - new UnlessCondition( new TenOrLessLifeCondition(TenOrLessLifeCondition.CheckType.AN_OPPONENT) ), - "you lose 1 life unless an opponent has 10 or less life"), Constants.TargetController.YOU, false)); - } + new LoseLifeSourceEffect(1), + new UnlessCondition( new TenOrLessLifeCondition(TenOrLessLifeCondition.CheckType.AN_OPPONENT) ), + "you lose 1 life unless an opponent has 10 or less life"), Constants.TargetController.YOU, false)); + } - public VampireLacerator(final VampireLacerator card) { - super(card); - } + public VampireLacerator(final VampireLacerator card) { + super(card); + } - @Override - public VampireLacerator copy() { - return new VampireLacerator(this); - } + @Override + public VampireLacerator copy() { + return new VampireLacerator(this); + } } diff --git a/Mage.Sets/src/mage/sets/zendikar/VampireNighthawk.java b/Mage.Sets/src/mage/sets/zendikar/VampireNighthawk.java index ba4be0707f..94a4c51762 100644 --- a/Mage.Sets/src/mage/sets/zendikar/VampireNighthawk.java +++ b/Mage.Sets/src/mage/sets/zendikar/VampireNighthawk.java @@ -42,27 +42,27 @@ import mage.cards.CardImpl; */ public class VampireNighthawk extends CardImpl { - public VampireNighthawk(UUID ownerId) { - super(ownerId, 116, "Vampire Nighthawk", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{1}{B}{B}"); - this.expansionSetCode = "ZEN"; - this.subtype.add("Vampire"); - this.subtype.add("Shaman"); + public VampireNighthawk(UUID ownerId) { + super(ownerId, 116, "Vampire Nighthawk", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{1}{B}{B}"); + this.expansionSetCode = "ZEN"; + this.subtype.add("Vampire"); + this.subtype.add("Shaman"); - this.color.setBlack(true); - this.power = new MageInt(2); - this.toughness = new MageInt(3); + this.color.setBlack(true); + this.power = new MageInt(2); + this.toughness = new MageInt(3); - this.addAbility(FlyingAbility.getInstance()); - this.addAbility(DeathtouchAbility.getInstance()); - this.addAbility(LifelinkAbility.getInstance()); - } + this.addAbility(FlyingAbility.getInstance()); + this.addAbility(DeathtouchAbility.getInstance()); + this.addAbility(LifelinkAbility.getInstance()); + } - public VampireNighthawk(final VampireNighthawk card) { - super(card); - } + public VampireNighthawk(final VampireNighthawk card) { + super(card); + } - @Override - public VampireNighthawk copy() { - return new VampireNighthawk(this); - } + @Override + public VampireNighthawk copy() { + return new VampireNighthawk(this); + } } diff --git a/Mage.Sets/src/mage/sets/zendikar/VerdantCatacombs.java b/Mage.Sets/src/mage/sets/zendikar/VerdantCatacombs.java index 023b325f7d..add06cfadd 100644 --- a/Mage.Sets/src/mage/sets/zendikar/VerdantCatacombs.java +++ b/Mage.Sets/src/mage/sets/zendikar/VerdantCatacombs.java @@ -40,19 +40,19 @@ import mage.cards.CardImpl; */ public class VerdantCatacombs extends CardImpl { - public VerdantCatacombs(UUID ownerId) { - super(ownerId, 229, "Verdant Catacombs", Rarity.RARE, new CardType[]{CardType.LAND}, null); - this.expansionSetCode = "ZEN"; - this.addAbility(new FetchLandActivatedAbility(new String[] {"Forest", "Swamp"})); - } + public VerdantCatacombs(UUID ownerId) { + super(ownerId, 229, "Verdant Catacombs", Rarity.RARE, new CardType[]{CardType.LAND}, null); + this.expansionSetCode = "ZEN"; + this.addAbility(new FetchLandActivatedAbility(new String[] {"Forest", "Swamp"})); + } - public VerdantCatacombs(final VerdantCatacombs card) { - super(card); - } + public VerdantCatacombs(final VerdantCatacombs card) { + super(card); + } - @Override - public VerdantCatacombs copy() { - return new VerdantCatacombs(this); - } + @Override + public VerdantCatacombs copy() { + return new VerdantCatacombs(this); + } } diff --git a/Mage.Sets/src/mage/sets/zendikar/WelkinTern.java b/Mage.Sets/src/mage/sets/zendikar/WelkinTern.java index 0fd8ff373d..1496bfa135 100644 --- a/Mage.Sets/src/mage/sets/zendikar/WelkinTern.java +++ b/Mage.Sets/src/mage/sets/zendikar/WelkinTern.java @@ -48,11 +48,11 @@ public class WelkinTern extends CardImpl { super(ownerId, 76, "Welkin Tern", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{1}{U}"); this.expansionSetCode = "ZEN"; this.subtype.add("Bird"); - - this.color.setBlue(true); + + this.color.setBlue(true); this.power = new MageInt(2 ); this.toughness = new MageInt( 1); - + this.addAbility(FlyingAbility.getInstance()); this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new CanBlockOnlyFlyingEffect())); } diff --git a/Mage.Sets/src/mage/sets/zendikar/WindriderEel.java b/Mage.Sets/src/mage/sets/zendikar/WindriderEel.java index b5f5ec8fab..844a380bc9 100644 --- a/Mage.Sets/src/mage/sets/zendikar/WindriderEel.java +++ b/Mage.Sets/src/mage/sets/zendikar/WindriderEel.java @@ -48,7 +48,7 @@ public class WindriderEel extends CardImpl { super(ownerId, 78, "Windrider Eel", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{3}{U}"); this.expansionSetCode = "ZEN"; this.subtype.add("Fish"); - this.color.setBlue(true); + this.color.setBlue(true); this.power = new MageInt(2); this.toughness = new MageInt(2); this.addAbility(FlyingAbility.getInstance()); diff --git a/Mage.Tests/config/config.xml b/Mage.Tests/config/config.xml index cc19be31ee..0331f07712 100644 --- a/Mage.Tests/config/config.xml +++ b/Mage.Tests/config/config.xml @@ -1,20 +1,20 @@ - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + diff --git a/Mage.Tests/pom.xml b/Mage.Tests/pom.xml index 1f0bf31202..9cff037309 100644 --- a/Mage.Tests/pom.xml +++ b/Mage.Tests/pom.xml @@ -1,18 +1,18 @@ - + 4.0.0 - - + + org.mage mage-root 0.8.6 - + mage-tests jar Mage Tests - + ${project.groupId} @@ -45,13 +45,13 @@ ${project.version} compile - + ${project.groupId} mage-player-ai ${project.version} compile - + log4j log4j @@ -59,7 +59,7 @@ jar - + @@ -78,10 +78,10 @@ - + mage-tests - + - + 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 c1ac149db1..d544f6d090 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 @@ -65,13 +65,13 @@ public class MageBase { connect("player", "localhost", 17171); UUID roomId = server.getMainRoomId(); - MatchOptions options = new MatchOptions("1", "Two Player Duel"); - options.getPlayerTypes().add("Human"); - options.getPlayerTypes().add("Computer - default"); - options.setDeckType("Limited"); - options.setAttackOption(MultiplayerAttackOption.LEFT); - options.setRange(RangeOfInfluence.ALL); - options.setWinsNeeded(1); + MatchOptions options = new MatchOptions("1", "Two Player Duel"); + options.getPlayerTypes().add("Human"); + options.getPlayerTypes().add("Computer - default"); + options.setDeckType("Limited"); + options.setAttackOption(MultiplayerAttackOption.LEFT); + options.setRange(RangeOfInfluence.ALL); + options.setWinsNeeded(1); TableView table = server.createTable(sessionId, roomId, options); System.out.println("Cards in the deck: " + Sets.loadDeck("UW Control.dck").getCards().size()); server.joinTable(sessionId, roomId, table.getTableId(), "Human", "Human", Sets.loadDeck("UW Control.dck")); @@ -108,8 +108,8 @@ public class MageBase { server.joinGame(gameId, sessionId); } else if (callback.getMethod().equals("gameInit")) { server.ack("gameInit", sessionId); - } else if (callback.getMethod().equals("gameAsk")) { - GameClientMessage message = (GameClientMessage) callback.getData(); + } else if (callback.getMethod().equals("gameAsk")) { + GameClientMessage message = (GameClientMessage) callback.getData(); logger.info("ASK >> " + message.getMessage()); if (message.getMessage().equals("Do you want to take a mulligan?")) { server.sendPlayerBoolean(gameId, sessionId, false); @@ -117,7 +117,7 @@ public class MageBase { synchronized (syncStart) { syncStart.notify(); } - } else if (callback.getMethod().equals("gameTarget")) { + } else if (callback.getMethod().equals("gameTarget")) { GameClientMessage message = (GameClientMessage) callback.getData(); logger.info("TARGET >> " + message.getMessage() + " >> " + message.getTargets()); if (message.getMessage().equals("Select a starting player")) { @@ -125,8 +125,8 @@ public class MageBase { server.sendPlayerUUID(gameId, sessionId, playerId); } } else if (callback.getMethod().equals("gameSelect")) { - GameClientMessage message = (GameClientMessage) callback.getData(); - logger.info("SELECT >> " + message.getMessage()); + GameClientMessage message = (GameClientMessage) callback.getData(); + logger.info("SELECT >> " + message.getMessage()); if (phaseToWait == null) { synchronized (sync) { sync.wait(); @@ -178,7 +178,7 @@ public class MageBase { } } */ - } + } } catch (Exception e) { logger.info(e.getMessage()); } diff --git a/Mage.Tests/src/test/java/org/mage/test/ai/bugs/BugDoesntAttackTest.java b/Mage.Tests/src/test/java/org/mage/test/ai/bugs/BugDoesntAttackTest.java index a09cfad3c6..00d64cf6b2 100644 --- a/Mage.Tests/src/test/java/org/mage/test/ai/bugs/BugDoesntAttackTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/ai/bugs/BugDoesntAttackTest.java @@ -12,31 +12,31 @@ import org.mage.test.serverside.base.CardTestBase; */ public class BugDoesntAttackTest extends CardTestBase { - @Test + @Test @Ignore - public void testAttackWithZephyrSprite() throws Exception { - addCard(Constants.Zone.HAND, playerA, "Zephyr Sprite"); - addCard(Constants.Zone.HAND, playerA, "Island"); - addCard(Constants.Zone.HAND, playerA, "Rupture Spire"); - setLife(playerB, 1); + public void testAttackWithZephyrSprite() throws Exception { + addCard(Constants.Zone.HAND, playerA, "Zephyr Sprite"); + addCard(Constants.Zone.HAND, playerA, "Island"); + addCard(Constants.Zone.HAND, playerA, "Rupture Spire"); + setLife(playerB, 1); setStopOnTurn(4); - execute(); + execute(); - assertLife(playerB, 0); - } + assertLife(playerB, 0); + } @Test @Ignore - public void testAttackWithGoblinGuide() throws Exception { - addCard(Constants.Zone.HAND, playerA, "Goblin Guide"); - addCard(Constants.Zone.HAND, playerA, "Mountain"); + public void testAttackWithGoblinGuide() throws Exception { + addCard(Constants.Zone.HAND, playerA, "Goblin Guide"); + addCard(Constants.Zone.HAND, playerA, "Mountain"); playLand(playerA, "Mountain"); castSpell(playerA, "Goblin Guide"); - execute(); + execute(); - assertLife(playerB, 18); - } + assertLife(playerB, 18); + } } diff --git a/Mage.Tests/src/test/java/org/mage/test/ai/bugs/BugTapsItselfTest.java b/Mage.Tests/src/test/java/org/mage/test/ai/bugs/BugTapsItselfTest.java index 421446cca1..5dc4aa1f8d 100644 --- a/Mage.Tests/src/test/java/org/mage/test/ai/bugs/BugTapsItselfTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/ai/bugs/BugTapsItselfTest.java @@ -16,18 +16,18 @@ import org.mage.test.serverside.base.CardTestBase; */ public class BugTapsItselfTest extends CardTestBase { - @Test + @Test @Ignore - public void testVersusInfectCreature() throws Exception { - useWhiteDefault(); - addCard(Constants.Zone.BATTLEFIELD, playerA, "Blinding Mage"); - addCard(Constants.Zone.BATTLEFIELD, playerB, "Myr Sire"); + public void testVersusInfectCreature() throws Exception { + useWhiteDefault(); + addCard(Constants.Zone.BATTLEFIELD, playerA, "Blinding Mage"); + addCard(Constants.Zone.BATTLEFIELD, playerB, "Myr Sire"); - setStopOnTurn(4); - execute(); + setStopOnTurn(4); + execute(); - assertResult(playerA, GameResult.DRAW); - Permanent permanent = getPermanent("Blinding Mage", playerA.getId()); - Assert.assertFalse("Should have been untapped", permanent.isTapped()); - } + assertResult(playerA, GameResult.DRAW); + Permanent permanent = getPermanent("Blinding Mage", playerA.getId()); + Assert.assertFalse("Should have been untapped", permanent.isTapped()); + } } diff --git a/Mage.Tests/src/test/java/org/mage/test/ai/bugs/TestHavengulLich.java b/Mage.Tests/src/test/java/org/mage/test/ai/bugs/TestHavengulLich.java index 6fd30da484..37c6e1dceb 100644 --- a/Mage.Tests/src/test/java/org/mage/test/ai/bugs/TestHavengulLich.java +++ b/Mage.Tests/src/test/java/org/mage/test/ai/bugs/TestHavengulLich.java @@ -12,17 +12,17 @@ import org.mage.test.serverside.base.CardTestPlayerBase; * @author BetaSteward */ public class TestHavengulLich extends CardTestPlayerBase { - + @Test public void testCard() { addCard(Constants.Zone.GRAVEYARD, playerA, "Gravecrawler"); addCard(Constants.Zone.BATTLEFIELD, playerA, "Black Cat"); addCard(Constants.Zone.BATTLEFIELD, playerA, "Swamp"); - + castSpell(1, Constants.PhaseStep.PRECOMBAT_MAIN, playerA, "Gravecrawler"); setStopAt(1, Constants.PhaseStep.BEGIN_COMBAT); execute(); - + assertLife(playerA, 20); assertLife(playerB, 20); assertPermanentCount(playerA, "Gravecrawler", 1); @@ -33,15 +33,15 @@ public class TestHavengulLich extends CardTestPlayerBase { public void testCard1() { addCard(Constants.Zone.GRAVEYARD, playerA, "Gravecrawler"); addCard(Constants.Zone.BATTLEFIELD, playerA, "Swamp"); - + castSpell(1, Constants.PhaseStep.PRECOMBAT_MAIN, playerA, "Gravecrawler"); setStopAt(1, Constants.PhaseStep.BEGIN_COMBAT); execute(); - + assertLife(playerA, 20); assertLife(playerB, 20); assertPermanentCount(playerA, "Gravecrawler", 0); assertGraveyardCount(playerA, 1); } - + } diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/abilities/activated/LevelUpAbilityTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/abilities/activated/LevelUpAbilityTest.java index dfa28fcaed..9903a787d8 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/abilities/activated/LevelUpAbilityTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/abilities/activated/LevelUpAbilityTest.java @@ -99,7 +99,7 @@ public class LevelUpAbilityTest extends CardTestPlayerBase { Permanent master = getPermanent("Transcendent Master", playerA.getId()); Assert.assertEquals(12, master.getCounters().getCount(CounterType.LEVEL)); - + Assert.assertEquals("Power different", 9, master.getPower().getValue()); Assert.assertEquals("Toughness different", 9, master.getToughness().getValue()); Assert.assertTrue(master.getAbilities().contains(LifelinkAbility.getInstance())); diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/abilities/curses/CursesTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/abilities/curses/CursesTest.java index f492f2b14b..de0fa36498 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/abilities/curses/CursesTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/abilities/curses/CursesTest.java @@ -19,11 +19,11 @@ public class CursesTest extends CardTestPlayerBase { castSpell(1, Constants.PhaseStep.PRECOMBAT_MAIN, playerA, "Curse of Bloodletting", playerB); castSpell(1, Constants.PhaseStep.POSTCOMBAT_MAIN, playerA, "Lightning Bolt", playerB); castSpell(1, Constants.PhaseStep.POSTCOMBAT_MAIN, playerA, "Lightning Bolt", playerA); - + setStopAt(1, Constants.PhaseStep.END_TURN); execute(); - + assertLife(playerA, 17); assertLife(playerB, 14); } @@ -40,7 +40,7 @@ public class CursesTest extends CardTestPlayerBase { setStopAt(1, Constants.PhaseStep.END_TURN); execute(); - + assertHandCount(playerA, 3); assertHandCount(playerB, 3); } @@ -55,11 +55,11 @@ public class CursesTest extends CardTestPlayerBase { castSpell(1, Constants.PhaseStep.PRECOMBAT_MAIN, playerA, "Curse of Exhaustion", playerB); castSpell(1, Constants.PhaseStep.POSTCOMBAT_MAIN, playerB, "Lightning Bolt", playerA); castSpell(1, Constants.PhaseStep.POSTCOMBAT_MAIN, playerB, "Lightning Bolt", playerA); - + setStopAt(1, Constants.PhaseStep.END_TURN); execute(); - + assertLife(playerB, 20); assertLife(playerA, 17); } @@ -74,11 +74,11 @@ public class CursesTest extends CardTestPlayerBase { castSpell(1, Constants.PhaseStep.PRECOMBAT_MAIN, playerA, "Curse of Exhaustion", playerB); castSpell(1, Constants.PhaseStep.POSTCOMBAT_MAIN, playerA, "Lightning Bolt", playerB); castSpell(1, Constants.PhaseStep.POSTCOMBAT_MAIN, playerA, "Lightning Bolt", playerB); - + setStopAt(1, Constants.PhaseStep.END_TURN); execute(); - + assertLife(playerA, 20); assertLife(playerB, 14); } @@ -92,7 +92,7 @@ public class CursesTest extends CardTestPlayerBase { setStopAt(2, Constants.PhaseStep.DRAW); execute(); - + assertLife(playerA, 20); assertLife(playerB, 19); } @@ -109,11 +109,11 @@ public class CursesTest extends CardTestPlayerBase { setStopAt(2, Constants.PhaseStep.DRAW); execute(); - + assertLife(playerA, 20); assertLife(playerB, 16); } - + @Test public void testCurseOfMisfortune1() { removeAllCardsFromLibrary(playerA); @@ -125,7 +125,7 @@ public class CursesTest extends CardTestPlayerBase { setStopAt(3, Constants.PhaseStep.DRAW); execute(); - + assertLife(playerA, 20); assertLife(playerB, 20); assertPermanentCount(playerA, "Curse of Misfortunes", 1); @@ -142,7 +142,7 @@ public class CursesTest extends CardTestPlayerBase { setStopAt(3, Constants.PhaseStep.DRAW); execute(); - + assertLife(playerA, 20); assertLife(playerB, 20); assertPermanentCount(playerA, "Curse of Misfortunes", 1); diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/abilities/enters/AEtherFigmentTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/abilities/enters/AEtherFigmentTest.java index 39c81591a3..1d27ab265b 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/abilities/enters/AEtherFigmentTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/abilities/enters/AEtherFigmentTest.java @@ -21,7 +21,7 @@ public class AEtherFigmentTest extends CardTestPlayerBase { setStopAt(1, Constants.PhaseStep.BEGIN_COMBAT); execute(); - + assertLife(playerA, 20); assertLife(playerB, 20); assertPermanentCount(playerA, "AEther Figment", 1); diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/abilities/enters/ProteanHydraTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/abilities/enters/ProteanHydraTest.java index d4bbf56c9a..a4e556ac4c 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/abilities/enters/ProteanHydraTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/abilities/enters/ProteanHydraTest.java @@ -21,7 +21,7 @@ public class ProteanHydraTest extends CardTestPlayerBase { setStopAt(1, Constants.PhaseStep.BEGIN_COMBAT); execute(); - + assertLife(playerA, 20); assertLife(playerB, 20); diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/abilities/equipped/GolemSkinGauntletsTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/abilities/equipped/GolemSkinGauntletsTest.java index ae8a6b09a4..47dabdf10b 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/abilities/equipped/GolemSkinGauntletsTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/abilities/equipped/GolemSkinGauntletsTest.java @@ -24,10 +24,10 @@ public class GolemSkinGauntletsTest extends CardTestPlayerBase { activateAbility(1, Constants.PhaseStep.PRECOMBAT_MAIN, playerA, "Equip {4}", "Elite Vanguard"); activateAbility(1, Constants.PhaseStep.PRECOMBAT_MAIN, playerA, "Equip {2}", "Elite Vanguard"); - + setStopAt(1, Constants.PhaseStep.BEGIN_COMBAT); execute(); - + assertLife(playerA, 20); assertLife(playerB, 20); diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/abilities/equipped/HeavyArbalestTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/abilities/equipped/HeavyArbalestTest.java index 6ba61f034b..1681004f93 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/abilities/equipped/HeavyArbalestTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/abilities/equipped/HeavyArbalestTest.java @@ -24,10 +24,10 @@ public class HeavyArbalestTest extends CardTestPlayerBase { activateAbility(1, Constants.PhaseStep.PRECOMBAT_MAIN, playerA, "Equip {4}", "Elite Vanguard"); activateAbility(1, Constants.PhaseStep.PRECOMBAT_MAIN, playerA, "{T}: {source} deals 2 damage", playerB); - + setStopAt(3, Constants.PhaseStep.BEGIN_COMBAT); execute(); - + assertLife(playerA, 20); assertLife(playerB, 18); diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/abilities/keywords/AffinityForArtifactsTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/abilities/keywords/AffinityForArtifactsTest.java index bd9c7ee656..9c73529857 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/abilities/keywords/AffinityForArtifactsTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/abilities/keywords/AffinityForArtifactsTest.java @@ -21,7 +21,7 @@ public class AffinityForArtifactsTest extends CardTestPlayerBase { setStopAt(1, Constants.PhaseStep.BEGIN_COMBAT); execute(); - + assertPermanentCount(playerA, "Myr Enforcer", 4); } diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/abilities/lose/LoseAbilityTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/abilities/lose/LoseAbilityTest.java index 2288bd625f..c4c15a11ec 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/abilities/lose/LoseAbilityTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/abilities/lose/LoseAbilityTest.java @@ -26,7 +26,7 @@ public class LoseAbilityTest extends CardTestPlayerBase { setStopAt(2, Constants.PhaseStep.END_TURN); execute(); - + assertLife(playerA, 20); assertLife(playerB, 20); diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/abilities/oneshot/counterspell/SecondGuessTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/abilities/oneshot/counterspell/SecondGuessTest.java index 137b95cdbc..69b32ad9be 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/abilities/oneshot/counterspell/SecondGuessTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/abilities/oneshot/counterspell/SecondGuessTest.java @@ -22,7 +22,7 @@ public class SecondGuessTest extends CardTestPlayerBase { setStopAt(1, Constants.PhaseStep.END_TURN); execute(); - + assertLife(playerA, 20); assertLife(playerB, 17); diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/abilities/oneshot/damage/SpitefulShadowsTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/abilities/oneshot/damage/SpitefulShadowsTest.java index 5b8110931d..50949bde3a 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/abilities/oneshot/damage/SpitefulShadowsTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/abilities/oneshot/damage/SpitefulShadowsTest.java @@ -21,13 +21,13 @@ public class SpitefulShadowsTest extends CardTestPlayerBase { addCard(Constants.Zone.BATTLEFIELD, playerA, "Mountain", 2); addCard(Constants.Zone.HAND, playerA, "Spiteful Shadows"); addCard(Constants.Zone.HAND, playerA, "Lightning Bolt"); - + castSpell(1, Constants.PhaseStep.PRECOMBAT_MAIN, playerA, "Spiteful Shadows", "Glistener Elf"); castSpell(1, Constants.PhaseStep.POSTCOMBAT_MAIN, playerA, "Lightning Bolt", "Glistener Elf"); setStopAt(1, Constants.PhaseStep.END_TURN); execute(); - + assertLife(playerA, 20); assertLife(playerB, 20); assertCounterCount(playerA, CounterType.POISON, 3); @@ -40,13 +40,13 @@ public class SpitefulShadowsTest extends CardTestPlayerBase { addCard(Constants.Zone.BATTLEFIELD, playerA, "Mountain", 2); addCard(Constants.Zone.HAND, playerA, "Spiteful Shadows"); addCard(Constants.Zone.HAND, playerA, "Lightning Bolt"); - + castSpell(1, Constants.PhaseStep.PRECOMBAT_MAIN, playerA, "Spiteful Shadows", "Craw Wurm"); castSpell(1, Constants.PhaseStep.POSTCOMBAT_MAIN, playerA, "Lightning Bolt", "Craw Wurm"); setStopAt(1, Constants.PhaseStep.END_TURN); execute(); - + assertLife(playerA, 17); assertLife(playerB, 20); assertCounterCount(playerA, CounterType.POISON, 0); diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/abilities/oneshot/regenerate/NecrobiteRegenerateTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/abilities/oneshot/regenerate/NecrobiteRegenerateTest.java index f46691e2f5..d2d0fe045b 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/abilities/oneshot/regenerate/NecrobiteRegenerateTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/abilities/oneshot/regenerate/NecrobiteRegenerateTest.java @@ -23,10 +23,10 @@ public class NecrobiteRegenerateTest extends CardTestPlayerBase { attack(2, playerB, "Elite Vanguard"); block(2, playerA, "Craw Wurm", "Elite Vanguard"); castSpell(2, Constants.PhaseStep.DECLARE_BLOCKERS, playerB, "Necrobite", "Elite Vanguard"); - + setStopAt(2, Constants.PhaseStep.POSTCOMBAT_MAIN); execute(); - + assertLife(playerA, 20); assertLife(playerB, 20); diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/asthough/AlchemistsRefugeTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/asthough/AlchemistsRefugeTest.java index bd6e8498b2..f615dfd6bc 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/asthough/AlchemistsRefugeTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/asthough/AlchemistsRefugeTest.java @@ -25,7 +25,7 @@ public class AlchemistsRefugeTest extends CardTestPlayerBase { setStopAt(2, Constants.PhaseStep.BEGIN_COMBAT); execute(); - + assertLife(playerA, 20); assertLife(playerB, 20); assertPermanentCount(playerA, "Elite Vanguard", 1); diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/control/BattlefieldTriggeredAbilitiesTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/control/BattlefieldTriggeredAbilitiesTest.java index 33fde8507b..12c45802df 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/control/BattlefieldTriggeredAbilitiesTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/control/BattlefieldTriggeredAbilitiesTest.java @@ -25,7 +25,7 @@ public class BattlefieldTriggeredAbilitiesTest extends CardTestPlayerBase { setStopAt(4, Constants.PhaseStep.END_TURN); execute(); - + assertLife(playerA, 14); assertLife(playerB, 20); diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/cost/kicker/GatekeeperOfMalakirTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/cost/kicker/GatekeeperOfMalakirTest.java index 8cf6af0ca7..c10ece10db 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/cost/kicker/GatekeeperOfMalakirTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/cost/kicker/GatekeeperOfMalakirTest.java @@ -20,7 +20,7 @@ public class GatekeeperOfMalakirTest extends CardTestPlayerBase { setStopAt(1, Constants.PhaseStep.BEGIN_COMBAT); execute(); - + assertLife(playerA, 20); assertLife(playerB, 20); assertPermanentCount(playerA, "Gatekeeper of Malakir", 1); @@ -28,5 +28,5 @@ public class GatekeeperOfMalakirTest extends CardTestPlayerBase { assertGraveyardCount(playerB, 1); } - + } diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/cost/modification/ArcaneMeleeTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/cost/modification/ArcaneMeleeTest.java index 3dde294863..b39236fcfd 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/cost/modification/ArcaneMeleeTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/cost/modification/ArcaneMeleeTest.java @@ -31,7 +31,7 @@ public class ArcaneMeleeTest extends CardTestPlayerBase { setStopAt(1, Constants.PhaseStep.BEGIN_COMBAT); execute(); - + assertLife(playerA, 20); assertLife(playerB, 20); // by default players don't draw 7 cards at startup in tests (it can be changed through command though) diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/cost/modification/ThaliaGuardianOfThrabenTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/cost/modification/ThaliaGuardianOfThrabenTest.java index 7b5d8ae589..2a5b931cff 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/cost/modification/ThaliaGuardianOfThrabenTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/cost/modification/ThaliaGuardianOfThrabenTest.java @@ -11,17 +11,17 @@ import org.mage.test.serverside.base.CardTestPlayerBase; * @author BetaSteward */ public class ThaliaGuardianOfThrabenTest extends CardTestPlayerBase { - + @Test public void testCard() { addCard(Constants.Zone.BATTLEFIELD, playerA, "Thalia, Guardian of Thraben"); addCard(Constants.Zone.BATTLEFIELD, playerA, "Mountain"); addCard(Constants.Zone.HAND, playerA, "Lightning Bolt"); - + castSpell(1, Constants.PhaseStep.PRECOMBAT_MAIN, playerA, "Lightning Bolt", playerB); setStopAt(1, Constants.PhaseStep.BEGIN_COMBAT); execute(); - + assertLife(playerA, 20); assertLife(playerB, 20); assertGraveyardCount(playerA, 0); @@ -32,14 +32,14 @@ public class ThaliaGuardianOfThrabenTest extends CardTestPlayerBase { addCard(Constants.Zone.BATTLEFIELD, playerA, "Thalia, Guardian of Thraben"); addCard(Constants.Zone.BATTLEFIELD, playerA, "Mountain", 2); addCard(Constants.Zone.HAND, playerA, "Lightning Bolt"); - + castSpell(1, Constants.PhaseStep.PRECOMBAT_MAIN, playerA, "Lightning Bolt", playerB); setStopAt(1, Constants.PhaseStep.BEGIN_COMBAT); execute(); - + assertLife(playerA, 20); assertLife(playerB, 17); assertGraveyardCount(playerA, 1); } - + } diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/cost/sacrifice/MomentousFallTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/cost/sacrifice/MomentousFallTest.java index 48ed636b37..64219c07a9 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/cost/sacrifice/MomentousFallTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/cost/sacrifice/MomentousFallTest.java @@ -21,7 +21,7 @@ public class MomentousFallTest extends CardTestPlayerBase { setStopAt(1, Constants.PhaseStep.BEGIN_COMBAT); execute(); - + assertPermanentCount(playerA, "Geralf's Messenger", 1); assertPowerToughness(playerA, "Geralf's Messenger", 5, 4); // +1/+1 counter + Anthem effect assertHandCount(playerA, 4); // +4 cards @@ -44,5 +44,5 @@ public class MomentousFallTest extends CardTestPlayerBase { assertLife(playerA, 22); // +2 life } - + } diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/cost/variable/MikaeusTheLunarchTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/cost/variable/MikaeusTheLunarchTest.java index e546a8c493..c3baf880bc 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/cost/variable/MikaeusTheLunarchTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/cost/variable/MikaeusTheLunarchTest.java @@ -22,9 +22,9 @@ public class MikaeusTheLunarchTest extends CardTestPlayerBase { setStopAt(1, Constants.PhaseStep.BEGIN_COMBAT); execute(); - + assertPermanentCount(playerA, "Mikaeus, the Lunarch", 1); } - + } diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/filters/MassAppealTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/filters/MassAppealTest.java index a640b8f055..a2eade048a 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/filters/MassAppealTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/filters/MassAppealTest.java @@ -19,7 +19,7 @@ public class MassAppealTest extends CardTestPlayerBase { setStopAt(1, Constants.PhaseStep.BEGIN_COMBAT); execute(); - + assertLife(playerA, 20); assertLife(playerB, 20); assertHandCount(playerA, 0); diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/filters/WhipflareTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/filters/WhipflareTest.java index ee12910a7f..8184a2292e 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/filters/WhipflareTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/filters/WhipflareTest.java @@ -24,7 +24,7 @@ public class WhipflareTest extends CardTestPlayerBase { setStopAt(1, Constants.PhaseStep.BEGIN_COMBAT); execute(); - + assertLife(playerA, 20); assertLife(playerB, 20); diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/single/AlphaBrawlTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/single/AlphaBrawlTest.java index 5a03be99af..08abc892c0 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/single/AlphaBrawlTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/single/AlphaBrawlTest.java @@ -17,36 +17,36 @@ public class AlphaBrawlTest extends CardTestPlayerBase { addCard(Constants.Zone.HAND, playerA, "Alpha Brawl"); addCard(Constants.Zone.BATTLEFIELD, playerB, "Air Elemental", 1); addCard(Constants.Zone.BATTLEFIELD, playerB, "Horned Turtle", 4); - + castSpell(1, Constants.PhaseStep.PRECOMBAT_MAIN, playerA, "Alpha Brawl", "Air Elemental"); setStopAt(1, Constants.PhaseStep.BEGIN_COMBAT); execute(); - + assertLife(playerA, 20); assertLife(playerB, 20); assertPermanentCount(playerB, "Air Elemental", 0); assertPermanentCount(playerB, "Horned Turtle", 0); } - + @Test public void testCardWithInfect() { addCard(Constants.Zone.BATTLEFIELD, playerA, "Mountain", 8); addCard(Constants.Zone.HAND, playerA, "Alpha Brawl"); addCard(Constants.Zone.BATTLEFIELD, playerB, "Blackcleave Goblin", 1); addCard(Constants.Zone.BATTLEFIELD, playerB, "Air Elemental", 2); - + castSpell(1, Constants.PhaseStep.PRECOMBAT_MAIN, playerA, "Alpha Brawl", "Blackcleave Goblin"); setStopAt(1, Constants.PhaseStep.BEGIN_COMBAT); execute(); - + assertLife(playerA, 20); assertLife(playerB, 20); assertPermanentCount(playerB, "Blackcleave Goblin", 0); assertPermanentCount(playerB, "Air Elemental", 2); assertPowerToughness(playerB, "Air Elemental", 2, 2, Filter.ComparisonScope.All); } - + } diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/single/AltarOfTheLostTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/single/AltarOfTheLostTest.java index a56230cf00..a49e1de8fb 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/single/AltarOfTheLostTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/single/AltarOfTheLostTest.java @@ -9,7 +9,7 @@ import org.mage.test.serverside.base.CardTestPlayerBase; * @author BetaSteward */ public class AltarOfTheLostTest extends CardTestPlayerBase { - + @Test public void testCard() { addCard(Constants.Zone.BATTLEFIELD, playerA, "Altar of the Lost"); @@ -21,7 +21,7 @@ public class AltarOfTheLostTest extends CardTestPlayerBase { activateAbility(3, Constants.PhaseStep.PRECOMBAT_MAIN, playerA, "Flashback {1}{B}"); setStopAt(3, Constants.PhaseStep.BEGIN_COMBAT); execute(); - + assertLife(playerA, 20); assertLife(playerB, 20); assertPermanentCount(playerA, "Spirit", 2); @@ -39,10 +39,10 @@ public class AltarOfTheLostTest extends CardTestPlayerBase { castSpell(3, Constants.PhaseStep.PRECOMBAT_MAIN, playerA, "Lingering Souls"); setStopAt(3, Constants.PhaseStep.BEGIN_COMBAT); execute(); - + assertLife(playerA, 20); assertLife(playerB, 20); assertPermanentCount(playerA, "Spirit", 0); } - + } diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/single/ArchangelsLightTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/single/ArchangelsLightTest.java index a8736273e3..f61062005d 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/single/ArchangelsLightTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/single/ArchangelsLightTest.java @@ -21,7 +21,7 @@ public class ArchangelsLightTest extends CardTestPlayerBase { setStopAt(1, Constants.PhaseStep.BEGIN_COMBAT); execute(); - + assertLife(playerA, 32); assertLife(playerB, 20); assertGraveyardCount(playerA, 1); @@ -29,5 +29,5 @@ public class ArchangelsLightTest extends CardTestPlayerBase { Assert.assertEquals(currentGame.getPlayer(playerA.getId()).getLibrary().size(), 77); } - + } diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/single/ArrogantBloodlordTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/single/ArrogantBloodlordTest.java index 611775cf47..19b345e960 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/single/ArrogantBloodlordTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/single/ArrogantBloodlordTest.java @@ -14,13 +14,13 @@ public class ArrogantBloodlordTest extends CardTestPlayerBase { public void testCardBlocked() { addCard(Constants.Zone.BATTLEFIELD, playerA, "Arrogant Bloodlord"); addCard(Constants.Zone.BATTLEFIELD, playerB, "Wall of Air"); - + attack(1, playerA, "Arrogant Bloodlord"); block(1, playerB, "Wall of Air", "Arrogant Bloodlord"); setStopAt(1, Constants.PhaseStep.END_TURN); execute(); - + assertLife(playerA, 20); assertLife(playerB, 20); assertPermanentCount(playerA, "Arrogant Bloodlord", 0); @@ -31,13 +31,13 @@ public class ArrogantBloodlordTest extends CardTestPlayerBase { public void testCardBlocker() { addCard(Constants.Zone.BATTLEFIELD, playerA, "Caravan Hurda"); addCard(Constants.Zone.BATTLEFIELD, playerB, "Arrogant Bloodlord"); - + attack(1, playerA, "Caravan Hurda"); block(1, playerB, "Arrogant Bloodlord", "Caravan Hurda"); setStopAt(1, Constants.PhaseStep.END_TURN); execute(); - + assertLife(playerA, 21); assertLife(playerB, 20); assertPermanentCount(playerA, "Caravan Hurda", 1); @@ -48,13 +48,13 @@ public class ArrogantBloodlordTest extends CardTestPlayerBase { public void testCardBlockedNonTrigger() { addCard(Constants.Zone.BATTLEFIELD, playerA, "Arrogant Bloodlord"); addCard(Constants.Zone.BATTLEFIELD, playerB, "Grizzly Bears"); - + attack(1, playerA, "Arrogant Bloodlord"); block(1, playerB, "Grizzly Bears", "Arrogant Bloodlord"); setStopAt(1, Constants.PhaseStep.END_TURN); execute(); - + assertLife(playerA, 20); assertLife(playerB, 20); assertPermanentCount(playerA, "Arrogant Bloodlord", 1); @@ -65,13 +65,13 @@ public class ArrogantBloodlordTest extends CardTestPlayerBase { public void testCardBlocksNonTrigger() { addCard(Constants.Zone.BATTLEFIELD, playerA, "Acid Web Spider"); addCard(Constants.Zone.BATTLEFIELD, playerB, "Arrogant Bloodlord"); - + attack(1, playerA, "Acid Web Spider"); block(1, playerB, "Arrogant Bloodlord", "Acid Web Spider"); setStopAt(1, Constants.PhaseStep.END_TURN); execute(); - + assertLife(playerA, 20); assertLife(playerB, 20); assertPermanentCount(playerA, "Acid Web Spider", 1); diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/single/BurntheImpureTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/single/BurntheImpureTest.java index 2d8f004243..36cdf9ac89 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/single/BurntheImpureTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/single/BurntheImpureTest.java @@ -15,62 +15,62 @@ import org.mage.test.serverside.base.CardTestBase; @Ignore public class BurntheImpureTest extends CardTestBase { - /** - * Reproduces the test written in MBS/Burn the Impure.test - * - * Actually it can be tested with one java line that loads all test metadata from text file: - * load("MBS/Burn the Impure.test"); - * - * But it was decided to use java code only. - * - * @throws Exception - */ - @Test - public void testVersusInfectCreature() throws Exception { - // $include red.default - useRedDefault(); - // hand:ComputerA:Burn the Impure:1 - addCard(Constants.Zone.HAND, playerA, "Burn the Impure"); - // battlefield:ComputerB:Tine Shrike:1 - addCard(Constants.Zone.BATTLEFIELD, playerB, "Tine Shrike"); - // player:ComputerB:life:3 - setLife(playerB, 3); + /** + * Reproduces the test written in MBS/Burn the Impure.test + * + * Actually it can be tested with one java line that loads all test metadata from text file: + * load("MBS/Burn the Impure.test"); + * + * But it was decided to use java code only. + * + * @throws Exception + */ + @Test + public void testVersusInfectCreature() throws Exception { + // $include red.default + useRedDefault(); + // hand:ComputerA:Burn the Impure:1 + addCard(Constants.Zone.HAND, playerA, "Burn the Impure"); + // battlefield:ComputerB:Tine Shrike:1 + addCard(Constants.Zone.BATTLEFIELD, playerB, "Tine Shrike"); + // player:ComputerB:life:3 + setLife(playerB, 3); - setStopOnTurn(2); - execute(); + setStopOnTurn(2); + execute(); - // turn:1 - assertTurn(1); - // result:won - assertResult(playerA, CardTestAPI.GameResult.WON); - // life:ComputerA:20 - assertLife(playerA, 20); - // life:ComputerB:0 - assertLife(playerB, 0); - // assert Tine Shrike has been killed - assertPermanentCount(playerB, "Tine Shrike", 0); - } + // turn:1 + assertTurn(1); + // result:won + assertResult(playerA, CardTestAPI.GameResult.WON); + // life:ComputerA:20 + assertLife(playerA, 20); + // life:ComputerB:0 + assertLife(playerB, 0); + // assert Tine Shrike has been killed + assertPermanentCount(playerB, "Tine Shrike", 0); + } - /** - * load("MBS/Burn the Impure - no infect.test"); - * @throws Exception - */ - @Test - public void testVersusNonInfectCreature() throws Exception { - useRedDefault(); - addCard(Constants.Zone.HAND, playerA, "Burn the Impure"); - addCard(Constants.Zone.BATTLEFIELD, playerB, "Runeclaw Bear", 3); - setLife(playerB, 3); + /** + * load("MBS/Burn the Impure - no infect.test"); + * @throws Exception + */ + @Test + public void testVersusNonInfectCreature() throws Exception { + useRedDefault(); + addCard(Constants.Zone.HAND, playerA, "Burn the Impure"); + addCard(Constants.Zone.BATTLEFIELD, playerB, "Runeclaw Bear", 3); + setLife(playerB, 3); - setStopOnTurn(2); - execute(); + setStopOnTurn(2); + execute(); - assertTurn(2); - assertResult(playerA, CardTestAPI.GameResult.DRAW); - assertLife(playerA, 20); - assertLife(playerB, 3); - assertPermanentCount(playerB, "Runeclaw Bear", 2); - assertPowerToughness(playerB, "Runeclaw Bear", 2, 2, Filter.ComparisonScope.Any); - assertPowerToughness(playerB, "Runeclaw Bear", 2, 2, Filter.ComparisonScope.All); - } + assertTurn(2); + assertResult(playerA, CardTestAPI.GameResult.DRAW); + assertLife(playerA, 20); + assertLife(playerB, 3); + assertPermanentCount(playerB, "Runeclaw Bear", 2); + assertPowerToughness(playerB, "Runeclaw Bear", 2, 2, Filter.ComparisonScope.Any); + assertPowerToughness(playerB, "Runeclaw Bear", 2, 2, Filter.ComparisonScope.All); + } } diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/single/ClingingMistsTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/single/ClingingMistsTest.java index 61bb873e17..9c8cccd2bb 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/single/ClingingMistsTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/single/ClingingMistsTest.java @@ -18,13 +18,13 @@ public class ClingingMistsTest extends CardTestPlayerBase { addCard(Constants.Zone.BATTLEFIELD, playerA, "White Knight"); addCard(Constants.Zone.BATTLEFIELD, playerA, "Forest", 3); addCard(Constants.Zone.HAND, playerA, "Clinging Mists"); - + castSpell(1, Constants.PhaseStep.PRECOMBAT_MAIN, playerA, "Clinging Mists"); attack(1, playerA, "White Knight"); setStopAt(1, Constants.PhaseStep.END_TURN); execute(); - + assertLife(playerA, 20); assertLife(playerB, 20); } @@ -35,13 +35,13 @@ public class ClingingMistsTest extends CardTestPlayerBase { addCard(Constants.Zone.BATTLEFIELD, playerA, "Abbey Griffin"); addCard(Constants.Zone.BATTLEFIELD, playerA, "Forest", 3); addCard(Constants.Zone.HAND, playerA, "Clinging Mists"); - + attack(1, playerA, "Abbey Griffin"); castSpell(1, Constants.PhaseStep.DECLARE_BLOCKERS, playerA, "Clinging Mists"); setStopAt(3, Constants.PhaseStep.END_TURN); execute(); - + assertLife(playerA, 5); assertLife(playerB, 20); assertTapped("Abbey Griffin", true); @@ -55,14 +55,14 @@ public class ClingingMistsTest extends CardTestPlayerBase { addCard(Constants.Zone.BATTLEFIELD, playerB, "Mountain"); addCard(Constants.Zone.BATTLEFIELD, playerB, "Abbey Griffin"); addCard(Constants.Zone.HAND, playerB, "Lightning Bolt"); - + attack(2, playerB, "Abbey Griffin"); castSpell(2, Constants.PhaseStep.DECLARE_BLOCKERS, playerA, "Clinging Mists"); castSpell(2, Constants.PhaseStep.POSTCOMBAT_MAIN, playerB, "Lightning Bolt", playerA); setStopAt(6, Constants.PhaseStep.DRAW); execute(); - + assertLife(playerA, 2); assertLife(playerB, 20); assertTapped("Abbey Griffin", false); diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/single/CobraTrapTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/single/CobraTrapTest.java index 9f647b0121..ecadb443ea 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/single/CobraTrapTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/single/CobraTrapTest.java @@ -16,13 +16,13 @@ public class CobraTrapTest extends CardTestPlayerBase { addCard(Constants.Zone.HAND, playerA, "Cobra Trap"); addCard(Constants.Zone.BATTLEFIELD, playerB, "Mountain", 3); addCard(Constants.Zone.HAND, playerB, "Stone Rain"); - + castSpell(2, Constants.PhaseStep.PRECOMBAT_MAIN, playerB, "Stone Rain", "Forest"); castSpell(2, Constants.PhaseStep.POSTCOMBAT_MAIN, playerA, "Cobra Trap"); setStopAt(2, Constants.PhaseStep.END_TURN); execute(); - + assertLife(playerA, 20); assertLife(playerB, 20); assertPermanentCount(playerA, "Forest", 1); @@ -35,12 +35,12 @@ public class CobraTrapTest extends CardTestPlayerBase { addCard(Constants.Zone.HAND, playerA, "Cobra Trap"); addCard(Constants.Zone.BATTLEFIELD, playerB, "Mountain", 3); addCard(Constants.Zone.HAND, playerB, "Stone Rain"); - + castSpell(2, Constants.PhaseStep.POSTCOMBAT_MAIN, playerA, "Cobra Trap"); setStopAt(2, Constants.PhaseStep.END_TURN); execute(); - + assertLife(playerA, 20); assertLife(playerB, 20); assertPermanentCount(playerA, "Forest", 2); diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/single/CounterlashTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/single/CounterlashTest.java index 5e785a3c4f..f711c26da0 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/single/CounterlashTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/single/CounterlashTest.java @@ -23,7 +23,7 @@ public class CounterlashTest extends CardTestPlayerBase { setStopAt(1, Constants.PhaseStep.BEGIN_COMBAT); execute(); - + assertLife(playerA, 20); assertLife(playerB, 40); assertGraveyardCount(playerA, 1); @@ -31,5 +31,5 @@ public class CounterlashTest extends CardTestPlayerBase { } - + } diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/single/DungeonGeistsTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/single/DungeonGeistsTest.java index fa9241e4e4..914ec6a150 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/single/DungeonGeistsTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/single/DungeonGeistsTest.java @@ -9,17 +9,17 @@ import org.mage.test.serverside.base.CardTestPlayerBase; * @author BetaSteward */ public class DungeonGeistsTest extends CardTestPlayerBase { - + @Test public void testCard() { addCard(Constants.Zone.BATTLEFIELD, playerA, "Island", 4); addCard(Constants.Zone.HAND, playerA, "Dungeon Geists"); addCard(Constants.Zone.BATTLEFIELD, playerB, "Craw Wurm"); - + castSpell(1, Constants.PhaseStep.PRECOMBAT_MAIN, playerA, "Dungeon Geists"); setStopAt(2, Constants.PhaseStep.DRAW); execute(); - + assertLife(playerA, 20); assertLife(playerB, 20); assertPermanentCount(playerA, "Dungeon Geists", 1); @@ -35,12 +35,12 @@ public class DungeonGeistsTest extends CardTestPlayerBase { addCard(Constants.Zone.BATTLEFIELD, playerB, "Craw Wurm"); addCard(Constants.Zone.HAND, playerB, "Act of Treason"); addCard(Constants.Zone.BATTLEFIELD, playerB, "Mountain", 3); - + castSpell(1, Constants.PhaseStep.PRECOMBAT_MAIN, playerA, "Dungeon Geists"); castSpell(2, Constants.PhaseStep.PRECOMBAT_MAIN, playerB, "Act of Treason", "Dungeon Geists"); setStopAt(4, Constants.PhaseStep.DRAW); execute(); - + assertLife(playerA, 20); assertLife(playerB, 20); assertPermanentCount(playerA, "Dungeon Geists", 1); @@ -55,12 +55,12 @@ public class DungeonGeistsTest extends CardTestPlayerBase { addCard(Constants.Zone.HAND, playerA, "Dungeon Geists"); addCard(Constants.Zone.HAND, playerA, "Mind Control"); addCard(Constants.Zone.BATTLEFIELD, playerB, "Craw Wurm"); - + castSpell(1, Constants.PhaseStep.PRECOMBAT_MAIN, playerA, "Dungeon Geists"); castSpell(1, Constants.PhaseStep.POSTCOMBAT_MAIN, playerA, "Mind Control", "Craw Wurm"); setStopAt(3, Constants.PhaseStep.DRAW); execute(); - + assertLife(playerA, 20); assertLife(playerB, 20); assertPermanentCount(playerA, "Dungeon Geists", 1); diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/single/ElbrusTheBindingBladeTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/single/ElbrusTheBindingBladeTest.java index 9734d2e1b3..e6229901ba 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/single/ElbrusTheBindingBladeTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/single/ElbrusTheBindingBladeTest.java @@ -15,14 +15,14 @@ public class ElbrusTheBindingBladeTest extends CardTestPlayerBase { addCard(Constants.Zone.BATTLEFIELD, playerA, "Mountain"); addCard(Constants.Zone.BATTLEFIELD, playerA, "Air Elemental"); addCard(Constants.Zone.BATTLEFIELD, playerA, "Elbrus, the Binding Blade"); - + activateAbility(1, Constants.PhaseStep.PRECOMBAT_MAIN, playerA, "Equip {1}", "Air Elemental"); attack(1, playerA, "Air Elemental"); setStopAt(1, Constants.PhaseStep.END_COMBAT); execute(); - + assertLife(playerA, 20); assertLife(playerB, 15); assertPermanentCount(playerA, "Air Elemental", 1); diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/single/ExquisiteBloodTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/single/ExquisiteBloodTest.java index faaf7b120b..d2ce0f8b09 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/single/ExquisiteBloodTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/single/ExquisiteBloodTest.java @@ -36,7 +36,7 @@ public class ExquisiteBloodTest extends CardTestPlayerBase { setStopAt(2, Constants.PhaseStep.BEGIN_COMBAT); execute(); - + assertLife(playerB, 12); assertLife(playerA, 26); } diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/single/FaithsShieldTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/single/FaithsShieldTest.java index 00504df070..924c0dd687 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/single/FaithsShieldTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/single/FaithsShieldTest.java @@ -20,14 +20,14 @@ public class FaithsShieldTest extends CardTestPlayerBase { addCard(Constants.Zone.BATTLEFIELD, playerA, "Mountain"); addCard(Constants.Zone.HAND, playerA, "Faith's Shield"); addCard(Constants.Zone.HAND, playerA, "Lightning Bolt"); - + setChoice(playerA, "Red"); castSpell(1, Constants.PhaseStep.PRECOMBAT_MAIN, playerA, "Faith's Shield", "White Knight"); castSpell(1, Constants.PhaseStep.POSTCOMBAT_MAIN, playerA, "Lightning Bolt", "White Knight"); setStopAt(1, Constants.PhaseStep.END_TURN); execute(); - + assertLife(playerA, 20); assertLife(playerB, 17); assertPermanentCount(playerA, "White Knight", 1); @@ -41,14 +41,14 @@ public class FaithsShieldTest extends CardTestPlayerBase { addCard(Constants.Zone.BATTLEFIELD, playerA, "Mountain"); addCard(Constants.Zone.HAND, playerA, "Faith's Shield"); addCard(Constants.Zone.HAND, playerA, "Lightning Bolt"); - + setChoice(playerA, "Red"); castSpell(1, Constants.PhaseStep.PRECOMBAT_MAIN, playerA, "Faith's Shield", "White Knight"); castSpell(1, Constants.PhaseStep.POSTCOMBAT_MAIN, playerA, "Lightning Bolt", playerA); setStopAt(1, Constants.PhaseStep.END_TURN); execute(); - + assertLife(playerA, 5); assertLife(playerB, 20); } diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/single/FeedThePackTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/single/FeedThePackTest.java index 1bf10f31c5..1a19958401 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/single/FeedThePackTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/single/FeedThePackTest.java @@ -9,15 +9,15 @@ import org.mage.test.serverside.base.CardTestPlayerBase; * @author BetaSteward */ public class FeedThePackTest extends CardTestPlayerBase { - + @Test public void testCard() { addCard(Constants.Zone.BATTLEFIELD, playerA, "Feed the Pack"); addCard(Constants.Zone.BATTLEFIELD, playerA, "Craw Wurm"); - + setStopAt(2, Constants.PhaseStep.DRAW); execute(); - + assertLife(playerA, 20); assertLife(playerB, 20); assertPermanentCount(playerA, "Wolf", 4); diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/single/FiendOfTheShadowsTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/single/FiendOfTheShadowsTest.java index 7ada4c85a2..d8f6e72b6f 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/single/FiendOfTheShadowsTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/single/FiendOfTheShadowsTest.java @@ -19,13 +19,13 @@ public class FiendOfTheShadowsTest extends CardTestPlayerBase { addCard(Constants.Zone.BATTLEFIELD, playerA, "Fiend of the Shadows"); addCard(Constants.Zone.BATTLEFIELD, playerB, "Mountain"); addCard(Constants.Zone.HAND, playerB, "Lightning Bolt"); - + activateAbility(1, Constants.PhaseStep.PRECOMBAT_MAIN, playerA, "Sacrifice a human: Regenerate {this}. "); castSpell(1, Constants.PhaseStep.POSTCOMBAT_MAIN, playerB, "Lightning Bolt", "Fiend of the Shadows"); setStopAt(1, Constants.PhaseStep.END_TURN); execute(); - + assertLife(playerA, 20); assertLife(playerB, 20); assertPermanentCount(playerA, "Fiend of the Shadows", 1); @@ -37,13 +37,13 @@ public class FiendOfTheShadowsTest extends CardTestPlayerBase { addCard(Constants.Zone.BATTLEFIELD, playerA, "Fiend of the Shadows"); removeAllCardsFromHand(playerB); addCard(Constants.Zone.HAND, playerB, "Swamp"); - + attack(1, playerA, "Fiend of the Shadows"); playLand(1, Constants.PhaseStep.POSTCOMBAT_MAIN, playerA, "Swamp"); setStopAt(1, Constants.PhaseStep.END_TURN); execute(); - + assertLife(playerA, 20); assertLife(playerB, 17); assertPermanentCount(playerA, "Fiend of the Shadows", 1); @@ -57,13 +57,13 @@ public class FiendOfTheShadowsTest extends CardTestPlayerBase { addCard(Constants.Zone.BATTLEFIELD, playerA, "Fiend of the Shadows"); removeAllCardsFromHand(playerB); addCard(Constants.Zone.HAND, playerB, "Lightning Bolt"); - + attack(1, playerA, "Fiend of the Shadows"); castSpell(1, Constants.PhaseStep.POSTCOMBAT_MAIN, playerA, "Lightning Bolt", playerB); setStopAt(1, Constants.PhaseStep.END_TURN); execute(); - + assertLife(playerA, 20); assertLife(playerB, 14); assertPermanentCount(playerA, "Fiend of the Shadows", 1); diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/single/FlayerOfTheHateboundTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/single/FlayerOfTheHateboundTest.java index dec58d5db7..1c0fe98c63 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/single/FlayerOfTheHateboundTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/single/FlayerOfTheHateboundTest.java @@ -12,18 +12,18 @@ import org.mage.test.serverside.base.CardTestPlayerBase; * @author BetaSteward */ public class FlayerOfTheHateboundTest extends CardTestPlayerBase { - + @Test public void testCard() { addCard(Constants.Zone.BATTLEFIELD, playerA, "Flayer of the Hatebound"); addCard(Constants.Zone.BATTLEFIELD, playerA, "Mountain", 1); addCard(Constants.Zone.HAND, playerA, "Lightning Bolt", 1); - + castSpell(1, Constants.PhaseStep.PRECOMBAT_MAIN, playerA, "Lightning Bolt", "Flayer of the Hatebound"); setStopAt(2, Constants.PhaseStep.DRAW); execute(); - + assertLife(playerA, 20); assertLife(playerB, 15); assertPermanentCount(playerA, "Flayer of the Hatebound", 1); @@ -35,33 +35,33 @@ public class FlayerOfTheHateboundTest extends CardTestPlayerBase { addCard(Constants.Zone.BATTLEFIELD, playerA, "Flayer of the Hatebound"); addCard(Constants.Zone.BATTLEFIELD, playerA, "Swamp", 2); addCard(Constants.Zone.GRAVEYARD, playerA, "Reassembling Skeleton", 1); - + activateAbility(1, Constants.PhaseStep.PRECOMBAT_MAIN, playerA, "{1}{B}:"); setStopAt(1, Constants.PhaseStep.BEGIN_COMBAT); execute(); - + assertLife(playerA, 20); assertLife(playerB, 19); assertPermanentCount(playerA, "Flayer of the Hatebound", 1); assertPermanentCount(playerA, "Reassembling Skeleton", 1); assertPowerToughness(playerA, "Flayer of the Hatebound", 4, 2, Filter.ComparisonScope.Any); } - + @Test public void testCard2() { addCard(Constants.Zone.BATTLEFIELD, playerA, "Flayer of the Hatebound"); addCard(Constants.Zone.BATTLEFIELD, playerB, "Swamp", 2); addCard(Constants.Zone.GRAVEYARD, playerB, "Reassembling Skeleton", 1); - + activateAbility(1, Constants.PhaseStep.PRECOMBAT_MAIN, playerB, "{1}{B}:"); setStopAt(1, Constants.PhaseStep.BEGIN_COMBAT); execute(); - + assertLife(playerA, 20); assertLife(playerB, 20); assertPermanentCount(playerA, "Flayer of the Hatebound", 1); assertPermanentCount(playerB, "Reassembling Skeleton", 1); assertPowerToughness(playerA, "Flayer of the Hatebound", 4, 2, Filter.ComparisonScope.Any); } - + } diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/single/GrafdiggersCageTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/single/GrafdiggersCageTest.java index 778b2ad48a..e6bd1d774c 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/single/GrafdiggersCageTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/single/GrafdiggersCageTest.java @@ -9,17 +9,17 @@ import org.mage.test.serverside.base.CardTestPlayerBase; * @author BetaSteward */ public class GrafdiggersCageTest extends CardTestPlayerBase { - + @Test public void testCard() { addCard(Constants.Zone.BATTLEFIELD, playerA, "Grafdigger's Cage"); addCard(Constants.Zone.BATTLEFIELD, playerA, "Swamp", 2); addCard(Constants.Zone.GRAVEYARD, playerA, "Lingering Souls"); - + activateAbility(1, Constants.PhaseStep.PRECOMBAT_MAIN, playerA, "Flashback {1}{B}"); setStopAt(1, Constants.PhaseStep.BEGIN_COMBAT); execute(); - + assertLife(playerA, 20); assertLife(playerB, 20); assertPermanentCount(playerA, "Spirit", 0); @@ -32,16 +32,16 @@ public class GrafdiggersCageTest extends CardTestPlayerBase { addCard(Constants.Zone.BATTLEFIELD, playerA, "Swamp", 5); addCard(Constants.Zone.HAND, playerA, "Rise from the Grave", 1); addCard(Constants.Zone.GRAVEYARD, playerA, "Craw Wurm"); - + castSpell(1, Constants.PhaseStep.PRECOMBAT_MAIN, playerA, "Rise from the Grave", "Craw Wurm"); setStopAt(1, Constants.PhaseStep.BEGIN_COMBAT); execute(); - + assertLife(playerA, 20); assertLife(playerB, 20); assertPermanentCount(playerA, "Craw Wurm", 0); assertGraveyardCount(playerA, "Craw Wurm", 1); assertGraveyardCount(playerA, "Rise from the Grave", 1); } - + } diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/single/GravecrawlerTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/single/GravecrawlerTest.java index ad0970fb6b..c62b926eb4 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/single/GravecrawlerTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/single/GravecrawlerTest.java @@ -9,17 +9,17 @@ import org.mage.test.serverside.base.CardTestPlayerBase; * @author BetaSteward */ public class GravecrawlerTest extends CardTestPlayerBase { - + @Test public void testCard() { addCard(Constants.Zone.GRAVEYARD, playerA, "Gravecrawler"); addCard(Constants.Zone.BATTLEFIELD, playerA, "Black Cat"); addCard(Constants.Zone.BATTLEFIELD, playerA, "Swamp"); - + castSpell(1, Constants.PhaseStep.PRECOMBAT_MAIN, playerA, "Gravecrawler"); setStopAt(1, Constants.PhaseStep.BEGIN_COMBAT); execute(); - + assertLife(playerA, 20); assertLife(playerB, 20); assertPermanentCount(playerA, "Gravecrawler", 1); @@ -30,15 +30,15 @@ public class GravecrawlerTest extends CardTestPlayerBase { public void testCard1() { addCard(Constants.Zone.GRAVEYARD, playerA, "Gravecrawler"); addCard(Constants.Zone.BATTLEFIELD, playerA, "Swamp"); - + castSpell(1, Constants.PhaseStep.PRECOMBAT_MAIN, playerA, "Gravecrawler"); setStopAt(1, Constants.PhaseStep.BEGIN_COMBAT); execute(); - + assertLife(playerA, 20); assertLife(playerB, 20); assertPermanentCount(playerA, "Gravecrawler", 0); assertGraveyardCount(playerA, 1); } - + } diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/single/HavengulLichTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/single/HavengulLichTest.java index 19658004d2..81b86c733a 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/single/HavengulLichTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/single/HavengulLichTest.java @@ -9,19 +9,19 @@ import org.mage.test.serverside.base.CardTestPlayerBase; * @author BetaSteward */ public class HavengulLichTest extends CardTestPlayerBase { - + @Test public void testCard() { addCard(Constants.Zone.BATTLEFIELD, playerA, "Mountain", 4); addCard(Constants.Zone.BATTLEFIELD, playerA, "Havengul Lich"); addCard(Constants.Zone.GRAVEYARD, playerA, "Prodigal Pyromancer"); - + activateAbility(1, Constants.PhaseStep.PRECOMBAT_MAIN, playerA, "{1}", "Prodigal Pyromancer"); castSpell(1, Constants.PhaseStep.PRECOMBAT_MAIN, playerA, "Prodigal Pyromancer"); activateAbility(1, Constants.PhaseStep.POSTCOMBAT_MAIN, playerA, "{T}", playerB); setStopAt(1, Constants.PhaseStep.END_TURN); execute(); - + assertLife(playerA, 20); assertLife(playerB, 19); assertPermanentCount(playerA, "Havengul Lich", 1); @@ -36,12 +36,12 @@ public class HavengulLichTest extends CardTestPlayerBase { addCard(Constants.Zone.BATTLEFIELD, playerA, "Swamp", 3); addCard(Constants.Zone.BATTLEFIELD, playerA, "Havengul Lich"); addCard(Constants.Zone.GRAVEYARD, playerA, "Black Cat"); - + activateAbility(1, Constants.PhaseStep.PRECOMBAT_MAIN, playerA, "{1}", "Black Cat"); castSpell(3, Constants.PhaseStep.PRECOMBAT_MAIN, playerA, "Black Cat"); setStopAt(3, Constants.PhaseStep.BEGIN_COMBAT); execute(); - + assertLife(playerA, 20); assertLife(playerB, 20); assertPermanentCount(playerA, "Havengul Lich", 1); @@ -54,14 +54,14 @@ public class HavengulLichTest extends CardTestPlayerBase { addCard(Constants.Zone.BATTLEFIELD, playerA, "Mountain", 4); addCard(Constants.Zone.BATTLEFIELD, playerA, "Havengul Lich"); addCard(Constants.Zone.GRAVEYARD, playerA, "Prodigal Pyromancer"); - + activateAbility(1, Constants.PhaseStep.PRECOMBAT_MAIN, playerA, "{1}", "Prodigal Pyromancer"); castSpell(1, Constants.PhaseStep.PRECOMBAT_MAIN, playerA, "Prodigal Pyromancer"); activateAbility(3, Constants.PhaseStep.PRECOMBAT_MAIN, playerA, "{T}", playerB); activateAbility(3, Constants.PhaseStep.PRECOMBAT_MAIN, playerA, "{T}", playerB); setStopAt(3, Constants.PhaseStep.BEGIN_COMBAT); execute(); - + assertLife(playerA, 20); assertLife(playerB, 19); assertPermanentCount(playerA, "Havengul Lich", 1); diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/single/HinterlandScourgeTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/single/HinterlandScourgeTest.java index 12092767b9..46de48fc33 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/single/HinterlandScourgeTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/single/HinterlandScourgeTest.java @@ -9,15 +9,15 @@ import org.mage.test.serverside.base.CardTestPlayerBase; * @author BetaSteward */ public class HinterlandScourgeTest extends CardTestPlayerBase { - + @Test public void testCard() { addCard(Constants.Zone.BATTLEFIELD, playerA, "Hinterland Hermit"); // addCard(Constants.Zone.BATTLEFIELD, playerB, "Ornithopter"); - + setStopAt(2, Constants.PhaseStep.BEGIN_COMBAT); execute(); - + assertLife(playerA, 20); assertLife(playerB, 20); assertPermanentCount(playerA, "Hinterland Hermit", 0); @@ -28,11 +28,11 @@ public class HinterlandScourgeTest extends CardTestPlayerBase { public void testCard1() { addCard(Constants.Zone.BATTLEFIELD, playerA, "Hinterland Hermit"); addCard(Constants.Zone.BATTLEFIELD, playerB, "Ornithopter"); - + attack(3, playerA, "Hinterland Scourge"); setStopAt(3, Constants.PhaseStep.END_COMBAT); execute(); - + assertLife(playerA, 20); assertLife(playerB, 20); assertPermanentCount(playerA, "Hinterland Hermit", 0); @@ -43,11 +43,11 @@ public class HinterlandScourgeTest extends CardTestPlayerBase { @Test public void testCard2() { addCard(Constants.Zone.BATTLEFIELD, playerA, "Hinterland Hermit"); - + attack(3, playerA, "Hinterland Scourge"); setStopAt(3, Constants.PhaseStep.END_COMBAT); execute(); - + assertLife(playerA, 20); assertLife(playerB, 17); assertPermanentCount(playerA, "Hinterland Hermit", 0); diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/single/HollowhengeSpiritTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/single/HollowhengeSpiritTest.java index 5581e6d3ec..700a2e7767 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/single/HollowhengeSpiritTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/single/HollowhengeSpiritTest.java @@ -11,18 +11,18 @@ import org.mage.test.serverside.base.CardTestPlayerBase; * @author BetaSteward */ public class HollowhengeSpiritTest extends CardTestPlayerBase { - + @Test public void testCard() { addCard(Constants.Zone.BATTLEFIELD, playerA, "Plains", 4); addCard(Constants.Zone.HAND, playerA, "Hollowhenge Spirit"); addCard(Constants.Zone.BATTLEFIELD, playerB, "Craw Wurm"); - + castSpell(2, Constants.PhaseStep.DECLARE_BLOCKERS, playerA, "Hollowhenge Spirit"); attack(2, playerB, "Craw Wurm"); setStopAt(2, Constants.PhaseStep.END_TURN); execute(); - + assertLife(playerA, 20); assertLife(playerB, 20); assertPermanentCount(playerA, "Hollowhenge Spirit", 1); @@ -36,12 +36,12 @@ public class HollowhengeSpiritTest extends CardTestPlayerBase { addCard(Constants.Zone.BATTLEFIELD, playerA, "Plains", 4); addCard(Constants.Zone.HAND, playerA, "Hollowhenge Spirit"); addCard(Constants.Zone.BATTLEFIELD, playerA, "Craw Wurm"); - + castSpell(1, Constants.PhaseStep.DECLARE_BLOCKERS, playerA, "Hollowhenge Spirit"); attack(1, playerA, "Craw Wurm"); setStopAt(1, Constants.PhaseStep.END_TURN); execute(); - + assertLife(playerA, 20); assertLife(playerB, 20); assertPermanentCount(playerA, "Hollowhenge Spirit", 1); @@ -55,11 +55,11 @@ public class HollowhengeSpiritTest extends CardTestPlayerBase { addCard(Constants.Zone.BATTLEFIELD, playerA, "Plains", 4); addCard(Constants.Zone.HAND, playerA, "Hollowhenge Spirit"); addCard(Constants.Zone.BATTLEFIELD, playerA, "Craw Wurm"); - + castSpell(1, Constants.PhaseStep.PRECOMBAT_MAIN, playerA, "Hollowhenge Spirit"); setStopAt(1, Constants.PhaseStep.END_TURN); execute(); - + assertLife(playerA, 20); assertLife(playerB, 20); assertPermanentCount(playerA, "Hollowhenge Spirit", 1); diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/single/HomicidalBruteTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/single/HomicidalBruteTest.java index d1ce80a286..2fb1b50485 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/single/HomicidalBruteTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/single/HomicidalBruteTest.java @@ -9,18 +9,18 @@ import org.mage.test.serverside.base.CardTestPlayerBase; * @author BetaSteward */ public class HomicidalBruteTest extends CardTestPlayerBase { - + @Test public void testCard() { removeAllCardsFromHand(playerA); removeAllCardsFromLibrary(playerA); addCard(Constants.Zone.BATTLEFIELD, playerA, "Civilized Scholar"); addCard(Constants.Zone.LIBRARY, playerA, "Sejiri Merfolk"); - + activateAbility(1, Constants.PhaseStep.PRECOMBAT_MAIN, playerA, "{T}: Draw a card, then discard a card. "); setStopAt(1, Constants.PhaseStep.BEGIN_COMBAT); execute(); - + assertLife(playerA, 20); assertLife(playerB, 20); assertPermanentCount(playerA, "Civilized Scholar", 0); @@ -34,11 +34,11 @@ public class HomicidalBruteTest extends CardTestPlayerBase { removeAllCardsFromLibrary(playerA); addCard(Constants.Zone.BATTLEFIELD, playerA, "Civilized Scholar"); addCard(Constants.Zone.LIBRARY, playerA, "Lightning Bolt"); - + activateAbility(1, Constants.PhaseStep.PRECOMBAT_MAIN, playerA, "{T}: Draw a card, then discard a card. "); setStopAt(1, Constants.PhaseStep.BEGIN_COMBAT); execute(); - + assertLife(playerA, 20); assertLife(playerB, 20); assertPermanentCount(playerA, "Civilized Scholar", 1); @@ -52,11 +52,11 @@ public class HomicidalBruteTest extends CardTestPlayerBase { removeAllCardsFromLibrary(playerA); addCard(Constants.Zone.BATTLEFIELD, playerA, "Civilized Scholar"); addCard(Constants.Zone.LIBRARY, playerA, "Sejiri Merfolk"); - + activateAbility(1, Constants.PhaseStep.PRECOMBAT_MAIN, playerA, "{T}: Draw a card, then discard a card. "); setStopAt(2, Constants.PhaseStep.UPKEEP); execute(); - + assertLife(playerA, 20); assertLife(playerB, 20); assertPermanentCount(playerA, "Civilized Scholar", 1); @@ -70,12 +70,12 @@ public class HomicidalBruteTest extends CardTestPlayerBase { removeAllCardsFromLibrary(playerA); addCard(Constants.Zone.BATTLEFIELD, playerA, "Civilized Scholar"); addCard(Constants.Zone.LIBRARY, playerA, "Sejiri Merfolk", 2); - + activateAbility(3, Constants.PhaseStep.PRECOMBAT_MAIN, playerA, "{T}: Draw a card, then discard a card. "); attack(3, playerA, "Homicidal Brute"); setStopAt(4, Constants.PhaseStep.UPKEEP); execute(); - + assertLife(playerA, 20); assertLife(playerB, 15); assertPermanentCount(playerA, "Civilized Scholar", 0); diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/single/HomicidalSeclusionTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/single/HomicidalSeclusionTest.java index 15db7fc715..f05f68abad 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/single/HomicidalSeclusionTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/single/HomicidalSeclusionTest.java @@ -22,10 +22,10 @@ public class HomicidalSeclusionTest extends CardTestPlayerBase { addCard(Constants.Zone.BATTLEFIELD, playerA, "Homicidal Seclusion"); addCard(Constants.Zone.BATTLEFIELD, playerA, "Air Elemental", 1); addCard(Constants.Zone.BATTLEFIELD, playerA, "Horned Turtle", 1); - + setStopAt(1, Constants.PhaseStep.BEGIN_COMBAT); execute(); - + assertLife(playerA, 20); assertLife(playerB, 20); @@ -98,5 +98,5 @@ public class HomicidalSeclusionTest extends CardTestPlayerBase { abilities.add(LifelinkAbility.getInstance()); assertAbilities(playerA, "Air Elemental", abilities); } - + } diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/single/HuntmasterOfTheFellsTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/single/HuntmasterOfTheFellsTest.java index 882947e517..fee1451d23 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/single/HuntmasterOfTheFellsTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/single/HuntmasterOfTheFellsTest.java @@ -9,18 +9,18 @@ import org.mage.test.serverside.base.CardTestPlayerBase; * @author BetaSteward, noxx */ public class HuntmasterOfTheFellsTest extends CardTestPlayerBase { - + @Test public void testCard() { addCard(Constants.Zone.BATTLEFIELD, playerA, "Forest", 3); addCard(Constants.Zone.BATTLEFIELD, playerA, "Mountain"); addCard(Constants.Zone.HAND, playerA, "Huntmaster of the Fells"); addCard(Constants.Zone.BATTLEFIELD, playerB, "Ornithopter"); - + castSpell(1, Constants.PhaseStep.PRECOMBAT_MAIN, playerA, "Huntmaster of the Fells"); setStopAt(3, Constants.PhaseStep.DRAW); execute(); - + assertLife(playerA, 22); assertLife(playerB, 18); assertPermanentCount(playerA, "Wolf", 1); diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/single/ImmerwolfTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/single/ImmerwolfTest.java index 4c985b64eb..6277b20bb6 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/single/ImmerwolfTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/single/ImmerwolfTest.java @@ -9,16 +9,16 @@ import org.mage.test.serverside.base.CardTestPlayerBase; * @author BetaSteward */ public class ImmerwolfTest extends CardTestPlayerBase { - + @Test public void testCard() { addCard(Constants.Zone.BATTLEFIELD, playerA, "Afflicted Deserter"); addCard(Constants.Zone.BATTLEFIELD, playerA, "Immerwolf"); addCard(Constants.Zone.BATTLEFIELD, playerB, "Ornithopter"); - + setStopAt(2, Constants.PhaseStep.BEGIN_COMBAT); execute(); - + assertLife(playerA, 20); assertLife(playerB, 17); assertPermanentCount(playerB, "Ornithopter", 0); @@ -33,17 +33,17 @@ public class ImmerwolfTest extends CardTestPlayerBase { addCard(Constants.Zone.BATTLEFIELD, playerB, "Ornithopter"); addCard(Constants.Zone.BATTLEFIELD, playerB, "Mountain", 2); addCard(Constants.Zone.HAND, playerB, "Lightning Bolt", 2); - + castSpell(2, Constants.PhaseStep.PRECOMBAT_MAIN, playerB, "Lightning Bolt", playerA); castSpell(2, Constants.PhaseStep.PRECOMBAT_MAIN, playerB, "Lightning Bolt", playerA); setStopAt(3, Constants.PhaseStep.DRAW); execute(); - + assertLife(playerA, 14); assertLife(playerB, 17); assertPermanentCount(playerB, "Ornithopter", 0); assertPermanentCount(playerA, "Afflicted Deserter", 0); assertPermanentCount(playerA, "Werewolf Ransacker", 1); } - + } diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/single/IncreasingCardsTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/single/IncreasingCardsTest.java index 0717b1d694..df2cd36fd9 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/single/IncreasingCardsTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/single/IncreasingCardsTest.java @@ -26,7 +26,7 @@ public class IncreasingCardsTest extends CardTestPlayerBase { setStopAt(3, Constants.PhaseStep.BEGIN_COMBAT); execute(); - + assertLife(playerA, 20); assertLife(playerB, 20); assertGraveyardCount(playerA, 0); @@ -45,7 +45,7 @@ public class IncreasingCardsTest extends CardTestPlayerBase { setStopAt(3, Constants.PhaseStep.BEGIN_COMBAT); execute(); - + assertLife(playerA, 20); assertLife(playerB, 20); assertGraveyardCount(playerA, 0); @@ -53,7 +53,7 @@ public class IncreasingCardsTest extends CardTestPlayerBase { assertGraveyardCount(playerB, 9); } - + @Test public void testIncreasingDevotion() { addCard(Constants.Zone.BATTLEFIELD, playerA, "Plains", 9); @@ -64,7 +64,7 @@ public class IncreasingCardsTest extends CardTestPlayerBase { setStopAt(3, Constants.PhaseStep.BEGIN_COMBAT); execute(); - + assertLife(playerA, 20); assertLife(playerB, 20); assertGraveyardCount(playerA, 0); @@ -72,7 +72,7 @@ public class IncreasingCardsTest extends CardTestPlayerBase { assertExileCount("Increasing Devotion", 1); } - + @Test public void testIncreasingSavagery() { addCard(Constants.Zone.BATTLEFIELD, playerA, "Forest", 7); @@ -84,7 +84,7 @@ public class IncreasingCardsTest extends CardTestPlayerBase { setStopAt(3, Constants.PhaseStep.BEGIN_COMBAT); execute(); - + assertLife(playerA, 20); assertLife(playerB, 20); assertGraveyardCount(playerA, 0); @@ -106,12 +106,12 @@ public class IncreasingCardsTest extends CardTestPlayerBase { setStopAt(3, Constants.PhaseStep.BEGIN_COMBAT); execute(); - + assertLife(playerA, 20); assertLife(playerB, 5); assertGraveyardCount(playerA, 2); assertExileCount("Increasing Vengeance", 1); } - + } diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/single/NecroticPlagueTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/single/NecroticPlagueTest.java index ef3d9bee2e..bc8af1ccf6 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/single/NecroticPlagueTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/single/NecroticPlagueTest.java @@ -18,12 +18,12 @@ public class NecroticPlagueTest extends CardTestPlayerBase { addCard(Constants.Zone.BATTLEFIELD, playerA, "Swamp", 4); addCard(Constants.Zone.HAND, playerA, "Necrotic Plague"); addCard(Constants.Zone.BATTLEFIELD, playerB, "Sejiri Merfolk"); - + castSpell(1, Constants.PhaseStep.PRECOMBAT_MAIN, playerA, "Necrotic Plague", "Sejiri Merfolk"); setStopAt(2, Constants.PhaseStep.PRECOMBAT_MAIN); execute(); - + assertLife(playerA, 20); assertLife(playerB, 20); assertPermanentCount(playerB, "Sejiri Merfolk", 0); @@ -38,12 +38,12 @@ public class NecroticPlagueTest extends CardTestPlayerBase { addCard(Constants.Zone.BATTLEFIELD, playerA, "Goblin Deathraiders"); addCard(Constants.Zone.HAND, playerA, "Necrotic Plague"); addCard(Constants.Zone.BATTLEFIELD, playerB, "Sejiri Merfolk"); - + castSpell(1, Constants.PhaseStep.PRECOMBAT_MAIN, playerA, "Necrotic Plague", "Sejiri Merfolk"); setStopAt(3, Constants.PhaseStep.PRECOMBAT_MAIN); execute(); - + assertLife(playerA, 20); assertLife(playerB, 20); assertPermanentCount(playerA, "Goblin Deathraiders", 0); @@ -54,5 +54,5 @@ public class NecroticPlagueTest extends CardTestPlayerBase { assertGraveyardCount(playerB, 1); assertGraveyardCount(playerB, "Sejiri Merfolk", 1); } - + } diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/single/SeanceTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/single/SeanceTest.java index a860e740a7..89923983a3 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/single/SeanceTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/single/SeanceTest.java @@ -9,15 +9,15 @@ import org.mage.test.serverside.base.CardTestPlayerBase; * @author BetaSteward */ public class SeanceTest extends CardTestPlayerBase { - + @Test public void testCard() { addCard(Constants.Zone.BATTLEFIELD, playerA, "Seance"); addCard(Constants.Zone.GRAVEYARD, playerA, "Craw Wurm"); - + setStopAt(1, Constants.PhaseStep.DRAW); execute(); - + assertLife(playerA, 20); assertLife(playerB, 20); assertExileCount("Craw Wurm", 1); @@ -28,14 +28,14 @@ public class SeanceTest extends CardTestPlayerBase { public void testCard1() { addCard(Constants.Zone.BATTLEFIELD, playerA, "Seance"); addCard(Constants.Zone.GRAVEYARD, playerA, "Craw Wurm"); - + setStopAt(2, Constants.PhaseStep.DRAW); execute(); - + assertLife(playerA, 20); assertLife(playerB, 20); assertExileCount("Craw Wurm", 1); assertPermanentCount(playerA, "Craw Wurm", 0); } - + } diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/single/SecretsOfTheDeadTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/single/SecretsOfTheDeadTest.java index 3ceb5a035a..3fb42e15d9 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/single/SecretsOfTheDeadTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/single/SecretsOfTheDeadTest.java @@ -9,17 +9,17 @@ import org.mage.test.serverside.base.CardTestPlayerBase; * @author BetaSteward */ public class SecretsOfTheDeadTest extends CardTestPlayerBase { - + @Test public void testCard() { addCard(Constants.Zone.BATTLEFIELD, playerA, "Swamp", 2); addCard(Constants.Zone.BATTLEFIELD, playerA, "Secrets of the Dead"); addCard(Constants.Zone.GRAVEYARD, playerA, "Lingering Souls"); - + activateAbility(1, Constants.PhaseStep.PRECOMBAT_MAIN, playerA, "Flashback {1}{B}"); setStopAt(1, Constants.PhaseStep.BEGIN_COMBAT); execute(); - + assertLife(playerA, 20); assertLife(playerB, 20); assertPermanentCount(playerA, "Spirit", 2); @@ -30,15 +30,15 @@ public class SecretsOfTheDeadTest extends CardTestPlayerBase { public void testCard1() { addCard(Constants.Zone.BATTLEFIELD, playerA, "Swamp", 2); addCard(Constants.Zone.GRAVEYARD, playerA, "Lingering Souls"); - + activateAbility(1, Constants.PhaseStep.PRECOMBAT_MAIN, playerA, "Flashback {1}{B}"); setStopAt(1, Constants.PhaseStep.BEGIN_COMBAT); execute(); - + assertLife(playerA, 20); assertLife(playerB, 20); assertPermanentCount(playerA, "Spirit", 2); assertHandCount(playerA, 0); } - + } diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/single/SorinLordOfInnistradTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/single/SorinLordOfInnistradTest.java index 20f0c10751..317d767390 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/single/SorinLordOfInnistradTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/single/SorinLordOfInnistradTest.java @@ -13,15 +13,15 @@ import org.mage.test.serverside.base.CardTestPlayerBase; * @author BetaSteward */ public class SorinLordOfInnistradTest extends CardTestPlayerBase { - + @Test public void testCard() { addCard(Constants.Zone.BATTLEFIELD, playerA, "Sorin, Lord of Innistrad"); - + activateAbility(1, Constants.PhaseStep.PRECOMBAT_MAIN, playerA, "+1: put a a 1/1 black Vampire creature token with lifelink onto the battlefield. "); setStopAt(1, Constants.PhaseStep.BEGIN_COMBAT); execute(); - + assertLife(playerA, 20); assertLife(playerB, 20); assertPermanentCount(playerA, "Sorin, Lord of Innistrad", 1); @@ -33,13 +33,13 @@ public class SorinLordOfInnistradTest extends CardTestPlayerBase { public void testCard2() { addCard(Constants.Zone.BATTLEFIELD, playerA, "Sorin, Lord of Innistrad"); addCard(Constants.Zone.BATTLEFIELD, playerA, "Sejiri Merfolk"); - + addCounters(1, Constants.PhaseStep.UPKEEP, playerA, "Sorin, Lord of Innistrad", CounterType.LOYALTY, 1); activateAbility(1, Constants.PhaseStep.PRECOMBAT_MAIN, playerA, "-2: You get an emblem with \"[creature you control get +1/+0. ]\". "); activateAbility(3, Constants.PhaseStep.PRECOMBAT_MAIN, playerA, "-2: You get an emblem with \"[creature you control get +1/+0. ]\". "); setStopAt(3, Constants.PhaseStep.BEGIN_COMBAT); execute(); - + assertLife(playerA, 20); assertLife(playerB, 20); assertPermanentCount(playerA, "Sorin, Lord of Innistrad", 0); @@ -52,7 +52,7 @@ public class SorinLordOfInnistradTest extends CardTestPlayerBase { addCard(Constants.Zone.BATTLEFIELD, playerA, "Sorin, Lord of Innistrad"); addCard(Constants.Zone.BATTLEFIELD, playerB, "Craw Wurm"); addCard(Constants.Zone.BATTLEFIELD, playerB, "Angel of Mercy"); - + addCounters(1, Constants.PhaseStep.UPKEEP, playerA, "Sorin, Lord of Innistrad", CounterType.LOYALTY, 3); activateAbility(1, Constants.PhaseStep.PRECOMBAT_MAIN, playerA, "-6: ", "Craw Wurm^Angel of Mercy"); setStopAt(1, Constants.PhaseStep.BEGIN_COMBAT); diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/single/SoulSeizerTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/single/SoulSeizerTest.java index 23d9d0be77..6ed8dcac01 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/single/SoulSeizerTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/single/SoulSeizerTest.java @@ -13,16 +13,16 @@ import org.mage.test.serverside.base.CardTestPlayerBase; */ @Ignore public class SoulSeizerTest extends CardTestPlayerBase { - + @Test public void testCard() { addCard(Constants.Zone.BATTLEFIELD, playerA, "Soul Seizer"); addCard(Constants.Zone.BATTLEFIELD, playerB, "Craw Wurm"); - + attack(1, playerA, "Soul Seizer"); setStopAt(1, Constants.PhaseStep.END_COMBAT); execute(); - + assertLife(playerA, 20); assertLife(playerB, 19); assertPermanentCount(playerA, "Ghastly Haunting", 1); @@ -36,13 +36,13 @@ public class SoulSeizerTest extends CardTestPlayerBase { addCard(Constants.Zone.BATTLEFIELD, playerB, "Craw Wurm"); addCard(Constants.Zone.BATTLEFIELD, playerB, "Plains", 2); addCard(Constants.Zone.HAND, playerB, "Clear"); - - + + attack(1, playerA, "Soul Seizer"); castSpell(2, Constants.PhaseStep.PRECOMBAT_MAIN, playerB, "Clear", "Ghastly Haunting"); setStopAt(2, Constants.PhaseStep.BEGIN_COMBAT); execute(); - + assertLife(playerA, 20); assertLife(playerB, 19); assertPermanentCount(playerA, "Ghastly Haunting", 0); @@ -57,12 +57,12 @@ public class SoulSeizerTest extends CardTestPlayerBase { addCard(Constants.Zone.BATTLEFIELD, playerA, "Forest", 2); addCard(Constants.Zone.HAND, playerA, "Battlegrowth"); addCard(Constants.Zone.BATTLEFIELD, playerB, "Craw Wurm"); - + castSpell(1, Constants.PhaseStep.PRECOMBAT_MAIN, playerA, "Battlegrowth", "Soul Seizer"); attack(1, playerA, "Soul Seizer"); setStopAt(1, Constants.PhaseStep.END_COMBAT); execute(); - + assertLife(playerA, 20); assertLife(playerB, 18); assertPermanentCount(playerA, "Ghastly Haunting", 1); diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/single/SuddenDisappearanceTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/single/SuddenDisappearanceTest.java index 3c904bfb9a..ea0f60a079 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/single/SuddenDisappearanceTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/single/SuddenDisappearanceTest.java @@ -17,12 +17,12 @@ public class SuddenDisappearanceTest extends CardTestPlayerBase { addCard(Constants.Zone.BATTLEFIELD, playerB, "Air Elemental", 1); addCard(Constants.Zone.BATTLEFIELD, playerB, "Horned Turtle", 4); addCard(Constants.Zone.BATTLEFIELD, playerB, "Altar of the Lost", 1); - + castSpell(1, Constants.PhaseStep.PRECOMBAT_MAIN, playerA, "Sudden Disappearance", playerB); setStopAt(1, Constants.PhaseStep.BEGIN_COMBAT); execute(); - + assertLife(playerA, 20); assertLife(playerB, 20); assertPermanentCount(playerB, "Air Elemental", 0); @@ -33,7 +33,7 @@ public class SuddenDisappearanceTest extends CardTestPlayerBase { assertExileCount("Altar of the Lost", 1); } - + @Test public void testCard1() { addCard(Constants.Zone.BATTLEFIELD, playerA, "Plains", 6); @@ -41,12 +41,12 @@ public class SuddenDisappearanceTest extends CardTestPlayerBase { addCard(Constants.Zone.BATTLEFIELD, playerB, "Air Elemental", 1); addCard(Constants.Zone.BATTLEFIELD, playerB, "Horned Turtle", 4); addCard(Constants.Zone.BATTLEFIELD, playerB, "Altar of the Lost", 1); - + castSpell(1, Constants.PhaseStep.PRECOMBAT_MAIN, playerA, "Sudden Disappearance", playerB); setStopAt(2, Constants.PhaseStep.UPKEEP); execute(); - + assertLife(playerA, 20); assertLife(playerB, 20); assertPermanentCount(playerB, "Air Elemental", 1); @@ -56,5 +56,5 @@ public class SuddenDisappearanceTest extends CardTestPlayerBase { assertExileCount("Horned Turtle", 0); assertExileCount("Altar of the Lost", 0); } - + } diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/single/TurnToFrogTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/single/TurnToFrogTest.java index 06c1f14a83..99648008c1 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/single/TurnToFrogTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/single/TurnToFrogTest.java @@ -21,14 +21,14 @@ public class TurnToFrogTest extends CardTestPlayerBase { addCard(Constants.Zone.BATTLEFIELD, playerA, "Raging Ravine"); addCard(Constants.Zone.BATTLEFIELD, playerB, "Island", 2); addCard(Constants.Zone.HAND, playerB, "Turn to Frog"); - + activateAbility(1, Constants.PhaseStep.PRECOMBAT_MAIN, playerA, "{2}{R}{G}: until end of turn {this} becomes a 3/3 red and green Elemental creature with \"Whenever this creature attacks, put a +1/+1 counter on it.\" that's still a land. "); castSpell(1, Constants.PhaseStep.PRECOMBAT_MAIN, playerB, "Turn to Frog", "Raging Ravine"); attack(1, playerA, "Raging Ravine"); setStopAt(1, Constants.PhaseStep.END_COMBAT); execute(); - + assertLife(playerA, 20); assertLife(playerB, 19); assertPowerToughness(playerA, "Raging Ravine", 1, 1, Filter.ComparisonScope.Any); @@ -42,7 +42,7 @@ public class TurnToFrogTest extends CardTestPlayerBase { addCard(Constants.Zone.BATTLEFIELD, playerA, "Raging Ravine"); addCard(Constants.Zone.BATTLEFIELD, playerB, "Island", 2); addCard(Constants.Zone.HAND, playerB, "Turn to Frog"); - + activateAbility(1, Constants.PhaseStep.PRECOMBAT_MAIN, playerA, "{2}{R}{G}: until end of turn {this} becomes a 3/3 red and green Elemental creature with \"Whenever this creature attacks, put a +1/+1 counter on it.\" that's still a land. "); castSpell(1, Constants.PhaseStep.PRECOMBAT_MAIN, playerB, "Turn to Frog", "Raging Ravine"); @@ -51,7 +51,7 @@ public class TurnToFrogTest extends CardTestPlayerBase { setStopAt(3, Constants.PhaseStep.END_COMBAT); execute(); - + assertLife(playerA, 20); assertLife(playerB, 16); assertPowerToughness(playerA, "Raging Ravine", 4, 4, Filter.ComparisonScope.Any); diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/single/UnhallowedCatharTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/single/UnhallowedCatharTest.java index e4e7e684e7..b0bc321e24 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/single/UnhallowedCatharTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/single/UnhallowedCatharTest.java @@ -9,7 +9,7 @@ import org.mage.test.serverside.base.CardTestPlayerBase; * @author BetaSteward */ public class UnhallowedCatharTest extends CardTestPlayerBase { - + @Test public void testCard() { addCard(Constants.Zone.BATTLEFIELD, playerA, "Mountain"); @@ -19,7 +19,7 @@ public class UnhallowedCatharTest extends CardTestPlayerBase { castSpell(1, Constants.PhaseStep.PRECOMBAT_MAIN, playerA, "Lightning Bolt", "Loyal Cathar"); setStopAt(2, Constants.PhaseStep.DRAW); execute(); - + assertLife(playerA, 20); assertLife(playerB, 20); assertPermanentCount(playerA, "Loyal Cathar", 0); diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/single/WardenOfTheWallTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/single/WardenOfTheWallTest.java index ad93e73408..808dff71f7 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/single/WardenOfTheWallTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/single/WardenOfTheWallTest.java @@ -11,14 +11,14 @@ import org.mage.test.serverside.base.CardTestPlayerBase; * @author BetaSteward */ public class WardenOfTheWallTest extends CardTestPlayerBase { - + @Test public void testCard() { addCard(Constants.Zone.BATTLEFIELD, playerA, "Warden of the Wall"); - + setStopAt(1, Constants.PhaseStep.BEGIN_COMBAT); execute(); - + assertLife(playerA, 20); assertLife(playerB, 20); assertPowerToughness(playerA, "Warden of the Wall", 0, 0, Filter.ComparisonScope.All); @@ -27,14 +27,14 @@ public class WardenOfTheWallTest extends CardTestPlayerBase { @Test public void testCard1() { addCard(Constants.Zone.BATTLEFIELD, playerA, "Warden of the Wall"); - + setStopAt(2, Constants.PhaseStep.BEGIN_COMBAT); execute(); - + assertLife(playerA, 20); assertLife(playerB, 20); assertPowerToughness(playerA, "Warden of the Wall", 2, 3, Filter.ComparisonScope.All); assertType("Warden of the Wall", CardType.CREATURE, "Gargoyle"); } - + } diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/single/WerewolfRansackerTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/single/WerewolfRansackerTest.java index 75b3c719d9..cda697c9c0 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/single/WerewolfRansackerTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/single/WerewolfRansackerTest.java @@ -9,15 +9,15 @@ import org.mage.test.serverside.base.CardTestPlayerBase; * @author BetaSteward */ public class WerewolfRansackerTest extends CardTestPlayerBase { - + @Test public void testCard() { addCard(Constants.Zone.BATTLEFIELD, playerA, "Afflicted Deserter"); addCard(Constants.Zone.BATTLEFIELD, playerB, "Ornithopter"); - + setStopAt(2, Constants.PhaseStep.BEGIN_COMBAT); execute(); - + assertLife(playerA, 20); assertLife(playerB, 17); assertPermanentCount(playerB, "Ornithopter", 0); @@ -31,12 +31,12 @@ public class WerewolfRansackerTest extends CardTestPlayerBase { addCard(Constants.Zone.HAND, playerA, "Blade Splicer"); addCard(Constants.Zone.BATTLEFIELD, playerB, "Mountain", 4); addCard(Constants.Zone.HAND, playerB, "Afflicted Deserter"); - + castSpell(1, Constants.PhaseStep.PRECOMBAT_MAIN, playerA, "Blade Splicer"); castSpell(2, Constants.PhaseStep.PRECOMBAT_MAIN, playerB, "Afflicted Deserter"); setStopAt(4, Constants.PhaseStep.DRAW); execute(); - + assertLife(playerA, 20); assertLife(playerB, 20); assertPermanentCount(playerB, "Afflicted Deserter", 0); @@ -51,12 +51,12 @@ public class WerewolfRansackerTest extends CardTestPlayerBase { addCard(Constants.Zone.BATTLEFIELD, playerB, "Ornithopter"); addCard(Constants.Zone.BATTLEFIELD, playerB, "Mountain", 2); addCard(Constants.Zone.HAND, playerB, "Lightning Bolt", 2); - + castSpell(2, Constants.PhaseStep.PRECOMBAT_MAIN, playerB, "Lightning Bolt", playerA); castSpell(2, Constants.PhaseStep.PRECOMBAT_MAIN, playerB, "Lightning Bolt", playerA); setStopAt(3, Constants.PhaseStep.DRAW); execute(); - + assertLife(playerA, 14); assertLife(playerB, 17); assertPermanentCount(playerB, "Ornithopter", 0); diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/single/ZombieApocalypseTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/single/ZombieApocalypseTest.java index d034516076..9475615bc1 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/single/ZombieApocalypseTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/single/ZombieApocalypseTest.java @@ -24,7 +24,7 @@ public class ZombieApocalypseTest extends CardTestPlayerBase { setStopAt(1, Constants.PhaseStep.BEGIN_COMBAT); execute(); - + assertGraveyardCount(playerA, 2); assertGraveyardCount(playerB, 2); assertPermanentCount(playerA, "Bog Raiders", 2); @@ -34,5 +34,5 @@ public class ZombieApocalypseTest extends CardTestPlayerBase { } - + } diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/single/avr/CavernOfSoulsTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/single/avr/CavernOfSoulsTest.java index dc7c02cc5a..dca47210c4 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/single/avr/CavernOfSoulsTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/single/avr/CavernOfSoulsTest.java @@ -106,5 +106,5 @@ public class CavernOfSoulsTest extends CardTestPlayerBase { assertGraveyardCount(playerA, "Azure Drake", 0); assertPermanentCount(playerA, "Azure Drake", 1); } - + } diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/triggers/ManabarbsTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/triggers/ManabarbsTest.java index 83ea9f7db0..3d046e876e 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/triggers/ManabarbsTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/triggers/ManabarbsTest.java @@ -32,11 +32,11 @@ public class ManabarbsTest extends CardTestBase { castSpell(playerA, "Lightning Elemental"); attack(playerA, "Ball Lightning"); attack(playerA, "Lightning Elemental"); - + playerA.setAllowBadMoves(true); setStopAt(2, Constants.PhaseStep.UNTAP); execute(); - + assertLife(playerA, 13); // burns from Manabarbs assertLife(playerB, 10); // ai should attack with 4/1 + 6/1 assertPermanentCount(playerA, "Lightning Elemental", 1); diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/triggers/ManabarbsTest2.java b/Mage.Tests/src/test/java/org/mage/test/cards/triggers/ManabarbsTest2.java index abeecc3015..d3e49c6125 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/triggers/ManabarbsTest2.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/triggers/ManabarbsTest2.java @@ -31,10 +31,10 @@ public class ManabarbsTest2 extends CardTestPlayerBase { castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Lightning Elemental"); attack(1, playerA, "Ball Lightning"); attack(1, playerA, "Lightning Elemental"); - + setStopAt(2, Constants.PhaseStep.UNTAP); execute(); - + assertLife(playerA, 13); // burns from Manabarbs assertLife(playerB, 10); // ai should attack with 4/1 + 6/1 assertPermanentCount(playerA, "Lightning Elemental", 1); diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/triggers/MausoleumGuardTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/triggers/MausoleumGuardTest.java index 88867a4f24..01aaa65812 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/triggers/MausoleumGuardTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/triggers/MausoleumGuardTest.java @@ -12,7 +12,7 @@ import org.mage.test.serverside.base.CardTestBase; public class MausoleumGuardTest extends CardTestBase { /** - * Issue 350: Mausoleum Guard + * Issue 350: Mausoleum Guard * Destroyed a mausoleum guard, was supposed to get two 1/1 fliers when it dies. None of them were created. * * version: 0.8.1 diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/triggers/SoulWardenTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/triggers/SoulWardenTest.java index 394056168c..0b018a66d3 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/triggers/SoulWardenTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/triggers/SoulWardenTest.java @@ -30,9 +30,9 @@ public class SoulWardenTest extends CardTestPlayerBase { setStopAt(1, Constants.PhaseStep.END_TURN); execute(); - + assertLife(playerA, 21); assertLife(playerB, 20); } - + } diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/triggers/combat/damage/HuntersInsightTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/triggers/combat/damage/HuntersInsightTest.java index 51d8d38127..d9beeedabb 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/triggers/combat/damage/HuntersInsightTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/triggers/combat/damage/HuntersInsightTest.java @@ -23,7 +23,7 @@ public class HuntersInsightTest extends CardTestPlayerBase { setStopAt(3, Constants.PhaseStep.POSTCOMBAT_MAIN); execute(); - + assertLife(playerA, 20); assertLife(playerB, 16); @@ -31,5 +31,5 @@ public class HuntersInsightTest extends CardTestPlayerBase { // +4 in combat assertHandCount(playerA, 5); } - + } diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/triggers/dies/BloodArtistTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/triggers/dies/BloodArtistTest.java index 23bcf4605b..2438a71fef 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/triggers/dies/BloodArtistTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/triggers/dies/BloodArtistTest.java @@ -30,9 +30,9 @@ public class BloodArtistTest extends CardTestPlayerBase { setStopAt(1, Constants.PhaseStep.END_TURN); execute(); - + assertLife(playerA, 23); assertLife(playerB, 17); } - + } diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/triggers/dies/HarvesterOfSoulsTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/triggers/dies/HarvesterOfSoulsTest.java index 39f81d31d6..aeb5bd9946 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/triggers/dies/HarvesterOfSoulsTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/triggers/dies/HarvesterOfSoulsTest.java @@ -32,12 +32,12 @@ public class HarvesterOfSoulsTest extends CardTestPlayerBase { setStopAt(1, Constants.PhaseStep.BEGIN_COMBAT); execute(); - + assertLife(playerA, 20); assertLife(playerB, 20); assertHandCount(playerA, 2); assertHandCount(playerB, 0); } - + } diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/triggers/dies/RotcrownGhoulTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/triggers/dies/RotcrownGhoulTest.java index 0b3ac8d01d..6a28c9ffdf 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/triggers/dies/RotcrownGhoulTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/triggers/dies/RotcrownGhoulTest.java @@ -23,7 +23,7 @@ public class RotcrownGhoulTest extends CardTestPlayerBase { setStopAt(1, Constants.PhaseStep.BEGIN_COMBAT); execute(); - + assertLife(playerA, 20); assertLife(playerB, 20); // Lightning Bolt + 5 cards @@ -51,5 +51,5 @@ public class RotcrownGhoulTest extends CardTestPlayerBase { // Rotcrown Ghoul assertGraveyardCount(playerB, 1); } - + } diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/triggers/dies/SelhoffOccultistTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/triggers/dies/SelhoffOccultistTest.java index 0ed6c9e1f0..82faf8a60e 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/triggers/dies/SelhoffOccultistTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/triggers/dies/SelhoffOccultistTest.java @@ -26,7 +26,7 @@ public class SelhoffOccultistTest extends CardTestPlayerBase { setStopAt(1, Constants.PhaseStep.BEGIN_COMBAT); execute(); - + assertLife(playerA, 20); assertLife(playerB, 20); // Lightning Bolt + 1 card @@ -84,5 +84,5 @@ public class SelhoffOccultistTest extends CardTestPlayerBase { // Selhoff Occultist + Ana Disciple assertGraveyardCount(playerB, 2); } - + } diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/triggers/events/SearchShuffleTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/triggers/events/SearchShuffleTest.java index a87516b390..e8235416c3 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/triggers/events/SearchShuffleTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/triggers/events/SearchShuffleTest.java @@ -11,7 +11,7 @@ import org.mage.test.serverside.base.CardTestPlayerBase; */ public class SearchShuffleTest extends CardTestPlayerBase { - + /** * even though Leonin Arbiter prevents searching, the library should still * get shuffled and Cosi's Trickster will still get a counter @@ -21,12 +21,12 @@ public class SearchShuffleTest extends CardTestPlayerBase { addCard(Constants.Zone.BATTLEFIELD, playerA, "Cosi's Trickster"); addCard(Constants.Zone.BATTLEFIELD, playerA, "Leonin Arbiter"); addCard(Constants.Zone.BATTLEFIELD, playerA, "Arid Mesa"); - + activateAbility(1, Constants.PhaseStep.PRECOMBAT_MAIN, playerA, "{T}, Pay 1 life"); setStopAt(1, Constants.PhaseStep.BEGIN_COMBAT); execute(); - + assertLife(playerA, 19); assertLife(playerB, 20); assertPermanentCount(playerA, "Arid Mesa", 0); diff --git a/Mage.Tests/src/test/java/org/mage/test/combat/AttackBlockRestrictionsTest.java b/Mage.Tests/src/test/java/org/mage/test/combat/AttackBlockRestrictionsTest.java index 8aeda607db..3503ab49db 100644 --- a/Mage.Tests/src/test/java/org/mage/test/combat/AttackBlockRestrictionsTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/combat/AttackBlockRestrictionsTest.java @@ -223,7 +223,7 @@ public class AttackBlockRestrictionsTest extends CardTestPlayerBase { setStopAt(2, Constants.PhaseStep.END_TURN); execute(); - + assertCounterCount(playerA, CounterType.POISON, 1); } } diff --git a/Mage.Tests/src/test/java/org/mage/test/combat/DamageDistributionTest.java b/Mage.Tests/src/test/java/org/mage/test/combat/DamageDistributionTest.java index f5c81e37b4..d684810153 100644 --- a/Mage.Tests/src/test/java/org/mage/test/combat/DamageDistributionTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/combat/DamageDistributionTest.java @@ -39,11 +39,11 @@ public class DamageDistributionTest extends CardTestPlayerBase { public void testDoubleStrikeUnblocked() { addCard(Constants.Zone.BATTLEFIELD, playerA, "Warren Instigator"); setLife(playerB, 4); - + attack(1, playerA, "Warren Instigator"); setStopAt(1, Constants.PhaseStep.END_COMBAT); execute(); - + assertLife(playerB, 2); } @@ -52,7 +52,7 @@ public class DamageDistributionTest extends CardTestPlayerBase { addCard(Constants.Zone.BATTLEFIELD, playerA, "Merfolk Looter"); addCard(Constants.Zone.BATTLEFIELD, playerB, "Warren Instigator"); setLife(playerB, 4); - + setStopAt(1, Constants.PhaseStep.END_COMBAT); execute(); diff --git a/Mage.Tests/src/test/java/org/mage/test/load/LoadCallbackClient.java b/Mage.Tests/src/test/java/org/mage/test/load/LoadCallbackClient.java index 0f07cbb193..ec9c7427d9 100644 --- a/Mage.Tests/src/test/java/org/mage/test/load/LoadCallbackClient.java +++ b/Mage.Tests/src/test/java/org/mage/test/load/LoadCallbackClient.java @@ -18,16 +18,16 @@ import java.util.UUID; public class LoadCallbackClient implements CallbackClient { private static final transient Logger log = Logger.getLogger(LoadCallbackClient.class); - + private Session session; private UUID gameId; private UUID playerId; private boolean gameOver; - + private volatile int controlCount; private GameView gameView; - + @Override public void processCallback(ClientCallback callback) { //TODO @@ -75,7 +75,7 @@ public class LoadCallbackClient implements CallbackClient { } } - + public void setSession(Session session) { this.session = session; } diff --git a/Mage.Tests/src/test/java/org/mage/test/load/LoadTest.java b/Mage.Tests/src/test/java/org/mage/test/load/LoadTest.java index 6a4b1022bf..bf90f6a483 100644 --- a/Mage.Tests/src/test/java/org/mage/test/load/LoadTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/load/LoadTest.java @@ -88,17 +88,17 @@ public class LoadTest { for (int i = 0; i < EXECUTION_COUNT; i++) { Connection connection = createConnection(TEST_USER_NAME + i); - + SimpleMageClient mageClient = new SimpleMageClient(); Session session = new SessionImpl(mageClient); - + session.connect(connection); UUID roomId = session.getMainRoomId(); - + GameTypeView gameTypeView = session.getGameTypes().get(0); log.info("Game type view: " + gameTypeView.getName()); MatchOptions options = createGameOptions(gameTypeView, session); - + TableView table = session.createTable(roomId, options); if (!session.joinTable(roomId, table.getTableId(), TEST_USER_NAME + i, "Human", 1, deckList)) { @@ -106,24 +106,24 @@ public class LoadTest { Assert.assertTrue("Error while joining table", false); return; } - + /*** Connect with a second player ***/ Connection connection2 = createConnection(TEST_USER_NAME_2 + i); SimpleMageClient mageClient2 = new SimpleMageClient(); Session session2 = new SessionImpl(mageClient2); session2.connect(connection2); UUID roomId2 = session2.getMainRoomId(); - + // connect to the table with the same deck if (!session2.joinTable(roomId2, table.getTableId(), TEST_USER_NAME_2 + i, "Human", 1, deckList)) { log.error("Error while joining table"); Assert.assertTrue("Error while joining table", false); return; } - + /*** Start game ***/ session.startGame(roomId, table.getTableId()); - + Thread.sleep(100); } } diff --git a/Mage.Tests/src/test/java/org/mage/test/load/SimpleMageClient.java b/Mage.Tests/src/test/java/org/mage/test/load/SimpleMageClient.java index a21da72c79..d6f4e41520 100644 --- a/Mage.Tests/src/test/java/org/mage/test/load/SimpleMageClient.java +++ b/Mage.Tests/src/test/java/org/mage/test/load/SimpleMageClient.java @@ -18,7 +18,7 @@ public class SimpleMageClient implements MageClient { private UUID clientId; private final static MageVersion version = new MageVersion(0, 8, 4, ""); - + private static final transient Logger log = Logger.getLogger(SimpleMageClient.class); private CallbackClient callbackClient; @@ -62,11 +62,11 @@ public class SimpleMageClient implements MageClient { public void processCallback(ClientCallback callback) { callbackClient.processCallback(callback); } - + public void setSession(Session session) { ((LoadCallbackClient)callbackClient).setSession(session); } - + public boolean isGameOver() { return ((LoadCallbackClient)callbackClient).isGameOver(); } diff --git a/Mage.Tests/src/test/java/org/mage/test/player/PlayerAction.java b/Mage.Tests/src/test/java/org/mage/test/player/PlayerAction.java index 2a6b2e4941..4bfc6c066e 100644 --- a/Mage.Tests/src/test/java/org/mage/test/player/PlayerAction.java +++ b/Mage.Tests/src/test/java/org/mage/test/player/PlayerAction.java @@ -35,27 +35,27 @@ import mage.Constants.PhaseStep; * @author BetaSteward_at_googlemail.com */ public class PlayerAction { - + private int turnNum; private PhaseStep step; private String action; - + public PlayerAction(int turnNum, PhaseStep step, String action) { this.turnNum = turnNum; this.step = step; this.action = action; } - + public int getTurnNum() { return turnNum; } - + public PhaseStep getStep() { return step; } - + public String getAction() { return action; } - + } diff --git a/Mage.Tests/src/test/java/org/mage/test/player/RandomPlayer.java b/Mage.Tests/src/test/java/org/mage/test/player/RandomPlayer.java index a753e3f842..fa20172a5b 100644 --- a/Mage.Tests/src/test/java/org/mage/test/player/RandomPlayer.java +++ b/Mage.Tests/src/test/java/org/mage/test/player/RandomPlayer.java @@ -72,45 +72,45 @@ import org.apache.log4j.Logger; * @author BetaSteward_at_googlemail.com */ public class RandomPlayer extends ComputerPlayer { - - private boolean isSimulatedPlayer; + + private boolean isSimulatedPlayer; private static Random rnd = new Random(); private int actionCount = 0; - + protected PassAbility pass = new PassAbility(); public RandomPlayer(String name) { - super(name, RangeOfInfluence.ALL); - this.isSimulatedPlayer = true; - } + super(name, RangeOfInfluence.ALL); + this.isSimulatedPlayer = true; + } - public RandomPlayer(final RandomPlayer player) { - super(player); - this.isSimulatedPlayer = player.isSimulatedPlayer; - } + public RandomPlayer(final RandomPlayer player) { + super(player); + this.isSimulatedPlayer = player.isSimulatedPlayer; + } - @Override - public RandomPlayer copy() { - return new RandomPlayer(this); - } + @Override + public RandomPlayer copy() { + return new RandomPlayer(this); + } public boolean isSimulatedPlayer() { return this.isSimulatedPlayer; } - + public int getActionCount() { return actionCount; } - - @Override - public boolean priority(Game game) { + + @Override + public boolean priority(Game game) { boolean didSomething = false; Ability ability = getAction(game); if (!(ability instanceof PassAbility)) didSomething = true; activateAbility((ActivatedAbility) ability, game); - + actionCount++; return didSomething; } @@ -161,9 +161,9 @@ public class RandomPlayer extends ComputerPlayer { playables.add(pass); return playables; } - + @Override - public boolean triggerAbility(TriggeredAbility source, Game game) { + public boolean triggerAbility(TriggeredAbility source, Game game) { if (source != null && source.canChooseTarget(game)) { Ability ability; List options = getPlayableOptions(source, game); @@ -176,32 +176,32 @@ public class RandomPlayer extends ComputerPlayer { else ability = options.get(rnd.nextInt(options.size())); } - if (ability.isUsesStack()) { - game.getStack().push(new StackAbility(ability, playerId)); - if (ability.activate(game, false)) { + if (ability.isUsesStack()) { + game.getStack().push(new StackAbility(ability, playerId)); + if (ability.activate(game, false)) { actionCount++; - return true; - } - } else { - if (ability.activate(game, false)) { - ability.resolve(game); + return true; + } + } else { + if (ability.activate(game, false)) { + ability.resolve(game); actionCount++; - return true; - } - } + return true; + } + } } return false; - } + } @Override public void selectAttackers(Game game) { - //useful only for two player games - will only attack first opponent - UUID defenderId = game.getOpponents(playerId).iterator().next(); - List attackersList = super.getAvailableAttackers(game); - //use binary digits to calculate powerset of attackers - int powerElements = (int) Math.pow(2, attackersList.size()); + //useful only for two player games - will only attack first opponent + UUID defenderId = game.getOpponents(playerId).iterator().next(); + List attackersList = super.getAvailableAttackers(game); + //use binary digits to calculate powerset of attackers + int powerElements = (int) Math.pow(2, attackersList.size()); int value = rnd.nextInt(powerElements); - StringBuilder binary = new StringBuilder(); + StringBuilder binary = new StringBuilder(); binary.append(Integer.toBinaryString(value)); while (binary.length() < attackersList.size()) { binary.insert(0, "0"); //pad with zeros @@ -215,10 +215,10 @@ public class RandomPlayer extends ComputerPlayer { @Override public void selectBlockers(Game game) { - int numGroups = game.getCombat().getGroups().size(); - if (numGroups == 0) return; + int numGroups = game.getCombat().getGroups().size(); + if (numGroups == 0) return; - List blockers = getAvailableBlockers(game); + List blockers = getAvailableBlockers(game); for (Permanent blocker: blockers) { int check = rnd.nextInt(numGroups + 1); if (check < numGroups) { @@ -228,7 +228,7 @@ public class RandomPlayer extends ComputerPlayer { } } actionCount++; - } + } @Override public void abort() { @@ -257,7 +257,7 @@ public class RandomPlayer extends ComputerPlayer { target.add(targetId, game); return true; } - + protected boolean chooseRandomTarget(Target target, Ability source, Game game) { Set possibleTargets = target.possibleTargets(source==null?null:source.getSourceId(), playerId, game); if (possibleTargets.isEmpty()) @@ -360,7 +360,7 @@ public class RandomPlayer extends ComputerPlayer { public boolean choosePile(Outcome outcome, String message, List pile1, List pile2, Game game) { return rnd.nextBoolean(); } - + @Override public boolean choose(Outcome outcome, Choice choice, Game game) { Iterator it = choice.getChoices().iterator(); @@ -375,20 +375,20 @@ public class RandomPlayer extends ComputerPlayer { @Override public boolean playXMana(VariableManaCost cost, ManaCosts costs, Game game) { - for (Permanent perm: this.getAvailableManaProducers(game)) { - for (ManaAbility ability: perm.getAbilities().getAvailableManaAbilities(Zone.BATTLEFIELD, game)) { + for (Permanent perm: this.getAvailableManaProducers(game)) { + for (ManaAbility ability: perm.getAbilities().getAvailableManaAbilities(Zone.BATTLEFIELD, game)) { if (rnd.nextBoolean()) activateAbility(ability, game); - } - } + } + } - // don't allow X=0 - if (getManaPool().count() == 0) { - return false; - } + // don't allow X=0 + if (getManaPool().count() == 0) { + return false; + } - cost.setPaid(); - return true; + cost.setPaid(); + return true; } @Override diff --git a/Mage.Tests/src/test/java/org/mage/test/player/TestPlayer.java b/Mage.Tests/src/test/java/org/mage/test/player/TestPlayer.java index df98b3ec0e..ceb67a7f17 100644 --- a/Mage.Tests/src/test/java/org/mage/test/player/TestPlayer.java +++ b/Mage.Tests/src/test/java/org/mage/test/player/TestPlayer.java @@ -62,28 +62,28 @@ public class TestPlayer extends ComputerPlayer { private List actions = new ArrayList(); private List choices = new ArrayList(); private List targets = new ArrayList(); - + public TestPlayer(String name, Constants.RangeOfInfluence range) { - super(name, range); - human = false; - } + super(name, range); + human = false; + } public TestPlayer(final TestPlayer player) { - super(player); - } + super(player); + } public void addAction(int turnNum, PhaseStep step, String action) { actions.add(new PlayerAction(turnNum, step, action)); } - + public void addChoice(String choice) { choices.add(choice); } - + public void addTarget(String target) { targets.add(target); } - + @Override public TestPlayer copy() { return new TestPlayer(this); @@ -165,9 +165,9 @@ public class TestPlayer extends ComputerPlayer { } } } - - @Override - public boolean choose(Constants.Outcome outcome, Choice choice, Game game) { + + @Override + public boolean choose(Constants.Outcome outcome, Choice choice, Game game) { if (!choices.isEmpty()) { for (String choose1: choice.getChoices()) { for (String choose2: choices) { @@ -180,7 +180,7 @@ public class TestPlayer extends ComputerPlayer { } } return super.choose(outcome, choice, game); - } + } @Override public boolean choose(Constants.Outcome outcome, Target target, UUID sourceId, Game game, Map options) { @@ -248,7 +248,7 @@ public class TestPlayer extends ComputerPlayer { } return true; } - + protected Permanent findPermanent(FilterPermanent filter, UUID controllerId, Game game) { List permanents = game.getBattlefield().getAllActivePermanents(filter, controllerId, game); if (permanents.size() > 0) @@ -303,5 +303,5 @@ public class TestPlayer extends ComputerPlayer { } } } - + } diff --git a/Mage.Tests/src/test/java/org/mage/test/serverside/PlayGameTest.java b/Mage.Tests/src/test/java/org/mage/test/serverside/PlayGameTest.java index 97c0d11481..f0272dd1bb 100644 --- a/Mage.Tests/src/test/java/org/mage/test/serverside/PlayGameTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/serverside/PlayGameTest.java @@ -26,65 +26,65 @@ import java.util.Random; */ public class PlayGameTest extends MageTestBase { - private static List colorChoices = Arrays.asList("bu", "bg", "br", "bw", "ug", "ur", "uw", "gr", "gw", "rw", "bur", "buw", "bug", "brg", "brw", "bgw", "wur", "wug", "wrg", "rgu"); + private static List colorChoices = Arrays.asList("bu", "bg", "br", "bw", "ug", "ur", "uw", "gr", "gw", "rw", "bur", "buw", "bug", "brg", "brw", "bgw", "wur", "wug", "wrg", "rgu"); - @Ignore + @Ignore @Test - public void playOneGame() throws GameException, FileNotFoundException, IllegalArgumentException { - Game game = new TwoPlayerDuel(Constants.MultiplayerAttackOption.LEFT, Constants.RangeOfInfluence.ALL); + public void playOneGame() throws GameException, FileNotFoundException, IllegalArgumentException { + Game game = new TwoPlayerDuel(Constants.MultiplayerAttackOption.LEFT, Constants.RangeOfInfluence.ALL); - Player computerA = createPlayer("ComputerA", "Computer - minimax hybrid"); -// Player playerA = createPlayer("ComputerA", "Computer - mad"); -// Deck deck = Deck.load(Sets.loadDeck("RB Aggro.dck")); - Deck deck = generateRandomDeck(); + Player computerA = createPlayer("ComputerA", "Computer - minimax hybrid"); +// Player playerA = createPlayer("ComputerA", "Computer - mad"); +// Deck deck = Deck.load(Sets.loadDeck("RB Aggro.dck")); + Deck deck = generateRandomDeck(); - if (deck.getCards().size() < 40) { - throw new IllegalArgumentException("Couldn't load deck, deck size=" + deck.getCards().size()); - } - game.addPlayer(computerA, deck); - game.loadCards(deck.getCards(), computerA.getId()); + if (deck.getCards().size() < 40) { + throw new IllegalArgumentException("Couldn't load deck, deck size=" + deck.getCards().size()); + } + game.addPlayer(computerA, deck); + game.loadCards(deck.getCards(), computerA.getId()); - Player computerB = createPlayer("ComputerB", "Computer - minimax hybrid"); -// Player playerB = createPlayer("ComputerB", "Computer - mad"); -// Deck deck2 = Deck.load(Sets.loadDeck("RB Aggro.dck")); - Deck deck2 = generateRandomDeck(); - if (deck2.getCards().size() < 40) { - throw new IllegalArgumentException("Couldn't load deck, deck size=" + deck2.getCards().size()); - } - game.addPlayer(computerB, deck2); - game.loadCards(deck2.getCards(), computerB.getId()); + Player computerB = createPlayer("ComputerB", "Computer - minimax hybrid"); +// Player playerB = createPlayer("ComputerB", "Computer - mad"); +// Deck deck2 = Deck.load(Sets.loadDeck("RB Aggro.dck")); + Deck deck2 = generateRandomDeck(); + if (deck2.getCards().size() < 40) { + throw new IllegalArgumentException("Couldn't load deck, deck size=" + deck2.getCards().size()); + } + game.addPlayer(computerB, deck2); + game.loadCards(deck2.getCards(), computerB.getId()); -// parseScenario("scenario1.txt"); -// game.cheat(playerA.getId(), commandsA); -// game.cheat(playerA.getId(), libraryCardsA, handCardsA, battlefieldCardsA, graveyardCardsA); -// game.cheat(playerB.getId(), commandsB); -// game.cheat(playerB.getId(), libraryCardsB, handCardsB, battlefieldCardsB, graveyardCardsB); +// parseScenario("scenario1.txt"); +// game.cheat(playerA.getId(), commandsA); +// game.cheat(playerA.getId(), libraryCardsA, handCardsA, battlefieldCardsA, graveyardCardsA); +// game.cheat(playerB.getId(), commandsB); +// game.cheat(playerB.getId(), libraryCardsB, handCardsB, battlefieldCardsB, graveyardCardsB); - //boolean testMode = false; - boolean testMode = true; + //boolean testMode = false; + boolean testMode = true; - long t1 = System.nanoTime(); - GameOptions options = new GameOptions(); - options.testMode = true; - game.start(computerA.getId(), options); - long t2 = System.nanoTime(); + long t1 = System.nanoTime(); + GameOptions options = new GameOptions(); + options.testMode = true; + game.start(computerA.getId(), options); + long t2 = System.nanoTime(); - logger.info("Winner: " + game.getWinner()); - logger.info("Time: " + (t2 - t1) / 1000000 + " ms"); - /*if (!game.getWinner().equals("Player ComputerA is the winner")) { - throw new RuntimeException("Lost :("); - }*/ - } + logger.info("Winner: " + game.getWinner()); + logger.info("Time: " + (t2 - t1) / 1000000 + " ms"); + /*if (!game.getWinner().equals("Player ComputerA is the winner")) { + throw new RuntimeException("Lost :("); + }*/ + } - private Deck generateRandomDeck() { - String selectedColors = colorChoices.get(new Random().nextInt(colorChoices.size())).toUpperCase(); - List allowedColors = new ArrayList(); - logger.info("Building deck with colors: " + selectedColors); - for (int i = 0; i < selectedColors.length(); i++) { - char c = selectedColors.charAt(i); - allowedColors.add(ColoredManaSymbol.lookup(c)); - } - List cardPool = Sets.generateRandomCardPool(45, allowedColors); - return ComputerPlayer.buildDeck(cardPool, allowedColors); - } + private Deck generateRandomDeck() { + String selectedColors = colorChoices.get(new Random().nextInt(colorChoices.size())).toUpperCase(); + List allowedColors = new ArrayList(); + logger.info("Building deck with colors: " + selectedColors); + for (int i = 0; i < selectedColors.length(); i++) { + char c = selectedColors.charAt(i); + allowedColors.add(ColoredManaSymbol.lookup(c)); + } + List cardPool = Sets.generateRandomCardPool(45, allowedColors); + return ComputerPlayer.buildDeck(cardPool, allowedColors); + } } diff --git a/Mage.Tests/src/test/java/org/mage/test/serverside/TestPlayRandomGame.java b/Mage.Tests/src/test/java/org/mage/test/serverside/TestPlayRandomGame.java index 7f7df12e3f..2b3723edbe 100644 --- a/Mage.Tests/src/test/java/org/mage/test/serverside/TestPlayRandomGame.java +++ b/Mage.Tests/src/test/java/org/mage/test/serverside/TestPlayRandomGame.java @@ -26,7 +26,7 @@ import java.util.Random; */ public class TestPlayRandomGame extends MageTestBase { - private static List colorChoices = Arrays.asList("bu", "bg", "br", "bw", "ug", "ur", "uw", "gr", "gw", "rw", "bur", "buw", "bug", "brg", "brw", "bgw", "wur", "wug", "wrg", "rgu"); + private static List colorChoices = Arrays.asList("bu", "bg", "br", "bw", "ug", "ur", "uw", "gr", "gw", "rw", "bur", "buw", "bug", "brg", "brw", "bgw", "wur", "wug", "wrg", "rgu"); @Test @Ignore @@ -36,48 +36,48 @@ public class TestPlayRandomGame extends MageTestBase { playOneGame(); } } - - private void playOneGame() throws GameException, FileNotFoundException, IllegalArgumentException { - Game game = new TwoPlayerDuel(Constants.MultiplayerAttackOption.LEFT, Constants.RangeOfInfluence.ALL); - Player computerA = createRandomPlayer("ComputerA"); - Deck deck = generateRandomDeck(); + private void playOneGame() throws GameException, FileNotFoundException, IllegalArgumentException { + Game game = new TwoPlayerDuel(Constants.MultiplayerAttackOption.LEFT, Constants.RangeOfInfluence.ALL); - if (deck.getCards().size() < 40) { - throw new IllegalArgumentException("Couldn't load deck, deck size=" + deck.getCards().size()); - } - game.addPlayer(computerA, deck); - game.loadCards(deck.getCards(), computerA.getId()); + Player computerA = createRandomPlayer("ComputerA"); + Deck deck = generateRandomDeck(); - Player computerB = createRandomPlayer("ComputerB"); - Deck deck2 = generateRandomDeck(); - if (deck2.getCards().size() < 40) { - throw new IllegalArgumentException("Couldn't load deck, deck size=" + deck2.getCards().size()); - } - game.addPlayer(computerB, deck2); - game.loadCards(deck2.getCards(), computerB.getId()); + if (deck.getCards().size() < 40) { + throw new IllegalArgumentException("Couldn't load deck, deck size=" + deck.getCards().size()); + } + game.addPlayer(computerA, deck); + game.loadCards(deck.getCards(), computerA.getId()); - boolean testMode = true; + Player computerB = createRandomPlayer("ComputerB"); + Deck deck2 = generateRandomDeck(); + if (deck2.getCards().size() < 40) { + throw new IllegalArgumentException("Couldn't load deck, deck size=" + deck2.getCards().size()); + } + game.addPlayer(computerB, deck2); + game.loadCards(deck2.getCards(), computerB.getId()); - long t1 = System.nanoTime(); - GameOptions options = new GameOptions(); - options.testMode = true; - game.start(computerA.getId(), options); - long t2 = System.nanoTime(); + boolean testMode = true; - logger.info("Winner: " + game.getWinner()); - logger.info("Time: " + (t2 - t1) / 1000000 + " ms"); - } + long t1 = System.nanoTime(); + GameOptions options = new GameOptions(); + options.testMode = true; + game.start(computerA.getId(), options); + long t2 = System.nanoTime(); - private Deck generateRandomDeck() { - String selectedColors = colorChoices.get(new Random().nextInt(colorChoices.size())).toUpperCase(); - List allowedColors = new ArrayList(); - logger.info("Building deck with colors: " + selectedColors); - for (int i = 0; i < selectedColors.length(); i++) { - char c = selectedColors.charAt(i); - allowedColors.add(ColoredManaSymbol.lookup(c)); - } - List cardPool = Sets.generateRandomCardPool(45, allowedColors); - return ComputerPlayer.buildDeck(cardPool, allowedColors); - } + logger.info("Winner: " + game.getWinner()); + logger.info("Time: " + (t2 - t1) / 1000000 + " ms"); + } + + private Deck generateRandomDeck() { + String selectedColors = colorChoices.get(new Random().nextInt(colorChoices.size())).toUpperCase(); + List allowedColors = new ArrayList(); + logger.info("Building deck with colors: " + selectedColors); + for (int i = 0; i < selectedColors.length(); i++) { + char c = selectedColors.charAt(i); + allowedColors.add(ColoredManaSymbol.lookup(c)); + } + List cardPool = Sets.generateRandomCardPool(45, allowedColors); + return ComputerPlayer.buildDeck(cardPool, allowedColors); + } } diff --git a/Mage.Tests/src/test/java/org/mage/test/serverside/base/CardTestAPI.java b/Mage.Tests/src/test/java/org/mage/test/serverside/base/CardTestAPI.java index b103b22b41..2e6d3ddd69 100644 --- a/Mage.Tests/src/test/java/org/mage/test/serverside/base/CardTestAPI.java +++ b/Mage.Tests/src/test/java/org/mage/test/serverside/base/CardTestAPI.java @@ -13,155 +13,155 @@ import mage.Constants.PhaseStep; */ public interface CardTestAPI { - /** - * Types of game result. - */ - public enum GameResult { - WON, - LOST, - DRAW - } + /** + * Types of game result. + */ + public enum GameResult { + WON, + LOST, + DRAW + } - //******* INITIALIZATION METHODS *******/ + //******* INITIALIZATION METHODS *******/ - /** - * Default game initialization params for red player (that plays with Mountains) - */ - void useRedDefault(); + /** + * Default game initialization params for red player (that plays with Mountains) + */ + void useRedDefault(); - /** - * Removes all cards from player's library from the game. - * Usually this should be used once before initialization to form the library in certain order. - * - * @param player {@link Player} to remove all library cards from. - */ - void removeAllCardsFromLibrary(Player player); + /** + * Removes all cards from player's library from the game. + * Usually this should be used once before initialization to form the library in certain order. + * + * @param player {@link Player} to remove all library cards from. + */ + void removeAllCardsFromLibrary(Player player); - /** - * Add a card to specified zone of specified player. - * - * @param gameZone {@link Constants.Zone} to add cards to. - * @param player {@link Player} to add cards for. Use either playerA or playerB. - * @param cardName Card name in string format. - */ - void addCard(Constants.Zone gameZone, Player player, String cardName); + /** + * Add a card to specified zone of specified player. + * + * @param gameZone {@link Constants.Zone} to add cards to. + * @param player {@link Player} to add cards for. Use either playerA or playerB. + * @param cardName Card name in string format. + */ + void addCard(Constants.Zone gameZone, Player player, String cardName); - /** - * Add any amount of cards to specified zone of specified player. - * - * @param gameZone {@link Constants.Zone} to add cards to. - * @param player {@link Player} to add cards for. Use either playerA or playerB. - * @param cardName Card name in string format. - * @param count Amount of cards to be added. - */ - void addCard(Constants.Zone gameZone, Player player, String cardName, int count); + /** + * Add any amount of cards to specified zone of specified player. + * + * @param gameZone {@link Constants.Zone} to add cards to. + * @param player {@link Player} to add cards for. Use either playerA or playerB. + * @param cardName Card name in string format. + * @param count Amount of cards to be added. + */ + void addCard(Constants.Zone gameZone, Player player, String cardName, int count); - /** - * Add any amount of cards to specified zone of specified player. - * - * @param gameZone {@link Constants.Zone} to add cards to. - * @param player {@link Player} to add cards for. Use either playerA or playerB. - * @param cardName Card name in string format. - * @param count Amount of cards to be added. - * @param tapped In case gameZone is Battlefield, determines whether permanent should be tapped. - * In case gameZone is other than Battlefield, {@link IllegalArgumentException} is thrown - */ - void addCard(Constants.Zone gameZone, Player player, String cardName, int count, boolean tapped); + /** + * Add any amount of cards to specified zone of specified player. + * + * @param gameZone {@link Constants.Zone} to add cards to. + * @param player {@link Player} to add cards for. Use either playerA or playerB. + * @param cardName Card name in string format. + * @param count Amount of cards to be added. + * @param tapped In case gameZone is Battlefield, determines whether permanent should be tapped. + * In case gameZone is other than Battlefield, {@link IllegalArgumentException} is thrown + */ + void addCard(Constants.Zone gameZone, Player player, String cardName, int count, boolean tapped); - /** - * Set player's initial life count. - * - * @param player {@link Player} to set life count for. - * @param life Life count to set. - */ - void setLife(Player player, int life); + /** + * Set player's initial life count. + * + * @param player {@link Player} to set life count for. + * @param life Life count to set. + */ + void setLife(Player player, int life); - //******* GAME OPTIONS *******/ + //******* GAME OPTIONS *******/ - /** - * Define turn number to stop the game on. - */ - void setStopOnTurn(int turn); + /** + * Define turn number to stop the game on. + */ + void setStopOnTurn(int turn); - /** - * Define the turn number and step to stop the game on. - */ - void setStopAt(int turn, PhaseStep step); + /** + * Define the turn number and step to stop the game on. + */ + void setStopAt(int turn, PhaseStep step); //******* ASSERT METHODS *******/ - /** - * Assert turn number after test execution. - * - * @param turn Expected turn number to compare with. - */ - void assertTurn(int turn) throws AssertionError; - - /** - * Assert game result for the player after test execution. - * - * @param player {@link Player} to get game result for. - * @param result Expected {@link GameResult} to compare with. - */ - void assertResult(Player player, GameResult result) throws AssertionError; - - /** - * Assert player's life count after test execution. - * - * @param player {@link Player} to get life for comparison. - * @param life Expected player's life to compare with. - */ - void assertLife(Player player, int life) throws AssertionError; - - /** - * Assert creature's power and toughness by card name. - *

- * Throws {@link AssertionError} in the following cases: - * 1. no such player - * 2. no such creature under player's control - * 3. depending on comparison scope: - * 3a. any: no creature under player's control with the specified p\t params - * 3b. all: there is at least one creature with the cardName with the different p\t params - * - * @param player {@link Player} to get creatures for comparison. - * @param cardName Card name to compare with. - * @param power Expected power to compare with. - * @param toughness Expected toughness to compare with. - * @param scope {@link Filter.ComparisonScope} Use ANY, if you want "at least one creature with given name should have specified p\t" - * Use ALL, if you want "all creature with gived name should have specified p\t" - */ - void assertPowerToughness(Player player, String cardName, int power, int toughness, Filter.ComparisonScope scope) - throws AssertionError; + /** + * Assert turn number after test execution. + * + * @param turn Expected turn number to compare with. + */ + void assertTurn(int turn) throws AssertionError; /** - * Assert creature's abilities. - *

- * Throws {@link AssertionError} in the following cases: - * 1. no such player - * 2. no such creature under player's control - * 3. there is more than one creature with such name - * - * @param player {@link Player} to get creatures for comparison. - * @param cardName Card name to compare with. - * @param abilities Expected abilities - */ - void assertAbilities(Player player, String cardName, List abilities) - throws AssertionError; + * Assert game result for the player after test execution. + * + * @param player {@link Player} to get game result for. + * @param result Expected {@link GameResult} to compare with. + */ + void assertResult(Player player, GameResult result) throws AssertionError; - /** - * Assert permanent count under player's control. - * - * @param player {@link Player} which permanents should be counted. - * @param count Expected count. - */ - void assertPermanentCount(Player player, int count) throws AssertionError; + /** + * Assert player's life count after test execution. + * + * @param player {@link Player} to get life for comparison. + * @param life Expected player's life to compare with. + */ + void assertLife(Player player, int life) throws AssertionError; - /** - * Assert permanent count under player's control. - * - * @param player {@link Player} which permanents should be counted. - * @param cardName Name of the cards that should be counted. - * @param count Expected count. - */ - void assertPermanentCount(Player player, String cardName, int count) throws AssertionError; + /** + * Assert creature's power and toughness by card name. + *

+ * Throws {@link AssertionError} in the following cases: + * 1. no such player + * 2. no such creature under player's control + * 3. depending on comparison scope: + * 3a. any: no creature under player's control with the specified p\t params + * 3b. all: there is at least one creature with the cardName with the different p\t params + * + * @param player {@link Player} to get creatures for comparison. + * @param cardName Card name to compare with. + * @param power Expected power to compare with. + * @param toughness Expected toughness to compare with. + * @param scope {@link Filter.ComparisonScope} Use ANY, if you want "at least one creature with given name should have specified p\t" + * Use ALL, if you want "all creature with gived name should have specified p\t" + */ + void assertPowerToughness(Player player, String cardName, int power, int toughness, Filter.ComparisonScope scope) + throws AssertionError; + + /** + * Assert creature's abilities. + *

+ * Throws {@link AssertionError} in the following cases: + * 1. no such player + * 2. no such creature under player's control + * 3. there is more than one creature with such name + * + * @param player {@link Player} to get creatures for comparison. + * @param cardName Card name to compare with. + * @param abilities Expected abilities + */ + void assertAbilities(Player player, String cardName, List abilities) + throws AssertionError; + + /** + * Assert permanent count under player's control. + * + * @param player {@link Player} which permanents should be counted. + * @param count Expected count. + */ + void assertPermanentCount(Player player, int count) throws AssertionError; + + /** + * Assert permanent count under player's control. + * + * @param player {@link Player} which permanents should be counted. + * @param cardName Name of the cards that should be counted. + * @param count Expected count. + */ + void assertPermanentCount(Player player, String cardName, int count) throws AssertionError; } diff --git a/Mage.Tests/src/test/java/org/mage/test/serverside/base/CardTestBase.java b/Mage.Tests/src/test/java/org/mage/test/serverside/base/CardTestBase.java index 5b8f2f01a4..a772097a56 100644 --- a/Mage.Tests/src/test/java/org/mage/test/serverside/base/CardTestBase.java +++ b/Mage.Tests/src/test/java/org/mage/test/serverside/base/CardTestBase.java @@ -25,36 +25,36 @@ import org.mage.test.serverside.base.impl.CardTestAPIImpl; */ public abstract class CardTestBase extends CardTestAPIImpl { - protected enum AIType { - MinimaxHybrid, - MAD, + protected enum AIType { + MinimaxHybrid, + MAD, MonteCarlo - } + } - protected enum ExpectedType { - TURN_NUMBER, - RESULT, - LIFE, - BATTLEFIELD, - GRAVEYARD, - UNKNOWN - } + protected enum ExpectedType { + TURN_NUMBER, + RESULT, + LIFE, + BATTLEFIELD, + GRAVEYARD, + UNKNOWN + } - /** - * Computer types used to test cards. - * By default: MAD. - */ - private AIType aiTypeA, aiTypeB; + /** + * Computer types used to test cards. + * By default: MAD. + */ + private AIType aiTypeA, aiTypeB; - public CardTestBase() { - aiTypeA = AIType.MAD; - aiTypeB = AIType.MAD; - } + public CardTestBase() { + aiTypeA = AIType.MAD; + aiTypeB = AIType.MAD; + } - public CardTestBase(AIType aiTypeA, AIType aiTypeB) { - this.aiTypeA = aiTypeA; - this.aiTypeB = aiTypeB; - } + public CardTestBase(AIType aiTypeA, AIType aiTypeB) { + this.aiTypeA = aiTypeA; + this.aiTypeB = aiTypeB; + } protected Player createNewPlayer(String playerName, AIType aiType) { Player player = null; @@ -71,277 +71,277 @@ public abstract class CardTestBase extends CardTestAPIImpl { } return player; } - - @Before - public void reset() throws GameException, FileNotFoundException { - if (currentGame != null) { - logger.info("Resetting previous game and creating new one!"); - currentGame = null; - System.gc(); - } - Game game = new TwoPlayerDuel(Constants.MultiplayerAttackOption.LEFT, Constants.RangeOfInfluence.ALL); + @Before + public void reset() throws GameException, FileNotFoundException { + if (currentGame != null) { + logger.info("Resetting previous game and creating new one!"); + currentGame = null; + System.gc(); + } - playerA = createNewPlayer("PlayerA", aiTypeA); - playerA.setTestMode(true); + Game game = new TwoPlayerDuel(Constants.MultiplayerAttackOption.LEFT, Constants.RangeOfInfluence.ALL); + + playerA = createNewPlayer("PlayerA", aiTypeA); + playerA.setTestMode(true); logger.info("Loading deck..."); - Deck deck = Deck.load(DeckImporterUtil.importDeck("RB Aggro.dck")); + Deck deck = Deck.load(DeckImporterUtil.importDeck("RB Aggro.dck")); logger.info("Done!"); - if (deck.getCards().size() < 40) { - throw new IllegalArgumentException("Couldn't load deck, deck size=" + deck.getCards().size()); - } - game.addPlayer(playerA, deck); - game.loadCards(deck.getCards(), playerA.getId()); + if (deck.getCards().size() < 40) { + throw new IllegalArgumentException("Couldn't load deck, deck size=" + deck.getCards().size()); + } + game.addPlayer(playerA, deck); + game.loadCards(deck.getCards(), playerA.getId()); - playerB = createNewPlayer("PlayerB", aiTypeB); - playerB.setTestMode(true); - Deck deck2 = Deck.load(DeckImporterUtil.importDeck("RB Aggro.dck")); - if (deck2.getCards().size() < 40) { - throw new IllegalArgumentException("Couldn't load deck, deck size=" + deck2.getCards().size()); - } - game.addPlayer(playerB, deck2); - game.loadCards(deck2.getCards(), playerB.getId()); - activePlayer = playerA; - currentGame = game; + playerB = createNewPlayer("PlayerB", aiTypeB); + playerB.setTestMode(true); + Deck deck2 = Deck.load(DeckImporterUtil.importDeck("RB Aggro.dck")); + if (deck2.getCards().size() < 40) { + throw new IllegalArgumentException("Couldn't load deck, deck size=" + deck2.getCards().size()); + } + game.addPlayer(playerB, deck2); + game.loadCards(deck2.getCards(), playerB.getId()); + activePlayer = playerA; + currentGame = game; stopOnTurn = 2; stopAtStep = PhaseStep.UNTAP; - handCardsA.clear(); - handCardsB.clear(); - battlefieldCardsA.clear(); - battlefieldCardsB.clear(); - graveyardCardsA.clear(); - graveyardCardsB.clear(); - libraryCardsA.clear(); - libraryCardsB.clear(); - commandsA.clear(); - commandsB.clear(); - } + handCardsA.clear(); + handCardsB.clear(); + battlefieldCardsA.clear(); + battlefieldCardsB.clear(); + graveyardCardsA.clear(); + graveyardCardsB.clear(); + libraryCardsA.clear(); + libraryCardsB.clear(); + commandsA.clear(); + commandsB.clear(); + } - public void load(String path) throws FileNotFoundException, GameException { - load(path, AIType.MAD, AIType.MAD); - } + public void load(String path) throws FileNotFoundException, GameException { + load(path, AIType.MAD, AIType.MAD); + } - public void load(String path, AIType aiTypeA, AIType aiTypeB) throws FileNotFoundException, GameException { - String cardPath = TESTS_PATH + path; - File checkFile = new File(cardPath); - if (!checkFile.exists()) { - throw new FileNotFoundException("Couldn't find test file: " + cardPath); - } - if (checkFile.isDirectory()) { - throw new FileNotFoundException("Couldn't find test file: " + cardPath + ". It is directory."); - } + public void load(String path, AIType aiTypeA, AIType aiTypeB) throws FileNotFoundException, GameException { + String cardPath = TESTS_PATH + path; + File checkFile = new File(cardPath); + if (!checkFile.exists()) { + throw new FileNotFoundException("Couldn't find test file: " + cardPath); + } + if (checkFile.isDirectory()) { + throw new FileNotFoundException("Couldn't find test file: " + cardPath + ". It is directory."); + } - if (currentGame != null) { - logger.info("Resetting previous game and creating new one!"); - currentGame = null; - System.gc(); - } + if (currentGame != null) { + logger.info("Resetting previous game and creating new one!"); + currentGame = null; + System.gc(); + } - Game game = new TwoPlayerDuel(Constants.MultiplayerAttackOption.LEFT, Constants.RangeOfInfluence.ALL); + Game game = new TwoPlayerDuel(Constants.MultiplayerAttackOption.LEFT, Constants.RangeOfInfluence.ALL); - playerA = createNewPlayer("ComputerA", aiTypeA); - playerA.setTestMode(true); + playerA = createNewPlayer("ComputerA", aiTypeA); + playerA.setTestMode(true); - Deck deck = Deck.load(DeckImporterUtil.importDeck("RB Aggro.dck")); + Deck deck = Deck.load(DeckImporterUtil.importDeck("RB Aggro.dck")); - if (deck.getCards().size() < 40) { - throw new IllegalArgumentException("Couldn't load deck, deck size=" + deck.getCards().size()); - } - game.addPlayer(playerA, deck); - game.loadCards(deck.getCards(), playerA.getId()); + if (deck.getCards().size() < 40) { + throw new IllegalArgumentException("Couldn't load deck, deck size=" + deck.getCards().size()); + } + game.addPlayer(playerA, deck); + game.loadCards(deck.getCards(), playerA.getId()); - playerB = createNewPlayer("ComputerB", aiTypeB); - playerB.setTestMode(true); - Deck deck2 = Deck.load(DeckImporterUtil.importDeck("RB Aggro.dck")); - if (deck2.getCards().size() < 40) { - throw new IllegalArgumentException("Couldn't load deck, deck size=" + deck2.getCards().size()); - } - game.addPlayer(playerB, deck2); - game.loadCards(deck2.getCards(), playerB.getId()); + playerB = createNewPlayer("ComputerB", aiTypeB); + playerB.setTestMode(true); + Deck deck2 = Deck.load(DeckImporterUtil.importDeck("RB Aggro.dck")); + if (deck2.getCards().size() < 40) { + throw new IllegalArgumentException("Couldn't load deck, deck size=" + deck2.getCards().size()); + } + game.addPlayer(playerB, deck2); + game.loadCards(deck2.getCards(), playerB.getId()); - parseScenario(cardPath); + parseScenario(cardPath); - activePlayer = playerA; - currentGame = game; - } + activePlayer = playerA; + currentGame = game; + } - /** - * Starts testing card by starting current game. - * - * @throws IllegalStateException In case game wasn't created previously. Use {@link #load} method to initialize the game. - */ - public void execute() throws IllegalStateException { - if (currentGame == null || activePlayer == null) { - throw new IllegalStateException("Game is not initialized. Use load method to load a test case and initialize a game."); - } + /** + * Starts testing card by starting current game. + * + * @throws IllegalStateException In case game wasn't created previously. Use {@link #load} method to initialize the game. + */ + public void execute() throws IllegalStateException { + if (currentGame == null || activePlayer == null) { + throw new IllegalStateException("Game is not initialized. Use load method to load a test case and initialize a game."); + } - currentGame.cheat(playerA.getId(), commandsA); - currentGame.cheat(playerA.getId(), libraryCardsA, handCardsA, battlefieldCardsA, graveyardCardsA); - currentGame.cheat(playerB.getId(), commandsB); - currentGame.cheat(playerB.getId(), libraryCardsB, handCardsB, battlefieldCardsB, graveyardCardsB); + currentGame.cheat(playerA.getId(), commandsA); + currentGame.cheat(playerA.getId(), libraryCardsA, handCardsA, battlefieldCardsA, graveyardCardsA); + currentGame.cheat(playerB.getId(), commandsB); + currentGame.cheat(playerB.getId(), libraryCardsB, handCardsB, battlefieldCardsB, graveyardCardsB); - boolean testMode = true; - long t1 = System.nanoTime(); - GameOptions gameOptions = new GameOptions(); - gameOptions.testMode = true; - gameOptions.stopOnTurn = stopOnTurn; + boolean testMode = true; + long t1 = System.nanoTime(); + GameOptions gameOptions = new GameOptions(); + gameOptions.testMode = true; + gameOptions.stopOnTurn = stopOnTurn; gameOptions.stopAtStep = stopAtStep; - currentGame.start(activePlayer.getId(), gameOptions); - long t2 = System.nanoTime(); - logger.info("Winner: " + currentGame.getWinner()); - logger.info("Time: " + (t2 - t1) / 1000000 + " ms"); + currentGame.start(activePlayer.getId(), gameOptions); + long t2 = System.nanoTime(); + logger.info("Winner: " + currentGame.getWinner()); + logger.info("Time: " + (t2 - t1) / 1000000 + " ms"); - assertTheResults(); - } + assertTheResults(); + } - /** - * Assert expected and actual results. - */ - private void assertTheResults() { - logger.info("Matching expected results:"); - for (String line : expectedResults) { - boolean ok = false; - try { - ExpectedType type = getExpectedType(line); - if (type.equals(CardTestBase.ExpectedType.UNKNOWN)) { - throw new AssertionError("Unknown expected type, check the line in $expected section=" + line); - } - parseType(type, line); - ok = true; - } finally { - logger.info(" " + line + " - " + (ok ? "OK" : "ERROR")); - } - } - } + /** + * Assert expected and actual results. + */ + private void assertTheResults() { + logger.info("Matching expected results:"); + for (String line : expectedResults) { + boolean ok = false; + try { + ExpectedType type = getExpectedType(line); + if (type.equals(CardTestBase.ExpectedType.UNKNOWN)) { + throw new AssertionError("Unknown expected type, check the line in $expected section=" + line); + } + parseType(type, line); + ok = true; + } finally { + logger.info(" " + line + " - " + (ok ? "OK" : "ERROR")); + } + } + } - private ExpectedType getExpectedType(String line) { - if (line.startsWith("turn:")) { - return CardTestBase.ExpectedType.TURN_NUMBER; - } - if (line.startsWith("result:")) { - return CardTestBase.ExpectedType.RESULT; - } - if (line.startsWith("life:")) { - return CardTestBase.ExpectedType.LIFE; - } - if (line.startsWith("battlefield:")) { - return CardTestBase.ExpectedType.BATTLEFIELD; - } - if (line.startsWith("graveyard:")) { - return CardTestBase.ExpectedType.GRAVEYARD; - } - return CardTestBase.ExpectedType.UNKNOWN; - } + private ExpectedType getExpectedType(String line) { + if (line.startsWith("turn:")) { + return CardTestBase.ExpectedType.TURN_NUMBER; + } + if (line.startsWith("result:")) { + return CardTestBase.ExpectedType.RESULT; + } + if (line.startsWith("life:")) { + return CardTestBase.ExpectedType.LIFE; + } + if (line.startsWith("battlefield:")) { + return CardTestBase.ExpectedType.BATTLEFIELD; + } + if (line.startsWith("graveyard:")) { + return CardTestBase.ExpectedType.GRAVEYARD; + } + return CardTestBase.ExpectedType.UNKNOWN; + } - private void parseType(ExpectedType type, String line) { - if (type.equals(CardTestBase.ExpectedType.TURN_NUMBER)) { - int turn = getIntParam(line, 1); - Assert.assertEquals("Turn numbers are not equal", turn, currentGame.getTurnNum()); - return; - } - if (type.equals(CardTestBase.ExpectedType.RESULT)) { - String expected = getStringParam(line, 1); - String actual = "draw"; - if (currentGame.getWinner().equals("Player ComputerA is the winner")) { - actual = "won"; - } else if (currentGame.getWinner().equals("Player ComputerB is the winner")) { - actual = "lost"; - } - Assert.assertEquals("Game results are not equal", expected, actual); - return; - } - if (type.equals(CardTestBase.ExpectedType.LIFE)) { - String player = getStringParam(line, 1); - int expected = getIntParam(line, 2); - if (player.equals("ComputerA")) { - int actual = currentGame.getPlayer(playerA.getId()).getLife(); - Assert.assertEquals("Life amounts are not equal", expected, actual); - } else if (player.equals("ComputerB")) { - int actual = currentGame.getPlayer(playerB.getId()).getLife(); - Assert.assertEquals("Life amounts are not equal", expected, actual); - } else { - throw new IllegalArgumentException("Wrong player in 'life' line, player=" + player + ", line=" + line); - } - return; - } - if (type.equals(CardTestBase.ExpectedType.BATTLEFIELD)) { - String playerName = getStringParam(line, 1); - String cardName = getStringParam(line, 2); - int expectedCount = getIntParam(line, 3); - Player player = null; - if (playerName.equals("ComputerA")) { - player = currentGame.getPlayer(playerA.getId()); - } else if (playerName.equals("ComputerB")) { - player = currentGame.getPlayer(playerB.getId()); - } else { - throw new IllegalArgumentException("Wrong player in 'battlefield' line, player=" + player + ", line=" + line); - } - int actualCount = 0; - for (Permanent permanent : currentGame.getBattlefield().getAllPermanents()) { - if (permanent.getControllerId().equals(player.getId())) { - if (permanent.getName().equals(cardName)) { - actualCount++; - } - } - } - Assert.assertEquals("(Battlefield) Card counts are not equal (" + cardName + ")", expectedCount, actualCount); - return; - } - if (type.equals(CardTestBase.ExpectedType.GRAVEYARD)) { - String playerName = getStringParam(line, 1); - String cardName = getStringParam(line, 2); - int expectedCount = getIntParam(line, 3); - Player player = null; - if (playerName.equals("ComputerA")) { - player = currentGame.getPlayer(playerA.getId()); - } else if (playerName.equals("ComputerB")) { - player = currentGame.getPlayer(playerB.getId()); - } else { - throw new IllegalArgumentException("Wrong player in 'graveyard' line, player=" + player + ", line=" + line); - } - int actualCount = 0; - for (Card card : player.getGraveyard().getCards(currentGame)) { - if (card.getName().equals(cardName)) { - actualCount++; - } - } - Assert.assertEquals("(Graveyard) Card counts are not equal (" + cardName + ")", expectedCount, actualCount); - } - } + private void parseType(ExpectedType type, String line) { + if (type.equals(CardTestBase.ExpectedType.TURN_NUMBER)) { + int turn = getIntParam(line, 1); + Assert.assertEquals("Turn numbers are not equal", turn, currentGame.getTurnNum()); + return; + } + if (type.equals(CardTestBase.ExpectedType.RESULT)) { + String expected = getStringParam(line, 1); + String actual = "draw"; + if (currentGame.getWinner().equals("Player ComputerA is the winner")) { + actual = "won"; + } else if (currentGame.getWinner().equals("Player ComputerB is the winner")) { + actual = "lost"; + } + Assert.assertEquals("Game results are not equal", expected, actual); + return; + } + if (type.equals(CardTestBase.ExpectedType.LIFE)) { + String player = getStringParam(line, 1); + int expected = getIntParam(line, 2); + if (player.equals("ComputerA")) { + int actual = currentGame.getPlayer(playerA.getId()).getLife(); + Assert.assertEquals("Life amounts are not equal", expected, actual); + } else if (player.equals("ComputerB")) { + int actual = currentGame.getPlayer(playerB.getId()).getLife(); + Assert.assertEquals("Life amounts are not equal", expected, actual); + } else { + throw new IllegalArgumentException("Wrong player in 'life' line, player=" + player + ", line=" + line); + } + return; + } + if (type.equals(CardTestBase.ExpectedType.BATTLEFIELD)) { + String playerName = getStringParam(line, 1); + String cardName = getStringParam(line, 2); + int expectedCount = getIntParam(line, 3); + Player player = null; + if (playerName.equals("ComputerA")) { + player = currentGame.getPlayer(playerA.getId()); + } else if (playerName.equals("ComputerB")) { + player = currentGame.getPlayer(playerB.getId()); + } else { + throw new IllegalArgumentException("Wrong player in 'battlefield' line, player=" + player + ", line=" + line); + } + int actualCount = 0; + for (Permanent permanent : currentGame.getBattlefield().getAllPermanents()) { + if (permanent.getControllerId().equals(player.getId())) { + if (permanent.getName().equals(cardName)) { + actualCount++; + } + } + } + Assert.assertEquals("(Battlefield) Card counts are not equal (" + cardName + ")", expectedCount, actualCount); + return; + } + if (type.equals(CardTestBase.ExpectedType.GRAVEYARD)) { + String playerName = getStringParam(line, 1); + String cardName = getStringParam(line, 2); + int expectedCount = getIntParam(line, 3); + Player player = null; + if (playerName.equals("ComputerA")) { + player = currentGame.getPlayer(playerA.getId()); + } else if (playerName.equals("ComputerB")) { + player = currentGame.getPlayer(playerB.getId()); + } else { + throw new IllegalArgumentException("Wrong player in 'graveyard' line, player=" + player + ", line=" + line); + } + int actualCount = 0; + for (Card card : player.getGraveyard().getCards(currentGame)) { + if (card.getName().equals(cardName)) { + actualCount++; + } + } + Assert.assertEquals("(Graveyard) Card counts are not equal (" + cardName + ")", expectedCount, actualCount); + } + } - private int getIntParam(String line, int index) { - String[] params = line.split(":"); - if (index > params.length - 1) { - throw new IllegalArgumentException("Not correct line: " + line); - } - return Integer.parseInt(params[index]); - } + private int getIntParam(String line, int index) { + String[] params = line.split(":"); + if (index > params.length - 1) { + throw new IllegalArgumentException("Not correct line: " + line); + } + return Integer.parseInt(params[index]); + } - private String getStringParam(String line, int index) { - String[] params = line.split(":"); - if (index > params.length - 1) { - throw new IllegalArgumentException("Not correct line: " + line); - } - return params[index]; - } + private String getStringParam(String line, int index) { + String[] params = line.split(":"); + if (index > params.length - 1) { + throw new IllegalArgumentException("Not correct line: " + line); + } + return params[index]; + } - protected void checkPermanentPT(Player player, String cardName, int power, int toughness, Filter.ComparisonScope scope) { - if (currentGame == null) { - throw new IllegalStateException("Current game is null"); - } - if (scope.equals(Filter.ComparisonScope.All)) { - throw new UnsupportedOperationException("ComparisonScope.All is not implemented."); - } - int count = 0; - int fit = 0; - for (Permanent permanent : currentGame.getBattlefield().getAllActivePermanents(player.getId())) { - if (permanent.getName().equals(cardName)) { - Assert.assertEquals("Power is not the same", power, permanent.getPower().getValue()); - Assert.assertEquals("Toughness is not the same", toughness, permanent.getToughness().getValue()); - break; - } - } - } + protected void checkPermanentPT(Player player, String cardName, int power, int toughness, Filter.ComparisonScope scope) { + if (currentGame == null) { + throw new IllegalStateException("Current game is null"); + } + if (scope.equals(Filter.ComparisonScope.All)) { + throw new UnsupportedOperationException("ComparisonScope.All is not implemented."); + } + int count = 0; + int fit = 0; + for (Permanent permanent : currentGame.getBattlefield().getAllActivePermanents(player.getId())) { + if (permanent.getName().equals(cardName)) { + Assert.assertEquals("Power is not the same", power, permanent.getPower().getValue()); + Assert.assertEquals("Toughness is not the same", toughness, permanent.getToughness().getValue()); + break; + } + } + } } diff --git a/Mage.Tests/src/test/java/org/mage/test/serverside/base/CardTestPlayerBase.java b/Mage.Tests/src/test/java/org/mage/test/serverside/base/CardTestPlayerBase.java index 26defd3c9b..504537039a 100644 --- a/Mage.Tests/src/test/java/org/mage/test/serverside/base/CardTestPlayerBase.java +++ b/Mage.Tests/src/test/java/org/mage/test/serverside/base/CardTestPlayerBase.java @@ -27,292 +27,292 @@ import java.io.FileNotFoundException; */ public abstract class CardTestPlayerBase extends CardTestPlayerAPIImpl { - protected enum ExpectedType { - TURN_NUMBER, - RESULT, - LIFE, - BATTLEFIELD, - GRAVEYARD, - UNKNOWN + protected enum ExpectedType { + TURN_NUMBER, + RESULT, + LIFE, + BATTLEFIELD, + GRAVEYARD, + UNKNOWN } protected GameOptions gameOptions; - public CardTestPlayerBase() { - } + public CardTestPlayerBase() { + } protected TestPlayer createNewPlayer(String playerName) { return createPlayer(playerName); } - - @Before - public void reset() throws GameException, FileNotFoundException { - if (currentGame != null) { - logger.debug("Resetting previous game and creating new one!"); - currentGame = null; - System.gc(); - } - Game game = new TwoPlayerDuel(Constants.MultiplayerAttackOption.LEFT, Constants.RangeOfInfluence.ONE); + @Before + public void reset() throws GameException, FileNotFoundException { + if (currentGame != null) { + logger.debug("Resetting previous game and creating new one!"); + currentGame = null; + System.gc(); + } - playerA = createNewPlayer("PlayerA"); - playerA.setTestMode(true); + Game game = new TwoPlayerDuel(Constants.MultiplayerAttackOption.LEFT, Constants.RangeOfInfluence.ONE); + + playerA = createNewPlayer("PlayerA"); + playerA.setTestMode(true); logger.debug("Loading deck..."); - Deck deck = Deck.load(DeckImporterUtil.importDeck("RB Aggro.dck")); + Deck deck = Deck.load(DeckImporterUtil.importDeck("RB Aggro.dck")); logger.debug("Done!"); - if (deck.getCards().size() < 40) { - throw new IllegalArgumentException("Couldn't load deck, deck size=" + deck.getCards().size()); - } - game.addPlayer(playerA, deck); - game.loadCards(deck.getCards(), playerA.getId()); + if (deck.getCards().size() < 40) { + throw new IllegalArgumentException("Couldn't load deck, deck size=" + deck.getCards().size()); + } + game.addPlayer(playerA, deck); + game.loadCards(deck.getCards(), playerA.getId()); - playerB = createNewPlayer("PlayerB"); - playerB.setTestMode(true); - Deck deck2 = Deck.load(DeckImporterUtil.importDeck("RB Aggro.dck")); - if (deck2.getCards().size() < 40) { - throw new IllegalArgumentException("Couldn't load deck, deck size=" + deck2.getCards().size()); - } - game.addPlayer(playerB, deck2); - game.loadCards(deck2.getCards(), playerB.getId()); - activePlayer = playerA; - currentGame = game; + playerB = createNewPlayer("PlayerB"); + playerB.setTestMode(true); + Deck deck2 = Deck.load(DeckImporterUtil.importDeck("RB Aggro.dck")); + if (deck2.getCards().size() < 40) { + throw new IllegalArgumentException("Couldn't load deck, deck size=" + deck2.getCards().size()); + } + game.addPlayer(playerB, deck2); + game.loadCards(deck2.getCards(), playerB.getId()); + activePlayer = playerA; + currentGame = game; stopOnTurn = 2; stopAtStep = PhaseStep.UNTAP; - handCardsA.clear(); - handCardsB.clear(); - battlefieldCardsA.clear(); - battlefieldCardsB.clear(); - graveyardCardsA.clear(); - graveyardCardsB.clear(); - libraryCardsA.clear(); - libraryCardsB.clear(); - commandsA.clear(); - commandsB.clear(); + handCardsA.clear(); + handCardsB.clear(); + battlefieldCardsA.clear(); + battlefieldCardsB.clear(); + graveyardCardsA.clear(); + graveyardCardsB.clear(); + libraryCardsA.clear(); + libraryCardsB.clear(); + commandsA.clear(); + commandsB.clear(); gameOptions = new GameOptions(); - } + } - public void load(String path) throws FileNotFoundException, GameException { - String cardPath = TESTS_PATH + path; - File checkFile = new File(cardPath); - if (!checkFile.exists()) { - throw new FileNotFoundException("Couldn't find test file: " + cardPath); - } - if (checkFile.isDirectory()) { - throw new FileNotFoundException("Couldn't find test file: " + cardPath + ". It is directory."); - } + public void load(String path) throws FileNotFoundException, GameException { + String cardPath = TESTS_PATH + path; + File checkFile = new File(cardPath); + if (!checkFile.exists()) { + throw new FileNotFoundException("Couldn't find test file: " + cardPath); + } + if (checkFile.isDirectory()) { + throw new FileNotFoundException("Couldn't find test file: " + cardPath + ". It is directory."); + } - if (currentGame != null) { - logger.debug("Resetting previous game and creating new one!"); - currentGame = null; - System.gc(); - } + if (currentGame != null) { + logger.debug("Resetting previous game and creating new one!"); + currentGame = null; + System.gc(); + } - Game game = new TwoPlayerDuel(Constants.MultiplayerAttackOption.LEFT, Constants.RangeOfInfluence.ALL); + Game game = new TwoPlayerDuel(Constants.MultiplayerAttackOption.LEFT, Constants.RangeOfInfluence.ALL); - playerA = createNewPlayer("ComputerA"); - playerA.setTestMode(true); + playerA = createNewPlayer("ComputerA"); + playerA.setTestMode(true); - Deck deck = Deck.load(DeckImporterUtil.importDeck("RB Aggro.dck")); + Deck deck = Deck.load(DeckImporterUtil.importDeck("RB Aggro.dck")); - if (deck.getCards().size() < 40) { - throw new IllegalArgumentException("Couldn't load deck, deck size=" + deck.getCards().size()); - } - game.addPlayer(playerA, deck); - game.loadCards(deck.getCards(), playerA.getId()); + if (deck.getCards().size() < 40) { + throw new IllegalArgumentException("Couldn't load deck, deck size=" + deck.getCards().size()); + } + game.addPlayer(playerA, deck); + game.loadCards(deck.getCards(), playerA.getId()); - playerB = createNewPlayer("ComputerB"); - playerB.setTestMode(true); - Deck deck2 = Deck.load(DeckImporterUtil.importDeck("RB Aggro.dck")); - if (deck2.getCards().size() < 40) { - throw new IllegalArgumentException("Couldn't load deck, deck size=" + deck2.getCards().size()); - } - game.addPlayer(playerB, deck2); - game.loadCards(deck2.getCards(), playerB.getId()); + playerB = createNewPlayer("ComputerB"); + playerB.setTestMode(true); + Deck deck2 = Deck.load(DeckImporterUtil.importDeck("RB Aggro.dck")); + if (deck2.getCards().size() < 40) { + throw new IllegalArgumentException("Couldn't load deck, deck size=" + deck2.getCards().size()); + } + game.addPlayer(playerB, deck2); + game.loadCards(deck2.getCards(), playerB.getId()); - parseScenario(cardPath); + parseScenario(cardPath); - activePlayer = playerA; - currentGame = game; - } + activePlayer = playerA; + currentGame = game; + } - /** - * Starts testing card by starting current game. - * - * @throws IllegalStateException In case game wasn't created previously. Use {@link #load} method to initialize the game. - */ - public void execute() throws IllegalStateException { - if (currentGame == null || activePlayer == null) { - throw new IllegalStateException("Game is not initialized. Use load method to load a test case and initialize a game."); - } + /** + * Starts testing card by starting current game. + * + * @throws IllegalStateException In case game wasn't created previously. Use {@link #load} method to initialize the game. + */ + public void execute() throws IllegalStateException { + if (currentGame == null || activePlayer == null) { + throw new IllegalStateException("Game is not initialized. Use load method to load a test case and initialize a game."); + } - currentGame.cheat(playerA.getId(), commandsA); - currentGame.cheat(playerA.getId(), libraryCardsA, handCardsA, battlefieldCardsA, graveyardCardsA); - currentGame.cheat(playerB.getId(), commandsB); - currentGame.cheat(playerB.getId(), libraryCardsB, handCardsB, battlefieldCardsB, graveyardCardsB); + currentGame.cheat(playerA.getId(), commandsA); + currentGame.cheat(playerA.getId(), libraryCardsA, handCardsA, battlefieldCardsA, graveyardCardsA); + currentGame.cheat(playerB.getId(), commandsB); + currentGame.cheat(playerB.getId(), libraryCardsB, handCardsB, battlefieldCardsB, graveyardCardsB); - boolean testMode = true; - long t1 = System.nanoTime(); + boolean testMode = true; + long t1 = System.nanoTime(); - gameOptions.testMode = true; - gameOptions.stopOnTurn = stopOnTurn; + gameOptions.testMode = true; + gameOptions.stopOnTurn = stopOnTurn; gameOptions.stopAtStep = stopAtStep; - currentGame.start(activePlayer.getId(), gameOptions); - long t2 = System.nanoTime(); - logger.debug("Winner: " + currentGame.getWinner()); - logger.info("Test has been executed. Execution time: " + (t2 - t1) / 1000000 + " ms"); + currentGame.start(activePlayer.getId(), gameOptions); + long t2 = System.nanoTime(); + logger.debug("Winner: " + currentGame.getWinner()); + logger.info("Test has been executed. Execution time: " + (t2 - t1) / 1000000 + " ms"); - assertTheResults(); - } + assertTheResults(); + } - /** - * Assert expected and actual results. - */ - private void assertTheResults() { - logger.debug("Matching expected results:"); - for (String line : expectedResults) { - boolean ok = false; - try { - ExpectedType type = getExpectedType(line); - if (type.equals(CardTestPlayerBase.ExpectedType.UNKNOWN)) { - throw new AssertionError("Unknown expected type, check the line in $expected section=" + line); - } - parseType(type, line); - ok = true; - } finally { - logger.info(" " + line + " - " + (ok ? "OK" : "ERROR")); - } - } - } + /** + * Assert expected and actual results. + */ + private void assertTheResults() { + logger.debug("Matching expected results:"); + for (String line : expectedResults) { + boolean ok = false; + try { + ExpectedType type = getExpectedType(line); + if (type.equals(CardTestPlayerBase.ExpectedType.UNKNOWN)) { + throw new AssertionError("Unknown expected type, check the line in $expected section=" + line); + } + parseType(type, line); + ok = true; + } finally { + logger.info(" " + line + " - " + (ok ? "OK" : "ERROR")); + } + } + } - private ExpectedType getExpectedType(String line) { - if (line.startsWith("turn:")) { - return CardTestPlayerBase.ExpectedType.TURN_NUMBER; - } - if (line.startsWith("result:")) { - return CardTestPlayerBase.ExpectedType.RESULT; - } - if (line.startsWith("life:")) { - return CardTestPlayerBase.ExpectedType.LIFE; - } - if (line.startsWith("battlefield:")) { - return CardTestPlayerBase.ExpectedType.BATTLEFIELD; - } - if (line.startsWith("graveyard:")) { - return CardTestPlayerBase.ExpectedType.GRAVEYARD; - } - return CardTestPlayerBase.ExpectedType.UNKNOWN; - } + private ExpectedType getExpectedType(String line) { + if (line.startsWith("turn:")) { + return CardTestPlayerBase.ExpectedType.TURN_NUMBER; + } + if (line.startsWith("result:")) { + return CardTestPlayerBase.ExpectedType.RESULT; + } + if (line.startsWith("life:")) { + return CardTestPlayerBase.ExpectedType.LIFE; + } + if (line.startsWith("battlefield:")) { + return CardTestPlayerBase.ExpectedType.BATTLEFIELD; + } + if (line.startsWith("graveyard:")) { + return CardTestPlayerBase.ExpectedType.GRAVEYARD; + } + return CardTestPlayerBase.ExpectedType.UNKNOWN; + } - private void parseType(ExpectedType type, String line) { - if (type.equals(CardTestPlayerBase.ExpectedType.TURN_NUMBER)) { - int turn = getIntParam(line, 1); - Assert.assertEquals("Turn numbers are not equal", turn, currentGame.getTurnNum()); - return; - } - if (type.equals(CardTestPlayerBase.ExpectedType.RESULT)) { - String expected = getStringParam(line, 1); - String actual = "draw"; - if (currentGame.getWinner().equals("Player ComputerA is the winner")) { - actual = "won"; - } else if (currentGame.getWinner().equals("Player ComputerB is the winner")) { - actual = "lost"; - } - Assert.assertEquals("Game results are not equal", expected, actual); - return; - } - if (type.equals(CardTestPlayerBase.ExpectedType.LIFE)) { - String player = getStringParam(line, 1); - int expected = getIntParam(line, 2); - if (player.equals("ComputerA")) { - int actual = currentGame.getPlayer(playerA.getId()).getLife(); - Assert.assertEquals("Life amounts are not equal", expected, actual); - } else if (player.equals("ComputerB")) { - int actual = currentGame.getPlayer(playerB.getId()).getLife(); - Assert.assertEquals("Life amounts are not equal", expected, actual); - } else { - throw new IllegalArgumentException("Wrong player in 'life' line, player=" + player + ", line=" + line); - } - return; - } - if (type.equals(CardTestPlayerBase.ExpectedType.BATTLEFIELD)) { - String playerName = getStringParam(line, 1); - String cardName = getStringParam(line, 2); - int expectedCount = getIntParam(line, 3); - Player player = null; - if (playerName.equals("ComputerA")) { - player = currentGame.getPlayer(playerA.getId()); - } else if (playerName.equals("ComputerB")) { - player = currentGame.getPlayer(playerB.getId()); - } else { - throw new IllegalArgumentException("Wrong player in 'battlefield' line, player=" + player + ", line=" + line); - } - int actualCount = 0; - for (Permanent permanent : currentGame.getBattlefield().getAllPermanents()) { - if (permanent.getControllerId().equals(player.getId())) { - if (permanent.getName().equals(cardName)) { - actualCount++; - } - } - } - Assert.assertEquals("(Battlefield) Card counts are not equal (" + cardName + ")", expectedCount, actualCount); - return; - } - if (type.equals(CardTestPlayerBase.ExpectedType.GRAVEYARD)) { - String playerName = getStringParam(line, 1); - String cardName = getStringParam(line, 2); - int expectedCount = getIntParam(line, 3); - Player player = null; - if (playerName.equals("ComputerA")) { - player = currentGame.getPlayer(playerA.getId()); - } else if (playerName.equals("ComputerB")) { - player = currentGame.getPlayer(playerB.getId()); - } else { - throw new IllegalArgumentException("Wrong player in 'graveyard' line, player=" + player + ", line=" + line); - } - int actualCount = 0; - for (Card card : player.getGraveyard().getCards(currentGame)) { - if (card.getName().equals(cardName)) { - actualCount++; - } - } - Assert.assertEquals("(Graveyard) Card counts are not equal (" + cardName + ")", expectedCount, actualCount); - } - } + private void parseType(ExpectedType type, String line) { + if (type.equals(CardTestPlayerBase.ExpectedType.TURN_NUMBER)) { + int turn = getIntParam(line, 1); + Assert.assertEquals("Turn numbers are not equal", turn, currentGame.getTurnNum()); + return; + } + if (type.equals(CardTestPlayerBase.ExpectedType.RESULT)) { + String expected = getStringParam(line, 1); + String actual = "draw"; + if (currentGame.getWinner().equals("Player ComputerA is the winner")) { + actual = "won"; + } else if (currentGame.getWinner().equals("Player ComputerB is the winner")) { + actual = "lost"; + } + Assert.assertEquals("Game results are not equal", expected, actual); + return; + } + if (type.equals(CardTestPlayerBase.ExpectedType.LIFE)) { + String player = getStringParam(line, 1); + int expected = getIntParam(line, 2); + if (player.equals("ComputerA")) { + int actual = currentGame.getPlayer(playerA.getId()).getLife(); + Assert.assertEquals("Life amounts are not equal", expected, actual); + } else if (player.equals("ComputerB")) { + int actual = currentGame.getPlayer(playerB.getId()).getLife(); + Assert.assertEquals("Life amounts are not equal", expected, actual); + } else { + throw new IllegalArgumentException("Wrong player in 'life' line, player=" + player + ", line=" + line); + } + return; + } + if (type.equals(CardTestPlayerBase.ExpectedType.BATTLEFIELD)) { + String playerName = getStringParam(line, 1); + String cardName = getStringParam(line, 2); + int expectedCount = getIntParam(line, 3); + Player player = null; + if (playerName.equals("ComputerA")) { + player = currentGame.getPlayer(playerA.getId()); + } else if (playerName.equals("ComputerB")) { + player = currentGame.getPlayer(playerB.getId()); + } else { + throw new IllegalArgumentException("Wrong player in 'battlefield' line, player=" + player + ", line=" + line); + } + int actualCount = 0; + for (Permanent permanent : currentGame.getBattlefield().getAllPermanents()) { + if (permanent.getControllerId().equals(player.getId())) { + if (permanent.getName().equals(cardName)) { + actualCount++; + } + } + } + Assert.assertEquals("(Battlefield) Card counts are not equal (" + cardName + ")", expectedCount, actualCount); + return; + } + if (type.equals(CardTestPlayerBase.ExpectedType.GRAVEYARD)) { + String playerName = getStringParam(line, 1); + String cardName = getStringParam(line, 2); + int expectedCount = getIntParam(line, 3); + Player player = null; + if (playerName.equals("ComputerA")) { + player = currentGame.getPlayer(playerA.getId()); + } else if (playerName.equals("ComputerB")) { + player = currentGame.getPlayer(playerB.getId()); + } else { + throw new IllegalArgumentException("Wrong player in 'graveyard' line, player=" + player + ", line=" + line); + } + int actualCount = 0; + for (Card card : player.getGraveyard().getCards(currentGame)) { + if (card.getName().equals(cardName)) { + actualCount++; + } + } + Assert.assertEquals("(Graveyard) Card counts are not equal (" + cardName + ")", expectedCount, actualCount); + } + } - private int getIntParam(String line, int index) { - String[] params = line.split(":"); - if (index > params.length - 1) { - throw new IllegalArgumentException("Not correct line: " + line); - } - return Integer.parseInt(params[index]); - } + private int getIntParam(String line, int index) { + String[] params = line.split(":"); + if (index > params.length - 1) { + throw new IllegalArgumentException("Not correct line: " + line); + } + return Integer.parseInt(params[index]); + } - private String getStringParam(String line, int index) { - String[] params = line.split(":"); - if (index > params.length - 1) { - throw new IllegalArgumentException("Not correct line: " + line); - } - return params[index]; - } + private String getStringParam(String line, int index) { + String[] params = line.split(":"); + if (index > params.length - 1) { + throw new IllegalArgumentException("Not correct line: " + line); + } + return params[index]; + } - protected void checkPermanentPT(Player player, String cardName, int power, int toughness, Filter.ComparisonScope scope) { - if (currentGame == null) { - throw new IllegalStateException("Current game is null"); - } - if (scope.equals(Filter.ComparisonScope.All)) { - throw new UnsupportedOperationException("ComparisonScope.All is not implemented."); - } + protected void checkPermanentPT(Player player, String cardName, int power, int toughness, Filter.ComparisonScope scope) { + if (currentGame == null) { + throw new IllegalStateException("Current game is null"); + } + if (scope.equals(Filter.ComparisonScope.All)) { + throw new UnsupportedOperationException("ComparisonScope.All is not implemented."); + } - for (Permanent permanent : currentGame.getBattlefield().getAllActivePermanents(player.getId())) { - if (permanent.getName().equals(cardName)) { - Assert.assertEquals("Power is not the same", power, permanent.getPower().getValue()); - Assert.assertEquals("Toughness is not the same", toughness, permanent.getToughness().getValue()); - break; - } - } - } + for (Permanent permanent : currentGame.getBattlefield().getAllActivePermanents(player.getId())) { + if (permanent.getName().equals(cardName)) { + Assert.assertEquals("Power is not the same", power, permanent.getPower().getValue()); + Assert.assertEquals("Toughness is not the same", toughness, permanent.getToughness().getValue()); + break; + } + } + } protected void skipInitShuffling() { gameOptions.skipInitShuffling = true; 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 4ea7b8c7cf..274a0d9d3c 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 @@ -36,270 +36,270 @@ import org.mage.test.player.RandomPlayer; * @author ayratn */ public abstract class MageTestBase { - protected static Logger logger = Logger.getLogger(MageTestBase.class); + protected static Logger logger = Logger.getLogger(MageTestBase.class); - public static PluginClassLoader classLoader = new PluginClassLoader(); + public static PluginClassLoader classLoader = new PluginClassLoader(); - private final static String pluginFolder = "plugins"; + private final static String pluginFolder = "plugins"; - protected Pattern pattern = Pattern.compile("([a-zA-Z]*):([\\w]*):([a-zA-Z ,\\-.!'\\d]*):([\\d]*)(:\\{tapped\\})?"); + protected Pattern pattern = Pattern.compile("([a-zA-Z]*):([\\w]*):([a-zA-Z ,\\-.!'\\d]*):([\\d]*)(:\\{tapped\\})?"); - protected List handCardsA = new ArrayList(); - protected List handCardsB = new ArrayList(); - protected List battlefieldCardsA = new ArrayList(); - protected List battlefieldCardsB = new ArrayList(); - protected List graveyardCardsA = new ArrayList(); - protected List graveyardCardsB = new ArrayList(); - protected List libraryCardsA = new ArrayList(); - protected List libraryCardsB = new ArrayList(); + protected List handCardsA = new ArrayList(); + protected List handCardsB = new ArrayList(); + protected List battlefieldCardsA = new ArrayList(); + protected List battlefieldCardsB = new ArrayList(); + protected List graveyardCardsA = new ArrayList(); + protected List graveyardCardsB = new ArrayList(); + protected List libraryCardsA = new ArrayList(); + protected List libraryCardsB = new ArrayList(); - protected Map commandsA = new HashMap(); - protected Map commandsB = new HashMap(); + protected Map commandsA = new HashMap(); + protected Map commandsB = new HashMap(); - protected Player playerA; - protected Player playerB; + protected Player playerA; + protected Player playerB; - /** - * Game instance initialized in load method. - */ - protected static Game currentGame = null; + /** + * Game instance initialized in load method. + */ + protected static Game currentGame = null; - /** - * Player thats starts the game first. - * By default, it is ComputerA. - */ - protected static Player activePlayer = null; + /** + * Player thats starts the game first. + * By default, it is ComputerA. + */ + protected static Player activePlayer = null; + + protected Integer stopOnTurn; - protected Integer stopOnTurn; - protected PhaseStep stopAtStep = PhaseStep.UNTAP; - protected enum ParserState { - INIT, - OPTIONS, - EXPECTED - } + protected enum ParserState { + INIT, + OPTIONS, + EXPECTED + } - protected ParserState parserState; + protected ParserState parserState; - /** - * Expected results of the test. - * Read from test case in {@link String} based format: - *

- * Example: - * turn:1 - * result:won:ComputerA - * life:ComputerA:20 - * life:ComputerB:0 - * battlefield:ComputerB:Tine Shrike:0 - * graveyard:ComputerB:Tine Shrike:1 - */ - protected List expectedResults = new ArrayList(); + /** + * Expected results of the test. + * Read from test case in {@link String} based format: + *

+ * Example: + * turn:1 + * result:won:ComputerA + * life:ComputerA:20 + * life:ComputerB:0 + * battlefield:ComputerB:Tine Shrike:0 + * graveyard:ComputerB:Tine Shrike:1 + */ + protected List expectedResults = new ArrayList(); - protected static final String TESTS_PATH = "tests" + File.separator; + protected static final String TESTS_PATH = "tests" + File.separator; - @BeforeClass - public static void init() { - Logger.getRootLogger().setLevel(Level.DEBUG); - logger.info("Starting MAGE tests"); - logger.info("Logging level: " + logger.getLevel()); - deleteSavedGames(); - ConfigSettings config = ConfigSettings.getInstance(); - for (GamePlugin plugin : config.getGameTypes()) { - GameFactory.getInstance().addGameType(plugin.getName(), loadGameType(plugin), loadPlugin(plugin)); - } - for (GamePlugin plugin : config.getTournamentTypes()) { - TournamentFactory.getInstance().addTournamentType(plugin.getName(), loadTournamentType(plugin), loadPlugin(plugin)); - } - for (Plugin plugin : config.getPlayerTypes()) { - PlayerFactory.getInstance().addPlayerType(plugin.getName(), loadPlugin(plugin)); - } -// for (Plugin plugin : config.getDeckTypes()) { -// DeckValidatorFactory.getInstance().addDeckType(plugin.getName(), loadPlugin(plugin)); -// } - Copier.setLoader(classLoader); - } + @BeforeClass + public static void init() { + Logger.getRootLogger().setLevel(Level.DEBUG); + logger.info("Starting MAGE tests"); + logger.info("Logging level: " + logger.getLevel()); + deleteSavedGames(); + ConfigSettings config = ConfigSettings.getInstance(); + for (GamePlugin plugin : config.getGameTypes()) { + GameFactory.getInstance().addGameType(plugin.getName(), loadGameType(plugin), loadPlugin(plugin)); + } + for (GamePlugin plugin : config.getTournamentTypes()) { + TournamentFactory.getInstance().addTournamentType(plugin.getName(), loadTournamentType(plugin), loadPlugin(plugin)); + } + for (Plugin plugin : config.getPlayerTypes()) { + PlayerFactory.getInstance().addPlayerType(plugin.getName(), loadPlugin(plugin)); + } +// for (Plugin plugin : config.getDeckTypes()) { +// DeckValidatorFactory.getInstance().addDeckType(plugin.getName(), loadPlugin(plugin)); +// } + Copier.setLoader(classLoader); + } - private static Class loadPlugin(Plugin plugin) { - try { - classLoader.addURL(new File(pluginFolder + "/" + plugin.getJar()).toURI().toURL()); - logger.info("Loading plugin: " + plugin.getClassName()); - return Class.forName(plugin.getClassName(), true, classLoader); - } catch (ClassNotFoundException ex) { - logger.warn("Plugin not Found:" + plugin.getJar() + " - check plugin folder"); - } catch (Exception ex) { - logger.fatal("Error loading plugin " + plugin.getJar(), ex); - } - return null; - } + private static Class loadPlugin(Plugin plugin) { + try { + classLoader.addURL(new File(pluginFolder + "/" + plugin.getJar()).toURI().toURL()); + logger.info("Loading plugin: " + plugin.getClassName()); + return Class.forName(plugin.getClassName(), true, classLoader); + } catch (ClassNotFoundException ex) { + logger.warn("Plugin not Found:" + plugin.getJar() + " - check plugin folder"); + } catch (Exception ex) { + logger.fatal("Error loading plugin " + plugin.getJar(), ex); + } + return null; + } - private static MatchType loadGameType(GamePlugin plugin) { - try { - classLoader.addURL(new File(pluginFolder + "/" + plugin.getJar()).toURI().toURL()); - logger.info("Loading game type: " + plugin.getClassName()); - return (MatchType) Class.forName(plugin.getTypeName(), true, classLoader).newInstance(); - } catch (ClassNotFoundException ex) { - logger.warn("Game type not found:" + plugin.getJar() + " - check plugin folder"); - } catch (Exception ex) { - logger.fatal("Error loading game type " + plugin.getJar(), ex); - } - return null; - } + private static MatchType loadGameType(GamePlugin plugin) { + try { + classLoader.addURL(new File(pluginFolder + "/" + plugin.getJar()).toURI().toURL()); + logger.info("Loading game type: " + plugin.getClassName()); + return (MatchType) Class.forName(plugin.getTypeName(), true, classLoader).newInstance(); + } catch (ClassNotFoundException ex) { + logger.warn("Game type not found:" + plugin.getJar() + " - check plugin folder"); + } catch (Exception ex) { + logger.fatal("Error loading game type " + plugin.getJar(), ex); + } + return null; + } - private static TournamentType loadTournamentType(GamePlugin plugin) { - try { - classLoader.addURL(new File(pluginFolder + "/" + plugin.getJar()).toURI().toURL()); - logger.info("Loading tournament type: " + plugin.getClassName()); - return (TournamentType) Class.forName(plugin.getTypeName(), true, classLoader).newInstance(); - } catch (ClassNotFoundException ex) { - logger.warn("Tournament type not found:" + plugin.getJar() + " - check plugin folder"); - } catch (Exception ex) { - logger.fatal("Error loading game type " + plugin.getJar(), ex); - } - return null; - } + private static TournamentType loadTournamentType(GamePlugin plugin) { + try { + classLoader.addURL(new File(pluginFolder + "/" + plugin.getJar()).toURI().toURL()); + logger.info("Loading tournament type: " + plugin.getClassName()); + return (TournamentType) Class.forName(plugin.getTypeName(), true, classLoader).newInstance(); + } catch (ClassNotFoundException ex) { + logger.warn("Tournament type not found:" + plugin.getJar() + " - check plugin folder"); + } catch (Exception ex) { + logger.fatal("Error loading game type " + plugin.getJar(), ex); + } + return null; + } - private static void deleteSavedGames() { - File directory = new File("saved/"); - if (!directory.exists()) - directory.mkdirs(); - File[] files = directory.listFiles( - new FilenameFilter() { - @Override - public boolean accept(File dir, String name) { - return name.endsWith(".game"); - } - } - ); - for (File file : files) { - file.delete(); - } - } + private static void deleteSavedGames() { + File directory = new File("saved/"); + if (!directory.exists()) + directory.mkdirs(); + File[] files = directory.listFiles( + new FilenameFilter() { + @Override + public boolean accept(File dir, String name) { + return name.endsWith(".game"); + } + } + ); + for (File file : files) { + file.delete(); + } + } - protected void parseScenario(String filename) throws FileNotFoundException { - parserState = ParserState.INIT; - File f = new File(filename); - Scanner scanner = new Scanner(f); - try { - while (scanner.hasNextLine()) { - String line = scanner.nextLine().trim(); - if (line == null || line.isEmpty() || line.startsWith("#")) continue; - if (line.startsWith("$include")) { - includeFrom(line); - continue; - } - if (line.startsWith("$expected")) { - parserState = ParserState.EXPECTED; - continue; - } - parseLine(line); - } - } finally { - scanner.close(); - } - } + protected void parseScenario(String filename) throws FileNotFoundException { + parserState = ParserState.INIT; + File f = new File(filename); + Scanner scanner = new Scanner(f); + try { + while (scanner.hasNextLine()) { + String line = scanner.nextLine().trim(); + if (line == null || line.isEmpty() || line.startsWith("#")) continue; + if (line.startsWith("$include")) { + includeFrom(line); + continue; + } + if (line.startsWith("$expected")) { + parserState = ParserState.EXPECTED; + continue; + } + parseLine(line); + } + } finally { + scanner.close(); + } + } - private void parseLine(String line) { - if (parserState.equals(ParserState.EXPECTED)) { - expectedResults.add(line); // just remember for future use - return; - } + private void parseLine(String line) { + if (parserState.equals(ParserState.EXPECTED)) { + expectedResults.add(line); // just remember for future use + return; + } - Matcher m = pattern.matcher(line); - if (m.matches()) { + Matcher m = pattern.matcher(line); + if (m.matches()) { - String zone = m.group(1); - String nickname = m.group(2); + String zone = m.group(1); + String nickname = m.group(2); - if (nickname.equals("ComputerA") || nickname.equals("ComputerB")) { - List cards = null; - List perms = null; - Constants.Zone gameZone; - if ("hand".equalsIgnoreCase(zone)) { - gameZone = Constants.Zone.HAND; - cards = nickname.equals("ComputerA") ? handCardsA : handCardsB; - } else if ("battlefield".equalsIgnoreCase(zone)) { - gameZone = Constants.Zone.BATTLEFIELD; - perms = nickname.equals("ComputerA") ? battlefieldCardsA : battlefieldCardsB; - } else if ("graveyard".equalsIgnoreCase(zone)) { - gameZone = Constants.Zone.GRAVEYARD; - cards = nickname.equals("ComputerA") ? graveyardCardsA : graveyardCardsB; - } else if ("library".equalsIgnoreCase(zone)) { - gameZone = Constants.Zone.LIBRARY; - cards = nickname.equals("ComputerA") ? libraryCardsA : libraryCardsB; - } else if ("player".equalsIgnoreCase(zone)) { - String command = m.group(3); - if ("life".equals(command)) { - if (nickname.equals("ComputerA")) { - commandsA.put(Constants.Zone.OUTSIDE, "life:" + m.group(4)); - } else { - commandsB.put(Constants.Zone.OUTSIDE, "life:" + m.group(4)); - } - } - return; - } else { - return; // go parse next line - } + if (nickname.equals("ComputerA") || nickname.equals("ComputerB")) { + List cards = null; + List perms = null; + Constants.Zone gameZone; + if ("hand".equalsIgnoreCase(zone)) { + gameZone = Constants.Zone.HAND; + cards = nickname.equals("ComputerA") ? handCardsA : handCardsB; + } else if ("battlefield".equalsIgnoreCase(zone)) { + gameZone = Constants.Zone.BATTLEFIELD; + perms = nickname.equals("ComputerA") ? battlefieldCardsA : battlefieldCardsB; + } else if ("graveyard".equalsIgnoreCase(zone)) { + gameZone = Constants.Zone.GRAVEYARD; + cards = nickname.equals("ComputerA") ? graveyardCardsA : graveyardCardsB; + } else if ("library".equalsIgnoreCase(zone)) { + gameZone = Constants.Zone.LIBRARY; + cards = nickname.equals("ComputerA") ? libraryCardsA : libraryCardsB; + } else if ("player".equalsIgnoreCase(zone)) { + String command = m.group(3); + if ("life".equals(command)) { + if (nickname.equals("ComputerA")) { + commandsA.put(Constants.Zone.OUTSIDE, "life:" + m.group(4)); + } else { + commandsB.put(Constants.Zone.OUTSIDE, "life:" + m.group(4)); + } + } + return; + } else { + return; // go parse next line + } - String cardName = m.group(3); - Integer amount = Integer.parseInt(m.group(4)); - boolean tapped = m.group(5) != null && m.group(5).equals(":{tapped}"); + String cardName = m.group(3); + Integer amount = Integer.parseInt(m.group(4)); + boolean tapped = m.group(5) != null && m.group(5).equals(":{tapped}"); - if (cardName.equals("clear")) { - if (nickname.equals("ComputerA")) { - commandsA.put(gameZone, "clear"); - } else { - commandsB.put(gameZone, "clear"); - } - } else { - for (int i = 0; i < amount; i++) { - Card card = Sets.findCard(cardName, true); - if (card != null) { - if (gameZone.equals(Constants.Zone.BATTLEFIELD)) { - PermanentCard p = new PermanentCard(card, null); - p.setTapped(tapped); - perms.add(p); - } else { - cards.add(card); - } - } else { - logger.fatal("Couldn't find a card: " + cardName); - logger.fatal("line: " + line); - } - } - } - } else { - logger.warn("Unknown player: " + nickname); - } - } else { - logger.warn("Init string wasn't parsed: " + line); - } - } + if (cardName.equals("clear")) { + if (nickname.equals("ComputerA")) { + commandsA.put(gameZone, "clear"); + } else { + commandsB.put(gameZone, "clear"); + } + } else { + for (int i = 0; i < amount; i++) { + Card card = Sets.findCard(cardName, true); + if (card != null) { + if (gameZone.equals(Constants.Zone.BATTLEFIELD)) { + PermanentCard p = new PermanentCard(card, null); + p.setTapped(tapped); + perms.add(p); + } else { + cards.add(card); + } + } else { + logger.fatal("Couldn't find a card: " + cardName); + logger.fatal("line: " + line); + } + } + } + } else { + logger.warn("Unknown player: " + nickname); + } + } else { + logger.warn("Init string wasn't parsed: " + line); + } + } - private void includeFrom(String line) throws FileNotFoundException { - String[] params = line.split(" "); - if (params.length == 2) { - String paramName = params[1]; - if (!paramName.contains("..")) { - String includePath = TESTS_PATH + paramName; - File f = new File(includePath); - if (f.exists()) { - parseScenario(includePath); - } else { - logger.warn("Ignored (file doesn't exist): " + line); - } - } else { - logger.warn("Ignored (wrong charactres): " + line); - } - } else { - logger.warn("Ignored (wrong size): " + line); - } - } + private void includeFrom(String line) throws FileNotFoundException { + String[] params = line.split(" "); + if (params.length == 2) { + String paramName = params[1]; + if (!paramName.contains("..")) { + String includePath = TESTS_PATH + paramName; + File f = new File(includePath); + if (f.exists()) { + parseScenario(includePath); + } else { + logger.warn("Ignored (file doesn't exist): " + line); + } + } else { + logger.warn("Ignored (wrong charactres): " + line); + } + } else { + logger.warn("Ignored (wrong size): " + line); + } + } + + protected Player createPlayer(String name, String playerType) { + return PlayerFactory.getInstance().createPlayer(playerType, name, Constants.RangeOfInfluence.ALL, 5); + } - protected Player createPlayer(String name, String playerType) { - return PlayerFactory.getInstance().createPlayer(playerType, name, Constants.RangeOfInfluence.ALL, 5); - } - protected Player createRandomPlayer(String name) { return new RandomPlayer(name); } 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 a22f48abdf..c561393e89 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 @@ -33,267 +33,267 @@ import java.util.regex.Pattern; * @author ayratn */ public abstract class MageTestPlayerBase { - protected static Logger logger = Logger.getLogger(MageTestPlayerBase.class); + protected static Logger logger = Logger.getLogger(MageTestPlayerBase.class); - public static PluginClassLoader classLoader = new PluginClassLoader(); + public static PluginClassLoader classLoader = new PluginClassLoader(); - private final static String pluginFolder = "plugins"; + private final static String pluginFolder = "plugins"; - protected Pattern pattern = Pattern.compile("([a-zA-Z]*):([\\w]*):([a-zA-Z ,\\-.!'\\d]*):([\\d]*)(:\\{tapped\\})?"); + protected Pattern pattern = Pattern.compile("([a-zA-Z]*):([\\w]*):([a-zA-Z ,\\-.!'\\d]*):([\\d]*)(:\\{tapped\\})?"); - protected List handCardsA = new ArrayList(); - protected List handCardsB = new ArrayList(); - protected List battlefieldCardsA = new ArrayList(); - protected List battlefieldCardsB = new ArrayList(); - protected List graveyardCardsA = new ArrayList(); - protected List graveyardCardsB = new ArrayList(); - protected List libraryCardsA = new ArrayList(); - protected List libraryCardsB = new ArrayList(); + protected List handCardsA = new ArrayList(); + protected List handCardsB = new ArrayList(); + protected List battlefieldCardsA = new ArrayList(); + protected List battlefieldCardsB = new ArrayList(); + protected List graveyardCardsA = new ArrayList(); + protected List graveyardCardsB = new ArrayList(); + protected List libraryCardsA = new ArrayList(); + protected List libraryCardsB = new ArrayList(); - protected Map commandsA = new HashMap(); - protected Map commandsB = new HashMap(); + protected Map commandsA = new HashMap(); + protected Map commandsB = new HashMap(); - protected TestPlayer playerA; - protected TestPlayer playerB; + protected TestPlayer playerA; + protected TestPlayer playerB; - /** - * Game instance initialized in load method. - */ - protected static Game currentGame = null; + /** + * Game instance initialized in load method. + */ + protected static Game currentGame = null; - /** - * Player thats starts the game first. - * By default, it is ComputerA. - */ - protected static Player activePlayer = null; + /** + * Player thats starts the game first. + * By default, it is ComputerA. + */ + protected static Player activePlayer = null; + + protected Integer stopOnTurn; - protected Integer stopOnTurn; - protected PhaseStep stopAtStep = PhaseStep.UNTAP; - protected enum ParserState { - INIT, - OPTIONS, - EXPECTED - } + protected enum ParserState { + INIT, + OPTIONS, + EXPECTED + } - protected ParserState parserState; + protected ParserState parserState; - /** - * Expected results of the test. - * Read from test case in {@link String} based format: - *

- * Example: - * turn:1 - * result:won:ComputerA - * life:ComputerA:20 - * life:ComputerB:0 - * battlefield:ComputerB:Tine Shrike:0 - * graveyard:ComputerB:Tine Shrike:1 - */ - protected List expectedResults = new ArrayList(); + /** + * Expected results of the test. + * Read from test case in {@link String} based format: + *

+ * Example: + * turn:1 + * result:won:ComputerA + * life:ComputerA:20 + * life:ComputerB:0 + * battlefield:ComputerB:Tine Shrike:0 + * graveyard:ComputerB:Tine Shrike:1 + */ + protected List expectedResults = new ArrayList(); - protected static final String TESTS_PATH = "tests" + File.separator; + protected static final String TESTS_PATH = "tests" + File.separator; - @BeforeClass - public static void init() { - Logger.getRootLogger().setLevel(Level.DEBUG); - logger.debug("Starting MAGE tests"); - logger.debug("Logging level: " + logger.getLevel()); - deleteSavedGames(); - ConfigSettings config = ConfigSettings.getInstance(); - for (GamePlugin plugin : config.getGameTypes()) { - GameFactory.getInstance().addGameType(plugin.getName(), loadGameType(plugin), loadPlugin(plugin)); - } -// for (GamePlugin plugin : config.getTournamentTypes()) { -// TournamentFactory.getInstance().addTournamentType(plugin.getName(), loadTournamentType(plugin), loadPlugin(plugin)); -// } -// for (Plugin plugin : config.getPlayerTypes()) { -// PlayerFactory.getInstance().addPlayerType(plugin.getName(), loadPlugin(plugin)); -// } -// for (Plugin plugin : config.getDeckTypes()) { -// DeckValidatorFactory.getInstance().addDeckType(plugin.getName(), loadPlugin(plugin)); -// } - Copier.setLoader(classLoader); - } + @BeforeClass + public static void init() { + Logger.getRootLogger().setLevel(Level.DEBUG); + logger.debug("Starting MAGE tests"); + logger.debug("Logging level: " + logger.getLevel()); + deleteSavedGames(); + ConfigSettings config = ConfigSettings.getInstance(); + for (GamePlugin plugin : config.getGameTypes()) { + GameFactory.getInstance().addGameType(plugin.getName(), loadGameType(plugin), loadPlugin(plugin)); + } +// for (GamePlugin plugin : config.getTournamentTypes()) { +// TournamentFactory.getInstance().addTournamentType(plugin.getName(), loadTournamentType(plugin), loadPlugin(plugin)); +// } +// for (Plugin plugin : config.getPlayerTypes()) { +// PlayerFactory.getInstance().addPlayerType(plugin.getName(), loadPlugin(plugin)); +// } +// for (Plugin plugin : config.getDeckTypes()) { +// DeckValidatorFactory.getInstance().addDeckType(plugin.getName(), loadPlugin(plugin)); +// } + Copier.setLoader(classLoader); + } - private static Class loadPlugin(Plugin plugin) { - try { - classLoader.addURL(new File(pluginFolder + "/" + plugin.getJar()).toURI().toURL()); - logger.info("Loading plugin: " + plugin.getClassName()); - return Class.forName(plugin.getClassName(), true, classLoader); - } catch (ClassNotFoundException ex) { - logger.warn("Plugin not Found:" + plugin.getJar() + " - check plugin folder"); - } catch (Exception ex) { - logger.fatal("Error loading plugin " + plugin.getJar(), ex); - } - return null; - } + private static Class loadPlugin(Plugin plugin) { + try { + classLoader.addURL(new File(pluginFolder + "/" + plugin.getJar()).toURI().toURL()); + logger.info("Loading plugin: " + plugin.getClassName()); + return Class.forName(plugin.getClassName(), true, classLoader); + } catch (ClassNotFoundException ex) { + logger.warn("Plugin not Found:" + plugin.getJar() + " - check plugin folder"); + } catch (Exception ex) { + logger.fatal("Error loading plugin " + plugin.getJar(), ex); + } + return null; + } - private static MatchType loadGameType(GamePlugin plugin) { - try { - classLoader.addURL(new File(pluginFolder + "/" + plugin.getJar()).toURI().toURL()); - logger.info("Loading game type: " + plugin.getClassName()); - return (MatchType) Class.forName(plugin.getTypeName(), true, classLoader).newInstance(); - } catch (ClassNotFoundException ex) { - logger.warn("Game type not found:" + plugin.getJar() + " - check plugin folder"); - } catch (Exception ex) { - logger.fatal("Error loading game type " + plugin.getJar(), ex); - } - return null; - } + private static MatchType loadGameType(GamePlugin plugin) { + try { + classLoader.addURL(new File(pluginFolder + "/" + plugin.getJar()).toURI().toURL()); + logger.info("Loading game type: " + plugin.getClassName()); + return (MatchType) Class.forName(plugin.getTypeName(), true, classLoader).newInstance(); + } catch (ClassNotFoundException ex) { + logger.warn("Game type not found:" + plugin.getJar() + " - check plugin folder"); + } catch (Exception ex) { + logger.fatal("Error loading game type " + plugin.getJar(), ex); + } + return null; + } - private static TournamentType loadTournamentType(GamePlugin plugin) { - try { - classLoader.addURL(new File(pluginFolder + "/" + plugin.getJar()).toURI().toURL()); - logger.info("Loading tournament type: " + plugin.getClassName()); - return (TournamentType) Class.forName(plugin.getTypeName(), true, classLoader).newInstance(); - } catch (ClassNotFoundException ex) { - logger.warn("Tournament type not found:" + plugin.getJar() + " - check plugin folder"); - } catch (Exception ex) { - logger.fatal("Error loading game type " + plugin.getJar(), ex); - } - return null; - } + private static TournamentType loadTournamentType(GamePlugin plugin) { + try { + classLoader.addURL(new File(pluginFolder + "/" + plugin.getJar()).toURI().toURL()); + logger.info("Loading tournament type: " + plugin.getClassName()); + return (TournamentType) Class.forName(plugin.getTypeName(), true, classLoader).newInstance(); + } catch (ClassNotFoundException ex) { + logger.warn("Tournament type not found:" + plugin.getJar() + " - check plugin folder"); + } catch (Exception ex) { + logger.fatal("Error loading game type " + plugin.getJar(), ex); + } + return null; + } - private static void deleteSavedGames() { - File directory = new File("saved/"); - if (!directory.exists()) - directory.mkdirs(); - File[] files = directory.listFiles( - new FilenameFilter() { - @Override - public boolean accept(File dir, String name) { - return name.endsWith(".game"); - } - } - ); - for (File file : files) { - file.delete(); - } - } + private static void deleteSavedGames() { + File directory = new File("saved/"); + if (!directory.exists()) + directory.mkdirs(); + File[] files = directory.listFiles( + new FilenameFilter() { + @Override + public boolean accept(File dir, String name) { + return name.endsWith(".game"); + } + } + ); + for (File file : files) { + file.delete(); + } + } - protected void parseScenario(String filename) throws FileNotFoundException { - parserState = ParserState.INIT; - File f = new File(filename); - Scanner scanner = new Scanner(f); - try { - while (scanner.hasNextLine()) { - String line = scanner.nextLine().trim(); - if (line == null || line.isEmpty() || line.startsWith("#")) continue; - if (line.startsWith("$include")) { - includeFrom(line); - continue; - } - if (line.startsWith("$expected")) { - parserState = ParserState.EXPECTED; - continue; - } - parseLine(line); - } - } finally { - scanner.close(); - } - } + protected void parseScenario(String filename) throws FileNotFoundException { + parserState = ParserState.INIT; + File f = new File(filename); + Scanner scanner = new Scanner(f); + try { + while (scanner.hasNextLine()) { + String line = scanner.nextLine().trim(); + if (line == null || line.isEmpty() || line.startsWith("#")) continue; + if (line.startsWith("$include")) { + includeFrom(line); + continue; + } + if (line.startsWith("$expected")) { + parserState = ParserState.EXPECTED; + continue; + } + parseLine(line); + } + } finally { + scanner.close(); + } + } - private void parseLine(String line) { - if (parserState.equals(ParserState.EXPECTED)) { - expectedResults.add(line); // just remember for future use - return; - } + private void parseLine(String line) { + if (parserState.equals(ParserState.EXPECTED)) { + expectedResults.add(line); // just remember for future use + return; + } - Matcher m = pattern.matcher(line); - if (m.matches()) { + Matcher m = pattern.matcher(line); + if (m.matches()) { - String zone = m.group(1); - String nickname = m.group(2); + String zone = m.group(1); + String nickname = m.group(2); - if (nickname.equals("ComputerA") || nickname.equals("ComputerB")) { - List cards = null; - List perms = null; - Constants.Zone gameZone; - if ("hand".equalsIgnoreCase(zone)) { - gameZone = Constants.Zone.HAND; - cards = nickname.equals("ComputerA") ? handCardsA : handCardsB; - } else if ("battlefield".equalsIgnoreCase(zone)) { - gameZone = Constants.Zone.BATTLEFIELD; - perms = nickname.equals("ComputerA") ? battlefieldCardsA : battlefieldCardsB; - } else if ("graveyard".equalsIgnoreCase(zone)) { - gameZone = Constants.Zone.GRAVEYARD; - cards = nickname.equals("ComputerA") ? graveyardCardsA : graveyardCardsB; - } else if ("library".equalsIgnoreCase(zone)) { - gameZone = Constants.Zone.LIBRARY; - cards = nickname.equals("ComputerA") ? libraryCardsA : libraryCardsB; - } else if ("player".equalsIgnoreCase(zone)) { - String command = m.group(3); - if ("life".equals(command)) { - if (nickname.equals("ComputerA")) { - commandsA.put(Constants.Zone.OUTSIDE, "life:" + m.group(4)); - } else { - commandsB.put(Constants.Zone.OUTSIDE, "life:" + m.group(4)); - } - } - return; - } else { - return; // go parse next line - } + if (nickname.equals("ComputerA") || nickname.equals("ComputerB")) { + List cards = null; + List perms = null; + Constants.Zone gameZone; + if ("hand".equalsIgnoreCase(zone)) { + gameZone = Constants.Zone.HAND; + cards = nickname.equals("ComputerA") ? handCardsA : handCardsB; + } else if ("battlefield".equalsIgnoreCase(zone)) { + gameZone = Constants.Zone.BATTLEFIELD; + perms = nickname.equals("ComputerA") ? battlefieldCardsA : battlefieldCardsB; + } else if ("graveyard".equalsIgnoreCase(zone)) { + gameZone = Constants.Zone.GRAVEYARD; + cards = nickname.equals("ComputerA") ? graveyardCardsA : graveyardCardsB; + } else if ("library".equalsIgnoreCase(zone)) { + gameZone = Constants.Zone.LIBRARY; + cards = nickname.equals("ComputerA") ? libraryCardsA : libraryCardsB; + } else if ("player".equalsIgnoreCase(zone)) { + String command = m.group(3); + if ("life".equals(command)) { + if (nickname.equals("ComputerA")) { + commandsA.put(Constants.Zone.OUTSIDE, "life:" + m.group(4)); + } else { + commandsB.put(Constants.Zone.OUTSIDE, "life:" + m.group(4)); + } + } + return; + } else { + return; // go parse next line + } - String cardName = m.group(3); - Integer amount = Integer.parseInt(m.group(4)); - boolean tapped = m.group(5) != null && m.group(5).equals(":{tapped}"); + String cardName = m.group(3); + Integer amount = Integer.parseInt(m.group(4)); + boolean tapped = m.group(5) != null && m.group(5).equals(":{tapped}"); - if (cardName.equals("clear")) { - if (nickname.equals("ComputerA")) { - commandsA.put(gameZone, "clear"); - } else { - commandsB.put(gameZone, "clear"); - } - } else { - for (int i = 0; i < amount; i++) { - Card card = Sets.findCard(cardName, true); - if (card != null) { - if (gameZone.equals(Constants.Zone.BATTLEFIELD)) { - PermanentCard p = new PermanentCard(card, null); - p.setTapped(tapped); - perms.add(p); - } else { - cards.add(card); - } - } else { - logger.fatal("Couldn't find a card: " + cardName); - logger.fatal("line: " + line); - } - } - } - } else { - logger.warn("Unknown player: " + nickname); - } - } else { - logger.warn("Init string wasn't parsed: " + line); - } - } + if (cardName.equals("clear")) { + if (nickname.equals("ComputerA")) { + commandsA.put(gameZone, "clear"); + } else { + commandsB.put(gameZone, "clear"); + } + } else { + for (int i = 0; i < amount; i++) { + Card card = Sets.findCard(cardName, true); + if (card != null) { + if (gameZone.equals(Constants.Zone.BATTLEFIELD)) { + PermanentCard p = new PermanentCard(card, null); + p.setTapped(tapped); + perms.add(p); + } else { + cards.add(card); + } + } else { + logger.fatal("Couldn't find a card: " + cardName); + logger.fatal("line: " + line); + } + } + } + } else { + logger.warn("Unknown player: " + nickname); + } + } else { + logger.warn("Init string wasn't parsed: " + line); + } + } - private void includeFrom(String line) throws FileNotFoundException { - String[] params = line.split(" "); - if (params.length == 2) { - String paramName = params[1]; - if (!paramName.contains("..")) { - String includePath = TESTS_PATH + paramName; - File f = new File(includePath); - if (f.exists()) { - parseScenario(includePath); - } else { - logger.warn("Ignored (file doesn't exist): " + line); - } - } else { - logger.warn("Ignored (wrong charactres): " + line); - } - } else { - logger.warn("Ignored (wrong size): " + line); - } - } + private void includeFrom(String line) throws FileNotFoundException { + String[] params = line.split(" "); + if (params.length == 2) { + String paramName = params[1]; + if (!paramName.contains("..")) { + String includePath = TESTS_PATH + paramName; + File f = new File(includePath); + if (f.exists()) { + parseScenario(includePath); + } else { + logger.warn("Ignored (file doesn't exist): " + line); + } + } else { + logger.warn("Ignored (wrong charactres): " + line); + } + } else { + logger.warn("Ignored (wrong size): " + line); + } + } - protected TestPlayer createPlayer(String name) { - return new TestPlayer(name, Constants.RangeOfInfluence.ALL); - } + protected TestPlayer createPlayer(String name) { + return new TestPlayer(name, Constants.RangeOfInfluence.ALL); + } } diff --git a/Mage.Tests/src/test/java/org/mage/test/serverside/base/impl/CardTestAPIImpl.java b/Mage.Tests/src/test/java/org/mage/test/serverside/base/impl/CardTestAPIImpl.java index 74237e4f92..1453644012 100644 --- a/Mage.Tests/src/test/java/org/mage/test/serverside/base/impl/CardTestAPIImpl.java +++ b/Mage.Tests/src/test/java/org/mage/test/serverside/base/impl/CardTestAPIImpl.java @@ -23,273 +23,273 @@ import mage.Constants.PhaseStep; */ public abstract class CardTestAPIImpl extends MageTestBase implements CardTestAPI { - /** - * Default game initialization params for red player (that plays with Mountains) - */ - public void useRedDefault() { - // *** ComputerA *** - // battlefield:ComputerA:Mountain:5 - addCard(Constants.Zone.BATTLEFIELD, playerA, "Mountain", 5); - // hand:ComputerA:Mountain:4 - addCard(Constants.Zone.HAND, playerA, "Mountain", 5); - // library:ComputerA:clear:0 - removeAllCardsFromLibrary(playerA); - // library:ComputerA:Mountain:10 - addCard(Constants.Zone.LIBRARY, playerA, "Mountain", 10); + /** + * Default game initialization params for red player (that plays with Mountains) + */ + public void useRedDefault() { + // *** ComputerA *** + // battlefield:ComputerA:Mountain:5 + addCard(Constants.Zone.BATTLEFIELD, playerA, "Mountain", 5); + // hand:ComputerA:Mountain:4 + addCard(Constants.Zone.HAND, playerA, "Mountain", 5); + // library:ComputerA:clear:0 + removeAllCardsFromLibrary(playerA); + // library:ComputerA:Mountain:10 + addCard(Constants.Zone.LIBRARY, playerA, "Mountain", 10); - // *** ComputerB *** - // battlefield:ComputerB:Plains:2 - addCard(Constants.Zone.BATTLEFIELD, playerB, "Plains", 2); - // hand:ComputerB:Plains:2 - addCard(Constants.Zone.HAND, playerB, "Plains", 2); - // library:ComputerB:clear:0 - removeAllCardsFromLibrary(playerB); - // library:ComputerB:Plains:10 - addCard(Constants.Zone.LIBRARY, playerB, "Plains", 10); - } - - /** - * Default game initialization params for white player (that plays with Plains) - */ - public void useWhiteDefault() { - // *** ComputerA *** - addCard(Constants.Zone.BATTLEFIELD, playerA, "Plains", 5); - addCard(Constants.Zone.HAND, playerA, "Plains", 5); - removeAllCardsFromLibrary(playerA); - addCard(Constants.Zone.LIBRARY, playerA, "Plains", 10); + // *** ComputerB *** + // battlefield:ComputerB:Plains:2 + addCard(Constants.Zone.BATTLEFIELD, playerB, "Plains", 2); + // hand:ComputerB:Plains:2 + addCard(Constants.Zone.HAND, playerB, "Plains", 2); + // library:ComputerB:clear:0 + removeAllCardsFromLibrary(playerB); + // library:ComputerB:Plains:10 + addCard(Constants.Zone.LIBRARY, playerB, "Plains", 10); + } - // *** ComputerB *** - addCard(Constants.Zone.BATTLEFIELD, playerB, "Plains", 2); - addCard(Constants.Zone.HAND, playerB, "Plains", 2); - removeAllCardsFromLibrary(playerB); - addCard(Constants.Zone.LIBRARY, playerB, "Plains", 10); - } + /** + * Default game initialization params for white player (that plays with Plains) + */ + public void useWhiteDefault() { + // *** ComputerA *** + addCard(Constants.Zone.BATTLEFIELD, playerA, "Plains", 5); + addCard(Constants.Zone.HAND, playerA, "Plains", 5); + removeAllCardsFromLibrary(playerA); + addCard(Constants.Zone.LIBRARY, playerA, "Plains", 10); - /** - * Removes all cards from player's library from the game. - * Usually this should be used once before initialization to form the library in certain order. - * - * @param player {@link Player} to remove all library cards from. - */ - public void removeAllCardsFromLibrary(Player player) { - if (player.equals(playerA)) { - commandsA.put(Constants.Zone.LIBRARY, "clear"); - } else if (player.equals(playerB)) { - commandsB.put(Constants.Zone.LIBRARY, "clear"); - } - } + // *** ComputerB *** + addCard(Constants.Zone.BATTLEFIELD, playerB, "Plains", 2); + addCard(Constants.Zone.HAND, playerB, "Plains", 2); + removeAllCardsFromLibrary(playerB); + addCard(Constants.Zone.LIBRARY, playerB, "Plains", 10); + } - /** - * Add a card to specified zone of specified player. - * - * @param gameZone {@link Constants.Zone} to add cards to. - * @param player {@link Player} to add cards for. Use either playerA or playerB. - * @param cardName Card name in string format. - */ - public void addCard(Constants.Zone gameZone, Player player, String cardName) { - addCard(gameZone, player, cardName, 1, false); - } + /** + * Removes all cards from player's library from the game. + * Usually this should be used once before initialization to form the library in certain order. + * + * @param player {@link Player} to remove all library cards from. + */ + public void removeAllCardsFromLibrary(Player player) { + if (player.equals(playerA)) { + commandsA.put(Constants.Zone.LIBRARY, "clear"); + } else if (player.equals(playerB)) { + commandsB.put(Constants.Zone.LIBRARY, "clear"); + } + } - /** - * Add any amount of cards to specified zone of specified player. - * - * @param gameZone {@link Constants.Zone} to add cards to. - * @param player {@link Player} to add cards for. Use either playerA or playerB. - * @param cardName Card name in string format. - * @param count Amount of cards to be added. - */ - public void addCard(Constants.Zone gameZone, Player player, String cardName, int count) { - addCard(gameZone, player, cardName, count, false); - } + /** + * Add a card to specified zone of specified player. + * + * @param gameZone {@link Constants.Zone} to add cards to. + * @param player {@link Player} to add cards for. Use either playerA or playerB. + * @param cardName Card name in string format. + */ + public void addCard(Constants.Zone gameZone, Player player, String cardName) { + addCard(gameZone, player, cardName, 1, false); + } - /** - * Add any amount of cards to specified zone of specified player. - * - * @param gameZone {@link Constants.Zone} to add cards to. - * @param player {@link Player} to add cards for. Use either playerA or playerB. - * @param cardName Card name in string format. - * @param count Amount of cards to be added. - * @param tapped In case gameZone is Battlefield, determines whether permanent should be tapped. - * In case gameZone is other than Battlefield, {@link IllegalArgumentException} is thrown - */ - public void addCard(Constants.Zone gameZone, Player player, String cardName, int count, boolean tapped) { + /** + * Add any amount of cards to specified zone of specified player. + * + * @param gameZone {@link Constants.Zone} to add cards to. + * @param player {@link Player} to add cards for. Use either playerA or playerB. + * @param cardName Card name in string format. + * @param count Amount of cards to be added. + */ + public void addCard(Constants.Zone gameZone, Player player, String cardName, int count) { + addCard(gameZone, player, cardName, count, false); + } + + /** + * Add any amount of cards to specified zone of specified player. + * + * @param gameZone {@link Constants.Zone} to add cards to. + * @param player {@link Player} to add cards for. Use either playerA or playerB. + * @param cardName Card name in string format. + * @param count Amount of cards to be added. + * @param tapped In case gameZone is Battlefield, determines whether permanent should be tapped. + * In case gameZone is other than Battlefield, {@link IllegalArgumentException} is thrown + */ + public void addCard(Constants.Zone gameZone, Player player, String cardName, int count, boolean tapped) { - if (gameZone.equals(Constants.Zone.BATTLEFIELD)) { - for (int i = 0; i < count; i++) { - Card card = Sets.findCard(cardName, true); + if (gameZone.equals(Constants.Zone.BATTLEFIELD)) { + for (int i = 0; i < count; i++) { + Card card = Sets.findCard(cardName, true); if (card == null) { throw new IllegalArgumentException("[TEST] Couldn't find a card: " + cardName); } - PermanentCard p = new PermanentCard(card, null); - p.setTapped(tapped); - if (player.equals(playerA)) { - battlefieldCardsA.add(p); - } else if (player.equals(playerB)) { - battlefieldCardsB.add(p); - } - } - } else { - if (tapped) { - throw new IllegalArgumentException("Parameter tapped=true can be used only for Zone.BATTLEFIELD."); - } - List cards = getCardList(gameZone, player); - for (int i = 0; i < count; i++) { - Card card = Sets.findCard(cardName, true); - cards.add(card); - } - } - } - - /** - * Returns card list containter for specified game zone and player. - * - * @param gameZone - * @param player - * @return - */ - private List getCardList(Constants.Zone gameZone, Player player) { - if (player.equals(playerA)) { - if (gameZone.equals(Constants.Zone.HAND)) { - return handCardsA; - } else if (gameZone.equals(Constants.Zone.GRAVEYARD)) { - return graveyardCardsA; - } else if (gameZone.equals(Constants.Zone.LIBRARY)) { - return libraryCardsA; - } - } else if (player.equals(playerB)) { - if (gameZone.equals(Constants.Zone.HAND)) { - return handCardsB; - } else if (gameZone.equals(Constants.Zone.GRAVEYARD)) { - return graveyardCardsB; - } else if (gameZone.equals(Constants.Zone.LIBRARY)) { - return libraryCardsB; - } - } - return null; - } - - /** - * Set player's initial life count. - * - * @param player {@link Player} to set life count for. - * @param life Life count to set. - */ - public void setLife(Player player, int life) { - if (player.equals(playerA)) { - commandsA.put(Constants.Zone.OUTSIDE, "life:" + String.valueOf(life)); - } else if (player.equals(playerB)) { - commandsB.put(Constants.Zone.OUTSIDE, "life:" + String.valueOf(life)); - } - } - - /** - * Define turn number to stop the game on. - */ - public void setStopOnTurn(int turn) { - stopOnTurn = turn == -1 ? null : Integer.valueOf(turn); - stopAtStep = PhaseStep.UNTAP; - } + PermanentCard p = new PermanentCard(card, null); + p.setTapped(tapped); + if (player.equals(playerA)) { + battlefieldCardsA.add(p); + } else if (player.equals(playerB)) { + battlefieldCardsB.add(p); + } + } + } else { + if (tapped) { + throw new IllegalArgumentException("Parameter tapped=true can be used only for Zone.BATTLEFIELD."); + } + List cards = getCardList(gameZone, player); + for (int i = 0; i < count; i++) { + Card card = Sets.findCard(cardName, true); + cards.add(card); + } + } + } /** - * Define turn number and step to stop the game on. - */ - public void setStopAt(int turn, PhaseStep step) { - stopOnTurn = turn == -1 ? null : Integer.valueOf(turn); + * Returns card list containter for specified game zone and player. + * + * @param gameZone + * @param player + * @return + */ + private List getCardList(Constants.Zone gameZone, Player player) { + if (player.equals(playerA)) { + if (gameZone.equals(Constants.Zone.HAND)) { + return handCardsA; + } else if (gameZone.equals(Constants.Zone.GRAVEYARD)) { + return graveyardCardsA; + } else if (gameZone.equals(Constants.Zone.LIBRARY)) { + return libraryCardsA; + } + } else if (player.equals(playerB)) { + if (gameZone.equals(Constants.Zone.HAND)) { + return handCardsB; + } else if (gameZone.equals(Constants.Zone.GRAVEYARD)) { + return graveyardCardsB; + } else if (gameZone.equals(Constants.Zone.LIBRARY)) { + return libraryCardsB; + } + } + return null; + } + + /** + * Set player's initial life count. + * + * @param player {@link Player} to set life count for. + * @param life Life count to set. + */ + public void setLife(Player player, int life) { + if (player.equals(playerA)) { + commandsA.put(Constants.Zone.OUTSIDE, "life:" + String.valueOf(life)); + } else if (player.equals(playerB)) { + commandsB.put(Constants.Zone.OUTSIDE, "life:" + String.valueOf(life)); + } + } + + /** + * Define turn number to stop the game on. + */ + public void setStopOnTurn(int turn) { + stopOnTurn = turn == -1 ? null : Integer.valueOf(turn); + stopAtStep = PhaseStep.UNTAP; + } + + /** + * Define turn number and step to stop the game on. + */ + public void setStopAt(int turn, PhaseStep step) { + stopOnTurn = turn == -1 ? null : Integer.valueOf(turn); stopAtStep = step; - } + } - /** - * Assert turn number after test execution. - * - * @param turn Expected turn number to compare with. 1-based. - */ - public void assertTurn(int turn) throws AssertionError { - Assert.assertEquals("Turn numbers are not equal", turn, currentGame.getTurnNum()); - } + /** + * Assert turn number after test execution. + * + * @param turn Expected turn number to compare with. 1-based. + */ + public void assertTurn(int turn) throws AssertionError { + Assert.assertEquals("Turn numbers are not equal", turn, currentGame.getTurnNum()); + } - /** - * Assert game result after test execution. - * - * @param result Expected {@link GameResult} to compare with. - */ - public void assertResult(Player player, GameResult result) throws AssertionError { - if (player.equals(playerA)) { - GameResult actual = CardTestAPI.GameResult.DRAW; - if (currentGame.getWinner().equals("Player PlayerA is the winner")) { - actual = CardTestAPI.GameResult.WON; - } else if (currentGame.getWinner().equals("Player PlayerB is the winner")) { - actual = CardTestAPI.GameResult.LOST; - } - Assert.assertEquals("Game results are not equal", result, actual); - } else if (player.equals(playerB)) { - GameResult actual = CardTestAPI.GameResult.DRAW; - if (currentGame.getWinner().equals("Player PlayerB is the winner")) { - actual = CardTestAPI.GameResult.WON; - } else if (currentGame.getWinner().equals("Player PlayerA is the winner")) { - actual = CardTestAPI.GameResult.LOST; - } - Assert.assertEquals("Game results are not equal", result, actual); - } - } + /** + * Assert game result after test execution. + * + * @param result Expected {@link GameResult} to compare with. + */ + public void assertResult(Player player, GameResult result) throws AssertionError { + if (player.equals(playerA)) { + GameResult actual = CardTestAPI.GameResult.DRAW; + if (currentGame.getWinner().equals("Player PlayerA is the winner")) { + actual = CardTestAPI.GameResult.WON; + } else if (currentGame.getWinner().equals("Player PlayerB is the winner")) { + actual = CardTestAPI.GameResult.LOST; + } + Assert.assertEquals("Game results are not equal", result, actual); + } else if (player.equals(playerB)) { + GameResult actual = CardTestAPI.GameResult.DRAW; + if (currentGame.getWinner().equals("Player PlayerB is the winner")) { + actual = CardTestAPI.GameResult.WON; + } else if (currentGame.getWinner().equals("Player PlayerA is the winner")) { + actual = CardTestAPI.GameResult.LOST; + } + Assert.assertEquals("Game results are not equal", result, actual); + } + } - /** - * Assert player's life count after test execution. - * - * @param player {@link Player} to get life for comparison. - * @param life Expected player's life to compare with. - */ - public void assertLife(Player player, int life) throws AssertionError { - int actual = currentGame.getPlayer(player.getId()).getLife(); - Assert.assertEquals("Life amounts are not equal", life, actual); - } + /** + * Assert player's life count after test execution. + * + * @param player {@link Player} to get life for comparison. + * @param life Expected player's life to compare with. + */ + public void assertLife(Player player, int life) throws AssertionError { + int actual = currentGame.getPlayer(player.getId()).getLife(); + Assert.assertEquals("Life amounts are not equal", life, actual); + } - /** - * Assert creature's power and toughness by card name. - *

- * Throws {@link AssertionError} in the following cases: - * 1. no such player - * 2. no such creature under player's control - * 3. depending on comparison scope: - * 3a. any: no creature under player's control with the specified p\t params - * 3b. all: there is at least one creature with the cardName with the different p\t params - * - * @param player {@link Player} to get creatures for comparison. - * @param cardName Card name to compare with. - * @param power Expected power to compare with. - * @param toughness Expected toughness to compare with. - * @param scope {@link mage.filter.Filter.ComparisonScope} Use ANY, if you want "at least one creature with given name should have specified p\t" - * Use ALL, if you want "all creature with gived name should have specified p\t" - */ - public void assertPowerToughness(Player player, String cardName, int power, int toughness, Filter.ComparisonScope scope) - throws AssertionError { - int count = 0; - int fit = 0; - for (Permanent permanent : currentGame.getBattlefield().getAllActivePermanents(player.getId())) { - if (permanent.getName().equals(cardName)) { - count++; - if (scope.equals(Filter.ComparisonScope.All)) { - Assert.assertEquals("Power is not the same (" + power + " vs. " + permanent.getPower().getValue() + ")", - power, permanent.getPower().getValue()); - Assert.assertEquals("Toughness is not the same (" + toughness + " vs. " + permanent.getToughness().getValue() + ")", - toughness, permanent.getToughness().getValue()); - } else if (scope.equals(Filter.ComparisonScope.Any)) { - if (power == permanent.getPower().getValue() && toughness == permanent.getToughness().getValue()) { - fit++; - break; - } - } - } - } + /** + * Assert creature's power and toughness by card name. + *

+ * Throws {@link AssertionError} in the following cases: + * 1. no such player + * 2. no such creature under player's control + * 3. depending on comparison scope: + * 3a. any: no creature under player's control with the specified p\t params + * 3b. all: there is at least one creature with the cardName with the different p\t params + * + * @param player {@link Player} to get creatures for comparison. + * @param cardName Card name to compare with. + * @param power Expected power to compare with. + * @param toughness Expected toughness to compare with. + * @param scope {@link mage.filter.Filter.ComparisonScope} Use ANY, if you want "at least one creature with given name should have specified p\t" + * Use ALL, if you want "all creature with gived name should have specified p\t" + */ + public void assertPowerToughness(Player player, String cardName, int power, int toughness, Filter.ComparisonScope scope) + throws AssertionError { + int count = 0; + int fit = 0; + for (Permanent permanent : currentGame.getBattlefield().getAllActivePermanents(player.getId())) { + if (permanent.getName().equals(cardName)) { + count++; + if (scope.equals(Filter.ComparisonScope.All)) { + Assert.assertEquals("Power is not the same (" + power + " vs. " + permanent.getPower().getValue() + ")", + power, permanent.getPower().getValue()); + Assert.assertEquals("Toughness is not the same (" + toughness + " vs. " + permanent.getToughness().getValue() + ")", + toughness, permanent.getToughness().getValue()); + } else if (scope.equals(Filter.ComparisonScope.Any)) { + if (power == permanent.getPower().getValue() && toughness == permanent.getToughness().getValue()) { + fit++; + break; + } + } + } + } - Assert.assertTrue("There is no such permanent under player's control, player=" + player.getName() + - ", cardName=" + cardName, count > 0); + Assert.assertTrue("There is no such permanent under player's control, player=" + player.getName() + + ", cardName=" + cardName, count > 0); - if (scope.equals(Filter.ComparisonScope.Any)) { - Assert.assertTrue("There is no such creature under player's control with specified power&toughness, player=" + player.getName() + - ", cardName=" + cardName, fit > 0); - } - } + if (scope.equals(Filter.ComparisonScope.Any)) { + Assert.assertTrue("There is no such creature under player's control with specified power&toughness, player=" + player.getName() + + ", cardName=" + cardName, fit > 0); + } + } /** * {@inheritDoc} @@ -298,14 +298,14 @@ public abstract class CardTestAPIImpl extends MageTestBase implements CardTestAP throws AssertionError { int count = 0; Permanent found = null; - for (Permanent permanent : currentGame.getBattlefield().getAllActivePermanents(player.getId())) { - if (permanent.getName().equals(cardName)) { - found = permanent; - } - } + for (Permanent permanent : currentGame.getBattlefield().getAllActivePermanents(player.getId())) { + if (permanent.getName().equals(cardName)) { + found = permanent; + } + } - Assert.assertNotNull("There is no such permanent under player's control, player=" + player.getName() + - ", cardName=" + cardName, found); + Assert.assertNotNull("There is no such permanent under player's control, player=" + player.getName() + + ", cardName=" + cardName, found); Assert.assertTrue("There is more than one such permanent under player's control, player=" + player.getName() + ", cardName=" + cardName, count == 1); @@ -316,56 +316,56 @@ public abstract class CardTestAPIImpl extends MageTestBase implements CardTestAP } } - /** - * Assert permanent count under player's control. - * - * @param player {@link Player} which permanents should be counted. - * @param count Expected count. - */ - public void assertPermanentCount(Player player, int count) throws AssertionError { - int actualCount = 0; - for (Permanent permanent : currentGame.getBattlefield().getAllPermanents()) { - if (permanent.getControllerId().equals(player.getId())) { - actualCount++; - } - } - Assert.assertEquals("(Battlefield) Card counts are not equal ", count, actualCount); - } + /** + * Assert permanent count under player's control. + * + * @param player {@link Player} which permanents should be counted. + * @param count Expected count. + */ + public void assertPermanentCount(Player player, int count) throws AssertionError { + int actualCount = 0; + for (Permanent permanent : currentGame.getBattlefield().getAllPermanents()) { + if (permanent.getControllerId().equals(player.getId())) { + actualCount++; + } + } + Assert.assertEquals("(Battlefield) Card counts are not equal ", count, actualCount); + } - /** - * Assert permanent count under player's control. - * - * @param player {@link Player} which permanents should be counted. - * @param cardName Name of the cards that should be counted. - * @param count Expected count. - */ - public void assertPermanentCount(Player player, String cardName, int count) throws AssertionError { - int actualCount = 0; - for (Permanent permanent : currentGame.getBattlefield().getAllPermanents()) { - if (permanent.getControllerId().equals(player.getId())) { - if (permanent.getName().equals(cardName)) { - actualCount++; - } - } - } - Assert.assertEquals("(Battlefield) Card counts are not equal (" + cardName + ")", count, actualCount); - } - - public Permanent getPermanent(String cardName, UUID controller) { - Permanent permanent0 = null; - int count = 0; - for (Permanent permanent : currentGame.getBattlefield().getAllPermanents()) { - if (permanent.getControllerId().equals(controller)) { - if (permanent.getName().equals(cardName)) { - permanent0 = permanent; - count++; - } - } - } - Assert.assertNotNull("Couldn't find a card with specified name: " + cardName, permanent0); - Assert.assertEquals("More than one permanent was found: " + cardName + "(" + count + ")", 1, count); - return permanent0; - } + /** + * Assert permanent count under player's control. + * + * @param player {@link Player} which permanents should be counted. + * @param cardName Name of the cards that should be counted. + * @param count Expected count. + */ + public void assertPermanentCount(Player player, String cardName, int count) throws AssertionError { + int actualCount = 0; + for (Permanent permanent : currentGame.getBattlefield().getAllPermanents()) { + if (permanent.getControllerId().equals(player.getId())) { + if (permanent.getName().equals(cardName)) { + actualCount++; + } + } + } + Assert.assertEquals("(Battlefield) Card counts are not equal (" + cardName + ")", count, actualCount); + } + + public Permanent getPermanent(String cardName, UUID controller) { + Permanent permanent0 = null; + int count = 0; + for (Permanent permanent : currentGame.getBattlefield().getAllPermanents()) { + if (permanent.getControllerId().equals(controller)) { + if (permanent.getName().equals(cardName)) { + permanent0 = permanent; + count++; + } + } + } + Assert.assertNotNull("Couldn't find a card with specified name: " + cardName, permanent0); + Assert.assertEquals("More than one permanent was found: " + cardName + "(" + count + ")", 1, count); + return permanent0; + } public void playLand(Player player, String cardName) { player.addAction("play:"+cardName); diff --git a/Mage.Tests/src/test/java/org/mage/test/serverside/base/impl/CardTestPlayerAPIImpl.java b/Mage.Tests/src/test/java/org/mage/test/serverside/base/impl/CardTestPlayerAPIImpl.java index 3e7fa791c5..b1b2f4ff12 100644 --- a/Mage.Tests/src/test/java/org/mage/test/serverside/base/impl/CardTestPlayerAPIImpl.java +++ b/Mage.Tests/src/test/java/org/mage/test/serverside/base/impl/CardTestPlayerAPIImpl.java @@ -28,293 +28,293 @@ import java.util.UUID; */ public abstract class CardTestPlayerAPIImpl extends MageTestPlayerBase implements CardTestAPI { - /** - * Default game initialization params for red player (that plays with Mountains) - */ - public void useRedDefault() { - // *** ComputerA *** - // battlefield:ComputerA:Mountain:5 - addCard(Constants.Zone.BATTLEFIELD, playerA, "Mountain", 5); - // hand:ComputerA:Mountain:4 - addCard(Constants.Zone.HAND, playerA, "Mountain", 5); - // library:ComputerA:clear:0 - removeAllCardsFromLibrary(playerA); - // library:ComputerA:Mountain:10 - addCard(Constants.Zone.LIBRARY, playerA, "Mountain", 10); + /** + * Default game initialization params for red player (that plays with Mountains) + */ + public void useRedDefault() { + // *** ComputerA *** + // battlefield:ComputerA:Mountain:5 + addCard(Constants.Zone.BATTLEFIELD, playerA, "Mountain", 5); + // hand:ComputerA:Mountain:4 + addCard(Constants.Zone.HAND, playerA, "Mountain", 5); + // library:ComputerA:clear:0 + removeAllCardsFromLibrary(playerA); + // library:ComputerA:Mountain:10 + addCard(Constants.Zone.LIBRARY, playerA, "Mountain", 10); - // *** ComputerB *** - // battlefield:ComputerB:Plains:2 - addCard(Constants.Zone.BATTLEFIELD, playerB, "Plains", 2); - // hand:ComputerB:Plains:2 - addCard(Constants.Zone.HAND, playerB, "Plains", 2); - // library:ComputerB:clear:0 - removeAllCardsFromLibrary(playerB); - // library:ComputerB:Plains:10 - addCard(Constants.Zone.LIBRARY, playerB, "Plains", 10); - } - - /** - * Default game initialization params for white player (that plays with Plains) - */ - public void useWhiteDefault() { - // *** ComputerA *** - addCard(Constants.Zone.BATTLEFIELD, playerA, "Plains", 5); - addCard(Constants.Zone.HAND, playerA, "Plains", 5); - removeAllCardsFromLibrary(playerA); - addCard(Constants.Zone.LIBRARY, playerA, "Plains", 10); - - // *** ComputerB *** - addCard(Constants.Zone.BATTLEFIELD, playerB, "Plains", 2); - addCard(Constants.Zone.HAND, playerB, "Plains", 2); - removeAllCardsFromLibrary(playerB); - addCard(Constants.Zone.LIBRARY, playerB, "Plains", 10); - } - - /** - * Removes all cards from player's library from the game. - * Usually this should be used once before initialization to form the library in certain order. - * - * @param player {@link Player} to remove all library cards from. - */ - public void removeAllCardsFromLibrary(Player player) { - if (player.equals(playerA)) { - commandsA.put(Constants.Zone.LIBRARY, "clear"); - } else if (player.equals(playerB)) { - commandsB.put(Constants.Zone.LIBRARY, "clear"); - } - } - - /** - * Removes all cards from player's hand from the game. - * Usually this should be used once before initialization to set the players hand. - * - * @param player {@link Player} to remove all cards from hand. - */ - public void removeAllCardsFromHand(Player player) { - if (player.equals(playerA)) { - commandsA.put(Constants.Zone.HAND, "clear"); - } else if (player.equals(playerB)) { - commandsB.put(Constants.Zone.HAND, "clear"); - } - } + // *** ComputerB *** + // battlefield:ComputerB:Plains:2 + addCard(Constants.Zone.BATTLEFIELD, playerB, "Plains", 2); + // hand:ComputerB:Plains:2 + addCard(Constants.Zone.HAND, playerB, "Plains", 2); + // library:ComputerB:clear:0 + removeAllCardsFromLibrary(playerB); + // library:ComputerB:Plains:10 + addCard(Constants.Zone.LIBRARY, playerB, "Plains", 10); + } /** - * Add a card to specified zone of specified player. - * - * @param gameZone {@link Constants.Zone} to add cards to. - * @param player {@link Player} to add cards for. Use either playerA or playerB. - * @param cardName Card name in string format. - */ - public void addCard(Constants.Zone gameZone, Player player, String cardName) { - addCard(gameZone, player, cardName, 1, false); - } + * Default game initialization params for white player (that plays with Plains) + */ + public void useWhiteDefault() { + // *** ComputerA *** + addCard(Constants.Zone.BATTLEFIELD, playerA, "Plains", 5); + addCard(Constants.Zone.HAND, playerA, "Plains", 5); + removeAllCardsFromLibrary(playerA); + addCard(Constants.Zone.LIBRARY, playerA, "Plains", 10); - /** - * Add any amount of cards to specified zone of specified player. - * - * @param gameZone {@link Constants.Zone} to add cards to. - * @param player {@link Player} to add cards for. Use either playerA or playerB. - * @param cardName Card name in string format. - * @param count Amount of cards to be added. - */ - public void addCard(Constants.Zone gameZone, Player player, String cardName, int count) { - addCard(gameZone, player, cardName, count, false); - } + // *** ComputerB *** + addCard(Constants.Zone.BATTLEFIELD, playerB, "Plains", 2); + addCard(Constants.Zone.HAND, playerB, "Plains", 2); + removeAllCardsFromLibrary(playerB); + addCard(Constants.Zone.LIBRARY, playerB, "Plains", 10); + } - /** - * Add any amount of cards to specified zone of specified player. - * - * @param gameZone {@link Constants.Zone} to add cards to. - * @param player {@link Player} to add cards for. Use either playerA or playerB. - * @param cardName Card name in string format. - * @param count Amount of cards to be added. - * @param tapped In case gameZone is Battlefield, determines whether permanent should be tapped. - * In case gameZone is other than Battlefield, {@link IllegalArgumentException} is thrown - */ - public void addCard(Constants.Zone gameZone, Player player, String cardName, int count, boolean tapped) { + /** + * Removes all cards from player's library from the game. + * Usually this should be used once before initialization to form the library in certain order. + * + * @param player {@link Player} to remove all library cards from. + */ + public void removeAllCardsFromLibrary(Player player) { + if (player.equals(playerA)) { + commandsA.put(Constants.Zone.LIBRARY, "clear"); + } else if (player.equals(playerB)) { + commandsB.put(Constants.Zone.LIBRARY, "clear"); + } + } + + /** + * Removes all cards from player's hand from the game. + * Usually this should be used once before initialization to set the players hand. + * + * @param player {@link Player} to remove all cards from hand. + */ + public void removeAllCardsFromHand(Player player) { + if (player.equals(playerA)) { + commandsA.put(Constants.Zone.HAND, "clear"); + } else if (player.equals(playerB)) { + commandsB.put(Constants.Zone.HAND, "clear"); + } + } + + /** + * Add a card to specified zone of specified player. + * + * @param gameZone {@link Constants.Zone} to add cards to. + * @param player {@link Player} to add cards for. Use either playerA or playerB. + * @param cardName Card name in string format. + */ + public void addCard(Constants.Zone gameZone, Player player, String cardName) { + addCard(gameZone, player, cardName, 1, false); + } + + /** + * Add any amount of cards to specified zone of specified player. + * + * @param gameZone {@link Constants.Zone} to add cards to. + * @param player {@link Player} to add cards for. Use either playerA or playerB. + * @param cardName Card name in string format. + * @param count Amount of cards to be added. + */ + public void addCard(Constants.Zone gameZone, Player player, String cardName, int count) { + addCard(gameZone, player, cardName, count, false); + } + + /** + * Add any amount of cards to specified zone of specified player. + * + * @param gameZone {@link Constants.Zone} to add cards to. + * @param player {@link Player} to add cards for. Use either playerA or playerB. + * @param cardName Card name in string format. + * @param count Amount of cards to be added. + * @param tapped In case gameZone is Battlefield, determines whether permanent should be tapped. + * In case gameZone is other than Battlefield, {@link IllegalArgumentException} is thrown + */ + public void addCard(Constants.Zone gameZone, Player player, String cardName, int count, boolean tapped) { - if (gameZone.equals(Constants.Zone.BATTLEFIELD)) { - for (int i = 0; i < count; i++) { - Card card = Sets.findCard(cardName, true); + if (gameZone.equals(Constants.Zone.BATTLEFIELD)) { + for (int i = 0; i < count; i++) { + Card card = Sets.findCard(cardName, true); if (card == null) { throw new IllegalArgumentException("[TEST] Couldn't find a card: " + cardName); } - PermanentCard p = new PermanentCard(card, null); - p.setTapped(tapped); - if (player.equals(playerA)) { - battlefieldCardsA.add(p); - } else if (player.equals(playerB)) { - battlefieldCardsB.add(p); - } - } - } else { - if (tapped) { - throw new IllegalArgumentException("Parameter tapped=true can be used only for Zone.BATTLEFIELD."); - } - List cards = getCardList(gameZone, player); - for (int i = 0; i < count; i++) { - Card card = Sets.findCard(cardName, true); - cards.add(card); - } - } - } - - /** - * Returns card list containter for specified game zone and player. - * - * @param gameZone - * @param player - * @return - */ - private List getCardList(Constants.Zone gameZone, Player player) { - if (player.equals(playerA)) { - if (gameZone.equals(Constants.Zone.HAND)) { - return handCardsA; - } else if (gameZone.equals(Constants.Zone.GRAVEYARD)) { - return graveyardCardsA; - } else if (gameZone.equals(Constants.Zone.LIBRARY)) { - return libraryCardsA; - } - } else if (player.equals(playerB)) { - if (gameZone.equals(Constants.Zone.HAND)) { - return handCardsB; - } else if (gameZone.equals(Constants.Zone.GRAVEYARD)) { - return graveyardCardsB; - } else if (gameZone.equals(Constants.Zone.LIBRARY)) { - return libraryCardsB; - } - } - return null; - } - - /** - * Set player's initial life count. - * - * @param player {@link Player} to set life count for. - * @param life Life count to set. - */ - public void setLife(Player player, int life) { - if (player.equals(playerA)) { - commandsA.put(Constants.Zone.OUTSIDE, "life:" + String.valueOf(life)); - } else if (player.equals(playerB)) { - commandsB.put(Constants.Zone.OUTSIDE, "life:" + String.valueOf(life)); - } - } - - /** - * Define turn number to stop the game on. - */ - public void setStopOnTurn(int turn) { - stopOnTurn = turn == -1 ? null : Integer.valueOf(turn); - stopAtStep = PhaseStep.UNTAP; - } + PermanentCard p = new PermanentCard(card, null); + p.setTapped(tapped); + if (player.equals(playerA)) { + battlefieldCardsA.add(p); + } else if (player.equals(playerB)) { + battlefieldCardsB.add(p); + } + } + } else { + if (tapped) { + throw new IllegalArgumentException("Parameter tapped=true can be used only for Zone.BATTLEFIELD."); + } + List cards = getCardList(gameZone, player); + for (int i = 0; i < count; i++) { + Card card = Sets.findCard(cardName, true); + cards.add(card); + } + } + } /** - * Define turn number and step to stop the game on. - */ - public void setStopAt(int turn, PhaseStep step) { - stopOnTurn = turn == -1 ? null : Integer.valueOf(turn); + * Returns card list containter for specified game zone and player. + * + * @param gameZone + * @param player + * @return + */ + private List getCardList(Constants.Zone gameZone, Player player) { + if (player.equals(playerA)) { + if (gameZone.equals(Constants.Zone.HAND)) { + return handCardsA; + } else if (gameZone.equals(Constants.Zone.GRAVEYARD)) { + return graveyardCardsA; + } else if (gameZone.equals(Constants.Zone.LIBRARY)) { + return libraryCardsA; + } + } else if (player.equals(playerB)) { + if (gameZone.equals(Constants.Zone.HAND)) { + return handCardsB; + } else if (gameZone.equals(Constants.Zone.GRAVEYARD)) { + return graveyardCardsB; + } else if (gameZone.equals(Constants.Zone.LIBRARY)) { + return libraryCardsB; + } + } + return null; + } + + /** + * Set player's initial life count. + * + * @param player {@link Player} to set life count for. + * @param life Life count to set. + */ + public void setLife(Player player, int life) { + if (player.equals(playerA)) { + commandsA.put(Constants.Zone.OUTSIDE, "life:" + String.valueOf(life)); + } else if (player.equals(playerB)) { + commandsB.put(Constants.Zone.OUTSIDE, "life:" + String.valueOf(life)); + } + } + + /** + * Define turn number to stop the game on. + */ + public void setStopOnTurn(int turn) { + stopOnTurn = turn == -1 ? null : Integer.valueOf(turn); + stopAtStep = PhaseStep.UNTAP; + } + + /** + * Define turn number and step to stop the game on. + */ + public void setStopAt(int turn, PhaseStep step) { + stopOnTurn = turn == -1 ? null : Integer.valueOf(turn); stopAtStep = step; - } + } - /** - * Assert turn number after test execution. - * - * @param turn Expected turn number to compare with. 1-based. - */ - public void assertTurn(int turn) throws AssertionError { - Assert.assertEquals("Turn numbers are not equal", turn, currentGame.getTurnNum()); - } + /** + * Assert turn number after test execution. + * + * @param turn Expected turn number to compare with. 1-based. + */ + public void assertTurn(int turn) throws AssertionError { + Assert.assertEquals("Turn numbers are not equal", turn, currentGame.getTurnNum()); + } - /** - * Assert game result after test execution. - * - * @param result Expected {@link GameResult} to compare with. - */ - public void assertResult(Player player, GameResult result) throws AssertionError { - if (player.equals(playerA)) { - GameResult actual = CardTestAPI.GameResult.DRAW; - if (currentGame.getWinner().equals("Player PlayerA is the winner")) { - actual = CardTestAPI.GameResult.WON; - } else if (currentGame.getWinner().equals("Player PlayerB is the winner")) { - actual = CardTestAPI.GameResult.LOST; - } - Assert.assertEquals("Game results are not equal", result, actual); - } else if (player.equals(playerB)) { - GameResult actual = CardTestAPI.GameResult.DRAW; - if (currentGame.getWinner().equals("Player PlayerB is the winner")) { - actual = CardTestAPI.GameResult.WON; - } else if (currentGame.getWinner().equals("Player PlayerA is the winner")) { - actual = CardTestAPI.GameResult.LOST; - } - Assert.assertEquals("Game results are not equal", result, actual); - } - } + /** + * Assert game result after test execution. + * + * @param result Expected {@link GameResult} to compare with. + */ + public void assertResult(Player player, GameResult result) throws AssertionError { + if (player.equals(playerA)) { + GameResult actual = CardTestAPI.GameResult.DRAW; + if (currentGame.getWinner().equals("Player PlayerA is the winner")) { + actual = CardTestAPI.GameResult.WON; + } else if (currentGame.getWinner().equals("Player PlayerB is the winner")) { + actual = CardTestAPI.GameResult.LOST; + } + Assert.assertEquals("Game results are not equal", result, actual); + } else if (player.equals(playerB)) { + GameResult actual = CardTestAPI.GameResult.DRAW; + if (currentGame.getWinner().equals("Player PlayerB is the winner")) { + actual = CardTestAPI.GameResult.WON; + } else if (currentGame.getWinner().equals("Player PlayerA is the winner")) { + actual = CardTestAPI.GameResult.LOST; + } + Assert.assertEquals("Game results are not equal", result, actual); + } + } - /** - * Assert player's life count after test execution. - * - * @param player {@link Player} to get life for comparison. - * @param life Expected player's life to compare with. - */ - public void assertLife(Player player, int life) throws AssertionError { - int actual = currentGame.getPlayer(player.getId()).getLife(); - Assert.assertEquals("Life amounts are not equal for player " + player.getName(), life, actual); - } + /** + * Assert player's life count after test execution. + * + * @param player {@link Player} to get life for comparison. + * @param life Expected player's life to compare with. + */ + public void assertLife(Player player, int life) throws AssertionError { + int actual = currentGame.getPlayer(player.getId()).getLife(); + Assert.assertEquals("Life amounts are not equal for player " + player.getName(), life, actual); + } - /** - * Assert creature's power and toughness by card name. - *

- * Throws {@link AssertionError} in the following cases: - * 1. no such player - * 2. no such creature under player's control - * 3. depending on comparison scope: - * 3a. any: no creature under player's control with the specified p\t params - * 3b. all: there is at least one creature with the cardName with the different p\t params - * - * @param player {@link Player} to get creatures for comparison. - * @param cardName Card name to compare with. - * @param power Expected power to compare with. - * @param toughness Expected toughness to compare with. - * @param scope {@link mage.filter.Filter.ComparisonScope} Use ANY, if you want "at least one creature with given name should have specified p\t" - * Use ALL, if you want "all creature with gived name should have specified p\t" - */ - public void assertPowerToughness(Player player, String cardName, int power, int toughness, Filter.ComparisonScope scope) - throws AssertionError { - int count = 0; - int fit = 0; + /** + * Assert creature's power and toughness by card name. + *

+ * Throws {@link AssertionError} in the following cases: + * 1. no such player + * 2. no such creature under player's control + * 3. depending on comparison scope: + * 3a. any: no creature under player's control with the specified p\t params + * 3b. all: there is at least one creature with the cardName with the different p\t params + * + * @param player {@link Player} to get creatures for comparison. + * @param cardName Card name to compare with. + * @param power Expected power to compare with. + * @param toughness Expected toughness to compare with. + * @param scope {@link mage.filter.Filter.ComparisonScope} Use ANY, if you want "at least one creature with given name should have specified p\t" + * Use ALL, if you want "all creature with gived name should have specified p\t" + */ + public void assertPowerToughness(Player player, String cardName, int power, int toughness, Filter.ComparisonScope scope) + throws AssertionError { + int count = 0; + int fit = 0; int foundPower = 0; int foundToughness = 0; int found = 0; - for (Permanent permanent : currentGame.getBattlefield().getAllPermanents()) { - if (permanent.getName().equals(cardName) && permanent.getControllerId().equals(player.getId())) { - count++; - if (scope.equals(Filter.ComparisonScope.All)) { - Assert.assertEquals("Power is not the same (" + power + " vs. " + permanent.getPower().getValue() + ")", - power, permanent.getPower().getValue()); - Assert.assertEquals("Toughness is not the same (" + toughness + " vs. " + permanent.getToughness().getValue() + ")", - toughness, permanent.getToughness().getValue()); - } else if (scope.equals(Filter.ComparisonScope.Any)) { - if (power == permanent.getPower().getValue() && toughness == permanent.getToughness().getValue()) { - fit++; - break; - } + for (Permanent permanent : currentGame.getBattlefield().getAllPermanents()) { + if (permanent.getName().equals(cardName) && permanent.getControllerId().equals(player.getId())) { + count++; + if (scope.equals(Filter.ComparisonScope.All)) { + Assert.assertEquals("Power is not the same (" + power + " vs. " + permanent.getPower().getValue() + ")", + power, permanent.getPower().getValue()); + Assert.assertEquals("Toughness is not the same (" + toughness + " vs. " + permanent.getToughness().getValue() + ")", + toughness, permanent.getToughness().getValue()); + } else if (scope.equals(Filter.ComparisonScope.Any)) { + if (power == permanent.getPower().getValue() && toughness == permanent.getToughness().getValue()) { + fit++; + break; + } found++; foundPower = permanent.getPower().getValue(); foundToughness = permanent.getToughness().getValue(); - } - } - } + } + } + } - Assert.assertTrue("There is no such permanent under player's control, player=" + player.getName() + - ", cardName=" + cardName, count > 0); + Assert.assertTrue("There is no such permanent under player's control, player=" + player.getName() + + ", cardName=" + cardName, count > 0); - if (scope.equals(Filter.ComparisonScope.Any)) { - Assert.assertTrue("There is no such creature under player's control with specified power&toughness, player=" + player.getName() + - ", cardName=" + cardName + " (found similar: " + found + ", one of them: power=" + foundPower + " toughness=" + foundToughness + ")", fit > 0); - } - } + if (scope.equals(Filter.ComparisonScope.Any)) { + Assert.assertTrue("There is no such creature under player's control with specified power&toughness, player=" + player.getName() + + ", cardName=" + cardName + " (found similar: " + found + ", one of them: power=" + foundPower + " toughness=" + foundToughness + ")", fit > 0); + } + } /** * See {@link #assertPowerToughness(mage.players.Player, String, int, int, mage.filter.Filter.ComparisonScope)} @@ -335,15 +335,15 @@ public abstract class CardTestPlayerAPIImpl extends MageTestPlayerBase implement throws AssertionError { int count = 0; Permanent found = null; - for (Permanent permanent : currentGame.getBattlefield().getAllActivePermanents(player.getId())) { - if (permanent.getName().equals(cardName)) { - found = permanent; + for (Permanent permanent : currentGame.getBattlefield().getAllActivePermanents(player.getId())) { + if (permanent.getName().equals(cardName)) { + found = permanent; count++; - } - } + } + } - Assert.assertNotNull("There is no such permanent under player's control, player=" + player.getName() + - ", cardName=" + cardName, found); + Assert.assertNotNull("There is no such permanent under player's control, player=" + player.getName() + + ", cardName=" + cardName, found); Assert.assertTrue("There is more than one such permanent under player's control, player=" + player.getName() + ", cardName=" + cardName, count == 1); @@ -354,40 +354,40 @@ public abstract class CardTestPlayerAPIImpl extends MageTestPlayerBase implement } } - /** - * Assert permanent count under player's control. - * - * @param player {@link Player} which permanents should be counted. - * @param count Expected count. - */ - public void assertPermanentCount(Player player, int count) throws AssertionError { - int actualCount = 0; - for (Permanent permanent : currentGame.getBattlefield().getAllPermanents()) { - if (permanent.getControllerId().equals(player.getId())) { - actualCount++; - } - } - Assert.assertEquals("(Battlefield) Card counts are not equal ", count, actualCount); - } + /** + * Assert permanent count under player's control. + * + * @param player {@link Player} which permanents should be counted. + * @param count Expected count. + */ + public void assertPermanentCount(Player player, int count) throws AssertionError { + int actualCount = 0; + for (Permanent permanent : currentGame.getBattlefield().getAllPermanents()) { + if (permanent.getControllerId().equals(player.getId())) { + actualCount++; + } + } + Assert.assertEquals("(Battlefield) Card counts are not equal ", count, actualCount); + } - /** - * Assert permanent count under player's control. - * - * @param player {@link Player} which permanents should be counted. - * @param cardName Name of the cards that should be counted. - * @param count Expected count. - */ - public void assertPermanentCount(Player player, String cardName, int count) throws AssertionError { - int actualCount = 0; - for (Permanent permanent : currentGame.getBattlefield().getAllPermanents()) { - if (permanent.getControllerId().equals(player.getId())) { - if (permanent.getName().equals(cardName)) { - actualCount++; - } - } - } - Assert.assertEquals("(Battlefield) Card counts are not equal (" + cardName + ")", count, actualCount); - } + /** + * Assert permanent count under player's control. + * + * @param player {@link Player} which permanents should be counted. + * @param cardName Name of the cards that should be counted. + * @param count Expected count. + */ + public void assertPermanentCount(Player player, String cardName, int count) throws AssertionError { + int actualCount = 0; + for (Permanent permanent : currentGame.getBattlefield().getAllPermanents()) { + if (permanent.getControllerId().equals(player.getId())) { + if (permanent.getName().equals(cardName)) { + actualCount++; + } + } + } + Assert.assertEquals("(Battlefield) Card counts are not equal (" + cardName + ")", count, actualCount); + } /** * Assert emblem count under player's control @@ -406,110 +406,110 @@ public abstract class CardTestPlayerAPIImpl extends MageTestPlayerBase implement Assert.assertEquals("Emblem counts are not equal", count, actualCount); } - /** - * Assert counter count on a permanent - * - * @param cardName Name of the cards that should be counted. - * @param type Type of the counter that should be counted. + /** + * Assert counter count on a permanent + * + * @param cardName Name of the cards that should be counted. + * @param type Type of the counter that should be counted. * @param count Expected count. - */ - public void assertCounterCount(String cardName, CounterType type, int count) throws AssertionError { + */ + public void assertCounterCount(String cardName, CounterType type, int count) throws AssertionError { Permanent found = null; - for (Permanent permanent : currentGame.getBattlefield().getAllActivePermanents()) { - if (permanent.getName().equals(cardName)) { - found = permanent; + for (Permanent permanent : currentGame.getBattlefield().getAllActivePermanents()) { + if (permanent.getName().equals(cardName)) { + found = permanent; break; - } - } + } + } - Assert.assertNotNull("There is no such permanent on the battlefield, cardName=" + cardName, found); + Assert.assertNotNull("There is no such permanent on the battlefield, cardName=" + cardName, found); Assert.assertEquals("(Battlefield) Counter counts are not equal (" + cardName + ":" + type + ")", count, found.getCounters().getCount(type)); - } + } /** - * Assert counter count on a player - * - * @param player The player whos counters should be counted. - * @param type Type of the counter that should be counted. + * Assert counter count on a player + * + * @param player The player whos counters should be counted. + * @param type Type of the counter that should be counted. * @param count Expected count. - */ - public void assertCounterCount(Player player, CounterType type, int count) throws AssertionError { + */ + public void assertCounterCount(Player player, CounterType type, int count) throws AssertionError { Assert.assertEquals("(Battlefield) Counter counts are not equal (" + player.getName() + ":" + type + ")", count, player.getCounters().getCount(type)); - } - - /** - * Assert whether a permanent is a specified type or not - * - * @param cardName Name of the permanent that should be checked. - * @param type A type to test for - * @param subType a subtype to test for - */ - public void assertType(String cardName, CardType type, String subType) throws AssertionError { - Permanent found = null; - for (Permanent permanent : currentGame.getBattlefield().getAllActivePermanents()) { - if (permanent.getName().equals(cardName)) { - found = permanent; - break; - } - } + } - Assert.assertNotNull("There is no such permanent on the battlefield, cardName=" + cardName, found); - - Assert.assertTrue("(Battlefield) card type not found (" + cardName + ":" + type + ")", found.getCardType().contains(type)); + /** + * Assert whether a permanent is a specified type or not + * + * @param cardName Name of the permanent that should be checked. + * @param type A type to test for + * @param subType a subtype to test for + */ + public void assertType(String cardName, CardType type, String subType) throws AssertionError { + Permanent found = null; + for (Permanent permanent : currentGame.getBattlefield().getAllActivePermanents()) { + if (permanent.getName().equals(cardName)) { + found = permanent; + break; + } + } + + Assert.assertNotNull("There is no such permanent on the battlefield, cardName=" + cardName, found); + + Assert.assertTrue("(Battlefield) card type not found (" + cardName + ":" + type + ")", found.getCardType().contains(type)); Assert.assertTrue("(Battlefield) card sub-type not equal (" + cardName + ":" + subType + ")", found.getSubtype().contains(subType)); - } + } /** - * Assert whether a permanent is tapped or not - * - * @param cardName Name of the permanent that should be checked. - * @param tapped Whether the permanent is tapped or not - */ - public void assertTapped(String cardName, boolean tapped) throws AssertionError { + * Assert whether a permanent is tapped or not + * + * @param cardName Name of the permanent that should be checked. + * @param tapped Whether the permanent is tapped or not + */ + public void assertTapped(String cardName, boolean tapped) throws AssertionError { Permanent found = null; - for (Permanent permanent : currentGame.getBattlefield().getAllActivePermanents()) { - if (permanent.getName().equals(cardName)) { - found = permanent; - } - } + for (Permanent permanent : currentGame.getBattlefield().getAllActivePermanents()) { + if (permanent.getName().equals(cardName)) { + found = permanent; + } + } - Assert.assertNotNull("There is no such permanent on the battlefield, cardName=" + cardName, found); - - Assert.assertEquals("(Battlefield) Tapped state is not equal (" + cardName + ")", tapped, found.isTapped()); - } + Assert.assertNotNull("There is no such permanent on the battlefield, cardName=" + cardName, found); + + Assert.assertEquals("(Battlefield) Tapped state is not equal (" + cardName + ")", tapped, found.isTapped()); + } /** - * Assert card count in player's hand. - * - * @param player {@link Player} who's hand should be counted. - * @param count Expected count. - */ - public void assertHandCount(Player player, int count) throws AssertionError { - int actual = currentGame.getPlayer(player.getId()).getHand().size(); - Assert.assertEquals("(Hand) Card counts are not equal ", count, actual); - } - - /** - * Assert card count in player's graveyard. - * - * @param player {@link Player} who's graveyard should be counted. - * @param count Expected count. - */ - public void assertGraveyardCount(Player player, int count) throws AssertionError { - int actual = currentGame.getPlayer(player.getId()).getGraveyard().size(); - Assert.assertEquals("(Graveyard) Card counts are not equal ", count, actual); - } + * Assert card count in player's hand. + * + * @param player {@link Player} who's hand should be counted. + * @param count Expected count. + */ + public void assertHandCount(Player player, int count) throws AssertionError { + int actual = currentGame.getPlayer(player.getId()).getHand().size(); + Assert.assertEquals("(Hand) Card counts are not equal ", count, actual); + } /** - * Assert card count in exile. - * - * @param cardName Name of the cards that should be counted. - * @param count Expected count. - */ - public void assertExileCount(String cardName, int count) throws AssertionError { - int actualCount = 0; + * Assert card count in player's graveyard. + * + * @param player {@link Player} who's graveyard should be counted. + * @param count Expected count. + */ + public void assertGraveyardCount(Player player, int count) throws AssertionError { + int actual = currentGame.getPlayer(player.getId()).getGraveyard().size(); + Assert.assertEquals("(Graveyard) Card counts are not equal ", count, actual); + } + + /** + * Assert card count in exile. + * + * @param cardName Name of the cards that should be counted. + * @param count Expected count. + */ + public void assertExileCount(String cardName, int count) throws AssertionError { + int actualCount = 0; for (ExileZone exile: currentGame.getExile().getExileZones()) { for (Card card : exile.getCards(currentGame)) { if (card.getName().equals(cardName)) { @@ -518,42 +518,42 @@ public abstract class CardTestPlayerAPIImpl extends MageTestPlayerBase implement } } - Assert.assertEquals("(Exile) Card counts are not equal (" + cardName + ")", count, actualCount); - } + Assert.assertEquals("(Exile) Card counts are not equal (" + cardName + ")", count, actualCount); + } - /** - * Assert card count in player's graveyard. - * - * @param player {@link Player} who's graveyard should be counted. - * @param cardName Name of the cards that should be counted. - * @param count Expected count. - */ - public void assertGraveyardCount(Player player, String cardName, int count) throws AssertionError { - int actualCount = 0; - for (Card card : player.getGraveyard().getCards(currentGame)) { + /** + * Assert card count in player's graveyard. + * + * @param player {@link Player} who's graveyard should be counted. + * @param cardName Name of the cards that should be counted. + * @param count Expected count. + */ + public void assertGraveyardCount(Player player, String cardName, int count) throws AssertionError { + int actualCount = 0; + for (Card card : player.getGraveyard().getCards(currentGame)) { if (card.getName().equals(cardName)) { actualCount++; } } - Assert.assertEquals("(Graveyard) Card counts are not equal (" + cardName + ")", count, actualCount); - } + Assert.assertEquals("(Graveyard) Card counts are not equal (" + cardName + ")", count, actualCount); + } public Permanent getPermanent(String cardName, UUID controller) { - Permanent permanent0 = null; - int count = 0; - for (Permanent permanent : currentGame.getBattlefield().getAllPermanents()) { - if (permanent.getControllerId().equals(controller)) { - if (permanent.getName().equals(cardName)) { - permanent0 = permanent; - count++; - } - } - } - Assert.assertNotNull("Couldn't find a card with specified name: " + cardName, permanent0); - Assert.assertEquals("More than one permanent was found: " + cardName + "(" + count + ")", 1, count); - return permanent0; - } + Permanent permanent0 = null; + int count = 0; + for (Permanent permanent : currentGame.getBattlefield().getAllPermanents()) { + if (permanent.getControllerId().equals(controller)) { + if (permanent.getName().equals(cardName)) { + permanent0 = permanent; + count++; + } + } + } + Assert.assertNotNull("Couldn't find a card with specified name: " + cardName, permanent0); + Assert.assertEquals("More than one permanent was found: " + cardName + "(" + count + ")", 1, count); + return permanent0; + } public void playLand(int turnNum, PhaseStep step, TestPlayer player, String cardName) { player.addAction(turnNum, step, "activate:Play " + cardName); @@ -594,11 +594,11 @@ public abstract class CardTestPlayerAPIImpl extends MageTestPlayerBase implement public void block(int turnNum, TestPlayer player, String blocker, String attacker) { player.addAction(turnNum, PhaseStep.DECLARE_BLOCKERS, "block:"+blocker+";"+attacker); } - + public void setChoice(TestPlayer player, String choice) { player.addChoice(choice); } - + public void addTarget(TestPlayer player, String target) { player.addTarget(target); } diff --git a/Mage.Tests/src/test/java/org/mage/test/serverside/cards/abilities/ProtectionFromColorTest.java b/Mage.Tests/src/test/java/org/mage/test/serverside/cards/abilities/ProtectionFromColorTest.java index 8896b80fdd..0cdbe292b0 100644 --- a/Mage.Tests/src/test/java/org/mage/test/serverside/cards/abilities/ProtectionFromColorTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/serverside/cards/abilities/ProtectionFromColorTest.java @@ -11,32 +11,32 @@ import org.mage.test.serverside.base.CardTestPlayerBase; */ public class ProtectionFromColorTest extends CardTestPlayerBase { - @Test - public void testAgainstAbilityInTheStack() { - addCard(Constants.Zone.BATTLEFIELD, playerA, "Royal Assassin"); + @Test + public void testAgainstAbilityInTheStack() { + addCard(Constants.Zone.BATTLEFIELD, playerA, "Royal Assassin"); - // tapped White Knight with Protection from Black - addCard(Constants.Zone.BATTLEFIELD, playerB, "White Knight", 1, true); + // tapped White Knight with Protection from Black + addCard(Constants.Zone.BATTLEFIELD, playerB, "White Knight", 1, true); activateAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "{T}: Destroy target tapped creature. ", "White Knight"); - setStopAt(1, PhaseStep.BEGIN_COMBAT); - execute(); + setStopAt(1, PhaseStep.BEGIN_COMBAT); + execute(); - // no one should be destroyed - assertPermanentCount(playerB, "White Knight", 1); - } + // no one should be destroyed + assertPermanentCount(playerB, "White Knight", 1); + } - @Test - public void testAgainstAbilityInTheStackNoProtection() { - addCard(Constants.Zone.BATTLEFIELD, playerA, "Royal Assassin"); + @Test + public void testAgainstAbilityInTheStackNoProtection() { + addCard(Constants.Zone.BATTLEFIELD, playerA, "Royal Assassin"); - addCard(Constants.Zone.BATTLEFIELD, playerB, "Runeclaw Bear", 1, true); + addCard(Constants.Zone.BATTLEFIELD, playerB, "Runeclaw Bear", 1, true); activateAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "{T}: Destroy target tapped creature. ", "Runeclaw Bear"); - setStopAt(1, PhaseStep.BEGIN_COMBAT); - execute(); + setStopAt(1, PhaseStep.BEGIN_COMBAT); + execute(); - // One should have beendestroyed by Royal Assassin - assertPermanentCount(playerB, "Runeclaw Bear", 0); - } + // One should have beendestroyed by Royal Assassin + assertPermanentCount(playerB, "Runeclaw Bear", 0); + } } diff --git a/Mage.Tests/src/test/java/org/mage/test/serverside/cards/abilities/ProtectionFromTypeTest.java b/Mage.Tests/src/test/java/org/mage/test/serverside/cards/abilities/ProtectionFromTypeTest.java index 37f777915a..dc426523ae 100644 --- a/Mage.Tests/src/test/java/org/mage/test/serverside/cards/abilities/ProtectionFromTypeTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/serverside/cards/abilities/ProtectionFromTypeTest.java @@ -10,33 +10,33 @@ import org.mage.test.serverside.base.CardTestPlayerBase; */ public class ProtectionFromTypeTest extends CardTestPlayerBase { - @Test - public void testProtectionFromArtifacts() { - useRedDefault(); - addCard(Constants.Zone.BATTLEFIELD, playerA, "Trigon of Corruption"); + @Test + public void testProtectionFromArtifacts() { + useRedDefault(); + addCard(Constants.Zone.BATTLEFIELD, playerA, "Trigon of Corruption"); - addCard(Constants.Zone.BATTLEFIELD, playerB, "Tel-Jilad Fallen"); + addCard(Constants.Zone.BATTLEFIELD, playerB, "Tel-Jilad Fallen"); activateAbility(1, Constants.PhaseStep.PRECOMBAT_MAIN, playerA, "{2},Remove a Charge counter from {this}, {T}: put a -1/-1 counter on target creature. ", "Tel-Jilad Fallen"); - setStopAt(1, Constants.PhaseStep.BEGIN_COMBAT); - execute(); + setStopAt(1, Constants.PhaseStep.BEGIN_COMBAT); + execute(); - // no one should be destroyed - assertPermanentCount(playerB, "Tel-Jilad Fallen", 1); - } + // no one should be destroyed + assertPermanentCount(playerB, "Tel-Jilad Fallen", 1); + } - @Test - public void testNoProtection() { - useRedDefault(); - addCard(Constants.Zone.BATTLEFIELD, playerA, "Trigon of Corruption"); + @Test + public void testNoProtection() { + useRedDefault(); + addCard(Constants.Zone.BATTLEFIELD, playerA, "Trigon of Corruption"); - addCard(Constants.Zone.BATTLEFIELD, playerB, "Coral Merfolk"); + addCard(Constants.Zone.BATTLEFIELD, playerB, "Coral Merfolk"); activateAbility(1, Constants.PhaseStep.PRECOMBAT_MAIN, playerA, "{2},Remove a Charge counter from {this}, {T}: put a -1/-1 counter on target creature. ", "Coral Merfolk"); - setStopAt(1, Constants.PhaseStep.BEGIN_COMBAT); - execute(); + setStopAt(1, Constants.PhaseStep.BEGIN_COMBAT); + execute(); - // Coral Merfolk should be destroyed - assertPermanentCount(playerB, "Coral Merfolk", 0); - } + // Coral Merfolk should be destroyed + assertPermanentCount(playerB, "Coral Merfolk", 0); + } } diff --git a/Mage.Tests/src/test/java/org/mage/test/serverside/cards/effects/BoostContinuousEffectTest.java b/Mage.Tests/src/test/java/org/mage/test/serverside/cards/effects/BoostContinuousEffectTest.java index 25a7d9c1fe..75156d531c 100644 --- a/Mage.Tests/src/test/java/org/mage/test/serverside/cards/effects/BoostContinuousEffectTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/serverside/cards/effects/BoostContinuousEffectTest.java @@ -14,16 +14,16 @@ import org.mage.test.serverside.base.CardTestBase; */ public class BoostContinuousEffectTest extends CardTestBase { - @Test + @Test @Ignore - public void testHonorOfThePoor() throws Exception { - load("M11/Honor of the Pure.test"); - execute(); + public void testHonorOfThePoor() throws Exception { + load("M11/Honor of the Pure.test"); + execute(); + + checkPermanentPT(playerA, "Tine Shrike", 3, 2, Filter.ComparisonScope.Any); + checkPermanentPT(playerA, "Runeclaw Bear", 2, 2, Filter.ComparisonScope.Any); + } - checkPermanentPT(playerA, "Tine Shrike", 3, 2, Filter.ComparisonScope.Any); - checkPermanentPT(playerA, "Runeclaw Bear", 2, 2, Filter.ComparisonScope.Any); - } - @Test public void testHonorOfThePoor2() { addCard(Constants.Zone.BATTLEFIELD, playerA, "Honor of the Pure", 2); diff --git a/Mage.Tests/src/test/java/org/mage/test/serverside/cards/effects/TestActivatedContinuousEffect.java b/Mage.Tests/src/test/java/org/mage/test/serverside/cards/effects/TestActivatedContinuousEffect.java index 630411085e..dc8e213159 100644 --- a/Mage.Tests/src/test/java/org/mage/test/serverside/cards/effects/TestActivatedContinuousEffect.java +++ b/Mage.Tests/src/test/java/org/mage/test/serverside/cards/effects/TestActivatedContinuousEffect.java @@ -18,12 +18,12 @@ public class TestActivatedContinuousEffect extends CardTestPlayerBase { addCard(Constants.Zone.BATTLEFIELD, playerA, "Mountain", 3); addCard(Constants.Zone.BATTLEFIELD, playerA, "Captive Flame"); addCard(Constants.Zone.BATTLEFIELD, playerA, "White Knight"); - + activateAbility(1, Constants.PhaseStep.PRECOMBAT_MAIN, playerA, "{R}:", "White Knight"); - + setStopAt(1, Constants.PhaseStep.BEGIN_COMBAT); execute(); - + assertLife(playerA, 20); assertLife(playerB, 20); assertPermanentCount(playerA, "White Knight", 1); @@ -36,18 +36,18 @@ public class TestActivatedContinuousEffect extends CardTestPlayerBase { addCard(Constants.Zone.BATTLEFIELD, playerA, "Mountain", 3); addCard(Constants.Zone.BATTLEFIELD, playerA, "Captive Flame"); addCard(Constants.Zone.BATTLEFIELD, playerA, "White Knight"); - + activateAbility(1, Constants.PhaseStep.PRECOMBAT_MAIN, playerA, "{R}:", "White Knight"); activateAbility(1, Constants.PhaseStep.PRECOMBAT_MAIN, playerA, "{R}:", "White Knight"); - + setStopAt(1, Constants.PhaseStep.BEGIN_COMBAT); execute(); - + assertLife(playerA, 20); assertLife(playerB, 20); assertPermanentCount(playerA, "White Knight", 1); assertPowerToughness(playerA, "White Knight", 4, 2, Filter.ComparisonScope.Any); } - + } diff --git a/Mage.Updater/pom.xml b/Mage.Updater/pom.xml index 40d5ceac91..468ce0b495 100644 --- a/Mage.Updater/pom.xml +++ b/Mage.Updater/pom.xml @@ -9,9 +9,9 @@ 4.0.0 - org.mage - mage-updater - Mage Updater + org.mage + mage-updater + Mage Updater diff --git a/Mage.Updater/src/main/java/com/magefree/update/Updater.java b/Mage.Updater/src/main/java/com/magefree/update/Updater.java index 45a156012d..2bd10253bb 100644 --- a/Mage.Updater/src/main/java/com/magefree/update/Updater.java +++ b/Mage.Updater/src/main/java/com/magefree/update/Updater.java @@ -51,7 +51,7 @@ public class Updater { // remove odd files List removeList = m.findRemoved(local, remote); m.removeFiles(removeList); - + if (downloadList.isEmpty() && removeList.isEmpty()) { System.out.println("Already up-to-date."); } diff --git a/Mage/pom.xml b/Mage/pom.xml index 5b957d1858..997eb31af6 100644 --- a/Mage/pom.xml +++ b/Mage/pom.xml @@ -1,6 +1,6 @@ + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> 4.0.0 @@ -50,5 +50,5 @@ - + diff --git a/Mage/src/mage/ConditionalMana.java b/Mage/src/mage/ConditionalMana.java index 5b0fb3c57e..7466696128 100644 --- a/Mage/src/mage/ConditionalMana.java +++ b/Mage/src/mage/ConditionalMana.java @@ -44,93 +44,93 @@ import java.util.UUID; */ public class ConditionalMana extends Mana implements Serializable { - /** - * Conditions that should be met (all or any depending on comparison scope) to allow spending {@link Mana} mana. - */ - private List conditions = new ArrayList(); + /** + * Conditions that should be met (all or any depending on comparison scope) to allow spending {@link Mana} mana. + */ + private List conditions = new ArrayList(); - /** - * Text displayed as a description for conditional mana. - * Usually includes the conditions that should be met to use this mana. - */ - protected String staticText = "Conditional mana."; + /** + * Text displayed as a description for conditional mana. + * Usually includes the conditions that should be met to use this mana. + */ + protected String staticText = "Conditional mana."; - /** - * By default all conditions should be met - */ - private Filter.ComparisonScope scope = Filter.ComparisonScope.All; + /** + * By default all conditions should be met + */ + private Filter.ComparisonScope scope = Filter.ComparisonScope.All; /** * UUID of source for mana. */ private UUID manaProducerId; - public ConditionalMana(Mana mana) { - super(mana); - } + public ConditionalMana(Mana mana) { + super(mana); + } - public ConditionalMana(ConditionalMana conditionalMana) { - super(conditionalMana); - conditions = conditionalMana.conditions; - scope = conditionalMana.scope; - staticText = conditionalMana.staticText; - } + public ConditionalMana(ConditionalMana conditionalMana) { + super(conditionalMana); + conditions = conditionalMana.conditions; + scope = conditionalMana.scope; + staticText = conditionalMana.staticText; + } - public void addCondition(Condition condition) { - this.conditions.add(condition); - } + public void addCondition(Condition condition) { + this.conditions.add(condition); + } - public void setComparisonScope(Filter.ComparisonScope scope) { - this.scope = scope; - } + public void setComparisonScope(Filter.ComparisonScope scope) { + this.scope = scope; + } - public boolean apply(Ability ability, Game game, UUID manaProducerId) { - if (conditions.size() == 0) { - throw new IllegalStateException("Conditional mana should contain at least one Condition"); - } - for (Condition condition : conditions) { + public boolean apply(Ability ability, Game game, UUID manaProducerId) { + if (conditions.size() == 0) { + throw new IllegalStateException("Conditional mana should contain at least one Condition"); + } + for (Condition condition : conditions) { boolean applied = (condition instanceof ManaCondition) ? ((ManaCondition)condition).apply(game, ability, manaProducerId) : condition.apply(game, ability); if (!applied) { - // if one condition fails, return false only if All conditions should be met - // otherwise it may happen that Any other condition will be ok - if (scope.equals(Filter.ComparisonScope.All)) { - return false; - } - } else { - // if one condition succeeded, return true only if Any conditions should be met - // otherwise it may happen that any other condition will fail - if (scope.equals(Filter.ComparisonScope.Any)) { - return true; - } - } - } - // we are here - // if All conditions should be met, then it's Ok (return true) - // if Any, then it should have already returned true, so returning false here - return scope.equals(Filter.ComparisonScope.All); - } + // if one condition fails, return false only if All conditions should be met + // otherwise it may happen that Any other condition will be ok + if (scope.equals(Filter.ComparisonScope.All)) { + return false; + } + } else { + // if one condition succeeded, return true only if Any conditions should be met + // otherwise it may happen that any other condition will fail + if (scope.equals(Filter.ComparisonScope.Any)) { + return true; + } + } + } + // we are here + // if All conditions should be met, then it's Ok (return true) + // if Any, then it should have already returned true, so returning false here + return scope.equals(Filter.ComparisonScope.All); + } - @Override - public ConditionalMana copy() { - return new ConditionalMana(this); - } + @Override + public ConditionalMana copy() { + return new ConditionalMana(this); + } - public String getDescription() { - return staticText; - } + public String getDescription() { + return staticText; + } public void removeAll(FilterMana filter) { - if (filter == null) { - return; - } - if (filter.isBlack()) black = 0; - if (filter.isBlue()) blue = 0; - if (filter.isWhite()) white = 0; - if (filter.isGreen()) green = 0; - if (filter.isRed()) red = 0; - if (filter.isColorless()) colorless = 0; + if (filter == null) { + return; + } + if (filter.isBlack()) black = 0; + if (filter.isBlue()) blue = 0; + if (filter.isWhite()) white = 0; + if (filter.isGreen()) green = 0; + if (filter.isRed()) red = 0; + if (filter.isColorless()) colorless = 0; } public UUID getManaProducerId() { diff --git a/Mage/src/mage/Constants.java b/Mage/src/mage/Constants.java index d20efa10c5..e5869bf321 100644 --- a/Mage/src/mage/Constants.java +++ b/Mage/src/mage/Constants.java @@ -29,429 +29,429 @@ package mage; public final class Constants { - - public enum ColoredManaSymbol { - W("W"), U("U"), B("B"), R("R"), G("G"); - private String text; + public enum ColoredManaSymbol { + W("W"), U("U"), B("B"), R("R"), G("G"); - ColoredManaSymbol(String text) { - this.text = text; - } + private String text; - @Override - public String toString() { - return text; - } + ColoredManaSymbol(String text) { + this.text = text; + } - public static ColoredManaSymbol lookup(char c) { - switch (c) { - case 'W': - return W; - case 'R': - return R; - case 'G': - return G; - case 'B': - return B; - case 'U': - return U; - } - return null; - } + @Override + public String toString() { + return text; + } - } + public static ColoredManaSymbol lookup(char c) { + switch (c) { + case 'W': + return W; + case 'R': + return R; + case 'G': + return G; + case 'B': + return B; + case 'U': + return U; + } + return null; + } + + } public enum ManaType { BLACK, BLUE, GREEN, RED, WHITE, COLORLESS } - - public enum CardType { - ARTIFACT ("Artifact"), - CREATURE ("Creature"), - ENCHANTMENT ("Enchantment"), - INSTANT ("Instant"), - LAND ("Land"), - PLANESWALKER ("Planeswalker"), - SORCERY ("Sorcery"), - TRIBAL ("Tribal"); - private String text; + public enum CardType { + ARTIFACT ("Artifact"), + CREATURE ("Creature"), + ENCHANTMENT ("Enchantment"), + INSTANT ("Instant"), + LAND ("Land"), + PLANESWALKER ("Planeswalker"), + SORCERY ("Sorcery"), + TRIBAL ("Tribal"); - CardType(String text) { - this.text = text; - } + private String text; - @Override - public String toString() { - return text; - } - - } + CardType(String text) { + this.text = text; + } - public enum Rarity { + @Override + public String toString() { + return text; + } - NA ("na", "na", "N", 0), - LAND ("Land", "common", "C", 1), - COMMON ("Common", "common", "C", 1), - UNCOMMON ("Uncommon", "uncommon", "U", 2), - RARE ("Rare", "rare", "R", 3), - MYTHIC ("Mythic", "mythic", "M", 3); + } - private String text; - private String symbolCode; - private String code; - private int rating; + public enum Rarity { - Rarity(String text, String symbolCode, String code, int rating) { - this.text = text; - this.symbolCode = symbolCode; - this.code = code; - this.rating = rating; - } + NA ("na", "na", "N", 0), + LAND ("Land", "common", "C", 1), + COMMON ("Common", "common", "C", 1), + UNCOMMON ("Uncommon", "uncommon", "U", 2), + RARE ("Rare", "rare", "R", 3), + MYTHIC ("Mythic", "mythic", "M", 3); - @Override - public String toString() { - return text; - } + private String text; + private String symbolCode; + private String code; + private int rating; - public String getSymbolCode() { - return symbolCode; - } + Rarity(String text, String symbolCode, String code, int rating) { + this.text = text; + this.symbolCode = symbolCode; + this.code = code; + this.rating = rating; + } - public String getCode() { - return code; - } + @Override + public String toString() { + return text; + } - public int getRating() { - return rating; - } - } + public String getSymbolCode() { + return symbolCode; + } - public enum AbilityType { - PLAY_LAND("Play land"), - MANA("Mana"), - SPELL("Spell"), - ACTIVATED("Activated"), - STATIC("Static"), - TRIGGERED("Triggered"), - EVASION("Evasion"), - LOYALTY("Loyalty"), - SPECIAL_ACTION("Special Action"); + public String getCode() { + return code; + } - private String text; + public int getRating() { + return rating; + } + } - AbilityType(String text) { - this.text = text; - } + public enum AbilityType { + PLAY_LAND("Play land"), + MANA("Mana"), + SPELL("Spell"), + ACTIVATED("Activated"), + STATIC("Static"), + TRIGGERED("Triggered"), + EVASION("Evasion"), + LOYALTY("Loyalty"), + SPECIAL_ACTION("Special Action"); - @Override - public String toString() { - return text; - } - } + private String text; - public enum EffectType { + AbilityType(String text) { + this.text = text; + } - ONESHOT("One Shot Effect"), - CONTINUOUS("Continuous Effect"), - REPLACEMENT("Replacement Effect"), - PREVENTION("Prevention Effect"), - REDIRECTION("Redirection Effect"), - ASTHOUGH("As Though Effect"), - RESTRICTION("Restriction Effect"), - REQUIREMENT("Requirement Effect"), - COSTMODIFICATION("Cost Modification Effect"); + @Override + public String toString() { + return text; + } + } - private String text; + public enum EffectType { - EffectType(String text) { - this.text = text; - } + ONESHOT("One Shot Effect"), + CONTINUOUS("Continuous Effect"), + REPLACEMENT("Replacement Effect"), + PREVENTION("Prevention Effect"), + REDIRECTION("Redirection Effect"), + ASTHOUGH("As Though Effect"), + RESTRICTION("Restriction Effect"), + REQUIREMENT("Requirement Effect"), + COSTMODIFICATION("Cost Modification Effect"); - @Override - public String toString() { - return text; - } - } + private String text; - public enum AsThoughEffectType { - BLOCK, - BE_BLOCKED, - ATTACK, - CAST, - TARGET, - PAY, - DAMAGE - } + EffectType(String text) { + this.text = text; + } - public enum Duration { - OneUse(""), - EndOfGame("for the rest of the game"), - WhileOnBattlefield(""), - WhileOnStack(""), + @Override + public String toString() { + return text; + } + } + + public enum AsThoughEffectType { + BLOCK, + BE_BLOCKED, + ATTACK, + CAST, + TARGET, + PAY, + DAMAGE + } + + public enum Duration { + OneUse(""), + EndOfGame("for the rest of the game"), + WhileOnBattlefield(""), + WhileOnStack(""), WhileInGraveyard(""), - EndOfTurn("until end of turn"), - EndOfCombat("until end of combat"), - Custom(""); + EndOfTurn("until end of turn"), + EndOfCombat("until end of combat"), + Custom(""); - private String text; + private String text; - Duration(String text) { - this.text = text; - } + Duration(String text) { + this.text = text; + } - @Override - public String toString() { - return text; - } + @Override + public String toString() { + return text; + } - } + } - public enum Layer { - CopyEffects_1, - ControlChangingEffects_2, - TextChangingEffects_3, - TypeChangingEffects_4, - ColorChangingEffects_5, - AbilityAddingRemovingEffects_6, - PTChangingEffects_7, - PlayerEffects, - RulesEffects - } + public enum Layer { + CopyEffects_1, + ControlChangingEffects_2, + TextChangingEffects_3, + TypeChangingEffects_4, + ColorChangingEffects_5, + AbilityAddingRemovingEffects_6, + PTChangingEffects_7, + PlayerEffects, + RulesEffects + } - public enum SubLayer { - CharacteristicDefining_7a, - SetPT_7b, - ModifyPT_7c, - Counters_7d, - SwitchPT_e, - NA - } + public enum SubLayer { + CharacteristicDefining_7a, + SetPT_7b, + ModifyPT_7c, + Counters_7d, + SwitchPT_e, + NA + } - public enum TableState { - WAITING ("Waiting for players"), - STARTING ("Waiting to start"), - DRAFTING ("Drafting"), - DUELING ("Dueling"), - SIDEBOARDING ("Sideboarding"), - CONSTRUCTING ("Constructing"), - FINISHED ("Finished"); + public enum TableState { + WAITING ("Waiting for players"), + STARTING ("Waiting to start"), + DRAFTING ("Drafting"), + DUELING ("Dueling"), + SIDEBOARDING ("Sideboarding"), + CONSTRUCTING ("Constructing"), + FINISHED ("Finished"); - private String text; + private String text; - TableState(String text) { - this.text = text; - } + TableState(String text) { + this.text = text; + } - @Override - public String toString() { - return text; - } + @Override + public String toString() { + return text; + } - } + } - public enum TurnPhase { - BEGINNING ("Beginning"), - PRECOMBAT_MAIN ("Precombat Main"), - COMBAT ("Combat"), - POSTCOMBAT_MAIN ("Postcombat Main"), - END ("End"); + public enum TurnPhase { + BEGINNING ("Beginning"), + PRECOMBAT_MAIN ("Precombat Main"), + COMBAT ("Combat"), + POSTCOMBAT_MAIN ("Postcombat Main"), + END ("End"); - private String text; + private String text; - TurnPhase(String text) { - this.text = text; - } + TurnPhase(String text) { + this.text = text; + } - @Override - public String toString() { - return text; - } + @Override + public String toString() { + return text; + } - } + } - public enum PhaseStep { - UNTAP ("Untap", 0), - UPKEEP ("Upkeep", 1), - DRAW ("Draw", 2), - PRECOMBAT_MAIN ("Precombat Main", 3), - BEGIN_COMBAT ("Begin Combat", 4), - DECLARE_ATTACKERS ("Declare Attackers", 5), - DECLARE_BLOCKERS ("Declare Blockers", 6), - FIRST_COMBAT_DAMAGE ("First Combat Damage", 7), - COMBAT_DAMAGE ("Combat Damage", 8), - END_COMBAT ("End Combat", 9), - POSTCOMBAT_MAIN ("Postcombat Main", 10), - END_TURN ("End Turn", 11), - CLEANUP ("Cleanup", 12); + public enum PhaseStep { + UNTAP ("Untap", 0), + UPKEEP ("Upkeep", 1), + DRAW ("Draw", 2), + PRECOMBAT_MAIN ("Precombat Main", 3), + BEGIN_COMBAT ("Begin Combat", 4), + DECLARE_ATTACKERS ("Declare Attackers", 5), + DECLARE_BLOCKERS ("Declare Blockers", 6), + FIRST_COMBAT_DAMAGE ("First Combat Damage", 7), + COMBAT_DAMAGE ("Combat Damage", 8), + END_COMBAT ("End Combat", 9), + POSTCOMBAT_MAIN ("Postcombat Main", 10), + END_TURN ("End Turn", 11), + CLEANUP ("Cleanup", 12); - private String text; + private String text; /** * Index is used for game state scoring system. */ private int index; - PhaseStep(String text, int index) { - this.text = text; + PhaseStep(String text, int index) { + this.text = text; this.index = index; - } + } public int getIndex() { return index; } - @Override - public String toString() { - return text; - } + @Override + public String toString() { + return text; + } - } + } - public enum Outcome { - Damage(false), - DestroyPermanent(false), - BoostCreature(true), - UnboostCreature(false), - AddAbility(true), - LoseAbility(false), - GainLife(true), - LoseLife(false), + public enum Outcome { + Damage(false), + DestroyPermanent(false), + BoostCreature(true), + UnboostCreature(false), + AddAbility(true), + LoseAbility(false), + GainLife(true), + LoseLife(false), ExtraTurn(true), - BecomeCreature(true), - PutCreatureInPlay(true), - PutCardInPlay(true), - PutLandInPlay(true), - GainControl(false), - DrawCard(true), - Discard(false), - Sacrifice(false), - PlayForFree(true), - ReturnToHand(false), - Exile(false), - Protect(true), - PutManaInPool(true), - Regenerate(true), - PreventDamage(true), - RedirectDamage(true), - Tap(false), - Transform(true), - Untap(true), - Win(true), - Copy(true, true), - Benefit(true), - Detriment(false), - Neutral(true), - Removal(true); + BecomeCreature(true), + PutCreatureInPlay(true), + PutCardInPlay(true), + PutLandInPlay(true), + GainControl(false), + DrawCard(true), + Discard(false), + Sacrifice(false), + PlayForFree(true), + ReturnToHand(false), + Exile(false), + Protect(true), + PutManaInPool(true), + Regenerate(true), + PreventDamage(true), + RedirectDamage(true), + Tap(false), + Transform(true), + Untap(true), + Win(true), + Copy(true, true), + Benefit(true), + Detriment(false), + Neutral(true), + Removal(true); - private boolean good; + private boolean good; private boolean canTargetAll; - Outcome(boolean good) { - this.good = good; - } + Outcome(boolean good) { + this.good = good; + } Outcome(boolean good, boolean canTargetAll) { - this.good = good; + this.good = good; this.canTargetAll = canTargetAll; - } + } - public boolean isGood() { - return good; - } + public boolean isGood() { + return good; + } public boolean isCanTargetAll() { return canTargetAll; } } - public enum Zone { - HAND, GRAVEYARD, LIBRARY, BATTLEFIELD, STACK, EXILED, ALL, OUTSIDE, PICK, COMMAND; - - public boolean match(Zone zone) { - return (this == zone || this == ALL || zone == ALL); - } - } + public enum Zone { + HAND, GRAVEYARD, LIBRARY, BATTLEFIELD, STACK, EXILED, ALL, OUTSIDE, PICK, COMMAND; - public enum TimingRule { - INSTANT, SORCERY - } + public boolean match(Zone zone) { + return (this == zone || this == ALL || zone == ALL); + } + } - public enum TargetController { - ANY, YOU, NOT_YOU, OPPONENT - } + public enum TimingRule { + INSTANT, SORCERY + } - public enum RangeOfInfluence { - ONE(1), - TWO(2), - ALL(0); + public enum TargetController { + ANY, YOU, NOT_YOU, OPPONENT + } - private int range; + public enum RangeOfInfluence { + ONE(1), + TWO(2), + ALL(0); - RangeOfInfluence(int range) { - this.range = range; - } + private int range; - public int getRange() { - return range; - } - } + RangeOfInfluence(int range) { + this.range = range; + } - public enum MultiplayerAttackOption { - MULTIPLE("Attack Multiple Players"), - LEFT("Attack Left"), - RIGHT("Attack Right"); + public int getRange() { + return range; + } + } - private String text; + public enum MultiplayerAttackOption { + MULTIPLE("Attack Multiple Players"), + LEFT("Attack Left"), + RIGHT("Attack Right"); - MultiplayerAttackOption(String text) { - this.text = text; - } + private String text; - @Override - public String toString() { - return text; - } - } + MultiplayerAttackOption(String text) { + this.text = text; + } - public enum SetType { - CORE("Core"), - EXPANSION("Expansion"), - REPRINT("Reprint"); + @Override + public String toString() { + return text; + } + } - private String text; + public enum SetType { + CORE("Core"), + EXPANSION("Expansion"), + REPRINT("Reprint"); - SetType(String text) { - this.text = text; - } + private String text; - @Override - public String toString() { - return text; - } - } + SetType(String text) { + this.text = text; + } + + @Override + public String toString() { + return text; + } + } public enum AttachmentType { EQUIPMENT, AURA } - + public enum WatcherScope { GAME, PLAYER, CARD } -/* public static final List PlaneswalkerTypes = new ArrayList() - {{add("Ajani"); add("Bolas"); add("Chandra"); add("Elspeth"); - add("Garruk"); add("Jace"); add("Liliana"); add("Nissa"); - add("Sarkhan"); add("Sorin"); add("Tezzeret"); add("Karn"); - add("Venser"); add("Gideon"); add("Koth");}}; +/* public static final List PlaneswalkerTypes = new ArrayList() + {{add("Ajani"); add("Bolas"); add("Chandra"); add("Elspeth"); + add("Garruk"); add("Jace"); add("Liliana"); add("Nissa"); + add("Sarkhan"); add("Sorin"); add("Tezzeret"); add("Karn"); + add("Venser"); add("Gideon"); add("Koth");}}; */ - private Constants() { - throw new AssertionError(); - } - + private Constants() { + throw new AssertionError(); + } + } diff --git a/Mage/src/mage/MageException.java b/Mage/src/mage/MageException.java index 8e76bee88c..8b26585fe7 100644 --- a/Mage/src/mage/MageException.java +++ b/Mage/src/mage/MageException.java @@ -35,13 +35,13 @@ package mage; */ public class MageException extends Exception { - private static final long serialVersionUID = 8340806803178193696L; + private static final long serialVersionUID = 8340806803178193696L; - public MageException(String message) { - super(message); - } + public MageException(String message) { + super(message); + } - public MageException(Throwable t) { - super(t); - } + public MageException(Throwable t) { + super(t); + } } diff --git a/Mage/src/mage/MageInt.java b/Mage/src/mage/MageInt.java index 6ca567d565..52e706ce25 100644 --- a/Mage/src/mage/MageInt.java +++ b/Mage/src/mage/MageInt.java @@ -33,56 +33,56 @@ import mage.util.Copyable; public class MageInt implements Serializable, Copyable { - public static MageInt EmptyMageInt = new MageInt(Integer.MIN_VALUE, null) { + public static MageInt EmptyMageInt = new MageInt(Integer.MIN_VALUE, null) { private static final String exceptionMessage = "MageInt.EmptyMageInt can't be modified."; - @Override - public void boostValue(int amount) { - throw new RuntimeException(exceptionMessage); - } + @Override + public void boostValue(int amount) { + throw new RuntimeException(exceptionMessage); + } - @Override - public void setValue(int value) { - throw new RuntimeException(exceptionMessage); - } - }; + @Override + public void setValue(int value) { + throw new RuntimeException(exceptionMessage); + } + }; - protected int baseValue; - protected String cardValue = ""; - - public MageInt(int value) { - this.baseValue = value; - this.cardValue = Integer.toString(value); - } + protected int baseValue; + protected String cardValue = ""; - public MageInt(int baseValue, String cardValue) { - this.baseValue = baseValue; - this.cardValue = cardValue; - } + public MageInt(int value) { + this.baseValue = value; + this.cardValue = Integer.toString(value); + } - @Override - public MageInt copy() { - if (this == EmptyMageInt) - return this; - return new MageInt(baseValue, cardValue); - } - - public int getValue() { - return baseValue; - } - - public void setValue(int value) { - this.baseValue = value; - } - - public void boostValue(int amount) { - this.baseValue += amount; - } + public MageInt(int baseValue, String cardValue) { + this.baseValue = baseValue; + this.cardValue = cardValue; + } - @Override - public String toString() { - return cardValue; - } + @Override + public MageInt copy() { + if (this == EmptyMageInt) + return this; + return new MageInt(baseValue, cardValue); + } + + public int getValue() { + return baseValue; + } + + public void setValue(int value) { + this.baseValue = value; + } + + public void boostValue(int amount) { + this.baseValue += amount; + } + + @Override + public String toString() { + return cardValue; + } } diff --git a/Mage/src/mage/MageItem.java b/Mage/src/mage/MageItem.java index 16790e2375..4c1a9e3b96 100644 --- a/Mage/src/mage/MageItem.java +++ b/Mage/src/mage/MageItem.java @@ -37,6 +37,6 @@ import java.util.UUID; */ public interface MageItem extends Serializable { - public UUID getId(); + public UUID getId(); } diff --git a/Mage/src/mage/MageObject.java b/Mage/src/mage/MageObject.java index 5cb28fbd76..1738f40be3 100644 --- a/Mage/src/mage/MageObject.java +++ b/Mage/src/mage/MageObject.java @@ -12,24 +12,24 @@ import java.util.List; public interface MageObject extends MageItem, Serializable { - public String getName(); - public void setName(String name); + public String getName(); + public void setName(String name); - public List getCardType(); - public List getSubtype(); - public boolean hasSubtype(String subtype); - public List getSupertype(); + public List getCardType(); + public List getSubtype(); + public boolean hasSubtype(String subtype); + public List getSupertype(); - public Abilities getAbilities(); - public ObjectColor getColor(); - public ManaCosts getManaCost(); - - public MageInt getPower(); - public MageInt getToughness(); + public Abilities getAbilities(); + public ObjectColor getColor(); + public ManaCosts getManaCost(); - public void adjustCosts(Ability ability, Game game); + public MageInt getPower(); + public MageInt getToughness(); - public MageObject copy(); + public void adjustCosts(Ability ability, Game game); + + public MageObject copy(); /** * Defines that MageObject is a copy of another object diff --git a/Mage/src/mage/MageObjectImpl.java b/Mage/src/mage/MageObjectImpl.java index 34304c28df..1ca2bcadc5 100644 --- a/Mage/src/mage/MageObjectImpl.java +++ b/Mage/src/mage/MageObjectImpl.java @@ -44,128 +44,128 @@ import java.util.UUID; public abstract class MageObjectImpl> implements MageObject { - protected UUID objectId; - - protected String name; - protected ManaCosts manaCost; - protected ObjectColor color; - protected List cardType = new ArrayList(); - protected List subtype = new ArrayList(); - protected List supertype = new ArrayList(); - protected Abilities abilities; - protected String text; - protected MageInt power; - protected MageInt toughness; + protected UUID objectId; + + protected String name; + protected ManaCosts manaCost; + protected ObjectColor color; + protected List cardType = new ArrayList(); + protected List subtype = new ArrayList(); + protected List supertype = new ArrayList(); + protected Abilities abilities; + protected String text; + protected MageInt power; + protected MageInt toughness; protected boolean copy; - - @Override - public abstract T copy(); - public MageObjectImpl() { - this(UUID.randomUUID()); - } + @Override + public abstract T copy(); - public MageObjectImpl(UUID id) { - objectId = id; - power = new MageInt(0); - toughness = new MageInt(0); - color = new ObjectColor(); - manaCost = new ManaCostsImpl(""); - abilities = new AbilitiesImpl(); - } + public MageObjectImpl() { + this(UUID.randomUUID()); + } - public MageObjectImpl(final MageObjectImpl object) { - objectId = object.objectId; - name = object.name; - manaCost = object.manaCost.copy(); - text = object.text; - color = object.color.copy(); - power = object.power.copy(); - toughness = object.toughness.copy(); - abilities = object.abilities.copy(); + public MageObjectImpl(UUID id) { + objectId = id; + power = new MageInt(0); + toughness = new MageInt(0); + color = new ObjectColor(); + manaCost = new ManaCostsImpl(""); + abilities = new AbilitiesImpl(); + } + + public MageObjectImpl(final MageObjectImpl object) { + objectId = object.objectId; + name = object.name; + manaCost = object.manaCost.copy(); + text = object.text; + color = object.color.copy(); + power = object.power.copy(); + toughness = object.toughness.copy(); + abilities = object.abilities.copy(); this.cardType.addAll(object.cardType); this.subtype.addAll(object.subtype); this.supertype.addAll(object.supertype); - } + } - @Override - public UUID getId() { - return objectId; - } + @Override + public UUID getId() { + return objectId; + } - @Override - public String getName() { - return name; - } + @Override + public String getName() { + return name; + } - @Override - public void setName(String name) { - this.name = name; - } + @Override + public void setName(String name) { + this.name = name; + } - @Override - public List getCardType() { - return cardType; - } + @Override + public List getCardType() { + return cardType; + } - @Override - public List getSubtype(){ - return subtype; - } - - @Override - public List getSupertype(){ - return supertype; - } + @Override + public List getSubtype(){ + return subtype; + } - @Override - public Abilities getAbilities(){ - return abilities; - } + @Override + public List getSupertype(){ + return supertype; + } - @Override - public MageInt getPower() { - return power; - } + @Override + public Abilities getAbilities(){ + return abilities; + } - @Override - public MageInt getToughness() { - return toughness; - } + @Override + public MageInt getPower() { + return power; + } - @Override - public ObjectColor getColor() { - return color; - } + @Override + public MageInt getToughness() { + return toughness; + } - @Override - public ManaCosts getManaCost() { - return manaCost; - } + @Override + public ObjectColor getColor() { + return color; + } - @Override - public void adjustCosts(Ability ability, Game game) {} + @Override + public ManaCosts getManaCost() { + return manaCost; + } - @Override - public boolean hasSubtype(String value) { - if (value == null) { - return false; - } - if (this.subtype.contains(value)) { - return true; - } - else { // checking for Changeling - // first make sure input parameter is not creature type - // if so, then ChangelingAbility doesn't matter - if (value.equals("Mountain") || value.equals("Island") || value.equals("Plains") - || value.equals("Forest") || value.equals("Swamp") || value.equals("Aura") - || value.equals("Equipment") || value.equals("Fortification") || value.equals("Shrine")) { - return false; - } - // as it is creature subtype, then check the existence of Changeling - return abilities.contains(ChangelingAbility.getInstance()); - } - } + @Override + public void adjustCosts(Ability ability, Game game) {} + + @Override + public boolean hasSubtype(String value) { + if (value == null) { + return false; + } + if (this.subtype.contains(value)) { + return true; + } + else { // checking for Changeling + // first make sure input parameter is not creature type + // if so, then ChangelingAbility doesn't matter + if (value.equals("Mountain") || value.equals("Island") || value.equals("Plains") + || value.equals("Forest") || value.equals("Swamp") || value.equals("Aura") + || value.equals("Equipment") || value.equals("Fortification") || value.equals("Shrine")) { + return false; + } + // as it is creature subtype, then check the existence of Changeling + return abilities.contains(ChangelingAbility.getInstance()); + } + } @Override public void setCopy(boolean isCopy) { diff --git a/Mage/src/mage/MageObjectsImpl.java b/Mage/src/mage/MageObjectsImpl.java index 0baa5487bd..a619f72e30 100644 --- a/Mage/src/mage/MageObjectsImpl.java +++ b/Mage/src/mage/MageObjectsImpl.java @@ -37,10 +37,10 @@ import java.util.UUID; */ public class MageObjectsImpl extends LinkedHashMap implements MageObjects { - @Override - public MageObjects copy() { - throw new UnsupportedOperationException("Not supported yet."); - } + @Override + public MageObjects copy() { + throw new UnsupportedOperationException("Not supported yet."); + } } diff --git a/Mage/src/mage/Mana.java b/Mage/src/mage/Mana.java index 5ed9cc0004..d7216812d6 100644 --- a/Mage/src/mage/Mana.java +++ b/Mage/src/mage/Mana.java @@ -41,385 +41,385 @@ import java.io.Serializable; */ public class Mana implements Comparable, Serializable, Copyable { - protected int red; - protected int green; - protected int blue; - protected int white; - protected int black; - protected int colorless; - protected int any; + protected int red; + protected int green; + protected int blue; + protected int white; + protected int black; + protected int colorless; + protected int any; - public static final Mana RedMana = RedMana(1); - public static final Mana GreenMana = GreenMana(1); - public static final Mana BlueMana = BlueMana(1); - public static final Mana WhiteMana = WhiteMana(1); - public static final Mana BlackMana = BlackMana(1); - public static final Mana ColorlessMana = ColorlessMana(1); + public static final Mana RedMana = RedMana(1); + public static final Mana GreenMana = GreenMana(1); + public static final Mana BlueMana = BlueMana(1); + public static final Mana WhiteMana = WhiteMana(1); + public static final Mana BlackMana = BlackMana(1); + public static final Mana ColorlessMana = ColorlessMana(1); - public Mana() {} + public Mana() {} - public Mana(final Mana mana) { - red = mana.red; - green = mana.green; - blue = mana.blue; - white = mana.white; - black = mana.black; - colorless = mana.colorless; - any = mana.any; - } + public Mana(final Mana mana) { + red = mana.red; + green = mana.green; + blue = mana.blue; + white = mana.white; + black = mana.black; + colorless = mana.colorless; + any = mana.any; + } - public Mana(ColoredManaSymbol color) { - switch (color) { - case G: - green = 1; - break; - case R: - red = 1; - break; - case B: - black = 1; - break; - case U: - blue = 1; - break; - case W: - white = 1; - break; - } - } + public Mana(ColoredManaSymbol color) { + switch (color) { + case G: + green = 1; + break; + case R: + red = 1; + break; + case B: + black = 1; + break; + case U: + blue = 1; + break; + case W: + white = 1; + break; + } + } - public static Mana RedMana(int num) { - return new Mana(num, 0, 0, 0, 0, 0, 0); - } + public static Mana RedMana(int num) { + return new Mana(num, 0, 0, 0, 0, 0, 0); + } - public static Mana GreenMana(int num) { - return new Mana(0, num, 0, 0, 0, 0, 0); - } + public static Mana GreenMana(int num) { + return new Mana(0, num, 0, 0, 0, 0, 0); + } - public static Mana BlueMana(int num) { - return new Mana(0, 0, num, 0, 0, 0, 0); - } + public static Mana BlueMana(int num) { + return new Mana(0, 0, num, 0, 0, 0, 0); + } - public static Mana WhiteMana(int num) { - return new Mana(0, 0, 0, num, 0, 0, 0); - } + public static Mana WhiteMana(int num) { + return new Mana(0, 0, 0, num, 0, 0, 0); + } - public static Mana BlackMana(int num) { - return new Mana(0, 0, 0, 0, num, 0, 0); - } + public static Mana BlackMana(int num) { + return new Mana(0, 0, 0, 0, num, 0, 0); + } - public static Mana ColorlessMana(int num) { - return new Mana(0, 0, 0, 0, 0, num, 0); - } + public static Mana ColorlessMana(int num) { + return new Mana(0, 0, 0, 0, 0, num, 0); + } - public Mana(int red, int green, int blue, int white, int black, int colorless, int any) { - this.red = red; - this.green = green; - this.blue = blue; - this.white = white; - this.black = black; - this.colorless = colorless; - this.any = any; - } + public Mana(int red, int green, int blue, int white, int black, int colorless, int any) { + this.red = red; + this.green = green; + this.blue = blue; + this.white = white; + this.black = black; + this.colorless = colorless; + this.any = any; + } - public void add(Mana mana) { - red += mana.getRed(); - green += mana.getGreen(); - blue += mana.getBlue(); - white += mana.getWhite(); - black += mana.getBlack(); - colorless += mana.getColorless(); - any += mana.getAny(); - } + public void add(Mana mana) { + red += mana.getRed(); + green += mana.getGreen(); + blue += mana.getBlue(); + white += mana.getWhite(); + black += mana.getBlack(); + colorless += mana.getColorless(); + any += mana.getAny(); + } - public void addRed() { - red++; - } + public void addRed() { + red++; + } - public void addGreen() { - green++; - } + public void addGreen() { + green++; + } - public void addBlue() { - blue++; - } + public void addBlue() { + blue++; + } - public void addWhite() { - white++; - } + public void addWhite() { + white++; + } - public void addBlack() { - black++; - } + public void addBlack() { + black++; + } - public void addColorless() { - colorless++; - } + public void addColorless() { + colorless++; + } - public void subtract(Mana mana) { - red -= mana.getRed(); - green -= mana.getGreen(); - blue -= mana.getBlue(); - white -= mana.getWhite(); - black -= mana.getBlack(); - colorless -= mana.getColorless(); - any -= mana.getAny(); - } + public void subtract(Mana mana) { + red -= mana.getRed(); + green -= mana.getGreen(); + blue -= mana.getBlue(); + white -= mana.getWhite(); + black -= mana.getBlack(); + colorless -= mana.getColorless(); + any -= mana.getAny(); + } - public int count() { - return red + green + blue + white + black + colorless + any; - } + public int count() { + return red + green + blue + white + black + colorless + any; + } - public int count(FilterMana filter) { - if (filter == null) { - return count(); - } - int count = 0; - if (filter.isBlack()) count += black; - if (filter.isBlue()) count += blue; - if (filter.isWhite()) count += white; - if (filter.isGreen()) count += green; - if (filter.isRed()) count += red; - if (filter.isColorless()) count += colorless; - return count; - } + public int count(FilterMana filter) { + if (filter == null) { + return count(); + } + int count = 0; + if (filter.isBlack()) count += black; + if (filter.isBlue()) count += blue; + if (filter.isWhite()) count += white; + if (filter.isGreen()) count += green; + if (filter.isRed()) count += red; + if (filter.isColorless()) count += colorless; + return count; + } - public void clear() { - red = 0; - green = 0; - blue = 0; - white = 0; - black = 0; - colorless = 0; - any = 0; - } + public void clear() { + red = 0; + green = 0; + blue = 0; + white = 0; + black = 0; + colorless = 0; + any = 0; + } - @Override - public String toString() { - StringBuilder sbMana = new StringBuilder(); + @Override + public String toString() { + StringBuilder sbMana = new StringBuilder(); - for (int i = 0; i < red; i++) - sbMana.append("{R}"); - for (int i = 0; i < green; i++) - sbMana.append("{G}"); - for (int i = 0; i < blue; i++) - sbMana.append("{U}"); - for (int i = 0; i < black; i++) - sbMana.append("{B}"); - for (int i = 0; i < white; i++) - sbMana.append("{W}"); + for (int i = 0; i < red; i++) + sbMana.append("{R}"); + for (int i = 0; i < green; i++) + sbMana.append("{G}"); + for (int i = 0; i < blue; i++) + sbMana.append("{U}"); + for (int i = 0; i < black; i++) + sbMana.append("{B}"); + for (int i = 0; i < white; i++) + sbMana.append("{W}"); for (int i = 0; i < any; i++) sbMana.append("{Any}"); - if (colorless > 0) { - sbMana.append("{").append(Integer.toString(colorless)).append("}"); - } - return sbMana.toString(); - } + if (colorless > 0) { + sbMana.append("{").append(Integer.toString(colorless)).append("}"); + } + return sbMana.toString(); + } - @Override - public Mana copy() { - return new Mana(this); - } + @Override + public Mana copy() { + return new Mana(this); + } - public boolean enough(Mana avail) { - Mana compare = avail.copy(); - compare.subtract(this); - if (compare.getRed() < 0) { - compare.setAny(compare.getAny() + compare.getRed()); - if (compare.getAny() < 0) - return false; - compare.setRed(0); - } - if (compare.getGreen() < 0) { - compare.setAny(compare.getAny() + compare.getGreen()); - if (compare.getAny() < 0) - return false; - compare.setGreen(0); - } - if (compare.getBlue() < 0) { - compare.setAny(compare.getAny() + compare.getBlue()); - if (compare.getAny() < 0) - return false; - compare.setBlue(0); - } - if (compare.getBlack() < 0) { - compare.setAny(compare.getAny() + compare.getBlack()); - if (compare.getAny() < 0) - return false; - compare.setBlack(0); - } - if (compare.getWhite() < 0) { - compare.setAny(compare.getAny() + compare.getWhite()); - if (compare.getAny() < 0) - return false; - compare.setWhite(0); - } - if (compare.getColorless() < 0) { - int remaining = compare.getRed() + compare.getGreen() + compare.getBlack() + compare.getBlue() + compare.getWhite() + compare.getAny(); - if (compare.getColorless() + remaining < 0) - return false; - } - return true; - } + public boolean enough(Mana avail) { + Mana compare = avail.copy(); + compare.subtract(this); + if (compare.getRed() < 0) { + compare.setAny(compare.getAny() + compare.getRed()); + if (compare.getAny() < 0) + return false; + compare.setRed(0); + } + if (compare.getGreen() < 0) { + compare.setAny(compare.getAny() + compare.getGreen()); + if (compare.getAny() < 0) + return false; + compare.setGreen(0); + } + if (compare.getBlue() < 0) { + compare.setAny(compare.getAny() + compare.getBlue()); + if (compare.getAny() < 0) + return false; + compare.setBlue(0); + } + if (compare.getBlack() < 0) { + compare.setAny(compare.getAny() + compare.getBlack()); + if (compare.getAny() < 0) + return false; + compare.setBlack(0); + } + if (compare.getWhite() < 0) { + compare.setAny(compare.getAny() + compare.getWhite()); + if (compare.getAny() < 0) + return false; + compare.setWhite(0); + } + if (compare.getColorless() < 0) { + int remaining = compare.getRed() + compare.getGreen() + compare.getBlack() + compare.getBlue() + compare.getWhite() + compare.getAny(); + if (compare.getColorless() + remaining < 0) + return false; + } + return true; + } - public Mana needed(Mana avail) { - Mana compare = avail.copy(); - compare.subtract(this); - if (compare.getRed() < 0 && compare.getAny() > 0) { - int diff = Math.min( compare.getAny(), Math.abs(compare.getRed())); - compare.setAny(compare.getAny() - diff); - compare.setRed(compare.getRed() + diff); - } - if (compare.getGreen() < 0 && compare.getAny() > 0) { - int diff = Math.min( compare.getAny(), Math.abs(compare.getGreen())); - compare.setAny(compare.getAny() - diff); - compare.setGreen(compare.getGreen() + diff); - } - if (compare.getBlue() < 0 && compare.getAny() > 0) { - int diff = Math.min( compare.getAny(), Math.abs(compare.getBlue())); - compare.setAny(compare.getAny() - diff); - compare.setBlue(compare.getBlue() + diff); - } - if (compare.getBlack() < 0 && compare.getAny() > 0) { - int diff = Math.min( compare.getAny(), Math.abs(compare.getBlack())); - compare.setAny(compare.getAny() - diff); - compare.setBlack(compare.getBlack() + diff); - } - if (compare.getWhite() < 0 && compare.getAny() > 0) { - int diff = Math.min( compare.getAny(), Math.abs(compare.getWhite())); - compare.setAny(compare.getAny() - diff); - compare.setWhite(compare.getWhite() + diff); - } - if (compare.getColorless() < 0) { - int remaining = 0; - remaining += Math.min(0,compare.getRed()); - remaining += Math.min(0,compare.getWhite()); - remaining += Math.min(0,compare.getGreen()); - remaining += Math.min(0,compare.getBlack()); - remaining += Math.min(0,compare.getBlue()); - remaining += Math.min(0,compare.getAny()); - if (remaining > 0) { - int diff = Math.min(remaining, Math.abs(compare.getColorless())); - compare.setColorless(compare.getColorless() + diff); - } - } - Mana needed = new Mana(); - if (compare.getRed() < 0) - needed.setRed(Math.abs(compare.getRed())); - if (compare.getWhite() < 0) - needed.setWhite(Math.abs(compare.getWhite())); - if (compare.getGreen() < 0) - needed.setGreen(Math.abs(compare.getGreen())); - if (compare.getBlack() < 0) - needed.setBlack(Math.abs(compare.getBlack())); - if (compare.getBlue() < 0) - needed.setBlue(Math.abs(compare.getBlue())); - if (compare.getColorless() < 0) - needed.setColorless(Math.abs(compare.getColorless())); - return needed; - } + public Mana needed(Mana avail) { + Mana compare = avail.copy(); + compare.subtract(this); + if (compare.getRed() < 0 && compare.getAny() > 0) { + int diff = Math.min( compare.getAny(), Math.abs(compare.getRed())); + compare.setAny(compare.getAny() - diff); + compare.setRed(compare.getRed() + diff); + } + if (compare.getGreen() < 0 && compare.getAny() > 0) { + int diff = Math.min( compare.getAny(), Math.abs(compare.getGreen())); + compare.setAny(compare.getAny() - diff); + compare.setGreen(compare.getGreen() + diff); + } + if (compare.getBlue() < 0 && compare.getAny() > 0) { + int diff = Math.min( compare.getAny(), Math.abs(compare.getBlue())); + compare.setAny(compare.getAny() - diff); + compare.setBlue(compare.getBlue() + diff); + } + if (compare.getBlack() < 0 && compare.getAny() > 0) { + int diff = Math.min( compare.getAny(), Math.abs(compare.getBlack())); + compare.setAny(compare.getAny() - diff); + compare.setBlack(compare.getBlack() + diff); + } + if (compare.getWhite() < 0 && compare.getAny() > 0) { + int diff = Math.min( compare.getAny(), Math.abs(compare.getWhite())); + compare.setAny(compare.getAny() - diff); + compare.setWhite(compare.getWhite() + diff); + } + if (compare.getColorless() < 0) { + int remaining = 0; + remaining += Math.min(0,compare.getRed()); + remaining += Math.min(0,compare.getWhite()); + remaining += Math.min(0,compare.getGreen()); + remaining += Math.min(0,compare.getBlack()); + remaining += Math.min(0,compare.getBlue()); + remaining += Math.min(0,compare.getAny()); + if (remaining > 0) { + int diff = Math.min(remaining, Math.abs(compare.getColorless())); + compare.setColorless(compare.getColorless() + diff); + } + } + Mana needed = new Mana(); + if (compare.getRed() < 0) + needed.setRed(Math.abs(compare.getRed())); + if (compare.getWhite() < 0) + needed.setWhite(Math.abs(compare.getWhite())); + if (compare.getGreen() < 0) + needed.setGreen(Math.abs(compare.getGreen())); + if (compare.getBlack() < 0) + needed.setBlack(Math.abs(compare.getBlack())); + if (compare.getBlue() < 0) + needed.setBlue(Math.abs(compare.getBlue())); + if (compare.getColorless() < 0) + needed.setColorless(Math.abs(compare.getColorless())); + return needed; + } - public int getRed() { - return red; - } + public int getRed() { + return red; + } - public void setRed(int red) { - this.red = red; - } + public void setRed(int red) { + this.red = red; + } - public int getGreen() { - return green; - } + public int getGreen() { + return green; + } - public void setGreen(int green) { - this.green = green; - } + public void setGreen(int green) { + this.green = green; + } - public int getBlue() { - return blue; - } + public int getBlue() { + return blue; + } - public void setBlue(int blue) { - this.blue = blue; - } + public void setBlue(int blue) { + this.blue = blue; + } - public int getWhite() { - return white; - } + public int getWhite() { + return white; + } - public void setWhite(int white) { - this.white = white; - } + public void setWhite(int white) { + this.white = white; + } - public int getBlack() { - return black; - } + public int getBlack() { + return black; + } - public void setBlack(int black) { - this.black = black; - } + public void setBlack(int black) { + this.black = black; + } - public int getColorless() { - return colorless; - } + public int getColorless() { + return colorless; + } - public void setColorless(int colorless) { - this.colorless = colorless; - } + public void setColorless(int colorless) { + this.colorless = colorless; + } - public int getAny() { - return any; - } + public int getAny() { + return any; + } - public void setAny(int any) { - this.any = any; - } + public void setAny(int any) { + this.any = any; + } - @Override - public int compareTo(Mana o) { - return this.count() - o.count(); - } + @Override + public int compareTo(Mana o) { + return this.count() - o.count(); + } - /** - * - * @param mana - * @return true if this contains any values that mana has - */ - public boolean contains(Mana mana) { - if (mana.black > 0 && this.black > 0) - return true; - if (mana.blue > 0 && this.blue > 0) - return true; - if (mana.red > 0 && this.red > 0) - return true; - if (mana.white > 0 && this.white > 0) - return true; - if (mana.green > 0 && this.green > 0) - return true; - if (mana.colorless > 0 && this.count() > 0) - return true; - - return false; - } - - public int getColor(ColoredManaSymbol color) { - if (color.equals(ColoredManaSymbol.G)) { - return getGreen(); - } - if (color.equals(ColoredManaSymbol.R)) { - return getRed(); - } - if (color.equals(ColoredManaSymbol.B)) { - return getBlack(); - } - if (color.equals(ColoredManaSymbol.U)) { - return getBlue(); - } - if (color.equals(ColoredManaSymbol.W)) { - return getWhite(); - } - return 0; - } + /** + * + * @param mana + * @return true if this contains any values that mana has + */ + public boolean contains(Mana mana) { + if (mana.black > 0 && this.black > 0) + return true; + if (mana.blue > 0 && this.blue > 0) + return true; + if (mana.red > 0 && this.red > 0) + return true; + if (mana.white > 0 && this.white > 0) + return true; + if (mana.green > 0 && this.green > 0) + return true; + if (mana.colorless > 0 && this.count() > 0) + return true; + + return false; + } + + public int getColor(ColoredManaSymbol color) { + if (color.equals(ColoredManaSymbol.G)) { + return getGreen(); + } + if (color.equals(ColoredManaSymbol.R)) { + return getRed(); + } + if (color.equals(ColoredManaSymbol.B)) { + return getBlack(); + } + if (color.equals(ColoredManaSymbol.U)) { + return getBlue(); + } + if (color.equals(ColoredManaSymbol.W)) { + return getWhite(); + } + return 0; + } public int get(ManaType manaType) { switch(manaType) { diff --git a/Mage/src/mage/ObjectColor.java b/Mage/src/mage/ObjectColor.java index fa7ca47907..b370472f23 100644 --- a/Mage/src/mage/ObjectColor.java +++ b/Mage/src/mage/ObjectColor.java @@ -33,271 +33,271 @@ import mage.util.Copyable; public class ObjectColor implements Serializable, Copyable, Comparable { - public static final ObjectColor WHITE = new ObjectColor("W"); - public static final ObjectColor BLUE = new ObjectColor("U"); - public static final ObjectColor BLACK = new ObjectColor("B"); - public static final ObjectColor RED = new ObjectColor("R"); - public static final ObjectColor GREEN = new ObjectColor("G"); - - private boolean white; - private boolean blue; - private boolean black; - private boolean red; - private boolean green; + public static final ObjectColor WHITE = new ObjectColor("W"); + public static final ObjectColor BLUE = new ObjectColor("U"); + public static final ObjectColor BLACK = new ObjectColor("B"); + public static final ObjectColor RED = new ObjectColor("R"); + public static final ObjectColor GREEN = new ObjectColor("G"); - public ObjectColor() {} - - public ObjectColor(String color) { - for (int i = 0; i < color.length(); i++) { - switch (color.charAt(i)) { - case 'W': - white = true; - break; - case 'U': - blue = true; - break; - case 'B': - black = true; - break; - case 'R': - red = true; - break; - case 'G': - green = true; - break; - } - } - } + private boolean white; + private boolean blue; + private boolean black; + private boolean red; + private boolean green; - public ObjectColor(ObjectColor color) { - white = color.white; - blue = color.blue; - black = color.black; - red = color.red; - green = color.green; - } + public ObjectColor() {} - public int getColorCount() { - int count = 0; - if (white) count++; - if (blue) count++; - if (black) count++; - if (green) count++; - if (red) count++; - return count; - } + public ObjectColor(String color) { + for (int i = 0; i < color.length(); i++) { + switch (color.charAt(i)) { + case 'W': + white = true; + break; + case 'U': + blue = true; + break; + case 'B': + black = true; + break; + case 'R': + red = true; + break; + case 'G': + green = true; + break; + } + } + } - public void setColor(ObjectColor color) { - this.setBlack(color.isBlack()); - this.setBlue(color.isBlue()); - this.setGreen(color.isGreen()); - this.setRed(color.isRed()); - this.setWhite(color.isWhite()); - } + public ObjectColor(ObjectColor color) { + white = color.white; + blue = color.blue; + black = color.black; + red = color.red; + green = color.green; + } - public boolean isColorless() { - return !(hasColor()); - } - - public boolean hasColor() { - return white | blue | black | red | green; - } + public int getColorCount() { + int count = 0; + if (white) count++; + if (blue) count++; + if (black) count++; + if (green) count++; + if (red) count++; + return count; + } - public boolean isMulticolored() { - if (isColorless()) - return false; - if (white && (blue | black | red | green)) - return true; - if (blue && (black | red | green)) - return true; - if (black && (red | green)) - return true; - if (red && green) - return true; - return false; - } - - public boolean isWhite() { - return white; - } - public void setWhite(boolean white) { - this.white = white; - } - public boolean isBlue() { - return blue; - } - public void setBlue(boolean blue) { - this.blue = blue; - } - public boolean isBlack() { - return black; - } - public void setBlack(boolean black) { - this.black = black; - } - public boolean isRed() { - return red; - } - public void setRed(boolean red) { - this.red = red; - } - public boolean isGreen() { - return green; - } - public void setGreen(boolean green) { - this.green = green; - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - if (white) - sb.append("W"); - if (blue) - sb.append("U"); - if (black) - sb.append("B"); - if (red) - sb.append("R"); - if (green) - sb.append("G"); - return sb.toString(); - } + public void setColor(ObjectColor color) { + this.setBlack(color.isBlack()); + this.setBlue(color.isBlue()); + this.setGreen(color.isGreen()); + this.setRed(color.isRed()); + this.setWhite(color.isWhite()); + } - public String getDescription() { - StringBuilder sb = new StringBuilder(); - if (getColorCount() > 1) { - return "multicolored"; - } else { - if (white) - return "white"; - if (blue) - return "blue"; - if (black) - return "black"; - if (red) - return "red"; - if (green) - return "green"; - } - return "colorless"; - } - - @Override - public boolean equals(Object color) { - if (this == color) - return true; - if (!(color instanceof ObjectColor)) - return false; - ObjectColor test = (ObjectColor) color; - if (test.white != this.white) - return false; - if (test.blue != this.blue) - return false; - if (test.black != this.black) - return false; - if (test.red != this.red) - return false; - if (test.green != this.green) - return false; - return true; - } + public boolean isColorless() { + return !(hasColor()); + } - @Override - public int hashCode() { - int hash = 3; - hash = 23 * hash + (this.white ? 1 : 0); - hash = 23 * hash + (this.blue ? 1 : 0); - hash = 23 * hash + (this.black ? 1 : 0); - hash = 23 * hash + (this.red ? 1 : 0); - hash = 23 * hash + (this.green ? 1 : 0); - return hash; - } + public boolean hasColor() { + return white | blue | black | red | green; + } - public boolean contains(ObjectColor color) { - if (this == color) - return true; - if (color.white & this.white) - return true; - if (color.blue & this.blue) - return true; - if (color.black & this.black) - return true; - if (color.red & this.red) - return true; - if (color.green & this.green) - return true; - return false; - } + public boolean isMulticolored() { + if (isColorless()) + return false; + if (white && (blue | black | red | green)) + return true; + if (blue && (black | red | green)) + return true; + if (black && (red | green)) + return true; + if (red && green) + return true; + return false; + } - public boolean shares(ObjectColor color) { - if (this == color) - return true; - if (!hasColor() && !color.hasColor()) - return true; - return color.white && white || color.blue && blue || color.black && black || - color.red && red || color.green && green; - } + public boolean isWhite() { + return white; + } + public void setWhite(boolean white) { + this.white = white; + } + public boolean isBlue() { + return blue; + } + public void setBlue(boolean blue) { + this.blue = blue; + } + public boolean isBlack() { + return black; + } + public void setBlack(boolean black) { + this.black = black; + } + public boolean isRed() { + return red; + } + public void setRed(boolean red) { + this.red = red; + } + public boolean isGreen() { + return green; + } + public void setGreen(boolean green) { + this.green = green; + } - @Override - public ObjectColor copy() { - return new ObjectColor(this); - } + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + if (white) + sb.append("W"); + if (blue) + sb.append("U"); + if (black) + sb.append("B"); + if (red) + sb.append("R"); + if (green) + sb.append("G"); + return sb.toString(); + } - public static void main(String[] args) { - System.out.println(new ObjectColor().shares(new ObjectColor())); - System.out.println(new ObjectColor("W").shares(new ObjectColor("W"))); - System.out.println(new ObjectColor("U").shares(new ObjectColor("U"))); - System.out.println(new ObjectColor("B").shares(new ObjectColor("B"))); - System.out.println(new ObjectColor("R").shares(new ObjectColor("R"))); - System.out.println(new ObjectColor("G").shares(new ObjectColor("G"))); - System.out.println(new ObjectColor("RG").shares(new ObjectColor("GW"))); - System.out.println(new ObjectColor("BRGUW").shares(new ObjectColor("U"))); - System.out.println(new ObjectColor("{2}").shares(new ObjectColor("{1}"))); - System.out.println(new ObjectColor("WRB").shares(new ObjectColor("UGR"))); - System.out.println("should be false:"); - System.out.println(new ObjectColor("RG").shares(new ObjectColor("WU"))); - System.out.println(new ObjectColor("WRB").shares(new ObjectColor("UG"))); - System.out.println(new ObjectColor("U").shares(new ObjectColor("R"))); - System.out.println(new ObjectColor("G").shares(new ObjectColor("B"))); - System.out.println(new ObjectColor("W").shares(new ObjectColor("1"))); + public String getDescription() { + StringBuilder sb = new StringBuilder(); + if (getColorCount() > 1) { + return "multicolored"; + } else { + if (white) + return "white"; + if (blue) + return "blue"; + if (black) + return "black"; + if (red) + return "red"; + if (green) + return "green"; + } + return "colorless"; + } - } + @Override + public boolean equals(Object color) { + if (this == color) + return true; + if (!(color instanceof ObjectColor)) + return false; + ObjectColor test = (ObjectColor) color; + if (test.white != this.white) + return false; + if (test.blue != this.blue) + return false; + if (test.black != this.black) + return false; + if (test.red != this.red) + return false; + if (test.green != this.green) + return false; + return true; + } - @Override - public int compareTo(ObjectColor o) { - int o1 = 0; - int o2 = 0; + @Override + public int hashCode() { + int hash = 3; + hash = 23 * hash + (this.white ? 1 : 0); + hash = 23 * hash + (this.blue ? 1 : 0); + hash = 23 * hash + (this.black ? 1 : 0); + hash = 23 * hash + (this.red ? 1 : 0); + hash = 23 * hash + (this.green ? 1 : 0); + return hash; + } + + public boolean contains(ObjectColor color) { + if (this == color) + return true; + if (color.white & this.white) + return true; + if (color.blue & this.blue) + return true; + if (color.black & this.black) + return true; + if (color.red & this.red) + return true; + if (color.green & this.green) + return true; + return false; + } + + public boolean shares(ObjectColor color) { + if (this == color) + return true; + if (!hasColor() && !color.hasColor()) + return true; + return color.white && white || color.blue && blue || color.black && black || + color.red && red || color.green && green; + } + + @Override + public ObjectColor copy() { + return new ObjectColor(this); + } + + public static void main(String[] args) { + System.out.println(new ObjectColor().shares(new ObjectColor())); + System.out.println(new ObjectColor("W").shares(new ObjectColor("W"))); + System.out.println(new ObjectColor("U").shares(new ObjectColor("U"))); + System.out.println(new ObjectColor("B").shares(new ObjectColor("B"))); + System.out.println(new ObjectColor("R").shares(new ObjectColor("R"))); + System.out.println(new ObjectColor("G").shares(new ObjectColor("G"))); + System.out.println(new ObjectColor("RG").shares(new ObjectColor("GW"))); + System.out.println(new ObjectColor("BRGUW").shares(new ObjectColor("U"))); + System.out.println(new ObjectColor("{2}").shares(new ObjectColor("{1}"))); + System.out.println(new ObjectColor("WRB").shares(new ObjectColor("UGR"))); + System.out.println("should be false:"); + System.out.println(new ObjectColor("RG").shares(new ObjectColor("WU"))); + System.out.println(new ObjectColor("WRB").shares(new ObjectColor("UG"))); + System.out.println(new ObjectColor("U").shares(new ObjectColor("R"))); + System.out.println(new ObjectColor("G").shares(new ObjectColor("B"))); + System.out.println(new ObjectColor("W").shares(new ObjectColor("1"))); + + } + + @Override + public int compareTo(ObjectColor o) { + int o1 = 0; + int o2 = 0; + + if (this.isMulticolored()) + o1 = 6; + else if(this.isColorless()) + o1 = 0; + else if(this.isBlack()) + o1 = 1; + else if(this.isBlue()) + o1 = 2; + else if(this.isGreen()) + o1 = 3; + else if(this.isRed()) + o1 = 4; + else if(this.isWhite()) + o1 = 5; + if (o.isMulticolored()) + o2 = 6; + else if(o.isColorless()) + o2 = 0; + else if(o.isBlack()) + o2 = 1; + else if(o.isBlue()) + o2 = 2; + else if(o.isGreen()) + o2 = 3; + else if(o.isRed()) + o2 = 4; + else if(o.isWhite()) + o2 = 5; + return o1 - o2; + } - if (this.isMulticolored()) - o1 = 6; - else if(this.isColorless()) - o1 = 0; - else if(this.isBlack()) - o1 = 1; - else if(this.isBlue()) - o1 = 2; - else if(this.isGreen()) - o1 = 3; - else if(this.isRed()) - o1 = 4; - else if(this.isWhite()) - o1 = 5; - if (o.isMulticolored()) - o2 = 6; - else if(o.isColorless()) - o2 = 0; - else if(o.isBlack()) - o2 = 1; - else if(o.isBlue()) - o2 = 2; - else if(o.isGreen()) - o2 = 3; - else if(o.isRed()) - o2 = 4; - else if(o.isWhite()) - o2 = 5; - return o1 - o2; - } - } diff --git a/Mage/src/mage/abilities/Abilities.java b/Mage/src/mage/abilities/Abilities.java index e6ce22ee5c..e5ca34ee70 100644 --- a/Mage/src/mage/abilities/Abilities.java +++ b/Mage/src/mage/abilities/Abilities.java @@ -50,197 +50,197 @@ import mage.game.Game; */ public interface Abilities extends List, Serializable { - /** - * Retrieves a {@link List}<{@link String}> of ability texts for the - * given source. - * - * @param source The source to retrieve ability texts. - * @return the {@link List}<{@link String}> of ability texts. - * - * @see mage.cards.CardImpl#getRules() - * @see mage.abilities.keyword.LevelAbility#getRule() - */ - public List getRules(String source); - - /** - * Retrieves all activated abilities for the given {@link Zone}. - * - * @param zone The {@link Zone} for which abilities should be retrieved. - * @return All abilities for the given {@link Zone} - * - * @see mage.cards.CardImpl#getSpellAbility() - */ - public Abilities getActivatedAbilities(Zone zone); - - /** - * Retrieves all {@link ManaAbility mana abilities} in the given {@link Zone}. - * - * @param zone The {@link Zone} to search for {@link ManaAbility mana abilities}. - * @return All {@link ManaAbility mana abilities} for the given {@link Zone}. - * - * @see mage.cards.CardImpl#getMana() - * @see mage.players.PlayerImpl#getManaAvailable(mage.game.Game) - * @see mage.players.PlayerImpl#getAvailableManaProducers(mage.game.Game) - */ - public Abilities getManaAbilities(Zone zone); - - /** - * Retrieves all {@link ManaAbility mana abilities} in the given {@link Zone} that can be used. - * - * @param zone The {@link Zone} to search for {@link ManaAbility mana abilities}. - * @return All {@link ManaAbility mana abilities} for the given {@link Zone} that can be used. - * - * @see mage.cards.CardImpl#getMana() - * @see mage.players.PlayerImpl#getManaAvailable(mage.game.Game) - * @see mage.players.PlayerImpl#getAvailableManaProducers(mage.game.Game) - */ - public Abilities getAvailableManaAbilities(Zone zone, Game game); + /** + * Retrieves a {@link List}<{@link String}> of ability texts for the + * given source. + * + * @param source The source to retrieve ability texts. + * @return the {@link List}<{@link String}> of ability texts. + * + * @see mage.cards.CardImpl#getRules() + * @see mage.abilities.keyword.LevelAbility#getRule() + */ + public List getRules(String source); /** - * Retrieves all {@link StaticAbility static abilities} in the given {@link Zone}. - * - * @param zone The {@link Zone} to search for {@link StaticAbility} - * @return All {@link StaticAbility static abilities} in the given {@link Zone} - * - * @see mage.abilities.effects.ContinuousEffects#getLayeredEffects(mage.game.Game) - * @see mage.abilities.effects.ContinuousEffects#getApplicableRequirementEffects(mage.game.permanent.Permanent, mage.game.Game) - * @see mage.abilities.effects.ContinuousEffects#getApplicableRestrictionEffects(mage.game.permanent.Permanent, mage.game.Game) - * @see mage.abilities.effects.ContinuousEffects#getApplicableReplacementEffects(mage.game.events.GameEvent, mage.game.Game) - * @see mage.abilities.effects.ContinuousEffects#asThough(java.util.UUID, mage.Constants.AsThoughEffectType, mage.game.Game) - * @see mage.abilities.effects.ContinuousEffects#costModification(mage.abilities.Ability, mage.game.Game) - */ - public Abilities getStaticAbilities(Zone zone); - - /** - * Retrieves all {@link EvasionAbility evasion abilities}. - * - * @return The {@link EvasionAbility evasion abilities}. - */ - public Abilities getEvasionAbilities(); - - /** - * Retrieves all {@link TriggeredAbility triggered abilities} for the given - * {@link Zone}. - * - * @param zone The {@link Zone} to search for {@link TriggeredAbility triggered abilities} - * @return All found {@link TriggeredAbility triggered abilities}. - * - * @see mage.cards.CardImpl#checkTriggers(mage.Constants.Zone, mage.game.events.GameEvent, mage.game.Game) - * @see mage.game.permanent.PermanentImpl#checkTriggers(mage.game.events.GameEvent, mage.game.Game) - * @see mage.game.permanent.PermanentCard#checkPermanentOnlyTriggers(mage.game.events.ZoneChangeEvent, mage.game.Game) - */ - public Abilities getTriggeredAbilities(Zone zone); - - /** - * Retrieves all {@link ProtectionAbility protection abilities}. - * - * @return All found {@link ProtectionAbility protection abilities}. - * - * @see mage.game.permanent.PermanentImpl#hasProtectionFrom(mage.MageObject) - * @see mage.players.PlayerImpl#hasProtectionFrom(mage.MageObject) - * @see mage.players.PlayerImpl#canDamage(mage.MageObject) - */ - public Abilities getProtectionAbilities(); - - /** - * Retrieves all {@link KickerAbility kicker abilities}. - * - * @return All found {@link KickerAbility kicker abilities}. - * - * @see mage.players.PlayerImpl#cast(mage.abilities.SpellAbility, mage.game.Game, boolean) - * @see mage.game.stack.Spell#resolveKicker(mage.game.Game) - */ - public Abilities getKickerAbilities(); - - /** - * TODO Method is unused, keep it around? - * - * The only implementation seems to want to use this for totally a set of - * abilities by some arbitrary numeral value. Possibly a good method to be - * used by the AI's? - * - * @return A numeral value representing the 'strength' or effectiveness of the abilities? - */ - public int getOutcomeTotal(); - - /** - * Sets the controller of this set of abilities. - * - * @param controllerId - * - * @see mage.cards.CardImpl#setControllerId(java.util.UUID) - * @see mage.cards.CardImpl#setOwnerId(java.util.UUID) - * @see mage.game.permanent.PermanentImpl#changeControllerId(java.util.UUID, mage.game.Game) - * @see mage.game.permanent.PermanentCard#copyFromCard(mage.cards.Card) - */ - public void setControllerId(UUID controllerId); - - /** - * Sets the source of this set of abilities. - * - * @param sourceId - * - * @see mage.cards.CardImpl#assignNewId() - */ - public void setSourceId(UUID sourceId); - - /** - * Assigns a new {@link java.util.UUID} - */ - public void newId(); - - /** - * Assigns a new {@link java.util.UUID} - */ - public void newOriginalId(); + * Retrieves all activated abilities for the given {@link Zone}. + * + * @param zone The {@link Zone} for which abilities should be retrieved. + * @return All abilities for the given {@link Zone} + * + * @see mage.cards.CardImpl#getSpellAbility() + */ + public Abilities getActivatedAbilities(Zone zone); /** - * Searches this set of abilities to see if the ability represented by the abilityId - * is contained within. Can be used to find usages of singleton abilities. - * - * @param abilityId - * @return - */ - public boolean containsKey(UUID abilityId); - - /** - * TODO Method is unused, keep it around? - * - * Gets the ability represented by the given abilityId. - * - * @param abilityId - * @return - */ - public T get(UUID abilityId); + * Retrieves all {@link ManaAbility mana abilities} in the given {@link Zone}. + * + * @param zone The {@link Zone} to search for {@link ManaAbility mana abilities}. + * @return All {@link ManaAbility mana abilities} for the given {@link Zone}. + * + * @see mage.cards.CardImpl#getMana() + * @see mage.players.PlayerImpl#getManaAvailable(mage.game.Game) + * @see mage.players.PlayerImpl#getAvailableManaProducers(mage.game.Game) + */ + public Abilities getManaAbilities(Zone zone); - /** - * TODO The usage of this method seems redundant to that of {@link #containsKey(java.util.UUID)} - * minus the fact that it searches for exact instances instead of id's of - * singleton Abilities. - * - * Searches for the exact instance of the passed in ability. - * - * @param ability - * @return - */ - public boolean contains(T ability); - - /** - * Searches this set of abilities for the existence of each of the passed in - * set of abilities. - * - * @param abilities - * @return True if the passed in set of abilities is also in this set of abilities. - */ - public boolean containsAll(Abilities abilities); + /** + * Retrieves all {@link ManaAbility mana abilities} in the given {@link Zone} that can be used. + * + * @param zone The {@link Zone} to search for {@link ManaAbility mana abilities}. + * @return All {@link ManaAbility mana abilities} for the given {@link Zone} that can be used. + * + * @see mage.cards.CardImpl#getMana() + * @see mage.players.PlayerImpl#getManaAvailable(mage.game.Game) + * @see mage.players.PlayerImpl#getAvailableManaProducers(mage.game.Game) + */ + public Abilities getAvailableManaAbilities(Zone zone, Game game); - /** - * Copies this set of abilities. This copy should be new instances of all - * the contained abilities. - * - * @return - */ - public Abilities copy(); + /** + * Retrieves all {@link StaticAbility static abilities} in the given {@link Zone}. + * + * @param zone The {@link Zone} to search for {@link StaticAbility} + * @return All {@link StaticAbility static abilities} in the given {@link Zone} + * + * @see mage.abilities.effects.ContinuousEffects#getLayeredEffects(mage.game.Game) + * @see mage.abilities.effects.ContinuousEffects#getApplicableRequirementEffects(mage.game.permanent.Permanent, mage.game.Game) + * @see mage.abilities.effects.ContinuousEffects#getApplicableRestrictionEffects(mage.game.permanent.Permanent, mage.game.Game) + * @see mage.abilities.effects.ContinuousEffects#getApplicableReplacementEffects(mage.game.events.GameEvent, mage.game.Game) + * @see mage.abilities.effects.ContinuousEffects#asThough(java.util.UUID, mage.Constants.AsThoughEffectType, mage.game.Game) + * @see mage.abilities.effects.ContinuousEffects#costModification(mage.abilities.Ability, mage.game.Game) + */ + public Abilities getStaticAbilities(Zone zone); + + /** + * Retrieves all {@link EvasionAbility evasion abilities}. + * + * @return The {@link EvasionAbility evasion abilities}. + */ + public Abilities getEvasionAbilities(); + + /** + * Retrieves all {@link TriggeredAbility triggered abilities} for the given + * {@link Zone}. + * + * @param zone The {@link Zone} to search for {@link TriggeredAbility triggered abilities} + * @return All found {@link TriggeredAbility triggered abilities}. + * + * @see mage.cards.CardImpl#checkTriggers(mage.Constants.Zone, mage.game.events.GameEvent, mage.game.Game) + * @see mage.game.permanent.PermanentImpl#checkTriggers(mage.game.events.GameEvent, mage.game.Game) + * @see mage.game.permanent.PermanentCard#checkPermanentOnlyTriggers(mage.game.events.ZoneChangeEvent, mage.game.Game) + */ + public Abilities getTriggeredAbilities(Zone zone); + + /** + * Retrieves all {@link ProtectionAbility protection abilities}. + * + * @return All found {@link ProtectionAbility protection abilities}. + * + * @see mage.game.permanent.PermanentImpl#hasProtectionFrom(mage.MageObject) + * @see mage.players.PlayerImpl#hasProtectionFrom(mage.MageObject) + * @see mage.players.PlayerImpl#canDamage(mage.MageObject) + */ + public Abilities getProtectionAbilities(); + + /** + * Retrieves all {@link KickerAbility kicker abilities}. + * + * @return All found {@link KickerAbility kicker abilities}. + * + * @see mage.players.PlayerImpl#cast(mage.abilities.SpellAbility, mage.game.Game, boolean) + * @see mage.game.stack.Spell#resolveKicker(mage.game.Game) + */ + public Abilities getKickerAbilities(); + + /** + * TODO Method is unused, keep it around? + * + * The only implementation seems to want to use this for totally a set of + * abilities by some arbitrary numeral value. Possibly a good method to be + * used by the AI's? + * + * @return A numeral value representing the 'strength' or effectiveness of the abilities? + */ + public int getOutcomeTotal(); + + /** + * Sets the controller of this set of abilities. + * + * @param controllerId + * + * @see mage.cards.CardImpl#setControllerId(java.util.UUID) + * @see mage.cards.CardImpl#setOwnerId(java.util.UUID) + * @see mage.game.permanent.PermanentImpl#changeControllerId(java.util.UUID, mage.game.Game) + * @see mage.game.permanent.PermanentCard#copyFromCard(mage.cards.Card) + */ + public void setControllerId(UUID controllerId); + + /** + * Sets the source of this set of abilities. + * + * @param sourceId + * + * @see mage.cards.CardImpl#assignNewId() + */ + public void setSourceId(UUID sourceId); + + /** + * Assigns a new {@link java.util.UUID} + */ + public void newId(); + + /** + * Assigns a new {@link java.util.UUID} + */ + public void newOriginalId(); + + /** + * Searches this set of abilities to see if the ability represented by the abilityId + * is contained within. Can be used to find usages of singleton abilities. + * + * @param abilityId + * @return + */ + public boolean containsKey(UUID abilityId); + + /** + * TODO Method is unused, keep it around? + * + * Gets the ability represented by the given abilityId. + * + * @param abilityId + * @return + */ + public T get(UUID abilityId); + + /** + * TODO The usage of this method seems redundant to that of {@link #containsKey(java.util.UUID)} + * minus the fact that it searches for exact instances instead of id's of + * singleton Abilities. + * + * Searches for the exact instance of the passed in ability. + * + * @param ability + * @return + */ + public boolean contains(T ability); + + /** + * Searches this set of abilities for the existence of each of the passed in + * set of abilities. + * + * @param abilities + * @return True if the passed in set of abilities is also in this set of abilities. + */ + public boolean containsAll(Abilities abilities); + + /** + * Copies this set of abilities. This copy should be new instances of all + * the contained abilities. + * + * @return + */ + public Abilities copy(); public String getValue(); } diff --git a/Mage/src/mage/abilities/AbilitiesImpl.java b/Mage/src/mage/abilities/AbilitiesImpl.java index ea344f601c..b60d643c42 100644 --- a/Mage/src/mage/abilities/AbilitiesImpl.java +++ b/Mage/src/mage/abilities/AbilitiesImpl.java @@ -46,207 +46,207 @@ import java.util.UUID; */ public class AbilitiesImpl extends ArrayList implements Abilities { - public AbilitiesImpl() {} + public AbilitiesImpl() {} public AbilitiesImpl(T... abilities) { for (T ability : abilities) { add(ability); } } - - public AbilitiesImpl(final AbilitiesImpl abilities) { - for (T ability: abilities) { - this.add((T)ability.copy()); - } - } - @Override - public AbilitiesImpl copy() { - return new AbilitiesImpl(this); - } + public AbilitiesImpl(final AbilitiesImpl abilities) { + for (T ability: abilities) { + this.add((T)ability.copy()); + } + } - @Override - public List getRules(String source) { - List rules = new ArrayList(); + @Override + public AbilitiesImpl copy() { + return new AbilitiesImpl(this); + } - for (T ability:this) { - if (!(ability instanceof SpellAbility || ability instanceof PlayLandAbility)) - rules.add(ability.getRule()); - } + @Override + public List getRules(String source) { + List rules = new ArrayList(); - return rules; - } + for (T ability:this) { + if (!(ability instanceof SpellAbility || ability instanceof PlayLandAbility)) + rules.add(ability.getRule()); + } - @Override - public Abilities getActivatedAbilities(Zone zone) { - Abilities zonedAbilities = new AbilitiesImpl(); - for (T ability: this) { - if (ability instanceof ActivatedAbility && ability.getZone().match(zone)) { - zonedAbilities.add((ActivatedAbility)ability); - } - } - return zonedAbilities; - } + return rules; + } - @Override - public Abilities getManaAbilities(Zone zone) { - Abilities abilities = new AbilitiesImpl(); - for (T ability: this) { - if (ability instanceof ManaAbility && ability.getZone().match(zone)) { - abilities.add((ManaAbility)ability); - } - } - return abilities; - } + @Override + public Abilities getActivatedAbilities(Zone zone) { + Abilities zonedAbilities = new AbilitiesImpl(); + for (T ability: this) { + if (ability instanceof ActivatedAbility && ability.getZone().match(zone)) { + zonedAbilities.add((ActivatedAbility)ability); + } + } + return zonedAbilities; + } - @Override - public Abilities getAvailableManaAbilities(Zone zone, Game game) { - Abilities abilities = new AbilitiesImpl(); - for (T ability: this) { - if (ability instanceof ManaAbility && ability.getZone().match(zone)) { + @Override + public Abilities getManaAbilities(Zone zone) { + Abilities abilities = new AbilitiesImpl(); + for (T ability: this) { + if (ability instanceof ManaAbility && ability.getZone().match(zone)) { + abilities.add((ManaAbility)ability); + } + } + return abilities; + } + + @Override + public Abilities getAvailableManaAbilities(Zone zone, Game game) { + Abilities abilities = new AbilitiesImpl(); + for (T ability: this) { + if (ability instanceof ManaAbility && ability.getZone().match(zone)) { if ((((ManaAbility)ability).canActivate(ability.getControllerId(), game))) abilities.add((ManaAbility)ability); - } - } - return abilities; - } + } + } + return abilities; + } @Override - public Abilities getEvasionAbilities() { - Abilities abilities = new AbilitiesImpl(); - for (T ability: this) { - if (ability instanceof EvasionAbility) { - abilities.add((EvasionAbility)ability); - } - } - return abilities; - } - - @Override - public Abilities getStaticAbilities(Zone zone) { - Abilities zonedAbilities = new AbilitiesImpl(); - for (T ability: this) { - if (ability instanceof StaticAbility && ability.getZone().match(zone)) { - zonedAbilities.add((StaticAbility)ability); - } - } - return zonedAbilities; - } - - @Override - public Abilities getTriggeredAbilities(Zone zone) { - Abilities zonedAbilities = new AbilitiesImpl(); - for (T ability: this) { - if (ability instanceof TriggeredAbility && ability.getZone().match(zone)) { - zonedAbilities.add((TriggeredAbility)ability); - } - else if (ability instanceof ZoneChangeTriggeredAbility) { - ZoneChangeTriggeredAbility zcAbility = (ZoneChangeTriggeredAbility)ability; - if (zcAbility.getToZone() != null && zcAbility.getToZone().match(zone)) { - zonedAbilities.add((ZoneChangeTriggeredAbility)ability); - } - } - } - return zonedAbilities; - } - - @Override - public Abilities getProtectionAbilities() { - Abilities abilities = new AbilitiesImpl(); - for (T ability: this) { - if (ability instanceof ProtectionAbility) { - abilities.add((ProtectionAbility)ability); - } - } - return abilities; - } - - @Override - public Abilities getKickerAbilities() { - Abilities abilities = new AbilitiesImpl(); - for (T ability: this) { - if (ability instanceof KickerAbility) { - abilities.add((KickerAbility)ability); - } - } - return abilities; - } - - @Override - public void setControllerId(UUID controllerId) { - for (Ability ability: this) { - ability.setControllerId(controllerId); - } - } - - @Override - public void setSourceId(UUID sourceId) { - for (Ability ability: this) { - ability.setSourceId(sourceId); - } - } - - @Override - public void newId() { - for (Ability ability: this) { - ability.newId(); - } - } - - @Override - public void newOriginalId() { - for (Ability ability: this) { - ability.newOriginalId(); - } - } + public Abilities getEvasionAbilities() { + Abilities abilities = new AbilitiesImpl(); + for (T ability: this) { + if (ability instanceof EvasionAbility) { + abilities.add((EvasionAbility)ability); + } + } + return abilities; + } @Override - public boolean contains(T ability) { - for (T test: this) { - if (ability.getId().equals(test.getId()) || ability.getRule().equals(test.getRule())) { - return true; - } - } - return false; - } + public Abilities getStaticAbilities(Zone zone) { + Abilities zonedAbilities = new AbilitiesImpl(); + for (T ability: this) { + if (ability instanceof StaticAbility && ability.getZone().match(zone)) { + zonedAbilities.add((StaticAbility)ability); + } + } + return zonedAbilities; + } - @Override - public boolean containsAll(Abilities abilities) { - if (this.size() < abilities.size()) - return false; - for (T ability: abilities) { - if (!contains(ability)) - return false; - } - return true; - } + @Override + public Abilities getTriggeredAbilities(Zone zone) { + Abilities zonedAbilities = new AbilitiesImpl(); + for (T ability: this) { + if (ability instanceof TriggeredAbility && ability.getZone().match(zone)) { + zonedAbilities.add((TriggeredAbility)ability); + } + else if (ability instanceof ZoneChangeTriggeredAbility) { + ZoneChangeTriggeredAbility zcAbility = (ZoneChangeTriggeredAbility)ability; + if (zcAbility.getToZone() != null && zcAbility.getToZone().match(zone)) { + zonedAbilities.add((ZoneChangeTriggeredAbility)ability); + } + } + } + return zonedAbilities; + } - @Override - public boolean containsKey(UUID abilityId) { - for (T ability: this) { - if (ability.getId().equals(abilityId)) - return true; - } - return false; - } + @Override + public Abilities getProtectionAbilities() { + Abilities abilities = new AbilitiesImpl(); + for (T ability: this) { + if (ability instanceof ProtectionAbility) { + abilities.add((ProtectionAbility)ability); + } + } + return abilities; + } - @Override - public T get(UUID abilityId) { - for (T ability: this) { - if (ability.getId().equals(abilityId)) - return ability; - } - return null; - } + @Override + public Abilities getKickerAbilities() { + Abilities abilities = new AbilitiesImpl(); + for (T ability: this) { + if (ability instanceof KickerAbility) { + abilities.add((KickerAbility)ability); + } + } + return abilities; + } - @Override - public int getOutcomeTotal() { - int total = 0; - for (T ability: this) { - total += ability.getEffects().getOutcomeTotal(); - } - return total; - } + @Override + public void setControllerId(UUID controllerId) { + for (Ability ability: this) { + ability.setControllerId(controllerId); + } + } + + @Override + public void setSourceId(UUID sourceId) { + for (Ability ability: this) { + ability.setSourceId(sourceId); + } + } + + @Override + public void newId() { + for (Ability ability: this) { + ability.newId(); + } + } + + @Override + public void newOriginalId() { + for (Ability ability: this) { + ability.newOriginalId(); + } + } + + @Override + public boolean contains(T ability) { + for (T test: this) { + if (ability.getId().equals(test.getId()) || ability.getRule().equals(test.getRule())) { + return true; + } + } + return false; + } + + @Override + public boolean containsAll(Abilities abilities) { + if (this.size() < abilities.size()) + return false; + for (T ability: abilities) { + if (!contains(ability)) + return false; + } + return true; + } + + @Override + public boolean containsKey(UUID abilityId) { + for (T ability: this) { + if (ability.getId().equals(abilityId)) + return true; + } + return false; + } + + @Override + public T get(UUID abilityId) { + for (T ability: this) { + if (ability.getId().equals(abilityId)) + return ability; + } + return null; + } + + @Override + public int getOutcomeTotal() { + int total = 0; + for (T ability: this) { + total += ability.getEffects().getOutcomeTotal(); + } + return total; + } @Override public String getValue() { diff --git a/Mage/src/mage/abilities/Ability.java b/Mage/src/mage/abilities/Ability.java index b50a6acadb..266117203d 100644 --- a/Mage/src/mage/abilities/Ability.java +++ b/Mage/src/mage/abilities/Ability.java @@ -54,305 +54,305 @@ import java.util.UUID; */ public interface Ability extends Serializable { - /** - * Gets the globally unique id of the ability contained within the game. - * - * @return A {@link java.util.UUID} which the game will use to store and retrieve - * the exact instance of this ability. - */ - public UUID getId(); - - /** - * Assigns a new {@link java.util.UUID} - * - * @see mage.players.PlayerImpl#playAbility(mage.abilities.ActivatedAbility, mage.game.Game) - * @see mage.game.GameImpl#addTriggeredAbility(mage.abilities.TriggeredAbility) - * @see mage.game.GameImpl#addDelayedTriggeredAbility(mage.abilities.DelayedTriggeredAbility) - */ - public void newId(); - - /** - * Assigns a new {@link java.util.UUID} - * - * @see mage.players.PlayerImpl#playAbility(mage.abilities.ActivatedAbility, mage.game.Game) - * @see mage.game.GameImpl#addTriggeredAbility(mage.abilities.TriggeredAbility) - * @see mage.game.GameImpl#addDelayedTriggeredAbility(mage.abilities.DelayedTriggeredAbility) - */ - public void newOriginalId(); + /** + * Gets the globally unique id of the ability contained within the game. + * + * @return A {@link java.util.UUID} which the game will use to store and retrieve + * the exact instance of this ability. + */ + public UUID getId(); /** - * Gets the {@link AbilityType} of this ability. - * - * @return The {@link AbilityType type} of this ability. - */ - public AbilityType getAbilityType(); - - /** - * Gets the id of the player in control of this ability. - * - * @return The {@link java.util.UUID} of the controlling player. - */ - public UUID getControllerId(); - - /** - * Sets the id of the controller of this ability. - * - * @param controllerId The {@link java.util.UUID} of the controller. - */ - public void setControllerId(UUID controllerId); - - /** - * Gets the id of the object which put this ability in motion. - * - * @return The {@link java.util.UUID} of the object this ability is associated with. - */ - public UUID getSourceId(); - - /** - * Sets the id of the object which this ability orignates from. - * - * @param sourceID {@link java.util.UUID} the source id to set. - */ - public void setSourceId(UUID sourceID); + * Assigns a new {@link java.util.UUID} + * + * @see mage.players.PlayerImpl#playAbility(mage.abilities.ActivatedAbility, mage.game.Game) + * @see mage.game.GameImpl#addTriggeredAbility(mage.abilities.TriggeredAbility) + * @see mage.game.GameImpl#addDelayedTriggeredAbility(mage.abilities.DelayedTriggeredAbility) + */ + public void newId(); - /** - * Gets all {@link Costs} associated with this ability. - * - * @return All {@link Costs} associated with this ability. - */ - public Costs getCosts(); - - /** - * Adds a {@link Cost} to this ability that must be paid before this ability - * is activated. - * - * @param cost The {@link Cost} to add. - */ - public void addCost(Cost cost); - - /** - * Gets all {@link ManaCosts} associated with this ability. These returned - * costs should never be modified as they represent the base costs before - * any modifications. - * - * @return All {@link ManaCosts} that must be paid. - */ - public ManaCosts getManaCosts(); - - /** - * Gets all the {@link ManaCosts} that must be paid before activating this - * ability. These costs should be modified by any modification effects currently - * present within the game state. - * - * @return All {@link ManaCosts} that must be paid. - */ - public ManaCosts getManaCostsToPay(); - - /** - * Adds a {@link ManaCost} to this ability that must be paid before this - * ability is activated. - * - * @param cost The {@link ManaCost} to add. - */ - public void addManaCost(ManaCost cost); - - /** - * Gets all {@link AlternativeCost} associated with this ability. - * - * @return All {@link AlternativeCost}'s that can be paid instead of the {@link ManaCosts} - */ - public List getAlternativeCosts(); - - /** - * Adds an {@link AlternativeCost} this ability that may be paid instead of - * any other cost. - * - * @param cost The {@link AlternativeCost} to add. - */ - public void addAlternativeCost(AlternativeCost cost); - - /** - * TODO Method is unused, keep it around? - * - * Gets all costs that are optional to this ability. These costs can be paid - * in addition to other costs to have other effects put into place. - * - * @return All {@link Costs} that can be paid above and beyond other costs. - */ - public Costs getOptionalCosts(); - - /** - * Adds a {@link Cost} that is optional to this ability. - * - * @param cost The {@link Cost} to add to the optional costs. - */ - public void addOptionalCost(Cost cost); - - /** - * Retrieves the effects that are put into the place by the resolution of this - * ability. - * - * @return All {@link Effects} that will be put into place by the resolution - * of this ability. - */ - public Effects getEffects(); - - /** - * Retrieves the effects of the specified {@link EffectType type} that are - * put into place by the resolution of this ability. - * - * @param game - * @param effectType The {@link EffectType type} to search for. - * @return All {@link Effects} of the given {@link EffectType}. - */ - public Effects getEffects(Game game, EffectType effectType); - - /** - * Adds an effect to this ability. - * - * @param effect The {@link Effect} to add. - */ - public void addEffect(Effect effect); - - /** - * Retrieves all targets that must be satisfied before this ability is - * put onto the stack. - * - * @return All {@link Targets} that must be satisfied before this ability is put onto - * the stack. - */ - public Targets getTargets(); - - /** - * Retrieves the {@link Target} located at the 0th index in the {@link Targets}. - * A call to the method is equivalent to {@link #getTargets()}.get(0).getFirstTarget(). - * - * @return The {@link java.util.UUID} of the first target within the targets list. - * - * @see mage.target.Target - */ - public UUID getFirstTarget(); - - /** - * Adds a target to this ability that must be satisfied before this ability - * is put onto the stack. - * - * @param target The {@link Target} to add. - */ - public void addTarget(Target target); - - /** - * Choices - * - * @return - */ - public Choices getChoices(); - - /** - * TODO: Javadoc me - * - * @param choice - */ - public void addChoice(Choice choice); - - /** - * Retrieves the {@link Zone} that this ability is active within. - * - * @return - */ - public Zone getZone(); - - /** - * Retrieves whether or not this abilities activation will use the stack. - * - * @return - */ - public boolean isUsesStack(); - - /** - * Retrieves a human readable string representing what the ability states it - * accomplishes. This call is equivalent to {@link #getRule(boolean) getRule(false)} - * - * @return A human readable string representing what the ability states it - * accomplishes - */ - public String getRule(); - - /** - * Retrieves a human readable string including any costs associated with this - * ability if the all parameter is true, and just the abilities rule text if - * the all parameter is false. - * - * @param all True if costs are desired in the output, false otherwise. - * @return - */ - public String getRule(boolean all); - - /** - * Retrieves the rule associated with the given source. - * - * @param source - * @return - */ - public String getRule(String source); - - /** - * Activates this ability prompting the controller to pay any mandatory - * {@link Costs} or {@link AlternativeCost} associated with this ability. - * - * @param game A reference the {@link Game} for which this ability should be activated within. - * @param noMana Whether or not {@link ManaCosts} have to be paid. - * @return True if this ability was successfully activated. - * - * @see mage.players.PlayerImpl#cast(mage.abilities.SpellAbility, mage.game.Game, boolean) - * @see mage.players.PlayerImpl#playAbility(mage.abilities.ActivatedAbility, mage.game.Game) - * @see mage.players.PlayerImpl#triggerAbility(mage.abilities.TriggeredAbility, mage.game.Game) - */ - public boolean activate(Game game, boolean noMana); - - /** - * Resolves this ability and puts any effects it produces into play. This - * method should only be called if the {@link #activate(mage.game.Game, boolean)} - * method returned true. - * - * @param game The {@link Game} for which this ability resolves within. - * @return Whether or not this ability successfully resolved. - * - * @see mage.players.PlayerImpl#playManaAbility(mage.abilities.mana.ManaAbility, mage.game.Game) - * @see mage.players.PlayerImpl#specialAction(mage.abilities.SpecialAction, mage.game.Game) - */ - public boolean resolve(Game game); - - /** - * Used to reset the state of this ability. - * - * @param game - */ - public void reset(Game game); - - /** - * Overridden by triggered abilities with intervening if clauses - rule 20110715 - 603.4 + /** + * Assigns a new {@link java.util.UUID} + * + * @see mage.players.PlayerImpl#playAbility(mage.abilities.ActivatedAbility, mage.game.Game) + * @see mage.game.GameImpl#addTriggeredAbility(mage.abilities.TriggeredAbility) + * @see mage.game.GameImpl#addDelayedTriggeredAbility(mage.abilities.DelayedTriggeredAbility) + */ + public void newOriginalId(); + + /** + * Gets the {@link AbilityType} of this ability. + * + * @return The {@link AbilityType type} of this ability. + */ + public AbilityType getAbilityType(); + + /** + * Gets the id of the player in control of this ability. + * + * @return The {@link java.util.UUID} of the controlling player. + */ + public UUID getControllerId(); + + /** + * Sets the id of the controller of this ability. + * + * @param controllerId The {@link java.util.UUID} of the controller. + */ + public void setControllerId(UUID controllerId); + + /** + * Gets the id of the object which put this ability in motion. + * + * @return The {@link java.util.UUID} of the object this ability is associated with. + */ + public UUID getSourceId(); + + /** + * Sets the id of the object which this ability orignates from. + * + * @param sourceID {@link java.util.UUID} the source id to set. + */ + public void setSourceId(UUID sourceID); + + /** + * Gets all {@link Costs} associated with this ability. + * + * @return All {@link Costs} associated with this ability. + */ + public Costs getCosts(); + + /** + * Adds a {@link Cost} to this ability that must be paid before this ability + * is activated. + * + * @param cost The {@link Cost} to add. + */ + public void addCost(Cost cost); + + /** + * Gets all {@link ManaCosts} associated with this ability. These returned + * costs should never be modified as they represent the base costs before + * any modifications. + * + * @return All {@link ManaCosts} that must be paid. + */ + public ManaCosts getManaCosts(); + + /** + * Gets all the {@link ManaCosts} that must be paid before activating this + * ability. These costs should be modified by any modification effects currently + * present within the game state. + * + * @return All {@link ManaCosts} that must be paid. + */ + public ManaCosts getManaCostsToPay(); + + /** + * Adds a {@link ManaCost} to this ability that must be paid before this + * ability is activated. + * + * @param cost The {@link ManaCost} to add. + */ + public void addManaCost(ManaCost cost); + + /** + * Gets all {@link AlternativeCost} associated with this ability. + * + * @return All {@link AlternativeCost}'s that can be paid instead of the {@link ManaCosts} + */ + public List getAlternativeCosts(); + + /** + * Adds an {@link AlternativeCost} this ability that may be paid instead of + * any other cost. + * + * @param cost The {@link AlternativeCost} to add. + */ + public void addAlternativeCost(AlternativeCost cost); + + /** + * TODO Method is unused, keep it around? + * + * Gets all costs that are optional to this ability. These costs can be paid + * in addition to other costs to have other effects put into place. + * + * @return All {@link Costs} that can be paid above and beyond other costs. + */ + public Costs getOptionalCosts(); + + /** + * Adds a {@link Cost} that is optional to this ability. + * + * @param cost The {@link Cost} to add to the optional costs. + */ + public void addOptionalCost(Cost cost); + + /** + * Retrieves the effects that are put into the place by the resolution of this + * ability. + * + * @return All {@link Effects} that will be put into place by the resolution + * of this ability. + */ + public Effects getEffects(); + + /** + * Retrieves the effects of the specified {@link EffectType type} that are + * put into place by the resolution of this ability. + * + * @param game + * @param effectType The {@link EffectType type} to search for. + * @return All {@link Effects} of the given {@link EffectType}. + */ + public Effects getEffects(Game game, EffectType effectType); + + /** + * Adds an effect to this ability. + * + * @param effect The {@link Effect} to add. + */ + public void addEffect(Effect effect); + + /** + * Retrieves all targets that must be satisfied before this ability is + * put onto the stack. + * + * @return All {@link Targets} that must be satisfied before this ability is put onto + * the stack. + */ + public Targets getTargets(); + + /** + * Retrieves the {@link Target} located at the 0th index in the {@link Targets}. + * A call to the method is equivalent to {@link #getTargets()}.get(0).getFirstTarget(). + * + * @return The {@link java.util.UUID} of the first target within the targets list. + * + * @see mage.target.Target + */ + public UUID getFirstTarget(); + + /** + * Adds a target to this ability that must be satisfied before this ability + * is put onto the stack. + * + * @param target The {@link Target} to add. + */ + public void addTarget(Target target); + + /** + * Choices + * + * @return + */ + public Choices getChoices(); + + /** + * TODO: Javadoc me + * + * @param choice + */ + public void addChoice(Choice choice); + + /** + * Retrieves the {@link Zone} that this ability is active within. + * + * @return + */ + public Zone getZone(); + + /** + * Retrieves whether or not this abilities activation will use the stack. + * + * @return + */ + public boolean isUsesStack(); + + /** + * Retrieves a human readable string representing what the ability states it + * accomplishes. This call is equivalent to {@link #getRule(boolean) getRule(false)} + * + * @return A human readable string representing what the ability states it + * accomplishes + */ + public String getRule(); + + /** + * Retrieves a human readable string including any costs associated with this + * ability if the all parameter is true, and just the abilities rule text if + * the all parameter is false. + * + * @param all True if costs are desired in the output, false otherwise. + * @return + */ + public String getRule(boolean all); + + /** + * Retrieves the rule associated with the given source. + * + * @param source + * @return + */ + public String getRule(String source); + + /** + * Activates this ability prompting the controller to pay any mandatory + * {@link Costs} or {@link AlternativeCost} associated with this ability. + * + * @param game A reference the {@link Game} for which this ability should be activated within. + * @param noMana Whether or not {@link ManaCosts} have to be paid. + * @return True if this ability was successfully activated. + * + * @see mage.players.PlayerImpl#cast(mage.abilities.SpellAbility, mage.game.Game, boolean) + * @see mage.players.PlayerImpl#playAbility(mage.abilities.ActivatedAbility, mage.game.Game) + * @see mage.players.PlayerImpl#triggerAbility(mage.abilities.TriggeredAbility, mage.game.Game) + */ + public boolean activate(Game game, boolean noMana); + + /** + * Resolves this ability and puts any effects it produces into play. This + * method should only be called if the {@link #activate(mage.game.Game, boolean)} + * method returned true. + * + * @param game The {@link Game} for which this ability resolves within. + * @return Whether or not this ability successfully resolved. + * + * @see mage.players.PlayerImpl#playManaAbility(mage.abilities.mana.ManaAbility, mage.game.Game) + * @see mage.players.PlayerImpl#specialAction(mage.abilities.SpecialAction, mage.game.Game) + */ + public boolean resolve(Game game); + + /** + * Used to reset the state of this ability. + * + * @param game + */ + public void reset(Game game); + + /** + * Overridden by triggered abilities with intervening if clauses - rule 20110715 - 603.4 * * @param game * @return Whether or not the intervening if clause is satisfied - */ - public boolean checkIfClause(Game game); + */ + public boolean checkIfClause(Game game); + + /** + * Creates a fresh copy of this ability. + * + * @return A new copy of this ability. + */ + public Ability copy(); + + public boolean isModal(); + + public void addMode(Mode mode); + + public Modes getModes(); - /** - * Creates a fresh copy of this ability. - * - * @return A new copy of this ability. - */ - public Ability copy(); - - public boolean isModal(); - - public void addMode(Mode mode); - - public Modes getModes(); - public boolean canChooseTarget(Game game); - + /** * Returns true if this abilities source is in the zone for the ability * @@ -361,5 +361,5 @@ public interface Ability extends Serializable { * @return */ public boolean isInUseableZone(Game game, boolean checkLKI); - + } diff --git a/Mage/src/mage/abilities/AbilityImpl.java b/Mage/src/mage/abilities/AbilityImpl.java index 781163383d..675663efcb 100644 --- a/Mage/src/mage/abilities/AbilityImpl.java +++ b/Mage/src/mage/abilities/AbilityImpl.java @@ -58,113 +58,113 @@ import java.util.UUID; */ public abstract class AbilityImpl> implements Ability { - private final static transient Logger logger = Logger.getLogger(AbilityImpl.class); + private final static transient Logger logger = Logger.getLogger(AbilityImpl.class); - protected UUID id; - protected UUID originalId; - protected AbilityType abilityType; - protected UUID controllerId; - protected UUID sourceId; - protected ManaCosts manaCosts; - protected ManaCosts manaCostsToPay; - protected Costs costs; - protected ArrayList alternativeCosts = new ArrayList(); - protected Costs optionalCosts; - protected Modes modes; - protected Zone zone; - protected String name; - protected boolean usesStack = true; - - @Override - public abstract T copy(); - - public AbilityImpl(AbilityType abilityType, Zone zone) { - this.id = UUID.randomUUID(); - this.originalId = id; - this.abilityType = abilityType; - this.zone = zone; - this.manaCosts = new ManaCostsImpl(); - this.manaCostsToPay = new ManaCostsImpl(); - this.costs = new CostsImpl(); - this.optionalCosts = new CostsImpl(); - this.modes = new Modes(); - } - - public AbilityImpl(final AbilityImpl ability) { - this.id = ability.id; - this.originalId = ability.originalId; - this.abilityType = ability.abilityType; - this.controllerId = ability.controllerId; - this.sourceId = ability.sourceId; - this.zone = ability.zone; - this.name = ability.name; - this.usesStack = ability.usesStack; - this.manaCosts = ability.manaCosts; - this.manaCostsToPay = ability.manaCostsToPay.copy(); - this.costs = ability.costs.copy(); - this.optionalCosts = ability.optionalCosts.copy(); - for (AlternativeCost cost: ability.alternativeCosts) { - this.alternativeCosts.add((AlternativeCost)cost.copy()); - } - this.modes = ability.modes.copy(); - } - - @Override - public UUID getId() { - return id; - } - - @Override - public void newId() { - this.id = UUID.randomUUID(); - getEffects().newId(); - } - - @Override - public void newOriginalId() { - this.id = UUID.randomUUID(); - this.originalId = id; - getEffects().newId(); - } + protected UUID id; + protected UUID originalId; + protected AbilityType abilityType; + protected UUID controllerId; + protected UUID sourceId; + protected ManaCosts manaCosts; + protected ManaCosts manaCostsToPay; + protected Costs costs; + protected ArrayList alternativeCosts = new ArrayList(); + protected Costs optionalCosts; + protected Modes modes; + protected Zone zone; + protected String name; + protected boolean usesStack = true; @Override - public AbilityType getAbilityType() { - return this.abilityType; - } + public abstract T copy(); - @Override - public boolean resolve(Game game) { - boolean result = true; - //20100716 - 117.12 - if (checkIfClause(game)) { - for (Effect effect: getEffects()) { - if (effect instanceof OneShotEffect) { - if (!(effect instanceof PostResolveEffect)) - result &= effect.apply(game, this); - } - else { - game.addEffect((ContinuousEffect) effect, this); - } - } - } - return result; - } + public AbilityImpl(AbilityType abilityType, Zone zone) { + this.id = UUID.randomUUID(); + this.originalId = id; + this.abilityType = abilityType; + this.zone = zone; + this.manaCosts = new ManaCostsImpl(); + this.manaCostsToPay = new ManaCostsImpl(); + this.costs = new CostsImpl(); + this.optionalCosts = new CostsImpl(); + this.modes = new Modes(); + } - @Override - public boolean activate(Game game, boolean noMana) { - // 20110204 - 700.2 - if (!modes.choose(game, this)) - return false; - //20100716 - 601.2b - if (getChoices().size() > 0 && getChoices().choose(game, this) == false) { - logger.debug("activate failed - choice"); - return false; - } - //20100716 - 601.2b - if (getTargets().size() > 0 && getTargets().chooseTargets(getEffects().get(0).getOutcome(), this.controllerId, this, game) == false) { - logger.debug("activate failed - target"); - return false; - } + public AbilityImpl(final AbilityImpl ability) { + this.id = ability.id; + this.originalId = ability.originalId; + this.abilityType = ability.abilityType; + this.controllerId = ability.controllerId; + this.sourceId = ability.sourceId; + this.zone = ability.zone; + this.name = ability.name; + this.usesStack = ability.usesStack; + this.manaCosts = ability.manaCosts; + this.manaCostsToPay = ability.manaCostsToPay.copy(); + this.costs = ability.costs.copy(); + this.optionalCosts = ability.optionalCosts.copy(); + for (AlternativeCost cost: ability.alternativeCosts) { + this.alternativeCosts.add((AlternativeCost)cost.copy()); + } + this.modes = ability.modes.copy(); + } + + @Override + public UUID getId() { + return id; + } + + @Override + public void newId() { + this.id = UUID.randomUUID(); + getEffects().newId(); + } + + @Override + public void newOriginalId() { + this.id = UUID.randomUUID(); + this.originalId = id; + getEffects().newId(); + } + + @Override + public AbilityType getAbilityType() { + return this.abilityType; + } + + @Override + public boolean resolve(Game game) { + boolean result = true; + //20100716 - 117.12 + if (checkIfClause(game)) { + for (Effect effect: getEffects()) { + if (effect instanceof OneShotEffect) { + if (!(effect instanceof PostResolveEffect)) + result &= effect.apply(game, this); + } + else { + game.addEffect((ContinuousEffect) effect, this); + } + } + } + return result; + } + + @Override + public boolean activate(Game game, boolean noMana) { + // 20110204 - 700.2 + if (!modes.choose(game, this)) + return false; + //20100716 - 601.2b + if (getChoices().size() > 0 && getChoices().choose(game, this) == false) { + logger.debug("activate failed - choice"); + return false; + } + //20100716 - 601.2b + if (getTargets().size() > 0 && getTargets().chooseTargets(getEffects().get(0).getOutcome(), this.controllerId, this, game) == false) { + logger.debug("activate failed - target"); + return false; + } for (Cost cost : optionalCosts) { if (cost instanceof KickerManaCost) { @@ -179,7 +179,7 @@ public abstract class AbilityImpl> implements Ability { } } } - //20100716 - 601.2e + //20100716 - 601.2e Card card = game.getCard(sourceId); if (card != null) { card.adjustCosts(this, game); @@ -192,183 +192,183 @@ public abstract class AbilityImpl> implements Ability { // this is a hack to prevent mana abilities with mana costs from causing endless loops - pay other costs first if (this instanceof ManaAbility && !costs.pay(this, game, sourceId, controllerId, noMana)) { - logger.debug("activate mana ability failed - non mana costs"); - return false; + logger.debug("activate mana ability failed - non mana costs"); + return false; } - - if (!useAlternativeCost(game)) { - //20101001 - 601.2e - game.getContinuousEffects().costModification(this, game); - - //20100716 - 601.2f - if (!manaCostsToPay.pay(this, game, sourceId, controllerId, noMana)) { - logger.debug("activate failed - mana"); - return false; - } - } - //20100716 - 601.2g - if (!costs.pay(this, game, sourceId, controllerId, noMana)) { - logger.debug("activate failed - non mana costs"); - return false; - } - return true; - } - @Override - public void reset(Game game) {} + if (!useAlternativeCost(game)) { + //20101001 - 601.2e + game.getContinuousEffects().costModification(this, game); - protected boolean useAlternativeCost(Game game) { - for (AlternativeCost cost: alternativeCosts) { - if (cost.isAvailable(game, this)) { - if (game.getPlayer(this.controllerId).chooseUse(Outcome.Neutral, "Use alternative cost " + cost.getName(), game)) - return cost.pay(this, game, sourceId, controllerId, false); - } - } - return false; - } + //20100716 - 601.2f + if (!manaCostsToPay.pay(this, game, sourceId, controllerId, noMana)) { + logger.debug("activate failed - mana"); + return false; + } + } + //20100716 - 601.2g + if (!costs.pay(this, game, sourceId, controllerId, noMana)) { + logger.debug("activate failed - non mana costs"); + return false; + } + return true; + } - @Override - public boolean checkIfClause(Game game) { - return true; - } - - @Override - public UUID getControllerId() { - return controllerId; - } - - @Override - public void setControllerId(UUID controllerId) { - this.controllerId = controllerId; - } - - - @Override - public UUID getSourceId() { - return sourceId; - } - - @Override - public void setSourceId(UUID sourceId) { - this.sourceId = sourceId; - } - - @Override - public Costs getCosts() { - return costs; - } - - @Override - public ManaCosts getManaCosts() { - return manaCosts; - } - - /** - * Should be used by {@link mage.abilities.effects.CostModificationEffect cost modification effects} - * to manipulate what is actually paid before resolution. - * - * @return - */ @Override - public ManaCosts getManaCostsToPay ( ) { - return manaCostsToPay; - } + public void reset(Game game) {} - @Override - public List getAlternativeCosts() { - return alternativeCosts; - } + protected boolean useAlternativeCost(Game game) { + for (AlternativeCost cost: alternativeCosts) { + if (cost.isAvailable(game, this)) { + if (game.getPlayer(this.controllerId).chooseUse(Outcome.Neutral, "Use alternative cost " + cost.getName(), game)) + return cost.pay(this, game, sourceId, controllerId, false); + } + } + return false; + } - @Override - public Costs getOptionalCosts() { - return optionalCosts; - } + @Override + public boolean checkIfClause(Game game) { + return true; + } - @Override - public Effects getEffects() { - return modes.getMode().getEffects(); - } + @Override + public UUID getControllerId() { + return controllerId; + } - @Override - public Effects getEffects(Game game, EffectType effectType) { - Effects typedEffects = new Effects(); - for (Effect effect: getEffects()) { - if (effect.getEffectType() == effectType) { - typedEffects.add(effect); - } - } - return typedEffects; - } + @Override + public void setControllerId(UUID controllerId) { + this.controllerId = controllerId; + } - @Override - public Choices getChoices() { - return modes.getMode().getChoices(); - } - @Override - public Zone getZone() { - return zone; - } + @Override + public UUID getSourceId() { + return sourceId; + } - @Override - public boolean isUsesStack() { - return usesStack; - } + @Override + public void setSourceId(UUID sourceId) { + this.sourceId = sourceId; + } - @Override - public String getRule() { - return getRule(false); - } + @Override + public Costs getCosts() { + return costs; + } - @Override - public String getRule(boolean all) { - StringBuilder sbRule = new StringBuilder(); + @Override + public ManaCosts getManaCosts() { + return manaCosts; + } - if (all || this.abilityType != AbilityType.SPELL) { - if (manaCosts.size() > 0) { - sbRule.append(manaCosts.getText()); - } - if (costs.size() > 0) { - if (sbRule.length() > 0) { - sbRule.append(","); - } - sbRule.append(costs.getText()); - } - if (sbRule.length() > 0) { - sbRule.append(": "); - } - } - else if (this.alternativeCosts.size() > 0) { - for (AlternativeCost cost: alternativeCosts) { - sbRule.append(cost.getText()).append("\n"); - } - } - else { - for (Cost cost: this.costs) { - if (!(cost instanceof ManaCost)) { - sbRule.append("As an additional cost to cast {this}, ").append(cost.getText()).append("\n"); - } - } - } + /** + * Should be used by {@link mage.abilities.effects.CostModificationEffect cost modification effects} + * to manipulate what is actually paid before resolution. + * + * @return + */ + @Override + public ManaCosts getManaCostsToPay ( ) { + return manaCostsToPay; + } - sbRule.append(modes.getText()); + @Override + public List getAlternativeCosts() { + return alternativeCosts; + } - return sbRule.toString(); - } + @Override + public Costs getOptionalCosts() { + return optionalCosts; + } - @Override - public String getRule(String source) { - return formatRule(getRule(), source); - } + @Override + public Effects getEffects() { + return modes.getMode().getEffects(); + } - protected String formatRule(String rule, String source) { - String replace = rule.replace("{this}", source); - replace = replace.replace("{source}", source); - return replace; - } + @Override + public Effects getEffects(Game game, EffectType effectType) { + Effects typedEffects = new Effects(); + for (Effect effect: getEffects()) { + if (effect.getEffectType() == effectType) { + typedEffects.add(effect); + } + } + return typedEffects; + } - @Override - public void addCost(Cost cost) { + @Override + public Choices getChoices() { + return modes.getMode().getChoices(); + } + + @Override + public Zone getZone() { + return zone; + } + + @Override + public boolean isUsesStack() { + return usesStack; + } + + @Override + public String getRule() { + return getRule(false); + } + + @Override + public String getRule(boolean all) { + StringBuilder sbRule = new StringBuilder(); + + if (all || this.abilityType != AbilityType.SPELL) { + if (manaCosts.size() > 0) { + sbRule.append(manaCosts.getText()); + } + if (costs.size() > 0) { + if (sbRule.length() > 0) { + sbRule.append(","); + } + sbRule.append(costs.getText()); + } + if (sbRule.length() > 0) { + sbRule.append(": "); + } + } + else if (this.alternativeCosts.size() > 0) { + for (AlternativeCost cost: alternativeCosts) { + sbRule.append(cost.getText()).append("\n"); + } + } + else { + for (Cost cost: this.costs) { + if (!(cost instanceof ManaCost)) { + sbRule.append("As an additional cost to cast {this}, ").append(cost.getText()).append("\n"); + } + } + } + + sbRule.append(modes.getText()); + + return sbRule.toString(); + } + + @Override + public String getRule(String source) { + return formatRule(getRule(), source); + } + + protected String formatRule(String rule, String source) { + String replace = rule.replace("{this}", source); + replace = replace.replace("{source}", source); + return replace; + } + + @Override + public void addCost(Cost cost) { if (cost != null) { if (cost instanceof ManaCost) { this.addManaCost((ManaCost)cost); @@ -377,76 +377,76 @@ public abstract class AbilityImpl> implements Ability { this.costs.add(cost); } } - } + } - @Override - public void addManaCost(ManaCost cost) { - if (cost != null) { - this.manaCosts.add(cost); - this.manaCostsToPay.add(cost); - } - } + @Override + public void addManaCost(ManaCost cost) { + if (cost != null) { + this.manaCosts.add(cost); + this.manaCostsToPay.add(cost); + } + } - @Override - public void addAlternativeCost(AlternativeCost cost) { - if (cost != null) { - this.alternativeCosts.add(cost); - } - } + @Override + public void addAlternativeCost(AlternativeCost cost) { + if (cost != null) { + this.alternativeCosts.add(cost); + } + } - @Override - public void addOptionalCost(Cost cost) { - if (cost != null) { - this.optionalCosts.add(cost); - } - } + @Override + public void addOptionalCost(Cost cost) { + if (cost != null) { + this.optionalCosts.add(cost); + } + } - @Override - public void addEffect(Effect effect) { - if (effect != null) { - getEffects().add(effect); - } - } + @Override + public void addEffect(Effect effect) { + if (effect != null) { + getEffects().add(effect); + } + } - @Override - public void addTarget(Target target) { - if (target != null) { - getTargets().add(target); - } - } + @Override + public void addTarget(Target target) { + if (target != null) { + getTargets().add(target); + } + } - @Override - public void addChoice(Choice choice) { - if (choice != null) { - getChoices().add(choice); - } - } + @Override + public void addChoice(Choice choice) { + if (choice != null) { + getChoices().add(choice); + } + } - @Override - public Targets getTargets() { - return modes.getMode().getTargets(); - } + @Override + public Targets getTargets() { + return modes.getMode().getTargets(); + } - @Override - public UUID getFirstTarget() { - return getTargets().getFirstTarget(); - } + @Override + public UUID getFirstTarget() { + return getTargets().getFirstTarget(); + } + + @Override + public boolean isModal() { + return this.modes.size() > 1; + } + + @Override + public void addMode(Mode mode) { + this.modes.addMode(mode); + } + + @Override + public Modes getModes() { + return modes; + } - @Override - public boolean isModal() { - return this.modes.size() > 1; - } - - @Override - public void addMode(Mode mode) { - this.modes.addMode(mode); - } - - @Override - public Modes getModes() { - return modes; - } - @Override public boolean canChooseTarget(Game game) { for (Mode mode: modes.values()) { @@ -455,7 +455,7 @@ public abstract class AbilityImpl> implements Ability { } return false; } - + @Override public boolean isInUseableZone(Game game, boolean checkLKI) { @@ -476,9 +476,9 @@ public abstract class AbilityImpl> implements Ability { Zone test = game.getState().getZone(sourceId); return test != null && zone.match(test); } - - @Override - public String toString() { - return getRule(); - } + + @Override + public String toString() { + return getRule(); + } } diff --git a/Mage/src/mage/abilities/ActivatedAbility.java b/Mage/src/mage/abilities/ActivatedAbility.java index f6379bdd22..40dc49830f 100644 --- a/Mage/src/mage/abilities/ActivatedAbility.java +++ b/Mage/src/mage/abilities/ActivatedAbility.java @@ -37,7 +37,7 @@ import mage.game.Game; */ public interface ActivatedAbility extends Ability { - public boolean canActivate(UUID playerId, Game game); - public String getActivatedMessage(Game game); - + public boolean canActivate(UUID playerId, Game game); + public String getActivatedMessage(Game game); + } diff --git a/Mage/src/mage/abilities/ActivatedAbilityImpl.java b/Mage/src/mage/abilities/ActivatedAbilityImpl.java index 3d32511fa3..9bb9a4be1c 100644 --- a/Mage/src/mage/abilities/ActivatedAbilityImpl.java +++ b/Mage/src/mage/abilities/ActivatedAbilityImpl.java @@ -49,145 +49,145 @@ import mage.target.Target; */ public abstract class ActivatedAbilityImpl> extends AbilityImpl implements ActivatedAbility { - protected TimingRule timing = TimingRule.INSTANT; + protected TimingRule timing = TimingRule.INSTANT; - protected ActivatedAbilityImpl(AbilityType abilityType, Zone zone) { - super(abilityType, zone); - } + protected ActivatedAbilityImpl(AbilityType abilityType, Zone zone) { + super(abilityType, zone); + } - public ActivatedAbilityImpl(ActivatedAbilityImpl ability) { - super(ability); - timing = ability.timing; - } + public ActivatedAbilityImpl(ActivatedAbilityImpl ability) { + super(ability); + timing = ability.timing; + } - public ActivatedAbilityImpl(Zone zone) { - this(zone, null); - } + public ActivatedAbilityImpl(Zone zone) { + this(zone, null); + } - public ActivatedAbilityImpl(Zone zone, Effect effect) { - super(AbilityType.ACTIVATED, zone); - if (effect != null) { - this.addEffect(effect); - } - } + public ActivatedAbilityImpl(Zone zone, Effect effect) { + super(AbilityType.ACTIVATED, zone); + if (effect != null) { + this.addEffect(effect); + } + } - public ActivatedAbilityImpl(Zone zone, Effect effect, ManaCosts cost) { - super(AbilityType.ACTIVATED, zone); - if (effect != null) { - this.addEffect(effect); - } - if (cost != null) - this.addManaCost(cost); - } + public ActivatedAbilityImpl(Zone zone, Effect effect, ManaCosts cost) { + super(AbilityType.ACTIVATED, zone); + if (effect != null) { + this.addEffect(effect); + } + if (cost != null) + this.addManaCost(cost); + } - public ActivatedAbilityImpl(Zone zone, Effects effects, ManaCosts cost) { - super(AbilityType.ACTIVATED, zone); - if (effects != null) { - for (Effect effect: effects) { - this.addEffect(effect); - } - } - if (cost != null) - this.addManaCost(cost); - } + public ActivatedAbilityImpl(Zone zone, Effects effects, ManaCosts cost) { + super(AbilityType.ACTIVATED, zone); + if (effects != null) { + for (Effect effect: effects) { + this.addEffect(effect); + } + } + if (cost != null) + this.addManaCost(cost); + } - public ActivatedAbilityImpl(Zone zone, Effect effect, Cost cost) { - super(AbilityType.ACTIVATED, zone); - if (effect != null) { - this.addEffect(effect); - } - if (cost != null) { - if (cost instanceof PhyrexianManaCost) { - this.addManaCost((PhyrexianManaCost)cost); - } else { - this.addCost(cost); - } - } - } + public ActivatedAbilityImpl(Zone zone, Effect effect, Cost cost) { + super(AbilityType.ACTIVATED, zone); + if (effect != null) { + this.addEffect(effect); + } + if (cost != null) { + if (cost instanceof PhyrexianManaCost) { + this.addManaCost((PhyrexianManaCost)cost); + } else { + this.addCost(cost); + } + } + } - public ActivatedAbilityImpl(Zone zone, Effect effect, Costs costs) { - super(AbilityType.ACTIVATED, zone); - if (effect != null) { - this.addEffect(effect); - } - if (costs != null) { - for (Cost cost: costs) { - this.addCost(cost); - } - } - } + public ActivatedAbilityImpl(Zone zone, Effect effect, Costs costs) { + super(AbilityType.ACTIVATED, zone); + if (effect != null) { + this.addEffect(effect); + } + if (costs != null) { + for (Cost cost: costs) { + this.addCost(cost); + } + } + } - public ActivatedAbilityImpl(Zone zone, Effects effects, Cost cost) { - super(AbilityType.ACTIVATED, zone); - if (effects != null) { - for (Effect effect: effects) { - this.addEffect(effect); - } - } - if (cost != null) - this.addCost(cost); - } + public ActivatedAbilityImpl(Zone zone, Effects effects, Cost cost) { + super(AbilityType.ACTIVATED, zone); + if (effects != null) { + for (Effect effect: effects) { + this.addEffect(effect); + } + } + if (cost != null) + this.addCost(cost); + } - public ActivatedAbilityImpl(Zone zone, Effects effects, Costs costs) { - super(AbilityType.ACTIVATED, zone); - for (Effect effect: effects) { - if (effect != null) { - this.addEffect(effect); - } - } - if (costs != null) { - for (Cost cost: costs) { - this.addCost(cost); - } - } - } + public ActivatedAbilityImpl(Zone zone, Effects effects, Costs costs) { + super(AbilityType.ACTIVATED, zone); + for (Effect effect: effects) { + if (effect != null) { + this.addEffect(effect); + } + } + if (costs != null) { + for (Cost cost: costs) { + this.addCost(cost); + } + } + } - @Override - public boolean canActivate(UUID playerId, Game game) { - //20091005 - 602.2 - if (!controlsAbility(playerId, game)) - return false; - //20091005 - 602.5d/602.5e - if (timing == TimingRule.INSTANT || game.canPlaySorcery(playerId)) { - if (costs.canPay(sourceId, controllerId, game) && canChooseTarget(game)) { - return true; - } - } - return false; - } + @Override + public boolean canActivate(UUID playerId, Game game) { + //20091005 - 602.2 + if (!controlsAbility(playerId, game)) + return false; + //20091005 - 602.5d/602.5e + if (timing == TimingRule.INSTANT || game.canPlaySorcery(playerId)) { + if (costs.canPay(sourceId, controllerId, game) && canChooseTarget(game)) { + return true; + } + } + return false; + } - protected boolean controlsAbility(UUID playerId, Game game) { - if (this.controllerId != null && this.controllerId.equals(playerId)) - return true; - else { - Card card = (Card)game.getObject(this.sourceId); - if (card != null && game.getState().getZone(this.sourceId) != Zone.BATTLEFIELD) - return card.getOwnerId().equals(playerId); - } - return false; - } + protected boolean controlsAbility(UUID playerId, Game game) { + if (this.controllerId != null && this.controllerId.equals(playerId)) + return true; + else { + Card card = (Card)game.getObject(this.sourceId); + if (card != null && game.getState().getZone(this.sourceId) != Zone.BATTLEFIELD) + return card.getOwnerId().equals(playerId); + } + return false; + } - @Override - public String getActivatedMessage(Game game) { + @Override + public String getActivatedMessage(Game game) { if (game.isSimulation()) return ""; - return " activates ability from " + getMessageText(game); - } + return " activates ability from " + getMessageText(game); + } - protected String getMessageText(Game game) { - StringBuilder sb = new StringBuilder(); + protected String getMessageText(Game game) { + StringBuilder sb = new StringBuilder(); MageObject object = game.getObject(this.sourceId); if (object != null) sb.append(object.getName()); else sb.append("unknown"); - if (getTargets().size() > 0) { - sb.append(" targeting "); - for (Target target: getTargets()) { - sb.append(target.getTargetedName(game)); - } - } - return sb.toString(); - } + if (getTargets().size() > 0) { + sb.append(" targeting "); + for (Target target: getTargets()) { + sb.append(target.getTargetedName(game)); + } + } + return sb.toString(); + } } diff --git a/Mage/src/mage/abilities/DelayedTriggeredAbilities.java b/Mage/src/mage/abilities/DelayedTriggeredAbilities.java index 08eb41edab..27da73e8cf 100644 --- a/Mage/src/mage/abilities/DelayedTriggeredAbilities.java +++ b/Mage/src/mage/abilities/DelayedTriggeredAbilities.java @@ -39,18 +39,18 @@ import mage.game.events.GameEvent; */ public class DelayedTriggeredAbilities extends AbilitiesImpl { - public DelayedTriggeredAbilities() {} + public DelayedTriggeredAbilities() {} - public DelayedTriggeredAbilities(final DelayedTriggeredAbilities abilities) { - super(abilities); - } + public DelayedTriggeredAbilities(final DelayedTriggeredAbilities abilities) { + super(abilities); + } - @Override - public DelayedTriggeredAbilities copy() { - return new DelayedTriggeredAbilities(this); - } - - public void checkTriggers(GameEvent event, Game game) { + @Override + public DelayedTriggeredAbilities copy() { + return new DelayedTriggeredAbilities(this); + } + + public void checkTriggers(GameEvent event, Game game) { if (this.size() > 0) { for (Iterator it = this.iterator();it.hasNext();) { DelayedTriggeredAbility ability = it.next(); @@ -60,7 +60,7 @@ import mage.game.events.GameEvent; } } } - } + } public void removeEndOfTurnAbilities() { for (Iterator it = this.iterator();it.hasNext();) { diff --git a/Mage/src/mage/abilities/DelayedTriggeredAbility.java b/Mage/src/mage/abilities/DelayedTriggeredAbility.java index af26f4e6c2..0ff19de5c7 100644 --- a/Mage/src/mage/abilities/DelayedTriggeredAbility.java +++ b/Mage/src/mage/abilities/DelayedTriggeredAbility.java @@ -39,23 +39,23 @@ import mage.abilities.effects.Effect; public abstract class DelayedTriggeredAbility> extends TriggeredAbilityImpl { private Duration duration; - + public DelayedTriggeredAbility(Effect effect) { this(effect, Duration.EndOfGame); - } + } public DelayedTriggeredAbility(Effect effect, Duration duration) { - super(Zone.ALL, effect); + super(Zone.ALL, effect); this.duration = duration; - } + } public DelayedTriggeredAbility(final DelayedTriggeredAbility ability) { - super(ability); + super(ability); this.duration = ability.duration; - } + } - @Override - public abstract T copy(); + @Override + public abstract T copy(); public Duration getDuration() { return duration; diff --git a/Mage/src/mage/abilities/EvasionAbility.java b/Mage/src/mage/abilities/EvasionAbility.java index 097e1bcacd..59839fec0f 100644 --- a/Mage/src/mage/abilities/EvasionAbility.java +++ b/Mage/src/mage/abilities/EvasionAbility.java @@ -37,12 +37,12 @@ import mage.Constants.Zone; */ public abstract class EvasionAbility> extends StaticAbility { - public EvasionAbility() { - super(AbilityType.EVASION, Zone.BATTLEFIELD); - } + public EvasionAbility() { + super(AbilityType.EVASION, Zone.BATTLEFIELD); + } - public EvasionAbility(final EvasionAbility ability) { - super(ability); - } + public EvasionAbility(final EvasionAbility ability) { + super(ability); + } } diff --git a/Mage/src/mage/abilities/LoyaltyAbility.java b/Mage/src/mage/abilities/LoyaltyAbility.java index f7fe07ea03..b23e7dcf06 100644 --- a/Mage/src/mage/abilities/LoyaltyAbility.java +++ b/Mage/src/mage/abilities/LoyaltyAbility.java @@ -41,32 +41,32 @@ import mage.abilities.effects.Effects; */ public class LoyaltyAbility extends ActivatedAbilityImpl { - public LoyaltyAbility(Effect effect, int loyalty) { - super(Zone.BATTLEFIELD, effect, new PayLoyaltyCost(loyalty)); - this.timing = TimingRule.SORCERY; - } + public LoyaltyAbility(Effect effect, int loyalty) { + super(Zone.BATTLEFIELD, effect, new PayLoyaltyCost(loyalty)); + this.timing = TimingRule.SORCERY; + } - public LoyaltyAbility(Effects effects, int loyalty) { - super(Zone.BATTLEFIELD, effects, new PayLoyaltyCost(loyalty)); - this.timing = TimingRule.SORCERY; - } + public LoyaltyAbility(Effects effects, int loyalty) { + super(Zone.BATTLEFIELD, effects, new PayLoyaltyCost(loyalty)); + this.timing = TimingRule.SORCERY; + } - public LoyaltyAbility(Effect effect) { - super(Zone.BATTLEFIELD, effect, new PayVariableLoyaltyCost()); - this.timing = TimingRule.SORCERY; - } + public LoyaltyAbility(Effect effect) { + super(Zone.BATTLEFIELD, effect, new PayVariableLoyaltyCost()); + this.timing = TimingRule.SORCERY; + } - public LoyaltyAbility(Effects effects) { - super(Zone.BATTLEFIELD, effects, new PayVariableLoyaltyCost()); - this.timing = TimingRule.SORCERY; - } - public LoyaltyAbility(LoyaltyAbility ability) { - super(ability); - } + public LoyaltyAbility(Effects effects) { + super(Zone.BATTLEFIELD, effects, new PayVariableLoyaltyCost()); + this.timing = TimingRule.SORCERY; + } + public LoyaltyAbility(LoyaltyAbility ability) { + super(ability); + } - @Override - public LoyaltyAbility copy() { - return new LoyaltyAbility(this); - } + @Override + public LoyaltyAbility copy() { + return new LoyaltyAbility(this); + } } diff --git a/Mage/src/mage/abilities/Mode.java b/Mage/src/mage/abilities/Mode.java index 33641e64f1..6476050ef9 100644 --- a/Mage/src/mage/abilities/Mode.java +++ b/Mage/src/mage/abilities/Mode.java @@ -39,42 +39,42 @@ import mage.target.Targets; */ public class Mode implements Serializable { - protected UUID id; - protected Targets targets; - protected Choices choices; - protected Effects effects; - - public Mode() { - this.id = UUID.randomUUID(); - this.targets = new Targets(); - this.choices = new Choices(); - this.effects = new Effects(); - } - - public Mode(Mode mode) { - this.id = mode.id; - this.targets = mode.targets.copy(); - this.choices = mode.choices.copy(); - this.effects = mode.effects.copy(); - } - - public Mode copy() { - return new Mode(this); - } - - public UUID getId() { - return id; - } - - public Targets getTargets() { - return targets; - } - - public Choices getChoices() { - return choices; - } - - public Effects getEffects() { - return effects; - } + protected UUID id; + protected Targets targets; + protected Choices choices; + protected Effects effects; + + public Mode() { + this.id = UUID.randomUUID(); + this.targets = new Targets(); + this.choices = new Choices(); + this.effects = new Effects(); + } + + public Mode(Mode mode) { + this.id = mode.id; + this.targets = mode.targets.copy(); + this.choices = mode.choices.copy(); + this.effects = mode.effects.copy(); + } + + public Mode copy() { + return new Mode(this); + } + + public UUID getId() { + return id; + } + + public Targets getTargets() { + return targets; + } + + public Choices getChoices() { + return choices; + } + + public Effects getEffects() { + return effects; + } } diff --git a/Mage/src/mage/abilities/Modes.java b/Mage/src/mage/abilities/Modes.java index 3787910355..4c71febefe 100644 --- a/Mage/src/mage/abilities/Modes.java +++ b/Mage/src/mage/abilities/Modes.java @@ -38,75 +38,75 @@ import mage.players.Player; * @author BetaSteward_at_googlemail.com */ public class Modes extends HashMap { - - private UUID modeId; - - public Modes() { - Mode mode = new Mode(); - this.put(mode.getId(), mode); - this.modeId = mode.getId(); - } - - public Modes(Modes modes) { - this.modeId = modes.modeId; + + private UUID modeId; + + public Modes() { + Mode mode = new Mode(); + this.put(mode.getId(), mode); + this.modeId = mode.getId(); + } + + public Modes(Modes modes) { + this.modeId = modes.modeId; for (Map.Entry entry: modes.entrySet()) { this.put(entry.getKey(), entry.getValue().copy()); - } - } - - public Modes copy() { - return new Modes(this); - } - - public Mode getMode() { - return get(modeId); - } - - public void setMode(Mode mode) { - if (this.containsKey(mode.getId())) - this.modeId = mode.getId(); - } - - public void addMode(Mode mode) { - this.put(mode.getId(), mode); - } - - public boolean choose(Game game, Ability source) { - if (this.size() > 1) { - Player player = game.getPlayer(source.getControllerId()); - Mode choice = player.chooseMode(this, source, game); - if (choice == null) - return false; - setMode(choice); - return true; - } - this.modeId = this.values().iterator().next().getId(); - return true; - } - - public String getText() { - StringBuilder sb = new StringBuilder(); - if (this.size() > 1) - sb.append("Choose one - "); - for (Mode mode: this.values()) { - sb.append(mode.getEffects().getText(mode)).append("; or "); - } - sb.delete(sb.length() - 5, sb.length()); - return sb.toString(); - } + } + } - public String getText(String sourceName) { - StringBuilder sb = new StringBuilder(); - if (this.size() > 1) - sb.append("Choose one - "); - for (Mode mode: this.values()) { - sb.append(mode.getEffects().getText(mode)).append("; or "); - } - sb.delete(sb.length() - 5, sb.length()); - String text = sb.toString(); - text = text.replace("{this}", sourceName); - text = text.replace("{source}", sourceName); - return text; - } + public Modes copy() { + return new Modes(this); + } + + public Mode getMode() { + return get(modeId); + } + + public void setMode(Mode mode) { + if (this.containsKey(mode.getId())) + this.modeId = mode.getId(); + } + + public void addMode(Mode mode) { + this.put(mode.getId(), mode); + } + + public boolean choose(Game game, Ability source) { + if (this.size() > 1) { + Player player = game.getPlayer(source.getControllerId()); + Mode choice = player.chooseMode(this, source, game); + if (choice == null) + return false; + setMode(choice); + return true; + } + this.modeId = this.values().iterator().next().getId(); + return true; + } + + public String getText() { + StringBuilder sb = new StringBuilder(); + if (this.size() > 1) + sb.append("Choose one - "); + for (Mode mode: this.values()) { + sb.append(mode.getEffects().getText(mode)).append("; or "); + } + sb.delete(sb.length() - 5, sb.length()); + return sb.toString(); + } + + public String getText(String sourceName) { + StringBuilder sb = new StringBuilder(); + if (this.size() > 1) + sb.append("Choose one - "); + for (Mode mode: this.values()) { + sb.append(mode.getEffects().getText(mode)).append("; or "); + } + sb.delete(sb.length() - 5, sb.length()); + String text = sb.toString(); + text = text.replace("{this}", sourceName); + text = text.replace("{source}", sourceName); + return text; + } } diff --git a/Mage/src/mage/abilities/PlayLandAbility.java b/Mage/src/mage/abilities/PlayLandAbility.java index 5a367aace7..c52652d99c 100644 --- a/Mage/src/mage/abilities/PlayLandAbility.java +++ b/Mage/src/mage/abilities/PlayLandAbility.java @@ -39,40 +39,40 @@ import mage.game.Game; */ public class PlayLandAbility extends ActivatedAbilityImpl { - public PlayLandAbility(String cardName) { - super(AbilityType.PLAY_LAND, Zone.HAND); - this.usesStack = false; - this.name = "Play " + cardName; - } + public PlayLandAbility(String cardName) { + super(AbilityType.PLAY_LAND, Zone.HAND); + this.usesStack = false; + this.name = "Play " + cardName; + } - public PlayLandAbility(PlayLandAbility ability) { - super(ability); - } + public PlayLandAbility(PlayLandAbility ability) { + super(ability); + } - @Override - public boolean canActivate(UUID playerId, Game game) { - if (!controlsAbility(playerId, game)) - return false; - //20091005 - 114.2a - if (game.canPlaySorcery(playerId)) { - return game.getPlayer(playerId).canPlayLand(); - } - return false; - } + @Override + public boolean canActivate(UUID playerId, Game game) { + if (!controlsAbility(playerId, game)) + return false; + //20091005 - 114.2a + if (game.canPlaySorcery(playerId)) { + return game.getPlayer(playerId).canPlayLand(); + } + return false; + } - @Override - public String getActivatedMessage(Game game) { - return " plays " + getMessageText(game); - } + @Override + public String getActivatedMessage(Game game) { + return " plays " + getMessageText(game); + } - @Override - public String toString() { - return this.name; - } + @Override + public String toString() { + return this.name; + } - @Override - public PlayLandAbility copy() { - return new PlayLandAbility(this); - } + @Override + public PlayLandAbility copy() { + return new PlayLandAbility(this); + } } diff --git a/Mage/src/mage/abilities/SpecialAction.java b/Mage/src/mage/abilities/SpecialAction.java index a51206c174..c9ca81ab39 100644 --- a/Mage/src/mage/abilities/SpecialAction.java +++ b/Mage/src/mage/abilities/SpecialAction.java @@ -37,13 +37,13 @@ import mage.Constants.Zone; */ public abstract class SpecialAction> extends ActivatedAbilityImpl { - public SpecialAction() { - super(AbilityType.SPECIAL_ACTION, Zone.ALL); - this.usesStack = false; - } + public SpecialAction() { + super(AbilityType.SPECIAL_ACTION, Zone.ALL); + this.usesStack = false; + } - public SpecialAction(final SpecialAction action) { - super(action); - } + public SpecialAction(final SpecialAction action) { + super(action); + } } \ No newline at end of file diff --git a/Mage/src/mage/abilities/SpecialActions.java b/Mage/src/mage/abilities/SpecialActions.java index 0c6a3708a2..a48844318a 100644 --- a/Mage/src/mage/abilities/SpecialActions.java +++ b/Mage/src/mage/abilities/SpecialActions.java @@ -38,24 +38,24 @@ import java.util.UUID; */ public class SpecialActions extends AbilitiesImpl { - public SpecialActions() {} - - public SpecialActions(final SpecialActions actions) { - super(actions); - } + public SpecialActions() {} - public Map getControlledBy(UUID controllerId) { - HashMap controlledBy = new HashMap(); - for (SpecialAction action: this) { - if (action.getControllerId().equals(controllerId)) - controlledBy.put(action.id, action); - } - return controlledBy; - } + public SpecialActions(final SpecialActions actions) { + super(actions); + } - @Override - public SpecialActions copy() { - return new SpecialActions(this); - } + public Map getControlledBy(UUID controllerId) { + HashMap controlledBy = new HashMap(); + for (SpecialAction action: this) { + if (action.getControllerId().equals(controllerId)) + controlledBy.put(action.id, action); + } + return controlledBy; + } + + @Override + public SpecialActions copy() { + return new SpecialActions(this); + } } diff --git a/Mage/src/mage/abilities/SpellAbility.java b/Mage/src/mage/abilities/SpellAbility.java index bfb75dc0f6..79ef12685f 100644 --- a/Mage/src/mage/abilities/SpellAbility.java +++ b/Mage/src/mage/abilities/SpellAbility.java @@ -44,64 +44,64 @@ import mage.game.Game; */ public class SpellAbility extends ActivatedAbilityImpl { - public SpellAbility(ManaCost cost, String cardName) { - super(AbilityType.SPELL, Zone.HAND); - this.addManaCost(cost); - this.name = "Cast " + cardName; - } + public SpellAbility(ManaCost cost, String cardName) { + super(AbilityType.SPELL, Zone.HAND); + this.addManaCost(cost); + this.name = "Cast " + cardName; + } - public SpellAbility(SpellAbility ability) { - super(ability); - } + public SpellAbility(SpellAbility ability) { + super(ability); + } - @Override - public boolean canActivate(UUID playerId, Game game) { - MageObject object = game.getObject(sourceId); - if ((object.getCardType().contains(CardType.INSTANT) || - object.getAbilities().containsKey(FlashAbility.getInstance().getId()) || - game.getContinuousEffects().asThough(sourceId, AsThoughEffectType.CAST, game) || - game.canPlaySorcery(playerId))) { - if (costs.canPay(sourceId, controllerId, game) && canChooseTarget(game)) { - return true; - } - } - return false; - } + @Override + public boolean canActivate(UUID playerId, Game game) { + MageObject object = game.getObject(sourceId); + if ((object.getCardType().contains(CardType.INSTANT) || + object.getAbilities().containsKey(FlashAbility.getInstance().getId()) || + game.getContinuousEffects().asThough(sourceId, AsThoughEffectType.CAST, game) || + game.canPlaySorcery(playerId))) { + if (costs.canPay(sourceId, controllerId, game) && canChooseTarget(game)) { + return true; + } + } + return false; + } - @Override - public String getActivatedMessage(Game game) { - return " casts " + getMessageText(game); - } + @Override + public String getActivatedMessage(Game game) { + return " casts " + getMessageText(game); + } - @Override - public String getRule(boolean all) { - if (all) { - return super.getRule(all) + name; - } - return super.getRule(false); - } + @Override + public String getRule(boolean all) { + if (all) { + return super.getRule(all) + name; + } + return super.getRule(false); + } - public void clear() { - getChoices().clearChosen(); - getTargets().clearChosen(); - this.manaCosts.clearPaid(); - this.costs.clearPaid(); - } + public void clear() { + getChoices().clearChosen(); + getTargets().clearChosen(); + this.manaCosts.clearPaid(); + this.costs.clearPaid(); + } - @Override - public String toString() { - return this.name; - } + @Override + public String toString() { + return this.name; + } - @Override - public SpellAbility copy() { - return new SpellAbility(this); - } + @Override + public SpellAbility copy() { + return new SpellAbility(this); + } + + public SpellAbility copySpell() { + SpellAbility spell = new SpellAbility(this); + spell.id = UUID.randomUUID(); + return spell; + } - public SpellAbility copySpell() { - SpellAbility spell = new SpellAbility(this); - spell.id = UUID.randomUUID(); - return spell; - } - } diff --git a/Mage/src/mage/abilities/StateTriggeredAbility.java b/Mage/src/mage/abilities/StateTriggeredAbility.java index 42a4f9aca5..ea3fdf7108 100644 --- a/Mage/src/mage/abilities/StateTriggeredAbility.java +++ b/Mage/src/mage/abilities/StateTriggeredAbility.java @@ -39,34 +39,34 @@ import mage.game.Game; */ public abstract class StateTriggeredAbility> extends TriggeredAbilityImpl { - public StateTriggeredAbility(Zone zone, Effect effect) { - super(zone, effect); - } + public StateTriggeredAbility(Zone zone, Effect effect) { + super(zone, effect); + } - public StateTriggeredAbility(final StateTriggeredAbility ability) { - super(ability); - } + public StateTriggeredAbility(final StateTriggeredAbility ability) { + super(ability); + } - @Override - public void trigger(Game game, UUID controllerId) { - //20100716 - 603.8 - Boolean triggered = (Boolean) game.getState().getValue(this.id.toString() + "triggered"); - if (triggered == null) - triggered = Boolean.FALSE; - if (!triggered) { - game.getState().setValue(this.id.toString() + "triggered", Boolean.TRUE); - super.trigger(game, controllerId); - } - } + @Override + public void trigger(Game game, UUID controllerId) { + //20100716 - 603.8 + Boolean triggered = (Boolean) game.getState().getValue(this.id.toString() + "triggered"); + if (triggered == null) + triggered = Boolean.FALSE; + if (!triggered) { + game.getState().setValue(this.id.toString() + "triggered", Boolean.TRUE); + super.trigger(game, controllerId); + } + } - @Override - public boolean resolve(Game game) { - //20100716 - 603.8 - game.getState().setValue(this.id.toString() + "triggered", Boolean.FALSE); - return super.resolve(game); - } + @Override + public boolean resolve(Game game) { + //20100716 - 603.8 + game.getState().setValue(this.id.toString() + "triggered", Boolean.FALSE); + return super.resolve(game); + } - public void counter(Game game) { - game.getState().setValue(this.id.toString() + "triggered", Boolean.FALSE); - } + public void counter(Game game) { + game.getState().setValue(this.id.toString() + "triggered", Boolean.FALSE); + } } diff --git a/Mage/src/mage/abilities/StaticAbility.java b/Mage/src/mage/abilities/StaticAbility.java index f28a16853e..7f8f04d132 100644 --- a/Mage/src/mage/abilities/StaticAbility.java +++ b/Mage/src/mage/abilities/StaticAbility.java @@ -38,17 +38,17 @@ import mage.abilities.effects.Effect; */ public abstract class StaticAbility> extends AbilityImpl { - protected StaticAbility(AbilityType abilityType, Zone zone) { - super(abilityType, zone); - } + protected StaticAbility(AbilityType abilityType, Zone zone) { + super(abilityType, zone); + } - public StaticAbility(Zone zone, Effect effect) { - super(AbilityType.STATIC, zone); - if (effect != null) - this.addEffect(effect); - } + public StaticAbility(Zone zone, Effect effect) { + super(AbilityType.STATIC, zone); + if (effect != null) + this.addEffect(effect); + } - public StaticAbility(StaticAbility ability) { - super(ability); - } + public StaticAbility(StaticAbility ability) { + super(ability); + } } diff --git a/Mage/src/mage/abilities/TriggeredAbilities.java b/Mage/src/mage/abilities/TriggeredAbilities.java index b4e2516dd5..4f1098bf76 100644 --- a/Mage/src/mage/abilities/TriggeredAbilities.java +++ b/Mage/src/mage/abilities/TriggeredAbilities.java @@ -44,13 +44,13 @@ import java.util.UUID; */ public class TriggeredAbilities extends HashMap { - public TriggeredAbilities() {} + public TriggeredAbilities() {} - public TriggeredAbilities(final TriggeredAbilities abilities) { - for (Map.Entry entry: abilities.entrySet()) { + public TriggeredAbilities(final TriggeredAbilities abilities) { + for (Map.Entry entry: abilities.entrySet()) { this.put(entry.getKey(), entry.getValue().copy()); } - } + } public void checkTriggers(GameEvent event, Game game) { for (TriggeredAbility ability: this.values()) { @@ -99,9 +99,9 @@ public class TriggeredAbilities extends HashMap { public void add(TriggeredAbility ability) { this.put(ability.getId(), ability); } - - public TriggeredAbilities copy() { - return new TriggeredAbilities(this); - } + + public TriggeredAbilities copy() { + return new TriggeredAbilities(this); + } } diff --git a/Mage/src/mage/abilities/TriggeredAbility.java b/Mage/src/mage/abilities/TriggeredAbility.java index c24380a884..9037d8e368 100644 --- a/Mage/src/mage/abilities/TriggeredAbility.java +++ b/Mage/src/mage/abilities/TriggeredAbility.java @@ -38,10 +38,10 @@ import mage.game.events.GameEvent; */ public interface TriggeredAbility extends Ability { - public void trigger(Game game, UUID controllerId); - public boolean checkTrigger(GameEvent event, Game game); - public boolean checkInterveningIfClause(Game game); + public void trigger(Game game, UUID controllerId); + public boolean checkTrigger(GameEvent event, Game game); + public boolean checkInterveningIfClause(Game game); @Override public TriggeredAbility copy(); - + } diff --git a/Mage/src/mage/abilities/TriggeredAbilityImpl.java b/Mage/src/mage/abilities/TriggeredAbilityImpl.java index 9e3f5ef22e..bf6cb9e04f 100644 --- a/Mage/src/mage/abilities/TriggeredAbilityImpl.java +++ b/Mage/src/mage/abilities/TriggeredAbilityImpl.java @@ -42,60 +42,60 @@ import mage.players.Player; */ public abstract class TriggeredAbilityImpl> extends AbilityImpl implements TriggeredAbility { - protected boolean optional; + protected boolean optional; - public TriggeredAbilityImpl(Zone zone, Effect effect) { - this(zone, effect, false); - } - - public TriggeredAbilityImpl(Zone zone, Effect effect, boolean optional) { - super(AbilityType.TRIGGERED, zone); - if (effect != null) - addEffect(effect); - this.optional = optional; - } + public TriggeredAbilityImpl(Zone zone, Effect effect) { + this(zone, effect, false); + } - public TriggeredAbilityImpl(final TriggeredAbilityImpl ability) { - super(ability); - this.optional = ability.optional; - } + public TriggeredAbilityImpl(Zone zone, Effect effect, boolean optional) { + super(AbilityType.TRIGGERED, zone); + if (effect != null) + addEffect(effect); + this.optional = optional; + } - @Override - public void trigger(Game game, UUID controllerId) { - //20091005 - 603.4 - if (checkInterveningIfClause(game)) { - this.controllerId = controllerId; - game.addTriggeredAbility(this); - } - } + public TriggeredAbilityImpl(final TriggeredAbilityImpl ability) { + super(ability); + this.optional = ability.optional; + } - @Override - public boolean checkInterveningIfClause(Game game) { - return true; - } + @Override + public void trigger(Game game, UUID controllerId) { + //20091005 - 603.4 + if (checkInterveningIfClause(game)) { + this.controllerId = controllerId; + game.addTriggeredAbility(this); + } + } - @Override - public boolean resolve(Game game) { - if (optional) { - Player player = game.getPlayer(this.getControllerId()); - MageObject object = game.getObject(sourceId); - StringBuilder sb = new StringBuilder(); - if (object != null) { - sb.append("Use the following ability from ").append(object.getName()).append("? "); - sb.append(this.getRule(object.getName())); - } - else { - sb.append("Use the following ability? ").append(this.getRule()); - } - if (!player.chooseUse(getEffects().get(0).getOutcome(), sb.toString(), game)) { - return false; - } - } - //20091005 - 603.4 - if (checkInterveningIfClause(game)) - return super.resolve(game); - return false; - } + @Override + public boolean checkInterveningIfClause(Game game) { + return true; + } + + @Override + public boolean resolve(Game game) { + if (optional) { + Player player = game.getPlayer(this.getControllerId()); + MageObject object = game.getObject(sourceId); + StringBuilder sb = new StringBuilder(); + if (object != null) { + sb.append("Use the following ability from ").append(object.getName()).append("? "); + sb.append(this.getRule(object.getName())); + } + else { + sb.append("Use the following ability? ").append(this.getRule()); + } + if (!player.chooseUse(getEffects().get(0).getOutcome(), sb.toString(), game)) { + return false; + } + } + //20091005 - 603.4 + if (checkInterveningIfClause(game)) + return super.resolve(game); + return false; + } @Override public String getRule() { diff --git a/Mage/src/mage/abilities/common/ActivateOncePerTurnActivatedAbility.java b/Mage/src/mage/abilities/common/ActivateOncePerTurnActivatedAbility.java index bc685f877a..8dc017919d 100644 --- a/Mage/src/mage/abilities/common/ActivateOncePerTurnActivatedAbility.java +++ b/Mage/src/mage/abilities/common/ActivateOncePerTurnActivatedAbility.java @@ -41,58 +41,58 @@ import mage.game.Game; */ public class ActivateOncePerTurnActivatedAbility extends ActivatedAbilityImpl { - public ActivateOncePerTurnActivatedAbility(Zone zone, Effect effect, Cost cost) { - super(zone, effect, cost); - } + public ActivateOncePerTurnActivatedAbility(Zone zone, Effect effect, Cost cost) { + super(zone, effect, cost); + } - public ActivateOncePerTurnActivatedAbility(ActivateOncePerTurnActivatedAbility ability) { - super(ability); - } + public ActivateOncePerTurnActivatedAbility(ActivateOncePerTurnActivatedAbility ability) { + super(ability); + } - @Override - public boolean canActivate(UUID playerId, Game game) { - if (super.canActivate(playerId, game)) { - Boolean activated = (Boolean)game.getState().getValue(this.originalId.toString() + "activated"); - if (activated == null) - return true; - else - return !activated; - } - return false; - } + @Override + public boolean canActivate(UUID playerId, Game game) { + if (super.canActivate(playerId, game)) { + Boolean activated = (Boolean)game.getState().getValue(this.originalId.toString() + "activated"); + if (activated == null) + return true; + else + return !activated; + } + return false; + } - @Override - public boolean activate(Game game, boolean noMana) { - if (canActivate(this.controllerId, game)) { - if (super.activate(game, noMana)) { - game.getState().setValue(this.originalId.toString() + "activated", Boolean.TRUE); - return true; - } - } - return false; - } + @Override + public boolean activate(Game game, boolean noMana) { + if (canActivate(this.controllerId, game)) { + if (super.activate(game, noMana)) { + game.getState().setValue(this.originalId.toString() + "activated", Boolean.TRUE); + return true; + } + } + return false; + } - @Override - public void reset(Game game) { - game.getState().setValue(this.originalId.toString() + "activated", Boolean.FALSE); - } + @Override + public void reset(Game game) { + game.getState().setValue(this.originalId.toString() + "activated", Boolean.FALSE); + } - @Override - public boolean resolve(Game game) { - if (super.resolve(game)) { - return true; - } - return false; - } + @Override + public boolean resolve(Game game) { + if (super.resolve(game)) { + return true; + } + return false; + } - @Override - public String getRule() { - return super.getRule() + " Activate this ability only once each turn."; - } + @Override + public String getRule() { + return super.getRule() + " Activate this ability only once each turn."; + } - @Override - public ActivateOncePerTurnActivatedAbility copy() { - return new ActivateOncePerTurnActivatedAbility(this); - } + @Override + public ActivateOncePerTurnActivatedAbility copy() { + return new ActivateOncePerTurnActivatedAbility(this); + } } diff --git a/Mage/src/mage/abilities/common/AttacksEachTurnStaticAbility.java b/Mage/src/mage/abilities/common/AttacksEachTurnStaticAbility.java index de98170371..2607420845 100644 --- a/Mage/src/mage/abilities/common/AttacksEachTurnStaticAbility.java +++ b/Mage/src/mage/abilities/common/AttacksEachTurnStaticAbility.java @@ -39,17 +39,17 @@ import mage.abilities.effects.common.AttacksIfAbleSourceEffect; */ public class AttacksEachTurnStaticAbility extends StaticAbility { - public AttacksEachTurnStaticAbility() { - super(Zone.BATTLEFIELD, new AttacksIfAbleSourceEffect(Duration.WhileOnBattlefield)); - } + public AttacksEachTurnStaticAbility() { + super(Zone.BATTLEFIELD, new AttacksIfAbleSourceEffect(Duration.WhileOnBattlefield)); + } - public AttacksEachTurnStaticAbility(AttacksEachTurnStaticAbility ability) { - super(ability); - } + public AttacksEachTurnStaticAbility(AttacksEachTurnStaticAbility ability) { + super(ability); + } + + @Override + public AttacksEachTurnStaticAbility copy() { + return new AttacksEachTurnStaticAbility(this); + } - @Override - public AttacksEachTurnStaticAbility copy() { - return new AttacksEachTurnStaticAbility(this); - } - } diff --git a/Mage/src/mage/abilities/common/AttacksOrBlocksTriggeredAbility.java b/Mage/src/mage/abilities/common/AttacksOrBlocksTriggeredAbility.java index 7e70de2a4f..bb1966d806 100644 --- a/Mage/src/mage/abilities/common/AttacksOrBlocksTriggeredAbility.java +++ b/Mage/src/mage/abilities/common/AttacksOrBlocksTriggeredAbility.java @@ -8,12 +8,12 @@ import mage.game.events.GameEvent; public class AttacksOrBlocksTriggeredAbility extends TriggeredAbilityImpl { public AttacksOrBlocksTriggeredAbility(Effect effect, boolean optional) { - super(Constants.Zone.BATTLEFIELD, effect, optional); - } + super(Constants.Zone.BATTLEFIELD, effect, optional); + } public AttacksOrBlocksTriggeredAbility(final AttacksOrBlocksTriggeredAbility ability) { - super(ability); - } + super(ability); + } @Override public AttacksOrBlocksTriggeredAbility copy() { @@ -21,9 +21,9 @@ public class AttacksOrBlocksTriggeredAbility extends TriggeredAbilityImpl { - public AttacksTriggeredAbility(Effect effect, boolean optional) { - super(Zone.BATTLEFIELD, effect, optional); - } + public AttacksTriggeredAbility(Effect effect, boolean optional) { + super(Zone.BATTLEFIELD, effect, optional); + } - public AttacksTriggeredAbility(final AttacksTriggeredAbility ability) { - super(ability); - } + public AttacksTriggeredAbility(final AttacksTriggeredAbility ability) { + super(ability); + } - @Override - public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == EventType.ATTACKER_DECLARED && event.getSourceId().equals(this.getSourceId()) ) { - return true; - } - return false; - } + @Override + public boolean checkTrigger(GameEvent event, Game game) { + if (event.getType() == EventType.ATTACKER_DECLARED && event.getSourceId().equals(this.getSourceId()) ) { + return true; + } + return false; + } - @Override - public String getRule() { - return "When {this} attacks, " + super.getRule(); - } + @Override + public String getRule() { + return "When {this} attacks, " + super.getRule(); + } - @Override - public AttacksTriggeredAbility copy() { - return new AttacksTriggeredAbility(this); - } + @Override + public AttacksTriggeredAbility copy() { + return new AttacksTriggeredAbility(this); + } } diff --git a/Mage/src/mage/abilities/common/BeginningOfCombatTriggeredAbility.java b/Mage/src/mage/abilities/common/BeginningOfCombatTriggeredAbility.java index 3e822afad2..83c03c76ec 100644 --- a/Mage/src/mage/abilities/common/BeginningOfCombatTriggeredAbility.java +++ b/Mage/src/mage/abilities/common/BeginningOfCombatTriggeredAbility.java @@ -52,7 +52,7 @@ public class BeginningOfCombatTriggeredAbility extends TriggeredAbilityImpl { - public CantBlockEffect() { - super(Duration.WhileOnBattlefield); - } + public CantBlockEffect() { + super(Duration.WhileOnBattlefield); + } - public CantBlockEffect(final CantBlockEffect effect) { - super(effect); - } + public CantBlockEffect(final CantBlockEffect effect) { + super(effect); + } - @Override - public boolean applies(Permanent permanent, Ability source, Game game) { - return permanent.getAbilities().containsKey(CantBlockAbility.getInstance().getId()) || source.getId().equals(CantBlockAbility.getInstance().getId()); - } + @Override + public boolean applies(Permanent permanent, Ability source, Game game) { + return permanent.getAbilities().containsKey(CantBlockAbility.getInstance().getId()) || source.getId().equals(CantBlockAbility.getInstance().getId()); + } - @Override - public boolean canBlock(Permanent attacker, Permanent blocker, Ability source, Game game) { - return !blocker.getAbilities().containsKey(CantBlockAbility.getInstance().getId()); - } + @Override + public boolean canBlock(Permanent attacker, Permanent blocker, Ability source, Game game) { + return !blocker.getAbilities().containsKey(CantBlockAbility.getInstance().getId()); + } - @Override - public CantBlockEffect copy() { - return new CantBlockEffect(this); - } + @Override + public CantBlockEffect copy() { + return new CantBlockEffect(this); + } } diff --git a/Mage/src/mage/abilities/common/CantCounterAbility.java b/Mage/src/mage/abilities/common/CantCounterAbility.java index 75dc0751d3..b7670c595b 100644 --- a/Mage/src/mage/abilities/common/CantCounterAbility.java +++ b/Mage/src/mage/abilities/common/CantCounterAbility.java @@ -38,21 +38,21 @@ import mage.abilities.effects.common.CantCounterSourceEffect; */ public class CantCounterAbility extends StaticAbility { - public CantCounterAbility() { - super(Zone.STACK, new CantCounterSourceEffect()); - } + public CantCounterAbility() { + super(Zone.STACK, new CantCounterSourceEffect()); + } - public CantCounterAbility(CantCounterAbility ability) { - super(ability); - } + public CantCounterAbility(CantCounterAbility ability) { + super(ability); + } - @Override - public String getRule() { - return "{this} can't be countered."; - } + @Override + public String getRule() { + return "{this} can't be countered."; + } - @Override - public CantCounterAbility copy() { - return new CantCounterAbility(this); - } + @Override + public CantCounterAbility copy() { + return new CantCounterAbility(this); + } } diff --git a/Mage/src/mage/abilities/common/ChancellorAbility.java b/Mage/src/mage/abilities/common/ChancellorAbility.java index 39bde16603..d382d9b67d 100644 --- a/Mage/src/mage/abilities/common/ChancellorAbility.java +++ b/Mage/src/mage/abilities/common/ChancellorAbility.java @@ -44,7 +44,7 @@ public class ChancellorAbility extends StaticAbility { public ChancellorAbility(DelayedTriggeredAbility ability, String text) { super(Zone.HAND, new ChancellorEffect(ability, text)); } - + public ChancellorAbility(OneShotEffect effect) { super(Zone.HAND, effect); } @@ -52,45 +52,45 @@ public class ChancellorAbility extends StaticAbility { public ChancellorAbility(final ChancellorAbility ability) { super(ability); } - + @Override public ChancellorAbility copy() { return new ChancellorAbility(this); } - - @Override - public String getRule() { - return "You may reveal this card from your opening hand. If you do, " + super.getRule(); - } - + + @Override + public String getRule() { + return "You may reveal this card from your opening hand. If you do, " + super.getRule(); + } + } class ChancellorEffect extends OneShotEffect { private DelayedTriggeredAbility ability; - - ChancellorEffect (DelayedTriggeredAbility ability, String text) { - super(Outcome.Benefit); + + ChancellorEffect (DelayedTriggeredAbility ability, String text) { + super(Outcome.Benefit); this.ability = ability; - staticText = text; - } + staticText = text; + } - ChancellorEffect(ChancellorEffect effect) { - super(effect); + ChancellorEffect(ChancellorEffect effect) { + super(effect); this.ability = effect.ability; - } + } - @Override - public boolean apply(Game game, Ability source) { + @Override + public boolean apply(Game game, Ability source) { ability.setSourceId(source.getSourceId()); ability.setControllerId(source.getControllerId()); game.addDelayedTriggeredAbility(ability); return true; - } + } - @Override - public ChancellorEffect copy() { - return new ChancellorEffect(this); - } + @Override + public ChancellorEffect copy() { + return new ChancellorEffect(this); + } } diff --git a/Mage/src/mage/abilities/common/DamageAsThoughNotBlockedAbility.java b/Mage/src/mage/abilities/common/DamageAsThoughNotBlockedAbility.java index 695c5d231c..8732a58f97 100644 --- a/Mage/src/mage/abilities/common/DamageAsThoughNotBlockedAbility.java +++ b/Mage/src/mage/abilities/common/DamageAsThoughNotBlockedAbility.java @@ -38,28 +38,28 @@ import static mage.Constants.*; */ public class DamageAsThoughNotBlockedAbility extends StaticAbility { - private static final DamageAsThoughNotBlockedAbility fINSTANCE = new DamageAsThoughNotBlockedAbility(); + private static final DamageAsThoughNotBlockedAbility fINSTANCE = new DamageAsThoughNotBlockedAbility(); - private Object readResolve() throws ObjectStreamException { - return fINSTANCE; - } + private Object readResolve() throws ObjectStreamException { + return fINSTANCE; + } - public static DamageAsThoughNotBlockedAbility getInstance() { - return fINSTANCE; - } + public static DamageAsThoughNotBlockedAbility getInstance() { + return fINSTANCE; + } - private DamageAsThoughNotBlockedAbility() { - super(AbilityType.STATIC, Zone.BATTLEFIELD); - } + private DamageAsThoughNotBlockedAbility() { + super(AbilityType.STATIC, Zone.BATTLEFIELD); + } - @Override - public String getRule() { - return "You may have {this} assign its combat damage as though it weren't blocked."; - } + @Override + public String getRule() { + return "You may have {this} assign its combat damage as though it weren't blocked."; + } - @Override - public DamageAsThoughNotBlockedAbility copy() { - return fINSTANCE; - } + @Override + public DamageAsThoughNotBlockedAbility copy() { + return fINSTANCE; + } } \ No newline at end of file diff --git a/Mage/src/mage/abilities/common/DealsCombatDamageToACreatureTriggeredAbility.java b/Mage/src/mage/abilities/common/DealsCombatDamageToACreatureTriggeredAbility.java index c4a7b4caac..560774df0d 100644 --- a/Mage/src/mage/abilities/common/DealsCombatDamageToACreatureTriggeredAbility.java +++ b/Mage/src/mage/abilities/common/DealsCombatDamageToACreatureTriggeredAbility.java @@ -42,7 +42,7 @@ import mage.target.targetpointer.FixedTarget; * @author LevelX */ public class DealsCombatDamageToACreatureTriggeredAbility extends TriggeredAbilityImpl { - + private boolean setTargetPointer; public DealsCombatDamageToACreatureTriggeredAbility(Effect effect, boolean optional) { @@ -77,7 +77,7 @@ public class DealsCombatDamageToACreatureTriggeredAbility extends TriggeredAbili } return true; } - + } return false; } diff --git a/Mage/src/mage/abilities/common/DealsCombatDamageToAPlayerTriggeredAbility.java b/Mage/src/mage/abilities/common/DealsCombatDamageToAPlayerTriggeredAbility.java index 2b1f98f99e..a61a2dc6cd 100644 --- a/Mage/src/mage/abilities/common/DealsCombatDamageToAPlayerTriggeredAbility.java +++ b/Mage/src/mage/abilities/common/DealsCombatDamageToAPlayerTriggeredAbility.java @@ -44,28 +44,28 @@ import mage.target.targetpointer.FixedTarget; public class DealsCombatDamageToAPlayerTriggeredAbility extends TriggeredAbilityImpl { private boolean setTargetPointer; - public DealsCombatDamageToAPlayerTriggeredAbility(Effect effect, boolean optional) { - this(effect, optional, false); - } + public DealsCombatDamageToAPlayerTriggeredAbility(Effect effect, boolean optional) { + this(effect, optional, false); + } public DealsCombatDamageToAPlayerTriggeredAbility(Effect effect, boolean optional, boolean setTargetPointer) { super(Zone.BATTLEFIELD, effect, optional); this.setTargetPointer = setTargetPointer; } - public DealsCombatDamageToAPlayerTriggeredAbility(final DealsCombatDamageToAPlayerTriggeredAbility ability) { - super(ability); + public DealsCombatDamageToAPlayerTriggeredAbility(final DealsCombatDamageToAPlayerTriggeredAbility ability) { + super(ability); this.setTargetPointer = ability.setTargetPointer; - } + } - @Override - public DealsCombatDamageToAPlayerTriggeredAbility copy() { - return new DealsCombatDamageToAPlayerTriggeredAbility(this); - } + @Override + public DealsCombatDamageToAPlayerTriggeredAbility copy() { + return new DealsCombatDamageToAPlayerTriggeredAbility(this); + } - @Override - public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == EventType.DAMAGED_PLAYER && event.getSourceId().equals(this.sourceId) + @Override + public boolean checkTrigger(GameEvent event, Game game) { + if (event.getType() == EventType.DAMAGED_PLAYER && event.getSourceId().equals(this.sourceId) && ((DamagedPlayerEvent) event).isCombatDamage()) { if (setTargetPointer) { for (Effect effect : this.getEffects()) { @@ -73,14 +73,14 @@ public class DealsCombatDamageToAPlayerTriggeredAbility extends TriggeredAbility effect.setValue("damage", event.getAmount()); } } - return true; - } - return false; - } + return true; + } + return false; + } - @Override - public String getRule() { - return "Whenever {this} deals combat damage to a player, " + super.getRule(); - } + @Override + public String getRule() { + return "Whenever {this} deals combat damage to a player, " + super.getRule(); + } } diff --git a/Mage/src/mage/abilities/common/DiesAndDealtDamageThisTurnTriggeredAbility.java b/Mage/src/mage/abilities/common/DiesAndDealtDamageThisTurnTriggeredAbility.java index fe40b6df59..cb68c4b7a1 100644 --- a/Mage/src/mage/abilities/common/DiesAndDealtDamageThisTurnTriggeredAbility.java +++ b/Mage/src/mage/abilities/common/DiesAndDealtDamageThisTurnTriggeredAbility.java @@ -12,26 +12,26 @@ import mage.target.targetpointer.FixedTarget; public class DiesAndDealtDamageThisTurnTriggeredAbility extends TriggeredAbilityImpl { - public DiesAndDealtDamageThisTurnTriggeredAbility(Effect effect) { - this(effect, false); - } - - public DiesAndDealtDamageThisTurnTriggeredAbility(Effect effect, boolean optional) { - super(Constants.Zone.ALL, effect, optional); - } + public DiesAndDealtDamageThisTurnTriggeredAbility(Effect effect) { + this(effect, false); + } - public DiesAndDealtDamageThisTurnTriggeredAbility(final DiesAndDealtDamageThisTurnTriggeredAbility ability) { - super(ability); - } + public DiesAndDealtDamageThisTurnTriggeredAbility(Effect effect, boolean optional) { + super(Constants.Zone.ALL, effect, optional); + } - @Override - public DiesAndDealtDamageThisTurnTriggeredAbility copy() { - return new DiesAndDealtDamageThisTurnTriggeredAbility(this); - } + public DiesAndDealtDamageThisTurnTriggeredAbility(final DiesAndDealtDamageThisTurnTriggeredAbility ability) { + super(ability); + } - @Override - public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == GameEvent.EventType.ZONE_CHANGE && ((ZoneChangeEvent)event).isDiesEvent()) { + @Override + public DiesAndDealtDamageThisTurnTriggeredAbility copy() { + return new DiesAndDealtDamageThisTurnTriggeredAbility(this); + } + + @Override + public boolean checkTrigger(GameEvent event, Game game) { + if (event.getType() == GameEvent.EventType.ZONE_CHANGE && ((ZoneChangeEvent)event).isDiesEvent()) { MageObject object = game.getLastKnownInformation(event.getTargetId(), Constants.Zone.BATTLEFIELD); if (object instanceof Permanent && ((Permanent)object).getDealtDamageByThisTurn().contains(this.sourceId)) { for (Effect effect : getEffects()) { @@ -39,12 +39,12 @@ public class DiesAndDealtDamageThisTurnTriggeredAbility extends TriggeredAbility } return true; } - } - return false; - } + } + return false; + } - @Override - public String getRule() { - return "Whenever a creature dealt damage by {this} this turn dies, " + super.getRule(); - } + @Override + public String getRule() { + return "Whenever a creature dealt damage by {this} this turn dies, " + super.getRule(); + } } \ No newline at end of file diff --git a/Mage/src/mage/abilities/common/DiesAnotherCreatureYouControlTriggeredAbility.java b/Mage/src/mage/abilities/common/DiesAnotherCreatureYouControlTriggeredAbility.java index 8c55e6c19d..75c1e7850f 100644 --- a/Mage/src/mage/abilities/common/DiesAnotherCreatureYouControlTriggeredAbility.java +++ b/Mage/src/mage/abilities/common/DiesAnotherCreatureYouControlTriggeredAbility.java @@ -54,7 +54,7 @@ public class DiesAnotherCreatureYouControlTriggeredAbility extends TriggeredAbil public DiesAnotherCreatureYouControlTriggeredAbility(Effect effect, boolean optional, boolean nontoken) { this(effect, optional, new FilterCreaturePermanent(), nontoken); } - + public DiesAnotherCreatureYouControlTriggeredAbility(Effect effect, boolean optional, FilterCreaturePermanent filter) { this(effect, optional, filter, false); } diff --git a/Mage/src/mage/abilities/common/DiesAttachedTriggeredAbility.java b/Mage/src/mage/abilities/common/DiesAttachedTriggeredAbility.java index c876119b93..446c48a03a 100644 --- a/Mage/src/mage/abilities/common/DiesAttachedTriggeredAbility.java +++ b/Mage/src/mage/abilities/common/DiesAttachedTriggeredAbility.java @@ -40,8 +40,8 @@ public class DiesAttachedTriggeredAbility extends TriggeredAbilityImpl { -// boolean used = false; - - public DiesTriggeredAbility(Effect effect, boolean optional) { - super(Zone.BATTLEFIELD, Zone.GRAVEYARD, effect, "When {this} dies, ", optional); - } +// boolean used = false; - public DiesTriggeredAbility(Effect effect) { - this(effect, false); - } + public DiesTriggeredAbility(Effect effect, boolean optional) { + super(Zone.BATTLEFIELD, Zone.GRAVEYARD, effect, "When {this} dies, ", optional); + } - public DiesTriggeredAbility(DiesTriggeredAbility ability) { - super(ability); - } + public DiesTriggeredAbility(Effect effect) { + this(effect, false); + } + + public DiesTriggeredAbility(DiesTriggeredAbility ability) { + super(ability); + } @Override public boolean isInUseableZone(Game game, boolean checkLKI) { @@ -63,23 +63,23 @@ public class DiesTriggeredAbility extends ZoneChangeTriggeredAbility { - public EntersBattlefieldAbility(Effect effect) { - super(Zone.BATTLEFIELD, new EntersBattlefieldEffect(effect, null)); - } + public EntersBattlefieldAbility(Effect effect) { + super(Zone.BATTLEFIELD, new EntersBattlefieldEffect(effect, null)); + } - public EntersBattlefieldAbility(Effect effect, String rule) { - super(Zone.BATTLEFIELD, new EntersBattlefieldEffect(effect, rule)); - } + public EntersBattlefieldAbility(Effect effect, String rule) { + super(Zone.BATTLEFIELD, new EntersBattlefieldEffect(effect, rule)); + } - public EntersBattlefieldAbility(EntersBattlefieldAbility ability) { - super(ability); - } + public EntersBattlefieldAbility(EntersBattlefieldAbility ability) { + super(ability); + } - @Override - public EntersBattlefieldAbility copy() { - return new EntersBattlefieldAbility(this); - } + @Override + public EntersBattlefieldAbility copy() { + return new EntersBattlefieldAbility(this); + } } diff --git a/Mage/src/mage/abilities/common/EntersBattlefieldTappedAbility.java b/Mage/src/mage/abilities/common/EntersBattlefieldTappedAbility.java index 4dd58e5b3d..0e3ba88a02 100644 --- a/Mage/src/mage/abilities/common/EntersBattlefieldTappedAbility.java +++ b/Mage/src/mage/abilities/common/EntersBattlefieldTappedAbility.java @@ -39,22 +39,22 @@ import mage.abilities.effects.common.TapSourceEffect; */ public class EntersBattlefieldTappedAbility extends StaticAbility { - public EntersBattlefieldTappedAbility() { - super(Zone.BATTLEFIELD, new EntersBattlefieldEffect(new TapSourceEffect(true))); - } + public EntersBattlefieldTappedAbility() { + super(Zone.BATTLEFIELD, new EntersBattlefieldEffect(new TapSourceEffect(true))); + } - public EntersBattlefieldTappedAbility(final EntersBattlefieldTappedAbility ability) { - super(ability); - } + public EntersBattlefieldTappedAbility(final EntersBattlefieldTappedAbility ability) { + super(ability); + } - @Override - public String getRule() { - return "{this} enters the battlefield tapped"; - } + @Override + public String getRule() { + return "{this} enters the battlefield tapped"; + } - @Override - public EntersBattlefieldTappedAbility copy() { - return new EntersBattlefieldTappedAbility(this); - } + @Override + public EntersBattlefieldTappedAbility copy() { + return new EntersBattlefieldTappedAbility(this); + } } diff --git a/Mage/src/mage/abilities/common/EntersBattlefieldTriggeredAbility.java b/Mage/src/mage/abilities/common/EntersBattlefieldTriggeredAbility.java index c0d8f6d214..4074f05e97 100644 --- a/Mage/src/mage/abilities/common/EntersBattlefieldTriggeredAbility.java +++ b/Mage/src/mage/abilities/common/EntersBattlefieldTriggeredAbility.java @@ -37,22 +37,22 @@ import mage.abilities.effects.Effect; */ public class EntersBattlefieldTriggeredAbility extends ZoneChangeTriggeredAbility { - public EntersBattlefieldTriggeredAbility(Effect effect) { - this(effect, false); - } + public EntersBattlefieldTriggeredAbility(Effect effect) { + this(effect, false); + } - public EntersBattlefieldTriggeredAbility(Effect effect, boolean optional) { - super(Zone.BATTLEFIELD, effect, "When {this} enters the battlefield, ", optional); - } + public EntersBattlefieldTriggeredAbility(Effect effect, boolean optional) { + super(Zone.BATTLEFIELD, effect, "When {this} enters the battlefield, ", optional); + } - public EntersBattlefieldTriggeredAbility(EntersBattlefieldTriggeredAbility ability) { - super(ability); - } + public EntersBattlefieldTriggeredAbility(EntersBattlefieldTriggeredAbility ability) { + super(ability); + } - @Override - public EntersBattlefieldTriggeredAbility copy() { - return new EntersBattlefieldTriggeredAbility(this); - } + @Override + public EntersBattlefieldTriggeredAbility copy() { + return new EntersBattlefieldTriggeredAbility(this); + } } diff --git a/Mage/src/mage/abilities/common/FetchLandActivatedAbility.java b/Mage/src/mage/abilities/common/FetchLandActivatedAbility.java index dfad6179cd..859ce39acb 100644 --- a/Mage/src/mage/abilities/common/FetchLandActivatedAbility.java +++ b/Mage/src/mage/abilities/common/FetchLandActivatedAbility.java @@ -47,33 +47,33 @@ import mage.target.common.TargetCardInLibrary; */ public class FetchLandActivatedAbility extends ActivatedAbilityImpl { - public FetchLandActivatedAbility(String[] subTypes) { - super(Zone.BATTLEFIELD, null); - addCost(new TapSourceCost()); - addCost(new PayLifeCost(1)); - addCost(new SacrificeSourceCost()); - FilterCard filter = new FilterCard(subTypeNames(subTypes)); - filter.getCardType().add(CardType.LAND); + public FetchLandActivatedAbility(String[] subTypes) { + super(Zone.BATTLEFIELD, null); + addCost(new TapSourceCost()); + addCost(new PayLifeCost(1)); + addCost(new SacrificeSourceCost()); + FilterCard filter = new FilterCard(subTypeNames(subTypes)); + filter.getCardType().add(CardType.LAND); filter.getSubtype().addAll(Arrays.asList(subTypes)); - filter.setScopeSubtype(ComparisonScope.Any); - TargetCardInLibrary target = new TargetCardInLibrary(filter); - addEffect(new SearchLibraryPutInPlayEffect(target, false, true, Outcome.PutLandInPlay)); - } + filter.setScopeSubtype(ComparisonScope.Any); + TargetCardInLibrary target = new TargetCardInLibrary(filter); + addEffect(new SearchLibraryPutInPlayEffect(target, false, true, Outcome.PutLandInPlay)); + } - public FetchLandActivatedAbility(FetchLandActivatedAbility ability) { - super(ability); - } + public FetchLandActivatedAbility(FetchLandActivatedAbility ability) { + super(ability); + } - private String subTypeNames(String[] subTypes) { - StringBuilder sb = new StringBuilder(); - for (String subType: subTypes) { - sb.append(subType).append(" or "); - } - return sb.substring(0, sb.length() - 4); - } + private String subTypeNames(String[] subTypes) { + StringBuilder sb = new StringBuilder(); + for (String subType: subTypes) { + sb.append(subType).append(" or "); + } + return sb.substring(0, sb.length() - 4); + } - @Override - public FetchLandActivatedAbility copy() { - return new FetchLandActivatedAbility(this); - } + @Override + public FetchLandActivatedAbility copy() { + return new FetchLandActivatedAbility(this); + } } diff --git a/Mage/src/mage/abilities/common/LandfallAbility.java b/Mage/src/mage/abilities/common/LandfallAbility.java index badd68793d..f7907a78fe 100644 --- a/Mage/src/mage/abilities/common/LandfallAbility.java +++ b/Mage/src/mage/abilities/common/LandfallAbility.java @@ -44,37 +44,37 @@ import mage.game.permanent.Permanent; */ public class LandfallAbility extends TriggeredAbilityImpl { - public LandfallAbility(Effect effect, boolean optional) { - super(Zone.BATTLEFIELD, effect, optional); - } + public LandfallAbility(Effect effect, boolean optional) { + super(Zone.BATTLEFIELD, effect, optional); + } - public LandfallAbility ( Zone zone, Effect effect, Boolean optional ) { - super(zone, effect, optional); - } + public LandfallAbility ( Zone zone, Effect effect, Boolean optional ) { + super(zone, effect, optional); + } - public LandfallAbility(final LandfallAbility ability) { - super(ability); - } + public LandfallAbility(final LandfallAbility ability) { + super(ability); + } - @Override - public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == EventType.ZONE_CHANGE && ((ZoneChangeEvent)event).getToZone() == Zone.BATTLEFIELD) { - Permanent permanent = game.getPermanent(event.getTargetId()); - if (permanent != null && permanent.getCardType().contains(CardType.LAND) && permanent.getControllerId().equals(this.controllerId)) { - return true; - } - } - return false; - } + @Override + public boolean checkTrigger(GameEvent event, Game game) { + if (event.getType() == EventType.ZONE_CHANGE && ((ZoneChangeEvent)event).getToZone() == Zone.BATTLEFIELD) { + Permanent permanent = game.getPermanent(event.getTargetId()); + if (permanent != null && permanent.getCardType().contains(CardType.LAND) && permanent.getControllerId().equals(this.controllerId)) { + return true; + } + } + return false; + } - @Override - public String getRule() { - return "Landfall - Whenever a land enters the battlefield under your control, " + super.getRule(); - } + @Override + public String getRule() { + return "Landfall - Whenever a land enters the battlefield under your control, " + super.getRule(); + } - @Override - public LandfallAbility copy() { - return new LandfallAbility(this); - } + @Override + public LandfallAbility copy() { + return new LandfallAbility(this); + } } diff --git a/Mage/src/mage/abilities/common/LeavesBattlefieldTriggeredAbility.java b/Mage/src/mage/abilities/common/LeavesBattlefieldTriggeredAbility.java index b80b2d33fa..0d7c909066 100644 --- a/Mage/src/mage/abilities/common/LeavesBattlefieldTriggeredAbility.java +++ b/Mage/src/mage/abilities/common/LeavesBattlefieldTriggeredAbility.java @@ -37,17 +37,17 @@ import mage.abilities.effects.Effect; */ public class LeavesBattlefieldTriggeredAbility extends ZoneChangeTriggeredAbility { - public LeavesBattlefieldTriggeredAbility(Effect effect, boolean optional) { - super(Zone.BATTLEFIELD, null, effect, "When {this} leaves the battlefield, ", optional); - } + public LeavesBattlefieldTriggeredAbility(Effect effect, boolean optional) { + super(Zone.BATTLEFIELD, null, effect, "When {this} leaves the battlefield, ", optional); + } - public LeavesBattlefieldTriggeredAbility(LeavesBattlefieldTriggeredAbility ability) { - super(ability); - } + public LeavesBattlefieldTriggeredAbility(LeavesBattlefieldTriggeredAbility ability) { + super(ability); + } - @Override - public LeavesBattlefieldTriggeredAbility copy() { - return new LeavesBattlefieldTriggeredAbility(this); - } + @Override + public LeavesBattlefieldTriggeredAbility copy() { + return new LeavesBattlefieldTriggeredAbility(this); + } } diff --git a/Mage/src/mage/abilities/common/MetalcraftActivatedAbility.java b/Mage/src/mage/abilities/common/MetalcraftActivatedAbility.java index a5dc3d9d29..4c6708cfb9 100644 --- a/Mage/src/mage/abilities/common/MetalcraftActivatedAbility.java +++ b/Mage/src/mage/abilities/common/MetalcraftActivatedAbility.java @@ -42,33 +42,33 @@ import mage.abilities.effects.Effect; */ public class MetalcraftActivatedAbility extends ActivatedAbilityImpl { - public MetalcraftActivatedAbility(Zone zone, Effect effect, ManaCosts cost) { - super(zone, effect, cost); - this.costs.add(new MetalcraftCost()); - } + public MetalcraftActivatedAbility(Zone zone, Effect effect, ManaCosts cost) { + super(zone, effect, cost); + this.costs.add(new MetalcraftCost()); + } - public MetalcraftActivatedAbility(Zone zone, Effect effect, Costs costs) { - super(zone, effect, costs); - this.costs.add(new MetalcraftCost()); - } + public MetalcraftActivatedAbility(Zone zone, Effect effect, Costs costs) { + super(zone, effect, costs); + this.costs.add(new MetalcraftCost()); + } - public MetalcraftActivatedAbility(Zone zone, Effect effect, Cost cost) { - super(zone, effect, cost); - this.costs.add(new MetalcraftCost()); - } + public MetalcraftActivatedAbility(Zone zone, Effect effect, Cost cost) { + super(zone, effect, cost); + this.costs.add(new MetalcraftCost()); + } - public MetalcraftActivatedAbility(MetalcraftActivatedAbility ability) { - super(ability); - } + public MetalcraftActivatedAbility(MetalcraftActivatedAbility ability) { + super(ability); + } - @Override - public MetalcraftActivatedAbility copy() { - return new MetalcraftActivatedAbility(this); - } + @Override + public MetalcraftActivatedAbility copy() { + return new MetalcraftActivatedAbility(this); + } - @Override - public String getRule() { - return "Metalcraft - " + super.getRule(); - } + @Override + public String getRule() { + return "Metalcraft - " + super.getRule(); + } } diff --git a/Mage/src/mage/abilities/common/OnEventTriggeredAbility.java b/Mage/src/mage/abilities/common/OnEventTriggeredAbility.java index 4ac4fa3855..980e7b065e 100644 --- a/Mage/src/mage/abilities/common/OnEventTriggeredAbility.java +++ b/Mage/src/mage/abilities/common/OnEventTriggeredAbility.java @@ -41,54 +41,54 @@ import mage.game.events.GameEvent.EventType; */ public class OnEventTriggeredAbility extends TriggeredAbilityImpl { - private EventType eventType; - private String eventName; - private boolean allPlayers = false; + private EventType eventType; + private String eventName; + private boolean allPlayers = false; - public OnEventTriggeredAbility(EventType eventType, String eventName, Effect effect) { - super(Zone.BATTLEFIELD, effect); - this.eventType = eventType; - this.eventName = eventName; - } + public OnEventTriggeredAbility(EventType eventType, String eventName, Effect effect) { + super(Zone.BATTLEFIELD, effect); + this.eventType = eventType; + this.eventName = eventName; + } - public OnEventTriggeredAbility(EventType eventType, String eventName, Effect effect, boolean optional) { - super(Zone.BATTLEFIELD, effect, optional); - this.eventType = eventType; - this.eventName = eventName; - } + public OnEventTriggeredAbility(EventType eventType, String eventName, Effect effect, boolean optional) { + super(Zone.BATTLEFIELD, effect, optional); + this.eventType = eventType; + this.eventName = eventName; + } - public OnEventTriggeredAbility(EventType eventType, String eventName, boolean allPlayers, Effect effect) { - super(Zone.BATTLEFIELD, effect); - this.eventType = eventType; - this.eventName = eventName; - this.allPlayers = allPlayers; - } + public OnEventTriggeredAbility(EventType eventType, String eventName, boolean allPlayers, Effect effect) { + super(Zone.BATTLEFIELD, effect); + this.eventType = eventType; + this.eventName = eventName; + this.allPlayers = allPlayers; + } - public OnEventTriggeredAbility(OnEventTriggeredAbility ability) { - super(ability); - this.eventType = ability.eventType; - this.eventName = ability.eventName; - this.allPlayers = ability.allPlayers; - } + public OnEventTriggeredAbility(OnEventTriggeredAbility ability) { + super(ability); + this.eventType = ability.eventType; + this.eventName = ability.eventName; + this.allPlayers = ability.allPlayers; + } - @Override - public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == eventType) { - if (allPlayers || event.getPlayerId().equals(this.controllerId) ) { - return true; - } - } - return false; - } + @Override + public boolean checkTrigger(GameEvent event, Game game) { + if (event.getType() == eventType) { + if (allPlayers || event.getPlayerId().equals(this.controllerId) ) { + return true; + } + } + return false; + } - @Override - public String getRule() { - return "At the " + eventName + ", " + super.getRule(); - } + @Override + public String getRule() { + return "At the " + eventName + ", " + super.getRule(); + } - @Override - public OnEventTriggeredAbility copy() { - return new OnEventTriggeredAbility(this); - } + @Override + public OnEventTriggeredAbility copy() { + return new OnEventTriggeredAbility(this); + } } diff --git a/Mage/src/mage/abilities/common/OpponentCastsSpellTriggeredAbility.java b/Mage/src/mage/abilities/common/OpponentCastsSpellTriggeredAbility.java index c8a4e858eb..4149d133f7 100644 --- a/Mage/src/mage/abilities/common/OpponentCastsSpellTriggeredAbility.java +++ b/Mage/src/mage/abilities/common/OpponentCastsSpellTriggeredAbility.java @@ -60,7 +60,7 @@ public class OpponentCastsSpellTriggeredAbility extends TriggeredAbilityImpl { - + public OpponentSacrificesNonTokenPermanentTriggeredAbility(Effect effect) { super(Constants.Zone.BATTLEFIELD, effect, false); } - + public OpponentSacrificesNonTokenPermanentTriggeredAbility(final OpponentSacrificesNonTokenPermanentTriggeredAbility ability) { super(ability); } - + @Override public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == GameEvent.EventType.SACRIFICED_PERMANENT && game.getOpponents(controllerId).contains(event.getPlayerId())) { + if (event.getType() == GameEvent.EventType.SACRIFICED_PERMANENT && game.getOpponents(controllerId).contains(event.getPlayerId())) { MageObject object = game.getLastKnownInformation(event.getTargetId(), Constants.Zone.BATTLEFIELD); if (object instanceof Permanent && !(object instanceof PermanentToken) ) { for (Effect effect : getEffects()) { @@ -60,7 +60,7 @@ public class OpponentSacrificesNonTokenPermanentTriggeredAbility extends Trigger } return false; } - + @Override public String getRule() { return "Whenever an opponent sacrifices a nontoken permanent, " + super.getRule(); @@ -70,5 +70,5 @@ public class OpponentSacrificesNonTokenPermanentTriggeredAbility extends Trigger public OpponentSacrificesNonTokenPermanentTriggeredAbility copy() { return new OpponentSacrificesNonTokenPermanentTriggeredAbility(this); } - + } \ No newline at end of file diff --git a/Mage/src/mage/abilities/common/OpponentSacrificesPermanentTriggeredAbility.java b/Mage/src/mage/abilities/common/OpponentSacrificesPermanentTriggeredAbility.java index 60ef80b717..240d6ad79d 100644 --- a/Mage/src/mage/abilities/common/OpponentSacrificesPermanentTriggeredAbility.java +++ b/Mage/src/mage/abilities/common/OpponentSacrificesPermanentTriggeredAbility.java @@ -37,18 +37,18 @@ import mage.game.permanent.Permanent; import mage.target.targetpointer.FixedTarget; public class OpponentSacrificesPermanentTriggeredAbility extends TriggeredAbilityImpl { - + public OpponentSacrificesPermanentTriggeredAbility(Effect effect) { super(Constants.Zone.BATTLEFIELD, effect, false); } - + public OpponentSacrificesPermanentTriggeredAbility(final OpponentSacrificesPermanentTriggeredAbility ability) { super(ability); } - + @Override public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == GameEvent.EventType.SACRIFICED_PERMANENT && game.getOpponents(controllerId).contains(event.getPlayerId())) { + if (event.getType() == GameEvent.EventType.SACRIFICED_PERMANENT && game.getOpponents(controllerId).contains(event.getPlayerId())) { MageObject object = game.getLastKnownInformation(event.getTargetId(), Constants.Zone.BATTLEFIELD); if (object instanceof Permanent) { for (Effect effect : getEffects()) { @@ -59,7 +59,7 @@ public class OpponentSacrificesPermanentTriggeredAbility extends TriggeredAbilit } return false; } - + @Override public String getRule() { return "Whenever an opponent sacrifices a nontoken permanent, " + super.getRule(); @@ -69,5 +69,5 @@ public class OpponentSacrificesPermanentTriggeredAbility extends TriggeredAbilit public OpponentSacrificesPermanentTriggeredAbility copy() { return new OpponentSacrificesPermanentTriggeredAbility(this); } - + } \ No newline at end of file diff --git a/Mage/src/mage/abilities/common/PassAbility.java b/Mage/src/mage/abilities/common/PassAbility.java index 616072a5a1..ad5e24b65c 100644 --- a/Mage/src/mage/abilities/common/PassAbility.java +++ b/Mage/src/mage/abilities/common/PassAbility.java @@ -40,28 +40,28 @@ import mage.game.Game; */ public class PassAbility extends ActivatedAbilityImpl { - public PassAbility() { - super(Zone.ALL, new PassEffect()); + public PassAbility() { + super(Zone.ALL, new PassEffect()); this.usesStack = false; - } + } - public PassAbility(final PassAbility ability) { - super(ability); - } - - @Override - public PassAbility copy() { - return new PassAbility(this); - } + public PassAbility(final PassAbility ability) { + super(ability); + } - @Override - public boolean canActivate(UUID playerId, Game game) { - return true; - } + @Override + public PassAbility copy() { + return new PassAbility(this); + } - @Override - public String toString() { - return "Pass"; - } + @Override + public boolean canActivate(UUID playerId, Game game) { + return true; + } + + @Override + public String toString() { + return "Pass"; + } } diff --git a/Mage/src/mage/abilities/common/SimpleActivatedAbility.java b/Mage/src/mage/abilities/common/SimpleActivatedAbility.java index 37fe19e602..753597e159 100644 --- a/Mage/src/mage/abilities/common/SimpleActivatedAbility.java +++ b/Mage/src/mage/abilities/common/SimpleActivatedAbility.java @@ -41,25 +41,25 @@ import mage.abilities.effects.Effect; */ public class SimpleActivatedAbility extends ActivatedAbilityImpl { - public SimpleActivatedAbility(Zone zone, Effect effect, ManaCosts cost) { - super(zone, effect, cost); - } + public SimpleActivatedAbility(Zone zone, Effect effect, ManaCosts cost) { + super(zone, effect, cost); + } - public SimpleActivatedAbility(Zone zone, Effect effect, Costs costs) { - super(zone, effect, costs); - } + public SimpleActivatedAbility(Zone zone, Effect effect, Costs costs) { + super(zone, effect, costs); + } - public SimpleActivatedAbility(Zone zone, Effect effect, Cost cost) { - super(zone, effect, cost); - } + public SimpleActivatedAbility(Zone zone, Effect effect, Cost cost) { + super(zone, effect, cost); + } - public SimpleActivatedAbility(SimpleActivatedAbility ability) { - super(ability); - } + public SimpleActivatedAbility(SimpleActivatedAbility ability) { + super(ability); + } - @Override - public SimpleActivatedAbility copy() { - return new SimpleActivatedAbility(this); - } + @Override + public SimpleActivatedAbility copy() { + return new SimpleActivatedAbility(this); + } } diff --git a/Mage/src/mage/abilities/common/SimpleStaticAbility.java b/Mage/src/mage/abilities/common/SimpleStaticAbility.java index adc00849fc..41ef8f3ae1 100644 --- a/Mage/src/mage/abilities/common/SimpleStaticAbility.java +++ b/Mage/src/mage/abilities/common/SimpleStaticAbility.java @@ -38,17 +38,17 @@ import mage.abilities.effects.Effect; */ public class SimpleStaticAbility extends StaticAbility { - public SimpleStaticAbility(Zone zone, Effect effect) { - super(zone, effect); - } + public SimpleStaticAbility(Zone zone, Effect effect) { + super(zone, effect); + } - public SimpleStaticAbility(SimpleStaticAbility ability) { - super(ability); - } + public SimpleStaticAbility(SimpleStaticAbility ability) { + super(ability); + } - @Override - public SimpleStaticAbility copy() { - return new SimpleStaticAbility(this); - } + @Override + public SimpleStaticAbility copy() { + return new SimpleStaticAbility(this); + } } diff --git a/Mage/src/mage/abilities/common/SimpleTriggeredAbility.java b/Mage/src/mage/abilities/common/SimpleTriggeredAbility.java index 26dc8d5155..b62221f531 100644 --- a/Mage/src/mage/abilities/common/SimpleTriggeredAbility.java +++ b/Mage/src/mage/abilities/common/SimpleTriggeredAbility.java @@ -41,42 +41,42 @@ import mage.game.events.GameEvent.EventType; */ public class SimpleTriggeredAbility extends TriggeredAbilityImpl { - private EventType eventType; + private EventType eventType; private boolean onlyController; private String prefix; - public SimpleTriggeredAbility(Zone zone, EventType eventType, Effect effect, String prefix) { - this(zone, eventType, effect, prefix, false); - } + public SimpleTriggeredAbility(Zone zone, EventType eventType, Effect effect, String prefix) { + this(zone, eventType, effect, prefix, false); + } public SimpleTriggeredAbility(Zone zone, EventType eventType, Effect effect, String prefix, boolean onlyController) { super(zone, effect); - this.eventType = eventType; + this.eventType = eventType; this.onlyController = onlyController; this.prefix = prefix; } - public SimpleTriggeredAbility(SimpleTriggeredAbility ability) { - super(ability); - this.eventType = ability.eventType; + public SimpleTriggeredAbility(SimpleTriggeredAbility ability) { + super(ability); + this.eventType = ability.eventType; this.onlyController = ability.onlyController; this.prefix = ability.prefix; - } + } - @Override - public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == eventType) { + @Override + public boolean checkTrigger(GameEvent event, Game game) { + if (event.getType() == eventType) { if (!onlyController || event.getPlayerId().equals(this.controllerId)) { return true; } - } - return false; - } + } + return false; + } - @Override - public SimpleTriggeredAbility copy() { - return new SimpleTriggeredAbility(this); - } + @Override + public SimpleTriggeredAbility copy() { + return new SimpleTriggeredAbility(this); + } @Override public String getRule() { diff --git a/Mage/src/mage/abilities/common/SpellCastTriggeredAbility.java b/Mage/src/mage/abilities/common/SpellCastTriggeredAbility.java index 9865743a3d..9ea18836ac 100644 --- a/Mage/src/mage/abilities/common/SpellCastTriggeredAbility.java +++ b/Mage/src/mage/abilities/common/SpellCastTriggeredAbility.java @@ -45,10 +45,10 @@ public class SpellCastTriggeredAbility extends TriggeredAbilityImpl { - public UnattachedTriggeredAbility(Effect effect, boolean optional) { - super(Zone.BATTLEFIELD, effect, optional); - } + public UnattachedTriggeredAbility(Effect effect, boolean optional) { + super(Zone.BATTLEFIELD, effect, optional); + } - public UnattachedTriggeredAbility(final UnattachedTriggeredAbility ability) { - super(ability); - } + public UnattachedTriggeredAbility(final UnattachedTriggeredAbility ability) { + super(ability); + } - @Override - public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == EventType.UNATTACHED && event.getSourceId().equals(this.getSourceId()) ) { - getEffects().get(0).setTargetPointer(new FixedTarget(event.getTargetId())); - return true; - } - return false; - } + @Override + public boolean checkTrigger(GameEvent event, Game game) { + if (event.getType() == EventType.UNATTACHED && event.getSourceId().equals(this.getSourceId()) ) { + getEffects().get(0).setTargetPointer(new FixedTarget(event.getTargetId())); + return true; + } + return false; + } - @Override - public String getRule() { - return "Whenever {this} becomes unattached from a permanent, " + super.getRule(); - } + @Override + public String getRule() { + return "Whenever {this} becomes unattached from a permanent, " + super.getRule(); + } - @Override - public UnattachedTriggeredAbility copy() { - return new UnattachedTriggeredAbility(this); - } + @Override + public UnattachedTriggeredAbility copy() { + return new UnattachedTriggeredAbility(this); + } } diff --git a/Mage/src/mage/abilities/common/ZoneChangeTriggeredAbility.java b/Mage/src/mage/abilities/common/ZoneChangeTriggeredAbility.java index ef10a7cf12..60a0f2ebf0 100644 --- a/Mage/src/mage/abilities/common/ZoneChangeTriggeredAbility.java +++ b/Mage/src/mage/abilities/common/ZoneChangeTriggeredAbility.java @@ -43,57 +43,57 @@ import mage.game.events.ZoneChangeEvent; */ public class ZoneChangeTriggeredAbility> extends TriggeredAbilityImpl { - protected Zone fromZone; - protected Zone toZone; - protected String rule; + protected Zone fromZone; + protected Zone toZone; + protected String rule; - public ZoneChangeTriggeredAbility(Zone fromZone, Zone toZone, Effect effect, String rule, boolean optional) { - super(fromZone, effect, optional); - this.fromZone = fromZone; - this.toZone = toZone; - this.rule = rule; - } + public ZoneChangeTriggeredAbility(Zone fromZone, Zone toZone, Effect effect, String rule, boolean optional) { + super(fromZone, effect, optional); + this.fromZone = fromZone; + this.toZone = toZone; + this.rule = rule; + } - public ZoneChangeTriggeredAbility(Zone toZone, Effect effect, String rule, boolean optional) { - super(toZone, effect, optional); - this.fromZone = null; - this.toZone = toZone; - this.rule = rule; - } + public ZoneChangeTriggeredAbility(Zone toZone, Effect effect, String rule, boolean optional) { + super(toZone, effect, optional); + this.fromZone = null; + this.toZone = toZone; + this.rule = rule; + } - public ZoneChangeTriggeredAbility(ZoneChangeTriggeredAbility ability) { - super(ability); - this.fromZone = ability.fromZone; - this.toZone = ability.toZone; - this.rule = ability.rule; - } + public ZoneChangeTriggeredAbility(ZoneChangeTriggeredAbility ability) { + super(ability); + this.fromZone = ability.fromZone; + this.toZone = ability.toZone; + this.rule = ability.rule; + } - @Override - public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == EventType.ZONE_CHANGE && event.getTargetId().equals(this.getSourceId())) { - ZoneChangeEvent zEvent = (ZoneChangeEvent)event; - if ((fromZone == null || zEvent.getFromZone() == fromZone) && (toZone == null || zEvent.getToZone() == toZone)) { - return true; - } - } - return false; - } + @Override + public boolean checkTrigger(GameEvent event, Game game) { + if (event.getType() == EventType.ZONE_CHANGE && event.getTargetId().equals(this.getSourceId())) { + ZoneChangeEvent zEvent = (ZoneChangeEvent)event; + if ((fromZone == null || zEvent.getFromZone() == fromZone) && (toZone == null || zEvent.getToZone() == toZone)) { + return true; + } + } + return false; + } - @Override - public String getRule() { - return rule + super.getRule(); - } + @Override + public String getRule() { + return rule + super.getRule(); + } - @Override - public T copy() { - return (T)new ZoneChangeTriggeredAbility(this); - } + @Override + public T copy() { + return (T)new ZoneChangeTriggeredAbility(this); + } - public Zone getFromZone() { - return fromZone; - } + public Zone getFromZone() { + return fromZone; + } - public Zone getToZone() { - return toZone; - } + public Zone getToZone() { + return toZone; + } } diff --git a/Mage/src/mage/abilities/common/delayed/AtTheEndOfTurnStepPostDelayedTriggeredAbility.java b/Mage/src/mage/abilities/common/delayed/AtTheEndOfTurnStepPostDelayedTriggeredAbility.java index 2399b9334f..58ec574717 100644 --- a/Mage/src/mage/abilities/common/delayed/AtTheEndOfTurnStepPostDelayedTriggeredAbility.java +++ b/Mage/src/mage/abilities/common/delayed/AtTheEndOfTurnStepPostDelayedTriggeredAbility.java @@ -37,13 +37,13 @@ import mage.game.events.GameEvent; */ public class AtTheEndOfTurnStepPostDelayedTriggeredAbility extends DelayedTriggeredAbility { - public AtTheEndOfTurnStepPostDelayedTriggeredAbility(Effect effect) { + public AtTheEndOfTurnStepPostDelayedTriggeredAbility(Effect effect) { super(effect); } - public AtTheEndOfTurnStepPostDelayedTriggeredAbility(Effect effect, boolean usesStack) { + public AtTheEndOfTurnStepPostDelayedTriggeredAbility(Effect effect, boolean usesStack) { super(effect); - this.usesStack = usesStack; + this.usesStack = usesStack; } diff --git a/Mage/src/mage/abilities/condition/Condition.java b/Mage/src/mage/abilities/condition/Condition.java index 9b19bbe0af..97e114d686 100644 --- a/Mage/src/mage/abilities/condition/Condition.java +++ b/Mage/src/mage/abilities/condition/Condition.java @@ -13,11 +13,11 @@ import java.io.Serializable; public interface Condition extends Serializable { /** - * Checks the game to see if this condition applies for the given ability. - * - * @param game - * @param source - * @return - */ + * Checks the game to see if this condition applies for the given ability. + * + * @param game + * @param source + * @return + */ boolean apply(Game game, Ability source); } diff --git a/Mage/src/mage/abilities/condition/common/CardsInHandCondition.java b/Mage/src/mage/abilities/condition/common/CardsInHandCondition.java index fdb5aaf363..e84518124d 100644 --- a/Mage/src/mage/abilities/condition/common/CardsInHandCondition.java +++ b/Mage/src/mage/abilities/condition/common/CardsInHandCondition.java @@ -40,46 +40,46 @@ import mage.game.Game; */ public class CardsInHandCondition implements Condition { - public static enum CountType { MORE_THAN, FEWER_THAN, EQUAL_TO }; - private Condition condition; - private CountType type; - private int count; + public static enum CountType { MORE_THAN, FEWER_THAN, EQUAL_TO }; + private Condition condition; + private CountType type; + private int count; public CardsInHandCondition() { this(CountType.EQUAL_TO, 0); } - public CardsInHandCondition (CountType type, int count ) { - this.type = type; - this.count = count; - } + public CardsInHandCondition (CountType type, int count ) { + this.type = type; + this.count = count; + } - public CardsInHandCondition (CountType type, int count, Condition conditionToDecorate ) { + public CardsInHandCondition (CountType type, int count, Condition conditionToDecorate ) { this(type, count); - this.condition = conditionToDecorate; - } + this.condition = conditionToDecorate; + } - @Override - public boolean apply(Game game, Ability source) { - boolean conditionApplies = false; + @Override + public boolean apply(Game game, Ability source) { + boolean conditionApplies = false; - switch ( this.type ) { - case FEWER_THAN: - conditionApplies = game.getPlayer(source.getControllerId()).getHand().size() < this.count; - break; - case MORE_THAN: - conditionApplies = game.getPlayer(source.getControllerId()).getHand().size() > this.count; - break; - case EQUAL_TO: - conditionApplies = game.getPlayer(source.getControllerId()).getHand().size() == this.count; - break; - } + switch ( this.type ) { + case FEWER_THAN: + conditionApplies = game.getPlayer(source.getControllerId()).getHand().size() < this.count; + break; + case MORE_THAN: + conditionApplies = game.getPlayer(source.getControllerId()).getHand().size() > this.count; + break; + case EQUAL_TO: + conditionApplies = game.getPlayer(source.getControllerId()).getHand().size() == this.count; + break; + } - //If a decorated condition exists, check it as well and apply them together. - if ( this.condition != null ) { - conditionApplies = conditionApplies && this.condition.apply(game, source); - } + //If a decorated condition exists, check it as well and apply them together. + if ( this.condition != null ) { + conditionApplies = conditionApplies && this.condition.apply(game, source); + } - return conditionApplies; - } + return conditionApplies; + } } diff --git a/Mage/src/mage/abilities/condition/common/ControlsBiggestOrTiedCreatureCondition.java b/Mage/src/mage/abilities/condition/common/ControlsBiggestOrTiedCreatureCondition.java index 3e82d98620..657dca5037 100644 --- a/Mage/src/mage/abilities/condition/common/ControlsBiggestOrTiedCreatureCondition.java +++ b/Mage/src/mage/abilities/condition/common/ControlsBiggestOrTiedCreatureCondition.java @@ -47,7 +47,7 @@ public class ControlsBiggestOrTiedCreatureCondition implements Condition { private static ControlsBiggestOrTiedCreatureCondition fInstance = new ControlsBiggestOrTiedCreatureCondition(); - private static final FilterCreaturePermanent filter = new FilterCreaturePermanent(); + private static final FilterCreaturePermanent filter = new FilterCreaturePermanent(); public static Condition getInstance() { return fInstance; diff --git a/Mage/src/mage/abilities/condition/common/ControlsPermanentCondition.java b/Mage/src/mage/abilities/condition/common/ControlsPermanentCondition.java index 6005b9f7ff..4b6901234b 100644 --- a/Mage/src/mage/abilities/condition/common/ControlsPermanentCondition.java +++ b/Mage/src/mage/abilities/condition/common/ControlsPermanentCondition.java @@ -44,74 +44,74 @@ import mage.game.Game; */ public class ControlsPermanentCondition implements Condition { - public static enum CountType { MORE_THAN, FEWER_THAN, EQUAL_TO }; - private FilterPermanent filter; - private Condition condition; - private CountType type; - private int count; + public static enum CountType { MORE_THAN, FEWER_THAN, EQUAL_TO }; + private FilterPermanent filter; + private Condition condition; + private CountType type; + private int count; - /** - * Applies a filter and delegates creation to - * {@link #ControlsPermanent(mage.filter.FilterPermanent, mage.abilities.condition.common.ControlsPermanent.CountType, int)} - * with {@link CountType#MORE_THAN}, and 0. - * - * @param filter - */ + /** + * Applies a filter and delegates creation to + * {@link #ControlsPermanent(mage.filter.FilterPermanent, mage.abilities.condition.common.ControlsPermanent.CountType, int)} + * with {@link CountType#MORE_THAN}, and 0. + * + * @param filter + */ public ControlsPermanentCondition(FilterPermanent filter) { this(filter, CountType.MORE_THAN, 0); } - /** - * Applies a filter, a {@link CountType}, and count to permanents on the - * battlefield when checking the condition during the - * {@link #apply(mage.game.Game, mage.abilities.Ability) apply} method invocation. - * - * @param filter - */ - public ControlsPermanentCondition ( FilterPermanent filter, CountType type, int count ) { - this.filter = filter; - this.type = type; - this.count = count; - } + /** + * Applies a filter, a {@link CountType}, and count to permanents on the + * battlefield when checking the condition during the + * {@link #apply(mage.game.Game, mage.abilities.Ability) apply} method invocation. + * + * @param filter + */ + public ControlsPermanentCondition ( FilterPermanent filter, CountType type, int count ) { + this.filter = filter; + this.type = type; + this.count = count; + } - /** - * Applies a filter, a {@link CountType}, and count to permanents on the - * battlefield and calls the decorated condition to see if it - * {@link #apply(mage.game.Game, mage.abilities.Ability) applies} - * as well. This will force both conditions to apply for this to be true. - * - * @param filter - * @param conditionToDecorate - */ - public ControlsPermanentCondition ( FilterPermanent filter, CountType type, int count, Condition conditionToDecorate ) { - this(filter, type, count); - this.condition = conditionToDecorate; - } + /** + * Applies a filter, a {@link CountType}, and count to permanents on the + * battlefield and calls the decorated condition to see if it + * {@link #apply(mage.game.Game, mage.abilities.Ability) applies} + * as well. This will force both conditions to apply for this to be true. + * + * @param filter + * @param conditionToDecorate + */ + public ControlsPermanentCondition ( FilterPermanent filter, CountType type, int count, Condition conditionToDecorate ) { + this(filter, type, count); + this.condition = conditionToDecorate; + } /* - * {@inheritDoc} - */ - @Override - public boolean apply(Game game, Ability source) { - boolean conditionApplies = false; + * {@inheritDoc} + */ + @Override + public boolean apply(Game game, Ability source) { + boolean conditionApplies = false; - switch ( this.type ) { - case FEWER_THAN: - conditionApplies = game.getBattlefield().countAll(filter, source.getControllerId(), game) < this.count; - break; - case MORE_THAN: - conditionApplies = game.getBattlefield().countAll(filter, source.getControllerId(), game) > this.count; - break; - case EQUAL_TO: - conditionApplies = game.getBattlefield().countAll(filter, source.getControllerId(), game) == this.count; - break; - } + switch ( this.type ) { + case FEWER_THAN: + conditionApplies = game.getBattlefield().countAll(filter, source.getControllerId(), game) < this.count; + break; + case MORE_THAN: + conditionApplies = game.getBattlefield().countAll(filter, source.getControllerId(), game) > this.count; + break; + case EQUAL_TO: + conditionApplies = game.getBattlefield().countAll(filter, source.getControllerId(), game) == this.count; + break; + } - //If a decorated condition exists, check it as well and apply them together. - if ( this.condition != null ) { - conditionApplies = conditionApplies && this.condition.apply(game, source); - } + //If a decorated condition exists, check it as well and apply them together. + if ( this.condition != null ) { + conditionApplies = conditionApplies && this.condition.apply(game, source); + } - return conditionApplies; - } + return conditionApplies; + } } diff --git a/Mage/src/mage/abilities/condition/common/DealtDamageToAnOpponent.java b/Mage/src/mage/abilities/condition/common/DealtDamageToAnOpponent.java index 86c3ccd75d..99ebdfb5fa 100644 --- a/Mage/src/mage/abilities/condition/common/DealtDamageToAnOpponent.java +++ b/Mage/src/mage/abilities/condition/common/DealtDamageToAnOpponent.java @@ -37,18 +37,18 @@ import mage.watchers.common.PlayerDamagedBySourceWatcher; * @author LevelX */ public class DealtDamageToAnOpponent implements Condition { - - public DealtDamageToAnOpponent() { - } - - @Override - public boolean apply(Game game, Ability source) { + + public DealtDamageToAnOpponent() { + } + + @Override + public boolean apply(Game game, Ability source) { for (UUID opponentId: game.getOpponents(source.getControllerId())) { PlayerDamagedBySourceWatcher watcher = (PlayerDamagedBySourceWatcher) game.getState().getWatchers().get("PlayerDamagedBySource", opponentId); if (watcher != null && watcher.damageSources.contains(source.getSourceId())) return true; } - return false; - } + return false; + } } diff --git a/Mage/src/mage/abilities/condition/common/EquippedCondition.java b/Mage/src/mage/abilities/condition/common/EquippedCondition.java index 90a28810f1..e34f1f97bd 100644 --- a/Mage/src/mage/abilities/condition/common/EquippedCondition.java +++ b/Mage/src/mage/abilities/condition/common/EquippedCondition.java @@ -50,14 +50,14 @@ public class EquippedCondition implements Condition { @Override public boolean apply(Game game, Ability source) { Permanent permanent = game.getBattlefield().getPermanent(source.getSourceId()); - if (permanent != null) { - for (UUID uuid : permanent.getAttachments()) { - Permanent attached = game.getBattlefield().getPermanent(uuid); - if (attached.getSubtype().contains("Equipment")) { - return true; - } - } - } - return false; + if (permanent != null) { + for (UUID uuid : permanent.getAttachments()) { + Permanent attached = game.getBattlefield().getPermanent(uuid); + if (attached.getSubtype().contains("Equipment")) { + return true; + } + } + } + return false; } } diff --git a/Mage/src/mage/abilities/condition/common/EquippedHasSubtypeCondition.java b/Mage/src/mage/abilities/condition/common/EquippedHasSubtypeCondition.java index 53c6ce3d55..c7363f270d 100644 --- a/Mage/src/mage/abilities/condition/common/EquippedHasSubtypeCondition.java +++ b/Mage/src/mage/abilities/condition/common/EquippedHasSubtypeCondition.java @@ -53,7 +53,7 @@ public class EquippedHasSubtypeCondition implements Condition { @Override public boolean apply(Game game, Ability source) { Permanent permanent = game.getBattlefield().getPermanent(source.getSourceId()); - if (permanent != null && permanent.getAttachedTo() != null) { + if (permanent != null && permanent.getAttachedTo() != null) { Permanent attachedTo = game.getBattlefield().getPermanent(permanent.getAttachedTo()); if (attachedTo != null) { if (subType != null) { @@ -68,7 +68,7 @@ public class EquippedHasSubtypeCondition implements Condition { } } } - } - return false; + } + return false; } } diff --git a/Mage/src/mage/abilities/condition/common/EquippedMatchesFilterCondition.java b/Mage/src/mage/abilities/condition/common/EquippedMatchesFilterCondition.java index 982c5bca76..d8d4db3434 100644 --- a/Mage/src/mage/abilities/condition/common/EquippedMatchesFilterCondition.java +++ b/Mage/src/mage/abilities/condition/common/EquippedMatchesFilterCondition.java @@ -50,7 +50,7 @@ public class EquippedMatchesFilterCondition implements Condition { @Override public boolean apply(Game game, Ability source) { Permanent permanent = game.getBattlefield().getPermanent(source.getSourceId()); - if (permanent != null && permanent.getAttachedTo() != null) { + if (permanent != null && permanent.getAttachedTo() != null) { Permanent attachedTo = game.getBattlefield().getPermanent(permanent.getAttachedTo()); if (attachedTo != null) { if (filter.match(attachedTo, attachedTo.getId(),attachedTo.getControllerId(), game)) { @@ -58,7 +58,7 @@ public class EquippedMatchesFilterCondition implements Condition { } } - } - return false; + } + return false; } } diff --git a/Mage/src/mage/abilities/condition/common/HasCounterCondition.java b/Mage/src/mage/abilities/condition/common/HasCounterCondition.java index 41789086e5..2e17487c52 100644 --- a/Mage/src/mage/abilities/condition/common/HasCounterCondition.java +++ b/Mage/src/mage/abilities/condition/common/HasCounterCondition.java @@ -37,20 +37,20 @@ import mage.game.Game; * @author nantuko */ public class HasCounterCondition implements Condition { - + private CounterType counterType; - private int amount = 1; + private int amount = 1; private int from = -1; private int to; - public HasCounterCondition(CounterType type) { - this.counterType = type; - } - - public HasCounterCondition(CounterType type, int amount) { - this.counterType = type; - this.amount = amount; - } + public HasCounterCondition(CounterType type) { + this.counterType = type; + } + + public HasCounterCondition(CounterType type, int amount) { + this.counterType = type; + this.amount = amount; + } public HasCounterCondition(CounterType type, int from, int to) { this.counterType = type; @@ -58,8 +58,8 @@ public class HasCounterCondition implements Condition { this.to = to; } - @Override - public boolean apply(Game game, Ability source) { + @Override + public boolean apply(Game game, Ability source) { if (from != -1) { //range compare int count = game.getPermanent(source.getSourceId()).getCounters().getCount(counterType); if (to == Integer.MAX_VALUE) { @@ -67,7 +67,7 @@ public class HasCounterCondition implements Condition { } return count >= from && count <= to; } else { // single compare (lte) - return game.getPermanent(source.getSourceId()).getCounters().getCount(counterType) >= amount; + return game.getPermanent(source.getSourceId()).getCounters().getCount(counterType) >= amount; } - } + } } diff --git a/Mage/src/mage/abilities/condition/common/InvertCondition.java b/Mage/src/mage/abilities/condition/common/InvertCondition.java index 29a1e15053..b004e8fc27 100644 --- a/Mage/src/mage/abilities/condition/common/InvertCondition.java +++ b/Mage/src/mage/abilities/condition/common/InvertCondition.java @@ -42,18 +42,18 @@ import mage.game.Game; */ public class InvertCondition implements Condition { - private Condition condition; + private Condition condition; - public InvertCondition(Condition condition) { - this.condition = condition; - } + public InvertCondition(Condition condition) { + this.condition = condition; + } - /* - * {@inheritDoc} - */ - @Override - public boolean apply(Game game, Ability source) { - return !condition.apply(game, source); - } + /* + * {@inheritDoc} + */ + @Override + public boolean apply(Game game, Ability source) { + return !condition.apply(game, source); + } } diff --git a/Mage/src/mage/abilities/condition/common/MorbidCondition.java b/Mage/src/mage/abilities/condition/common/MorbidCondition.java index e3f54f5fc7..4e81b7666a 100644 --- a/Mage/src/mage/abilities/condition/common/MorbidCondition.java +++ b/Mage/src/mage/abilities/condition/common/MorbidCondition.java @@ -37,15 +37,15 @@ import mage.watchers.Watcher; */ public class MorbidCondition implements Condition { - private static MorbidCondition fInstance = new MorbidCondition(); + private static MorbidCondition fInstance = new MorbidCondition(); - public static Condition getInstance() { - return fInstance; - } + public static Condition getInstance() { + return fInstance; + } - @Override - public boolean apply(Game game, Ability source) { - Watcher watcher = game.getState().getWatchers().get("Morbid"); - return watcher.conditionMet(); - } + @Override + public boolean apply(Game game, Ability source) { + Watcher watcher = game.getState().getWatchers().get("Morbid"); + return watcher.conditionMet(); + } } diff --git a/Mage/src/mage/abilities/condition/common/NoControlledCreatureCondition.java b/Mage/src/mage/abilities/condition/common/NoControlledCreatureCondition.java index adc589bd99..bf79c12c63 100644 --- a/Mage/src/mage/abilities/condition/common/NoControlledCreatureCondition.java +++ b/Mage/src/mage/abilities/condition/common/NoControlledCreatureCondition.java @@ -39,7 +39,7 @@ public class NoControlledCreatureCondition implements Condition { private static NoControlledCreatureCondition fInstance = new NoControlledCreatureCondition(); - private static final FilterCreaturePermanent filter = new FilterCreaturePermanent(); + private static final FilterCreaturePermanent filter = new FilterCreaturePermanent(); public static Condition getInstance() { return fInstance; @@ -47,6 +47,6 @@ public class NoControlledCreatureCondition implements Condition { @Override public boolean apply(Game game, Ability source) { - return game.getBattlefield().countAll(filter, source.getControllerId(), game) == 0; + return game.getBattlefield().countAll(filter, source.getControllerId(), game) == 0; } } diff --git a/Mage/src/mage/abilities/condition/common/NoCreatureCondition.java b/Mage/src/mage/abilities/condition/common/NoCreatureCondition.java index 9713c65ff2..68cee2d7ce 100644 --- a/Mage/src/mage/abilities/condition/common/NoCreatureCondition.java +++ b/Mage/src/mage/abilities/condition/common/NoCreatureCondition.java @@ -38,7 +38,7 @@ import mage.game.Game; public class NoCreatureCondition implements Condition { private static NoCreatureCondition fInstance = new NoCreatureCondition(); - private static final FilterCreaturePermanent filter = new FilterCreaturePermanent(); + private static final FilterCreaturePermanent filter = new FilterCreaturePermanent(); public static Condition getInstance() { return fInstance; @@ -46,6 +46,6 @@ public class NoCreatureCondition implements Condition { @Override public boolean apply(Game game, Ability source) { - return game.getBattlefield().countAll(filter, game) == 0; + return game.getBattlefield().countAll(filter, game) == 0; } } diff --git a/Mage/src/mage/abilities/condition/common/OneControlledCreatureCondition.java b/Mage/src/mage/abilities/condition/common/OneControlledCreatureCondition.java index fe9e3e1920..3e609c634d 100644 --- a/Mage/src/mage/abilities/condition/common/OneControlledCreatureCondition.java +++ b/Mage/src/mage/abilities/condition/common/OneControlledCreatureCondition.java @@ -39,7 +39,7 @@ public class OneControlledCreatureCondition implements Condition { private static OneControlledCreatureCondition fInstance = new OneControlledCreatureCondition(); - private static final FilterCreaturePermanent filter = new FilterCreaturePermanent(); + private static final FilterCreaturePermanent filter = new FilterCreaturePermanent(); public static Condition getInstance() { return fInstance; @@ -47,6 +47,6 @@ public class OneControlledCreatureCondition implements Condition { @Override public boolean apply(Game game, Ability source) { - return game.getBattlefield().countAll(filter, source.getControllerId(), game) == 1; + return game.getBattlefield().countAll(filter, source.getControllerId(), game) == 1; } } diff --git a/Mage/src/mage/abilities/condition/common/TenOrLessLifeCondition.java b/Mage/src/mage/abilities/condition/common/TenOrLessLifeCondition.java index 80287109f8..3323cdfa4c 100644 --- a/Mage/src/mage/abilities/condition/common/TenOrLessLifeCondition.java +++ b/Mage/src/mage/abilities/condition/common/TenOrLessLifeCondition.java @@ -38,33 +38,33 @@ import mage.game.Game; */ public class TenOrLessLifeCondition implements Condition { - public static enum CheckType { AN_OPPONENT, CONTROLLER, TARGET_OPPONENT }; + public static enum CheckType { AN_OPPONENT, CONTROLLER, TARGET_OPPONENT }; - private CheckType type; + private CheckType type; - public TenOrLessLifeCondition ( CheckType type ) { - this.type = type; - } + public TenOrLessLifeCondition ( CheckType type ) { + this.type = type; + } - @Override - public boolean apply(Game game, Ability source) { - boolean conditionApplies = false; + @Override + public boolean apply(Game game, Ability source) { + boolean conditionApplies = false; - switch ( this.type ) { - case AN_OPPONENT: - for ( UUID opponentUUID : game.getOpponents(source.getControllerId()) ) { - conditionApplies |= game.getPlayer(opponentUUID).getLife() <= 10; - } - break; - case CONTROLLER: - conditionApplies |= game.getPlayer(source.getControllerId()).getLife() <= 10; - break; - case TARGET_OPPONENT: - //TODO: Implement this. - break; - } + switch ( this.type ) { + case AN_OPPONENT: + for ( UUID opponentUUID : game.getOpponents(source.getControllerId()) ) { + conditionApplies |= game.getPlayer(opponentUUID).getLife() <= 10; + } + break; + case CONTROLLER: + conditionApplies |= game.getPlayer(source.getControllerId()).getLife() <= 10; + break; + case TARGET_OPPONENT: + //TODO: Implement this. + break; + } - return conditionApplies; - } + return conditionApplies; + } } diff --git a/Mage/src/mage/abilities/condition/common/TransformedCondition.java b/Mage/src/mage/abilities/condition/common/TransformedCondition.java index d943098e9e..2905e13c7f 100644 --- a/Mage/src/mage/abilities/condition/common/TransformedCondition.java +++ b/Mage/src/mage/abilities/condition/common/TransformedCondition.java @@ -40,8 +40,8 @@ public class TransformedCondition implements Condition { public TransformedCondition() { } - @Override - public boolean apply(Game game, Ability source) { + @Override + public boolean apply(Game game, Ability source) { return game.getPermanent(source.getSourceId()).isTransformed(); - } + } } diff --git a/Mage/src/mage/abilities/condition/common/UnlessCondition.java b/Mage/src/mage/abilities/condition/common/UnlessCondition.java index 32046116f6..f7e01af7aa 100644 --- a/Mage/src/mage/abilities/condition/common/UnlessCondition.java +++ b/Mage/src/mage/abilities/condition/common/UnlessCondition.java @@ -40,18 +40,18 @@ import mage.game.Game; */ public class UnlessCondition implements Condition { - private Condition condition; + private Condition condition; - public UnlessCondition ( Condition condition ) { - this.condition = condition; - } + public UnlessCondition ( Condition condition ) { + this.condition = condition; + } - /* - * {@inheritDoc} - */ - @Override - public boolean apply(Game game, Ability source) { - return !condition.apply(game, source); - } + /* + * {@inheritDoc} + */ + @Override + public boolean apply(Game game, Ability source) { + return !condition.apply(game, source); + } } diff --git a/Mage/src/mage/abilities/costs/Cost.java b/Mage/src/mage/abilities/costs/Cost.java index 53eb10c8d8..c77fa80c0e 100644 --- a/Mage/src/mage/abilities/costs/Cost.java +++ b/Mage/src/mage/abilities/costs/Cost.java @@ -37,15 +37,15 @@ import mage.target.Targets; public interface Cost extends Serializable { - public UUID getId(); - public String getText(); - public boolean canPay(UUID sourceId, UUID controllerId, Game game); - public boolean pay(Ability ability, Game game, UUID sourceId, UUID controllerId, boolean noMana); - public boolean isPaid(); - public void clearPaid(); - public void setPaid(); - public Targets getTargets(); + public UUID getId(); + public String getText(); + public boolean canPay(UUID sourceId, UUID controllerId, Game game); + public boolean pay(Ability ability, Game game, UUID sourceId, UUID controllerId, boolean noMana); + public boolean isPaid(); + public void clearPaid(); + public void setPaid(); + public Targets getTargets(); - public Cost copy(); + public Cost copy(); } diff --git a/Mage/src/mage/abilities/costs/CostImpl.java b/Mage/src/mage/abilities/costs/CostImpl.java index c18d0328d4..4b08aded26 100644 --- a/Mage/src/mage/abilities/costs/CostImpl.java +++ b/Mage/src/mage/abilities/costs/CostImpl.java @@ -35,61 +35,61 @@ import java.util.UUID; public abstract class CostImpl> implements Cost { - protected UUID id; - protected String text; - protected boolean paid; - protected Targets targets; + protected UUID id; + protected String text; + protected boolean paid; + protected Targets targets; - @Override - public abstract T copy(); + @Override + public abstract T copy(); - public CostImpl() { - id = UUID.randomUUID(); - paid = false; - targets = new Targets(); - } + public CostImpl() { + id = UUID.randomUUID(); + paid = false; + targets = new Targets(); + } - public CostImpl(final CostImpl cost) { - this.id = cost.id; - this.text = cost.text; - this.paid = cost.paid; - this.targets = cost.targets.copy(); - } + public CostImpl(final CostImpl cost) { + this.id = cost.id; + this.text = cost.text; + this.paid = cost.paid; + this.targets = cost.targets.copy(); + } - @Override - public String getText() { - return text; - } - - public void addTarget(Target target) { - if (target != null) { - this.targets.add(target); - } - } + @Override + public String getText() { + return text; + } - @Override - public Targets getTargets() { - return this.targets; - } + public void addTarget(Target target) { + if (target != null) { + this.targets.add(target); + } + } - @Override - public boolean isPaid() { - return paid; - } + @Override + public Targets getTargets() { + return this.targets; + } - @Override - public void clearPaid() { - paid = false; - } + @Override + public boolean isPaid() { + return paid; + } - @Override - public void setPaid() { - paid = true; - } + @Override + public void clearPaid() { + paid = false; + } - @Override - public UUID getId() { - return this.id; - } + @Override + public void setPaid() { + paid = true; + } + + @Override + public UUID getId() { + return this.id; + } } diff --git a/Mage/src/mage/abilities/costs/Costs.java b/Mage/src/mage/abilities/costs/Costs.java index fd4415fcb0..9fb95226b7 100644 --- a/Mage/src/mage/abilities/costs/Costs.java +++ b/Mage/src/mage/abilities/costs/Costs.java @@ -32,8 +32,8 @@ import java.util.List; public interface Costs extends List, Cost { - public List getUnpaid(); - public List getVariableCosts(); - @Override - public Costs copy(); + public List getUnpaid(); + public List getVariableCosts(); + @Override + public Costs copy(); } diff --git a/Mage/src/mage/abilities/costs/CostsImpl.java b/Mage/src/mage/abilities/costs/CostsImpl.java index 77866656b9..a38a14bbea 100644 --- a/Mage/src/mage/abilities/costs/CostsImpl.java +++ b/Mage/src/mage/abilities/costs/CostsImpl.java @@ -43,13 +43,13 @@ import mage.target.Targets; */ public class CostsImpl extends ArrayList implements Costs { - public CostsImpl() {} - - public CostsImpl(final CostsImpl costs) { - for (Cost cost: costs) { - this.add((T)cost.copy()); - } - } + public CostsImpl() {} + + public CostsImpl(final CostsImpl costs) { + for (Cost cost: costs) { + this.add((T)cost.copy()); + } + } @Override public UUID getId() { @@ -57,105 +57,105 @@ public class CostsImpl extends ArrayList implements Costs } @Override - public String getText() { - if (this.size() == 0) - return ""; + public String getText() { + if (this.size() == 0) + return ""; - StringBuilder sbText = new StringBuilder(); - for (T cost: this) { - sbText.append(cost.getText()).append(", "); - } - sbText.setLength(sbText.length() - 2); - return sbText.toString(); - } + StringBuilder sbText = new StringBuilder(); + for (T cost: this) { + sbText.append(cost.getText()).append(", "); + } + sbText.setLength(sbText.length() - 2); + return sbText.toString(); + } - @Override - public boolean canPay(UUID sourceId, UUID controllerId, Game game) { - for (T cost: this) { - if (!cost.canPay(sourceId, controllerId, game)) - return false; - } - return true; - } + @Override + public boolean canPay(UUID sourceId, UUID controllerId, Game game) { + for (T cost: this) { + if (!cost.canPay(sourceId, controllerId, game)) + return false; + } + return true; + } - @Override - public boolean pay(Ability ability, Game game, UUID sourceId, UUID controllerId, boolean noMana) { - if (this.size() > 0) { - while (!isPaid()) { - T cost = getFirstUnpaid(); - if (!cost.pay(ability, game, sourceId, controllerId, noMana)) - return false; - } - } - return true; - } + @Override + public boolean pay(Ability ability, Game game, UUID sourceId, UUID controllerId, boolean noMana) { + if (this.size() > 0) { + while (!isPaid()) { + T cost = getFirstUnpaid(); + if (!cost.pay(ability, game, sourceId, controllerId, noMana)) + return false; + } + } + return true; + } - @Override - public boolean isPaid() { - for (T cost: this) { - if (!((T)cost instanceof VariableManaCost) && !cost.isPaid()) - return false; - } - return true; - } + @Override + public boolean isPaid() { + for (T cost: this) { + if (!((T)cost instanceof VariableManaCost) && !cost.isPaid()) + return false; + } + return true; + } - @Override - public void clearPaid() { - for (T cost: this) { - cost.clearPaid(); - } - } + @Override + public void clearPaid() { + for (T cost: this) { + cost.clearPaid(); + } + } - @Override - public void setPaid() { - for (T cost: this) { - cost.setPaid(); - } - } + @Override + public void setPaid() { + for (T cost: this) { + cost.setPaid(); + } + } - @Override - public Costs getUnpaid() { - Costs unpaid = new CostsImpl(); - for (T cost: this) { - if (!cost.isPaid()) - unpaid.add(cost); - } - return unpaid; - } + @Override + public Costs getUnpaid() { + Costs unpaid = new CostsImpl(); + for (T cost: this) { + if (!cost.isPaid()) + unpaid.add(cost); + } + return unpaid; + } - protected T getFirstUnpaid() { - Costs unpaid = getUnpaid(); - if (unpaid.size() > 0) { - return unpaid.get(0); - } - return null; - } + protected T getFirstUnpaid() { + Costs unpaid = getUnpaid(); + if (unpaid.size() > 0) { + return unpaid.get(0); + } + return null; + } - @Override - public List getVariableCosts() { - List variableCosts = new ArrayList(); - for (T cost: this) { - if (cost instanceof VariableCost) - variableCosts.add((VariableCost) cost); - if (cost instanceof ManaCosts) { - variableCosts.addAll(((ManaCosts)cost).getVariableCosts()); - } - } - return variableCosts; - } + @Override + public List getVariableCosts() { + List variableCosts = new ArrayList(); + for (T cost: this) { + if (cost instanceof VariableCost) + variableCosts.add((VariableCost) cost); + if (cost instanceof ManaCosts) { + variableCosts.addAll(((ManaCosts)cost).getVariableCosts()); + } + } + return variableCosts; + } - @Override - public Targets getTargets() { - Targets targets = new Targets(); - for (T cost: this) { - targets.addAll(cost.getTargets()); - } - return targets; - } + @Override + public Targets getTargets() { + Targets targets = new Targets(); + for (T cost: this) { + targets.addAll(cost.getTargets()); + } + return targets; + } - @Override - public Costs copy() { - return new CostsImpl(this); - } + @Override + public Costs copy() { + return new CostsImpl(this); + } } diff --git a/Mage/src/mage/abilities/costs/VariableCost.java b/Mage/src/mage/abilities/costs/VariableCost.java index bf1a5d14df..049f4a3226 100644 --- a/Mage/src/mage/abilities/costs/VariableCost.java +++ b/Mage/src/mage/abilities/costs/VariableCost.java @@ -36,7 +36,7 @@ import mage.filter.FilterMana; */ public interface VariableCost { - public int getAmount(); + public int getAmount(); public void setAmount(int amount); - public void setFilter(FilterMana filter); + public void setFilter(FilterMana filter); } diff --git a/Mage/src/mage/abilities/costs/common/ControlPermanentCost.java b/Mage/src/mage/abilities/costs/common/ControlPermanentCost.java index 8d1ce3e5fa..8739e35b20 100644 --- a/Mage/src/mage/abilities/costs/common/ControlPermanentCost.java +++ b/Mage/src/mage/abilities/costs/common/ControlPermanentCost.java @@ -28,7 +28,7 @@ public class ControlPermanentCost extends CostImpl { @Override public boolean pay(Ability ability, Game game, UUID sourceId, UUID controllerId, boolean noMana) { this.paid = true; - return paid; + return paid; } @Override diff --git a/Mage/src/mage/abilities/costs/common/DiscardSourceCost.java b/Mage/src/mage/abilities/costs/common/DiscardSourceCost.java index 30e8934dec..116046f12e 100644 --- a/Mage/src/mage/abilities/costs/common/DiscardSourceCost.java +++ b/Mage/src/mage/abilities/costs/common/DiscardSourceCost.java @@ -41,36 +41,36 @@ import mage.players.Player; */ public class DiscardSourceCost extends CostImpl { - public DiscardSourceCost() {} + public DiscardSourceCost() {} - public DiscardSourceCost(DiscardSourceCost cost) { - super(cost); - } + public DiscardSourceCost(DiscardSourceCost cost) { + super(cost); + } - @Override - public boolean canPay(UUID sourceId, UUID controllerId, Game game) { - return game.getPlayer(controllerId).getHand().contains(sourceId); - } + @Override + public boolean canPay(UUID sourceId, UUID controllerId, Game game) { + return game.getPlayer(controllerId).getHand().contains(sourceId); + } - @Override - public boolean pay(Ability ability, Game game, UUID sourceId, UUID controllerId, boolean noMana) { - Player player = game.getPlayer(controllerId); - if (player != null) { - Card card = player.getHand().get(sourceId, game); - if (card != null) { - paid = player.discard(card, null, game); - } - } - return paid; - } + @Override + public boolean pay(Ability ability, Game game, UUID sourceId, UUID controllerId, boolean noMana) { + Player player = game.getPlayer(controllerId); + if (player != null) { + Card card = player.getHand().get(sourceId, game); + if (card != null) { + paid = player.discard(card, null, game); + } + } + return paid; + } - @Override - public String getText() { - return "Discard {this}"; - } + @Override + public String getText() { + return "Discard {this}"; + } - @Override - public DiscardSourceCost copy() { - return new DiscardSourceCost(this); - } + @Override + public DiscardSourceCost copy() { + return new DiscardSourceCost(this); + } } diff --git a/Mage/src/mage/abilities/costs/common/DiscardTargetCost.java b/Mage/src/mage/abilities/costs/common/DiscardTargetCost.java index 5b9ad27e9e..1e6b3eef6e 100644 --- a/Mage/src/mage/abilities/costs/common/DiscardTargetCost.java +++ b/Mage/src/mage/abilities/costs/common/DiscardTargetCost.java @@ -43,37 +43,37 @@ import mage.target.common.TargetCardInHand; */ public class DiscardTargetCost extends CostImpl { - public DiscardTargetCost(TargetCardInHand target) { - this.addTarget(target); - this.text = "Discard " + target.getTargetName(); - } + public DiscardTargetCost(TargetCardInHand target) { + this.addTarget(target); + this.text = "Discard " + target.getTargetName(); + } - public DiscardTargetCost(DiscardTargetCost cost) { - super(cost); - } + public DiscardTargetCost(DiscardTargetCost cost) { + super(cost); + } - @Override - public boolean pay(Ability ability, Game game, UUID sourceId, UUID controllerId, boolean noMana) { - if (targets.choose(Outcome.Discard, controllerId, sourceId, game)) { - Player player = game.getPlayer(controllerId); - for (UUID targetId: targets.get(0).getTargets()) { - Card card = player.getHand().get(targetId, game); - if (card == null) - return false; - paid |= player.discard(card, null, game); - } - } - return paid; - } + @Override + public boolean pay(Ability ability, Game game, UUID sourceId, UUID controllerId, boolean noMana) { + if (targets.choose(Outcome.Discard, controllerId, sourceId, game)) { + Player player = game.getPlayer(controllerId); + for (UUID targetId: targets.get(0).getTargets()) { + Card card = player.getHand().get(targetId, game); + if (card == null) + return false; + paid |= player.discard(card, null, game); + } + } + return paid; + } - @Override - public boolean canPay(UUID sourceId, UUID controllerId, Game game) { - return targets.canChoose(controllerId, game); - } + @Override + public boolean canPay(UUID sourceId, UUID controllerId, Game game) { + return targets.canChoose(controllerId, game); + } - @Override - public DiscardTargetCost copy() { - return new DiscardTargetCost(this); - } + @Override + public DiscardTargetCost copy() { + return new DiscardTargetCost(this); + } } diff --git a/Mage/src/mage/abilities/costs/common/ExileFromGraveCost.java b/Mage/src/mage/abilities/costs/common/ExileFromGraveCost.java index 0709332da5..6140722a1a 100644 --- a/Mage/src/mage/abilities/costs/common/ExileFromGraveCost.java +++ b/Mage/src/mage/abilities/costs/common/ExileFromGraveCost.java @@ -46,45 +46,45 @@ import java.util.UUID; public class ExileFromGraveCost extends CostImpl { public ExileFromGraveCost(TargetCardInYourGraveyard target) { - this.addTarget(target); + this.addTarget(target); if (target.getMaxNumberOfTargets() > 1) this.text = "Exile " + target.getMaxNumberOfTargets() + " " + target.getTargetName() + " from your graveyard"; else - this.text = "Exile " + target.getTargetName() + " from your graveyard"; - } + this.text = "Exile " + target.getTargetName() + " from your graveyard"; + } public ExileFromGraveCost(TargetCardInYourGraveyard target, String text) { - this(target); - this.text = text; - } + this(target); + this.text = text; + } - public ExileFromGraveCost(ExileFromGraveCost cost) { - super(cost); - } + public ExileFromGraveCost(ExileFromGraveCost cost) { + super(cost); + } - @Override - public boolean pay(Ability ability, Game game, UUID sourceId, UUID controllerId, boolean noMana) { - if (targets.choose(Outcome.Exile, controllerId, sourceId, game)) { - Player player = game.getPlayer(controllerId); - for (UUID targetId: targets.get(0).getTargets()) { - Card card = player.getGraveyard().get(targetId, game); - if (card == null) { - return false; + @Override + public boolean pay(Ability ability, Game game, UUID sourceId, UUID controllerId, boolean noMana) { + if (targets.choose(Outcome.Exile, controllerId, sourceId, game)) { + Player player = game.getPlayer(controllerId); + for (UUID targetId: targets.get(0).getTargets()) { + Card card = player.getGraveyard().get(targetId, game); + if (card == null) { + return false; } paid |= card.moveToZone(Constants.Zone.EXILED, sourceId, game, false); - } - } - return paid; - } + } + } + return paid; + } - @Override - public boolean canPay(UUID sourceId, UUID controllerId, Game game) { - return targets.canChoose(controllerId, game); - } + @Override + public boolean canPay(UUID sourceId, UUID controllerId, Game game) { + return targets.canChoose(controllerId, game); + } - @Override - public ExileFromGraveCost copy() { - return new ExileFromGraveCost(this); - } + @Override + public ExileFromGraveCost copy() { + return new ExileFromGraveCost(this); + } } diff --git a/Mage/src/mage/abilities/costs/common/ExileSourceCost.java b/Mage/src/mage/abilities/costs/common/ExileSourceCost.java index 623d4f8cac..6b59148661 100644 --- a/Mage/src/mage/abilities/costs/common/ExileSourceCost.java +++ b/Mage/src/mage/abilities/costs/common/ExileSourceCost.java @@ -41,35 +41,35 @@ import mage.game.permanent.Permanent; */ public class ExileSourceCost extends CostImpl { - public ExileSourceCost() { - this.text = "Exile {this}"; - } + public ExileSourceCost() { + this.text = "Exile {this}"; + } - public ExileSourceCost(ExileSourceCost cost) { - super(cost); - } + public ExileSourceCost(ExileSourceCost cost) { + super(cost); + } - @Override - public boolean pay(Ability ability, Game game, UUID sourceId, UUID controllerId, boolean noMana) { - Permanent permanent = game.getPermanent(sourceId); - if (permanent != null) { - paid = permanent.moveToExile(null, "", sourceId, game); - } - return paid; - } + @Override + public boolean pay(Ability ability, Game game, UUID sourceId, UUID controllerId, boolean noMana) { + Permanent permanent = game.getPermanent(sourceId); + if (permanent != null) { + paid = permanent.moveToExile(null, "", sourceId, game); + } + return paid; + } - @Override - public boolean canPay(UUID sourceId, UUID controllerId, Game game) { - Permanent permanent = game.getPermanent(sourceId); - if (permanent != null) { - return true; - } - return false; - } + @Override + public boolean canPay(UUID sourceId, UUID controllerId, Game game) { + Permanent permanent = game.getPermanent(sourceId); + if (permanent != null) { + return true; + } + return false; + } - @Override - public ExileSourceCost copy() { - return new ExileSourceCost(this); - } + @Override + public ExileSourceCost copy() { + return new ExileSourceCost(this); + } } diff --git a/Mage/src/mage/abilities/costs/common/MetalcraftCost.java b/Mage/src/mage/abilities/costs/common/MetalcraftCost.java index f6c6f827e2..c850bc341c 100644 --- a/Mage/src/mage/abilities/costs/common/MetalcraftCost.java +++ b/Mage/src/mage/abilities/costs/common/MetalcraftCost.java @@ -41,34 +41,34 @@ import mage.game.Game; */ public class MetalcraftCost extends CostImpl { - private static final FilterPermanent filter = new FilterPermanent("artifact"); + private static final FilterPermanent filter = new FilterPermanent("artifact"); - static { - filter.getCardType().add(CardType.ARTIFACT); - } + static { + filter.getCardType().add(CardType.ARTIFACT); + } - public MetalcraftCost() { - this.text = "Activate this ability only if you control three or more artifacts"; - } + public MetalcraftCost() { + this.text = "Activate this ability only if you control three or more artifacts"; + } - public MetalcraftCost(final MetalcraftCost cost) { - super(cost); - } + public MetalcraftCost(final MetalcraftCost cost) { + super(cost); + } - @Override - public MetalcraftCost copy() { - return new MetalcraftCost(this); - } + @Override + public MetalcraftCost copy() { + return new MetalcraftCost(this); + } - @Override - public boolean canPay(UUID sourceId, UUID controllerId, Game game) { - return game.getBattlefield().contains(filter, controllerId, 3, game); - } + @Override + public boolean canPay(UUID sourceId, UUID controllerId, Game game) { + return game.getBattlefield().contains(filter, controllerId, 3, game); + } - @Override - public boolean pay(Ability ability, Game game, UUID sourceId, UUID controllerId, boolean noMana) { - this.paid = true; - return paid; - } + @Override + public boolean pay(Ability ability, Game game, UUID sourceId, UUID controllerId, boolean noMana) { + this.paid = true; + return paid; + } } \ No newline at end of file diff --git a/Mage/src/mage/abilities/costs/common/OnlyDuringUpkeepCost.java b/Mage/src/mage/abilities/costs/common/OnlyDuringUpkeepCost.java index fba957bb49..fc87209bcc 100644 --- a/Mage/src/mage/abilities/costs/common/OnlyDuringUpkeepCost.java +++ b/Mage/src/mage/abilities/costs/common/OnlyDuringUpkeepCost.java @@ -39,30 +39,30 @@ import mage.game.Game; */ public class OnlyDuringUpkeepCost extends CostImpl { - public OnlyDuringUpkeepCost() { - text = "Activate this ability only during your upkeep"; - } - - public OnlyDuringUpkeepCost(final OnlyDuringUpkeepCost cost) { - super(cost); - } - - @Override - public OnlyDuringUpkeepCost copy() { - return new OnlyDuringUpkeepCost(this); - } + public OnlyDuringUpkeepCost() { + text = "Activate this ability only during your upkeep"; + } - @Override - public boolean canPay(UUID sourceId, UUID controllerId, Game game) { - if (game.getActivePlayerId().equals(controllerId) && game.getStep().getType() == PhaseStep.UPKEEP) - return true; - return false; - } + public OnlyDuringUpkeepCost(final OnlyDuringUpkeepCost cost) { + super(cost); + } + + @Override + public OnlyDuringUpkeepCost copy() { + return new OnlyDuringUpkeepCost(this); + } + + @Override + public boolean canPay(UUID sourceId, UUID controllerId, Game game) { + if (game.getActivePlayerId().equals(controllerId) && game.getStep().getType() == PhaseStep.UPKEEP) + return true; + return false; + } + + @Override + public boolean pay(Ability ability, Game game, UUID sourceId, UUID controllerId, boolean noMana) { + this.paid = true; + return paid; + } - @Override - public boolean pay(Ability ability, Game game, UUID sourceId, UUID controllerId, boolean noMana) { - this.paid = true; - return paid; - } - } diff --git a/Mage/src/mage/abilities/costs/common/OnlyDuringYourTurnCost.java b/Mage/src/mage/abilities/costs/common/OnlyDuringYourTurnCost.java index be15cc7fbf..93ef0b71de 100644 --- a/Mage/src/mage/abilities/costs/common/OnlyDuringYourTurnCost.java +++ b/Mage/src/mage/abilities/costs/common/OnlyDuringYourTurnCost.java @@ -39,30 +39,30 @@ import java.util.UUID; */ public class OnlyDuringYourTurnCost extends CostImpl { - public OnlyDuringYourTurnCost() { - text = "Activate this ability only during your turn"; - } + public OnlyDuringYourTurnCost() { + text = "Activate this ability only during your turn"; + } - public OnlyDuringYourTurnCost(final OnlyDuringYourTurnCost cost) { - super(cost); - } - - @Override - public OnlyDuringYourTurnCost copy() { - return new OnlyDuringYourTurnCost(this); - } + public OnlyDuringYourTurnCost(final OnlyDuringYourTurnCost cost) { + super(cost); + } - @Override - public boolean canPay(UUID sourceId, UUID controllerId, Game game) { - if (game.getActivePlayerId().equals(controllerId)) - return true; - return false; - } + @Override + public OnlyDuringYourTurnCost copy() { + return new OnlyDuringYourTurnCost(this); + } + + @Override + public boolean canPay(UUID sourceId, UUID controllerId, Game game) { + if (game.getActivePlayerId().equals(controllerId)) + return true; + return false; + } + + @Override + public boolean pay(Ability ability, Game game, UUID sourceId, UUID controllerId, boolean noMana) { + this.paid = true; + return paid; + } - @Override - public boolean pay(Ability ability, Game game, UUID sourceId, UUID controllerId, boolean noMana) { - this.paid = true; - return paid; - } - } diff --git a/Mage/src/mage/abilities/costs/common/PayLifeCost.java b/Mage/src/mage/abilities/costs/common/PayLifeCost.java index 6e6e00c0d7..7c7c5e7d4b 100644 --- a/Mage/src/mage/abilities/costs/common/PayLifeCost.java +++ b/Mage/src/mage/abilities/costs/common/PayLifeCost.java @@ -40,35 +40,35 @@ import java.util.UUID; */ public class PayLifeCost extends CostImpl { - private int amount; + private int amount; - public PayLifeCost(int amount) { - this.amount = amount; - this.text = "Pay " + Integer.toString(amount) + " life"; - } + public PayLifeCost(int amount) { + this.amount = amount; + this.text = "Pay " + Integer.toString(amount) + " life"; + } - public PayLifeCost(PayLifeCost cost) { - super(cost); - this.amount = cost.amount; - } + public PayLifeCost(PayLifeCost cost) { + super(cost); + this.amount = cost.amount; + } - @Override - public boolean canPay(UUID sourceId, UUID controllerId, Game game) { + @Override + public boolean canPay(UUID sourceId, UUID controllerId, Game game) { if (amount > 0 && !game.getPlayer(controllerId).canPayLifeCost()) { return false; } - return game.getPlayer(controllerId).getLife() > amount; - } + return game.getPlayer(controllerId).getLife() > amount; + } - @Override - public boolean pay(Ability ability, Game game, UUID sourceId, UUID controllerId, boolean noMana) { - this.paid = game.getPlayer(controllerId).loseLife(amount, game) == amount; - return paid; - } + @Override + public boolean pay(Ability ability, Game game, UUID sourceId, UUID controllerId, boolean noMana) { + this.paid = game.getPlayer(controllerId).loseLife(amount, game) == amount; + return paid; + } - @Override - public PayLifeCost copy() { - return new PayLifeCost(this); - } + @Override + public PayLifeCost copy() { + return new PayLifeCost(this); + } } diff --git a/Mage/src/mage/abilities/costs/common/PayLoyaltyCost.java b/Mage/src/mage/abilities/costs/common/PayLoyaltyCost.java index b1d4534814..13a060aacf 100644 --- a/Mage/src/mage/abilities/costs/common/PayLoyaltyCost.java +++ b/Mage/src/mage/abilities/costs/common/PayLoyaltyCost.java @@ -42,45 +42,45 @@ import mage.game.permanent.Permanent; */ public class PayLoyaltyCost extends CostImpl { - private int amount; + private int amount; - public PayLoyaltyCost(int amount) { - this.amount = amount; - this.text = Integer.toString(amount); - if (amount >= 0) this.text = "+" + this.text; - } + public PayLoyaltyCost(int amount) { + this.amount = amount; + this.text = Integer.toString(amount); + if (amount >= 0) this.text = "+" + this.text; + } - public PayLoyaltyCost(PayLoyaltyCost cost) { - super(cost); - this.amount = cost.amount; - } + public PayLoyaltyCost(PayLoyaltyCost cost) { + super(cost); + this.amount = cost.amount; + } - @Override - public boolean canPay(UUID sourceId, UUID controllerId, Game game) { - Permanent planeswalker = game.getPermanent(sourceId); - if (planeswalker.getCounters().getCount(CounterType.LOYALTY) + amount >= 0 && !planeswalker.isLoyaltyUsed()) - return true; - return false; - } + @Override + public boolean canPay(UUID sourceId, UUID controllerId, Game game) { + Permanent planeswalker = game.getPermanent(sourceId); + if (planeswalker.getCounters().getCount(CounterType.LOYALTY) + amount >= 0 && !planeswalker.isLoyaltyUsed()) + return true; + return false; + } - @Override - public boolean pay(Ability ability, Game game, UUID sourceId, UUID controllerId, boolean noMana) { - Permanent planeswalker = game.getPermanent(sourceId); - if (planeswalker.getCounters().getCount(CounterType.LOYALTY) + amount >= 0 && !planeswalker.isLoyaltyUsed()) { - if (amount > 0) { - planeswalker.getCounters().addCounter(CounterType.LOYALTY.createInstance(amount)); - } else if (amount < 0) { - planeswalker.getCounters().removeCounter(CounterType.LOYALTY, Math.abs(amount)); - } - planeswalker.setLoyaltyUsed(true); - this.paid = true; - } - return paid; - } + @Override + public boolean pay(Ability ability, Game game, UUID sourceId, UUID controllerId, boolean noMana) { + Permanent planeswalker = game.getPermanent(sourceId); + if (planeswalker.getCounters().getCount(CounterType.LOYALTY) + amount >= 0 && !planeswalker.isLoyaltyUsed()) { + if (amount > 0) { + planeswalker.getCounters().addCounter(CounterType.LOYALTY.createInstance(amount)); + } else if (amount < 0) { + planeswalker.getCounters().removeCounter(CounterType.LOYALTY, Math.abs(amount)); + } + planeswalker.setLoyaltyUsed(true); + this.paid = true; + } + return paid; + } - @Override - public PayLoyaltyCost copy() { - return new PayLoyaltyCost(this); - } + @Override + public PayLoyaltyCost copy() { + return new PayLoyaltyCost(this); + } } diff --git a/Mage/src/mage/abilities/costs/common/PayVariableLoyaltyCost.java b/Mage/src/mage/abilities/costs/common/PayVariableLoyaltyCost.java index 8816685aa5..4d5443eef2 100644 --- a/Mage/src/mage/abilities/costs/common/PayVariableLoyaltyCost.java +++ b/Mage/src/mage/abilities/costs/common/PayVariableLoyaltyCost.java @@ -45,48 +45,48 @@ import mage.players.Player; */ public class PayVariableLoyaltyCost extends CostImpl implements VariableCost { - protected int amountPaid = 0; + protected int amountPaid = 0; - public PayVariableLoyaltyCost() { - this.text = "-X"; - } + public PayVariableLoyaltyCost() { + this.text = "-X"; + } - public PayVariableLoyaltyCost(final PayVariableLoyaltyCost cost) { - super(cost); - this.amountPaid = cost.amountPaid; - } + public PayVariableLoyaltyCost(final PayVariableLoyaltyCost cost) { + super(cost); + this.amountPaid = cost.amountPaid; + } - @Override - public boolean canPay(UUID sourceId, UUID controllerId, Game game) { - Permanent planeswalker = game.getPermanent(sourceId); - return !planeswalker.isLoyaltyUsed(); - } + @Override + public boolean canPay(UUID sourceId, UUID controllerId, Game game) { + Permanent planeswalker = game.getPermanent(sourceId); + return !planeswalker.isLoyaltyUsed(); + } - @Override - public boolean pay(Ability ability, Game game, UUID sourceId, UUID controllerId, boolean noMana) { - Permanent planeswalker = game.getPermanent(sourceId); - Player player = game.getPlayer(planeswalker.getControllerId()); - this.amountPaid = player.getAmount(0, planeswalker.getCounters().getCount(CounterType.LOYALTY), "Choose X", game); - if (this.amountPaid> 0) { - planeswalker.getCounters().removeCounter(CounterType.LOYALTY, this.amountPaid); - } else if (this.amountPaid < 0) { - planeswalker.getCounters().addCounter(CounterType.LOYALTY.createInstance(Math.abs(this.amountPaid))); - } - planeswalker.setLoyaltyUsed(true); - this.paid = true; - return paid; - } + @Override + public boolean pay(Ability ability, Game game, UUID sourceId, UUID controllerId, boolean noMana) { + Permanent planeswalker = game.getPermanent(sourceId); + Player player = game.getPlayer(planeswalker.getControllerId()); + this.amountPaid = player.getAmount(0, planeswalker.getCounters().getCount(CounterType.LOYALTY), "Choose X", game); + if (this.amountPaid> 0) { + planeswalker.getCounters().removeCounter(CounterType.LOYALTY, this.amountPaid); + } else if (this.amountPaid < 0) { + planeswalker.getCounters().addCounter(CounterType.LOYALTY.createInstance(Math.abs(this.amountPaid))); + } + planeswalker.setLoyaltyUsed(true); + this.paid = true; + return paid; + } - @Override - public void clearPaid() { - paid = false; - amountPaid = 0; - } + @Override + public void clearPaid() { + paid = false; + amountPaid = 0; + } - @Override - public int getAmount() { - return amountPaid; - } + @Override + public int getAmount() { + return amountPaid; + } @Override public void setAmount(int amount) { @@ -94,12 +94,12 @@ public class PayVariableLoyaltyCost extends CostImpl imp } @Override - public void setFilter(FilterMana filter) { - } + public void setFilter(FilterMana filter) { + } - @Override - public PayVariableLoyaltyCost copy() { - return new PayVariableLoyaltyCost(this); - } + @Override + public PayVariableLoyaltyCost copy() { + return new PayVariableLoyaltyCost(this); + } } diff --git a/Mage/src/mage/abilities/costs/common/RemoveCountersSourceCost.java b/Mage/src/mage/abilities/costs/common/RemoveCountersSourceCost.java index a08255c09a..11a53e7731 100644 --- a/Mage/src/mage/abilities/costs/common/RemoveCountersSourceCost.java +++ b/Mage/src/mage/abilities/costs/common/RemoveCountersSourceCost.java @@ -41,42 +41,42 @@ import mage.game.permanent.Permanent; */ public class RemoveCountersSourceCost extends CostImpl { - private int amount; - private String name; + private int amount; + private String name; public RemoveCountersSourceCost(Counter counter) { - this.amount = counter.getCount(); - this.name = counter.getName(); - this.text = "Remove " + (amount == 1 ? "a" : amount) + " " + name + " counter" - + (amount != 1 ? "s" : "") + " from {this}"; - } + this.amount = counter.getCount(); + this.name = counter.getName(); + this.text = "Remove " + (amount == 1 ? "a" : amount) + " " + name + " counter" + + (amount != 1 ? "s" : "") + " from {this}"; + } - public RemoveCountersSourceCost(RemoveCountersSourceCost cost) { - super(cost); - this.amount = cost.amount; - this.name = cost.name; - } + public RemoveCountersSourceCost(RemoveCountersSourceCost cost) { + super(cost); + this.amount = cost.amount; + this.name = cost.name; + } - @Override - public boolean canPay(UUID sourceId, UUID controllerId, Game game) { - Permanent permanent = game.getPermanent(sourceId); - if (permanent.getCounters().getCount(name) >= amount) - return true; - return false; - } + @Override + public boolean canPay(UUID sourceId, UUID controllerId, Game game) { + Permanent permanent = game.getPermanent(sourceId); + if (permanent.getCounters().getCount(name) >= amount) + return true; + return false; + } - @Override - public boolean pay(Ability ability, Game game, UUID sourceId, UUID controllerId, boolean noMana) { - Permanent permanent = game.getPermanent(sourceId); - if (permanent != null && permanent.getCounters().getCount(name) >= amount) { - permanent.removeCounters(name, amount, game); - this.paid = true; - } - return paid; - } + @Override + public boolean pay(Ability ability, Game game, UUID sourceId, UUID controllerId, boolean noMana) { + Permanent permanent = game.getPermanent(sourceId); + if (permanent != null && permanent.getCounters().getCount(name) >= amount) { + permanent.removeCounters(name, amount, game); + this.paid = true; + } + return paid; + } - @Override - public RemoveCountersSourceCost copy() { - return new RemoveCountersSourceCost(this); - } + @Override + public RemoveCountersSourceCost copy() { + return new RemoveCountersSourceCost(this); + } } diff --git a/Mage/src/mage/abilities/costs/common/ReturnToHandTargetCost.java b/Mage/src/mage/abilities/costs/common/ReturnToHandTargetCost.java index 7a6d2508d1..94eda4a6e5 100644 --- a/Mage/src/mage/abilities/costs/common/ReturnToHandTargetCost.java +++ b/Mage/src/mage/abilities/costs/common/ReturnToHandTargetCost.java @@ -43,41 +43,41 @@ import mage.target.common.TargetControlledPermanent; */ public class ReturnToHandTargetCost extends CostImpl { - public ReturnToHandTargetCost(TargetControlledPermanent target) { - this.addTarget(target); + public ReturnToHandTargetCost(TargetControlledPermanent target) { + this.addTarget(target); if (target.getMaxNumberOfTargets() > 1 && target.getMaxNumberOfTargets() == target.getNumberOfTargets()) { this.text = "return " + target.getMaxNumberOfTargets() + " " + target.getTargetName() + " you control to it's owner's hand"; } else { - this.text = "return " + target.getTargetName() + " you control to it's owner's hand"; + this.text = "return " + target.getTargetName() + " you control to it's owner's hand"; } - } + } - public ReturnToHandTargetCost(ReturnToHandTargetCost cost) { - super(cost); - } + public ReturnToHandTargetCost(ReturnToHandTargetCost cost) { + super(cost); + } - @Override - public boolean pay(Ability ability, Game game, UUID sourceId, UUID controllerId, boolean noMana) { - if (targets.choose(Outcome.ReturnToHand, controllerId, sourceId, game)) { - for (UUID targetId: targets.get(0).getTargets()) { - Permanent permanent = game.getPermanent(targetId); - if (permanent == null) - return false; - paid |= permanent.moveToZone(Zone.HAND, sourceId, game, false); - } - } - return paid; - } + @Override + public boolean pay(Ability ability, Game game, UUID sourceId, UUID controllerId, boolean noMana) { + if (targets.choose(Outcome.ReturnToHand, controllerId, sourceId, game)) { + for (UUID targetId: targets.get(0).getTargets()) { + Permanent permanent = game.getPermanent(targetId); + if (permanent == null) + return false; + paid |= permanent.moveToZone(Zone.HAND, sourceId, game, false); + } + } + return paid; + } - @Override - public boolean canPay(UUID sourceId, UUID controllerId, Game game) { - return targets.canChoose(controllerId, game); - } + @Override + public boolean canPay(UUID sourceId, UUID controllerId, Game game) { + return targets.canChoose(controllerId, game); + } - @Override - public ReturnToHandTargetCost copy() { - return new ReturnToHandTargetCost(this); - } + @Override + public ReturnToHandTargetCost copy() { + return new ReturnToHandTargetCost(this); + } } diff --git a/Mage/src/mage/abilities/costs/common/SacrificeSourceCost.java b/Mage/src/mage/abilities/costs/common/SacrificeSourceCost.java index 9b7cc35828..7a84ee12c4 100644 --- a/Mage/src/mage/abilities/costs/common/SacrificeSourceCost.java +++ b/Mage/src/mage/abilities/costs/common/SacrificeSourceCost.java @@ -41,38 +41,38 @@ import java.util.UUID; */ public class SacrificeSourceCost extends CostImpl { - public SacrificeSourceCost() { - this.text = "Sacrifice {this}"; - } + public SacrificeSourceCost() { + this.text = "Sacrifice {this}"; + } - public SacrificeSourceCost(SacrificeSourceCost cost) { - super(cost); - } + public SacrificeSourceCost(SacrificeSourceCost cost) { + super(cost); + } - @Override - public boolean pay(Ability ability, Game game, UUID sourceId, UUID controllerId, boolean noMana) { - Permanent permanent = game.getPermanent(sourceId); - if (permanent != null) { - paid = permanent.sacrifice(sourceId, game); - } - return paid; - } + @Override + public boolean pay(Ability ability, Game game, UUID sourceId, UUID controllerId, boolean noMana) { + Permanent permanent = game.getPermanent(sourceId); + if (permanent != null) { + paid = permanent.sacrifice(sourceId, game); + } + return paid; + } - @Override - public boolean canPay(UUID sourceId, UUID controllerId, Game game) { + @Override + public boolean canPay(UUID sourceId, UUID controllerId, Game game) { if (!game.getPlayer(controllerId).canPaySacrificeCost()) { return false; } Permanent permanent = game.getPermanent(sourceId); - if (permanent != null) { - return true; - } - return false; - } + if (permanent != null) { + return true; + } + return false; + } - @Override - public SacrificeSourceCost copy() { - return new SacrificeSourceCost(this); - } + @Override + public SacrificeSourceCost copy() { + return new SacrificeSourceCost(this); + } } diff --git a/Mage/src/mage/abilities/costs/common/SacrificeTargetCost.java b/Mage/src/mage/abilities/costs/common/SacrificeTargetCost.java index e288fa8485..ce88bf236f 100644 --- a/Mage/src/mage/abilities/costs/common/SacrificeTargetCost.java +++ b/Mage/src/mage/abilities/costs/common/SacrificeTargetCost.java @@ -45,49 +45,49 @@ import java.util.UUID; */ public class SacrificeTargetCost extends CostImpl { - List permanents = new ArrayList(); + List permanents = new ArrayList(); - public SacrificeTargetCost(TargetControlledPermanent target) { - this.addTarget(target); - this.text = "Sacrifice " + target.getTargetName(); - } + public SacrificeTargetCost(TargetControlledPermanent target) { + this.addTarget(target); + this.text = "Sacrifice " + target.getTargetName(); + } - public SacrificeTargetCost(SacrificeTargetCost cost) { - super(cost); - for (Permanent permanent: cost.permanents) { - this.permanents.add(permanent.copy()); - } - } + public SacrificeTargetCost(SacrificeTargetCost cost) { + super(cost); + for (Permanent permanent: cost.permanents) { + this.permanents.add(permanent.copy()); + } + } - @Override - public boolean pay(Ability ability, Game game, UUID sourceId, UUID controllerId, boolean noMana) { - if (targets.choose(Outcome.Sacrifice, controllerId, sourceId, game)) { - for (UUID targetId: targets.get(0).getTargets()) { - Permanent permanent = game.getPermanent(targetId); - if (permanent == null) - return false; - permanents.add(permanent.copy()); - paid |= permanent.sacrifice(sourceId, game); - } - } - return paid; - } + @Override + public boolean pay(Ability ability, Game game, UUID sourceId, UUID controllerId, boolean noMana) { + if (targets.choose(Outcome.Sacrifice, controllerId, sourceId, game)) { + for (UUID targetId: targets.get(0).getTargets()) { + Permanent permanent = game.getPermanent(targetId); + if (permanent == null) + return false; + permanents.add(permanent.copy()); + paid |= permanent.sacrifice(sourceId, game); + } + } + return paid; + } - @Override - public boolean canPay(UUID sourceId, UUID controllerId, Game game) { + @Override + public boolean canPay(UUID sourceId, UUID controllerId, Game game) { if (!game.getPlayer(controllerId).canPaySacrificeCost()) { return false; } return targets.canChoose(controllerId, game); - } + } - @Override - public SacrificeTargetCost copy() { - return new SacrificeTargetCost(this); - } - - public List getPermanents() { - return permanents; - } + @Override + public SacrificeTargetCost copy() { + return new SacrificeTargetCost(this); + } + + public List getPermanents() { + return permanents; + } } diff --git a/Mage/src/mage/abilities/costs/common/TapSourceCost.java b/Mage/src/mage/abilities/costs/common/TapSourceCost.java index f7f4f03e45..930182167a 100644 --- a/Mage/src/mage/abilities/costs/common/TapSourceCost.java +++ b/Mage/src/mage/abilities/costs/common/TapSourceCost.java @@ -42,37 +42,37 @@ import mage.game.permanent.Permanent; */ public class TapSourceCost extends CostImpl { - public TapSourceCost() { - this.text = "{T}"; - } + public TapSourceCost() { + this.text = "{T}"; + } - public TapSourceCost(TapSourceCost cost) { - super(cost); - } + public TapSourceCost(TapSourceCost cost) { + super(cost); + } - @Override - public boolean pay(Ability ability, Game game, UUID sourceId, UUID controllerId, boolean noMana) { - Permanent permanent = game.getPermanent(sourceId); - if (permanent != null) { - paid = permanent.tap(game); - if (paid && ability instanceof ManaAbility) { - game.fireEvent(GameEvent.getEvent(GameEvent.EventType.TAPPED_FOR_MANA, sourceId, sourceId, controllerId)); - } - } - return paid; - } + @Override + public boolean pay(Ability ability, Game game, UUID sourceId, UUID controllerId, boolean noMana) { + Permanent permanent = game.getPermanent(sourceId); + if (permanent != null) { + paid = permanent.tap(game); + if (paid && ability instanceof ManaAbility) { + game.fireEvent(GameEvent.getEvent(GameEvent.EventType.TAPPED_FOR_MANA, sourceId, sourceId, controllerId)); + } + } + return paid; + } - @Override - public boolean canPay(UUID sourceId, UUID controllerId, Game game) { - Permanent permanent = game.getPermanent(sourceId); - if (permanent != null) { - return !permanent.isTapped() && permanent.canTap(); - } - return false; - } + @Override + public boolean canPay(UUID sourceId, UUID controllerId, Game game) { + Permanent permanent = game.getPermanent(sourceId); + if (permanent != null) { + return !permanent.isTapped() && permanent.canTap(); + } + return false; + } - @Override - public TapSourceCost copy() { - return new TapSourceCost(this); - } + @Override + public TapSourceCost copy() { + return new TapSourceCost(this); + } } diff --git a/Mage/src/mage/abilities/costs/common/TapTargetCost.java b/Mage/src/mage/abilities/costs/common/TapTargetCost.java index 39d078ad1c..9af3e6b101 100644 --- a/Mage/src/mage/abilities/costs/common/TapTargetCost.java +++ b/Mage/src/mage/abilities/costs/common/TapTargetCost.java @@ -44,40 +44,40 @@ import java.util.UUID; */ public class TapTargetCost extends CostImpl { - TargetControlledPermanent target; + TargetControlledPermanent target; - public TapTargetCost(TargetControlledPermanent target) { - this.target = target; - this.text = "Tap " + target.getMaxNumberOfTargets() + " " + target.getTargetName(); - } + public TapTargetCost(TargetControlledPermanent target) { + this.target = target; + this.text = "Tap " + target.getMaxNumberOfTargets() + " " + target.getTargetName(); + } - public TapTargetCost(final TapTargetCost cost) { - super(cost); - this.target = cost.target.copy(); - } + public TapTargetCost(final TapTargetCost cost) { + super(cost); + this.target = cost.target.copy(); + } - @Override - public boolean pay(Ability ability, Game game, UUID sourceId, UUID controllerId, boolean noMana) { - if (target.choose(Outcome.Tap, controllerId, sourceId, game)) { - for (UUID targetId: (List)target.getTargets()) { - Permanent permanent = game.getPermanent(targetId); - if (permanent == null) - return false; - paid |= permanent.tap(game); - } - } - return paid; - } + @Override + public boolean pay(Ability ability, Game game, UUID sourceId, UUID controllerId, boolean noMana) { + if (target.choose(Outcome.Tap, controllerId, sourceId, game)) { + for (UUID targetId: (List)target.getTargets()) { + Permanent permanent = game.getPermanent(targetId); + if (permanent == null) + return false; + paid |= permanent.tap(game); + } + } + return paid; + } - @Override - public boolean canPay(UUID sourceId, UUID controllerId, Game game) { - return target.canChoose(controllerId, game); - } + @Override + public boolean canPay(UUID sourceId, UUID controllerId, Game game) { + return target.canChoose(controllerId, game); + } - @Override - public TapTargetCost copy() { - return new TapTargetCost(this); - } + @Override + public TapTargetCost copy() { + return new TapTargetCost(this); + } } diff --git a/Mage/src/mage/abilities/costs/common/TapVariableTargetCost.java b/Mage/src/mage/abilities/costs/common/TapVariableTargetCost.java index 0452cd4516..5de4c4ab8a 100644 --- a/Mage/src/mage/abilities/costs/common/TapVariableTargetCost.java +++ b/Mage/src/mage/abilities/costs/common/TapVariableTargetCost.java @@ -44,54 +44,54 @@ import mage.target.common.TargetControlledPermanent; */ public class TapVariableTargetCost extends CostImpl implements VariableCost { - protected int amountPaid = 0; - protected TargetControlledPermanent target; + protected int amountPaid = 0; + protected TargetControlledPermanent target; - public TapVariableTargetCost(TargetControlledPermanent target) { - this.target = target; - this.text = "tap X " + target.getTargetName() + " you control"; - } + public TapVariableTargetCost(TargetControlledPermanent target) { + this.target = target; + this.text = "tap X " + target.getTargetName() + " you control"; + } - public TapVariableTargetCost(final TapVariableTargetCost cost) { - super(cost); - this.target = cost.target.copy(); - this.amountPaid = cost.amountPaid; - } + public TapVariableTargetCost(final TapVariableTargetCost cost) { + super(cost); + this.target = cost.target.copy(); + this.amountPaid = cost.amountPaid; + } - @Override - public boolean canPay(UUID sourceId, UUID controllerId, Game game) { - return target.canChoose(controllerId, game); - } + @Override + public boolean canPay(UUID sourceId, UUID controllerId, Game game) { + return target.canChoose(controllerId, game); + } - @Override - public boolean pay(Ability ability, Game game, UUID sourceId, UUID controllerId, boolean noMana) { - amountPaid = 0; - while (true) { - target.clearChosen(); - if (target.canChoose(sourceId, controllerId, game) && target.choose(Outcome.Tap, controllerId, sourceId, game)) { - Permanent permanent = game.getPermanent(target.getFirstTarget()); - if (permanent != null && permanent.tap(game)) { - amountPaid++; - } - } - else { - break; - } - } - paid = true; - return true; - } + @Override + public boolean pay(Ability ability, Game game, UUID sourceId, UUID controllerId, boolean noMana) { + amountPaid = 0; + while (true) { + target.clearChosen(); + if (target.canChoose(sourceId, controllerId, game) && target.choose(Outcome.Tap, controllerId, sourceId, game)) { + Permanent permanent = game.getPermanent(target.getFirstTarget()); + if (permanent != null && permanent.tap(game)) { + amountPaid++; + } + } + else { + break; + } + } + paid = true; + return true; + } - @Override - public void clearPaid() { - paid = false; - amountPaid = 0; - } + @Override + public void clearPaid() { + paid = false; + amountPaid = 0; + } - @Override - public int getAmount() { - return amountPaid; - } + @Override + public int getAmount() { + return amountPaid; + } @Override public void setAmount(int amount) { @@ -99,12 +99,12 @@ public class TapVariableTargetCost extends CostImpl imple } @Override - public void setFilter(FilterMana filter) { - } + public void setFilter(FilterMana filter) { + } - @Override - public TapVariableTargetCost copy() { - return new TapVariableTargetCost(this); - } + @Override + public TapVariableTargetCost copy() { + return new TapVariableTargetCost(this); + } } diff --git a/Mage/src/mage/abilities/costs/mana/ColoredManaCost.java b/Mage/src/mage/abilities/costs/mana/ColoredManaCost.java index 484076b46e..caa4f5b0f4 100644 --- a/Mage/src/mage/abilities/costs/mana/ColoredManaCost.java +++ b/Mage/src/mage/abilities/costs/mana/ColoredManaCost.java @@ -36,69 +36,69 @@ import mage.players.ManaPool; public class ColoredManaCost extends ManaCostImpl { - protected ColoredManaSymbol mana; + protected ColoredManaSymbol mana; - public ColoredManaCost(ColoredManaSymbol mana) { - this.mana = mana; - this.cost = new Mana(mana); - addColoredOption(mana); - } + public ColoredManaCost(ColoredManaSymbol mana) { + this.mana = mana; + this.cost = new Mana(mana); + addColoredOption(mana); + } - public ColoredManaCost(ColoredManaCost manaCost) { - super(manaCost); - this.mana = manaCost.mana; - } + public ColoredManaCost(ColoredManaCost manaCost) { + super(manaCost); + this.mana = manaCost.mana; + } - @Override - public int convertedManaCost() { - return 1; - } + @Override + public int convertedManaCost() { + return 1; + } - @Override - public boolean isPaid() { - if (paid) - return true; - return this.isColoredPaid(mana); - } + @Override + public boolean isPaid() { + if (paid) + return true; + return this.isColoredPaid(mana); + } - @Override - public void assignPayment(Game game, Ability ability, ManaPool pool) { - this.assignColored(ability, game, pool, mana); - } + @Override + public void assignPayment(Game game, Ability ability, ManaPool pool) { + this.assignColored(ability, game, pool, mana); + } - @Override - public String getText() { - return "{" + mana.toString() + "}"; - } + @Override + public String getText() { + return "{" + mana.toString() + "}"; + } - @Override - public ColoredManaCost getUnpaid() { - return this; - } + @Override + public ColoredManaCost getUnpaid() { + return this; + } - @Override - public boolean testPay(Mana testMana) { + @Override + public boolean testPay(Mana testMana) { if (testMana.getAny() > 0) { return true; } - switch (mana) { - case B: - return testMana.getBlack() > 0; - case U: - return testMana.getBlue() > 0; - case R: - return testMana.getRed() > 0; - case W: - return testMana.getWhite() > 0; - case G: - return testMana.getGreen() > 0; - } - return false; - } + switch (mana) { + case B: + return testMana.getBlack() > 0; + case U: + return testMana.getBlue() > 0; + case R: + return testMana.getRed() > 0; + case W: + return testMana.getWhite() > 0; + case G: + return testMana.getGreen() > 0; + } + return false; + } - @Override - public ColoredManaCost copy() { - return new ColoredManaCost(this); - } + @Override + public ColoredManaCost copy() { + return new ColoredManaCost(this); + } } diff --git a/Mage/src/mage/abilities/costs/mana/GenericManaCost.java b/Mage/src/mage/abilities/costs/mana/GenericManaCost.java index faaa4871a4..90f0eadd5b 100644 --- a/Mage/src/mage/abilities/costs/mana/GenericManaCost.java +++ b/Mage/src/mage/abilities/costs/mana/GenericManaCost.java @@ -35,58 +35,58 @@ import mage.players.ManaPool; public class GenericManaCost extends ManaCostImpl { - protected int mana; + protected int mana; - public GenericManaCost(int mana) { - this.mana = mana; - this.cost = Mana.ColorlessMana(mana); - this.options.addMana(Mana.ColorlessMana(mana)); - } + public GenericManaCost(int mana) { + this.mana = mana; + this.cost = Mana.ColorlessMana(mana); + this.options.addMana(Mana.ColorlessMana(mana)); + } - public GenericManaCost(GenericManaCost manaCost) { - super(manaCost); - this.mana = manaCost.mana; - } + public GenericManaCost(GenericManaCost manaCost) { + super(manaCost); + this.mana = manaCost.mana; + } - public void setMana(int mana) { - this.mana = mana; - } + public void setMana(int mana) { + this.mana = mana; + } - @Override - public int convertedManaCost() { - return mana; - } + @Override + public int convertedManaCost() { + return mana; + } - @Override - public boolean isPaid() { - if (paid) - return true; - return this.isColorlessPaid(mana); - } + @Override + public boolean isPaid() { + if (paid) + return true; + return this.isColorlessPaid(mana); + } - @Override - public void assignPayment(Game game, Ability ability, ManaPool pool) { - this.assignColorless(ability, game, pool, mana); - } + @Override + public void assignPayment(Game game, Ability ability, ManaPool pool) { + this.assignColorless(ability, game, pool, mana); + } - @Override - public String getText() { - return "{" + Integer.toString(mana) + "}"; - } + @Override + public String getText() { + return "{" + Integer.toString(mana) + "}"; + } - @Override - public GenericManaCost getUnpaid() { - return new GenericManaCost(mana - this.payment.count()); - } + @Override + public GenericManaCost getUnpaid() { + return new GenericManaCost(mana - this.payment.count()); + } - @Override - public boolean testPay(Mana testMana) { - return testMana.count() > 0; - } + @Override + public boolean testPay(Mana testMana) { + return testMana.count() > 0; + } - @Override - public GenericManaCost copy() { - return new GenericManaCost(this); - } + @Override + public GenericManaCost copy() { + return new GenericManaCost(this); + } } diff --git a/Mage/src/mage/abilities/costs/mana/HybridManaCost.java b/Mage/src/mage/abilities/costs/mana/HybridManaCost.java index cdce18163c..691f77b630 100644 --- a/Mage/src/mage/abilities/costs/mana/HybridManaCost.java +++ b/Mage/src/mage/abilities/costs/mana/HybridManaCost.java @@ -35,89 +35,89 @@ import mage.game.Game; import mage.players.ManaPool; public class HybridManaCost extends ManaCostImpl { - private ColoredManaSymbol mana1; - private ColoredManaSymbol mana2; + private ColoredManaSymbol mana1; + private ColoredManaSymbol mana2; - public HybridManaCost(ColoredManaSymbol mana1, ColoredManaSymbol mana2) { - this.mana1 = mana1; - this.mana2 = mana2; - this.cost = new Mana(mana1); - this.cost.add(new Mana(mana2)); - addColoredOption(mana1); - addColoredOption(mana2); - } + public HybridManaCost(ColoredManaSymbol mana1, ColoredManaSymbol mana2) { + this.mana1 = mana1; + this.mana2 = mana2; + this.cost = new Mana(mana1); + this.cost.add(new Mana(mana2)); + addColoredOption(mana1); + addColoredOption(mana2); + } - public HybridManaCost(HybridManaCost manaCost) { - super(manaCost); - this.mana1 = manaCost.mana1; - this.mana2 = manaCost.mana2; - } + public HybridManaCost(HybridManaCost manaCost) { + super(manaCost); + this.mana1 = manaCost.mana1; + this.mana2 = manaCost.mana2; + } - @Override - public int convertedManaCost() { - return 1; - } + @Override + public int convertedManaCost() { + return 1; + } - @Override - public boolean isPaid() { - if (paid || isColoredPaid(this.mana1) || isColoredPaid(this.mana2)) - return true; - return false; - } + @Override + public boolean isPaid() { + if (paid || isColoredPaid(this.mana1) || isColoredPaid(this.mana2)) + return true; + return false; + } - @Override - public void assignPayment(Game game, Ability ability, ManaPool pool) { - if (assignColored(ability, game, pool, this.mana1)) - return; - assignColored(ability, game, pool, this.mana2); - } + @Override + public void assignPayment(Game game, Ability ability, ManaPool pool) { + if (assignColored(ability, game, pool, this.mana1)) + return; + assignColored(ability, game, pool, this.mana2); + } - @Override - public String getText() { - return "{" + mana1.toString() + "/" + mana2.toString() + "}"; - } + @Override + public String getText() { + return "{" + mana1.toString() + "/" + mana2.toString() + "}"; + } - @Override - public HybridManaCost getUnpaid() { - return this; - } + @Override + public HybridManaCost getUnpaid() { + return this; + } - @Override - public boolean testPay(Mana testMana) { - switch (mana1) { - case B: - if (testMana.getBlack() > 0) - return true; - case U: - if (testMana.getBlue() >0) - return true; - case R: - if (testMana.getRed() > 0) - return true; - case W: - if (testMana.getWhite() > 0) - return true; - case G: - if (testMana.getGreen() > 0) - return true; - } - switch (mana2) { - case B: - return testMana.getBlack() > 0; - case U: - return testMana.getBlue() > 0; - case R: - return testMana.getRed() > 0; - case W: - return testMana.getWhite() > 0; - case G: - return testMana.getGreen() > 0; - } - return false; - } + @Override + public boolean testPay(Mana testMana) { + switch (mana1) { + case B: + if (testMana.getBlack() > 0) + return true; + case U: + if (testMana.getBlue() >0) + return true; + case R: + if (testMana.getRed() > 0) + return true; + case W: + if (testMana.getWhite() > 0) + return true; + case G: + if (testMana.getGreen() > 0) + return true; + } + switch (mana2) { + case B: + return testMana.getBlack() > 0; + case U: + return testMana.getBlue() > 0; + case R: + return testMana.getRed() > 0; + case W: + return testMana.getWhite() > 0; + case G: + return testMana.getGreen() > 0; + } + return false; + } - @Override - public HybridManaCost copy() { - return new HybridManaCost(this); - } + @Override + public HybridManaCost copy() { + return new HybridManaCost(this); + } } diff --git a/Mage/src/mage/abilities/costs/mana/ManaCost.java b/Mage/src/mage/abilities/costs/mana/ManaCost.java index c9c0fc526b..63739d94ac 100644 --- a/Mage/src/mage/abilities/costs/mana/ManaCost.java +++ b/Mage/src/mage/abilities/costs/mana/ManaCost.java @@ -38,20 +38,20 @@ import mage.players.ManaPool; public interface ManaCost extends Cost { - public int convertedManaCost(); - public Mana getMana(); - public Mana getPayment(); - public void assignPayment(Game game, Ability ability, ManaPool pool); - public void setPayment(Mana mana); - @Override - public String getText(); - public ManaCost getUnpaid(); - public ManaOptions getOptions(); - public boolean testPay(Mana testMana); + public int convertedManaCost(); + public Mana getMana(); + public Mana getPayment(); + public void assignPayment(Game game, Ability ability, ManaPool pool); + public void setPayment(Mana mana); + @Override + public String getText(); + public ManaCost getUnpaid(); + public ManaOptions getOptions(); + public boolean testPay(Mana testMana); public Filter getSourceFilter(); public void setSourceFilter(Filter filter); - @Override - public ManaCost copy(); + @Override + public ManaCost copy(); } diff --git a/Mage/src/mage/abilities/costs/mana/ManaCostImpl.java b/Mage/src/mage/abilities/costs/mana/ManaCostImpl.java index 5563080564..816f744995 100644 --- a/Mage/src/mage/abilities/costs/mana/ManaCostImpl.java +++ b/Mage/src/mage/abilities/costs/mana/ManaCostImpl.java @@ -90,12 +90,12 @@ public abstract class ManaCostImpl> extends CostImpl extends List, ManaCost { - public ManaCosts getUnpaidVariableCosts(); - public List getVariableCosts(); + public ManaCosts getUnpaidVariableCosts(); + public List getVariableCosts(); public int getX(); public void setX(int x); - public void load(String mana); - public List getSymbols(); - - - @Override - public Mana getMana(); + public void load(String mana); + public List getSymbols(); - @Override - public ManaCosts copy(); + + @Override + public Mana getMana(); + + @Override + public ManaCosts copy(); } diff --git a/Mage/src/mage/abilities/costs/mana/ManaCostsImpl.java b/Mage/src/mage/abilities/costs/mana/ManaCostsImpl.java index a860c1bff5..777b2771ab 100644 --- a/Mage/src/mage/abilities/costs/mana/ManaCostsImpl.java +++ b/Mage/src/mage/abilities/costs/mana/ManaCostsImpl.java @@ -150,7 +150,7 @@ public class ManaCostsImpl extends ArrayList implements M game.restoreState(bookmark); return false; } - + @Override public ManaCosts getUnpaid() { ManaCosts unpaid = new ManaCostsImpl(); @@ -179,10 +179,10 @@ public class ManaCostsImpl extends ArrayList implements M if (cost instanceof VariableCost) variableCosts.add((VariableCost) cost); } -// if (variableCosts.size() == 0) { -// // add empty cost (#Issue 210) -// variableCosts.add(new VariableManaCost()); -// } +// if (variableCosts.size() == 0) { +// // add empty cost (#Issue 210) +// variableCosts.add(new VariableManaCost()); +// } return variableCosts; } diff --git a/Mage/src/mage/abilities/costs/mana/MonoHybridManaCost.java b/Mage/src/mage/abilities/costs/mana/MonoHybridManaCost.java index 5027afad5e..10d31b7ce6 100644 --- a/Mage/src/mage/abilities/costs/mana/MonoHybridManaCost.java +++ b/Mage/src/mage/abilities/costs/mana/MonoHybridManaCost.java @@ -36,77 +36,77 @@ import mage.players.ManaPool; public class MonoHybridManaCost extends ManaCostImpl { - private ColoredManaSymbol mana; - private int mana2 = 2; + private ColoredManaSymbol mana; + private int mana2 = 2; - public MonoHybridManaCost(ColoredManaSymbol mana) { - this.mana = mana; - this.cost = new Mana(mana); - this.cost.add(Mana.ColorlessMana(2)); - addColoredOption(mana); - options.add(Mana.ColorlessMana(2)); - } + public MonoHybridManaCost(ColoredManaSymbol mana) { + this.mana = mana; + this.cost = new Mana(mana); + this.cost.add(Mana.ColorlessMana(2)); + addColoredOption(mana); + options.add(Mana.ColorlessMana(2)); + } - public MonoHybridManaCost(MonoHybridManaCost manaCost) { - super(manaCost); - this.mana = manaCost.mana; - this.mana2 = manaCost.mana2; - } + public MonoHybridManaCost(MonoHybridManaCost manaCost) { + super(manaCost); + this.mana = manaCost.mana; + this.mana2 = manaCost.mana2; + } - @Override - public int convertedManaCost() { - return 2; - } + @Override + public int convertedManaCost() { + return 2; + } - @Override - public boolean isPaid() { - if (paid || isColoredPaid(this.mana)) - return true; - return isColorlessPaid(this.mana2); - } + @Override + public boolean isPaid() { + if (paid || isColoredPaid(this.mana)) + return true; + return isColorlessPaid(this.mana2); + } - @Override - public void assignPayment(Game game, Ability ability, ManaPool pool) { - if (!assignColored(ability, game, pool, mana)) { - assignColorless(ability, game, pool, mana2); - } - } + @Override + public void assignPayment(Game game, Ability ability, ManaPool pool) { + if (!assignColored(ability, game, pool, mana)) { + assignColorless(ability, game, pool, mana2); + } + } - @Override - public String getText() { - return "{2/" + mana.toString() + "}"; - } + @Override + public String getText() { + return "{2/" + mana.toString() + "}"; + } - @Override - public MonoHybridManaCost getUnpaid() { - return this; - } + @Override + public MonoHybridManaCost getUnpaid() { + return this; + } - @Override - public boolean testPay(Mana testMana) { - switch (mana) { - case B: - if (testMana.getBlack() > 0) - return true; - case U: - if (testMana.getBlue() > 0) - return true; - case R: - if (testMana.getRed() > 0) - return true; - case W: - if (testMana.getWhite() > 0) - return true; - case G: - if (testMana.getGreen() > 0) - return true; - } - return testMana.count() > 0; - } + @Override + public boolean testPay(Mana testMana) { + switch (mana) { + case B: + if (testMana.getBlack() > 0) + return true; + case U: + if (testMana.getBlue() > 0) + return true; + case R: + if (testMana.getRed() > 0) + return true; + case W: + if (testMana.getWhite() > 0) + return true; + case G: + if (testMana.getGreen() > 0) + return true; + } + return testMana.count() > 0; + } - @Override - public MonoHybridManaCost copy() { - return new MonoHybridManaCost(this); - } + @Override + public MonoHybridManaCost copy() { + return new MonoHybridManaCost(this); + } } diff --git a/Mage/src/mage/abilities/costs/mana/PhyrexianManaCost.java b/Mage/src/mage/abilities/costs/mana/PhyrexianManaCost.java index 3726781eee..ff0a15ac0a 100644 --- a/Mage/src/mage/abilities/costs/mana/PhyrexianManaCost.java +++ b/Mage/src/mage/abilities/costs/mana/PhyrexianManaCost.java @@ -42,48 +42,48 @@ import java.util.UUID; */ public class PhyrexianManaCost extends ColoredManaCost { - public PhyrexianManaCost(ColoredManaSymbol mana) { - super(mana); + public PhyrexianManaCost(ColoredManaSymbol mana) { + super(mana); options.add(Mana.ColorlessMana(0)); - } + } - public PhyrexianManaCost(PhyrexianManaCost manaCost) { - super(manaCost); - } + public PhyrexianManaCost(PhyrexianManaCost manaCost) { + super(manaCost); + } - @Override - public void assignPayment(Game game, Ability ability, ManaPool pool) { - if (assignColored(ability, game, pool, this.mana)) - return; - } + @Override + public void assignPayment(Game game, Ability ability, ManaPool pool) { + if (assignColored(ability, game, pool, this.mana)) + return; + } - @Override - public String getText() { - return "{" + mana.toString() + "P}"; - } + @Override + public String getText() { + return "{" + mana.toString() + "P}"; + } - @Override - public PhyrexianManaCost getUnpaid() { - return this; - } + @Override + public PhyrexianManaCost getUnpaid() { + return this; + } - @Override - public boolean canPay(UUID sourceId, UUID controllerId, Game game) { - if (!game.getPlayer(controllerId).isLifeTotalCanChange()) { - return false; - } - return game.getPlayer(controllerId).getLife() >= 2; - } + @Override + public boolean canPay(UUID sourceId, UUID controllerId, Game game) { + if (!game.getPlayer(controllerId).isLifeTotalCanChange()) { + return false; + } + return game.getPlayer(controllerId).getLife() >= 2; + } - @Override - public boolean pay(Ability ability, Game game, UUID sourceId, UUID controllerId, boolean noMana) { - this.paid = game.getPlayer(controllerId).loseLife(2, game) == 2; - return paid; - } + @Override + public boolean pay(Ability ability, Game game, UUID sourceId, UUID controllerId, boolean noMana) { + this.paid = game.getPlayer(controllerId).loseLife(2, game) == 2; + return paid; + } - @Override - public PhyrexianManaCost copy() { - return new PhyrexianManaCost(this); - } + @Override + public PhyrexianManaCost copy() { + return new PhyrexianManaCost(this); + } } diff --git a/Mage/src/mage/abilities/costs/mana/VariableManaCost.java b/Mage/src/mage/abilities/costs/mana/VariableManaCost.java index cf82980bf9..22dff9416a 100644 --- a/Mage/src/mage/abilities/costs/mana/VariableManaCost.java +++ b/Mage/src/mage/abilities/costs/mana/VariableManaCost.java @@ -41,60 +41,60 @@ import mage.players.ManaPool; */ public class VariableManaCost extends ManaCostImpl implements VariableCost { - protected int multiplier; - protected FilterMana filter; + protected int multiplier; + protected FilterMana filter; - public VariableManaCost() { - this(1); - } - - public VariableManaCost(int multiplier) { - this.multiplier = multiplier; + public VariableManaCost() { + this(1); + } + + public VariableManaCost(int multiplier) { + this.multiplier = multiplier; this.cost = new Mana(); options.add(new Mana()); - } + } - public VariableManaCost(VariableManaCost manaCost) { - super(manaCost); - this.multiplier = manaCost.multiplier; - if (manaCost.filter != null) this.filter = manaCost.filter.copy(); - } + public VariableManaCost(VariableManaCost manaCost) { + super(manaCost); + this.multiplier = manaCost.multiplier; + if (manaCost.filter != null) this.filter = manaCost.filter.copy(); + } - @Override - public int convertedManaCost() { - return 0; - } + @Override + public int convertedManaCost() { + return 0; + } - @Override - public void assignPayment(Game game, Ability ability, ManaPool pool) { - payment.add(pool.getMana(filter)); - payment.add(pool.getAllConditionalMana(ability, game, filter)); - pool.payX(ability, game, filter); - } + @Override + public void assignPayment(Game game, Ability ability, ManaPool pool) { + payment.add(pool.getMana(filter)); + payment.add(pool.getAllConditionalMana(ability, game, filter)); + pool.payX(ability, game, filter); + } - @Override - public String getText() { - if (multiplier > 1) { - String symbol = ""; - for (int i = 0; i < multiplier; i++) { - symbol += "{X}"; - } - return symbol; - } - else { - return "{X}"; - } - } + @Override + public String getText() { + if (multiplier > 1) { + String symbol = ""; + for (int i = 0; i < multiplier; i++) { + symbol += "{X}"; + } + return symbol; + } + else { + return "{X}"; + } + } - @Override - public VariableManaCost getUnpaid() { - return this; - } + @Override + public VariableManaCost getUnpaid() { + return this; + } - @Override - public int getAmount() { - return payment.count() / multiplier; - } + @Override + public int getAmount() { + return payment.count() / multiplier; + } @Override public void setAmount(int amount) { @@ -102,18 +102,18 @@ public class VariableManaCost extends ManaCostImpl implements } @Override - public boolean testPay(Mana testMana) { - return true; - } + public boolean testPay(Mana testMana) { + return true; + } - @Override - public void setFilter(FilterMana filter) { - this.filter = filter; - } + @Override + public void setFilter(FilterMana filter) { + this.filter = filter; + } + + @Override + public VariableManaCost copy() { + return new VariableManaCost(this); + } - @Override - public VariableManaCost copy() { - return new VariableManaCost(this); - } - } diff --git a/Mage/src/mage/abilities/decorator/ConditionalActivatedAbility.java b/Mage/src/mage/abilities/decorator/ConditionalActivatedAbility.java index 80d5356ebb..4ea378b3c7 100644 --- a/Mage/src/mage/abilities/decorator/ConditionalActivatedAbility.java +++ b/Mage/src/mage/abilities/decorator/ConditionalActivatedAbility.java @@ -22,59 +22,59 @@ import mage.game.Game; * @author LevelX */ public class ConditionalActivatedAbility extends ActivatedAbilityImpl { - - private Condition condition; - private String staticText = ""; - + + private Condition condition; + private String staticText = ""; + private static final Effects emptyEffects = new Effects(); - - public ConditionalActivatedAbility(Zone zone, Effect effect, ManaCosts cost, Condition condition, String rule) { - super(zone, effect, cost); - this.condition = condition; - this.staticText = rule; - } - public ConditionalActivatedAbility(Zone zone, Effect effect, Costs costs, Condition condition, String rule) { - super(zone, effect, costs); + public ConditionalActivatedAbility(Zone zone, Effect effect, ManaCosts cost, Condition condition, String rule) { + super(zone, effect, cost); + this.condition = condition; + this.staticText = rule; + } + + public ConditionalActivatedAbility(Zone zone, Effect effect, Costs costs, Condition condition, String rule) { + super(zone, effect, costs); this.condition = condition; - this.staticText = rule; - } + this.staticText = rule; + } - public ConditionalActivatedAbility(Zone zone, Effect effect, Cost cost, Condition condition, String rule) { - super(zone, effect, cost); + public ConditionalActivatedAbility(Zone zone, Effect effect, Cost cost, Condition condition, String rule) { + super(zone, effect, cost); this.condition = condition; - this.staticText = rule; - } + this.staticText = rule; + } - public ConditionalActivatedAbility(ConditionalActivatedAbility ability) { - super(ability); + public ConditionalActivatedAbility(ConditionalActivatedAbility ability) { + super(ability); this.condition = ability.condition; - this.staticText = ability.staticText; - } + this.staticText = ability.staticText; + } @Override - public Effects getEffects(Game game, Constants.EffectType effectType) { - if (!condition.apply(game, this)) { - return emptyEffects; - } - return super.getEffects(game, effectType); - } - + public Effects getEffects(Game game, Constants.EffectType effectType) { + if (!condition.apply(game, this)) { + return emptyEffects; + } + return super.getEffects(game, effectType); + } + @Override public boolean canActivate(UUID playerId, Game game) { - if (!condition.apply(game, this)) { - return false; - } - return super.canActivate(playerId, game); - } - - @Override - public ConditionalActivatedAbility copy() { - return new ConditionalActivatedAbility(this); - } + if (!condition.apply(game, this)) { + return false; + } + return super.canActivate(playerId, game); + } + + @Override + public ConditionalActivatedAbility copy() { + return new ConditionalActivatedAbility(this); + } @Override - public String getRule() { - return staticText; - } + public String getRule() { + return staticText; + } } diff --git a/Mage/src/mage/abilities/decorator/ConditionalOneShotEffect.java b/Mage/src/mage/abilities/decorator/ConditionalOneShotEffect.java index 31e698885f..8b0a1aa31a 100644 --- a/Mage/src/mage/abilities/decorator/ConditionalOneShotEffect.java +++ b/Mage/src/mage/abilities/decorator/ConditionalOneShotEffect.java @@ -40,45 +40,45 @@ import mage.game.Game; */ public class ConditionalOneShotEffect extends OneShotEffect { - private OneShotEffect effect; - private OneShotEffect otherwiseEffect; - private Condition condition; + private OneShotEffect effect; + private OneShotEffect otherwiseEffect; + private Condition condition; - public ConditionalOneShotEffect(OneShotEffect effect, Condition condition, String text) { - this(effect, null, condition, text); - } + public ConditionalOneShotEffect(OneShotEffect effect, Condition condition, String text) { + this(effect, null, condition, text); + } - public ConditionalOneShotEffect(OneShotEffect effect, OneShotEffect otherwiseEffect, Condition condition, String text) { - super(effect.getOutcome()); - this.effect = effect; - this.otherwiseEffect = otherwiseEffect; - this.condition = condition; - this.staticText = text; - } + public ConditionalOneShotEffect(OneShotEffect effect, OneShotEffect otherwiseEffect, Condition condition, String text) { + super(effect.getOutcome()); + this.effect = effect; + this.otherwiseEffect = otherwiseEffect; + this.condition = condition; + this.staticText = text; + } - public ConditionalOneShotEffect(ConditionalOneShotEffect effect) { - super(effect); - this.effect = (OneShotEffect) effect.effect.copy(); - if (effect.otherwiseEffect != null) - this.otherwiseEffect = (OneShotEffect) effect.otherwiseEffect.copy(); - this.condition = effect.condition; - } + public ConditionalOneShotEffect(ConditionalOneShotEffect effect) { + super(effect); + this.effect = (OneShotEffect) effect.effect.copy(); + if (effect.otherwiseEffect != null) + this.otherwiseEffect = (OneShotEffect) effect.otherwiseEffect.copy(); + this.condition = effect.condition; + } - @Override - public boolean apply(Game game, Ability source) { - if (condition.apply(game, source)) { - effect.setTargetPointer(this.targetPointer); - return effect.apply(game, source); - } else if (otherwiseEffect != null) { - otherwiseEffect.setTargetPointer(this.targetPointer); - return otherwiseEffect.apply(game, source); - } - return false; - } + @Override + public boolean apply(Game game, Ability source) { + if (condition.apply(game, source)) { + effect.setTargetPointer(this.targetPointer); + return effect.apply(game, source); + } else if (otherwiseEffect != null) { + otherwiseEffect.setTargetPointer(this.targetPointer); + return otherwiseEffect.apply(game, source); + } + return false; + } - @Override - public ConditionalOneShotEffect copy() { - return new ConditionalOneShotEffect(this); - } + @Override + public ConditionalOneShotEffect copy() { + return new ConditionalOneShotEffect(this); + } } diff --git a/Mage/src/mage/abilities/decorator/ConditionalTriggeredAbility.java b/Mage/src/mage/abilities/decorator/ConditionalTriggeredAbility.java index 4ff65a3325..82c79ec5b3 100644 --- a/Mage/src/mage/abilities/decorator/ConditionalTriggeredAbility.java +++ b/Mage/src/mage/abilities/decorator/ConditionalTriggeredAbility.java @@ -20,7 +20,7 @@ public class ConditionalTriggeredAbility extends TriggeredAbilityImpl { - public ApplyCountersEffect() { - super(Duration.EndOfGame, Layer.PTChangingEffects_7, SubLayer.Counters_7d, Outcome.BoostCreature); - } + public ApplyCountersEffect() { + super(Duration.EndOfGame, Layer.PTChangingEffects_7, SubLayer.Counters_7d, Outcome.BoostCreature); + } - public ApplyCountersEffect(ApplyCountersEffect effect) { - super(effect); - } + public ApplyCountersEffect(ApplyCountersEffect effect) { + super(effect); + } - @Override - public boolean apply(Game game, Ability source) { - for (Permanent permanent: game.getBattlefield().getAllActivePermanents(CardType.CREATURE)) { - for (BoostCounter counter: permanent.getCounters().getBoostCounters()) { - permanent.addPower(counter.getPower() * counter.getCount()); - permanent.addToughness(counter.getToughness() * counter.getCount()); - } - } - return true; - } + @Override + public boolean apply(Game game, Ability source) { + for (Permanent permanent: game.getBattlefield().getAllActivePermanents(CardType.CREATURE)) { + for (BoostCounter counter: permanent.getCounters().getBoostCounters()) { + permanent.addPower(counter.getPower() * counter.getCount()); + permanent.addToughness(counter.getToughness() * counter.getCount()); + } + } + return true; + } - @Override - public ApplyCountersEffect copy() { - return new ApplyCountersEffect(this); - } + @Override + public ApplyCountersEffect copy() { + return new ApplyCountersEffect(this); + } } diff --git a/Mage/src/mage/abilities/effects/AsThoughEffect.java b/Mage/src/mage/abilities/effects/AsThoughEffect.java index 5d339d1939..f9e5df8676 100644 --- a/Mage/src/mage/abilities/effects/AsThoughEffect.java +++ b/Mage/src/mage/abilities/effects/AsThoughEffect.java @@ -39,7 +39,7 @@ import mage.game.Game; */ public interface AsThoughEffect> extends ContinuousEffect { - public boolean applies(UUID sourceId, Ability source, Game game); - public AsThoughEffectType getAsThoughEffectType(); + public boolean applies(UUID sourceId, Ability source, Game game); + public AsThoughEffectType getAsThoughEffectType(); } diff --git a/Mage/src/mage/abilities/effects/AsThoughEffectImpl.java b/Mage/src/mage/abilities/effects/AsThoughEffectImpl.java index 251843d4ee..b96fd46215 100644 --- a/Mage/src/mage/abilities/effects/AsThoughEffectImpl.java +++ b/Mage/src/mage/abilities/effects/AsThoughEffectImpl.java @@ -39,22 +39,22 @@ import mage.Constants.Outcome; */ public abstract class AsThoughEffectImpl> extends ContinuousEffectImpl implements AsThoughEffect { - protected AsThoughEffectType type; + protected AsThoughEffectType type; - public AsThoughEffectImpl(AsThoughEffectType type, Duration duration, Outcome outcome) { - super(duration, outcome); - this.type = type; - this.effectType = EffectType.ASTHOUGH; - } + public AsThoughEffectImpl(AsThoughEffectType type, Duration duration, Outcome outcome) { + super(duration, outcome); + this.type = type; + this.effectType = EffectType.ASTHOUGH; + } - public AsThoughEffectImpl(final AsThoughEffectImpl effect) { - super(effect); - this.type = effect.type; - } + public AsThoughEffectImpl(final AsThoughEffectImpl effect) { + super(effect); + this.type = effect.type; + } - @Override - public AsThoughEffectType getAsThoughEffectType() { - return type; - } + @Override + public AsThoughEffectType getAsThoughEffectType() { + return type; + } } diff --git a/Mage/src/mage/abilities/effects/ContinuousEffect.java b/Mage/src/mage/abilities/effects/ContinuousEffect.java index 7200384328..230fd29a03 100644 --- a/Mage/src/mage/abilities/effects/ContinuousEffect.java +++ b/Mage/src/mage/abilities/effects/ContinuousEffect.java @@ -42,16 +42,16 @@ import java.util.Date; */ public interface ContinuousEffect> extends Effect { - public boolean isUsed(); - public Duration getDuration(); - public Date getTimestamp(); - public void setTimestamp(); - public void newId(); - public boolean apply(Layer layer, SubLayer sublayer, Ability source, Game game); - public boolean hasLayer(Layer layer); - public boolean isInactive(Ability source, Game game); - public void init(Ability source, Game game); - public Layer getLayer(); - public SubLayer getSublayer(); + public boolean isUsed(); + public Duration getDuration(); + public Date getTimestamp(); + public void setTimestamp(); + public void newId(); + public boolean apply(Layer layer, SubLayer sublayer, Ability source, Game game); + public boolean hasLayer(Layer layer); + public boolean isInactive(Ability source, Game game); + public void init(Ability source, Game game); + public Layer getLayer(); + public SubLayer getSublayer(); public void overrideRuleText(String text); } diff --git a/Mage/src/mage/abilities/effects/ContinuousEffectImpl.java b/Mage/src/mage/abilities/effects/ContinuousEffectImpl.java index d69a914a34..019e30c496 100644 --- a/Mage/src/mage/abilities/effects/ContinuousEffectImpl.java +++ b/Mage/src/mage/abilities/effects/ContinuousEffectImpl.java @@ -42,115 +42,115 @@ import java.util.*; */ public abstract class ContinuousEffectImpl> extends EffectImpl implements ContinuousEffect { - protected Duration duration; - protected Layer layer; - protected SubLayer sublayer; - protected Date timestamp; - protected boolean used = false; - protected boolean affectedObjectsSet = false; - protected List objects = new ArrayList(); + protected Duration duration; + protected Layer layer; + protected SubLayer sublayer; + protected Date timestamp; + protected boolean used = false; + protected boolean affectedObjectsSet = false; + protected List objects = new ArrayList(); protected Map metadata = new HashMap(); - public ContinuousEffectImpl(Duration duration, Outcome outcome) { - super(outcome); - this.duration = duration; - this.timestamp = new Date(); - this.effectType = EffectType.CONTINUOUS; - } + public ContinuousEffectImpl(Duration duration, Outcome outcome) { + super(outcome); + this.duration = duration; + this.timestamp = new Date(); + this.effectType = EffectType.CONTINUOUS; + } - public ContinuousEffectImpl(Duration duration, Layer layer, SubLayer sublayer, Outcome outcome) { - this(duration, outcome); - this.layer = layer; - this.sublayer = sublayer; - } + public ContinuousEffectImpl(Duration duration, Layer layer, SubLayer sublayer, Outcome outcome) { + this(duration, outcome); + this.layer = layer; + this.sublayer = sublayer; + } - public ContinuousEffectImpl(final ContinuousEffectImpl effect) { - super(effect); - this.duration = effect.duration; - this.layer = effect.layer; - this.sublayer = effect.sublayer; - this.timestamp = new Date(effect.timestamp.getTime()); - this.used = effect.used; - this.affectedObjectsSet = effect.affectedObjectsSet; + public ContinuousEffectImpl(final ContinuousEffectImpl effect) { + super(effect); + this.duration = effect.duration; + this.layer = effect.layer; + this.sublayer = effect.sublayer; + this.timestamp = new Date(effect.timestamp.getTime()); + this.used = effect.used; + this.affectedObjectsSet = effect.affectedObjectsSet; this.objects.addAll(effect.objects); - } + } - @Override - public Duration getDuration() { - return duration; - } + @Override + public Duration getDuration() { + return duration; + } - @Override - public boolean apply(Layer layer, SubLayer sublayer, Ability source, Game game) { - if (this.layer == layer && this.sublayer == sublayer) { - return apply(game, source); - } - return false; - } + @Override + public boolean apply(Layer layer, SubLayer sublayer, Ability source, Game game) { + if (this.layer == layer && this.sublayer == sublayer) { + return apply(game, source); + } + return false; + } - @Override - public Date getTimestamp() { - return timestamp; - } + @Override + public Date getTimestamp() { + return timestamp; + } - @Override - public void setTimestamp() { - this.timestamp = new Date(); - } + @Override + public void setTimestamp() { + this.timestamp = new Date(); + } - @Override - public void newId() { - this.id = UUID.randomUUID(); - } + @Override + public void newId() { + this.id = UUID.randomUUID(); + } - @Override - public boolean hasLayer(Layer layer) { - return this.layer == layer; - } + @Override + public boolean hasLayer(Layer layer) { + return this.layer == layer; + } - @Override - public boolean isUsed() { - return used; - } + @Override + public boolean isUsed() { + return used; + } - @Override - public void init(Ability source, Game game) { - //20100716 - 611.2c - if (source instanceof ActivatedAbility || source instanceof TriggeredAbility) { - if (layer != null) { - switch (layer) { - case CopyEffects_1: - case ControlChangingEffects_2: - case TextChangingEffects_3: - case TypeChangingEffects_4: - case ColorChangingEffects_5: - case AbilityAddingRemovingEffects_6: - case PTChangingEffects_7: - this.affectedObjectsSet = true; - } - } - else { - if (hasLayer(Layer.CopyEffects_1) || hasLayer(Layer.ControlChangingEffects_2) || hasLayer(Layer.TextChangingEffects_3) || - hasLayer(Layer.TypeChangingEffects_4) || hasLayer(Layer.ColorChangingEffects_5) || hasLayer(Layer.AbilityAddingRemovingEffects_6) || - hasLayer(Layer.PTChangingEffects_7)) { - this.affectedObjectsSet = true; - } - } - } - } + @Override + public void init(Ability source, Game game) { + //20100716 - 611.2c + if (source instanceof ActivatedAbility || source instanceof TriggeredAbility) { + if (layer != null) { + switch (layer) { + case CopyEffects_1: + case ControlChangingEffects_2: + case TextChangingEffects_3: + case TypeChangingEffects_4: + case ColorChangingEffects_5: + case AbilityAddingRemovingEffects_6: + case PTChangingEffects_7: + this.affectedObjectsSet = true; + } + } + else { + if (hasLayer(Layer.CopyEffects_1) || hasLayer(Layer.ControlChangingEffects_2) || hasLayer(Layer.TextChangingEffects_3) || + hasLayer(Layer.TypeChangingEffects_4) || hasLayer(Layer.ColorChangingEffects_5) || hasLayer(Layer.AbilityAddingRemovingEffects_6) || + hasLayer(Layer.PTChangingEffects_7)) { + this.affectedObjectsSet = true; + } + } + } + } - @Override - public boolean isInactive(Ability source, Game game) { - return false; - } + @Override + public boolean isInactive(Ability source, Game game) { + return false; + } - public Layer getLayer() { - return layer; - } + public Layer getLayer() { + return layer; + } - public SubLayer getSublayer() { - return sublayer; - } + public SubLayer getSublayer() { + return sublayer; + } @Override public void overrideRuleText(String text) { diff --git a/Mage/src/mage/abilities/effects/ContinuousEffects.java b/Mage/src/mage/abilities/effects/ContinuousEffects.java index 817e446ead..6d56c1bb45 100644 --- a/Mage/src/mage/abilities/effects/ContinuousEffects.java +++ b/Mage/src/mage/abilities/effects/ContinuousEffects.java @@ -49,31 +49,31 @@ import java.util.*; */ public class ContinuousEffects implements Serializable { - //transient Continuous effects - private ContinuousEffectsList layeredEffects = new ContinuousEffectsList(); - private ContinuousEffectsList replacementEffects = new ContinuousEffectsList(); - private ContinuousEffectsList preventionEffects = new ContinuousEffectsList(); - private ContinuousEffectsList requirementEffects = new ContinuousEffectsList(); - private ContinuousEffectsList restrictionEffects = new ContinuousEffectsList(); - private ContinuousEffectsList asThoughEffects = new ContinuousEffectsList(); - private ContinuousEffectsList costModificationEffects = new ContinuousEffectsList(); + //transient Continuous effects + private ContinuousEffectsList layeredEffects = new ContinuousEffectsList(); + private ContinuousEffectsList replacementEffects = new ContinuousEffectsList(); + private ContinuousEffectsList preventionEffects = new ContinuousEffectsList(); + private ContinuousEffectsList requirementEffects = new ContinuousEffectsList(); + private ContinuousEffectsList restrictionEffects = new ContinuousEffectsList(); + private ContinuousEffectsList asThoughEffects = new ContinuousEffectsList(); + private ContinuousEffectsList costModificationEffects = new ContinuousEffectsList(); - private final ApplyCountersEffect applyCounters; - private final PlaneswalkerRedirectionEffect planeswalkerRedirectionEffect; - private final AuraReplacementEffect auraReplacementEffect; + private final ApplyCountersEffect applyCounters; + private final PlaneswalkerRedirectionEffect planeswalkerRedirectionEffect; + private final AuraReplacementEffect auraReplacementEffect; private List previous = new ArrayList(); - public ContinuousEffects() { - applyCounters = new ApplyCountersEffect(); - planeswalkerRedirectionEffect = new PlaneswalkerRedirectionEffect(); - auraReplacementEffect = new AuraReplacementEffect(); - } + public ContinuousEffects() { + applyCounters = new ApplyCountersEffect(); + planeswalkerRedirectionEffect = new PlaneswalkerRedirectionEffect(); + auraReplacementEffect = new AuraReplacementEffect(); + } - public ContinuousEffects(final ContinuousEffects effect) { - this.applyCounters = effect.applyCounters.copy(); - this.planeswalkerRedirectionEffect = effect.planeswalkerRedirectionEffect.copy(); - this.auraReplacementEffect = effect.auraReplacementEffect.copy(); + public ContinuousEffects(final ContinuousEffects effect) { + this.applyCounters = effect.applyCounters.copy(); + this.planeswalkerRedirectionEffect = effect.planeswalkerRedirectionEffect.copy(); + this.auraReplacementEffect = effect.auraReplacementEffect.copy(); layeredEffects = effect.layeredEffects.copy(); replacementEffects = effect.replacementEffects.copy(); preventionEffects = effect.preventionEffects.copy(); @@ -81,22 +81,22 @@ public class ContinuousEffects implements Serializable { restrictionEffects = effect.restrictionEffects.copy(); asThoughEffects = effect.asThoughEffects.copy(); costModificationEffects = effect.costModificationEffects.copy(); - } + } - public ContinuousEffects copy() { - return new ContinuousEffects(this); - } + public ContinuousEffects copy() { + return new ContinuousEffects(this); + } - public List getRequirementEffects() { - return requirementEffects; - } + public List getRequirementEffects() { + return requirementEffects; + } - public List getRestrictionEffects() { - return restrictionEffects; - } + public List getRestrictionEffects() { + return restrictionEffects; + } - public Ability getAbility(UUID effectId) { - Ability ability = layeredEffects.getAbility(effectId); + public Ability getAbility(UUID effectId) { + Ability ability = layeredEffects.getAbility(effectId); if (ability == null) ability = replacementEffects.getAbility(effectId); if (ability == null) @@ -110,31 +110,31 @@ public class ContinuousEffects implements Serializable { if (ability == null) ability = costModificationEffects.getAbility(effectId); return ability; - } + } - public void removeEndOfTurnEffects() { + public void removeEndOfTurnEffects() { layeredEffects.removeEndOfTurnEffects(); replacementEffects.removeEndOfTurnEffects(); - preventionEffects.removeEndOfTurnEffects(); - requirementEffects.removeEndOfTurnEffects(); - restrictionEffects.removeEndOfTurnEffects(); - asThoughEffects.removeEndOfTurnEffects(); - costModificationEffects.removeEndOfTurnEffects(); - } + preventionEffects.removeEndOfTurnEffects(); + requirementEffects.removeEndOfTurnEffects(); + restrictionEffects.removeEndOfTurnEffects(); + asThoughEffects.removeEndOfTurnEffects(); + costModificationEffects.removeEndOfTurnEffects(); + } - public void removeInactiveEffects(Game game) { + public void removeInactiveEffects(Game game) { layeredEffects.removeInactiveEffects(game); replacementEffects.removeInactiveEffects(game); - preventionEffects.removeInactiveEffects(game); - requirementEffects.removeInactiveEffects(game); - restrictionEffects.removeInactiveEffects(game); - asThoughEffects.removeInactiveEffects(game); - costModificationEffects.removeInactiveEffects(game); + preventionEffects.removeInactiveEffects(game); + requirementEffects.removeInactiveEffects(game); + restrictionEffects.removeInactiveEffects(game); + asThoughEffects.removeInactiveEffects(game); + costModificationEffects.removeInactiveEffects(game); - } + } - public List getLayeredEffects(Game game) { - List layerEffects = new ArrayList(); + public List getLayeredEffects(Game game) { + List layerEffects = new ArrayList(); for (ContinuousEffect effect: layeredEffects) { switch (effect.getDuration()) { case WhileOnBattlefield: @@ -151,9 +151,9 @@ public class ContinuousEffects implements Serializable { updateTimestamps(layerEffects); - Collections.sort(layerEffects, new TimestampSorter()); - return layerEffects; - } + Collections.sort(layerEffects, new TimestampSorter()); + return layerEffects; + } /** * Initially effect timestamp is set when game starts in game.loadCard method. @@ -172,53 +172,53 @@ public class ContinuousEffects implements Serializable { previous.addAll(layerEffects); } - private List filterLayeredEffects(List effects, Layer layer) { - List layerEffects = new ArrayList(); - for (ContinuousEffect effect: effects) { - if (effect.hasLayer(layer)) - layerEffects.add(effect); - } - return layerEffects; - } + private List filterLayeredEffects(List effects, Layer layer) { + List layerEffects = new ArrayList(); + for (ContinuousEffect effect: effects) { + if (effect.hasLayer(layer)) + layerEffects.add(effect); + } + return layerEffects; + } - public List getApplicableRequirementEffects(Permanent permanent, Game game) { - List effects = new ArrayList(); - for (RequirementEffect effect: requirementEffects) { + public List getApplicableRequirementEffects(Permanent permanent, Game game) { + List effects = new ArrayList(); + for (RequirementEffect effect: requirementEffects) { Ability ability = requirementEffects.getAbility(effect.getId()); if (!(ability instanceof StaticAbility) || ability.isInUseableZone(game, false)) { if (effect.applies(permanent, ability, game)) effects.add(effect); } - } - return effects; - } + } + return effects; + } - public List getApplicableRestrictionEffects(Permanent permanent, Game game) { - List effects = new ArrayList(); - for (RestrictionEffect effect: restrictionEffects) { + public List getApplicableRestrictionEffects(Permanent permanent, Game game) { + List effects = new ArrayList(); + for (RestrictionEffect effect: restrictionEffects) { Ability ability = restrictionEffects.getAbility(effect.getId()); if (!(ability instanceof StaticAbility) || ability.isInUseableZone(game, false)) { if (effect.applies(permanent, ability, game)) effects.add(effect); } - } - return effects; - } + } + return effects; + } - /** - * - * @param event - * @param game - * @return a list of all {@link ReplacementEffect} that apply to the current event - */ - private List getApplicableReplacementEffects(GameEvent event, Game game) { - List replaceEffects = new ArrayList(); - if (planeswalkerRedirectionEffect.applies(event, null, game)) - replaceEffects.add(planeswalkerRedirectionEffect); - if(auraReplacementEffect.applies(event, null, game)) - replaceEffects.add(auraReplacementEffect); - //get all applicable transient Replacement effects - for (ReplacementEffect effect: replacementEffects) { + /** + * + * @param event + * @param game + * @return a list of all {@link ReplacementEffect} that apply to the current event + */ + private List getApplicableReplacementEffects(GameEvent event, Game game) { + List replaceEffects = new ArrayList(); + if (planeswalkerRedirectionEffect.applies(event, null, game)) + replaceEffects.add(planeswalkerRedirectionEffect); + if(auraReplacementEffect.applies(event, null, game)) + replaceEffects.add(auraReplacementEffect); + //get all applicable transient Replacement effects + for (ReplacementEffect effect: replacementEffects) { Ability ability = replacementEffects.getAbility(effect.getId()); if (!(ability instanceof StaticAbility) || ability.isInUseableZone(game, false)) { if (effect.getDuration() != Duration.OneUse || !effect.isUsed()) { @@ -227,8 +227,8 @@ public class ContinuousEffects implements Serializable { } } } - } - for (PreventionEffect effect: preventionEffects) { + } + for (PreventionEffect effect: preventionEffects) { Ability ability = preventionEffects.getAbility(effect.getId()); if (!(ability instanceof StaticAbility) || ability.isInUseableZone(game, false)) { if (effect.getDuration() != Duration.OneUse || !effect.isUsed()) { @@ -237,9 +237,9 @@ public class ContinuousEffects implements Serializable { } } } - } - return replaceEffects; - } + } + return replaceEffects; + } /** * Filters out cost modification effects that are not active. @@ -262,40 +262,40 @@ public class ContinuousEffects implements Serializable { return costEffects; } - public boolean asThough(UUID objectId, AsThoughEffectType type, Game game) { - for (AsThoughEffect entry: asThoughEffects) { - AsThoughEffect effect = entry; - if (effect.getAsThoughEffectType() == type) { - if (effect.getDuration() != Duration.OneUse || !effect.isUsed()) { - if (effect.applies(objectId, asThoughEffects.getAbility(entry.getId()), game)) { - return true; - } - } - } - } - return false; - } + public boolean asThough(UUID objectId, AsThoughEffectType type, Game game) { + for (AsThoughEffect entry: asThoughEffects) { + AsThoughEffect effect = entry; + if (effect.getAsThoughEffectType() == type) { + if (effect.getDuration() != Duration.OneUse || !effect.isUsed()) { + if (effect.applies(objectId, asThoughEffects.getAbility(entry.getId()), game)) { + return true; + } + } + } + } + return false; + } - /** - * Inspects all {@link Permanent permanent's} {@link Ability abilities} on the battlefield - * for {@link CostModificationEffect cost modification effects} and applies them if necessary. - * - * @param abilityToModify - * @param game - * @return - */ - public void costModification ( Ability abilityToModify, Game game ) { + /** + * Inspects all {@link Permanent permanent's} {@link Ability abilities} on the battlefield + * for {@link CostModificationEffect cost modification effects} and applies them if necessary. + * + * @param abilityToModify + * @param game + * @return + */ + public void costModification ( Ability abilityToModify, Game game ) { List costEffects = getApplicableCostModificationEffects(game); for ( CostModificationEffect effect : costEffects) { - if ( effect.applies(abilityToModify, costModificationEffects.getAbility(effect.getId()), game) ) { - effect.apply(game, costModificationEffects.getAbility(effect.getId()), abilityToModify); - } - } - } + if ( effect.applies(abilityToModify, costModificationEffects.getAbility(effect.getId()), game) ) { + effect.apply(game, costModificationEffects.getAbility(effect.getId()), abilityToModify); + } + } + } - public boolean replaceEvent(GameEvent event, Game game) { - boolean caught = false; + public boolean replaceEvent(GameEvent event, Game game) { + boolean caught = false; List consumed = new ArrayList(); do { List rEffects = getApplicableReplacementEffects(event, game); @@ -322,91 +322,91 @@ public class ContinuousEffects implements Serializable { consumed.add(rEffect.getId()); game.applyEffects(); } while (true); - return caught; - } + return caught; + } - //20091005 - 613 - public void apply(Game game) { - removeInactiveEffects(game); - List layerEffects = getLayeredEffects(game); - List layer = filterLayeredEffects(layerEffects, Layer.CopyEffects_1); - for (ContinuousEffect effect: layer) { - effect.apply(Layer.CopyEffects_1, SubLayer.NA, layeredEffects.getAbility(effect.getId()), game); - } - layer = filterLayeredEffects(layerEffects, Layer.ControlChangingEffects_2); - for (ContinuousEffect effect: layer) { - effect.apply(Layer.ControlChangingEffects_2, SubLayer.NA, layeredEffects.getAbility(effect.getId()), game); - } - layer = filterLayeredEffects(layerEffects, Layer.TextChangingEffects_3); - for (ContinuousEffect effect: layer) { - effect.apply(Layer.TextChangingEffects_3, SubLayer.NA, layeredEffects.getAbility(effect.getId()), game); - } - layer = filterLayeredEffects(layerEffects, Layer.TypeChangingEffects_4); - for (ContinuousEffect effect: layer) { - effect.apply(Layer.TypeChangingEffects_4, SubLayer.NA, layeredEffects.getAbility(effect.getId()), game); - } - layer = filterLayeredEffects(layerEffects, Layer.ColorChangingEffects_5); - for (ContinuousEffect effect: layer) { - effect.apply(Layer.ColorChangingEffects_5, SubLayer.NA, layeredEffects.getAbility(effect.getId()), game); - } - layer = filterLayeredEffects(layerEffects, Layer.AbilityAddingRemovingEffects_6); - for (ContinuousEffect effect: layer) { - effect.apply(Layer.AbilityAddingRemovingEffects_6, SubLayer.NA, layeredEffects.getAbility(effect.getId()), game); - } - layerEffects = getLayeredEffects(game); - layer = filterLayeredEffects(layerEffects, Layer.PTChangingEffects_7); - for (ContinuousEffect effect: layer) { - effect.apply(Layer.PTChangingEffects_7, SubLayer.SetPT_7b, layeredEffects.getAbility(effect.getId()), game); - } - for (ContinuousEffect effect: layer) { - effect.apply(Layer.PTChangingEffects_7, SubLayer.ModifyPT_7c, layeredEffects.getAbility(effect.getId()), game); - } - applyCounters.apply(Layer.PTChangingEffects_7, SubLayer.Counters_7d, null, game); - for (ContinuousEffect effect: layer) { - effect.apply(Layer.PTChangingEffects_7, SubLayer.SwitchPT_e, layeredEffects.getAbility(effect.getId()), game); - } - layer = filterLayeredEffects(layerEffects, Layer.PlayerEffects); - for (ContinuousEffect effect: layer) { - effect.apply(Layer.PlayerEffects, SubLayer.NA, layeredEffects.getAbility(effect.getId()), game); - } - layer = filterLayeredEffects(layerEffects, Layer.RulesEffects); - for (ContinuousEffect effect: layer) { - effect.apply(Layer.RulesEffects, SubLayer.NA, layeredEffects.getAbility(effect.getId()), game); - } - } + //20091005 - 613 + public void apply(Game game) { + removeInactiveEffects(game); + List layerEffects = getLayeredEffects(game); + List layer = filterLayeredEffects(layerEffects, Layer.CopyEffects_1); + for (ContinuousEffect effect: layer) { + effect.apply(Layer.CopyEffects_1, SubLayer.NA, layeredEffects.getAbility(effect.getId()), game); + } + layer = filterLayeredEffects(layerEffects, Layer.ControlChangingEffects_2); + for (ContinuousEffect effect: layer) { + effect.apply(Layer.ControlChangingEffects_2, SubLayer.NA, layeredEffects.getAbility(effect.getId()), game); + } + layer = filterLayeredEffects(layerEffects, Layer.TextChangingEffects_3); + for (ContinuousEffect effect: layer) { + effect.apply(Layer.TextChangingEffects_3, SubLayer.NA, layeredEffects.getAbility(effect.getId()), game); + } + layer = filterLayeredEffects(layerEffects, Layer.TypeChangingEffects_4); + for (ContinuousEffect effect: layer) { + effect.apply(Layer.TypeChangingEffects_4, SubLayer.NA, layeredEffects.getAbility(effect.getId()), game); + } + layer = filterLayeredEffects(layerEffects, Layer.ColorChangingEffects_5); + for (ContinuousEffect effect: layer) { + effect.apply(Layer.ColorChangingEffects_5, SubLayer.NA, layeredEffects.getAbility(effect.getId()), game); + } + layer = filterLayeredEffects(layerEffects, Layer.AbilityAddingRemovingEffects_6); + for (ContinuousEffect effect: layer) { + effect.apply(Layer.AbilityAddingRemovingEffects_6, SubLayer.NA, layeredEffects.getAbility(effect.getId()), game); + } + layerEffects = getLayeredEffects(game); + layer = filterLayeredEffects(layerEffects, Layer.PTChangingEffects_7); + for (ContinuousEffect effect: layer) { + effect.apply(Layer.PTChangingEffects_7, SubLayer.SetPT_7b, layeredEffects.getAbility(effect.getId()), game); + } + for (ContinuousEffect effect: layer) { + effect.apply(Layer.PTChangingEffects_7, SubLayer.ModifyPT_7c, layeredEffects.getAbility(effect.getId()), game); + } + applyCounters.apply(Layer.PTChangingEffects_7, SubLayer.Counters_7d, null, game); + for (ContinuousEffect effect: layer) { + effect.apply(Layer.PTChangingEffects_7, SubLayer.SwitchPT_e, layeredEffects.getAbility(effect.getId()), game); + } + layer = filterLayeredEffects(layerEffects, Layer.PlayerEffects); + for (ContinuousEffect effect: layer) { + effect.apply(Layer.PlayerEffects, SubLayer.NA, layeredEffects.getAbility(effect.getId()), game); + } + layer = filterLayeredEffects(layerEffects, Layer.RulesEffects); + for (ContinuousEffect effect: layer) { + effect.apply(Layer.RulesEffects, SubLayer.NA, layeredEffects.getAbility(effect.getId()), game); + } + } - public void addEffect(ContinuousEffect effect, Ability source) { - switch (effect.getEffectType()) { - case REPLACEMENT: - ReplacementEffect newReplacementEffect = (ReplacementEffect)effect; - replacementEffects.addEffect(newReplacementEffect, source); - break; - case PREVENTION: - PreventionEffect newPreventionEffect = (PreventionEffect)effect; - preventionEffects.addEffect(newPreventionEffect, source); - break; - case RESTRICTION: - RestrictionEffect newRestrictionEffect = (RestrictionEffect)effect; - restrictionEffects.addEffect(newRestrictionEffect, source); - break; - case REQUIREMENT: - RequirementEffect newRequirementEffect = (RequirementEffect)effect; - requirementEffects.addEffect(newRequirementEffect, source); - break; - case ASTHOUGH: - AsThoughEffect newAsThoughEffect = (AsThoughEffect)effect; - asThoughEffects.addEffect(newAsThoughEffect, source); - break; - case COSTMODIFICATION: - CostModificationEffect newCostModificationEffect = (CostModificationEffect)effect; - costModificationEffects.addEffect(newCostModificationEffect, source); - break; - default: - ContinuousEffect newEffect = (ContinuousEffect)effect; - layeredEffects.addEffect(newEffect, source); - break; - } - } + public void addEffect(ContinuousEffect effect, Ability source) { + switch (effect.getEffectType()) { + case REPLACEMENT: + ReplacementEffect newReplacementEffect = (ReplacementEffect)effect; + replacementEffects.addEffect(newReplacementEffect, source); + break; + case PREVENTION: + PreventionEffect newPreventionEffect = (PreventionEffect)effect; + preventionEffects.addEffect(newPreventionEffect, source); + break; + case RESTRICTION: + RestrictionEffect newRestrictionEffect = (RestrictionEffect)effect; + restrictionEffects.addEffect(newRestrictionEffect, source); + break; + case REQUIREMENT: + RequirementEffect newRequirementEffect = (RequirementEffect)effect; + requirementEffects.addEffect(newRequirementEffect, source); + break; + case ASTHOUGH: + AsThoughEffect newAsThoughEffect = (AsThoughEffect)effect; + asThoughEffects.addEffect(newAsThoughEffect, source); + break; + case COSTMODIFICATION: + CostModificationEffect newCostModificationEffect = (CostModificationEffect)effect; + costModificationEffects.addEffect(newCostModificationEffect, source); + break; + default: + ContinuousEffect newEffect = (ContinuousEffect)effect; + layeredEffects.addEffect(newEffect, source); + break; + } + } public void clear() { layeredEffects.clear(); @@ -420,8 +420,8 @@ public class ContinuousEffects implements Serializable { } class TimestampSorter implements Comparator { - @Override - public int compare(ContinuousEffect one, ContinuousEffect two) { - return one.getTimestamp().compareTo(two.getTimestamp()); - } + @Override + public int compare(ContinuousEffect one, ContinuousEffect two) { + return one.getTimestamp().compareTo(two.getTimestamp()); + } } diff --git a/Mage/src/mage/abilities/effects/ContinuousEffectsList.java b/Mage/src/mage/abilities/effects/ContinuousEffectsList.java index da663d824f..4f77a4fad2 100644 --- a/Mage/src/mage/abilities/effects/ContinuousEffectsList.java +++ b/Mage/src/mage/abilities/effects/ContinuousEffectsList.java @@ -41,56 +41,56 @@ public class ContinuousEffectsList extends ArrayList private final Map abilityMap = new HashMap(); public ContinuousEffectsList() { } - - public ContinuousEffectsList(final ContinuousEffectsList effects) { + + public ContinuousEffectsList(final ContinuousEffectsList effects) { this.ensureCapacity(effects.size()); - for (ContinuousEffect cost: effects) { - this.add((T)cost.copy()); - } - for (Map.Entry entry: effects.abilityMap.entrySet()) { - abilityMap.put(entry.getKey(), entry.getValue().copy()); - } - } - + for (ContinuousEffect cost: effects) { + this.add((T)cost.copy()); + } + for (Map.Entry entry: effects.abilityMap.entrySet()) { + abilityMap.put(entry.getKey(), entry.getValue().copy()); + } + } + public ContinuousEffectsList copy() { return new ContinuousEffectsList(this); } - - public void removeEndOfTurnEffects() { - for (Iterator i = this.iterator(); i.hasNext();) { - T entry = i.next(); - if (entry.getDuration() == Constants.Duration.EndOfTurn) { - i.remove(); - abilityMap.remove(entry.getId()); - } - } - } - - public void removeInactiveEffects(Game game) { - for (Iterator i = this.iterator(); i.hasNext();) { + + public void removeEndOfTurnEffects() { + for (Iterator i = this.iterator(); i.hasNext();) { T entry = i.next(); - if (isInactive(entry, game)) { - i.remove(); + if (entry.getDuration() == Constants.Duration.EndOfTurn) { + i.remove(); abilityMap.remove(entry.getId()); } - } + } } - + + public void removeInactiveEffects(Game game) { + for (Iterator i = this.iterator(); i.hasNext();) { + T entry = i.next(); + if (isInactive(entry, game)) { + i.remove(); + abilityMap.remove(entry.getId()); + } + } + } + private boolean isInactive(T effect, Game game) { Ability ability = abilityMap.get(effect.getId()); if (ability == null) return true; - switch(effect.getDuration()) { - case WhileOnBattlefield: + switch(effect.getDuration()) { + case WhileOnBattlefield: if (game.getObject(ability.getSourceId()) == null) return (true); - case OneUse: - return effect.isUsed(); - case Custom: - return effect.isInactive(abilityMap.get(effect.getId()), game); - } - return false; - } + case OneUse: + return effect.isUsed(); + case Custom: + return effect.isInactive(abilityMap.get(effect.getId()), game); + } + return false; + } public void addEffect(T effect, Ability source) { if (abilityMap.containsKey(effect.getId())) @@ -102,7 +102,7 @@ public class ContinuousEffectsList extends ArrayList public Ability getAbility(UUID effectId) { return abilityMap.get(effectId); } - + @Override public void clear() { super.clear(); diff --git a/Mage/src/mage/abilities/effects/CostModificationEffect.java b/Mage/src/mage/abilities/effects/CostModificationEffect.java index 97516182f6..275f9eaf6c 100644 --- a/Mage/src/mage/abilities/effects/CostModificationEffect.java +++ b/Mage/src/mage/abilities/effects/CostModificationEffect.java @@ -43,25 +43,25 @@ import mage.game.Game; */ //20101001 - 601.2e/613.10 public interface CostModificationEffect> extends ContinuousEffect { - /** - * Called by the {@link ContinuousEffects#costModification(java.util.UUID, mage.abilities.Ability, mage.game.Game) ContinuousEffects.costModification} - * method. - * - * @param game The game for which this effect should be applied. - * @param source The source ability of this effect. - * @param abilityToModify The {@link mage.abilities.SpellAbility} or {@link Ability} which should be modified. - * @return - */ - public boolean apply ( Game game, Ability source, Ability abilityToModify ); + /** + * Called by the {@link ContinuousEffects#costModification(java.util.UUID, mage.abilities.Ability, mage.game.Game) ContinuousEffects.costModification} + * method. + * + * @param game The game for which this effect should be applied. + * @param source The source ability of this effect. + * @param abilityToModify The {@link mage.abilities.SpellAbility} or {@link Ability} which should be modified. + * @return + */ + public boolean apply ( Game game, Ability source, Ability abilityToModify ); - /** - * Called by the {@link ContinuousEffects#costModification(mage.abilities.Ability, mage.game.Game) ContinuousEffects.costModification} - * method. - * - * @param abilityToModify The ability to possibly modify. - * @param source The source ability of this effect. - * @param game The game for which this effect shoul dbe applied. - * @return - */ - public boolean applies(Ability abilityToModify, Ability source, Game game); + /** + * Called by the {@link ContinuousEffects#costModification(mage.abilities.Ability, mage.game.Game) ContinuousEffects.costModification} + * method. + * + * @param abilityToModify The ability to possibly modify. + * @param source The source ability of this effect. + * @param game The game for which this effect shoul dbe applied. + * @return + */ + public boolean applies(Ability abilityToModify, Ability source, Game game); } diff --git a/Mage/src/mage/abilities/effects/CostModificationEffectImpl.java b/Mage/src/mage/abilities/effects/CostModificationEffectImpl.java index 0757173931..2b97dbf3b1 100644 --- a/Mage/src/mage/abilities/effects/CostModificationEffectImpl.java +++ b/Mage/src/mage/abilities/effects/CostModificationEffectImpl.java @@ -42,25 +42,25 @@ import mage.game.Game; */ public abstract class CostModificationEffectImpl> extends ContinuousEffectImpl implements CostModificationEffect { - public CostModificationEffectImpl ( Duration duration, Outcome outcome ) { - super(duration, outcome); - this.effectType = EffectType.COSTMODIFICATION; - } + public CostModificationEffectImpl ( Duration duration, Outcome outcome ) { + super(duration, outcome); + this.effectType = EffectType.COSTMODIFICATION; + } - public CostModificationEffectImpl(final CostModificationEffectImpl effect) { - super(effect); - this.effectType = effect.effectType; - } + public CostModificationEffectImpl(final CostModificationEffectImpl effect) { + super(effect); + this.effectType = effect.effectType; + } - /** - * Overridden and 'no-op' implementation put in place. - * - * @see #apply(mage.game.Game, mage.abilities.Ability, mage.abilities.Ability) - * - * @param game - * @param source - * @return - */ - @Override - public final boolean apply ( Game game, Ability source ) { return false; } + /** + * Overridden and 'no-op' implementation put in place. + * + * @see #apply(mage.game.Game, mage.abilities.Ability, mage.abilities.Ability) + * + * @param game + * @param source + * @return + */ + @Override + public final boolean apply ( Game game, Ability source ) { return false; } } diff --git a/Mage/src/mage/abilities/effects/Effect.java b/Mage/src/mage/abilities/effects/Effect.java index ea0cc70c7c..1725376b26 100644 --- a/Mage/src/mage/abilities/effects/Effect.java +++ b/Mage/src/mage/abilities/effects/Effect.java @@ -43,17 +43,17 @@ import mage.target.targetpointer.TargetPointer; */ public interface Effect> extends Serializable { - public UUID getId(); - public void newId(); - public String getText(Mode mode); - public boolean apply(Game game, Ability source); - public Outcome getOutcome(); - public EffectType getEffectType(); + public UUID getId(); + public void newId(); + public String getText(Mode mode); + public boolean apply(Game game, Ability source); + public Outcome getOutcome(); + public EffectType getEffectType(); public void setTargetPointer(TargetPointer targetPointer); - public TargetPointer getTargetPointer(); - public void setValue(String key, Object value); - public Object getValue(String key); + public TargetPointer getTargetPointer(); + public void setValue(String key, Object value); + public Object getValue(String key); - public T copy(); + public T copy(); } diff --git a/Mage/src/mage/abilities/effects/EffectImpl.java b/Mage/src/mage/abilities/effects/EffectImpl.java index a7cba8809a..b2137bc4ac 100644 --- a/Mage/src/mage/abilities/effects/EffectImpl.java +++ b/Mage/src/mage/abilities/effects/EffectImpl.java @@ -44,85 +44,85 @@ import java.util.UUID; */ public abstract class EffectImpl> implements Effect { - protected UUID id; - protected final Outcome outcome; - protected EffectType effectType; + protected UUID id; + protected final Outcome outcome; + protected EffectType effectType; protected TargetPointer targetPointer = FirstTargetPointer.getInstance(); protected String staticText = ""; - protected Map values; + protected Map values; - public EffectImpl(Outcome outcome) { - this.id = UUID.randomUUID(); - this.outcome = outcome; - } + public EffectImpl(Outcome outcome) { + this.id = UUID.randomUUID(); + this.outcome = outcome; + } - public EffectImpl(final EffectImpl effect) { - this.id = effect.id; - this.outcome = effect.outcome; - this.effectType = effect.effectType; + public EffectImpl(final EffectImpl effect) { + this.id = effect.id; + this.outcome = effect.outcome; + this.effectType = effect.effectType; this.staticText = effect.staticText; this.targetPointer = effect.targetPointer.copy(); - if (effect.values != null) { - values = new HashMap(); - Map map = effect.values; - for (Map.Entry entry : map.entrySet()) { - values.put(entry.getKey(), entry.getValue()); - } - } - } + if (effect.values != null) { + values = new HashMap(); + Map map = effect.values; + for (Map.Entry entry : map.entrySet()) { + values.put(entry.getKey(), entry.getValue()); + } + } + } - @Override - public UUID getId() { - return id; - } + @Override + public UUID getId() { + return id; + } - @Override - public String getText(Mode mode) { + @Override + public String getText(Mode mode) { return staticText; - } + } - @Override - public Outcome getOutcome() { - return outcome; - } + @Override + public Outcome getOutcome() { + return outcome; + } - @Override - public EffectType getEffectType() { - return effectType; - } + @Override + public EffectType getEffectType() { + return effectType; + } @Override public void setTargetPointer(TargetPointer targetPointer) { this.targetPointer = targetPointer; } - @Override - public TargetPointer getTargetPointer() { - return this.targetPointer; - } + @Override + public TargetPointer getTargetPointer() { + return this.targetPointer; + } - @Override - public void newId() { - this.id = UUID.randomUUID(); - } + @Override + public void newId() { + this.id = UUID.randomUUID(); + } - @Override - public void setValue(String key, Object value) { - if (values == null) { - synchronized (this) { - if (values == null) { - values = new HashMap(); - } - } - } - values.put(key, value); - } + @Override + public void setValue(String key, Object value) { + if (values == null) { + synchronized (this) { + if (values == null) { + values = new HashMap(); + } + } + } + values.put(key, value); + } - @Override - public Object getValue(String key) { - if (values == null) { // no value was set - return null; - } - return values.get(key); - } + @Override + public Object getValue(String key) { + if (values == null) { // no value was set + return null; + } + return values.get(key); + } } diff --git a/Mage/src/mage/abilities/effects/Effects.java b/Mage/src/mage/abilities/effects/Effects.java index 98a39395e5..c2d88af6ca 100644 --- a/Mage/src/mage/abilities/effects/Effects.java +++ b/Mage/src/mage/abilities/effects/Effects.java @@ -42,59 +42,59 @@ import java.util.Set; */ public class Effects extends ArrayList { - public Effects() {} - - public Effects(final Effects effects) { - for (Effect effect: effects) { - this.add(effect.copy()); - } - } + public Effects() {} - public Effects copy() { - return new Effects(this); - } + public Effects(final Effects effects) { + for (Effect effect: effects) { + this.add(effect.copy()); + } + } - public String getText(Mode mode) { - StringBuilder sbText = new StringBuilder(); - for (Effect effect: this) { + public Effects copy() { + return new Effects(this); + } + + public String getText(Mode mode) { + StringBuilder sbText = new StringBuilder(); + for (Effect effect: this) { String rule = effect.getText(mode); if (rule != null) { - sbText.append(effect.getText(mode)).append(". "); + sbText.append(effect.getText(mode)).append(". "); } - } - return sbText.toString(); - } + } + return sbText.toString(); + } - public boolean hasOutcome(Outcome outcome) { - for (Effect effect: this) { - if (effect.getOutcome() == outcome) - return true; - } - return false; - } + public boolean hasOutcome(Outcome outcome) { + for (Effect effect: this) { + if (effect.getOutcome() == outcome) + return true; + } + return false; + } - public List getOutcomes() { - Set outcomes = new HashSet(); - for (Effect effect: this) { - outcomes.add(effect.getOutcome()); - } - return new ArrayList(outcomes); - } + public List getOutcomes() { + Set outcomes = new HashSet(); + for (Effect effect: this) { + outcomes.add(effect.getOutcome()); + } + return new ArrayList(outcomes); + } - public int getOutcomeTotal() { - int total = 0; - for (Effect effect: this) { - if (effect.getOutcome().isGood()) - total++; - else - total--; - } - return total; - } + public int getOutcomeTotal() { + int total = 0; + for (Effect effect: this) { + if (effect.getOutcome().isGood()) + total++; + else + total--; + } + return total; + } - public void newId() { - for (Effect effect: this) { - effect.newId(); - } - } + public void newId() { + for (Effect effect: this) { + effect.newId(); + } + } } diff --git a/Mage/src/mage/abilities/effects/EntersBattlefieldEffect.java b/Mage/src/mage/abilities/effects/EntersBattlefieldEffect.java index 5029d177e4..4bfe46e945 100644 --- a/Mage/src/mage/abilities/effects/EntersBattlefieldEffect.java +++ b/Mage/src/mage/abilities/effects/EntersBattlefieldEffect.java @@ -42,80 +42,80 @@ import mage.game.stack.Spell; */ public class EntersBattlefieldEffect extends ReplacementEffectImpl { - protected Effects baseEffects = new Effects(); - protected String text; + protected Effects baseEffects = new Effects(); + protected String text; public static final String SOURCE_CAST_SPELL_ABILITY = "sourceCastSpellAbility"; - public EntersBattlefieldEffect(Effect baseEffect) { - this(baseEffect, ""); - } + public EntersBattlefieldEffect(Effect baseEffect) { + this(baseEffect, ""); + } - public EntersBattlefieldEffect(Effect baseEffect, String text) { - super(Duration.OneUse, baseEffect.getOutcome()); - this.baseEffects.add(baseEffect); - this.text = text; - } + public EntersBattlefieldEffect(Effect baseEffect, String text) { + super(Duration.OneUse, baseEffect.getOutcome()); + this.baseEffects.add(baseEffect); + this.text = text; + } - public EntersBattlefieldEffect(EntersBattlefieldEffect effect) { - super(effect); - this.baseEffects = effect.baseEffects.copy(); - this.text = effect.text; - } + public EntersBattlefieldEffect(EntersBattlefieldEffect effect) { + super(effect); + this.baseEffects = effect.baseEffects.copy(); + this.text = effect.text; + } public void addEffect(Effect effect) { baseEffects.add(effect); } - @Override - public boolean applies(GameEvent event, Ability source, Game game) { - if (event.getType() == EventType.ENTERS_THE_BATTLEFIELD && event.getTargetId().equals(source.getSourceId())) { - return true; - } - return false; - } + @Override + public boolean applies(GameEvent event, Ability source, Game game) { + if (event.getType() == EventType.ENTERS_THE_BATTLEFIELD && event.getTargetId().equals(source.getSourceId())) { + return true; + } + return false; + } - @Override - public boolean apply(Game game, Ability source) { - return false; - } + @Override + public boolean apply(Game game, Ability source) { + return false; + } - @Override - public boolean replaceEvent(GameEvent event, Ability source, Game game) { - Spell spell = game.getStack().getSpell(event.getSourceId()); - for (Effect effect: baseEffects) { - if (source.activate(game, false)) { - if (effect instanceof ContinuousEffect) { - game.addEffect((ContinuousEffect) effect, source); - } - else { + @Override + public boolean replaceEvent(GameEvent event, Ability source, Game game) { + Spell spell = game.getStack().getSpell(event.getSourceId()); + for (Effect effect: baseEffects) { + if (source.activate(game, false)) { + if (effect instanceof ContinuousEffect) { + game.addEffect((ContinuousEffect) effect, source); + } + else { // noxx: commented it out because of resulting in a bug // with CopyEffect (PhantasmalImageTest.java) - /*if (spell != null) - effect.apply(game, spell.getSpellAbility()); - else - effect.apply(game, source);*/ + /*if (spell != null) + effect.apply(game, spell.getSpellAbility()); + else + effect.apply(game, source);*/ if (spell != null) { effect.setValue(SOURCE_CAST_SPELL_ABILITY, spell.getSpellAbility()); } effect.apply(game, source); - } - } - } - return false; - } + } + } + } + return false; + } - @Override - public String getText(Mode mode) { - if (text == null || text.length() == 0) - return "{this} enters the battlefield " + baseEffects.getText(mode); - else - return text; - } + @Override + public String getText(Mode mode) { + if (text == null || text.length() == 0) + return "{this} enters the battlefield " + baseEffects.getText(mode); + else + return text; + } - @Override - public EntersBattlefieldEffect copy() { - return new EntersBattlefieldEffect(this); - } + @Override + public EntersBattlefieldEffect copy() { + return new EntersBattlefieldEffect(this); + } } diff --git a/Mage/src/mage/abilities/effects/OneShotEffect.java b/Mage/src/mage/abilities/effects/OneShotEffect.java index 608bd7c0b8..d4c8b62702 100644 --- a/Mage/src/mage/abilities/effects/OneShotEffect.java +++ b/Mage/src/mage/abilities/effects/OneShotEffect.java @@ -37,13 +37,13 @@ import mage.Constants.Outcome; */ public abstract class OneShotEffect> extends EffectImpl { - public OneShotEffect(Outcome outcome) { - super(outcome); - this.effectType = EffectType.ONESHOT; - } + public OneShotEffect(Outcome outcome) { + super(outcome); + this.effectType = EffectType.ONESHOT; + } - public OneShotEffect(final OneShotEffect effect) { - super(effect); - } + public OneShotEffect(final OneShotEffect effect) { + super(effect); + } } diff --git a/Mage/src/mage/abilities/effects/PlaneswalkerRedirectionEffect.java b/Mage/src/mage/abilities/effects/PlaneswalkerRedirectionEffect.java index 727c330cd3..c61c360d37 100644 --- a/Mage/src/mage/abilities/effects/PlaneswalkerRedirectionEffect.java +++ b/Mage/src/mage/abilities/effects/PlaneswalkerRedirectionEffect.java @@ -49,54 +49,54 @@ import java.util.UUID; */ public class PlaneswalkerRedirectionEffect extends RedirectionEffect { - private static FilterPlaneswalkerPermanent filter = new FilterPlaneswalkerPermanent(); + private static FilterPlaneswalkerPermanent filter = new FilterPlaneswalkerPermanent(); - public PlaneswalkerRedirectionEffect() { - super(Duration.EndOfGame); - } + public PlaneswalkerRedirectionEffect() { + super(Duration.EndOfGame); + } - public PlaneswalkerRedirectionEffect(final PlaneswalkerRedirectionEffect effect) { - super(effect); - } + public PlaneswalkerRedirectionEffect(final PlaneswalkerRedirectionEffect effect) { + super(effect); + } - @Override - public PlaneswalkerRedirectionEffect copy() { - return new PlaneswalkerRedirectionEffect(this); - } + @Override + public PlaneswalkerRedirectionEffect copy() { + return new PlaneswalkerRedirectionEffect(this); + } - @Override - public boolean applies(GameEvent event, Ability source, Game game) { - if (event.getType() == EventType.DAMAGE_PLAYER) { - DamageEvent damageEvent = (DamageEvent)event; - UUID playerId = getSourceControllerId(event.getSourceId(), game); - if (!damageEvent.isCombatDamage() && game.getOpponents(event.getTargetId()).contains(playerId)) { - Player target = game.getPlayer(event.getTargetId()); - Player player = game.getPlayer(playerId); - if (target != null && player != null) { - int numPlaneswalkers = game.getBattlefield().countAll(filter, target.getId(), game); - if (numPlaneswalkers > 0 && player.chooseUse(outcome, "Redirect damage to planeswalker?", game)) { - redirectTarget = new TargetPermanent(filter); - if (numPlaneswalkers == 1) { - redirectTarget.add(game.getBattlefield().getAllActivePermanents(filter, target.getId(), game).get(0).getId(), game); - } - else { - player.choose(Outcome.Damage, redirectTarget, null, game); - } - return true; - } - } - } - } - return false; - } + @Override + public boolean applies(GameEvent event, Ability source, Game game) { + if (event.getType() == EventType.DAMAGE_PLAYER) { + DamageEvent damageEvent = (DamageEvent)event; + UUID playerId = getSourceControllerId(event.getSourceId(), game); + if (!damageEvent.isCombatDamage() && game.getOpponents(event.getTargetId()).contains(playerId)) { + Player target = game.getPlayer(event.getTargetId()); + Player player = game.getPlayer(playerId); + if (target != null && player != null) { + int numPlaneswalkers = game.getBattlefield().countAll(filter, target.getId(), game); + if (numPlaneswalkers > 0 && player.chooseUse(outcome, "Redirect damage to planeswalker?", game)) { + redirectTarget = new TargetPermanent(filter); + if (numPlaneswalkers == 1) { + redirectTarget.add(game.getBattlefield().getAllActivePermanents(filter, target.getId(), game).get(0).getId(), game); + } + else { + player.choose(Outcome.Damage, redirectTarget, null, game); + } + return true; + } + } + } + } + return false; + } - private UUID getSourceControllerId(UUID sourceId, Game game) { - StackObject source = game.getStack().getStackObject(sourceId); - if (source != null) - return source.getControllerId(); - Permanent permanent = game.getBattlefield().getPermanent(sourceId); - if (permanent != null) - return permanent.getControllerId(); - return null; - } + private UUID getSourceControllerId(UUID sourceId, Game game) { + StackObject source = game.getStack().getStackObject(sourceId); + if (source != null) + return source.getControllerId(); + Permanent permanent = game.getBattlefield().getPermanent(sourceId); + if (permanent != null) + return permanent.getControllerId(); + return null; + } } diff --git a/Mage/src/mage/abilities/effects/PostResolveEffect.java b/Mage/src/mage/abilities/effects/PostResolveEffect.java index 5f16a4c84f..a2f827b83b 100644 --- a/Mage/src/mage/abilities/effects/PostResolveEffect.java +++ b/Mage/src/mage/abilities/effects/PostResolveEffect.java @@ -39,19 +39,19 @@ import mage.game.Game; */ public abstract class PostResolveEffect> extends OneShotEffect { - public PostResolveEffect() { - super(Outcome.Neutral); - } - - public PostResolveEffect(final PostResolveEffect effect) { - super(effect); - } - - @Override - public boolean apply(Game game, Ability source) { - return true; - } + public PostResolveEffect() { + super(Outcome.Neutral); + } - public abstract void postResolve(Card card, Ability source, UUID controllerId, Game game); + public PostResolveEffect(final PostResolveEffect effect) { + super(effect); + } + + @Override + public boolean apply(Game game, Ability source) { + return true; + } + + public abstract void postResolve(Card card, Ability source, UUID controllerId, Game game); } diff --git a/Mage/src/mage/abilities/effects/PreventionEffectImpl.java b/Mage/src/mage/abilities/effects/PreventionEffectImpl.java index 8b7e8a1f0f..09e633cb1b 100644 --- a/Mage/src/mage/abilities/effects/PreventionEffectImpl.java +++ b/Mage/src/mage/abilities/effects/PreventionEffectImpl.java @@ -42,25 +42,25 @@ import mage.game.events.GameEvent; */ public abstract class PreventionEffectImpl> extends ReplacementEffectImpl implements PreventionEffect { - public PreventionEffectImpl(Duration duration) { - super(duration, Outcome.PreventDamage); - this.effectType = EffectType.PREVENTION; - } + public PreventionEffectImpl(Duration duration) { + super(duration, Outcome.PreventDamage); + this.effectType = EffectType.PREVENTION; + } - public PreventionEffectImpl(final PreventionEffectImpl effect) { - super(effect); - } + public PreventionEffectImpl(final PreventionEffectImpl effect) { + super(effect); + } - @Override - public boolean applies(GameEvent event, Ability source, Game game) { - switch (event.getType()) { - case DAMAGE_CREATURE: - case DAMAGE_PLAYER: - case DAMAGE_PLANESWALKER: - return event.getFlag(); - default: - return false; - } - } + @Override + public boolean applies(GameEvent event, Ability source, Game game) { + switch (event.getType()) { + case DAMAGE_CREATURE: + case DAMAGE_PLAYER: + case DAMAGE_PLANESWALKER: + return event.getFlag(); + default: + return false; + } + } } diff --git a/Mage/src/mage/abilities/effects/RedirectionEffect.java b/Mage/src/mage/abilities/effects/RedirectionEffect.java index a3ace22334..4cd4d67c80 100644 --- a/Mage/src/mage/abilities/effects/RedirectionEffect.java +++ b/Mage/src/mage/abilities/effects/RedirectionEffect.java @@ -49,49 +49,49 @@ import mage.target.TargetPermanent; */ public abstract class RedirectionEffect> extends ReplacementEffectImpl { - protected TargetPermanent redirectTarget; + protected TargetPermanent redirectTarget; - public RedirectionEffect(Duration duration) { - super(duration, Outcome.RedirectDamage); - this.effectType = EffectType.REDIRECTION; - } + public RedirectionEffect(Duration duration) { + super(duration, Outcome.RedirectDamage); + this.effectType = EffectType.REDIRECTION; + } - public RedirectionEffect(final RedirectionEffect effect) { - super(effect); - this.redirectTarget = effect.redirectTarget; - } + public RedirectionEffect(final RedirectionEffect effect) { + super(effect); + this.redirectTarget = effect.redirectTarget; + } - @Override - public boolean apply(Game game, Ability source) { - return true; - } + @Override + public boolean apply(Game game, Ability source) { + return true; + } - @Override - public boolean replaceEvent(GameEvent event, Ability source, Game game) { - DamageEvent damageEvent = (DamageEvent)event; - Permanent permanent = game.getPermanent(redirectTarget.getFirstTarget()); - Ability damageSource = getSource(damageEvent.getSourceId(), game); - if (permanent != null && damageSource != null) { - permanent.damage(damageEvent.getAmount(), damageSource.getId(), game, damageEvent.isPreventable(), damageEvent.isCombatDamage()); - return true; - } - Player player = game.getPlayer(redirectTarget.getFirstTarget()); - if (player != null) { - player.damage(damageEvent.getAmount(), damageSource.getId(), game, damageEvent.isCombatDamage(), damageEvent.isPreventable()); - return true; - } - return false; - } + @Override + public boolean replaceEvent(GameEvent event, Ability source, Game game) { + DamageEvent damageEvent = (DamageEvent)event; + Permanent permanent = game.getPermanent(redirectTarget.getFirstTarget()); + Ability damageSource = getSource(damageEvent.getSourceId(), game); + if (permanent != null && damageSource != null) { + permanent.damage(damageEvent.getAmount(), damageSource.getId(), game, damageEvent.isPreventable(), damageEvent.isCombatDamage()); + return true; + } + Player player = game.getPlayer(redirectTarget.getFirstTarget()); + if (player != null) { + player.damage(damageEvent.getAmount(), damageSource.getId(), game, damageEvent.isCombatDamage(), damageEvent.isPreventable()); + return true; + } + return false; + } - protected Ability getSource(UUID sourceId, Game game) { - StackObject source = game.getStack().getStackObject(sourceId); - if (source != null) { - if (source instanceof StackAbility) - return (StackAbility)source; - if (source instanceof Spell) - return ((Spell)source).getSpellAbility(); - } - return null; - } + protected Ability getSource(UUID sourceId, Game game) { + StackObject source = game.getStack().getStackObject(sourceId); + if (source != null) { + if (source instanceof StackAbility) + return (StackAbility)source; + if (source instanceof Spell) + return ((Spell)source).getSpellAbility(); + } + return null; + } } diff --git a/Mage/src/mage/abilities/effects/ReplacementEffect.java b/Mage/src/mage/abilities/effects/ReplacementEffect.java index b22e2608df..aab0e26484 100644 --- a/Mage/src/mage/abilities/effects/ReplacementEffect.java +++ b/Mage/src/mage/abilities/effects/ReplacementEffect.java @@ -38,7 +38,7 @@ import mage.game.events.GameEvent; */ public interface ReplacementEffect> extends ContinuousEffect { - public boolean replaceEvent(GameEvent event, Ability source, Game game); - public boolean applies(GameEvent event, Ability source, Game game); + public boolean replaceEvent(GameEvent event, Ability source, Game game); + public boolean applies(GameEvent event, Ability source, Game game); } diff --git a/Mage/src/mage/abilities/effects/ReplacementEffectImpl.java b/Mage/src/mage/abilities/effects/ReplacementEffectImpl.java index 956e7cf30d..573fdf54da 100644 --- a/Mage/src/mage/abilities/effects/ReplacementEffectImpl.java +++ b/Mage/src/mage/abilities/effects/ReplacementEffectImpl.java @@ -38,13 +38,13 @@ import mage.Constants.Outcome; */ public abstract class ReplacementEffectImpl> extends ContinuousEffectImpl implements ReplacementEffect { - public ReplacementEffectImpl(Duration duration, Outcome outcome) { - super(duration, outcome); - this.effectType = EffectType.REPLACEMENT; - } + public ReplacementEffectImpl(Duration duration, Outcome outcome) { + super(duration, outcome); + this.effectType = EffectType.REPLACEMENT; + } - public ReplacementEffectImpl(final ReplacementEffectImpl effect) { - super(effect); - } + public ReplacementEffectImpl(final ReplacementEffectImpl effect) { + super(effect); + } } diff --git a/Mage/src/mage/abilities/effects/RequirementBlockEffect.java b/Mage/src/mage/abilities/effects/RequirementBlockEffect.java index 9db1782050..359b70b863 100644 --- a/Mage/src/mage/abilities/effects/RequirementBlockEffect.java +++ b/Mage/src/mage/abilities/effects/RequirementBlockEffect.java @@ -41,26 +41,26 @@ import mage.game.events.GameEvent.EventType; */ public abstract class RequirementBlockEffect> extends ReplacementEffectImpl { - public RequirementBlockEffect(Duration duration) { - super(duration, Outcome.Detriment); - } + public RequirementBlockEffect(Duration duration) { + super(duration, Outcome.Detriment); + } - public RequirementBlockEffect(final RequirementBlockEffect effect) { - super(effect); - } + public RequirementBlockEffect(final RequirementBlockEffect effect) { + super(effect); + } - @Override - public boolean replaceEvent(GameEvent event, Ability source, Game game) { - apply(game, source); - return false; - } + @Override + public boolean replaceEvent(GameEvent event, Ability source, Game game) { + apply(game, source); + return false; + } - @Override - public boolean applies(GameEvent event, Ability source, Game game) { - if (event.getType().equals(EventType.DECLARE_BLOCKERS_STEP_PRE)) - return true; - return false; - } + @Override + public boolean applies(GameEvent event, Ability source, Game game) { + if (event.getType().equals(EventType.DECLARE_BLOCKERS_STEP_PRE)) + return true; + return false; + } } diff --git a/Mage/src/mage/abilities/effects/RequirementEffect.java b/Mage/src/mage/abilities/effects/RequirementEffect.java index 925e388339..12f161fc4b 100644 --- a/Mage/src/mage/abilities/effects/RequirementEffect.java +++ b/Mage/src/mage/abilities/effects/RequirementEffect.java @@ -42,32 +42,32 @@ import mage.game.permanent.Permanent; */ public abstract class RequirementEffect> extends ContinuousEffectImpl { - public RequirementEffect(Duration duration) { - super(duration, Outcome.Detriment); - this.effectType = EffectType.REQUIREMENT; - } + public RequirementEffect(Duration duration) { + super(duration, Outcome.Detriment); + this.effectType = EffectType.REQUIREMENT; + } - public RequirementEffect(final RequirementEffect effect) { - super(effect); - } + public RequirementEffect(final RequirementEffect effect) { + super(effect); + } - @Override - public boolean apply(Game game, Ability source) { - throw new UnsupportedOperationException("Not supported."); - } + @Override + public boolean apply(Game game, Ability source) { + throw new UnsupportedOperationException("Not supported."); + } - public abstract boolean applies(Permanent permanent, Ability source, Game game); + public abstract boolean applies(Permanent permanent, Ability source, Game game); - public abstract boolean mustAttack(Game game); + public abstract boolean mustAttack(Game game); - public abstract boolean mustBlock(Game game); + public abstract boolean mustBlock(Game game); - public UUID mustAttackDefender(Ability source, Game game) { - return null; - } + public UUID mustAttackDefender(Ability source, Game game) { + return null; + } - public UUID mustBlockAttacker(Ability source, Game game) { - return null; - } + public UUID mustBlockAttacker(Ability source, Game game) { + return null; + } } diff --git a/Mage/src/mage/abilities/effects/RestrictionEffect.java b/Mage/src/mage/abilities/effects/RestrictionEffect.java index dd44a8c6a7..8bd2f95ab3 100644 --- a/Mage/src/mage/abilities/effects/RestrictionEffect.java +++ b/Mage/src/mage/abilities/effects/RestrictionEffect.java @@ -41,36 +41,36 @@ import mage.game.permanent.Permanent; */ public abstract class RestrictionEffect> extends ContinuousEffectImpl { - public RestrictionEffect(Duration duration) { - super(duration, Outcome.Detriment); - this.effectType = EffectType.RESTRICTION; - } + public RestrictionEffect(Duration duration) { + super(duration, Outcome.Detriment); + this.effectType = EffectType.RESTRICTION; + } - public RestrictionEffect(final RestrictionEffect effect) { - super(effect); - } + public RestrictionEffect(final RestrictionEffect effect) { + super(effect); + } - @Override - public boolean apply(Game game, Ability source) { - throw new UnsupportedOperationException("Not supported."); - } + @Override + public boolean apply(Game game, Ability source) { + throw new UnsupportedOperationException("Not supported."); + } - public abstract boolean applies(Permanent permanent, Ability source, Game game); + public abstract boolean applies(Permanent permanent, Ability source, Game game); - public boolean canAttack(Game game) { - return true; - } + public boolean canAttack(Game game) { + return true; + } - public boolean canBlock(Permanent attacker, Permanent blocker, Ability source, Game game) { - return true; - } + public boolean canBlock(Permanent attacker, Permanent blocker, Ability source, Game game) { + return true; + } public boolean canBeBlocked(Permanent attacker, Permanent blocker, Ability source, Game game) { - return true; - } + return true; + } + + public boolean canBeUntapped(Permanent permanent, Game game) { + return true; + } - public boolean canBeUntapped(Permanent permanent, Game game) { - return true; - } - } diff --git a/Mage/src/mage/abilities/effects/SearchEffect.java b/Mage/src/mage/abilities/effects/SearchEffect.java index 68c1e53c2a..9dd01ee2a6 100644 --- a/Mage/src/mage/abilities/effects/SearchEffect.java +++ b/Mage/src/mage/abilities/effects/SearchEffect.java @@ -38,19 +38,19 @@ import mage.target.common.TargetCardInLibrary; */ public abstract class SearchEffect> extends OneShotEffect { - protected TargetCardInLibrary target; + protected TargetCardInLibrary target; - public SearchEffect(TargetCardInLibrary target, Outcome outcome) { - super(outcome); - this.target = target; - } + public SearchEffect(TargetCardInLibrary target, Outcome outcome) { + super(outcome); + this.target = target; + } - public SearchEffect(SearchEffect effect) { - super(effect); - this.target = effect.target.copy(); - } + public SearchEffect(SearchEffect effect) { + super(effect); + this.target = effect.target.copy(); + } - public TargetCard getTarget() { - return target; - } + public TargetCard getTarget() { + return target; + } } diff --git a/Mage/src/mage/abilities/effects/WhileConditionContiniousEffect.java b/Mage/src/mage/abilities/effects/WhileConditionContiniousEffect.java index f5b8e99740..d1ce3b5226 100644 --- a/Mage/src/mage/abilities/effects/WhileConditionContiniousEffect.java +++ b/Mage/src/mage/abilities/effects/WhileConditionContiniousEffect.java @@ -10,9 +10,9 @@ public abstract class WhileConditionContiniousEffect { private ContinuousEffect effect; - - public AddContinuousEffectToGame(ContinuousEffect effect) { - super(Outcome.Benefit); - this.effect = effect; - } - public AddContinuousEffectToGame(final AddContinuousEffectToGame effect) { - super(effect); - this.effect = effect.effect; - } + public AddContinuousEffectToGame(ContinuousEffect effect) { + super(Outcome.Benefit); + this.effect = effect; + } - @Override - public AddContinuousEffectToGame copy() { - return new AddContinuousEffectToGame(this); - } + public AddContinuousEffectToGame(final AddContinuousEffectToGame effect) { + super(effect); + this.effect = effect.effect; + } - @Override - public boolean apply(Game game, Ability source) { + @Override + public AddContinuousEffectToGame copy() { + return new AddContinuousEffectToGame(this); + } + + @Override + public boolean apply(Game game, Ability source) { ContinuousEffect effectToAdd = (ContinuousEffect) effect.copy(); - game.addEffect(effectToAdd, source); + game.addEffect(effectToAdd, source); return true; - } + } } diff --git a/Mage/src/mage/abilities/effects/common/AttachEffect.java b/Mage/src/mage/abilities/effects/common/AttachEffect.java index 4bf78743b3..610f2576eb 100644 --- a/Mage/src/mage/abilities/effects/common/AttachEffect.java +++ b/Mage/src/mage/abilities/effects/common/AttachEffect.java @@ -41,37 +41,37 @@ import mage.players.Player; */ public class AttachEffect extends OneShotEffect { - public AttachEffect(Outcome outcome) { - super(outcome); - } + public AttachEffect(Outcome outcome) { + super(outcome); + } - public AttachEffect(Outcome outcome, String rule) { - super(outcome); - staticText = rule; - } + public AttachEffect(Outcome outcome, String rule) { + super(outcome); + staticText = rule; + } - public AttachEffect(final AttachEffect effect) { - super(effect); - } + public AttachEffect(final AttachEffect effect) { + super(effect); + } - @Override - public AttachEffect copy() { - return new AttachEffect(this); - } + @Override + public AttachEffect copy() { + return new AttachEffect(this); + } - @Override - public boolean apply(Game game, Ability source) { - Permanent permanent = game.getPermanent(source.getFirstTarget()); - if (permanent != null) { - return permanent.addAttachment(source.getSourceId(), game); - } + @Override + public boolean apply(Game game, Ability source) { + Permanent permanent = game.getPermanent(source.getFirstTarget()); + if (permanent != null) { + return permanent.addAttachment(source.getSourceId(), game); + } else { Player player = game.getPlayer(source.getFirstTarget()); if (player != null) { return player.addAttachment(source.getSourceId(), game); } } - return false; - } + return false; + } } diff --git a/Mage/src/mage/abilities/effects/common/AttacksIfAbleSourceEffect.java b/Mage/src/mage/abilities/effects/common/AttacksIfAbleSourceEffect.java index 3be1731864..62e2a6b12e 100644 --- a/Mage/src/mage/abilities/effects/common/AttacksIfAbleSourceEffect.java +++ b/Mage/src/mage/abilities/effects/common/AttacksIfAbleSourceEffect.java @@ -40,39 +40,39 @@ import mage.game.permanent.Permanent; */ public class AttacksIfAbleSourceEffect extends RequirementEffect { - public AttacksIfAbleSourceEffect(Duration duration) { - super(duration); - if (this.duration == Duration.EndOfTurn) - staticText = "{this} attacks this turn if able"; - else - staticText = "{this} attacks each turn if able"; - } + public AttacksIfAbleSourceEffect(Duration duration) { + super(duration); + if (this.duration == Duration.EndOfTurn) + staticText = "{this} attacks this turn if able"; + else + staticText = "{this} attacks each turn if able"; + } - public AttacksIfAbleSourceEffect(final AttacksIfAbleSourceEffect effect) { - super(effect); - } + public AttacksIfAbleSourceEffect(final AttacksIfAbleSourceEffect effect) { + super(effect); + } - @Override - public AttacksIfAbleSourceEffect copy() { - return new AttacksIfAbleSourceEffect(this); - } + @Override + public AttacksIfAbleSourceEffect copy() { + return new AttacksIfAbleSourceEffect(this); + } - @Override - public boolean applies(Permanent permanent, Ability source, Game game) { - if (permanent.getId().equals(source.getSourceId())) { - return true; - } - return false; - } + @Override + public boolean applies(Permanent permanent, Ability source, Game game) { + if (permanent.getId().equals(source.getSourceId())) { + return true; + } + return false; + } - @Override - public boolean mustAttack(Game game) { - return true; - } + @Override + public boolean mustAttack(Game game) { + return true; + } - @Override - public boolean mustBlock(Game game) { - return false; - } + @Override + public boolean mustBlock(Game game) { + return false; + } } \ No newline at end of file diff --git a/Mage/src/mage/abilities/effects/common/AttacksIfAbleTargetEffect.java b/Mage/src/mage/abilities/effects/common/AttacksIfAbleTargetEffect.java index 2b7ef82147..4d7f91e231 100644 --- a/Mage/src/mage/abilities/effects/common/AttacksIfAbleTargetEffect.java +++ b/Mage/src/mage/abilities/effects/common/AttacksIfAbleTargetEffect.java @@ -41,44 +41,44 @@ import mage.game.permanent.Permanent; */ public class AttacksIfAbleTargetEffect extends RequirementEffect { - public AttacksIfAbleTargetEffect(Duration duration) { - super(duration); - } + public AttacksIfAbleTargetEffect(Duration duration) { + super(duration); + } - public AttacksIfAbleTargetEffect(final AttacksIfAbleTargetEffect effect) { - super(effect); - } + public AttacksIfAbleTargetEffect(final AttacksIfAbleTargetEffect effect) { + super(effect); + } - @Override - public AttacksIfAbleTargetEffect copy() { - return new AttacksIfAbleTargetEffect(this); - } + @Override + public AttacksIfAbleTargetEffect copy() { + return new AttacksIfAbleTargetEffect(this); + } - @Override - public boolean applies(Permanent permanent, Ability source, Game game) { - Permanent creature = game.getPermanent(source.getFirstTarget()); - if (creature != null && creature.getId().equals(permanent.getId())) { - return true; - } - return false; - } + @Override + public boolean applies(Permanent permanent, Ability source, Game game) { + Permanent creature = game.getPermanent(source.getFirstTarget()); + if (creature != null && creature.getId().equals(permanent.getId())) { + return true; + } + return false; + } - @Override - public boolean mustAttack(Game game) { - return true; - } + @Override + public boolean mustAttack(Game game) { + return true; + } - @Override - public boolean mustBlock(Game game) { - return false; - } + @Override + public boolean mustBlock(Game game) { + return false; + } - @Override - public String getText(Mode mode) { - if (this.duration == Duration.EndOfTurn) - return "Target " + mode.getTargets().get(0).getTargetName() + " attacks this turn if able"; - else - return "Target " + mode.getTargets().get(0).getTargetName() + " attacks each turn if able"; - } + @Override + public String getText(Mode mode) { + if (this.duration == Duration.EndOfTurn) + return "Target " + mode.getTargets().get(0).getTargetName() + " attacks this turn if able"; + else + return "Target " + mode.getTargets().get(0).getTargetName() + " attacks each turn if able"; + } } \ No newline at end of file diff --git a/Mage/src/mage/abilities/effects/common/BasicManaEffect.java b/Mage/src/mage/abilities/effects/common/BasicManaEffect.java index 7948387472..2dea638b50 100644 --- a/Mage/src/mage/abilities/effects/common/BasicManaEffect.java +++ b/Mage/src/mage/abilities/effects/common/BasicManaEffect.java @@ -9,21 +9,21 @@ public class BasicManaEffect extends ManaEffect { protected Mana mana; public BasicManaEffect(Mana mana) { - super(); - this.mana = mana; - staticText = "Add " + mana.toString() + " to your mana pool"; - } + super(); + this.mana = mana; + staticText = "Add " + mana.toString() + " to your mana pool"; + } - public BasicManaEffect(ConditionalMana conditionalMana) { - super(); - this.mana = conditionalMana; - staticText = "Add " + mana.toString() + " to your mana pool. " + conditionalMana.getDescription(); - } + public BasicManaEffect(ConditionalMana conditionalMana) { + super(); + this.mana = conditionalMana; + staticText = "Add " + mana.toString() + " to your mana pool. " + conditionalMana.getDescription(); + } public BasicManaEffect(final BasicManaEffect effect) { - super(effect); - this.mana = effect.mana.copy(); - } + super(effect); + this.mana = effect.mana.copy(); + } @Override public BasicManaEffect copy() { @@ -31,12 +31,12 @@ public class BasicManaEffect extends ManaEffect { } @Override - public boolean apply(Game game, Ability source) { - game.getPlayer(source.getControllerId()).getManaPool().addMana(mana, game, source); - return true; - } + public boolean apply(Game game, Ability source) { + game.getPlayer(source.getControllerId()).getManaPool().addMana(mana, game, source); + return true; + } - public Mana getMana() { - return mana; - } + public Mana getMana() { + return mana; + } } diff --git a/Mage/src/mage/abilities/effects/common/CantAttackSourceEffect.java b/Mage/src/mage/abilities/effects/common/CantAttackSourceEffect.java index a9790b3570..a1c3b2c7c7 100644 --- a/Mage/src/mage/abilities/effects/common/CantAttackSourceEffect.java +++ b/Mage/src/mage/abilities/effects/common/CantAttackSourceEffect.java @@ -40,30 +40,30 @@ import mage.game.permanent.Permanent; */ public class CantAttackSourceEffect extends RestrictionEffect { - public CantAttackSourceEffect(Duration duration) { - super(duration); - } + public CantAttackSourceEffect(Duration duration) { + super(duration); + } - public CantAttackSourceEffect(final CantAttackSourceEffect effect) { - super(effect); - } + public CantAttackSourceEffect(final CantAttackSourceEffect effect) { + super(effect); + } - @Override - public boolean applies(Permanent permanent, Ability source, Game game) { - if (permanent.getId().equals(source.getSourceId())) { - return true; - } - return false; - } + @Override + public boolean applies(Permanent permanent, Ability source, Game game) { + if (permanent.getId().equals(source.getSourceId())) { + return true; + } + return false; + } - @Override - public boolean canAttack(Game game) { - return false; - } + @Override + public boolean canAttack(Game game) { + return false; + } - @Override - public CantAttackSourceEffect copy() { - return new CantAttackSourceEffect(this); - } + @Override + public CantAttackSourceEffect copy() { + return new CantAttackSourceEffect(this); + } } diff --git a/Mage/src/mage/abilities/effects/common/CantBlockSourceEffect.java b/Mage/src/mage/abilities/effects/common/CantBlockSourceEffect.java index dd170f7cfe..bf5ba1b9b6 100644 --- a/Mage/src/mage/abilities/effects/common/CantBlockSourceEffect.java +++ b/Mage/src/mage/abilities/effects/common/CantBlockSourceEffect.java @@ -40,30 +40,30 @@ import mage.game.permanent.Permanent; */ public class CantBlockSourceEffect extends RestrictionEffect { - public CantBlockSourceEffect(Duration duration) { - super(duration); - } + public CantBlockSourceEffect(Duration duration) { + super(duration); + } - public CantBlockSourceEffect(final CantBlockSourceEffect effect) { - super(effect); - } + public CantBlockSourceEffect(final CantBlockSourceEffect effect) { + super(effect); + } - @Override - public boolean applies(Permanent permanent, Ability source, Game game) { - if (permanent.getId().equals(source.getSourceId())) { - return true; - } - return false; - } + @Override + public boolean applies(Permanent permanent, Ability source, Game game) { + if (permanent.getId().equals(source.getSourceId())) { + return true; + } + return false; + } - @Override - public boolean canBlock(Permanent attacker, Permanent blocker, Ability source, Game game) { - return false; - } + @Override + public boolean canBlock(Permanent attacker, Permanent blocker, Ability source, Game game) { + return false; + } - @Override - public CantBlockSourceEffect copy() { - return new CantBlockSourceEffect(this); - } + @Override + public CantBlockSourceEffect copy() { + return new CantBlockSourceEffect(this); + } } diff --git a/Mage/src/mage/abilities/effects/common/CantCounterControlledEffect.java b/Mage/src/mage/abilities/effects/common/CantCounterControlledEffect.java index b260e796da..dda538b367 100644 --- a/Mage/src/mage/abilities/effects/common/CantCounterControlledEffect.java +++ b/Mage/src/mage/abilities/effects/common/CantCounterControlledEffect.java @@ -46,72 +46,72 @@ import mage.game.stack.Spell; */ public class CantCounterControlledEffect extends ReplacementEffectImpl { - private FilterSpell filterTarget; - private FilterObject filterSource; + private FilterSpell filterTarget; + private FilterObject filterSource; - public CantCounterControlledEffect(FilterSpell filterTarget, FilterObject filterSource, Duration duration) { - super(duration, Outcome.Benefit); - this.filterTarget = filterTarget; - this.filterSource = filterSource; - setText(); - } + public CantCounterControlledEffect(FilterSpell filterTarget, FilterObject filterSource, Duration duration) { + super(duration, Outcome.Benefit); + this.filterTarget = filterTarget; + this.filterSource = filterSource; + setText(); + } - public CantCounterControlledEffect(FilterSpell filterTarget, Duration duration) { - this(filterTarget, null, duration); - } + public CantCounterControlledEffect(FilterSpell filterTarget, Duration duration) { + this(filterTarget, null, duration); + } - public CantCounterControlledEffect(final CantCounterControlledEffect effect) { - super(effect); - if (effect.filterTarget != null) - this.filterTarget = effect.filterTarget.copy(); - if (effect.filterSource != null) - this.filterSource = effect.filterSource.copy(); - } + public CantCounterControlledEffect(final CantCounterControlledEffect effect) { + super(effect); + if (effect.filterTarget != null) + this.filterTarget = effect.filterTarget.copy(); + if (effect.filterSource != null) + this.filterSource = effect.filterSource.copy(); + } - @Override - public CantCounterControlledEffect copy() { - return new CantCounterControlledEffect(this); - } + @Override + public CantCounterControlledEffect copy() { + return new CantCounterControlledEffect(this); + } - @Override - public boolean apply(Game game, Ability source) { - return true; - } + @Override + public boolean apply(Game game, Ability source) { + return true; + } - @Override - public boolean replaceEvent(GameEvent event, Ability source, Game game) { - return true; - } + @Override + public boolean replaceEvent(GameEvent event, Ability source, Game game) { + return true; + } - @Override - public boolean applies(GameEvent event, Ability source, Game game) { - if (event.getType() == EventType.COUNTER) { - filterTarget.getControllerId().clear(); - filterTarget.getControllerId().add(source.getControllerId()); - Spell spell = game.getStack().getSpell(event.getTargetId()); - if (spell != null) { - if (filterTarget.match(spell, game)) { - if (filterSource == null) - return true; - else { - MageObject sourceObject = game.getObject(source.getSourceId()); - if (sourceObject != null && filterSource.match(sourceObject, game)) { - return true; - } - } - } - } - } - return false; - } + @Override + public boolean applies(GameEvent event, Ability source, Game game) { + if (event.getType() == EventType.COUNTER) { + filterTarget.getControllerId().clear(); + filterTarget.getControllerId().add(source.getControllerId()); + Spell spell = game.getStack().getSpell(event.getTargetId()); + if (spell != null) { + if (filterTarget.match(spell, game)) { + if (filterSource == null) + return true; + else { + MageObject sourceObject = game.getObject(source.getSourceId()); + if (sourceObject != null && filterSource.match(sourceObject, game)) { + return true; + } + } + } + } + } + return false; + } - private void setText() { - StringBuilder sb = new StringBuilder(); - sb.append(filterTarget.getMessage()).append(" can't be countered"); - if (filterSource != null) { - sb.append(" by ").append(filterSource.getMessage()); - } - staticText = sb.toString(); - } + private void setText() { + StringBuilder sb = new StringBuilder(); + sb.append(filterTarget.getMessage()).append(" can't be countered"); + if (filterSource != null) { + sb.append(" by ").append(filterSource.getMessage()); + } + staticText = sb.toString(); + } } diff --git a/Mage/src/mage/abilities/effects/common/CantCounterSourceEffect.java b/Mage/src/mage/abilities/effects/common/CantCounterSourceEffect.java index 69771a120a..d284a72b80 100644 --- a/Mage/src/mage/abilities/effects/common/CantCounterSourceEffect.java +++ b/Mage/src/mage/abilities/effects/common/CantCounterSourceEffect.java @@ -43,38 +43,38 @@ import mage.game.events.GameEvent.EventType; */ public class CantCounterSourceEffect extends ReplacementEffectImpl { - public CantCounterSourceEffect() { - super(Duration.WhileOnStack, Outcome.Benefit); - staticText = "{this} can't be countered"; - } - - public CantCounterSourceEffect(final CantCounterSourceEffect effect) { - super(effect); - } + public CantCounterSourceEffect() { + super(Duration.WhileOnStack, Outcome.Benefit); + staticText = "{this} can't be countered"; + } - @Override - public CantCounterSourceEffect copy() { - return new CantCounterSourceEffect(this); - } + public CantCounterSourceEffect(final CantCounterSourceEffect effect) { + super(effect); + } - @Override - public boolean apply(Game game, Ability source) { - return true; - } + @Override + public CantCounterSourceEffect copy() { + return new CantCounterSourceEffect(this); + } - @Override - public boolean replaceEvent(GameEvent event, Ability source, Game game) { - return true; - } + @Override + public boolean apply(Game game, Ability source) { + return true; + } - @Override - public boolean applies(GameEvent event, Ability source, Game game) { - if (event.getType() == EventType.COUNTER) { - UUID spellId = game.getCard(source.getSourceId()).getSpellAbility().getId(); - if (event.getTargetId().equals(spellId)) - return true; - } - return false; - } + @Override + public boolean replaceEvent(GameEvent event, Ability source, Game game) { + return true; + } + + @Override + public boolean applies(GameEvent event, Ability source, Game game) { + if (event.getType() == EventType.COUNTER) { + UUID spellId = game.getCard(source.getSourceId()).getSpellAbility().getId(); + if (event.getTargetId().equals(spellId)) + return true; + } + return false; + } } diff --git a/Mage/src/mage/abilities/effects/common/CantTargetControlledEffect.java b/Mage/src/mage/abilities/effects/common/CantTargetControlledEffect.java index 9222a73123..a1bd610b84 100644 --- a/Mage/src/mage/abilities/effects/common/CantTargetControlledEffect.java +++ b/Mage/src/mage/abilities/effects/common/CantTargetControlledEffect.java @@ -47,73 +47,73 @@ import mage.game.stack.StackObject; */ public class CantTargetControlledEffect extends ReplacementEffectImpl { - private FilterPermanent filterTarget; - private FilterStackObject filterSource; + private FilterPermanent filterTarget; + private FilterStackObject filterSource; - public CantTargetControlledEffect(FilterPermanent filterTarget, FilterStackObject filterSource, Duration duration) { - super(duration, Outcome.Benefit); - this.filterTarget = filterTarget; - this.filterSource = filterSource; - setText(); - } + public CantTargetControlledEffect(FilterPermanent filterTarget, FilterStackObject filterSource, Duration duration) { + super(duration, Outcome.Benefit); + this.filterTarget = filterTarget; + this.filterSource = filterSource; + setText(); + } - public CantTargetControlledEffect(FilterPermanent filterTarget, Duration duration) { - this(filterTarget, null, duration); - } + public CantTargetControlledEffect(FilterPermanent filterTarget, Duration duration) { + this(filterTarget, null, duration); + } - public CantTargetControlledEffect(final CantTargetControlledEffect effect) { - super(effect); - if (effect.filterTarget != null) - this.filterTarget = effect.filterTarget.copy(); - if (effect.filterSource != null) - this.filterSource = effect.filterSource.copy(); - } + public CantTargetControlledEffect(final CantTargetControlledEffect effect) { + super(effect); + if (effect.filterTarget != null) + this.filterTarget = effect.filterTarget.copy(); + if (effect.filterSource != null) + this.filterSource = effect.filterSource.copy(); + } - @Override - public CantTargetControlledEffect copy() { - return new CantTargetControlledEffect(this); - } + @Override + public CantTargetControlledEffect copy() { + return new CantTargetControlledEffect(this); + } - @Override - public boolean apply(Game game, Ability source) { - return true; - } + @Override + public boolean apply(Game game, Ability source) { + return true; + } - @Override - public boolean replaceEvent(GameEvent event, Ability source, Game game) { - return true; - } + @Override + public boolean replaceEvent(GameEvent event, Ability source, Game game) { + return true; + } - @Override - public boolean applies(GameEvent event, Ability source, Game game) { - if (event.getType() == EventType.TARGET) { - filterTarget.setTargetController(TargetController.YOU); - Permanent permanent = game.getPermanent(event.getTargetId()); - if (permanent != null && filterTarget.match(permanent, source.getSourceId(), source.getControllerId(), game)) { - if (filterSource == null) - return true; - else { - StackObject sourceObject = game.getStack().getStackObject(event.getSourceId()); - if (sourceObject != null && filterSource.match(sourceObject, game)) { - return true; - } - } - } - } - return false; - } + @Override + public boolean applies(GameEvent event, Ability source, Game game) { + if (event.getType() == EventType.TARGET) { + filterTarget.setTargetController(TargetController.YOU); + Permanent permanent = game.getPermanent(event.getTargetId()); + if (permanent != null && filterTarget.match(permanent, source.getSourceId(), source.getControllerId(), game)) { + if (filterSource == null) + return true; + else { + StackObject sourceObject = game.getStack().getStackObject(event.getSourceId()); + if (sourceObject != null && filterSource.match(sourceObject, game)) { + return true; + } + } + } + } + return false; + } - private void setText() { - StringBuilder sb = new StringBuilder(); - sb.append(filterTarget.getMessage()).append(" can't be the targets of "); - if (filterSource != null) { - sb.append(filterSource.getMessage()); - } - else { - sb.append("spells"); - } - sb.append(" ").append(duration.toString()); - staticText = sb.toString(); - } + private void setText() { + StringBuilder sb = new StringBuilder(); + sb.append(filterTarget.getMessage()).append(" can't be the targets of "); + if (filterSource != null) { + sb.append(filterSource.getMessage()); + } + else { + sb.append("spells"); + } + sb.append(" ").append(duration.toString()); + staticText = sb.toString(); + } } diff --git a/Mage/src/mage/abilities/effects/common/CantTargetSourceEffect.java b/Mage/src/mage/abilities/effects/common/CantTargetSourceEffect.java index 5f16fb9415..291f8c0e88 100644 --- a/Mage/src/mage/abilities/effects/common/CantTargetSourceEffect.java +++ b/Mage/src/mage/abilities/effects/common/CantTargetSourceEffect.java @@ -44,51 +44,51 @@ import mage.game.stack.StackObject; */ public class CantTargetSourceEffect extends ReplacementEffectImpl { - private FilterStackObject filterSource; + private FilterStackObject filterSource; - public CantTargetSourceEffect(FilterStackObject filterSource, Duration duration) { - super(duration, Outcome.Benefit); - this.filterSource = filterSource; - setText(); - } + public CantTargetSourceEffect(FilterStackObject filterSource, Duration duration) { + super(duration, Outcome.Benefit); + this.filterSource = filterSource; + setText(); + } - public CantTargetSourceEffect(final CantTargetSourceEffect effect) { - super(effect); - this.filterSource = effect.filterSource.copy(); - } + public CantTargetSourceEffect(final CantTargetSourceEffect effect) { + super(effect); + this.filterSource = effect.filterSource.copy(); + } - @Override - public CantTargetSourceEffect copy() { - return new CantTargetSourceEffect(this); - } + @Override + public CantTargetSourceEffect copy() { + return new CantTargetSourceEffect(this); + } - @Override - public boolean apply(Game game, Ability source) { - return true; - } + @Override + public boolean apply(Game game, Ability source) { + return true; + } - @Override - public boolean replaceEvent(GameEvent event, Ability source, Game game) { - return true; - } + @Override + public boolean replaceEvent(GameEvent event, Ability source, Game game) { + return true; + } - @Override - public boolean applies(GameEvent event, Ability source, Game game) { - if (event.getType() == EventType.TARGET && event.getTargetId().equals(source.getSourceId())) { - StackObject sourceObject = game.getStack().getStackObject(event.getSourceId()); - if (sourceObject != null && filterSource.match(sourceObject, source.getControllerId(), game)) { - return true; - } - } - return false; - } + @Override + public boolean applies(GameEvent event, Ability source, Game game) { + if (event.getType() == EventType.TARGET && event.getTargetId().equals(source.getSourceId())) { + StackObject sourceObject = game.getStack().getStackObject(event.getSourceId()); + if (sourceObject != null && filterSource.match(sourceObject, source.getControllerId(), game)) { + return true; + } + } + return false; + } - private void setText() { - StringBuilder sb = new StringBuilder(); - sb.append("{this} can't be the target of "); - sb.append(filterSource.getMessage()); - sb.append(" ").append(duration.toString()); - staticText = sb.toString(); - } + private void setText() { + StringBuilder sb = new StringBuilder(); + sb.append("{this} can't be the target of "); + sb.append(filterSource.getMessage()); + sb.append(" ").append(duration.toString()); + staticText = sb.toString(); + } } diff --git a/Mage/src/mage/abilities/effects/common/ChooseNewTargetsTargetEffect.java b/Mage/src/mage/abilities/effects/common/ChooseNewTargetsTargetEffect.java index e54c6596fa..9a3751bbea 100644 --- a/Mage/src/mage/abilities/effects/common/ChooseNewTargetsTargetEffect.java +++ b/Mage/src/mage/abilities/effects/common/ChooseNewTargetsTargetEffect.java @@ -41,30 +41,30 @@ import mage.game.stack.Spell; */ public class ChooseNewTargetsTargetEffect extends OneShotEffect { - public ChooseNewTargetsTargetEffect() { - super(Outcome.Benefit); - } + public ChooseNewTargetsTargetEffect() { + super(Outcome.Benefit); + } - public ChooseNewTargetsTargetEffect(final ChooseNewTargetsTargetEffect effect) { - super(effect); - } - - @Override - public boolean apply(Game game, Ability source) { - Spell spell = game.getStack().getSpell(source.getFirstTarget()); - if (spell != null) { - return spell.chooseNewTargets(game, source.getControllerId()); - } - return false; - } + public ChooseNewTargetsTargetEffect(final ChooseNewTargetsTargetEffect effect) { + super(effect); + } - @Override - public ChooseNewTargetsTargetEffect copy() { - return new ChooseNewTargetsTargetEffect(this); - } + @Override + public boolean apply(Game game, Ability source) { + Spell spell = game.getStack().getSpell(source.getFirstTarget()); + if (spell != null) { + return spell.chooseNewTargets(game, source.getControllerId()); + } + return false; + } - @Override - public String getText(Mode mode) { - return "You may choose new targets for target " + mode.getTargets().get(0).getTargetName(); - } + @Override + public ChooseNewTargetsTargetEffect copy() { + return new ChooseNewTargetsTargetEffect(this); + } + + @Override + public String getText(Mode mode) { + return "You may choose new targets for target " + mode.getTargets().get(0).getTargetName(); + } } diff --git a/Mage/src/mage/abilities/effects/common/CopyEffect.java b/Mage/src/mage/abilities/effects/common/CopyEffect.java index 4e5e025184..c688b4c45d 100644 --- a/Mage/src/mage/abilities/effects/common/CopyEffect.java +++ b/Mage/src/mage/abilities/effects/common/CopyEffect.java @@ -48,21 +48,21 @@ public class CopyEffect extends ContinuousEffectImpl { */ private MageObject target; private UUID sourceId; - - public CopyEffect(Permanent target, UUID sourceId) { - super(Duration.WhileOnBattlefield, Layer.CopyEffects_1, SubLayer.NA, Outcome.BecomeCreature); + + public CopyEffect(Permanent target, UUID sourceId) { + super(Duration.WhileOnBattlefield, Layer.CopyEffects_1, SubLayer.NA, Outcome.BecomeCreature); this.target = target; this.sourceId = sourceId; - } + } - public CopyEffect(final CopyEffect effect) { - super(effect); + public CopyEffect(final CopyEffect effect) { + super(effect); this.target = effect.target.copy(); this.sourceId = effect.sourceId; - } + } - @Override - public boolean apply(Game game, Ability source) { + @Override + public boolean apply(Game game, Ability source) { Permanent permanent = game.getPermanent(this.sourceId); if (permanent == null) { return false; @@ -97,12 +97,12 @@ public class CopyEffect extends ContinuousEffectImpl { permanent.setCopy(true); return true; - } + } - @Override - public CopyEffect copy() { - return new CopyEffect(this); - } + @Override + public CopyEffect copy() { + return new CopyEffect(this); + } public MageObject getTarget() { return target; diff --git a/Mage/src/mage/abilities/effects/common/CopyPermanentEffect.java b/Mage/src/mage/abilities/effects/common/CopyPermanentEffect.java index a3cb788fb1..0cf24538ed 100644 --- a/Mage/src/mage/abilities/effects/common/CopyPermanentEffect.java +++ b/Mage/src/mage/abilities/effects/common/CopyPermanentEffect.java @@ -45,13 +45,13 @@ import mage.util.functions.ApplyToPermanent; * @author BetaSteward_at_googlemail.com */ public class CopyPermanentEffect extends OneShotEffect { - + private FilterPermanent filter; - + public CopyPermanentEffect() { this(new FilterCreaturePermanent()); } - + public CopyPermanentEffect(FilterPermanent filter) { super(Outcome.Copy); this.filter = filter; @@ -62,7 +62,7 @@ public class CopyPermanentEffect extends OneShotEffect { super(effect); this.filter = effect.filter.copy(); } - + @Override public boolean apply(Game game, Ability source) { Player player = game.getPlayer(source.getControllerId()); @@ -94,5 +94,5 @@ public class CopyPermanentEffect extends OneShotEffect { public CopyPermanentEffect copy() { return new CopyPermanentEffect(this); } - + } \ No newline at end of file diff --git a/Mage/src/mage/abilities/effects/common/CopyTargetSpellEffect.java b/Mage/src/mage/abilities/effects/common/CopyTargetSpellEffect.java index 531a1f6f62..c6db5a9547 100644 --- a/Mage/src/mage/abilities/effects/common/CopyTargetSpellEffect.java +++ b/Mage/src/mage/abilities/effects/common/CopyTargetSpellEffect.java @@ -42,32 +42,32 @@ import mage.game.stack.Spell; */ public class CopyTargetSpellEffect extends OneShotEffect { - public CopyTargetSpellEffect() { - super(Outcome.Copy); - } - - public CopyTargetSpellEffect(final CopyTargetSpellEffect effect) { - super(effect); - } + public CopyTargetSpellEffect() { + super(Outcome.Copy); + } - @Override - public boolean apply(Game game, Ability source) { - Spell spell = game.getStack().getSpell(targetPointer.getFirst(game, source)); - if (spell != null) { - Spell copy = spell.copySpell(); - copy.setControllerId(source.getControllerId()); - copy.setCopiedSpell(true); - game.getStack().push(copy); - copy.chooseNewTargets(game, source.getControllerId()); - return true; - } - return false; - } + public CopyTargetSpellEffect(final CopyTargetSpellEffect effect) { + super(effect); + } - @Override - public CopyTargetSpellEffect copy() { - return new CopyTargetSpellEffect(this); - } + @Override + public boolean apply(Game game, Ability source) { + Spell spell = game.getStack().getSpell(targetPointer.getFirst(game, source)); + if (spell != null) { + Spell copy = spell.copySpell(); + copy.setControllerId(source.getControllerId()); + copy.setCopiedSpell(true); + game.getStack().push(copy); + copy.chooseNewTargets(game, source.getControllerId()); + return true; + } + return false; + } + + @Override + public CopyTargetSpellEffect copy() { + return new CopyTargetSpellEffect(this); + } @Override public String getText(Mode mode) { diff --git a/Mage/src/mage/abilities/effects/common/CopyTokenEffect.java b/Mage/src/mage/abilities/effects/common/CopyTokenEffect.java index 9444165f77..da6d9a5c76 100644 --- a/Mage/src/mage/abilities/effects/common/CopyTokenEffect.java +++ b/Mage/src/mage/abilities/effects/common/CopyTokenEffect.java @@ -10,49 +10,49 @@ import mage.game.permanent.token.Token; public class CopyTokenEffect extends ContinuousEffectImpl { protected Token token; - public CopyTokenEffect(Token token) { - super(Constants.Duration.WhileOnBattlefield, Constants.Layer.CopyEffects_1, Constants.SubLayer.NA, Constants.Outcome.BecomeCreature); + public CopyTokenEffect(Token token) { + super(Constants.Duration.WhileOnBattlefield, Constants.Layer.CopyEffects_1, Constants.SubLayer.NA, Constants.Outcome.BecomeCreature); this.token = token.copy(); - staticText = "You may have {this} enter the battlefield as a copy of " + token.getDescription() + " on the battlefield"; - } + staticText = "You may have {this} enter the battlefield as a copy of " + token.getDescription() + " on the battlefield"; + } - public CopyTokenEffect(final CopyTokenEffect effect) { - super(effect); + public CopyTokenEffect(final CopyTokenEffect effect) { + super(effect); this.token = effect.token.copy(); - } + } - @Override - public boolean apply(Game game, Ability source) { - Permanent permanent = game.getPermanent(source.getSourceId()); - permanent.setName(token.getName()); - permanent.getColor().setColor(token.getColor()); - permanent.getCardType().clear(); - for (Constants.CardType type: token.getCardType()) { - permanent.getCardType().add(type); - } - permanent.getSubtype().clear(); - for (String type: token.getSubtype()) { - permanent.getSubtype().add(type); - } - permanent.getSupertype().clear(); - for (String type: token.getSupertype()) { - permanent.getSupertype().add(type); - } - permanent.getAbilities().clear(); - for (Ability ability: token.getAbilities()) { - permanent.addAbility(ability, game); - } - permanent.getPower().setValue(token.getPower().getValue()); - permanent.getToughness().setValue(token.getToughness().getValue()); - //permanent.getLoyalty().setValue(card.getLoyalty().getValue()); + @Override + public boolean apply(Game game, Ability source) { + Permanent permanent = game.getPermanent(source.getSourceId()); + permanent.setName(token.getName()); + permanent.getColor().setColor(token.getColor()); + permanent.getCardType().clear(); + for (Constants.CardType type: token.getCardType()) { + permanent.getCardType().add(type); + } + permanent.getSubtype().clear(); + for (String type: token.getSubtype()) { + permanent.getSubtype().add(type); + } + permanent.getSupertype().clear(); + for (String type: token.getSupertype()) { + permanent.getSupertype().add(type); + } + permanent.getAbilities().clear(); + for (Ability ability: token.getAbilities()) { + permanent.addAbility(ability, game); + } + permanent.getPower().setValue(token.getPower().getValue()); + permanent.getToughness().setValue(token.getToughness().getValue()); + //permanent.getLoyalty().setValue(card.getLoyalty().getValue()); - return true; + return true; - } + } - @Override - public CopyTokenEffect copy() { - return new CopyTokenEffect(this); - } + @Override + public CopyTokenEffect copy() { + return new CopyTokenEffect(this); + } } diff --git a/Mage/src/mage/abilities/effects/common/CounterTargetEffect.java b/Mage/src/mage/abilities/effects/common/CounterTargetEffect.java index c73d344277..f01747e92a 100644 --- a/Mage/src/mage/abilities/effects/common/CounterTargetEffect.java +++ b/Mage/src/mage/abilities/effects/common/CounterTargetEffect.java @@ -40,27 +40,27 @@ import mage.game.Game; */ public class CounterTargetEffect extends OneShotEffect { - public CounterTargetEffect() { - super(Outcome.Detriment); - } + public CounterTargetEffect() { + super(Outcome.Detriment); + } - public CounterTargetEffect(final CounterTargetEffect effect) { - super(effect); - } + public CounterTargetEffect(final CounterTargetEffect effect) { + super(effect); + } - @Override - public CounterTargetEffect copy() { - return new CounterTargetEffect(this); - } + @Override + public CounterTargetEffect copy() { + return new CounterTargetEffect(this); + } - @Override - public boolean apply(Game game, Ability source) { - return game.getStack().counter(source.getFirstTarget(), source.getSourceId(), game); - } + @Override + public boolean apply(Game game, Ability source) { + return game.getStack().counter(source.getFirstTarget(), source.getSourceId(), game); + } - @Override - public String getText(Mode mode) { - return "Counter target " + mode.getTargets().get(0).getTargetName(); - } + @Override + public String getText(Mode mode) { + return "Counter target " + mode.getTargets().get(0).getTargetName(); + } } diff --git a/Mage/src/mage/abilities/effects/common/CounterUnlessPaysEffect.java b/Mage/src/mage/abilities/effects/common/CounterUnlessPaysEffect.java index 1de6858b0f..d05152a15c 100644 --- a/Mage/src/mage/abilities/effects/common/CounterUnlessPaysEffect.java +++ b/Mage/src/mage/abilities/effects/common/CounterUnlessPaysEffect.java @@ -43,40 +43,40 @@ import mage.players.Player; */ public class CounterUnlessPaysEffect extends OneShotEffect { - protected Cost cost; + protected Cost cost; - public CounterUnlessPaysEffect(Cost cost) { - super(Outcome.Detriment); - this.cost = cost; - } + public CounterUnlessPaysEffect(Cost cost) { + super(Outcome.Detriment); + this.cost = cost; + } - public CounterUnlessPaysEffect(final CounterUnlessPaysEffect effect) { - super(effect); - this.cost = effect.cost.copy(); - } + public CounterUnlessPaysEffect(final CounterUnlessPaysEffect effect) { + super(effect); + this.cost = effect.cost.copy(); + } - @Override - public CounterUnlessPaysEffect copy() { - return new CounterUnlessPaysEffect(this); - } + @Override + public CounterUnlessPaysEffect copy() { + return new CounterUnlessPaysEffect(this); + } - @Override - public boolean apply(Game game, Ability source) { - StackObject spell = game.getStack().getStackObject(targetPointer.getFirst(game, source)); - if (spell != null) { - Player player = game.getPlayer(spell.getControllerId()); - if (player != null) { - cost.clearPaid(); - if (!cost.pay(source, game, spell.getControllerId(), spell.getControllerId(), false)) { - return game.getStack().counter(source.getFirstTarget(), source.getSourceId(), game); - } - } - } - return false; - } + @Override + public boolean apply(Game game, Ability source) { + StackObject spell = game.getStack().getStackObject(targetPointer.getFirst(game, source)); + if (spell != null) { + Player player = game.getPlayer(spell.getControllerId()); + if (player != null) { + cost.clearPaid(); + if (!cost.pay(source, game, spell.getControllerId(), spell.getControllerId(), false)) { + return game.getStack().counter(source.getFirstTarget(), source.getSourceId(), game); + } + } + } + return false; + } - @Override - public String getText(Mode mode) { + @Override + public String getText(Mode mode) { StringBuilder sb = new StringBuilder(); if (mode.getTargets().size() == 0) { sb.append("counter it"); @@ -85,7 +85,7 @@ public class CounterUnlessPaysEffect extends OneShotEffect { - protected DelayedTriggeredAbility ability; + protected DelayedTriggeredAbility ability; - public CreateDelayedTriggeredAbilityEffect(DelayedTriggeredAbility ability) { - super(ability.getEffects().get(0).getOutcome()); - this.ability = ability; - } + public CreateDelayedTriggeredAbilityEffect(DelayedTriggeredAbility ability) { + super(ability.getEffects().get(0).getOutcome()); + this.ability = ability; + } - public CreateDelayedTriggeredAbilityEffect(final CreateDelayedTriggeredAbilityEffect effect) { - super(effect); - this.ability = effect.ability.copy(); - } + public CreateDelayedTriggeredAbilityEffect(final CreateDelayedTriggeredAbilityEffect effect) { + super(effect); + this.ability = effect.ability.copy(); + } - @Override - public CreateDelayedTriggeredAbilityEffect copy() { - return new CreateDelayedTriggeredAbilityEffect(this); - } + @Override + public CreateDelayedTriggeredAbilityEffect copy() { + return new CreateDelayedTriggeredAbilityEffect(this); + } - @Override - public boolean apply(Game game, Ability source) { - DelayedTriggeredAbility delayedAbility = (DelayedTriggeredAbility) ability.copy(); - delayedAbility.setSourceId(source.getSourceId()); - delayedAbility.setControllerId(source.getControllerId()); - delayedAbility.getTargets().addAll(source.getTargets()); - game.addDelayedTriggeredAbility(delayedAbility); - return true; - } + @Override + public boolean apply(Game game, Ability source) { + DelayedTriggeredAbility delayedAbility = (DelayedTriggeredAbility) ability.copy(); + delayedAbility.setSourceId(source.getSourceId()); + delayedAbility.setControllerId(source.getControllerId()); + delayedAbility.getTargets().addAll(source.getTargets()); + game.addDelayedTriggeredAbility(delayedAbility); + return true; + } - @Override - public String getText(Mode mode) { - return ability.getRule(); - } + @Override + public String getText(Mode mode) { + return ability.getRule(); + } } diff --git a/Mage/src/mage/abilities/effects/common/CreateSpecialActionEffect.java b/Mage/src/mage/abilities/effects/common/CreateSpecialActionEffect.java index aa82cc5782..6994cc0371 100644 --- a/Mage/src/mage/abilities/effects/common/CreateSpecialActionEffect.java +++ b/Mage/src/mage/abilities/effects/common/CreateSpecialActionEffect.java @@ -40,36 +40,36 @@ import mage.game.Game; */ public class CreateSpecialActionEffect extends OneShotEffect { - protected SpecialAction action; + protected SpecialAction action; - public CreateSpecialActionEffect(SpecialAction action) { - super(action.getEffects().get(0).getOutcome()); - this.action = action; - } + public CreateSpecialActionEffect(SpecialAction action) { + super(action.getEffects().get(0).getOutcome()); + this.action = action; + } - public CreateSpecialActionEffect(final CreateSpecialActionEffect effect) { - super(effect); - this.action = (SpecialAction) effect.action.copy(); - } + public CreateSpecialActionEffect(final CreateSpecialActionEffect effect) { + super(effect); + this.action = (SpecialAction) effect.action.copy(); + } - @Override - public CreateSpecialActionEffect copy() { - return new CreateSpecialActionEffect(this); - } + @Override + public CreateSpecialActionEffect copy() { + return new CreateSpecialActionEffect(this); + } - @Override - public boolean apply(Game game, Ability source) { - SpecialAction newAction = (SpecialAction) action.copy(); - newAction.setSourceId(source.getSourceId()); - newAction.setControllerId(source.getControllerId()); - newAction.getTargets().addAll(source.getTargets()); - game.getState().getSpecialActions().add(newAction); - return true; - } + @Override + public boolean apply(Game game, Ability source) { + SpecialAction newAction = (SpecialAction) action.copy(); + newAction.setSourceId(source.getSourceId()); + newAction.setControllerId(source.getControllerId()); + newAction.getTargets().addAll(source.getTargets()); + game.getState().getSpecialActions().add(newAction); + return true; + } - @Override - public String getText(Mode mode) { - return action.getRule(); - } + @Override + public String getText(Mode mode) { + return action.getRule(); + } } diff --git a/Mage/src/mage/abilities/effects/common/CreateTokenEffect.java b/Mage/src/mage/abilities/effects/common/CreateTokenEffect.java index a5c28bf604..f4208fd3f5 100644 --- a/Mage/src/mage/abilities/effects/common/CreateTokenEffect.java +++ b/Mage/src/mage/abilities/effects/common/CreateTokenEffect.java @@ -42,56 +42,56 @@ import mage.game.permanent.token.Token; */ public class CreateTokenEffect extends OneShotEffect { - private Token token; - private DynamicValue amount; + private Token token; + private DynamicValue amount; - public CreateTokenEffect(Token token) { - this(token, new StaticValue(1)); - } + public CreateTokenEffect(Token token) { + this(token, new StaticValue(1)); + } - public CreateTokenEffect(Token token, int amount) { - this(token, new StaticValue(amount)); - } + public CreateTokenEffect(Token token, int amount) { + this(token, new StaticValue(amount)); + } public CreateTokenEffect(Token token, DynamicValue amount) { super(Outcome.PutCreatureInPlay); this.token = token; this.amount = amount.clone(); - setText(); + setText(); } - public CreateTokenEffect(final CreateTokenEffect effect) { - super(effect); - this.amount = effect.amount; - this.token = effect.token.copy(); - } + public CreateTokenEffect(final CreateTokenEffect effect) { + super(effect); + this.amount = effect.amount; + this.token = effect.token.copy(); + } - @Override - public CreateTokenEffect copy() { - return new CreateTokenEffect(this); - } + @Override + public CreateTokenEffect copy() { + return new CreateTokenEffect(this); + } - @Override - public boolean apply(Game game, Ability source) { + @Override + public boolean apply(Game game, Ability source) { int value = amount.calculate(game, source); - token.putOntoBattlefield(value, game, source.getSourceId(), source.getControllerId()); - return true; - } + token.putOntoBattlefield(value, game, source.getSourceId(), source.getControllerId()); + return true; + } - private void setText() { + private void setText() { StringBuilder sb = new StringBuilder("put "); if (amount.toString().equals("1")) { sb.append("a"); } else { sb.append(amount.toString()); } - sb.append(" ").append(token.getDescription()).append(" onto the battlefield"); + sb.append(" ").append(token.getDescription()).append(" onto the battlefield"); String message = amount.getMessage(); if (message.length() > 0) { sb.append(" for each "); } sb.append(message); - staticText = sb.toString(); - } + staticText = sb.toString(); + } } diff --git a/Mage/src/mage/abilities/effects/common/CreateTokenTargetEffect.java b/Mage/src/mage/abilities/effects/common/CreateTokenTargetEffect.java index eee0d7fed7..6d5382599f 100644 --- a/Mage/src/mage/abilities/effects/common/CreateTokenTargetEffect.java +++ b/Mage/src/mage/abilities/effects/common/CreateTokenTargetEffect.java @@ -14,15 +14,15 @@ import mage.game.permanent.token.Token; */ public class CreateTokenTargetEffect extends OneShotEffect { private Token token; - private DynamicValue amount; + private DynamicValue amount; - public CreateTokenTargetEffect(Token token) { - this(token, new StaticValue(1)); - } + public CreateTokenTargetEffect(Token token) { + this(token, new StaticValue(1)); + } - public CreateTokenTargetEffect(Token token, int amount) { - this(token, new StaticValue(amount)); - } + public CreateTokenTargetEffect(Token token, int amount) { + this(token, new StaticValue(amount)); + } public CreateTokenTargetEffect(Token token, DynamicValue amount) { super(Constants.Outcome.PutCreatureInPlay); @@ -30,25 +30,25 @@ public class CreateTokenTargetEffect extends OneShotEffect 0) { sb.append(" for each "); @@ -64,6 +64,6 @@ public class CreateTokenTargetEffect extends OneShotEffect { - private FilterCreaturePermanent filter; - private int amount; + private FilterCreaturePermanent filter; + private int amount; - public DamageAllControlledTargetEffect(int amount, FilterCreaturePermanent filter) { - super(Outcome.Damage); - this.amount = amount; - this.filter = filter; - getText(); - } + public DamageAllControlledTargetEffect(int amount, FilterCreaturePermanent filter) { + super(Outcome.Damage); + this.amount = amount; + this.filter = filter; + getText(); + } - public DamageAllControlledTargetEffect(final DamageAllControlledTargetEffect effect) { - super(effect); - this.amount = effect.amount; - this.filter = effect.filter.copy(); - } + public DamageAllControlledTargetEffect(final DamageAllControlledTargetEffect effect) { + super(effect); + this.amount = effect.amount; + this.filter = effect.filter.copy(); + } - @Override - public DamageAllControlledTargetEffect copy() { - return new DamageAllControlledTargetEffect(this); - } + @Override + public DamageAllControlledTargetEffect copy() { + return new DamageAllControlledTargetEffect(this); + } - @Override - public boolean apply(Game game, Ability source) { - for (Permanent permanent: game.getBattlefield().getAllActivePermanents(filter, source.getFirstTarget(), game)) { - permanent.damage(amount, source.getId(), game, true, false); - } - return true; - } + @Override + public boolean apply(Game game, Ability source) { + for (Permanent permanent: game.getBattlefield().getAllActivePermanents(filter, source.getFirstTarget(), game)) { + permanent.damage(amount, source.getId(), game, true, false); + } + return true; + } private void getText() { StringBuilder sb = new StringBuilder("{this} deals "); diff --git a/Mage/src/mage/abilities/effects/common/DamageAllEffect.java b/Mage/src/mage/abilities/effects/common/DamageAllEffect.java index c1e7a9da45..fae4077ed3 100644 --- a/Mage/src/mage/abilities/effects/common/DamageAllEffect.java +++ b/Mage/src/mage/abilities/effects/common/DamageAllEffect.java @@ -44,40 +44,40 @@ import mage.game.permanent.Permanent; */ public class DamageAllEffect extends OneShotEffect { - private FilterCreaturePermanent filter; - private DynamicValue amount; + private FilterCreaturePermanent filter; + private DynamicValue amount; - public DamageAllEffect(int amount, FilterCreaturePermanent filter) { - this(new StaticValue(amount), filter); - } - public DamageAllEffect(DynamicValue amount, FilterCreaturePermanent filter) { - super(Outcome.Damage); - this.amount = amount; - this.filter = filter; - setText(); - } + public DamageAllEffect(int amount, FilterCreaturePermanent filter) { + this(new StaticValue(amount), filter); + } + public DamageAllEffect(DynamicValue amount, FilterCreaturePermanent filter) { + super(Outcome.Damage); + this.amount = amount; + this.filter = filter; + setText(); + } - public DamageAllEffect(final DamageAllEffect effect) { - super(effect); - this.amount = effect.amount; - this.filter = effect.filter.copy(); - } + public DamageAllEffect(final DamageAllEffect effect) { + super(effect); + this.amount = effect.amount; + this.filter = effect.filter.copy(); + } - @Override - public DamageAllEffect copy() { - return new DamageAllEffect(this); - } + @Override + public DamageAllEffect copy() { + return new DamageAllEffect(this); + } - @Override - public boolean apply(Game game, Ability source) { + @Override + public boolean apply(Game game, Ability source) { List permanents = game.getBattlefield().getActivePermanents(filter, source.getControllerId(), game); - for (Permanent permanent: permanents) { - permanent.damage(amount.calculate(game, source), source.getSourceId(), game, true, false); - } - return true; - } + for (Permanent permanent: permanents) { + permanent.damage(amount.calculate(game, source), source.getSourceId(), game, true, false); + } + return true; + } - private void setText() { + private void setText() { StringBuilder sb = new StringBuilder(); sb.append("{source} deals ").append(amount.toString()).append(" damage to each ").append(filter.getMessage()); String message = amount.getMessage(); @@ -86,6 +86,6 @@ public class DamageAllEffect extends OneShotEffect { } sb.append(message); staticText = sb.toString(); - } + } } diff --git a/Mage/src/mage/abilities/effects/common/DamageControllerEffect.java b/Mage/src/mage/abilities/effects/common/DamageControllerEffect.java index b26fa9a6aa..d20400f73d 100644 --- a/Mage/src/mage/abilities/effects/common/DamageControllerEffect.java +++ b/Mage/src/mage/abilities/effects/common/DamageControllerEffect.java @@ -40,51 +40,51 @@ import mage.players.Player; */ public class DamageControllerEffect extends OneShotEffect { - protected int amount; - protected boolean preventable; + protected int amount; + protected boolean preventable; - public DamageControllerEffect(int amount) { - this(amount, true); - } + public DamageControllerEffect(int amount) { + this(amount, true); + } - public DamageControllerEffect(int amount, boolean preventable) { - super(Outcome.Damage); - this.amount = amount; - this.preventable = preventable; - setText(); - } + public DamageControllerEffect(int amount, boolean preventable) { + super(Outcome.Damage); + this.amount = amount; + this.preventable = preventable; + setText(); + } - public int getAmount() { - return amount; - } + public int getAmount() { + return amount; + } - public DamageControllerEffect(final DamageControllerEffect effect) { - super(effect); - this.amount = effect.amount; - this.preventable = effect.preventable; - } + public DamageControllerEffect(final DamageControllerEffect effect) { + super(effect); + this.amount = effect.amount; + this.preventable = effect.preventable; + } - @Override - public DamageControllerEffect copy() { - return new DamageControllerEffect(this); - } + @Override + public DamageControllerEffect copy() { + return new DamageControllerEffect(this); + } - @Override - public boolean apply(Game game, Ability source) { - Player player = game.getPlayer(source.getControllerId()); - if (player != null) { - player.damage(amount, source.getId(), game, false, preventable); - return true; - } - return false; - } + @Override + public boolean apply(Game game, Ability source) { + Player player = game.getPlayer(source.getControllerId()); + if (player != null) { + player.damage(amount, source.getId(), game, false, preventable); + return true; + } + return false; + } - private void setText() { - StringBuilder sb = new StringBuilder(); - sb.append("{source} deals ").append(Integer.toString(amount)).append(" damage to you"); - if (!preventable) - sb.append(". The damage can't be prevented"); - staticText = sb.toString(); - } + private void setText() { + StringBuilder sb = new StringBuilder(); + sb.append("{source} deals ").append(Integer.toString(amount)).append(" damage to you"); + if (!preventable) + sb.append(". The damage can't be prevented"); + staticText = sb.toString(); + } } diff --git a/Mage/src/mage/abilities/effects/common/DamageEverythingEffect.java b/Mage/src/mage/abilities/effects/common/DamageEverythingEffect.java index b7d681777f..1a232489ec 100644 --- a/Mage/src/mage/abilities/effects/common/DamageEverythingEffect.java +++ b/Mage/src/mage/abilities/effects/common/DamageEverythingEffect.java @@ -44,36 +44,36 @@ import mage.players.Player; */ public class DamageEverythingEffect extends OneShotEffect { - private int amount; + private int amount; - public DamageEverythingEffect(int amount) { - super(Outcome.Damage); - this.amount = amount; - staticText = "{source} deals " + Integer.toString(amount) + " damage to each creature and each player"; - } + public DamageEverythingEffect(int amount) { + super(Outcome.Damage); + this.amount = amount; + staticText = "{source} deals " + Integer.toString(amount) + " damage to each creature and each player"; + } - public DamageEverythingEffect(final DamageEverythingEffect effect) { - super(effect); - this.amount = effect.amount; - } + public DamageEverythingEffect(final DamageEverythingEffect effect) { + super(effect); + this.amount = effect.amount; + } - @Override - public DamageEverythingEffect copy() { - return new DamageEverythingEffect(this); - } + @Override + public DamageEverythingEffect copy() { + return new DamageEverythingEffect(this); + } - @Override - public boolean apply(Game game, Ability source) { + @Override + public boolean apply(Game game, Ability source) { List permanents = game.getBattlefield().getActivePermanents(new FilterCreaturePermanent(), source.getControllerId(), game); - for (Permanent permanent: permanents) { - permanent.damage(amount, source.getId(), game, true, false); - } - for (UUID playerId: game.getPlayer(source.getControllerId()).getInRange()) { - Player player = game.getPlayer(playerId); - if (player != null) - player.damage(amount, source.getId(), game, false, true); - } - return true; - } + for (Permanent permanent: permanents) { + permanent.damage(amount, source.getId(), game, true, false); + } + for (UUID playerId: game.getPlayer(source.getControllerId()).getInRange()) { + Player player = game.getPlayer(playerId); + if (player != null) + player.damage(amount, source.getId(), game, false, true); + } + return true; + } } diff --git a/Mage/src/mage/abilities/effects/common/DamageMultiEffect.java b/Mage/src/mage/abilities/effects/common/DamageMultiEffect.java index 2460c09020..f4b068ef01 100644 --- a/Mage/src/mage/abilities/effects/common/DamageMultiEffect.java +++ b/Mage/src/mage/abilities/effects/common/DamageMultiEffect.java @@ -44,29 +44,29 @@ import mage.target.Target; */ public class DamageMultiEffect extends OneShotEffect { - protected int amount; + protected int amount; - public DamageMultiEffect(int amount) { - super(Outcome.Damage); - this.amount = amount; - } + public DamageMultiEffect(int amount) { + super(Outcome.Damage); + this.amount = amount; + } - public int getAmount() { - return amount; - } + public int getAmount() { + return amount; + } - public DamageMultiEffect(final DamageMultiEffect effect) { - super(effect); - this.amount = effect.amount; - } + public DamageMultiEffect(final DamageMultiEffect effect) { + super(effect); + this.amount = effect.amount; + } - @Override - public DamageMultiEffect copy() { - return new DamageMultiEffect(this); - } + @Override + public DamageMultiEffect copy() { + return new DamageMultiEffect(this); + } - @Override - public boolean apply(Game game, Ability source) { + @Override + public boolean apply(Game game, Ability source) { if (source.getTargets().size() > 0) { Target multiTarget = source.getTargets().get(0); for (UUID target: multiTarget.getTargets()) { @@ -82,16 +82,16 @@ public class DamageMultiEffect extends OneShotEffect { } } } - return true; - } + return true; + } - @Override - public String getText(Mode mode) { - StringBuilder sb = new StringBuilder(); - sb.append("{source} deals ").append(Integer.toString(amount)); - sb.append(" damage divided as you choose among any number of target ").append(mode.getTargets().get(0).getTargetName()); - return sb.toString(); - } + @Override + public String getText(Mode mode) { + StringBuilder sb = new StringBuilder(); + sb.append("{source} deals ").append(Integer.toString(amount)); + sb.append(" damage divided as you choose among any number of target ").append(mode.getTargets().get(0).getTargetName()); + return sb.toString(); + } } diff --git a/Mage/src/mage/abilities/effects/common/DamagePlayersEffect.java b/Mage/src/mage/abilities/effects/common/DamagePlayersEffect.java index 214b7b71fb..22e647d377 100644 --- a/Mage/src/mage/abilities/effects/common/DamagePlayersEffect.java +++ b/Mage/src/mage/abilities/effects/common/DamagePlayersEffect.java @@ -41,30 +41,30 @@ import mage.players.Player; * @author BetaSteward_at_googlemail.com */ public class DamagePlayersEffect extends OneShotEffect { - private DynamicValue amount; + private DynamicValue amount; public DamagePlayersEffect(int amount) { this(Constants.Outcome.Damage, new StaticValue(amount)); - } - - public DamagePlayersEffect(Constants.Outcome outcome, DynamicValue amount) { - super(outcome); - this.amount = amount; - staticText = "{source} deals " + amount + " damage to each player"; - } + } + + public DamagePlayersEffect(Constants.Outcome outcome, DynamicValue amount) { + super(outcome); + this.amount = amount; + staticText = "{source} deals " + amount + " damage to each player"; + } public DamagePlayersEffect(final DamagePlayersEffect effect) { super(effect); - this.amount = effect.amount; + this.amount = effect.amount; } @Override public boolean apply(Game game, Ability source) { - for (UUID playerId: game.getPlayer(source.getControllerId()).getInRange()) { - Player player = game.getPlayer(playerId); - if (player != null) - player.damage(amount.calculate(game, source), source.getId(), game, false, true); - } + for (UUID playerId: game.getPlayer(source.getControllerId()).getInRange()) { + Player player = game.getPlayer(playerId); + if (player != null) + player.damage(amount.calculate(game, source), source.getId(), game, false, true); + } return true; } diff --git a/Mage/src/mage/abilities/effects/common/DamageTargetEffect.java b/Mage/src/mage/abilities/effects/common/DamageTargetEffect.java index fa268a700f..05b7841b76 100644 --- a/Mage/src/mage/abilities/effects/common/DamageTargetEffect.java +++ b/Mage/src/mage/abilities/effects/common/DamageTargetEffect.java @@ -45,21 +45,21 @@ import mage.players.Player; */ public class DamageTargetEffect extends OneShotEffect { - protected DynamicValue amount; - protected boolean preventable; + protected DynamicValue amount; + protected boolean preventable; protected String targetDescription; - public DamageTargetEffect(int amount) { - this(new StaticValue(amount), true); - } + public DamageTargetEffect(int amount) { + this(new StaticValue(amount), true); + } - public DamageTargetEffect(int amount, boolean preventable) { - this(new StaticValue(amount), preventable); - } + public DamageTargetEffect(int amount, boolean preventable) { + this(new StaticValue(amount), preventable); + } public DamageTargetEffect(int amount, boolean preventable, String targetDescription) { - this(new StaticValue(amount), preventable, targetDescription); - } + this(new StaticValue(amount), preventable, targetDescription); + } public DamageTargetEffect(DynamicValue amount) { this(amount, true); @@ -71,49 +71,49 @@ public class DamageTargetEffect extends OneShotEffect { public DamageTargetEffect(DynamicValue amount, boolean preventable, String targetDescription) { super(Outcome.Damage); - this.amount = amount; - this.preventable = preventable; + this.amount = amount; + this.preventable = preventable; this.targetDescription = targetDescription; } - public int getAmount() { + public int getAmount() { if (amount instanceof StaticValue) { return amount.calculate(null, null); } else { return 0; } - } + } public void setAmount(DynamicValue amount) { this.amount = amount; } - public DamageTargetEffect(final DamageTargetEffect effect) { - super(effect); - this.amount = effect.amount.clone(); - this.preventable = effect.preventable; + public DamageTargetEffect(final DamageTargetEffect effect) { + super(effect); + this.amount = effect.amount.clone(); + this.preventable = effect.preventable; this.targetDescription = effect.targetDescription; - } + } - @Override - public DamageTargetEffect copy() { - return new DamageTargetEffect(this); - } + @Override + public DamageTargetEffect copy() { + return new DamageTargetEffect(this); + } - @Override - public boolean apply(Game game, Ability source) { - Permanent permanent = game.getPermanent(targetPointer.getFirst(game, source)); - if (permanent != null) { - permanent.damage(amount.calculate(game, source), source.getSourceId(), game, preventable, false); - return true; - } - Player player = game.getPlayer(targetPointer.getFirst(game, source)); - if (player != null) { - player.damage(amount.calculate(game, source), source.getSourceId(), game, false, preventable); - return true; - } - return false; - } + @Override + public boolean apply(Game game, Ability source) { + Permanent permanent = game.getPermanent(targetPointer.getFirst(game, source)); + if (permanent != null) { + permanent.damage(amount.calculate(game, source), source.getSourceId(), game, preventable, false); + return true; + } + Player player = game.getPlayer(targetPointer.getFirst(game, source)); + if (player != null) { + player.damage(amount.calculate(game, source), source.getSourceId(), game, false, preventable); + return true; + } + return false; + } @Override public String getText(Mode mode) { diff --git a/Mage/src/mage/abilities/effects/common/DestroyAllControlledTargetEffect.java b/Mage/src/mage/abilities/effects/common/DestroyAllControlledTargetEffect.java index 37fe042c12..54c9bb0475 100644 --- a/Mage/src/mage/abilities/effects/common/DestroyAllControlledTargetEffect.java +++ b/Mage/src/mage/abilities/effects/common/DestroyAllControlledTargetEffect.java @@ -41,30 +41,30 @@ import mage.game.permanent.Permanent; */ public class DestroyAllControlledTargetEffect extends OneShotEffect { - private FilterPermanent filter; + private FilterPermanent filter; - public DestroyAllControlledTargetEffect(FilterPermanent filter) { - super(Outcome.DestroyPermanent); - this.filter = filter; - staticText = "Destroy all " + filter.getMessage() + " controlled by target player"; - } + public DestroyAllControlledTargetEffect(FilterPermanent filter) { + super(Outcome.DestroyPermanent); + this.filter = filter; + staticText = "Destroy all " + filter.getMessage() + " controlled by target player"; + } - public DestroyAllControlledTargetEffect(final DestroyAllControlledTargetEffect effect) { - super(effect); - this.filter = effect.filter.copy(); - } + public DestroyAllControlledTargetEffect(final DestroyAllControlledTargetEffect effect) { + super(effect); + this.filter = effect.filter.copy(); + } - @Override - public DestroyAllControlledTargetEffect copy() { - return new DestroyAllControlledTargetEffect(this); - } + @Override + public DestroyAllControlledTargetEffect copy() { + return new DestroyAllControlledTargetEffect(this); + } - @Override - public boolean apply(Game game, Ability source) { - for (Permanent permanent: game.getBattlefield().getAllActivePermanents(filter, source.getFirstTarget(), game)) { - permanent.destroy(source.getId(), game, false); - } - return true; - } + @Override + public boolean apply(Game game, Ability source) { + for (Permanent permanent: game.getBattlefield().getAllActivePermanents(filter, source.getFirstTarget(), game)) { + permanent.destroy(source.getId(), game, false); + } + return true; + } } diff --git a/Mage/src/mage/abilities/effects/common/DestroyAllNamedPermanentsEffect.java b/Mage/src/mage/abilities/effects/common/DestroyAllNamedPermanentsEffect.java index a7b1a12014..f0f3ac1c90 100644 --- a/Mage/src/mage/abilities/effects/common/DestroyAllNamedPermanentsEffect.java +++ b/Mage/src/mage/abilities/effects/common/DestroyAllNamedPermanentsEffect.java @@ -41,36 +41,36 @@ import mage.game.permanent.Permanent; */ public class DestroyAllNamedPermanentsEffect extends OneShotEffect { - public DestroyAllNamedPermanentsEffect() { - super(Outcome.DestroyPermanent); - } + public DestroyAllNamedPermanentsEffect() { + super(Outcome.DestroyPermanent); + } - public DestroyAllNamedPermanentsEffect(final DestroyAllNamedPermanentsEffect effect) { - super(effect); - } + public DestroyAllNamedPermanentsEffect(final DestroyAllNamedPermanentsEffect effect) { + super(effect); + } - @Override - public DestroyAllNamedPermanentsEffect copy() { - return new DestroyAllNamedPermanentsEffect(this); - } + @Override + public DestroyAllNamedPermanentsEffect copy() { + return new DestroyAllNamedPermanentsEffect(this); + } - @Override - public boolean apply(Game game, Ability source) { - Permanent permanent = game.getPermanent(source.getFirstTarget()); - String name = permanent.getName(); + @Override + public boolean apply(Game game, Ability source) { + Permanent permanent = game.getPermanent(source.getFirstTarget()); + String name = permanent.getName(); - permanent.destroy(source.getSourceId(), game, false); - for (Permanent perm: game.getBattlefield().getActivePermanents(source.getControllerId(), game)) { - if (perm.getName().equals(name)) - perm.destroy(source.getId(), game, false); - } + permanent.destroy(source.getSourceId(), game, false); + for (Permanent perm: game.getBattlefield().getActivePermanents(source.getControllerId(), game)) { + if (perm.getName().equals(name)) + perm.destroy(source.getId(), game, false); + } - return true; - } + return true; + } - @Override - public String getText(Mode mode) { - return "Destroy target " + mode.getTargets().get(0).getTargetName() + " and all other permanents with the same name as that permanent"; - } + @Override + public String getText(Mode mode) { + return "Destroy target " + mode.getTargets().get(0).getTargetName() + " and all other permanents with the same name as that permanent"; + } } diff --git a/Mage/src/mage/abilities/effects/common/DestroyMultiTargetEffect.java b/Mage/src/mage/abilities/effects/common/DestroyMultiTargetEffect.java index 8f4b66a6e8..18ee0812ef 100644 --- a/Mage/src/mage/abilities/effects/common/DestroyMultiTargetEffect.java +++ b/Mage/src/mage/abilities/effects/common/DestroyMultiTargetEffect.java @@ -42,41 +42,41 @@ import mage.target.Target; * @author BetaSteward_at_googlemail.com */ public class DestroyMultiTargetEffect extends OneShotEffect { - protected boolean noRegen; + protected boolean noRegen; - public DestroyMultiTargetEffect() { - this(false); - } - - public DestroyMultiTargetEffect(boolean noRegen) { - super(Outcome.DestroyPermanent); - this.noRegen = noRegen; - } + public DestroyMultiTargetEffect() { + this(false); + } - public DestroyMultiTargetEffect(final DestroyMultiTargetEffect effect) { - super(effect); - this.noRegen = effect.noRegen; - } + public DestroyMultiTargetEffect(boolean noRegen) { + super(Outcome.DestroyPermanent); + this.noRegen = noRegen; + } - @Override - public DestroyMultiTargetEffect copy() { - return new DestroyMultiTargetEffect(this); - } + public DestroyMultiTargetEffect(final DestroyMultiTargetEffect effect) { + super(effect); + this.noRegen = effect.noRegen; + } - @Override - public boolean apply(Game game, Ability source) { + @Override + public DestroyMultiTargetEffect copy() { + return new DestroyMultiTargetEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { int affectedTargets = 0; - for (Target target: source.getTargets()) { - for (UUID permanentId: target.getTargets()) { - Permanent permanent = game.getPermanent(permanentId); - if (permanent != null) { - permanent.destroy(source.getId(), game, noRegen); - affectedTargets++; - } - } - } - return affectedTargets > 0; - } + for (Target target: source.getTargets()) { + for (UUID permanentId: target.getTargets()) { + Permanent permanent = game.getPermanent(permanentId); + if (permanent != null) { + permanent.destroy(source.getId(), game, noRegen); + affectedTargets++; + } + } + } + return affectedTargets > 0; + } @Override public String getText(Mode mode) { diff --git a/Mage/src/mage/abilities/effects/common/DestroySourceEffect.java b/Mage/src/mage/abilities/effects/common/DestroySourceEffect.java index 49b6acae91..e0b8e20a26 100644 --- a/Mage/src/mage/abilities/effects/common/DestroySourceEffect.java +++ b/Mage/src/mage/abilities/effects/common/DestroySourceEffect.java @@ -40,36 +40,36 @@ import mage.game.permanent.Permanent; */ public class DestroySourceEffect extends OneShotEffect { - protected boolean noRegen; + protected boolean noRegen; - public DestroySourceEffect() { - this(false); - } + public DestroySourceEffect() { + this(false); + } - public DestroySourceEffect(boolean noRegen) { - super(Outcome.DestroyPermanent); - this.noRegen = noRegen; - staticText = "Destroy {this}"; - } + public DestroySourceEffect(boolean noRegen) { + super(Outcome.DestroyPermanent); + this.noRegen = noRegen; + staticText = "Destroy {this}"; + } - public DestroySourceEffect(final DestroySourceEffect effect) { - super(effect); - this.noRegen = effect.noRegen; - } + public DestroySourceEffect(final DestroySourceEffect effect) { + super(effect); + this.noRegen = effect.noRegen; + } - @Override - public DestroySourceEffect copy() { - return new DestroySourceEffect(this); - } + @Override + public DestroySourceEffect copy() { + return new DestroySourceEffect(this); + } - @Override - public boolean apply(Game game, Ability source) { - Permanent permanent = game.getPermanent(source.getSourceId()); - if (permanent != null) { - permanent.destroy(source.getId(), game, noRegen); - return true; - } - return false; - } + @Override + public boolean apply(Game game, Ability source) { + Permanent permanent = game.getPermanent(source.getSourceId()); + if (permanent != null) { + permanent.destroy(source.getId(), game, noRegen); + return true; + } + return false; + } } diff --git a/Mage/src/mage/abilities/effects/common/DestroyTargetEffect.java b/Mage/src/mage/abilities/effects/common/DestroyTargetEffect.java index 98ca28b0c2..5767b376bc 100644 --- a/Mage/src/mage/abilities/effects/common/DestroyTargetEffect.java +++ b/Mage/src/mage/abilities/effects/common/DestroyTargetEffect.java @@ -44,34 +44,34 @@ import java.util.UUID; */ public class DestroyTargetEffect extends OneShotEffect { - protected boolean noRegen; + protected boolean noRegen; - public DestroyTargetEffect() { - this(false); - } + public DestroyTargetEffect() { + this(false); + } public DestroyTargetEffect(String ruleText) { this(false); staticText = ruleText; } - - public DestroyTargetEffect(boolean noRegen) { - super(Outcome.DestroyPermanent); - this.noRegen = noRegen; - } - public DestroyTargetEffect(final DestroyTargetEffect effect) { - super(effect); - this.noRegen = effect.noRegen; - } + public DestroyTargetEffect(boolean noRegen) { + super(Outcome.DestroyPermanent); + this.noRegen = noRegen; + } - @Override - public DestroyTargetEffect copy() { - return new DestroyTargetEffect(this); - } + public DestroyTargetEffect(final DestroyTargetEffect effect) { + super(effect); + this.noRegen = effect.noRegen; + } - @Override - public boolean apply(Game game, Ability source) { + @Override + public DestroyTargetEffect copy() { + return new DestroyTargetEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { int affectedTargets = 0; if (source.getTargets().size() > 1) { // for Rain of Thorns for (Target target : source.getTargets()) { @@ -85,19 +85,19 @@ public class DestroyTargetEffect extends OneShotEffect { } } else if (targetPointer.getTargets(game, source).size() > 0) { - for (UUID permanentId : targetPointer.getTargets(game, source)) { - Permanent permanent = game.getPermanent(permanentId); - if (permanent != null) { - permanent.destroy(source.getId(), game, noRegen); - affectedTargets++; - } - } - } - return affectedTargets > 0; - } + for (UUID permanentId : targetPointer.getTargets(game, source)) { + Permanent permanent = game.getPermanent(permanentId); + if (permanent != null) { + permanent.destroy(source.getId(), game, noRegen); + affectedTargets++; + } + } + } + return affectedTargets > 0; + } - @Override - public String getText(Mode mode) { + @Override + public String getText(Mode mode) { if (staticText != null && !staticText.isEmpty()) { return staticText; } @@ -111,6 +111,6 @@ public class DestroyTargetEffect extends OneShotEffect { if (noRegen) sb.append(". It can't be regenerated"); return sb.toString(); - } + } } diff --git a/Mage/src/mage/abilities/effects/common/DiscardControllerEffect.java b/Mage/src/mage/abilities/effects/common/DiscardControllerEffect.java index f6604b018a..ad795c5fe1 100644 --- a/Mage/src/mage/abilities/effects/common/DiscardControllerEffect.java +++ b/Mage/src/mage/abilities/effects/common/DiscardControllerEffect.java @@ -46,7 +46,7 @@ public class DiscardControllerEffect extends OneShotEffect { protected DynamicValue amount; - protected boolean randomDiscard; + protected boolean randomDiscard; public DiscardTargetEffect(DynamicValue amount) { this(amount, false); } - public DiscardTargetEffect(DynamicValue amount, boolean randomDiscard) { + public DiscardTargetEffect(DynamicValue amount, boolean randomDiscard) { super(Outcome.Discard); - this.randomDiscard = randomDiscard; + this.randomDiscard = randomDiscard; this.amount = amount; } @@ -67,7 +67,7 @@ public class DiscardTargetEffect extends OneShotEffect { public DiscardTargetEffect(final DiscardTargetEffect effect) { super(effect); this.amount = effect.amount.clone(); - this.randomDiscard = effect.randomDiscard; + this.randomDiscard = effect.randomDiscard; } @Override @@ -79,32 +79,32 @@ public class DiscardTargetEffect extends OneShotEffect { public boolean apply(Game game, Ability source) { Player player = game.getPlayer(targetPointer.getFirst(game, source)); if (player != null) { - if (randomDiscard) { - int maxAmount = Math.min(amount.calculate(game, source), player.getHand().size()); - for (int i = 0; i < maxAmount; i++) { - Card card = player.getHand().getRandom(game); - if (card != null) { - player.discard(card, source, game); - } - } - } else { - player.discard(amount.calculate(game, source), source, game); - } - + if (randomDiscard) { + int maxAmount = Math.min(amount.calculate(game, source), player.getHand().size()); + for (int i = 0; i < maxAmount; i++) { + Card card = player.getHand().getRandom(game); + if (card != null) { + player.discard(card, source, game); + } + } + } else { + player.discard(amount.calculate(game, source), source, game); + } + return true; } return false; } - @Override - public String getText(Mode mode) { + @Override + public String getText(Mode mode) { StringBuilder sb = new StringBuilder(); - if(mode.getTargets().isEmpty()){ - sb.append("that player"); - } else { - sb.append("Target ").append(mode.getTargets().get(0).getTargetName()); - } - sb.append(" discards "); + if(mode.getTargets().isEmpty()){ + sb.append("that player"); + } else { + sb.append("Target ").append(mode.getTargets().get(0).getTargetName()); + } + sb.append(" discards "); sb.append(amount).append(" card"); try { if (Integer.parseInt(amount.toString()) > 1) { @@ -113,14 +113,14 @@ public class DiscardTargetEffect extends OneShotEffect { } catch (Exception e) { sb.append("s"); } - if (randomDiscard) { - sb.append(" at random"); - } + if (randomDiscard) { + sb.append(" at random"); + } String message = amount.getMessage(); if (message.length() > 0) { sb.append(" for each "); } sb.append(message); return sb.toString(); - } + } } diff --git a/Mage/src/mage/abilities/effects/common/DoIfCostPaid.java b/Mage/src/mage/abilities/effects/common/DoIfCostPaid.java index 3d75ac1223..1884265920 100644 --- a/Mage/src/mage/abilities/effects/common/DoIfCostPaid.java +++ b/Mage/src/mage/abilities/effects/common/DoIfCostPaid.java @@ -27,17 +27,17 @@ public class DoIfCostPaid extends OneShotEffect { @Override public boolean apply(Game game, Ability source) { Player player = game.getPlayer(source.getControllerId()); - if (player != null) { - if (player.chooseUse(executingEffect.getOutcome(), "Pay " + cost.getText() + " and " + executingEffect.getText(source.getModes().getMode()), game)) { - cost.clearPaid(); - if (cost.pay(source, game, source.getId(), source.getControllerId(), false)) { + if (player != null) { + if (player.chooseUse(executingEffect.getOutcome(), "Pay " + cost.getText() + " and " + executingEffect.getText(source.getModes().getMode()), game)) { + cost.clearPaid(); + if (cost.pay(source, game, source.getId(), source.getControllerId(), false)) { executingEffect.setTargetPointer(this.targetPointer); return executingEffect.apply(game, source); } - } - return true; - } - return false; + } + return true; + } + return false; } @Override diff --git a/Mage/src/mage/abilities/effects/common/DrawCardAllEffect.java b/Mage/src/mage/abilities/effects/common/DrawCardAllEffect.java index a26d750a9f..73fc4589b5 100644 --- a/Mage/src/mage/abilities/effects/common/DrawCardAllEffect.java +++ b/Mage/src/mage/abilities/effects/common/DrawCardAllEffect.java @@ -41,34 +41,34 @@ import mage.players.Player; */ public class DrawCardAllEffect extends OneShotEffect { - protected int amount; + protected int amount; - public DrawCardAllEffect(int amount) { - super(Outcome.DrawCard); - this.amount = amount; - staticText = "Each player draws " + Integer.toString(amount) + " card" + (amount == 1?"":"s"); - } + public DrawCardAllEffect(int amount) { + super(Outcome.DrawCard); + this.amount = amount; + staticText = "Each player draws " + Integer.toString(amount) + " card" + (amount == 1?"":"s"); + } - public DrawCardAllEffect(final DrawCardAllEffect effect) { - super(effect); - this.amount = effect.amount; - } + public DrawCardAllEffect(final DrawCardAllEffect effect) { + super(effect); + this.amount = effect.amount; + } - @Override - public DrawCardAllEffect copy() { - return new DrawCardAllEffect(this); - } + @Override + public DrawCardAllEffect copy() { + return new DrawCardAllEffect(this); + } - @Override - public boolean apply(Game game, Ability source) { + @Override + public boolean apply(Game game, Ability source) { - Player sourcePlayer = game.getPlayer(source.getControllerId()); - for (UUID playerId: sourcePlayer.getInRange()) { - Player player = game.getPlayer(playerId); - if (player != null) - player.drawCards(amount, game); - } - return true; - } + Player sourcePlayer = game.getPlayer(source.getControllerId()); + for (UUID playerId: sourcePlayer.getInRange()) { + Player player = game.getPlayer(playerId); + if (player != null) + player.drawCards(amount, game); + } + return true; + } } diff --git a/Mage/src/mage/abilities/effects/common/DrawCardControllerEffect.java b/Mage/src/mage/abilities/effects/common/DrawCardControllerEffect.java index f4591a22cd..9598ecb9da 100644 --- a/Mage/src/mage/abilities/effects/common/DrawCardControllerEffect.java +++ b/Mage/src/mage/abilities/effects/common/DrawCardControllerEffect.java @@ -42,53 +42,53 @@ import mage.players.Player; */ public class DrawCardControllerEffect extends OneShotEffect { - protected DynamicValue amount; + protected DynamicValue amount; - public DrawCardControllerEffect(int amount) { - this(new StaticValue(amount)); - } + public DrawCardControllerEffect(int amount) { + this(new StaticValue(amount)); + } - public DrawCardControllerEffect(DynamicValue amount) { - super(Outcome.DrawCard); - this.amount = amount.clone(); - setText(); - } + public DrawCardControllerEffect(DynamicValue amount) { + super(Outcome.DrawCard); + this.amount = amount.clone(); + setText(); + } - public DrawCardControllerEffect(final DrawCardControllerEffect effect) { - super(effect); - this.amount = effect.amount.clone(); - } + public DrawCardControllerEffect(final DrawCardControllerEffect effect) { + super(effect); + this.amount = effect.amount.clone(); + } - @Override - public DrawCardControllerEffect copy() { - return new DrawCardControllerEffect(this); - } + @Override + public DrawCardControllerEffect copy() { + return new DrawCardControllerEffect(this); + } - @Override - public boolean apply(Game game, Ability source) { - Player player = game.getPlayer(source.getControllerId()); - if (player != null) { - player.drawCards(amount.calculate(game, source), game); - return true; - } - return false; - } + @Override + public boolean apply(Game game, Ability source) { + Player player = game.getPlayer(source.getControllerId()); + if (player != null) { + player.drawCards(amount.calculate(game, source), game); + return true; + } + return false; + } - private void setText() { - StringBuilder sb = new StringBuilder(); - boolean oneCard = (amount instanceof StaticValue && amount.calculate(null, null) == 1) + private void setText() { + StringBuilder sb = new StringBuilder(); + boolean oneCard = (amount instanceof StaticValue && amount.calculate(null, null) == 1) || amount instanceof PermanentsOnBattlefieldCount; - sb.append("draw ").append(oneCard ? "a" : amount).append(" card"); - if (!oneCard) { - sb.append("s"); - } + sb.append("draw ").append(oneCard ? "a" : amount).append(" card"); + if (!oneCard) { + sb.append("s"); + } String message = amount.getMessage(); - if (message.length() > 0) { - sb.append(" for each "); - } - sb.append(message); - staticText = sb.toString(); - } + if (message.length() > 0) { + sb.append(" for each "); + } + sb.append(message); + staticText = sb.toString(); + } } diff --git a/Mage/src/mage/abilities/effects/common/DrawCardTargetEffect.java b/Mage/src/mage/abilities/effects/common/DrawCardTargetEffect.java index f43de6d379..b7e5919043 100644 --- a/Mage/src/mage/abilities/effects/common/DrawCardTargetEffect.java +++ b/Mage/src/mage/abilities/effects/common/DrawCardTargetEffect.java @@ -43,46 +43,46 @@ import mage.players.Player; */ public class DrawCardTargetEffect extends OneShotEffect { - protected DynamicValue amount; + protected DynamicValue amount; public DrawCardTargetEffect(int amount) { this(new StaticValue(amount)); } - public DrawCardTargetEffect(DynamicValue amount) { - super(Outcome.DrawCard); - this.amount = amount.clone(); - } + public DrawCardTargetEffect(DynamicValue amount) { + super(Outcome.DrawCard); + this.amount = amount.clone(); + } - public DrawCardTargetEffect(final DrawCardTargetEffect effect) { - super(effect); - this.amount = effect.amount.clone(); - } + public DrawCardTargetEffect(final DrawCardTargetEffect effect) { + super(effect); + this.amount = effect.amount.clone(); + } - @Override - public DrawCardTargetEffect copy() { - return new DrawCardTargetEffect(this); - } + @Override + public DrawCardTargetEffect copy() { + return new DrawCardTargetEffect(this); + } - @Override - public boolean apply(Game game, Ability source) { - Player player = game.getPlayer(targetPointer.getFirst(game, source)); - if (player != null) { - player.drawCards(amount.calculate(game, source), game); - return true; - } - return false; - } + @Override + public boolean apply(Game game, Ability source) { + Player player = game.getPlayer(targetPointer.getFirst(game, source)); + if (player != null) { + player.drawCards(amount.calculate(game, source), game); + return true; + } + return false; + } - @Override - public String getText(Mode mode) { - StringBuilder sb = new StringBuilder(); + @Override + public String getText(Mode mode) { + StringBuilder sb = new StringBuilder(); if (mode.getTargets().size() > 0) { - sb.append("Target ").append(mode.getTargets().get(0).getTargetName()); + sb.append("Target ").append(mode.getTargets().get(0).getTargetName()); } else { sb.append("that player"); } - sb.append(" draws ").append(amount).append(" card"); + sb.append(" draws ").append(amount).append(" card"); try { if (Integer.parseInt(amount.toString()) > 1) { sb.append("s"); @@ -95,8 +95,8 @@ public class DrawCardTargetEffect extends OneShotEffect { sb.append(" for each "); } sb.append(message); - return sb.toString(); - } + return sb.toString(); + } } diff --git a/Mage/src/mage/abilities/effects/common/DrawDiscardControllerEffect.java b/Mage/src/mage/abilities/effects/common/DrawDiscardControllerEffect.java index e6485a78df..ce6a392b71 100644 --- a/Mage/src/mage/abilities/effects/common/DrawDiscardControllerEffect.java +++ b/Mage/src/mage/abilities/effects/common/DrawDiscardControllerEffect.java @@ -40,29 +40,29 @@ import mage.players.Player; */ public class DrawDiscardControllerEffect extends OneShotEffect { - public DrawDiscardControllerEffect() { - super(Outcome.DrawCard); - staticText = "Draw a card, then discard a card"; - } + public DrawDiscardControllerEffect() { + super(Outcome.DrawCard); + staticText = "Draw a card, then discard a card"; + } - public DrawDiscardControllerEffect(final DrawDiscardControllerEffect effect) { - super(effect); - } + public DrawDiscardControllerEffect(final DrawDiscardControllerEffect effect) { + super(effect); + } - @Override - public DrawDiscardControllerEffect copy() { - return new DrawDiscardControllerEffect(this); - } + @Override + public DrawDiscardControllerEffect copy() { + return new DrawDiscardControllerEffect(this); + } - @Override - public boolean apply(Game game, Ability source) { - Player player = game.getPlayer(source.getControllerId()); - if (player != null) { - player.drawCards(1, game); - player.discard(1, source, game); - return true; - } - return false; - } + @Override + public boolean apply(Game game, Ability source) { + Player player = game.getPlayer(source.getControllerId()); + if (player != null) { + player.drawCards(1, game); + player.discard(1, source, game); + return true; + } + return false; + } } diff --git a/Mage/src/mage/abilities/effects/common/ExileFromZoneTargetEffect.java b/Mage/src/mage/abilities/effects/common/ExileFromZoneTargetEffect.java index 6eba2499a4..432384a97a 100644 --- a/Mage/src/mage/abilities/effects/common/ExileFromZoneTargetEffect.java +++ b/Mage/src/mage/abilities/effects/common/ExileFromZoneTargetEffect.java @@ -51,11 +51,11 @@ public class ExileFromZoneTargetEffect extends OneShotEffect { - public ExileSourceEffect() { - super(Outcome.Exile); - staticText = "Exile {this}"; - } + public ExileSourceEffect() { + super(Outcome.Exile); + staticText = "Exile {this}"; + } - public ExileSourceEffect(final ExileSourceEffect effect) { - super(effect); - } + public ExileSourceEffect(final ExileSourceEffect effect) { + super(effect); + } - @Override - public ExileSourceEffect copy() { - return new ExileSourceEffect(this); - } + @Override + public ExileSourceEffect copy() { + return new ExileSourceEffect(this); + } - @Override - public boolean apply(Game game, Ability source) { - Permanent permanent = game.getPermanent(source.getSourceId()); - if (permanent != null) { - return permanent.moveToExile(null, "", source.getId(), game); - } else { + @Override + public boolean apply(Game game, Ability source) { + Permanent permanent = game.getPermanent(source.getSourceId()); + if (permanent != null) { + return permanent.moveToExile(null, "", source.getId(), game); + } else { // try to exile card Card card = game.getCard(source.getSourceId()); if (card != null) { return card.moveToExile(null, "", source.getId(), game); } } - return false; - } + return false; + } } diff --git a/Mage/src/mage/abilities/effects/common/ExileSpellEffect.java b/Mage/src/mage/abilities/effects/common/ExileSpellEffect.java index 40705d90b9..fcca14a427 100644 --- a/Mage/src/mage/abilities/effects/common/ExileSpellEffect.java +++ b/Mage/src/mage/abilities/effects/common/ExileSpellEffect.java @@ -41,27 +41,27 @@ import mage.game.Game; */ public class ExileSpellEffect extends PostResolveEffect { - private static final ExileSpellEffect fINSTANCE = new ExileSpellEffect(); + private static final ExileSpellEffect fINSTANCE = new ExileSpellEffect(); - private Object readResolve() throws ObjectStreamException { - return fINSTANCE; - } + private Object readResolve() throws ObjectStreamException { + return fINSTANCE; + } - private ExileSpellEffect() { - staticText = "Exile {this}"; - } - - public static ExileSpellEffect getInstance() { - return fINSTANCE; - } + private ExileSpellEffect() { + staticText = "Exile {this}"; + } - @Override - public ExileSpellEffect copy() { - return fINSTANCE; - } + public static ExileSpellEffect getInstance() { + return fINSTANCE; + } - @Override - public void postResolve(Card card, Ability source, UUID controllerId, Game game) { + @Override + public ExileSpellEffect copy() { + return fINSTANCE; + } + + @Override + public void postResolve(Card card, Ability source, UUID controllerId, Game game) { card.moveToExile(null, "", source.getSourceId(), game); - } + } } diff --git a/Mage/src/mage/abilities/effects/common/ExileTargetEffect.java b/Mage/src/mage/abilities/effects/common/ExileTargetEffect.java index 719ce0ff14..709c9c6607 100644 --- a/Mage/src/mage/abilities/effects/common/ExileTargetEffect.java +++ b/Mage/src/mage/abilities/effects/common/ExileTargetEffect.java @@ -44,53 +44,53 @@ import java.util.UUID; */ public class ExileTargetEffect extends OneShotEffect { - private String exileZone = null; - private UUID exileId = null; + private String exileZone = null; + private UUID exileId = null; - public ExileTargetEffect(UUID exileId, String exileZone) { - this(); - this.exileZone = exileZone; - this.exileId = exileId; - } + public ExileTargetEffect(UUID exileId, String exileZone) { + this(); + this.exileZone = exileZone; + this.exileId = exileId; + } public ExileTargetEffect(String exileZone) { this(); this.exileZone = exileZone; } - public ExileTargetEffect() { - super(Outcome.Exile); - } + public ExileTargetEffect() { + super(Outcome.Exile); + } - public ExileTargetEffect(final ExileTargetEffect effect) { - super(effect); - this.exileZone = effect.exileZone; - this.exileId = effect.exileId; - } + public ExileTargetEffect(final ExileTargetEffect effect) { + super(effect); + this.exileZone = effect.exileZone; + this.exileId = effect.exileId; + } @Override - public ExileTargetEffect copy() { - return new ExileTargetEffect(this); - } + public ExileTargetEffect copy() { + return new ExileTargetEffect(this); + } - @Override - public boolean apply(Game game, Ability source) { - Permanent permanent = game.getPermanent(targetPointer.getFirst(game, source)); + @Override + public boolean apply(Game game, Ability source) { + Permanent permanent = game.getPermanent(targetPointer.getFirst(game, source)); if (exileId == null) { exileId = getId(); } - if (permanent != null) { - return permanent.moveToExile(exileId, exileZone, source.getSourceId(), game); - } else { + if (permanent != null) { + return permanent.moveToExile(exileId, exileZone, source.getSourceId(), game); + } else { Card card = game.getCard(targetPointer.getFirst(game, source)); if (card != null) { return card.moveToExile(exileId, exileZone, source.getSourceId(), game); } } return false; - } + } @Override public String getText(Mode mode) { diff --git a/Mage/src/mage/abilities/effects/common/ExileTargetForSourceEffect.java b/Mage/src/mage/abilities/effects/common/ExileTargetForSourceEffect.java index 5ebdb8ec61..9101ecb6e5 100644 --- a/Mage/src/mage/abilities/effects/common/ExileTargetForSourceEffect.java +++ b/Mage/src/mage/abilities/effects/common/ExileTargetForSourceEffect.java @@ -43,41 +43,41 @@ import mage.game.permanent.Permanent; */ public class ExileTargetForSourceEffect extends OneShotEffect { - private String exileZone = null; + private String exileZone = null; - public ExileTargetForSourceEffect(String exileZone) { - this(); - this.exileZone = exileZone; - } + public ExileTargetForSourceEffect(String exileZone) { + this(); + this.exileZone = exileZone; + } - public ExileTargetForSourceEffect() { - super(Outcome.Exile); - } + public ExileTargetForSourceEffect() { + super(Outcome.Exile); + } - public ExileTargetForSourceEffect(final ExileTargetForSourceEffect effect) { - super(effect); - this.exileZone = effect.exileZone; - } + public ExileTargetForSourceEffect(final ExileTargetForSourceEffect effect) { + super(effect); + this.exileZone = effect.exileZone; + } - @Override - public ExileTargetForSourceEffect copy() { - return new ExileTargetForSourceEffect(this); - } + @Override + public ExileTargetForSourceEffect copy() { + return new ExileTargetForSourceEffect(this); + } - @Override - public boolean apply(Game game, Ability source) { - Permanent permanent = game.getPermanent(targetPointer.getFirst(game, source)); - UUID exileId = source.getSourceId(); - if (permanent != null) { - return permanent.moveToExile(exileId, exileZone, source.getId(), game); - } else { + @Override + public boolean apply(Game game, Ability source) { + Permanent permanent = game.getPermanent(targetPointer.getFirst(game, source)); + UUID exileId = source.getSourceId(); + if (permanent != null) { + return permanent.moveToExile(exileId, exileZone, source.getId(), game); + } else { Card card = game.getCard(targetPointer.getFirst(game, source)); if (card != null) { return card.moveToExile(exileId, exileZone, source.getId(), game); } } return false; - } + } @Override public String getText(Mode mode) { diff --git a/Mage/src/mage/abilities/effects/common/FightTargetsEffect.java b/Mage/src/mage/abilities/effects/common/FightTargetsEffect.java index 7816385c20..25c584ff9f 100644 --- a/Mage/src/mage/abilities/effects/common/FightTargetsEffect.java +++ b/Mage/src/mage/abilities/effects/common/FightTargetsEffect.java @@ -44,11 +44,11 @@ public class FightTargetsEffect extends OneShotEffect { public FightTargetsEffect() { super(Outcome.Damage); } - + public FightTargetsEffect(final FightTargetsEffect effect) { super(effect); } - + @Override public boolean apply(Game game, Ability source) { Permanent creature1 = game.getPermanent(source.getTargets().get(0).getFirstTarget()); @@ -68,10 +68,10 @@ public class FightTargetsEffect extends OneShotEffect { public FightTargetsEffect copy() { return new FightTargetsEffect(this); } - + @Override public String getText(Mode mode) { return "Target " + mode.getTargets().get(0).getTargetName() + " fights target " + mode.getTargets().get(1).getTargetName(); } - + } diff --git a/Mage/src/mage/abilities/effects/common/GainLifeEffect.java b/Mage/src/mage/abilities/effects/common/GainLifeEffect.java index ed3aaa3bb8..f25722de78 100644 --- a/Mage/src/mage/abilities/effects/common/GainLifeEffect.java +++ b/Mage/src/mage/abilities/effects/common/GainLifeEffect.java @@ -42,38 +42,38 @@ import mage.players.Player; */ public class GainLifeEffect extends OneShotEffect { - private DynamicValue life; + private DynamicValue life; public GainLifeEffect(int life) { this(new StaticValue(life)); } - public GainLifeEffect(DynamicValue life) { - super(Outcome.GainLife); - this.life = life; - setText(); - } + public GainLifeEffect(DynamicValue life) { + super(Outcome.GainLife); + this.life = life; + setText(); + } - public GainLifeEffect(final GainLifeEffect effect) { - super(effect); - this.life = effect.life.clone(); - } + public GainLifeEffect(final GainLifeEffect effect) { + super(effect); + this.life = effect.life.clone(); + } - @Override - public GainLifeEffect copy() { - return new GainLifeEffect(this); - } + @Override + public GainLifeEffect copy() { + return new GainLifeEffect(this); + } - @Override - public boolean apply(Game game, Ability source) { - Player player = game.getPlayer(source.getControllerId()); - if (player != null) { - player.gainLife(life.calculate(game, source), game); - } - return true; - } + @Override + public boolean apply(Game game, Ability source) { + Player player = game.getPlayer(source.getControllerId()); + if (player != null) { + player.gainLife(life.calculate(game, source), game); + } + return true; + } - private void setText() { + private void setText() { StringBuilder sb = new StringBuilder(); String message = life.getMessage(); @@ -86,7 +86,7 @@ public class GainLifeEffect extends OneShotEffect { sb.append(message.equals("1") ? " equal to the number of " : " for each "); sb.append(message); } - staticText = sb.toString(); - } + staticText = sb.toString(); + } } diff --git a/Mage/src/mage/abilities/effects/common/GainLifeTargetEffect.java b/Mage/src/mage/abilities/effects/common/GainLifeTargetEffect.java index ff5e29c6b8..adb81b947b 100644 --- a/Mage/src/mage/abilities/effects/common/GainLifeTargetEffect.java +++ b/Mage/src/mage/abilities/effects/common/GainLifeTargetEffect.java @@ -41,33 +41,33 @@ import mage.players.Player; */ public class GainLifeTargetEffect extends OneShotEffect { - private int life; + private int life; - public GainLifeTargetEffect(int life) { - super(Outcome.GainLife); - this.life = life; - staticText = "target players each gain " + Integer.toString(life) + " life"; - } + public GainLifeTargetEffect(int life) { + super(Outcome.GainLife); + this.life = life; + staticText = "target players each gain " + Integer.toString(life) + " life"; + } - public GainLifeTargetEffect(final GainLifeTargetEffect effect) { - super(effect); - this.life = effect.life; - } + public GainLifeTargetEffect(final GainLifeTargetEffect effect) { + super(effect); + this.life = effect.life; + } - @Override - public GainLifeTargetEffect copy() { - return new GainLifeTargetEffect(this); - } + @Override + public GainLifeTargetEffect copy() { + return new GainLifeTargetEffect(this); + } - @Override - public boolean apply(Game game, Ability source) { - for (UUID playerId: targetPointer.getTargets(game, source)) { - Player player = game.getPlayer(playerId); - if (player != null) { - player.gainLife(life, game); - } - } - return true; - } + @Override + public boolean apply(Game game, Ability source) { + for (UUID playerId: targetPointer.getTargets(game, source)) { + Player player = game.getPlayer(playerId); + if (player != null) { + player.gainLife(life, game); + } + } + return true; + } } diff --git a/Mage/src/mage/abilities/effects/common/GetEmblemEffect.java b/Mage/src/mage/abilities/effects/common/GetEmblemEffect.java index 4f659a3ac4..a04532dd9f 100644 --- a/Mage/src/mage/abilities/effects/common/GetEmblemEffect.java +++ b/Mage/src/mage/abilities/effects/common/GetEmblemEffect.java @@ -40,28 +40,28 @@ import mage.game.command.Emblem; */ public class GetEmblemEffect extends OneShotEffect { - private Emblem emblem; + private Emblem emblem; - public GetEmblemEffect(Emblem emblem) { - super(Outcome.Benefit); - this.emblem = emblem; - this.staticText = "You get an emblem with \"" + emblem.getAbilities().getRules(null) + "\""; - } + public GetEmblemEffect(Emblem emblem) { + super(Outcome.Benefit); + this.emblem = emblem; + this.staticText = "You get an emblem with \"" + emblem.getAbilities().getRules(null) + "\""; + } - public GetEmblemEffect(final GetEmblemEffect effect) { - super(effect); - this.emblem = effect.emblem; - } + public GetEmblemEffect(final GetEmblemEffect effect) { + super(effect); + this.emblem = effect.emblem; + } - @Override - public GetEmblemEffect copy() { - return new GetEmblemEffect(this); - } + @Override + public GetEmblemEffect copy() { + return new GetEmblemEffect(this); + } - @Override - public boolean apply(Game game, Ability source) { + @Override + public boolean apply(Game game, Ability source) { game.addEmblem(emblem, source); - return true; - } + return true; + } } diff --git a/Mage/src/mage/abilities/effects/common/ImprintTargetEffect.java b/Mage/src/mage/abilities/effects/common/ImprintTargetEffect.java index 1b63b3c892..b336ac8eae 100644 --- a/Mage/src/mage/abilities/effects/common/ImprintTargetEffect.java +++ b/Mage/src/mage/abilities/effects/common/ImprintTargetEffect.java @@ -42,21 +42,21 @@ import mage.game.permanent.Permanent; */ public class ImprintTargetEffect extends OneShotEffect { - public ImprintTargetEffect() { - super(Outcome.Neutral); - } + public ImprintTargetEffect() { + super(Outcome.Neutral); + } - public ImprintTargetEffect(final ImprintTargetEffect effect) { - super(effect); - } + public ImprintTargetEffect(final ImprintTargetEffect effect) { + super(effect); + } @Override - public ImprintTargetEffect copy() { - return new ImprintTargetEffect(this); - } + public ImprintTargetEffect copy() { + return new ImprintTargetEffect(this); + } - @Override - public boolean apply(Game game, Ability source) { + @Override + public boolean apply(Game game, Ability source) { Permanent sourcePermanent = game.getPermanent(source.getSourceId()); if (sourcePermanent != null) { Permanent permanent = game.getPermanent(targetPointer.getFirst(game, source)); @@ -71,7 +71,7 @@ public class ImprintTargetEffect extends OneShotEffect { } return true; - } + } @Override public String getText(Mode mode) { diff --git a/Mage/src/mage/abilities/effects/common/LookLibraryAndPickControllerEffect.java b/Mage/src/mage/abilities/effects/common/LookLibraryAndPickControllerEffect.java index 56b8deea12..2a5b799f41 100644 --- a/Mage/src/mage/abilities/effects/common/LookLibraryAndPickControllerEffect.java +++ b/Mage/src/mage/abilities/effects/common/LookLibraryAndPickControllerEffect.java @@ -48,105 +48,105 @@ import mage.target.TargetCard; */ public class LookLibraryAndPickControllerEffect extends LookLibraryControllerEffect { - + protected FilterCard filter; // which kind of cards to reveal protected DynamicValue numberToPick; protected boolean revealPickedCards = true; protected Zone targetPickedCards = Zone.HAND; // HAND protected int foundCardsToPick = 0; - protected boolean optional; - + protected boolean optional; + public LookLibraryAndPickControllerEffect(DynamicValue numberOfCards, boolean mayShuffleAfter, DynamicValue numberToPick, FilterCard pickFilter, boolean putOnTop) { this(numberOfCards, mayShuffleAfter, numberToPick, pickFilter, putOnTop, true); } - public LookLibraryAndPickControllerEffect(DynamicValue numberOfCards, boolean mayShuffleAfter, DynamicValue numberToPick, FilterCard pickFilter, boolean putOnTop, boolean reveal) { + public LookLibraryAndPickControllerEffect(DynamicValue numberOfCards, boolean mayShuffleAfter, DynamicValue numberToPick, FilterCard pickFilter, boolean putOnTop, boolean reveal) { this(numberOfCards, mayShuffleAfter, numberToPick, pickFilter, Zone.LIBRARY, putOnTop, reveal); } - - public LookLibraryAndPickControllerEffect(DynamicValue numberOfCards, boolean mayShuffleAfter, DynamicValue numberToPick, FilterCard pickFilter, Zone targetZoneLookedCards, boolean putOnTop, boolean reveal) { + + public LookLibraryAndPickControllerEffect(DynamicValue numberOfCards, boolean mayShuffleAfter, DynamicValue numberToPick, FilterCard pickFilter, Zone targetZoneLookedCards, boolean putOnTop, boolean reveal) { super(Outcome.DrawCard, numberOfCards, mayShuffleAfter, targetZoneLookedCards, putOnTop); this.numberToPick = numberToPick; this.filter = pickFilter; - this.revealPickedCards = reveal; + this.revealPickedCards = reveal; } - public LookLibraryAndPickControllerEffect(final LookLibraryAndPickControllerEffect effect) { + public LookLibraryAndPickControllerEffect(final LookLibraryAndPickControllerEffect effect) { super(effect); this.numberToPick = effect.numberToPick.clone(); this.filter = effect.filter.copy(); this.revealPickedCards = effect.revealPickedCards; this.targetPickedCards = effect.targetPickedCards; } - + @Override public LookLibraryAndPickControllerEffect copy() { return new LookLibraryAndPickControllerEffect(this); - + } @Override protected void cardLooked(Card card, Game game, Ability source) { - + if (numberToPick.calculate(game, source) > 0 && filter.match(card, game)) ++foundCardsToPick; } - + @Override protected void actionWithSelectedCards(Cards cards, Game game, Ability source, String windowName) { Player player = game.getPlayer(source.getControllerId()); if (player != null && foundCardsToPick > 0) { - if (!optional || player.chooseUse(Outcome.DrawCard, "Do you wish to reveal "+filter.getMessage()+" and put it into your hand?", game)) { - FilterCard pickFilter = filter.copy(); - // Set the pick message - StringBuilder sb = new StringBuilder(filter.getMessage()).append(" to "); - if (revealPickedCards) { - sb.append("reveal and "); - } - sb.append("put into your hand"); - - pickFilter.setMessage(sb.toString()); - TargetCard target = new TargetCard(Zone.PICK, pickFilter); - if (player.choose(Outcome.DrawCard, cards, target, game)) { - Card card = cards.get(target.getFirstTarget(), game); - if (card != null) { - cards.remove(card); - card.moveToZone(targetPickedCards, source.getId(), game, false); - if (revealPickedCards) { - Cards reveal = new CardsImpl(Zone.OUTSIDE); - reveal.add(card); - player.revealCards(windowName, reveal, game); - } - } - } - } + if (!optional || player.chooseUse(Outcome.DrawCard, "Do you wish to reveal "+filter.getMessage()+" and put it into your hand?", game)) { + FilterCard pickFilter = filter.copy(); + // Set the pick message + StringBuilder sb = new StringBuilder(filter.getMessage()).append(" to "); + if (revealPickedCards) { + sb.append("reveal and "); + } + sb.append("put into your hand"); + + pickFilter.setMessage(sb.toString()); + TargetCard target = new TargetCard(Zone.PICK, pickFilter); + if (player.choose(Outcome.DrawCard, cards, target, game)) { + Card card = cards.get(target.getFirstTarget(), game); + if (card != null) { + cards.remove(card); + card.moveToZone(targetPickedCards, source.getId(), game, false); + if (revealPickedCards) { + Cards reveal = new CardsImpl(Zone.OUTSIDE); + reveal.add(card); + player.revealCards(windowName, reveal, game); + } + } + } + } } } - + @Override public String getText(Mode mode) { StringBuilder sb = new StringBuilder(); if (numberToPick.calculate(null, null) > 0) { - if (revealPickedCards) { - sb.append(". You may reveal a "); - sb.append(filter.getMessage()).append(" from among them and put it into your "); - } else { - sb.append(". Put one of them into your "); - } - sb.append(targetPickedCards.toString().toLowerCase()); + if (revealPickedCards) { + sb.append(". You may reveal a "); + sb.append(filter.getMessage()).append(" from among them and put it into your "); + } else { + sb.append(". Put one of them into your "); + } + sb.append(targetPickedCards.toString().toLowerCase()); if (targetZoneLookedCards == Zone.LIBRARY) { - sb.append(". Put the rest "); - if (putOnTop) - sb.append("back "); - else - sb.append("on the bottom of your library "); - sb.append("in any order"); - } else if (targetZoneLookedCards == Zone.GRAVEYARD) { - sb.append(" and the other into your graveyard"); - } + sb.append(". Put the rest "); + if (putOnTop) + sb.append("back "); + else + sb.append("on the bottom of your library "); + sb.append("in any order"); + } else if (targetZoneLookedCards == Zone.GRAVEYARD) { + sb.append(" and the other into your graveyard"); + } } // get text frame from super class and inject action text return setText(mode, sb.toString()); } - + } diff --git a/Mage/src/mage/abilities/effects/common/LookLibraryControllerEffect.java b/Mage/src/mage/abilities/effects/common/LookLibraryControllerEffect.java index 1469659c4b..5f819f9ced 100644 --- a/Mage/src/mage/abilities/effects/common/LookLibraryControllerEffect.java +++ b/Mage/src/mage/abilities/effects/common/LookLibraryControllerEffect.java @@ -54,7 +54,7 @@ public class LookLibraryControllerEffect extends OneShotEffect 1) { - player.choose(Outcome.Neutral, cards, target, game); - Card card = cards.get(target.getFirstTarget(), game); - if (card != null) { - cards.remove(card); - card.moveToZone(targetZoneLookedCards, source.getId(), game, putOnTop); - } - target.clearChosen(); - } - if (cards.size() == 1) { - Card card = cards.get(cards.iterator().next(), game); - card.moveToZone(targetZoneLookedCards, source.getId(), game, true); - } - break; - case GRAVEYARD: - for (Card card : cards.getCards(game)) { - card.moveToZone(Zone.GRAVEYARD, source.getId(), game, true); - } - break; - default: - // not supported yet - } - } + switch(targetZoneLookedCards) { + case LIBRARY: + TargetCard target = new TargetCard(Zone.PICK, new FilterCard(this.getPutBackText())); + target.setRequired(true); + while (cards.size() > 1) { + player.choose(Outcome.Neutral, cards, target, game); + Card card = cards.get(target.getFirstTarget(), game); + if (card != null) { + cards.remove(card); + card.moveToZone(targetZoneLookedCards, source.getId(), game, putOnTop); + } + target.clearChosen(); + } + if (cards.size() == 1) { + Card card = cards.get(cards.iterator().next(), game); + card.moveToZone(targetZoneLookedCards, source.getId(), game, true); + } + break; + case GRAVEYARD: + for (Card card : cards.getCards(game)) { + card.moveToZone(Zone.GRAVEYARD, source.getId(), game, true); + } + break; + default: + // not supported yet + } + } /** * Check to shuffle library if allowed diff --git a/Mage/src/mage/abilities/effects/common/LoseControlOnOtherPlayersControllerEffect.java b/Mage/src/mage/abilities/effects/common/LoseControlOnOtherPlayersControllerEffect.java index 2788af6e04..5e7c8c077a 100644 --- a/Mage/src/mage/abilities/effects/common/LoseControlOnOtherPlayersControllerEffect.java +++ b/Mage/src/mage/abilities/effects/common/LoseControlOnOtherPlayersControllerEffect.java @@ -40,27 +40,27 @@ import mage.players.Player; */ public class LoseControlOnOtherPlayersControllerEffect extends OneShotEffect { - public LoseControlOnOtherPlayersControllerEffect() { - super(Outcome.Detriment); - } + public LoseControlOnOtherPlayersControllerEffect() { + super(Outcome.Detriment); + } - public LoseControlOnOtherPlayersControllerEffect(final LoseControlOnOtherPlayersControllerEffect effect) { - super(effect); - } + public LoseControlOnOtherPlayersControllerEffect(final LoseControlOnOtherPlayersControllerEffect effect) { + super(effect); + } - @Override - public LoseControlOnOtherPlayersControllerEffect copy() { - return new LoseControlOnOtherPlayersControllerEffect(this); - } + @Override + public LoseControlOnOtherPlayersControllerEffect copy() { + return new LoseControlOnOtherPlayersControllerEffect(this); + } - @Override - public boolean apply(Game game, Ability source) { - Player player = game.getPlayer(source.getControllerId()); - if (player != null) { - player.resetOtherTurnsControlled(); - return true; - } - return false; - } + @Override + public boolean apply(Game game, Ability source) { + Player player = game.getPlayer(source.getControllerId()); + if (player != null) { + player.resetOtherTurnsControlled(); + return true; + } + return false; + } } diff --git a/Mage/src/mage/abilities/effects/common/LoseLifeControllerEffect.java b/Mage/src/mage/abilities/effects/common/LoseLifeControllerEffect.java index fc1b9d69ca..a7a833dee4 100644 --- a/Mage/src/mage/abilities/effects/common/LoseLifeControllerEffect.java +++ b/Mage/src/mage/abilities/effects/common/LoseLifeControllerEffect.java @@ -49,12 +49,12 @@ public class LoseLifeControllerEffect extends OneShotEffect { - - private DynamicValue amount; - - public LoseLifePlayersEffect(int amount) { - super(Constants.Outcome.Damage); - this.amount = new StaticValue(amount); - staticText = "each player loses " + amount + " life"; - } - public LoseLifePlayersEffect(final LoseLifePlayersEffect effect) { - super(effect); - this.amount = effect.amount; - } + private DynamicValue amount; - @Override - public boolean apply(Game game, Ability source) { - for (UUID playerId: game.getPlayer(source.getControllerId()).getInRange()) { - Player player = game.getPlayer(playerId); - if (player != null) - player.loseLife(amount.calculate(game, source), game); - } - return true; - } + public LoseLifePlayersEffect(int amount) { + super(Constants.Outcome.Damage); + this.amount = new StaticValue(amount); + staticText = "each player loses " + amount + " life"; + } - @Override - public LoseLifePlayersEffect copy() { - return new LoseLifePlayersEffect(this); - } + public LoseLifePlayersEffect(final LoseLifePlayersEffect effect) { + super(effect); + this.amount = effect.amount; + } + + @Override + public boolean apply(Game game, Ability source) { + for (UUID playerId: game.getPlayer(source.getControllerId()).getInRange()) { + Player player = game.getPlayer(playerId); + if (player != null) + player.loseLife(amount.calculate(game, source), game); + } + return true; + } + + @Override + public LoseLifePlayersEffect copy() { + return new LoseLifePlayersEffect(this); + } } diff --git a/Mage/src/mage/abilities/effects/common/LoseLifeSourceEffect.java b/Mage/src/mage/abilities/effects/common/LoseLifeSourceEffect.java index 180d163f88..959ad61c40 100644 --- a/Mage/src/mage/abilities/effects/common/LoseLifeSourceEffect.java +++ b/Mage/src/mage/abilities/effects/common/LoseLifeSourceEffect.java @@ -40,36 +40,36 @@ import mage.players.Player; */ public class LoseLifeSourceEffect extends OneShotEffect { - protected int amount; + protected int amount; - public LoseLifeSourceEffect(int amount) { - super(Outcome.Damage); - this.amount = amount; - staticText = "You lose " + Integer.toString(amount) + " life"; - } + public LoseLifeSourceEffect(int amount) { + super(Outcome.Damage); + this.amount = amount; + staticText = "You lose " + Integer.toString(amount) + " life"; + } - public int getAmount() { - return amount; - } + public int getAmount() { + return amount; + } - public LoseLifeSourceEffect(final LoseLifeSourceEffect effect) { - super(effect); - this.amount = effect.amount; - } + public LoseLifeSourceEffect(final LoseLifeSourceEffect effect) { + super(effect); + this.amount = effect.amount; + } - @Override - public LoseLifeSourceEffect copy() { - return new LoseLifeSourceEffect(this); - } + @Override + public LoseLifeSourceEffect copy() { + return new LoseLifeSourceEffect(this); + } - @Override - public boolean apply(Game game, Ability source) { + @Override + public boolean apply(Game game, Ability source) { Player player = game.getPlayer(source.getControllerId()); - if (player != null) { - player.loseLife(amount, game); - return true; - } - return false; - } + if (player != null) { + player.loseLife(amount, game); + return true; + } + return false; + } } diff --git a/Mage/src/mage/abilities/effects/common/LoseLifeTargetEffect.java b/Mage/src/mage/abilities/effects/common/LoseLifeTargetEffect.java index fcf2bb0827..e34a59fdec 100644 --- a/Mage/src/mage/abilities/effects/common/LoseLifeTargetEffect.java +++ b/Mage/src/mage/abilities/effects/common/LoseLifeTargetEffect.java @@ -43,44 +43,44 @@ import mage.players.Player; */ public class LoseLifeTargetEffect extends OneShotEffect { - protected DynamicValue amount; + protected DynamicValue amount; public LoseLifeTargetEffect(int amount) { this(new StaticValue(amount)); } - public LoseLifeTargetEffect(DynamicValue amount) { - super(Outcome.Damage); - this.amount = amount; - } + public LoseLifeTargetEffect(DynamicValue amount) { + super(Outcome.Damage); + this.amount = amount; + } - public LoseLifeTargetEffect(final LoseLifeTargetEffect effect) { - super(effect); - this.amount = effect.amount.clone(); - } + public LoseLifeTargetEffect(final LoseLifeTargetEffect effect) { + super(effect); + this.amount = effect.amount.clone(); + } - @Override - public LoseLifeTargetEffect copy() { - return new LoseLifeTargetEffect(this); - } + @Override + public LoseLifeTargetEffect copy() { + return new LoseLifeTargetEffect(this); + } - @Override - public boolean apply(Game game, Ability source) { - Player player = game.getPlayer(targetPointer.getFirst(game, source)); - if (player != null) { - player.loseLife(amount.calculate(game, source), game); - return true; - } - return false; - } + @Override + public boolean apply(Game game, Ability source) { + Player player = game.getPlayer(targetPointer.getFirst(game, source)); + if (player != null) { + player.loseLife(amount.calculate(game, source), game); + return true; + } + return false; + } - @Override - public String getText(Mode mode) { + @Override + public String getText(Mode mode) { StringBuilder sb = new StringBuilder(); String message = amount.getMessage(); if (mode.getTargets().size() > 0) { - sb.append("Target ").append(mode.getTargets().get(0).getTargetName()); + sb.append("Target ").append(mode.getTargets().get(0).getTargetName()); } else { sb.append("that player"); } @@ -94,7 +94,7 @@ public class LoseLifeTargetEffect extends OneShotEffect { sb.append(message); } return sb.toString(); - } + } } diff --git a/Mage/src/mage/abilities/effects/common/ManaEffect.java b/Mage/src/mage/abilities/effects/common/ManaEffect.java index 2157a3fff5..a223dd3b7a 100644 --- a/Mage/src/mage/abilities/effects/common/ManaEffect.java +++ b/Mage/src/mage/abilities/effects/common/ManaEffect.java @@ -37,12 +37,12 @@ import mage.abilities.effects.OneShotEffect; */ public abstract class ManaEffect> extends OneShotEffect { - public ManaEffect() { - super(Outcome.PutManaInPool); - } + public ManaEffect() { + super(Outcome.PutManaInPool); + } - public ManaEffect(final ManaEffect effect) { - super(effect); - } + public ManaEffect(final ManaEffect effect) { + super(effect); + } } diff --git a/Mage/src/mage/abilities/effects/common/MustBlockSourceEffect.java b/Mage/src/mage/abilities/effects/common/MustBlockSourceEffect.java index 8ce4e358ac..5460761fdd 100644 --- a/Mage/src/mage/abilities/effects/common/MustBlockSourceEffect.java +++ b/Mage/src/mage/abilities/effects/common/MustBlockSourceEffect.java @@ -41,42 +41,42 @@ import mage.game.permanent.Permanent; */ public class MustBlockSourceEffect extends RequirementEffect { - public MustBlockSourceEffect() { - this(Duration.WhileOnBattlefield); - } + public MustBlockSourceEffect() { + this(Duration.WhileOnBattlefield); + } - public MustBlockSourceEffect(Duration duration) { - super(duration); - staticText = "All creatures able to block {this} do so"; - } + public MustBlockSourceEffect(Duration duration) { + super(duration); + staticText = "All creatures able to block {this} do so"; + } - public MustBlockSourceEffect(final MustBlockSourceEffect effect) { - super(effect); - } + public MustBlockSourceEffect(final MustBlockSourceEffect effect) { + super(effect); + } - @Override - public boolean applies(Permanent permanent, Ability source, Game game) { - return true; - } + @Override + public boolean applies(Permanent permanent, Ability source, Game game) { + return true; + } - @Override - public boolean mustAttack(Game game) { - return false; - } + @Override + public boolean mustAttack(Game game) { + return false; + } - @Override - public boolean mustBlock(Game game) { - return true; - } + @Override + public boolean mustBlock(Game game) { + return true; + } - @Override - public UUID mustBlockAttacker(Ability source, Game game) { - return source.getSourceId(); - } + @Override + public UUID mustBlockAttacker(Ability source, Game game) { + return source.getSourceId(); + } - @Override - public MustBlockSourceEffect copy() { - return new MustBlockSourceEffect(this); - } + @Override + public MustBlockSourceEffect copy() { + return new MustBlockSourceEffect(this); + } } diff --git a/Mage/src/mage/abilities/effects/common/MustBlockSourceTargetEffect.java b/Mage/src/mage/abilities/effects/common/MustBlockSourceTargetEffect.java index 6db6ff1ee0..d5ac9766e6 100644 --- a/Mage/src/mage/abilities/effects/common/MustBlockSourceTargetEffect.java +++ b/Mage/src/mage/abilities/effects/common/MustBlockSourceTargetEffect.java @@ -41,46 +41,46 @@ import mage.game.permanent.Permanent; */ public class MustBlockSourceTargetEffect extends RequirementEffect { - public MustBlockSourceTargetEffect() { - this(Duration.EndOfTurn); - } + public MustBlockSourceTargetEffect() { + this(Duration.EndOfTurn); + } - public MustBlockSourceTargetEffect(Duration duration) { - super(duration); - staticText = "Target creature blocks {this} this turn if able"; - } + public MustBlockSourceTargetEffect(Duration duration) { + super(duration); + staticText = "Target creature blocks {this} this turn if able"; + } - public MustBlockSourceTargetEffect(final MustBlockSourceTargetEffect effect) { - super(effect); - } + public MustBlockSourceTargetEffect(final MustBlockSourceTargetEffect effect) { + super(effect); + } - @Override - public boolean applies(Permanent permanent, Ability source, Game game) { - Permanent creature = game.getPermanent(source.getFirstTarget()); - if (creature != null && creature.getId().equals(permanent.getId())) { - return true; - } - return false; - } + @Override + public boolean applies(Permanent permanent, Ability source, Game game) { + Permanent creature = game.getPermanent(source.getFirstTarget()); + if (creature != null && creature.getId().equals(permanent.getId())) { + return true; + } + return false; + } - @Override - public boolean mustAttack(Game game) { - return false; - } + @Override + public boolean mustAttack(Game game) { + return false; + } - @Override - public boolean mustBlock(Game game) { - return true; - } + @Override + public boolean mustBlock(Game game) { + return true; + } - @Override - public UUID mustBlockAttacker(Ability source, Game game) { - return source.getSourceId(); - } + @Override + public UUID mustBlockAttacker(Ability source, Game game) { + return source.getSourceId(); + } - @Override - public MustBlockSourceTargetEffect copy() { - return new MustBlockSourceTargetEffect(this); - } + @Override + public MustBlockSourceTargetEffect copy() { + return new MustBlockSourceTargetEffect(this); + } } diff --git a/Mage/src/mage/abilities/effects/common/PassEffect.java b/Mage/src/mage/abilities/effects/common/PassEffect.java index 5963330a01..4b4b671d91 100644 --- a/Mage/src/mage/abilities/effects/common/PassEffect.java +++ b/Mage/src/mage/abilities/effects/common/PassEffect.java @@ -40,24 +40,24 @@ import mage.players.Player; */ public class PassEffect extends OneShotEffect { - public PassEffect() { - super(Outcome.Neutral); - } + public PassEffect() { + super(Outcome.Neutral); + } - public PassEffect(final PassEffect effect) { - super(effect); - } + public PassEffect(final PassEffect effect) { + super(effect); + } - @Override - public boolean apply(Game game, Ability source) { + @Override + public boolean apply(Game game, Ability source) { Player player = game.getPlayer(source.getControllerId()); player.pass(); - return true; - } + return true; + } - @Override - public PassEffect copy() { - return new PassEffect(this); - } + @Override + public PassEffect copy() { + return new PassEffect(this); + } } diff --git a/Mage/src/mage/abilities/effects/common/PlayTargetWithoutPayingManaEffect.java b/Mage/src/mage/abilities/effects/common/PlayTargetWithoutPayingManaEffect.java index 580f0dc3e3..4c077db1d1 100644 --- a/Mage/src/mage/abilities/effects/common/PlayTargetWithoutPayingManaEffect.java +++ b/Mage/src/mage/abilities/effects/common/PlayTargetWithoutPayingManaEffect.java @@ -44,31 +44,31 @@ import mage.target.Target; */ public class PlayTargetWithoutPayingManaEffect extends OneShotEffect { - public PlayTargetWithoutPayingManaEffect() { - super(Outcome.GainControl); - } + public PlayTargetWithoutPayingManaEffect() { + super(Outcome.GainControl); + } - public PlayTargetWithoutPayingManaEffect(final PlayTargetWithoutPayingManaEffect effect) { - super(effect); - } + public PlayTargetWithoutPayingManaEffect(final PlayTargetWithoutPayingManaEffect effect) { + super(effect); + } - @Override - public PlayTargetWithoutPayingManaEffect copy() { - return new PlayTargetWithoutPayingManaEffect(this); - } + @Override + public PlayTargetWithoutPayingManaEffect copy() { + return new PlayTargetWithoutPayingManaEffect(this); + } - @Override - public boolean apply(Game game, Ability source) { - Player controller = game.getPlayer(source.getControllerId()); - Card target = (Card) game.getObject(source.getFirstTarget()); - if (controller != null && target != null) { - return controller.cast(target.getSpellAbility(), game, true); - } - return false; - } + @Override + public boolean apply(Game game, Ability source) { + Player controller = game.getPlayer(source.getControllerId()); + Card target = (Card) game.getObject(source.getFirstTarget()); + if (controller != null && target != null) { + return controller.cast(target.getSpellAbility(), game, true); + } + return false; + } - @Override - public String getText(Mode mode) { + @Override + public String getText(Mode mode) { StringBuilder sb = new StringBuilder(); if (mode.getTargets().size() > 0) { Target target = mode.getTargets().get(0); @@ -79,6 +79,6 @@ public class PlayTargetWithoutPayingManaEffect extends OneShotEffect { - public PreventAllDamageSourceEffect(Duration duration) { - super(duration); - staticText = "Prevent all damage that would be dealt to {this} " + duration.toString(); - } + public PreventAllDamageSourceEffect(Duration duration) { + super(duration); + staticText = "Prevent all damage that would be dealt to {this} " + duration.toString(); + } - public PreventAllDamageSourceEffect(final PreventAllDamageSourceEffect effect) { - super(effect); - } + public PreventAllDamageSourceEffect(final PreventAllDamageSourceEffect effect) { + super(effect); + } - @Override - public PreventAllDamageSourceEffect copy() { - return new PreventAllDamageSourceEffect(this); - } + @Override + public PreventAllDamageSourceEffect copy() { + return new PreventAllDamageSourceEffect(this); + } - @Override - public boolean apply(Game game, Ability source) { - return true; - } + @Override + public boolean apply(Game game, Ability source) { + return true; + } - @Override - public boolean replaceEvent(GameEvent event, Ability source, Game game) { - GameEvent preventEvent = new GameEvent(GameEvent.EventType.PREVENT_DAMAGE, source.getFirstTarget(), source.getId(), source.getControllerId(), event.getAmount(), false); - if (!game.replaceEvent(preventEvent)) { - int damage = event.getAmount(); - event.setAmount(0); - game.fireEvent(GameEvent.getEvent(GameEvent.EventType.PREVENTED_DAMAGE, source.getFirstTarget(), source.getId(), source.getControllerId(), damage)); - } - return false; - } + @Override + public boolean replaceEvent(GameEvent event, Ability source, Game game) { + GameEvent preventEvent = new GameEvent(GameEvent.EventType.PREVENT_DAMAGE, source.getFirstTarget(), source.getId(), source.getControllerId(), event.getAmount(), false); + if (!game.replaceEvent(preventEvent)) { + int damage = event.getAmount(); + event.setAmount(0); + game.fireEvent(GameEvent.getEvent(GameEvent.EventType.PREVENTED_DAMAGE, source.getFirstTarget(), source.getId(), source.getControllerId(), damage)); + } + return false; + } - @Override - public boolean applies(GameEvent event, Ability source, Game game) { - if (super.applies(event, source, game)) { - if (event.getTargetId().equals(source.getSourceId())) { - return true; - } - } - return false; - } + @Override + public boolean applies(GameEvent event, Ability source, Game game) { + if (super.applies(event, source, game)) { + if (event.getTargetId().equals(source.getSourceId())) { + return true; + } + } + return false; + } } diff --git a/Mage/src/mage/abilities/effects/common/PreventAllDamageToEffect.java b/Mage/src/mage/abilities/effects/common/PreventAllDamageToEffect.java index c9dfaa349e..7f7f4e26aa 100644 --- a/Mage/src/mage/abilities/effects/common/PreventAllDamageToEffect.java +++ b/Mage/src/mage/abilities/effects/common/PreventAllDamageToEffect.java @@ -43,55 +43,55 @@ import mage.players.Player; */ public class PreventAllDamageToEffect extends PreventionEffectImpl { - protected FilterInPlay filter; + protected FilterInPlay filter; - public PreventAllDamageToEffect(Duration duration, FilterInPlay filter) { - super(duration); - this.filter = filter; - staticText = "Prevent all damage that would be dealt to " + filter.getMessage() + " " + duration.toString(); - } + public PreventAllDamageToEffect(Duration duration, FilterInPlay filter) { + super(duration); + this.filter = filter; + staticText = "Prevent all damage that would be dealt to " + filter.getMessage() + " " + duration.toString(); + } - public PreventAllDamageToEffect(final PreventAllDamageToEffect effect) { - super(effect); - this.filter = effect.filter.copy(); - } + public PreventAllDamageToEffect(final PreventAllDamageToEffect effect) { + super(effect); + this.filter = effect.filter.copy(); + } - @Override - public PreventAllDamageToEffect copy() { - return new PreventAllDamageToEffect(this); - } + @Override + public PreventAllDamageToEffect copy() { + return new PreventAllDamageToEffect(this); + } - @Override - public boolean apply(Game game, Ability source) { - return true; - } + @Override + public boolean apply(Game game, Ability source) { + return true; + } - @Override - public boolean replaceEvent(GameEvent event, Ability source, Game game) { - GameEvent preventEvent = new GameEvent(GameEvent.EventType.PREVENT_DAMAGE, source.getFirstTarget(), source.getId(), source.getControllerId(), event.getAmount(), false); - if (!game.replaceEvent(preventEvent)) { - int damage = event.getAmount(); - event.setAmount(0); - game.fireEvent(GameEvent.getEvent(GameEvent.EventType.PREVENTED_DAMAGE, source.getFirstTarget(), source.getId(), source.getControllerId(), damage)); - } - return false; - } + @Override + public boolean replaceEvent(GameEvent event, Ability source, Game game) { + GameEvent preventEvent = new GameEvent(GameEvent.EventType.PREVENT_DAMAGE, source.getFirstTarget(), source.getId(), source.getControllerId(), event.getAmount(), false); + if (!game.replaceEvent(preventEvent)) { + int damage = event.getAmount(); + event.setAmount(0); + game.fireEvent(GameEvent.getEvent(GameEvent.EventType.PREVENTED_DAMAGE, source.getFirstTarget(), source.getId(), source.getControllerId(), damage)); + } + return false; + } - @Override - public boolean applies(GameEvent event, Ability source, Game game) { - if (super.applies(event, source, game)) { - Permanent permanent = game.getPermanent(event.getTargetId()); - if (permanent != null) { - if (filter.match(permanent, source.getSourceId(), source.getControllerId(), game)) - return true; - } - else { - Player player = game.getPlayer(event.getTargetId()); - if (player != null && filter.match(player, source.getSourceId(), source.getControllerId(), game)) - return true; - } - } - return false; - } + @Override + public boolean applies(GameEvent event, Ability source, Game game) { + if (super.applies(event, source, game)) { + Permanent permanent = game.getPermanent(event.getTargetId()); + if (permanent != null) { + if (filter.match(permanent, source.getSourceId(), source.getControllerId(), game)) + return true; + } + else { + Player player = game.getPlayer(event.getTargetId()); + if (player != null && filter.match(player, source.getSourceId(), source.getControllerId(), game)) + return true; + } + } + return false; + } } diff --git a/Mage/src/mage/abilities/effects/common/PreventCombatDamageFromSourceEffect.java b/Mage/src/mage/abilities/effects/common/PreventCombatDamageFromSourceEffect.java index 62135d641c..585a083648 100644 --- a/Mage/src/mage/abilities/effects/common/PreventCombatDamageFromSourceEffect.java +++ b/Mage/src/mage/abilities/effects/common/PreventCombatDamageFromSourceEffect.java @@ -41,27 +41,27 @@ import mage.game.events.GameEvent; */ public class PreventCombatDamageFromSourceEffect extends PreventionEffectImpl { - public PreventCombatDamageFromSourceEffect(Duration duration) { + public PreventCombatDamageFromSourceEffect(Duration duration) { super(duration); staticText = "Prevent all combat damage that would be dealt by {this} " + duration.toString(); - } + } - public PreventCombatDamageFromSourceEffect(final PreventCombatDamageFromSourceEffect effect) { + public PreventCombatDamageFromSourceEffect(final PreventCombatDamageFromSourceEffect effect) { super(effect); - } + } - @Override - public PreventCombatDamageFromSourceEffect copy() { + @Override + public PreventCombatDamageFromSourceEffect copy() { return new PreventCombatDamageFromSourceEffect(this); - } + } - @Override - public boolean apply(Game game, Ability source) { + @Override + public boolean apply(Game game, Ability source) { return true; - } + } - @Override - public boolean replaceEvent(GameEvent event, Ability source, Game game) { + @Override + public boolean replaceEvent(GameEvent event, Ability source, Game game) { GameEvent preventEvent = new GameEvent(GameEvent.EventType.PREVENT_DAMAGE, source.getSourceId(), source.getFirstTarget(), source.getControllerId(), event.getAmount(), false); if (!game.replaceEvent(preventEvent)) { int damage = event.getAmount(); @@ -72,8 +72,8 @@ public class PreventCombatDamageFromSourceEffect extends PreventionEffectImpl { - public PreventCombatDamageSourceEffect(Duration duration) { + public PreventCombatDamageSourceEffect(Duration duration) { super(duration); staticText = "Prevent all combat damage that would be dealt to {this} " + duration.toString(); - } + } - public PreventCombatDamageSourceEffect(final PreventCombatDamageSourceEffect effect) { + public PreventCombatDamageSourceEffect(final PreventCombatDamageSourceEffect effect) { super(effect); - } + } - @Override - public PreventCombatDamageSourceEffect copy() { + @Override + public PreventCombatDamageSourceEffect copy() { return new PreventCombatDamageSourceEffect(this); - } + } - @Override - public boolean apply(Game game, Ability source) { + @Override + public boolean apply(Game game, Ability source) { return true; - } + } - @Override - public boolean replaceEvent(GameEvent event, Ability source, Game game) { + @Override + public boolean replaceEvent(GameEvent event, Ability source, Game game) { GameEvent preventEvent = new GameEvent(GameEvent.EventType.PREVENT_DAMAGE, source.getFirstTarget(), source.getId(), source.getControllerId(), event.getAmount(), false); if (!game.replaceEvent(preventEvent)) { int damage = event.getAmount(); @@ -72,8 +72,8 @@ public class PreventCombatDamageSourceEffect extends PreventionEffectImpl { - private int amount; - private boolean all; + private int amount; + private boolean all; - public PreventDamageFromTargetEffect(Duration duration, int amount) { - super(duration); - this.amount = amount; - } + public PreventDamageFromTargetEffect(Duration duration, int amount) { + super(duration); + this.amount = amount; + } - public PreventDamageFromTargetEffect(Duration duration, boolean all) { - super(duration); - this.amount = 0; - this.all = all; - } + public PreventDamageFromTargetEffect(Duration duration, boolean all) { + super(duration); + this.amount = 0; + this.all = all; + } - public PreventDamageFromTargetEffect(final PreventDamageFromTargetEffect effect) { - super(effect); - this.amount = effect.amount; - this.all = effect.all; - } + public PreventDamageFromTargetEffect(final PreventDamageFromTargetEffect effect) { + super(effect); + this.amount = effect.amount; + this.all = effect.all; + } - @Override - public PreventDamageFromTargetEffect copy() { - return new PreventDamageFromTargetEffect(this); - } + @Override + public PreventDamageFromTargetEffect copy() { + return new PreventDamageFromTargetEffect(this); + } - @Override - public boolean apply(Game game, Ability source) { - return true; - } + @Override + public boolean apply(Game game, Ability source) { + return true; + } - @Override - public boolean replaceEvent(GameEvent event, Ability source, Game game) { - for (Target target : source.getTargets()) { - for (UUID chosen : target.getTargets()) { - if (event.getSourceId().equals(chosen)) { - preventDamage(event, source, chosen, game); - } - } - } - return false; - } + @Override + public boolean replaceEvent(GameEvent event, Ability source, Game game) { + for (Target target : source.getTargets()) { + for (UUID chosen : target.getTargets()) { + if (event.getSourceId().equals(chosen)) { + preventDamage(event, source, chosen, game); + } + } + } + return false; + } - private void preventDamage(GameEvent event, Ability source, UUID target, Game game) { - GameEvent preventEvent = new GameEvent(GameEvent.EventType.PREVENT_DAMAGE, target, source.getId(), source.getControllerId(), event.getAmount(), false); - if (!game.replaceEvent(preventEvent)) { - if (all) { - int damage = event.getAmount(); - event.setAmount(0); - game.fireEvent(GameEvent.getEvent(GameEvent.EventType.PREVENTED_DAMAGE, target, source.getId(), source.getControllerId(), damage)); - } else { - if (event.getAmount() >= this.amount) { - int damage = amount; - event.setAmount(event.getAmount() - amount); - this.used = true; - game.fireEvent(GameEvent.getEvent(GameEvent.EventType.PREVENTED_DAMAGE, target, source.getId(), source.getControllerId(), damage)); - } else { - int damage = event.getAmount(); - event.setAmount(0); - amount -= damage; - game.fireEvent(GameEvent.getEvent(GameEvent.EventType.PREVENTED_DAMAGE, target, source.getId(), source.getControllerId(), damage)); - } - } - } - } + private void preventDamage(GameEvent event, Ability source, UUID target, Game game) { + GameEvent preventEvent = new GameEvent(GameEvent.EventType.PREVENT_DAMAGE, target, source.getId(), source.getControllerId(), event.getAmount(), false); + if (!game.replaceEvent(preventEvent)) { + if (all) { + int damage = event.getAmount(); + event.setAmount(0); + game.fireEvent(GameEvent.getEvent(GameEvent.EventType.PREVENTED_DAMAGE, target, source.getId(), source.getControllerId(), damage)); + } else { + if (event.getAmount() >= this.amount) { + int damage = amount; + event.setAmount(event.getAmount() - amount); + this.used = true; + game.fireEvent(GameEvent.getEvent(GameEvent.EventType.PREVENTED_DAMAGE, target, source.getId(), source.getControllerId(), damage)); + } else { + int damage = event.getAmount(); + event.setAmount(0); + amount -= damage; + game.fireEvent(GameEvent.getEvent(GameEvent.EventType.PREVENTED_DAMAGE, target, source.getId(), source.getControllerId(), damage)); + } + } + } + } - @Override - public boolean applies(GameEvent event, Ability source, Game game) { - if (!this.used && super.applies(event, source, game)) { - for (Target target : source.getTargets()) { - for (UUID chosen : target.getTargets()) { - if (event.getSourceId().equals(chosen)) { - return true; - } - } - } - } - return false; - } + @Override + public boolean applies(GameEvent event, Ability source, Game game) { + if (!this.used && super.applies(event, source, game)) { + for (Target target : source.getTargets()) { + for (UUID chosen : target.getTargets()) { + if (event.getSourceId().equals(chosen)) { + return true; + } + } + } + } + return false; + } - @Override - public String getText(Mode mode) { - if (this.all) { - StringBuilder sb = new StringBuilder(); - sb.append("Prevent all damage target "); - sb.append(mode.getTargets().get(0).getTargetName()).append(" would deal ").append(duration.toString()); - return sb.toString(); - } else { - StringBuilder sb = new StringBuilder(); - sb.append("Prevent the next ").append(amount).append(" damage that "); - sb.append(mode.getTargets().get(0).getTargetName()).append(" would deal ").append(duration.toString()); - return sb.toString(); - } + @Override + public String getText(Mode mode) { + if (this.all) { + StringBuilder sb = new StringBuilder(); + sb.append("Prevent all damage target "); + sb.append(mode.getTargets().get(0).getTargetName()).append(" would deal ").append(duration.toString()); + return sb.toString(); + } else { + StringBuilder sb = new StringBuilder(); + sb.append("Prevent the next ").append(amount).append(" damage that "); + sb.append(mode.getTargets().get(0).getTargetName()).append(" would deal ").append(duration.toString()); + return sb.toString(); + } - } + } } diff --git a/Mage/src/mage/abilities/effects/common/PreventDamageTargetEffect.java b/Mage/src/mage/abilities/effects/common/PreventDamageTargetEffect.java index 07a959a771..29f62a1f08 100644 --- a/Mage/src/mage/abilities/effects/common/PreventDamageTargetEffect.java +++ b/Mage/src/mage/abilities/effects/common/PreventDamageTargetEffect.java @@ -41,65 +41,65 @@ import mage.game.events.GameEvent; */ public class PreventDamageTargetEffect extends PreventionEffectImpl { - private int amount; + private int amount; - public PreventDamageTargetEffect(Duration duration, int amount) { - super(duration); - this.amount = amount; - } + public PreventDamageTargetEffect(Duration duration, int amount) { + super(duration); + this.amount = amount; + } - public PreventDamageTargetEffect(final PreventDamageTargetEffect effect) { - super(effect); - this.amount = effect.amount; - } + public PreventDamageTargetEffect(final PreventDamageTargetEffect effect) { + super(effect); + this.amount = effect.amount; + } - @Override - public PreventDamageTargetEffect copy() { - return new PreventDamageTargetEffect(this); - } + @Override + public PreventDamageTargetEffect copy() { + return new PreventDamageTargetEffect(this); + } - @Override - public boolean apply(Game game, Ability source) { - return true; - } + @Override + public boolean apply(Game game, Ability source) { + return true; + } - @Override - public boolean replaceEvent(GameEvent event, Ability source, Game game) { - GameEvent preventEvent = new GameEvent(GameEvent.EventType.PREVENT_DAMAGE, source.getFirstTarget(), source.getId(), source.getControllerId(), event.getAmount(), false); - if (!game.replaceEvent(preventEvent)) { - if (event.getAmount() >= this.amount) { - int damage = amount; - event.setAmount(event.getAmount() - amount); - this.used = true; - game.fireEvent(GameEvent.getEvent(GameEvent.EventType.PREVENTED_DAMAGE, source.getFirstTarget(), source.getId(), source.getControllerId(), damage)); - } else { - int damage = event.getAmount(); - event.setAmount(0); - amount -= damage; - game.fireEvent(GameEvent.getEvent(GameEvent.EventType.PREVENTED_DAMAGE, source.getFirstTarget(), source.getId(), source.getControllerId(), damage)); - } - } - return false; - } + @Override + public boolean replaceEvent(GameEvent event, Ability source, Game game) { + GameEvent preventEvent = new GameEvent(GameEvent.EventType.PREVENT_DAMAGE, source.getFirstTarget(), source.getId(), source.getControllerId(), event.getAmount(), false); + if (!game.replaceEvent(preventEvent)) { + if (event.getAmount() >= this.amount) { + int damage = amount; + event.setAmount(event.getAmount() - amount); + this.used = true; + game.fireEvent(GameEvent.getEvent(GameEvent.EventType.PREVENTED_DAMAGE, source.getFirstTarget(), source.getId(), source.getControllerId(), damage)); + } else { + int damage = event.getAmount(); + event.setAmount(0); + amount -= damage; + game.fireEvent(GameEvent.getEvent(GameEvent.EventType.PREVENTED_DAMAGE, source.getFirstTarget(), source.getId(), source.getControllerId(), damage)); + } + } + return false; + } - @Override - public boolean applies(GameEvent event, Ability source, Game game) { - if (!this.used && super.applies(event, source, game) && event.getTargetId().equals(source.getFirstTarget())) { - return true; - } - return false; - } + @Override + public boolean applies(GameEvent event, Ability source, Game game) { + if (!this.used && super.applies(event, source, game) && event.getTargetId().equals(source.getFirstTarget())) { + return true; + } + return false; + } - @Override - public String getText(Mode mode) { - StringBuilder sb = new StringBuilder(); + @Override + public String getText(Mode mode) { + StringBuilder sb = new StringBuilder(); if (amount == Integer.MAX_VALUE) { sb.append("Prevent all damage that would be dealt to target "); } else { sb.append("Prevent the next ").append(amount).append(" damage that would be dealt to target "); } - sb.append(mode.getTargets().get(0).getTargetName()).append(" ").append(duration.toString()); - return sb.toString(); - } + sb.append(mode.getTargets().get(0).getTargetName()).append(" ").append(duration.toString()); + return sb.toString(); + } } diff --git a/Mage/src/mage/abilities/effects/common/PutLibraryIntoGraveTargetEffect.java b/Mage/src/mage/abilities/effects/common/PutLibraryIntoGraveTargetEffect.java index 8194317290..a23e10b761 100644 --- a/Mage/src/mage/abilities/effects/common/PutLibraryIntoGraveTargetEffect.java +++ b/Mage/src/mage/abilities/effects/common/PutLibraryIntoGraveTargetEffect.java @@ -45,47 +45,47 @@ import mage.players.Player; */ public class PutLibraryIntoGraveTargetEffect extends OneShotEffect { - private DynamicValue amount; + private DynamicValue amount; public PutLibraryIntoGraveTargetEffect(int amount) { this(new StaticValue(amount)); } - public PutLibraryIntoGraveTargetEffect(DynamicValue amount) { - super(Outcome.Detriment); - this.amount = amount; - } + public PutLibraryIntoGraveTargetEffect(DynamicValue amount) { + super(Outcome.Detriment); + this.amount = amount; + } - public PutLibraryIntoGraveTargetEffect(final PutLibraryIntoGraveTargetEffect effect) { - super(effect); - this.amount = effect.amount.clone(); - } + public PutLibraryIntoGraveTargetEffect(final PutLibraryIntoGraveTargetEffect effect) { + super(effect); + this.amount = effect.amount.clone(); + } - public void setAmount(DynamicValue value) { - this.amount = value; - } + public void setAmount(DynamicValue value) { + this.amount = value; + } - @Override - public PutLibraryIntoGraveTargetEffect copy() { - return new PutLibraryIntoGraveTargetEffect(this); - } + @Override + public PutLibraryIntoGraveTargetEffect copy() { + return new PutLibraryIntoGraveTargetEffect(this); + } - @Override - public boolean apply(Game game, Ability source) { - Player player = game.getPlayer(targetPointer.getFirst(game, source)); - if (player != null) { - // putting cards to grave shouldn't end the game, so getting minimun available - int cardsCount = Math.min(amount.calculate(game, source), player.getLibrary().size()); - for (int i = 0; i < cardsCount; i++) { - Card card = player.getLibrary().removeFromTop(game); - if (card != null) - card.moveToZone(Zone.GRAVEYARD, source.getId(), game, false); - else - break; - } - } - return true; - } + @Override + public boolean apply(Game game, Ability source) { + Player player = game.getPlayer(targetPointer.getFirst(game, source)); + if (player != null) { + // putting cards to grave shouldn't end the game, so getting minimun available + int cardsCount = Math.min(amount.calculate(game, source), player.getLibrary().size()); + for (int i = 0; i < cardsCount; i++) { + Card card = player.getLibrary().removeFromTop(game); + if (card != null) + card.moveToZone(Zone.GRAVEYARD, source.getId(), game, false); + else + break; + } + } + return true; + } @Override public String getText(Mode mode) { diff --git a/Mage/src/mage/abilities/effects/common/PutOntoBattlefieldTargetEffect.java b/Mage/src/mage/abilities/effects/common/PutOntoBattlefieldTargetEffect.java index 1118adb5c2..0df2d20c57 100644 --- a/Mage/src/mage/abilities/effects/common/PutOntoBattlefieldTargetEffect.java +++ b/Mage/src/mage/abilities/effects/common/PutOntoBattlefieldTargetEffect.java @@ -43,7 +43,7 @@ import java.util.UUID; * @author LevelX */ public class PutOntoBattlefieldTargetEffect extends OneShotEffect { - + boolean tapped; public PutOntoBattlefieldTargetEffect(boolean tapped) { diff --git a/Mage/src/mage/abilities/effects/common/RegenerateSourceEffect.java b/Mage/src/mage/abilities/effects/common/RegenerateSourceEffect.java index d9aed09641..0f728f33e8 100644 --- a/Mage/src/mage/abilities/effects/common/RegenerateSourceEffect.java +++ b/Mage/src/mage/abilities/effects/common/RegenerateSourceEffect.java @@ -43,43 +43,43 @@ import mage.game.permanent.Permanent; */ public class RegenerateSourceEffect extends ReplacementEffectImpl { - public RegenerateSourceEffect() { - super(Duration.EndOfTurn, Outcome.Regenerate); - staticText = "Regenerate {this}"; - } + public RegenerateSourceEffect() { + super(Duration.EndOfTurn, Outcome.Regenerate); + staticText = "Regenerate {this}"; + } - public RegenerateSourceEffect(final RegenerateSourceEffect effect) { - super(effect); - } + public RegenerateSourceEffect(final RegenerateSourceEffect effect) { + super(effect); + } - @Override - public boolean apply(Game game, Ability source) { - //20110204 - 701.11 - Permanent permanent = game.getPermanent(source.getSourceId()); - if (permanent != null && permanent.regenerate(this.getId(), game)) { - this.used = true; - return true; - } - return false; - } + @Override + public boolean apply(Game game, Ability source) { + //20110204 - 701.11 + Permanent permanent = game.getPermanent(source.getSourceId()); + if (permanent != null && permanent.regenerate(this.getId(), game)) { + this.used = true; + return true; + } + return false; + } - @Override - public RegenerateSourceEffect copy() { - return new RegenerateSourceEffect(this); - } + @Override + public RegenerateSourceEffect copy() { + return new RegenerateSourceEffect(this); + } - @Override - public boolean replaceEvent(GameEvent event, Ability source, Game game) { - return apply(game, source); - } + @Override + public boolean replaceEvent(GameEvent event, Ability source, Game game) { + return apply(game, source); + } - @Override - public boolean applies(GameEvent event, Ability source, Game game) { - //20110204 - 701.11c - event.getAmount() is used to signal if regeneration is allowed - if (event.getType() == EventType.DESTROY_PERMANENT && event.getAmount() == 0 && event.getTargetId().equals(source.getSourceId()) && !this.used) { - return true; - } - return false; - } + @Override + public boolean applies(GameEvent event, Ability source, Game game) { + //20110204 - 701.11c - event.getAmount() is used to signal if regeneration is allowed + if (event.getType() == EventType.DESTROY_PERMANENT && event.getAmount() == 0 && event.getTargetId().equals(source.getSourceId()) && !this.used) { + return true; + } + return false; + } } diff --git a/Mage/src/mage/abilities/effects/common/RegenerateTargetEffect.java b/Mage/src/mage/abilities/effects/common/RegenerateTargetEffect.java index 1d344fddfb..30210346e4 100644 --- a/Mage/src/mage/abilities/effects/common/RegenerateTargetEffect.java +++ b/Mage/src/mage/abilities/effects/common/RegenerateTargetEffect.java @@ -44,52 +44,52 @@ import mage.game.permanent.Permanent; */ public class RegenerateTargetEffect extends ReplacementEffectImpl { - public RegenerateTargetEffect ( ) { - super(Duration.EndOfTurn, Outcome.Regenerate); - } + public RegenerateTargetEffect ( ) { + super(Duration.EndOfTurn, Outcome.Regenerate); + } - public RegenerateTargetEffect(final RegenerateTargetEffect effect) { - super(effect); - } + public RegenerateTargetEffect(final RegenerateTargetEffect effect) { + super(effect); + } - @Override - public boolean apply(Game game, Ability source) { - //20110204 - 701.11 - Permanent permanent = game.getPermanent(targetPointer.getFirst(game, source)); - if (permanent != null && permanent.regenerate(this.getId(), game)) { - this.used = true; - return true; - } - return false; - } + @Override + public boolean apply(Game game, Ability source) { + //20110204 - 701.11 + Permanent permanent = game.getPermanent(targetPointer.getFirst(game, source)); + if (permanent != null && permanent.regenerate(this.getId(), game)) { + this.used = true; + return true; + } + return false; + } - @Override - public RegenerateTargetEffect copy() { - return new RegenerateTargetEffect(this); - } + @Override + public RegenerateTargetEffect copy() { + return new RegenerateTargetEffect(this); + } - @Override - public boolean replaceEvent(GameEvent event, Ability source, Game game) { - return apply(game, source); - } + @Override + public boolean replaceEvent(GameEvent event, Ability source, Game game) { + return apply(game, source); + } - @Override - public boolean applies(GameEvent event, Ability source, Game game) { - //20110204 - 701.11c - event.getAmount() is used to signal if regeneration is allowed - if (event.getType() == EventType.DESTROY_PERMANENT && event.getAmount() == 0 && event.getTargetId().equals(targetPointer.getFirst(game, source)) && !this.used) { - return true; - } - return false; - } + @Override + public boolean applies(GameEvent event, Ability source, Game game) { + //20110204 - 701.11c - event.getAmount() is used to signal if regeneration is allowed + if (event.getType() == EventType.DESTROY_PERMANENT && event.getAmount() == 0 && event.getTargetId().equals(targetPointer.getFirst(game, source)) && !this.used) { + return true; + } + return false; + } - @Override - public String getText(Mode mode) { - StringBuilder sb = new StringBuilder(); - sb.append("Regenerate target "); - if ( mode != null ) { - sb.append(mode.getTargets().get(0).getTargetName()); - } - return sb.toString(); - } + @Override + public String getText(Mode mode) { + StringBuilder sb = new StringBuilder(); + sb.append("Regenerate target "); + if ( mode != null ) { + sb.append(mode.getTargets().get(0).getTargetName()); + } + return sb.toString(); + } } diff --git a/Mage/src/mage/abilities/effects/common/RemoveDelayedTriggeredAbilityEffect.java b/Mage/src/mage/abilities/effects/common/RemoveDelayedTriggeredAbilityEffect.java index 05d55d8138..7aba37cb06 100644 --- a/Mage/src/mage/abilities/effects/common/RemoveDelayedTriggeredAbilityEffect.java +++ b/Mage/src/mage/abilities/effects/common/RemoveDelayedTriggeredAbilityEffect.java @@ -40,28 +40,28 @@ import mage.game.Game; */ public class RemoveDelayedTriggeredAbilityEffect extends OneShotEffect { - protected UUID abilityId; + protected UUID abilityId; - public RemoveDelayedTriggeredAbilityEffect(UUID abilityId) { - super(Outcome.Neutral); - this.abilityId = abilityId; - staticText = "remove triggered ability"; - } + public RemoveDelayedTriggeredAbilityEffect(UUID abilityId) { + super(Outcome.Neutral); + this.abilityId = abilityId; + staticText = "remove triggered ability"; + } - public RemoveDelayedTriggeredAbilityEffect(final RemoveDelayedTriggeredAbilityEffect effect) { - super(effect); - this.abilityId = effect.abilityId; - } + public RemoveDelayedTriggeredAbilityEffect(final RemoveDelayedTriggeredAbilityEffect effect) { + super(effect); + this.abilityId = effect.abilityId; + } - @Override - public RemoveDelayedTriggeredAbilityEffect copy() { - return new RemoveDelayedTriggeredAbilityEffect(this); - } + @Override + public RemoveDelayedTriggeredAbilityEffect copy() { + return new RemoveDelayedTriggeredAbilityEffect(this); + } - @Override - public boolean apply(Game game, Ability source) { - game.getState().removeDelayedTriggeredAbility(abilityId); - return true; - } + @Override + public boolean apply(Game game, Ability source) { + game.getState().removeDelayedTriggeredAbility(abilityId); + return true; + } } diff --git a/Mage/src/mage/abilities/effects/common/RemoveFromCombatTargetEffect.java b/Mage/src/mage/abilities/effects/common/RemoveFromCombatTargetEffect.java index edb067ea31..b98ff319cf 100644 --- a/Mage/src/mage/abilities/effects/common/RemoveFromCombatTargetEffect.java +++ b/Mage/src/mage/abilities/effects/common/RemoveFromCombatTargetEffect.java @@ -44,11 +44,11 @@ public class RemoveFromCombatTargetEffect extends OneShotEffect { - protected UUID actionId; + protected UUID actionId; - public RemoveSpecialActionEffect(UUID actionId) { - super(Outcome.Neutral); - this.actionId = actionId; - } + public RemoveSpecialActionEffect(UUID actionId) { + super(Outcome.Neutral); + this.actionId = actionId; + } - public RemoveSpecialActionEffect(final RemoveSpecialActionEffect effect) { - super(effect); - this.actionId = effect.actionId; - } + public RemoveSpecialActionEffect(final RemoveSpecialActionEffect effect) { + super(effect); + this.actionId = effect.actionId; + } - @Override - public RemoveSpecialActionEffect copy() { - return new RemoveSpecialActionEffect(this); - } + @Override + public RemoveSpecialActionEffect copy() { + return new RemoveSpecialActionEffect(this); + } - @Override - public boolean apply(Game game, Ability source) { - for (SpecialAction action: game.getState().getSpecialActions()) { - if (action.getId().equals(actionId)) { - game.getState().getSpecialActions().remove(action); - break; - } - } - return true; - } + @Override + public boolean apply(Game game, Ability source) { + for (SpecialAction action: game.getState().getSpecialActions()) { + if (action.getId().equals(actionId)) { + game.getState().getSpecialActions().remove(action); + break; + } + } + return true; + } } diff --git a/Mage/src/mage/abilities/effects/common/ReturnFromExileEffect.java b/Mage/src/mage/abilities/effects/common/ReturnFromExileEffect.java index eeeca638bb..96c184ce60 100644 --- a/Mage/src/mage/abilities/effects/common/ReturnFromExileEffect.java +++ b/Mage/src/mage/abilities/effects/common/ReturnFromExileEffect.java @@ -43,71 +43,71 @@ import mage.game.Game; */ public class ReturnFromExileEffect extends OneShotEffect { - private UUID exileId; - private Zone zone; - private boolean tapped; + private UUID exileId; + private Zone zone; + private boolean tapped; - public ReturnFromExileEffect(UUID exileId, Zone zone) { - this(exileId, zone, false); - } + public ReturnFromExileEffect(UUID exileId, Zone zone) { + this(exileId, zone, false); + } public ReturnFromExileEffect(UUID exileId, Zone zone, String text) { - this(exileId, zone, false); + this(exileId, zone, false); staticText = text; - } + } - public ReturnFromExileEffect(UUID exileId, Zone zone, boolean tapped) { - super(Outcome.PutCardInPlay); - this.exileId = exileId; - this.zone = zone; - this.tapped = tapped; + public ReturnFromExileEffect(UUID exileId, Zone zone, boolean tapped) { + super(Outcome.PutCardInPlay); + this.exileId = exileId; + this.zone = zone; + this.tapped = tapped; setText(); - } + } - public ReturnFromExileEffect(final ReturnFromExileEffect effect) { - super(effect); - this.exileId = effect.exileId; - this.zone = effect.zone; - this.tapped = effect.tapped; - } + public ReturnFromExileEffect(final ReturnFromExileEffect effect) { + super(effect); + this.exileId = effect.exileId; + this.zone = effect.zone; + this.tapped = effect.tapped; + } - @Override - public ReturnFromExileEffect copy() { - return new ReturnFromExileEffect(this); - } + @Override + public ReturnFromExileEffect copy() { + return new ReturnFromExileEffect(this); + } - @Override - public boolean apply(Game game, Ability source) { - ExileZone exile = game.getExile().getExileZone(exileId); - if (exile != null) { + @Override + public boolean apply(Game game, Ability source) { + ExileZone exile = game.getExile().getExileZone(exileId); + if (exile != null) { exile = exile.copy(); - for (UUID cardId: exile) { - Card card = game.getCard(cardId); - card.moveToZone(zone, source.getId(), game, tapped); - } - game.getExile().getExileZone(exileId).clear(); - return true; - } - return false; - } + for (UUID cardId: exile) { + Card card = game.getCard(cardId); + card.moveToZone(zone, source.getId(), game, tapped); + } + game.getExile().getExileZone(exileId).clear(); + return true; + } + return false; + } - private void setText() { - StringBuilder sb = new StringBuilder(); - sb.append("return the exiled cards "); - switch(zone) { - case BATTLEFIELD: - sb.append("to the battlefield under its owner's control"); - if (tapped) - sb.append(" tapped"); - break; - case HAND: - sb.append("to their owner's hand"); - break; - case GRAVEYARD: - sb.append("to their owner's graveyard"); - break; - } - staticText = sb.toString(); - } + private void setText() { + StringBuilder sb = new StringBuilder(); + sb.append("return the exiled cards "); + switch(zone) { + case BATTLEFIELD: + sb.append("to the battlefield under its owner's control"); + if (tapped) + sb.append(" tapped"); + break; + case HAND: + sb.append("to their owner's hand"); + break; + case GRAVEYARD: + sb.append("to their owner's graveyard"); + break; + } + staticText = sb.toString(); + } } diff --git a/Mage/src/mage/abilities/effects/common/ReturnFromExileForSourceEffect.java b/Mage/src/mage/abilities/effects/common/ReturnFromExileForSourceEffect.java index c9c3c6a7f4..2114a7de2e 100644 --- a/Mage/src/mage/abilities/effects/common/ReturnFromExileForSourceEffect.java +++ b/Mage/src/mage/abilities/effects/common/ReturnFromExileForSourceEffect.java @@ -44,64 +44,64 @@ import mage.game.Game; */ public class ReturnFromExileForSourceEffect extends OneShotEffect { - private Zone zone; - private boolean tapped; + private Zone zone; + private boolean tapped; - public ReturnFromExileForSourceEffect(Zone zone) { - this(zone, false); - } + public ReturnFromExileForSourceEffect(Zone zone) { + this(zone, false); + } - public ReturnFromExileForSourceEffect(Zone zone, boolean tapped) { - super(Outcome.PutCardInPlay); - this.zone = zone; - this.tapped = tapped; - setText(); - } + public ReturnFromExileForSourceEffect(Zone zone, boolean tapped) { + super(Outcome.PutCardInPlay); + this.zone = zone; + this.tapped = tapped; + setText(); + } - public ReturnFromExileForSourceEffect(final ReturnFromExileForSourceEffect effect) { - super(effect); - this.zone = effect.zone; - this.tapped = effect.tapped; - } + public ReturnFromExileForSourceEffect(final ReturnFromExileForSourceEffect effect) { + super(effect); + this.zone = effect.zone; + this.tapped = effect.tapped; + } - @Override - public ReturnFromExileForSourceEffect copy() { - return new ReturnFromExileForSourceEffect(this); - } + @Override + public ReturnFromExileForSourceEffect copy() { + return new ReturnFromExileForSourceEffect(this); + } - @Override - public boolean apply(Game game, Ability source) { - UUID exileId = source.getSourceId(); - ExileZone exile = game.getExile().getExileZone(exileId); - if (exile != null) { + @Override + public boolean apply(Game game, Ability source) { + UUID exileId = source.getSourceId(); + ExileZone exile = game.getExile().getExileZone(exileId); + if (exile != null) { LinkedList cards = new LinkedList(exile); - for (UUID cardId: cards) { - Card card = game.getCard(cardId); - card.moveToZone(zone, source.getId(), game, tapped); - } - exile.clear(); - return true; - } - return false; - } + for (UUID cardId: cards) { + Card card = game.getCard(cardId); + card.moveToZone(zone, source.getId(), game, tapped); + } + exile.clear(); + return true; + } + return false; + } - private void setText() { - StringBuilder sb = new StringBuilder(); - sb.append("return the exiled cards "); - switch(zone) { - case BATTLEFIELD: - sb.append("to the battlefield under its owner's control"); - if (tapped) - sb.append(" tapped"); - break; - case HAND: - sb.append("to their owner's hand"); - break; - case GRAVEYARD: - sb.append("to their owner's graveyard"); - break; - } - staticText = sb.toString(); - } + private void setText() { + StringBuilder sb = new StringBuilder(); + sb.append("return the exiled cards "); + switch(zone) { + case BATTLEFIELD: + sb.append("to the battlefield under its owner's control"); + if (tapped) + sb.append(" tapped"); + break; + case HAND: + sb.append("to their owner's hand"); + break; + case GRAVEYARD: + sb.append("to their owner's graveyard"); + break; + } + staticText = sb.toString(); + } } diff --git a/Mage/src/mage/abilities/effects/common/ReturnFromGraveyardToBattlefieldTargetEffect.java b/Mage/src/mage/abilities/effects/common/ReturnFromGraveyardToBattlefieldTargetEffect.java index 9959d391e4..42d2d2fcda 100644 --- a/Mage/src/mage/abilities/effects/common/ReturnFromGraveyardToBattlefieldTargetEffect.java +++ b/Mage/src/mage/abilities/effects/common/ReturnFromGraveyardToBattlefieldTargetEffect.java @@ -44,54 +44,54 @@ import mage.players.Player; */ public class ReturnFromGraveyardToBattlefieldTargetEffect extends OneShotEffect { - private boolean tapped; + private boolean tapped; - public ReturnFromGraveyardToBattlefieldTargetEffect() { - this(false); - } + public ReturnFromGraveyardToBattlefieldTargetEffect() { + this(false); + } - public ReturnFromGraveyardToBattlefieldTargetEffect(boolean tapped) { - super(Outcome.PutCreatureInPlay); - this.tapped = tapped; - } + public ReturnFromGraveyardToBattlefieldTargetEffect(boolean tapped) { + super(Outcome.PutCreatureInPlay); + this.tapped = tapped; + } - public ReturnFromGraveyardToBattlefieldTargetEffect(final ReturnFromGraveyardToBattlefieldTargetEffect effect) { - super(effect); - this.tapped = effect.tapped; - } + public ReturnFromGraveyardToBattlefieldTargetEffect(final ReturnFromGraveyardToBattlefieldTargetEffect effect) { + super(effect); + this.tapped = effect.tapped; + } - @Override - public ReturnFromGraveyardToBattlefieldTargetEffect copy() { - return new ReturnFromGraveyardToBattlefieldTargetEffect(this); - } + @Override + public ReturnFromGraveyardToBattlefieldTargetEffect copy() { + return new ReturnFromGraveyardToBattlefieldTargetEffect(this); + } - @Override - public boolean apply(Game game, Ability source) { - Card card = game.getCard(source.getFirstTarget()); - if (card != null) { - Player player = game.getPlayer(card.getOwnerId()); - if (player != null) { - if (card.putOntoBattlefield(game, Zone.GRAVEYARD, source.getId(), source.getControllerId())) { - if (tapped) { - Permanent permanent = game.getPermanent(card.getId()); - if (permanent != null) - permanent.setTapped(true); - } - return true; - } - } - } - return false; - } + @Override + public boolean apply(Game game, Ability source) { + Card card = game.getCard(source.getFirstTarget()); + if (card != null) { + Player player = game.getPlayer(card.getOwnerId()); + if (player != null) { + if (card.putOntoBattlefield(game, Zone.GRAVEYARD, source.getId(), source.getControllerId())) { + if (tapped) { + Permanent permanent = game.getPermanent(card.getId()); + if (permanent != null) + permanent.setTapped(true); + } + return true; + } + } + } + return false; + } - @Override - public String getText(Mode mode) { - StringBuilder sb = new StringBuilder(); - sb.append("Put target ").append(mode.getTargets().get(0).getTargetName()).append(" onto the battlefield"); - if (tapped) - sb.append(" tapped"); - sb.append(" under your control"); - return sb.toString(); - } + @Override + public String getText(Mode mode) { + StringBuilder sb = new StringBuilder(); + sb.append("Put target ").append(mode.getTargets().get(0).getTargetName()).append(" onto the battlefield"); + if (tapped) + sb.append(" tapped"); + sb.append(" under your control"); + return sb.toString(); + } } diff --git a/Mage/src/mage/abilities/effects/common/ReturnSourceFromGraveyardToBattlefieldEffect.java b/Mage/src/mage/abilities/effects/common/ReturnSourceFromGraveyardToBattlefieldEffect.java index f7570df1f1..3a84cf1b50 100644 --- a/Mage/src/mage/abilities/effects/common/ReturnSourceFromGraveyardToBattlefieldEffect.java +++ b/Mage/src/mage/abilities/effects/common/ReturnSourceFromGraveyardToBattlefieldEffect.java @@ -43,50 +43,50 @@ import mage.players.Player; */ public class ReturnSourceFromGraveyardToBattlefieldEffect extends OneShotEffect { - private boolean tapped; + private boolean tapped; - public ReturnSourceFromGraveyardToBattlefieldEffect() { - this(false); - } + public ReturnSourceFromGraveyardToBattlefieldEffect() { + this(false); + } - public ReturnSourceFromGraveyardToBattlefieldEffect(boolean tapped) { - super(Outcome.PutCreatureInPlay); - this.tapped = tapped; - setText(); - } + public ReturnSourceFromGraveyardToBattlefieldEffect(boolean tapped) { + super(Outcome.PutCreatureInPlay); + this.tapped = tapped; + setText(); + } - public ReturnSourceFromGraveyardToBattlefieldEffect(final ReturnSourceFromGraveyardToBattlefieldEffect effect) { - super(effect); - this.tapped = effect.tapped; - } + public ReturnSourceFromGraveyardToBattlefieldEffect(final ReturnSourceFromGraveyardToBattlefieldEffect effect) { + super(effect); + this.tapped = effect.tapped; + } - @Override - public ReturnSourceFromGraveyardToBattlefieldEffect copy() { - return new ReturnSourceFromGraveyardToBattlefieldEffect(this); - } + @Override + public ReturnSourceFromGraveyardToBattlefieldEffect copy() { + return new ReturnSourceFromGraveyardToBattlefieldEffect(this); + } - @Override - public boolean apply(Game game, Ability source) { - Player player = game.getPlayer(source.getControllerId()); - Card card = player.getGraveyard().get(source.getSourceId(), game); - if (card != null) { - if (card.putOntoBattlefield(game, Zone.GRAVEYARD, source.getId(), source.getControllerId())) { - if (tapped) { - Permanent permanent = game.getPermanent(card.getId()); - if (permanent != null) - permanent.setTapped(true); - } - return true; - } - } - return false; - } + @Override + public boolean apply(Game game, Ability source) { + Player player = game.getPlayer(source.getControllerId()); + Card card = player.getGraveyard().get(source.getSourceId(), game); + if (card != null) { + if (card.putOntoBattlefield(game, Zone.GRAVEYARD, source.getId(), source.getControllerId())) { + if (tapped) { + Permanent permanent = game.getPermanent(card.getId()); + if (permanent != null) + permanent.setTapped(true); + } + return true; + } + } + return false; + } - private void setText() { - if (tapped) - staticText = "Return {this} from your graveyard to the battlefield tapped"; - else - staticText = "Return {this} from your graveyard to the battlefield"; - } + private void setText() { + if (tapped) + staticText = "Return {this} from your graveyard to the battlefield tapped"; + else + staticText = "Return {this} from your graveyard to the battlefield"; + } } diff --git a/Mage/src/mage/abilities/effects/common/ReturnSourceFromGraveyardToHandEffect.java b/Mage/src/mage/abilities/effects/common/ReturnSourceFromGraveyardToHandEffect.java index 77805959d0..4f186ba2a3 100644 --- a/Mage/src/mage/abilities/effects/common/ReturnSourceFromGraveyardToHandEffect.java +++ b/Mage/src/mage/abilities/effects/common/ReturnSourceFromGraveyardToHandEffect.java @@ -42,30 +42,30 @@ import mage.players.Player; */ public class ReturnSourceFromGraveyardToHandEffect extends OneShotEffect { - public ReturnSourceFromGraveyardToHandEffect() { - super(Outcome.PutCreatureInPlay); - staticText = "Return {this} from your graveyard to your hand"; - } + public ReturnSourceFromGraveyardToHandEffect() { + super(Outcome.PutCreatureInPlay); + staticText = "Return {this} from your graveyard to your hand"; + } - public ReturnSourceFromGraveyardToHandEffect(final ReturnSourceFromGraveyardToHandEffect effect) { - super(effect); - } + public ReturnSourceFromGraveyardToHandEffect(final ReturnSourceFromGraveyardToHandEffect effect) { + super(effect); + } - @Override - public ReturnSourceFromGraveyardToHandEffect copy() { - return new ReturnSourceFromGraveyardToHandEffect(this); - } + @Override + public ReturnSourceFromGraveyardToHandEffect copy() { + return new ReturnSourceFromGraveyardToHandEffect(this); + } - @Override - public boolean apply(Game game, Ability source) { - Player player = game.getPlayer(source.getControllerId()); - Card card = player.getGraveyard().get(source.getSourceId(), game); - if (card != null) { - player.removeFromGraveyard(card, game); - card.moveToZone(Zone.HAND, source.getId(), game, false); - return true; - } - return false; - } + @Override + public boolean apply(Game game, Ability source) { + Player player = game.getPlayer(source.getControllerId()); + Card card = player.getGraveyard().get(source.getSourceId(), game); + if (card != null) { + player.removeFromGraveyard(card, game); + card.moveToZone(Zone.HAND, source.getId(), game, false); + return true; + } + return false; + } } diff --git a/Mage/src/mage/abilities/effects/common/ReturnToBattlefieldUnderYourControlAttachedEffect.java b/Mage/src/mage/abilities/effects/common/ReturnToBattlefieldUnderYourControlAttachedEffect.java index d2a9539a38..682a8950db 100644 --- a/Mage/src/mage/abilities/effects/common/ReturnToBattlefieldUnderYourControlAttachedEffect.java +++ b/Mage/src/mage/abilities/effects/common/ReturnToBattlefieldUnderYourControlAttachedEffect.java @@ -42,22 +42,22 @@ import mage.game.permanent.Permanent; */ public class ReturnToBattlefieldUnderYourControlAttachedEffect extends OneShotEffect { - public ReturnToBattlefieldUnderYourControlAttachedEffect() { - super(Outcome.Benefit); + public ReturnToBattlefieldUnderYourControlAttachedEffect() { + super(Outcome.Benefit); staticText = "return that card to the battlefield under your control"; - } + } - public ReturnToBattlefieldUnderYourControlAttachedEffect(final ReturnToBattlefieldUnderYourControlAttachedEffect effect) { - super(effect); - } + public ReturnToBattlefieldUnderYourControlAttachedEffect(final ReturnToBattlefieldUnderYourControlAttachedEffect effect) { + super(effect); + } - @Override - public ReturnToBattlefieldUnderYourControlAttachedEffect copy() { - return new ReturnToBattlefieldUnderYourControlAttachedEffect(this); - } + @Override + public ReturnToBattlefieldUnderYourControlAttachedEffect copy() { + return new ReturnToBattlefieldUnderYourControlAttachedEffect(this); + } - @Override - public boolean apply(Game game, Ability source) { + @Override + public boolean apply(Game game, Ability source) { Object object = getValue("attachedTo"); if (object != null && object instanceof Permanent) { Card card = game.getCard(((Permanent)object).getId()); @@ -69,7 +69,7 @@ public class ReturnToBattlefieldUnderYourControlAttachedEffect extends OneShotEf } } - return false; - } + return false; + } } diff --git a/Mage/src/mage/abilities/effects/common/ReturnToBattlefieldUnderYourControlSourceEffect.java b/Mage/src/mage/abilities/effects/common/ReturnToBattlefieldUnderYourControlSourceEffect.java index f72da05632..7ca626c0f1 100644 --- a/Mage/src/mage/abilities/effects/common/ReturnToBattlefieldUnderYourControlSourceEffect.java +++ b/Mage/src/mage/abilities/effects/common/ReturnToBattlefieldUnderYourControlSourceEffect.java @@ -41,22 +41,22 @@ import mage.game.Game; */ public class ReturnToBattlefieldUnderYourControlSourceEffect extends OneShotEffect { - public ReturnToBattlefieldUnderYourControlSourceEffect() { - super(Outcome.Benefit); + public ReturnToBattlefieldUnderYourControlSourceEffect() { + super(Outcome.Benefit); staticText = "return that card to the battlefield under your control"; - } + } - public ReturnToBattlefieldUnderYourControlSourceEffect(final ReturnToBattlefieldUnderYourControlSourceEffect effect) { - super(effect); - } + public ReturnToBattlefieldUnderYourControlSourceEffect(final ReturnToBattlefieldUnderYourControlSourceEffect effect) { + super(effect); + } - @Override - public ReturnToBattlefieldUnderYourControlSourceEffect copy() { - return new ReturnToBattlefieldUnderYourControlSourceEffect(this); - } + @Override + public ReturnToBattlefieldUnderYourControlSourceEffect copy() { + return new ReturnToBattlefieldUnderYourControlSourceEffect(this); + } - @Override - public boolean apply(Game game, Ability source) { + @Override + public boolean apply(Game game, Ability source) { Card card = game.getCard(source.getSourceId()); if (card != null) { Zone currentZone = game.getState().getZone(card.getId()); @@ -64,7 +64,7 @@ public class ReturnToBattlefieldUnderYourControlSourceEffect extends OneShotEffe return true; } } - return false; - } + return false; + } } diff --git a/Mage/src/mage/abilities/effects/common/ReturnToBattlefieldUnderYourControlTargetEffect.java b/Mage/src/mage/abilities/effects/common/ReturnToBattlefieldUnderYourControlTargetEffect.java index 4ed6a5c836..48af0c2e3b 100644 --- a/Mage/src/mage/abilities/effects/common/ReturnToBattlefieldUnderYourControlTargetEffect.java +++ b/Mage/src/mage/abilities/effects/common/ReturnToBattlefieldUnderYourControlTargetEffect.java @@ -41,22 +41,22 @@ import mage.game.Game; */ public class ReturnToBattlefieldUnderYourControlTargetEffect extends OneShotEffect { - public ReturnToBattlefieldUnderYourControlTargetEffect() { - super(Outcome.Benefit); + public ReturnToBattlefieldUnderYourControlTargetEffect() { + super(Outcome.Benefit); staticText = "return that card to the battlefield under your control"; - } + } - public ReturnToBattlefieldUnderYourControlTargetEffect(final ReturnToBattlefieldUnderYourControlTargetEffect effect) { - super(effect); - } + public ReturnToBattlefieldUnderYourControlTargetEffect(final ReturnToBattlefieldUnderYourControlTargetEffect effect) { + super(effect); + } - @Override - public ReturnToBattlefieldUnderYourControlTargetEffect copy() { - return new ReturnToBattlefieldUnderYourControlTargetEffect(this); - } + @Override + public ReturnToBattlefieldUnderYourControlTargetEffect copy() { + return new ReturnToBattlefieldUnderYourControlTargetEffect(this); + } - @Override - public boolean apply(Game game, Ability source) { + @Override + public boolean apply(Game game, Ability source) { Card card = game.getCard(targetPointer.getFirst(game, source)); if (card != null) { Zone currentZone = game.getState().getZone(card.getId()); @@ -64,7 +64,7 @@ public class ReturnToBattlefieldUnderYourControlTargetEffect extends OneShotEffe return true; } } - return false; - } + return false; + } } diff --git a/Mage/src/mage/abilities/effects/common/ReturnToHandSpellEffect.java b/Mage/src/mage/abilities/effects/common/ReturnToHandSpellEffect.java index 24ee99bb11..6226cba306 100644 --- a/Mage/src/mage/abilities/effects/common/ReturnToHandSpellEffect.java +++ b/Mage/src/mage/abilities/effects/common/ReturnToHandSpellEffect.java @@ -38,9 +38,9 @@ public class ReturnToHandSpellEffect extends PostResolveEffect { - protected int amount; - protected FilterControlledPermanent filter; + protected int amount; + protected FilterControlledPermanent filter; - public SacrificeAllEffect(FilterControlledPermanent filter) { - this(1, filter); - } + public SacrificeAllEffect(FilterControlledPermanent filter) { + this(1, filter); + } - public SacrificeAllEffect(int amount, FilterControlledPermanent filter) { - super(Outcome.Sacrifice); - this.amount = amount; - this.filter = filter; + public SacrificeAllEffect(int amount, FilterControlledPermanent filter) { + super(Outcome.Sacrifice); + this.amount = amount; + this.filter = filter; setText(); - } + } - public SacrificeAllEffect(final SacrificeAllEffect effect) { - super(effect); - this.amount = effect.amount; - this.filter = effect.filter.copy(); - } + public SacrificeAllEffect(final SacrificeAllEffect effect) { + super(effect); + this.amount = effect.amount; + this.filter = effect.filter.copy(); + } - @Override - public SacrificeAllEffect copy() { - return new SacrificeAllEffect(this); - } + @Override + public SacrificeAllEffect copy() { + return new SacrificeAllEffect(this); + } - @Override - public boolean apply(Game game, Ability source) { - List perms = new ArrayList(); - for (Player player: game.getPlayers().values()) { - int numTargets = Math.min(amount, game.getBattlefield().countAll(filter, player.getId(), game)); - TargetControlledPermanent target = new TargetControlledPermanent(numTargets, numTargets, filter, false); + @Override + public boolean apply(Game game, Ability source) { + List perms = new ArrayList(); + for (Player player: game.getPlayers().values()) { + int numTargets = Math.min(amount, game.getBattlefield().countAll(filter, player.getId(), game)); + TargetControlledPermanent target = new TargetControlledPermanent(numTargets, numTargets, filter, false); if (target.canChoose(player.getId(), game)) { - while (!target.isChosen()) { - player.choose(Outcome.Sacrifice, target, source.getSourceId(), game); - } - perms.addAll(target.getTargets()); - } - } - for (UUID permID: perms) { - Permanent permanent = game.getPermanent(permID); - if (permanent != null) - permanent.sacrifice(source.getSourceId(), game); - } - return true; - } + while (!target.isChosen()) { + player.choose(Outcome.Sacrifice, target, source.getSourceId(), game); + } + perms.addAll(target.getTargets()); + } + } + for (UUID permID: perms) { + Permanent permanent = game.getPermanent(permID); + if (permanent != null) + permanent.sacrifice(source.getSourceId(), game); + } + return true; + } - private void setText() { - StringBuilder sb = new StringBuilder(); - sb.append("Each players sacrifices "); - if (amount > 1) - sb.append(amount).append(" "); - else - sb.append("a "); - sb.append(filter.getMessage()); - staticText = sb.toString(); - } + private void setText() { + StringBuilder sb = new StringBuilder(); + sb.append("Each players sacrifices "); + if (amount > 1) + sb.append(amount).append(" "); + else + sb.append("a "); + sb.append(filter.getMessage()); + staticText = sb.toString(); + } } diff --git a/Mage/src/mage/abilities/effects/common/SacrificeControllerEffect.java b/Mage/src/mage/abilities/effects/common/SacrificeControllerEffect.java index ef495fcfca..aa4bf74e79 100644 --- a/Mage/src/mage/abilities/effects/common/SacrificeControllerEffect.java +++ b/Mage/src/mage/abilities/effects/common/SacrificeControllerEffect.java @@ -41,27 +41,27 @@ import mage.target.targetpointer.FixedTarget; public class SacrificeControllerEffect extends SacrificeEffect { - public SacrificeControllerEffect ( FilterPermanent filter, DynamicValue count, String preText ) { - super(filter, count, preText); - } + public SacrificeControllerEffect ( FilterPermanent filter, DynamicValue count, String preText ) { + super(filter, count, preText); + } public SacrificeControllerEffect ( FilterPermanent filter, int count, String preText ) { this(filter, new StaticValue(count), preText); } - public SacrificeControllerEffect (final SacrificeControllerEffect effect ) { - super(effect); - } - - @Override - public boolean apply(Game game, Ability source) { + public SacrificeControllerEffect (final SacrificeControllerEffect effect ) { + super(effect); + } + + @Override + public boolean apply(Game game, Ability source) { this.targetPointer = new FixedTarget(source.getControllerId()); return super.apply(game, source); - } + } - @Override - public SacrificeControllerEffect copy() { - return new SacrificeControllerEffect(this); - } + @Override + public SacrificeControllerEffect copy() { + return new SacrificeControllerEffect(this); + } } diff --git a/Mage/src/mage/abilities/effects/common/SacrificeEffect.java b/Mage/src/mage/abilities/effects/common/SacrificeEffect.java index 4294638925..ed9637ffa5 100644 --- a/Mage/src/mage/abilities/effects/common/SacrificeEffect.java +++ b/Mage/src/mage/abilities/effects/common/SacrificeEffect.java @@ -48,32 +48,32 @@ import java.util.UUID; */ public class SacrificeEffect extends OneShotEffect{ - private FilterPermanent filter; - private String preText; - private DynamicValue count; + private FilterPermanent filter; + private String preText; + private DynamicValue count; - public SacrificeEffect ( FilterPermanent filter, DynamicValue count, String preText ) { - super(Outcome.Sacrifice); - this.filter = filter; - this.count = count; - this.preText = preText; - setText(); - } + public SacrificeEffect ( FilterPermanent filter, DynamicValue count, String preText ) { + super(Outcome.Sacrifice); + this.filter = filter; + this.count = count; + this.preText = preText; + setText(); + } public SacrificeEffect ( FilterPermanent filter, int count, String preText ) { this(filter, new StaticValue(count), preText); } - public SacrificeEffect ( SacrificeEffect effect ) { - super(effect); - this.filter = effect.filter; - this.count = effect.count; - this.preText = effect.preText; - } - - @Override - public boolean apply(Game game, Ability source) { - Player player = game.getPlayer(targetPointer.getFirst(game, source)); + public SacrificeEffect ( SacrificeEffect effect ) { + super(effect); + this.filter = effect.filter; + this.count = effect.count; + this.preText = effect.preText; + } + + @Override + public boolean apply(Game game, Ability source) { + Player player = game.getPlayer(targetPointer.getFirst(game, source)); if (player == null) { return false; @@ -83,43 +83,43 @@ public class SacrificeEffect extends OneShotEffect{ int amount = count.calculate(game, source); int realCount = game.getBattlefield().countAll(filter, player.getId(), game); - amount = Math.min(amount, realCount); + amount = Math.min(amount, realCount); Target target = new TargetControlledPermanent(amount, amount, filter, false); target.setRequired(true); - //A spell or ability could have removed the only legal target this player - //had, if thats the case this ability should fizzle. - if (amount > 0 && target.canChoose(source.getSourceId(), player.getId(), game)) { - boolean abilityApplied = false; - while (!target.isChosen() && target.canChoose(player.getId(), game)) { - player.choose(Outcome.Sacrifice, target, source.getSourceId(), game); - } + //A spell or ability could have removed the only legal target this player + //had, if thats the case this ability should fizzle. + if (amount > 0 && target.canChoose(source.getSourceId(), player.getId(), game)) { + boolean abilityApplied = false; + while (!target.isChosen() && target.canChoose(player.getId(), game)) { + player.choose(Outcome.Sacrifice, target, source.getSourceId(), game); + } - for ( int idx = 0; idx < target.getTargets().size(); idx++) { - Permanent permanent = game.getPermanent((UUID)target.getTargets().get(idx)); + for ( int idx = 0; idx < target.getTargets().size(); idx++) { + Permanent permanent = game.getPermanent((UUID)target.getTargets().get(idx)); - if ( permanent != null ) { - abilityApplied |= permanent.sacrifice(source.getSourceId(), game); - } - } + if ( permanent != null ) { + abilityApplied |= permanent.sacrifice(source.getSourceId(), game); + } + } - return abilityApplied; - } - return false; - } + return abilityApplied; + } + return false; + } public void setAmount(DynamicValue amount) { this.count = amount; } - @Override - public SacrificeEffect copy() { - return new SacrificeEffect(this); - } + @Override + public SacrificeEffect copy() { + return new SacrificeEffect(this); + } - private void setText() { - StringBuilder sb = new StringBuilder(); + private void setText() { + StringBuilder sb = new StringBuilder(); sb.append(preText); if (preText.contains("player")) { sb.append(" sacrifices "); @@ -130,6 +130,6 @@ public class SacrificeEffect extends OneShotEffect{ sb.append(count).append(" "); } sb.append(filter.getMessage()); - staticText = sb.toString(); - } + staticText = sb.toString(); + } } diff --git a/Mage/src/mage/abilities/effects/common/SacrificeEquippedEffect.java b/Mage/src/mage/abilities/effects/common/SacrificeEquippedEffect.java index fe2c8f951a..3fb4b85332 100644 --- a/Mage/src/mage/abilities/effects/common/SacrificeEquippedEffect.java +++ b/Mage/src/mage/abilities/effects/common/SacrificeEquippedEffect.java @@ -42,34 +42,34 @@ import java.util.UUID; */ public class SacrificeEquippedEffect extends OneShotEffect { - public SacrificeEquippedEffect() { - super(Outcome.Sacrifice); - staticText = "sacrifice equipped permanent"; - } + public SacrificeEquippedEffect() { + super(Outcome.Sacrifice); + staticText = "sacrifice equipped permanent"; + } - public SacrificeEquippedEffect(final SacrificeEquippedEffect effect) { - super(effect); - } + public SacrificeEquippedEffect(final SacrificeEquippedEffect effect) { + super(effect); + } - @Override - public SacrificeEquippedEffect copy() { - return new SacrificeEquippedEffect(this); - } + @Override + public SacrificeEquippedEffect copy() { + return new SacrificeEquippedEffect(this); + } - @Override - public boolean apply(Game game, Ability source) { - Permanent equipment = game.getPermanent(source.getSourceId()); - if (equipment != null && equipment.getAttachedTo() != null) { - UUID uuid = getTargetPointer().getFirst(game, source); - Permanent permanent = game.getPermanent(uuid); - if (permanent == null) { - permanent = game.getPermanent(equipment.getAttachedTo()); - } - if (permanent != null) { - return permanent.sacrifice(source.getSourceId(), game); - } - } - return false; - } + @Override + public boolean apply(Game game, Ability source) { + Permanent equipment = game.getPermanent(source.getSourceId()); + if (equipment != null && equipment.getAttachedTo() != null) { + UUID uuid = getTargetPointer().getFirst(game, source); + Permanent permanent = game.getPermanent(uuid); + if (permanent == null) { + permanent = game.getPermanent(equipment.getAttachedTo()); + } + if (permanent != null) { + return permanent.sacrifice(source.getSourceId(), game); + } + } + return false; + } } diff --git a/Mage/src/mage/abilities/effects/common/SacrificeSourceEffect.java b/Mage/src/mage/abilities/effects/common/SacrificeSourceEffect.java index f123eb2166..a6a42a7b87 100644 --- a/Mage/src/mage/abilities/effects/common/SacrificeSourceEffect.java +++ b/Mage/src/mage/abilities/effects/common/SacrificeSourceEffect.java @@ -40,27 +40,27 @@ import mage.game.permanent.Permanent; */ public class SacrificeSourceEffect extends OneShotEffect { - public SacrificeSourceEffect() { - super(Outcome.Sacrifice); - staticText = "sacrifice {this}"; - } + public SacrificeSourceEffect() { + super(Outcome.Sacrifice); + staticText = "sacrifice {this}"; + } - public SacrificeSourceEffect(final SacrificeSourceEffect effect) { - super(effect); - } + public SacrificeSourceEffect(final SacrificeSourceEffect effect) { + super(effect); + } - @Override - public SacrificeSourceEffect copy() { - return new SacrificeSourceEffect(this); - } + @Override + public SacrificeSourceEffect copy() { + return new SacrificeSourceEffect(this); + } - @Override - public boolean apply(Game game, Ability source) { - Permanent permanent = game.getPermanent(source.getSourceId()); - if (permanent != null) { - return permanent.sacrifice(source.getSourceId(), game); - } - return false; - } + @Override + public boolean apply(Game game, Ability source) { + Permanent permanent = game.getPermanent(source.getSourceId()); + if (permanent != null) { + return permanent.sacrifice(source.getSourceId(), game); + } + return false; + } } diff --git a/Mage/src/mage/abilities/effects/common/SacrificeSourceUnlessPaysEffect.java b/Mage/src/mage/abilities/effects/common/SacrificeSourceUnlessPaysEffect.java index 14b8337eee..4e70baae95 100644 --- a/Mage/src/mage/abilities/effects/common/SacrificeSourceUnlessPaysEffect.java +++ b/Mage/src/mage/abilities/effects/common/SacrificeSourceUnlessPaysEffect.java @@ -31,17 +31,17 @@ public class SacrificeSourceUnlessPaysEffect extends OneShotEffect { - public SacrificeTargetEffect() { - super(Outcome.Sacrifice); - } + public SacrificeTargetEffect() { + super(Outcome.Sacrifice); + } - public SacrificeTargetEffect(String text) { - this(); - staticText = text; - } + public SacrificeTargetEffect(String text) { + this(); + staticText = text; + } - public SacrificeTargetEffect(final SacrificeTargetEffect effect) { - super(effect); - } + public SacrificeTargetEffect(final SacrificeTargetEffect effect) { + super(effect); + } - @Override - public SacrificeTargetEffect copy() { - return new SacrificeTargetEffect(this); - } + @Override + public SacrificeTargetEffect copy() { + return new SacrificeTargetEffect(this); + } - @Override - public boolean apply(Game game, Ability source) { - int affectedTargets = 0; - for (UUID permanentId : targetPointer.getTargets(game, source)) { - Permanent permanent = game.getPermanent(permanentId); - if (permanent != null) { - permanent.sacrifice(source.getSourceId(), game); - affectedTargets++; - } - } - return affectedTargets > 0; - } + @Override + public boolean apply(Game game, Ability source) { + int affectedTargets = 0; + for (UUID permanentId : targetPointer.getTargets(game, source)) { + Permanent permanent = game.getPermanent(permanentId); + if (permanent != null) { + permanent.sacrifice(source.getSourceId(), game); + affectedTargets++; + } + } + return affectedTargets > 0; + } - @Override - public String getText(Mode mode) { - if ("".equals(staticText) && !mode.getTargets().isEmpty()) { - if (mode.getTargets().get(0).getNumberOfTargets() == 1) { - return "The controller of target " + mode.getTargets().get(0).getTargetName() + " sacrifices it"; - } else { - return "The controller of " + mode.getTargets().get(0).getNumberOfTargets() + " target " + mode.getTargets().get(0).getTargetName() + " sacrifices it"; - } - } - return staticText; - } + @Override + public String getText(Mode mode) { + if ("".equals(staticText) && !mode.getTargets().isEmpty()) { + if (mode.getTargets().get(0).getNumberOfTargets() == 1) { + return "The controller of target " + mode.getTargets().get(0).getTargetName() + " sacrifices it"; + } else { + return "The controller of " + mode.getTargets().get(0).getNumberOfTargets() + " target " + mode.getTargets().get(0).getTargetName() + " sacrifices it"; + } + } + return staticText; + } } diff --git a/Mage/src/mage/abilities/effects/common/ScryEffect.java b/Mage/src/mage/abilities/effects/common/ScryEffect.java index b8cd227254..3d368e1bfe 100644 --- a/Mage/src/mage/abilities/effects/common/ScryEffect.java +++ b/Mage/src/mage/abilities/effects/common/ScryEffect.java @@ -46,67 +46,67 @@ import mage.target.TargetCard; */ public class ScryEffect extends OneShotEffect { - protected static FilterCard filter1 = new FilterCard("card to put on the bottom of your library"); - protected static FilterCard filter2 = new FilterCard("card to put on the top of your library (last chosen will be on top)"); + protected static FilterCard filter1 = new FilterCard("card to put on the bottom of your library"); + protected static FilterCard filter2 = new FilterCard("card to put on the top of your library (last chosen will be on top)"); - protected int scryNumber; + protected int scryNumber; - public ScryEffect(int scryNumber) { - super(Outcome.Benefit); - this.scryNumber = scryNumber; - staticText = "Scry " + scryNumber; - } + public ScryEffect(int scryNumber) { + super(Outcome.Benefit); + this.scryNumber = scryNumber; + staticText = "Scry " + scryNumber; + } - public ScryEffect(final ScryEffect effect) { - super(effect); - this.scryNumber = effect.scryNumber; - } + public ScryEffect(final ScryEffect effect) { + super(effect); + this.scryNumber = effect.scryNumber; + } - @Override - public boolean apply(Game game, Ability source) { - Player player = game.getPlayer(source.getControllerId()); - Cards cards = new CardsImpl(Zone.PICK); - int count = Math.min(scryNumber, player.getLibrary().size()); - if (count == 0) { - return false; - } - for (int i = 0; i < count; i++) { - Card card = player.getLibrary().removeFromTop(game); - cards.add(card); - game.setZone(card.getId(), Zone.PICK); - } - TargetCard target1 = new TargetCard(Zone.PICK, filter1); - while (cards.size() > 0 && player.choose(Outcome.Detriment, cards, target1, game)) { - Card card = cards.get(target1.getFirstTarget(), game); - if (card != null) { - cards.remove(card); - card.moveToZone(Zone.LIBRARY, source.getId(), game, false); - } - target1.clearChosen(); - } - if (cards.size() > 1) { - TargetCard target2 = new TargetCard(Zone.PICK, filter2); - target2.setRequired(true); - while (cards.size() > 1) { - player.choose(Outcome.Benefit, cards, target2, game); - Card card = cards.get(target2.getFirstTarget(), game); - if (card != null) { - cards.remove(card); - card.moveToZone(Zone.LIBRARY, source.getId(), game, true); - } - target2.clearChosen(); - } - } - if (cards.size() == 1) { - Card card = cards.get(cards.iterator().next(), game); - card.moveToZone(Zone.LIBRARY, source.getId(), game, true); - } - return true; - } + @Override + public boolean apply(Game game, Ability source) { + Player player = game.getPlayer(source.getControllerId()); + Cards cards = new CardsImpl(Zone.PICK); + int count = Math.min(scryNumber, player.getLibrary().size()); + if (count == 0) { + return false; + } + for (int i = 0; i < count; i++) { + Card card = player.getLibrary().removeFromTop(game); + cards.add(card); + game.setZone(card.getId(), Zone.PICK); + } + TargetCard target1 = new TargetCard(Zone.PICK, filter1); + while (cards.size() > 0 && player.choose(Outcome.Detriment, cards, target1, game)) { + Card card = cards.get(target1.getFirstTarget(), game); + if (card != null) { + cards.remove(card); + card.moveToZone(Zone.LIBRARY, source.getId(), game, false); + } + target1.clearChosen(); + } + if (cards.size() > 1) { + TargetCard target2 = new TargetCard(Zone.PICK, filter2); + target2.setRequired(true); + while (cards.size() > 1) { + player.choose(Outcome.Benefit, cards, target2, game); + Card card = cards.get(target2.getFirstTarget(), game); + if (card != null) { + cards.remove(card); + card.moveToZone(Zone.LIBRARY, source.getId(), game, true); + } + target2.clearChosen(); + } + } + if (cards.size() == 1) { + Card card = cards.get(cards.iterator().next(), game); + card.moveToZone(Zone.LIBRARY, source.getId(), game, true); + } + return true; + } - @Override - public ScryEffect copy() { - return new ScryEffect(this); - } + @Override + public ScryEffect copy() { + return new ScryEffect(this); + } } diff --git a/Mage/src/mage/abilities/effects/common/ShuffleSpellEffect.java b/Mage/src/mage/abilities/effects/common/ShuffleSpellEffect.java index 77dd414036..b451b6caaa 100644 --- a/Mage/src/mage/abilities/effects/common/ShuffleSpellEffect.java +++ b/Mage/src/mage/abilities/effects/common/ShuffleSpellEffect.java @@ -44,34 +44,34 @@ import mage.players.Player; */ public class ShuffleSpellEffect extends PostResolveEffect { - private static final ShuffleSpellEffect fINSTANCE = new ShuffleSpellEffect(); + private static final ShuffleSpellEffect fINSTANCE = new ShuffleSpellEffect(); - private Object readResolve() throws ObjectStreamException { - return fINSTANCE; - } + private Object readResolve() throws ObjectStreamException { + return fINSTANCE; + } - private ShuffleSpellEffect() { - staticText = "Shuffle {this} into its owner's library"; - } - - public static ShuffleSpellEffect getInstance() { - return fINSTANCE; - } + private ShuffleSpellEffect() { + staticText = "Shuffle {this} into its owner's library"; + } - @Override - public boolean apply(Game game, Ability source) { - return true; - } + public static ShuffleSpellEffect getInstance() { + return fINSTANCE; + } - @Override - public ShuffleSpellEffect copy() { - return fINSTANCE; - } + @Override + public boolean apply(Game game, Ability source) { + return true; + } - @Override - public void postResolve(Card card, Ability source, UUID controllerId, Game game) { - card.moveToZone(Zone.LIBRARY, source.getId(), game, false); - Player player = game.getPlayer(card.getOwnerId()); - if (player != null) player.shuffleLibrary(game); - } + @Override + public ShuffleSpellEffect copy() { + return fINSTANCE; + } + + @Override + public void postResolve(Card card, Ability source, UUID controllerId, Game game) { + card.moveToZone(Zone.LIBRARY, source.getId(), game, false); + Player player = game.getPlayer(card.getOwnerId()); + if (player != null) player.shuffleLibrary(game); + } } diff --git a/Mage/src/mage/abilities/effects/common/SkipEnchantedUntapEffect.java b/Mage/src/mage/abilities/effects/common/SkipEnchantedUntapEffect.java index 32c6451ab8..8f85b4e2a0 100644 --- a/Mage/src/mage/abilities/effects/common/SkipEnchantedUntapEffect.java +++ b/Mage/src/mage/abilities/effects/common/SkipEnchantedUntapEffect.java @@ -12,42 +12,42 @@ import mage.game.permanent.Permanent; */ public class SkipEnchantedUntapEffect extends ReplacementEffectImpl { - public SkipEnchantedUntapEffect() { - super(Constants.Duration.WhileOnBattlefield, Constants.Outcome.Detriment); - staticText = "Enchanted permanent doesn't untap during its controller's untap step"; - } + public SkipEnchantedUntapEffect() { + super(Constants.Duration.WhileOnBattlefield, Constants.Outcome.Detriment); + staticText = "Enchanted permanent doesn't untap during its controller's untap step"; + } - public SkipEnchantedUntapEffect(final SkipEnchantedUntapEffect effect) { - super(effect); - } + public SkipEnchantedUntapEffect(final SkipEnchantedUntapEffect effect) { + super(effect); + } - @Override - public boolean apply(Game game, Ability source) { - return true; - } + @Override + public boolean apply(Game game, Ability source) { + return true; + } - @Override - public SkipEnchantedUntapEffect copy() { - return new SkipEnchantedUntapEffect(this); - } + @Override + public SkipEnchantedUntapEffect copy() { + return new SkipEnchantedUntapEffect(this); + } - @Override - public boolean replaceEvent(GameEvent event, Ability source, Game game) { - return true; - } + @Override + public boolean replaceEvent(GameEvent event, Ability source, Game game) { + return true; + } - @Override - public boolean applies(GameEvent event, Ability source, Game game) { - if (game.getTurn().getStepType() == Constants.PhaseStep.UNTAP && event.getType() == GameEvent.EventType.UNTAP) { - Permanent enchantment = game.getPermanent(source.getSourceId()); - if (enchantment != null && enchantment.getAttachedTo() != null) { - Permanent permanent = game.getPermanent(enchantment.getAttachedTo()); - if (permanent != null && event.getTargetId().equals(permanent.getId())) { - return true; - } - } - } - return false; - } + @Override + public boolean applies(GameEvent event, Ability source, Game game) { + if (game.getTurn().getStepType() == Constants.PhaseStep.UNTAP && event.getType() == GameEvent.EventType.UNTAP) { + Permanent enchantment = game.getPermanent(source.getSourceId()); + if (enchantment != null && enchantment.getAttachedTo() != null) { + Permanent permanent = game.getPermanent(enchantment.getAttachedTo()); + if (permanent != null && event.getTargetId().equals(permanent.getId())) { + return true; + } + } + } + return false; + } } diff --git a/Mage/src/mage/abilities/effects/common/SkipNextPlayerUntapStepEffect.java b/Mage/src/mage/abilities/effects/common/SkipNextPlayerUntapStepEffect.java index a50c952021..c7ae0d7d5d 100644 --- a/Mage/src/mage/abilities/effects/common/SkipNextPlayerUntapStepEffect.java +++ b/Mage/src/mage/abilities/effects/common/SkipNextPlayerUntapStepEffect.java @@ -44,21 +44,21 @@ import mage.players.Player; */ public class SkipNextPlayerUntapStepEffect extends OneShotEffect { - public SkipNextPlayerUntapStepEffect() { - super(Constants.Outcome.Detriment); - } + public SkipNextPlayerUntapStepEffect() { + super(Constants.Outcome.Detriment); + } public SkipNextPlayerUntapStepEffect(String text) { this(); staticText = text; - } + } - public SkipNextPlayerUntapStepEffect(SkipNextPlayerUntapStepEffect effect) { - super(effect); - } + public SkipNextPlayerUntapStepEffect(SkipNextPlayerUntapStepEffect effect) { + super(effect); + } - @Override - public boolean apply(Game game, Ability source) { + @Override + public boolean apply(Game game, Ability source) { if (targetPointer != null) { Player player = game.getPlayer(targetPointer.getFirst(game, source)); if (player != null) { @@ -66,16 +66,16 @@ public class SkipNextPlayerUntapStepEffect extends OneShotEffect 0) { sb.append(staticText); @@ -85,5 +85,5 @@ public class SkipNextPlayerUntapStepEffect extends OneShotEffect { - protected Set usedFor = new HashSet(); - protected int count; + protected Set usedFor = new HashSet(); + protected int count; - public SkipNextUntapTargetEffect() { - super(Duration.OneUse, Outcome.Detriment); - } + public SkipNextUntapTargetEffect() { + super(Duration.OneUse, Outcome.Detriment); + } public SkipNextUntapTargetEffect(String text) { - this(); + this(); this.staticText = text; - } + } - public SkipNextUntapTargetEffect(final SkipNextUntapTargetEffect effect) { - super(effect); - for (UUID uuid : effect.usedFor) { - this.usedFor.add(uuid); - } - this.count = effect.count; - } + public SkipNextUntapTargetEffect(final SkipNextUntapTargetEffect effect) { + super(effect); + for (UUID uuid : effect.usedFor) { + this.usedFor.add(uuid); + } + this.count = effect.count; + } - @Override - public SkipNextUntapTargetEffect copy() { - return new SkipNextUntapTargetEffect(this); - } + @Override + public SkipNextUntapTargetEffect copy() { + return new SkipNextUntapTargetEffect(this); + } - @Override - public boolean apply(Game game, Ability source) { - return false; - } + @Override + public boolean apply(Game game, Ability source) { + return false; + } - @Override - public boolean replaceEvent(GameEvent event, Ability source, Game game) { - if (targetPointer.getTargets(game, source).size() < 2) { - used = true; - } else { - count++; - } - // not clear how to turn off the effect for more than one target - // especially as some targets may leave the battlefield since the effect creation - // so handling this in applies method is the only option for now for such cases - if (count == targetPointer.getTargets(game, source).size()) { - // this won't work for targets disappeared before applies() return true - used = true; - } - return true; - } + @Override + public boolean replaceEvent(GameEvent event, Ability source, Game game) { + if (targetPointer.getTargets(game, source).size() < 2) { + used = true; + } else { + count++; + } + // not clear how to turn off the effect for more than one target + // especially as some targets may leave the battlefield since the effect creation + // so handling this in applies method is the only option for now for such cases + if (count == targetPointer.getTargets(game, source).size()) { + // this won't work for targets disappeared before applies() return true + used = true; + } + return true; + } - @Override - public boolean applies(GameEvent event, Ability source, Game game) { - if (game.getTurn().getStepType() == PhaseStep.UNTAP && event.getType() == EventType.UNTAP) { + @Override + public boolean applies(GameEvent event, Ability source, Game game) { + if (game.getTurn().getStepType() == PhaseStep.UNTAP && event.getType() == EventType.UNTAP) { for (UUID target : targetPointer.getTargets(game, source)) { if (event.getTargetId().equals(target)) { if (!usedFor.contains(target)) { @@ -107,17 +107,17 @@ public class SkipNextUntapTargetEffect extends ReplacementEffectImpl 0) return staticText + " doesn't untap during its controller's next untap step"; else - return "Target " + mode.getTargets().get(0).getTargetName() + " doesn't untap during its controller's next untap step"; - } + return "Target " + mode.getTargets().get(0).getTargetName() + " doesn't untap during its controller's next untap step"; + } } diff --git a/Mage/src/mage/abilities/effects/common/TapEnchantedEffect.java b/Mage/src/mage/abilities/effects/common/TapEnchantedEffect.java index 7285c1ee46..4130cac716 100644 --- a/Mage/src/mage/abilities/effects/common/TapEnchantedEffect.java +++ b/Mage/src/mage/abilities/effects/common/TapEnchantedEffect.java @@ -41,12 +41,12 @@ import mage.game.permanent.Permanent; public class TapEnchantedEffect extends OneShotEffect { public TapEnchantedEffect() { - super(Outcome.Tap); - staticText = "tap enchanted creature"; + super(Outcome.Tap); + staticText = "tap enchanted creature"; } public TapEnchantedEffect(final TapEnchantedEffect effect) { - super(effect); + super(effect); } @Override diff --git a/Mage/src/mage/abilities/effects/common/TapSourceEffect.java b/Mage/src/mage/abilities/effects/common/TapSourceEffect.java index 33d4e8c766..ee3592c847 100644 --- a/Mage/src/mage/abilities/effects/common/TapSourceEffect.java +++ b/Mage/src/mage/abilities/effects/common/TapSourceEffect.java @@ -45,34 +45,34 @@ public class TapSourceEffect extends OneShotEffect { this(false); } - public TapSourceEffect(boolean withoutTrigger) { - super(Outcome.Tap); + public TapSourceEffect(boolean withoutTrigger) { + super(Outcome.Tap); this.withoutTrigger = withoutTrigger; - staticText = "tap {this}"; - } + staticText = "tap {this}"; + } - public TapSourceEffect(final TapSourceEffect effect) { - super(effect); + public TapSourceEffect(final TapSourceEffect effect) { + super(effect); this.withoutTrigger = effect.withoutTrigger; - } + } - @Override - public TapSourceEffect copy() { - return new TapSourceEffect(this); - } + @Override + public TapSourceEffect copy() { + return new TapSourceEffect(this); + } - @Override - public boolean apply(Game game, Ability source) { - Permanent permanent = game.getPermanent(source.getSourceId()); - if (permanent != null) { + @Override + public boolean apply(Game game, Ability source) { + Permanent permanent = game.getPermanent(source.getSourceId()); + if (permanent != null) { if (withoutTrigger) { permanent.setTapped(true); } else { - permanent.tap(game); + permanent.tap(game); } - return true; - } - return false; - } + return true; + } + return false; + } } diff --git a/Mage/src/mage/abilities/effects/common/TapSourceUnlessPaysEffect.java b/Mage/src/mage/abilities/effects/common/TapSourceUnlessPaysEffect.java index b82d9ef953..b03f82c5ca 100644 --- a/Mage/src/mage/abilities/effects/common/TapSourceUnlessPaysEffect.java +++ b/Mage/src/mage/abilities/effects/common/TapSourceUnlessPaysEffect.java @@ -42,38 +42,38 @@ import mage.players.Player; */ public class TapSourceUnlessPaysEffect extends OneShotEffect { - protected Cost cost; + protected Cost cost; - public TapSourceUnlessPaysEffect(Cost cost) { - super(Outcome.Tap); - this.cost = cost; - } + public TapSourceUnlessPaysEffect(Cost cost) { + super(Outcome.Tap); + this.cost = cost; + } - public TapSourceUnlessPaysEffect(final TapSourceUnlessPaysEffect effect) { - super(effect); - this.cost = effect.cost; - } + public TapSourceUnlessPaysEffect(final TapSourceUnlessPaysEffect effect) { + super(effect); + this.cost = effect.cost; + } - @Override - public boolean apply(Game game, Ability source) { - Player player = game.getPlayer(source.getControllerId()); - Permanent permanent = game.getPermanent(source.getSourceId()); - if (player != null && permanent != null) { - if (player.chooseUse(Outcome.Benefit, cost.getText() + " or " + permanent.getName() + " comes into play tapped?", game)) { - cost.clearPaid(); - if (cost.pay(source, game, source.getId(), source.getControllerId(), false)) - return true; - } - permanent.tap(game); - return true; - } - return false; - } + @Override + public boolean apply(Game game, Ability source) { + Player player = game.getPlayer(source.getControllerId()); + Permanent permanent = game.getPermanent(source.getSourceId()); + if (player != null && permanent != null) { + if (player.chooseUse(Outcome.Benefit, cost.getText() + " or " + permanent.getName() + " comes into play tapped?", game)) { + cost.clearPaid(); + if (cost.pay(source, game, source.getId(), source.getControllerId(), false)) + return true; + } + permanent.tap(game); + return true; + } + return false; + } - @Override - public TapSourceUnlessPaysEffect copy() { - return new TapSourceUnlessPaysEffect(this); - } + @Override + public TapSourceUnlessPaysEffect copy() { + return new TapSourceUnlessPaysEffect(this); + } } diff --git a/Mage/src/mage/abilities/effects/common/TransformSourceEffect.java b/Mage/src/mage/abilities/effects/common/TransformSourceEffect.java index dc226a180b..4df500b8a9 100644 --- a/Mage/src/mage/abilities/effects/common/TransformSourceEffect.java +++ b/Mage/src/mage/abilities/effects/common/TransformSourceEffect.java @@ -50,28 +50,28 @@ public class TransformSourceEffect extends OneShotEffect this(fromDayToNight, false); } - private TransformSourceEffect(boolean fromDayToNight, boolean withoutTrigger) { - super(Outcome.Transform); + private TransformSourceEffect(boolean fromDayToNight, boolean withoutTrigger) { + super(Outcome.Transform); this.withoutTrigger = withoutTrigger; this.fromDayToNight = fromDayToNight; - staticText = "transform {this}"; - } + staticText = "transform {this}"; + } - public TransformSourceEffect(final TransformSourceEffect effect) { - super(effect); + public TransformSourceEffect(final TransformSourceEffect effect) { + super(effect); this.withoutTrigger = effect.withoutTrigger; this.fromDayToNight = effect.fromDayToNight; - } + } - @Override - public TransformSourceEffect copy() { - return new TransformSourceEffect(this); - } + @Override + public TransformSourceEffect copy() { + return new TransformSourceEffect(this); + } - @Override - public boolean apply(Game game, Ability source) { - Permanent permanent = game.getPermanent(source.getSourceId()); - if (permanent != null) { + @Override + public boolean apply(Game game, Ability source) { + Permanent permanent = game.getPermanent(source.getSourceId()); + if (permanent != null) { if (permanent.canTransform()) { // check not to transform twice the same side if (permanent.isTransformed() != fromDayToNight) { @@ -82,9 +82,9 @@ public class TransformSourceEffect extends OneShotEffect } } } - return true; - } - return false; - } + return true; + } + return false; + } } diff --git a/Mage/src/mage/abilities/effects/common/UntapAllControllerEffect.java b/Mage/src/mage/abilities/effects/common/UntapAllControllerEffect.java index 78c4332d52..1c04f69880 100644 --- a/Mage/src/mage/abilities/effects/common/UntapAllControllerEffect.java +++ b/Mage/src/mage/abilities/effects/common/UntapAllControllerEffect.java @@ -45,32 +45,32 @@ public class UntapAllControllerEffect extends OneShotEffect { - public UntapAllLandsControllerEffect() { - super(Outcome.Untap); - staticText = "Untap all lands you control"; - } + public UntapAllLandsControllerEffect() { + super(Outcome.Untap); + staticText = "Untap all lands you control"; + } - public UntapAllLandsControllerEffect(final UntapAllLandsControllerEffect effect) { - super(effect); - } + public UntapAllLandsControllerEffect(final UntapAllLandsControllerEffect effect) { + super(effect); + } - @Override - public boolean apply(Game game, Ability source) { - Player player = game.getPlayer(source.getControllerId()); - if (player != null) { - for (Permanent land: game.getBattlefield().getAllActivePermanents(new FilterLandPermanent(), player.getId(), game)) { - land.untap(game); - } - return true; - } - return false; - } + @Override + public boolean apply(Game game, Ability source) { + Player player = game.getPlayer(source.getControllerId()); + if (player != null) { + for (Permanent land: game.getBattlefield().getAllActivePermanents(new FilterLandPermanent(), player.getId(), game)) { + land.untap(game); + } + return true; + } + return false; + } - @Override - public UntapAllLandsControllerEffect copy() { - return new UntapAllLandsControllerEffect(this); - } + @Override + public UntapAllLandsControllerEffect copy() { + return new UntapAllLandsControllerEffect(this); + } } \ No newline at end of file diff --git a/Mage/src/mage/abilities/effects/common/UntapEnchantedEffect.java b/Mage/src/mage/abilities/effects/common/UntapEnchantedEffect.java index aaaed63723..39d8bbf85d 100644 --- a/Mage/src/mage/abilities/effects/common/UntapEnchantedEffect.java +++ b/Mage/src/mage/abilities/effects/common/UntapEnchantedEffect.java @@ -39,7 +39,7 @@ import mage.game.permanent.Permanent; * @author LevelX */ public class UntapEnchantedEffect extends OneShotEffect { - + public UntapEnchantedEffect() { super(Outcome.Untap); staticText = "untap enchanted creature"; diff --git a/Mage/src/mage/abilities/effects/common/UntapSourceEffect.java b/Mage/src/mage/abilities/effects/common/UntapSourceEffect.java index 7464dc7afd..f6740a4160 100644 --- a/Mage/src/mage/abilities/effects/common/UntapSourceEffect.java +++ b/Mage/src/mage/abilities/effects/common/UntapSourceEffect.java @@ -41,22 +41,22 @@ import mage.game.permanent.Permanent; public class UntapSourceEffect extends OneShotEffect { public UntapSourceEffect() { - super(Outcome.Untap); - staticText = "untap {this}"; + super(Outcome.Untap); + staticText = "untap {this}"; } public UntapSourceEffect(final UntapSourceEffect effect) { - super(effect); + super(effect); } @Override public boolean apply(Game game, Ability source) { Permanent permanent = game.getPermanent(source.getSourceId()); - if (permanent != null) { - permanent.untap(game); - return true; - } - return false; + if (permanent != null) { + permanent.untap(game); + return true; + } + return false; } @Override diff --git a/Mage/src/mage/abilities/effects/common/UntapTargetEffect.java b/Mage/src/mage/abilities/effects/common/UntapTargetEffect.java index 2073c9351d..99184cbe4c 100644 --- a/Mage/src/mage/abilities/effects/common/UntapTargetEffect.java +++ b/Mage/src/mage/abilities/effects/common/UntapTargetEffect.java @@ -43,32 +43,32 @@ import mage.target.Target; */ public class UntapTargetEffect extends OneShotEffect { - public UntapTargetEffect() { - super(Outcome.Untap); - } + public UntapTargetEffect() { + super(Outcome.Untap); + } - public UntapTargetEffect(final UntapTargetEffect effect) { - super(effect); - } + public UntapTargetEffect(final UntapTargetEffect effect) { + super(effect); + } - @Override - public UntapTargetEffect copy() { - return new UntapTargetEffect(this); - } + @Override + public UntapTargetEffect copy() { + return new UntapTargetEffect(this); + } - @Override - public boolean apply(Game game, Ability source) { - for (UUID target: targetPointer.getTargets(game, source)) { - Permanent permanent = game.getPermanent(target); - if (permanent != null) { - permanent.untap(game); - } - else { - return false; - } - } - return true; - } + @Override + public boolean apply(Game game, Ability source) { + for (UUID target: targetPointer.getTargets(game, source)) { + Permanent permanent = game.getPermanent(target); + if (permanent != null) { + permanent.untap(game); + } + else { + return false; + } + } + return true; + } @Override public String getText(Mode mode) { diff --git a/Mage/src/mage/abilities/effects/common/continious/AddCardSubtypeAttachedEffect.java b/Mage/src/mage/abilities/effects/common/continious/AddCardSubtypeAttachedEffect.java index 5558b0b0b7..2d56405a30 100644 --- a/Mage/src/mage/abilities/effects/common/continious/AddCardSubtypeAttachedEffect.java +++ b/Mage/src/mage/abilities/effects/common/continious/AddCardSubtypeAttachedEffect.java @@ -45,7 +45,7 @@ public class AddCardSubtypeAttachedEffect extends ContinuousEffectImpl { - protected Token token; - protected String type; + protected Token token; + protected String type; - public BecomesCreatureSourceEffect(Token token, String type, Duration duration) { - super(duration, Outcome.BecomeCreature); - this.token = token; - this.type = type; - setText(); - } + public BecomesCreatureSourceEffect(Token token, String type, Duration duration) { + super(duration, Outcome.BecomeCreature); + this.token = token; + this.type = type; + setText(); + } - public BecomesCreatureSourceEffect(final BecomesCreatureSourceEffect effect) { - super(effect); - this.token = effect.token.copy(); - this.type = effect.type; - } + public BecomesCreatureSourceEffect(final BecomesCreatureSourceEffect effect) { + super(effect); + this.token = effect.token.copy(); + this.type = effect.type; + } - @Override - public BecomesCreatureSourceEffect copy() { - return new BecomesCreatureSourceEffect(this); - } + @Override + public BecomesCreatureSourceEffect copy() { + return new BecomesCreatureSourceEffect(this); + } - @Override - public boolean apply(Layer layer, SubLayer sublayer, Ability source, Game game) { - Permanent permanent = game.getPermanent(source.getSourceId()); - if (permanent != null) { - switch (layer) { - case TypeChangingEffects_4: - if (sublayer == SubLayer.NA) { - if (token.getCardType().size() > 0) { + @Override + public boolean apply(Layer layer, SubLayer sublayer, Ability source, Game game) { + Permanent permanent = game.getPermanent(source.getSourceId()); + if (permanent != null) { + switch (layer) { + case TypeChangingEffects_4: + if (sublayer == SubLayer.NA) { + if (token.getCardType().size() > 0) { for (Constants.CardType t : token.getCardType()) { if (!permanent.getCardType().contains(t)) { permanent.getCardType().add(t); - } + } } - } - if ("".equals(type) || type == null) { - permanent.getSubtype().clear(); - } - if (token.getSubtype().size() > 0) { - permanent.getSubtype().addAll(token.getSubtype()); - } - } - break; - case ColorChangingEffects_5: - if (sublayer == SubLayer.NA) { - if (token.getColor().hasColor()) - permanent.getColor().setColor(token.getColor()); - } - break; - case AbilityAddingRemovingEffects_6: - if (sublayer == SubLayer.NA) { - if (token.getAbilities().size() > 0) { - for (Ability ability: token.getAbilities()) { - permanent.addAbility(ability, game); - } - } - } - break; - case PTChangingEffects_7: - if (sublayer == SubLayer.SetPT_7b) { - int power = token.getPower().getValue(); - int toughness = token.getToughness().getValue(); - if (power != 0 && toughness != 0) { - permanent.getPower().setValue(power); - permanent.getToughness().setValue(toughness); - } - } - } - return true; - } - return false; - } + } + if ("".equals(type) || type == null) { + permanent.getSubtype().clear(); + } + if (token.getSubtype().size() > 0) { + permanent.getSubtype().addAll(token.getSubtype()); + } + } + break; + case ColorChangingEffects_5: + if (sublayer == SubLayer.NA) { + if (token.getColor().hasColor()) + permanent.getColor().setColor(token.getColor()); + } + break; + case AbilityAddingRemovingEffects_6: + if (sublayer == SubLayer.NA) { + if (token.getAbilities().size() > 0) { + for (Ability ability: token.getAbilities()) { + permanent.addAbility(ability, game); + } + } + } + break; + case PTChangingEffects_7: + if (sublayer == SubLayer.SetPT_7b) { + int power = token.getPower().getValue(); + int toughness = token.getToughness().getValue(); + if (power != 0 && toughness != 0) { + permanent.getPower().setValue(power); + permanent.getToughness().setValue(toughness); + } + } + } + return true; + } + return false; + } - @Override - public boolean apply(Game game, Ability source) { - return false; - } + @Override + public boolean apply(Game game, Ability source) { + return false; + } - private void setText() { + private void setText() { if (type.length() > 0) - staticText = duration.toString() + " {this} becomes a " + token.getDescription() + " that's still a " + this.type; + staticText = duration.toString() + " {this} becomes a " + token.getDescription() + " that's still a " + this.type; else staticText = duration.toString() + " {this} becomes a " + token.getDescription(); - } + } - @Override - public boolean hasLayer(Layer layer) { - return layer == Layer.PTChangingEffects_7 || layer == Layer.AbilityAddingRemovingEffects_6 || layer == Layer.ColorChangingEffects_5 || layer == Layer.TypeChangingEffects_4; - } + @Override + public boolean hasLayer(Layer layer) { + return layer == Layer.PTChangingEffects_7 || layer == Layer.AbilityAddingRemovingEffects_6 || layer == Layer.ColorChangingEffects_5 || layer == Layer.TypeChangingEffects_4; + } } diff --git a/Mage/src/mage/abilities/effects/common/continious/BoostAllEffect.java b/Mage/src/mage/abilities/effects/common/continious/BoostAllEffect.java index 9fb59e3e30..2cd22dd92d 100644 --- a/Mage/src/mage/abilities/effects/common/continious/BoostAllEffect.java +++ b/Mage/src/mage/abilities/effects/common/continious/BoostAllEffect.java @@ -46,79 +46,79 @@ import mage.game.permanent.Permanent; */ public class BoostAllEffect extends ContinuousEffectImpl { - protected DynamicValue power; - protected DynamicValue toughness; - protected boolean excludeSource; - protected FilterCreaturePermanent filter; + protected DynamicValue power; + protected DynamicValue toughness; + protected boolean excludeSource; + protected FilterCreaturePermanent filter; - public BoostAllEffect(int power, int toughness, Duration duration) { - this(power, toughness, duration, new FilterCreaturePermanent(), false); - } + public BoostAllEffect(int power, int toughness, Duration duration) { + this(power, toughness, duration, new FilterCreaturePermanent(), false); + } public BoostAllEffect(DynamicValue power, DynamicValue toughness, Duration duration) { - this(power, toughness, duration, new FilterCreaturePermanent(), false); - } + this(power, toughness, duration, new FilterCreaturePermanent(), false); + } - public BoostAllEffect(int power, int toughness, Duration duration, boolean excludeSource) { - this(power, toughness, duration, new FilterCreaturePermanent(), excludeSource); - } + public BoostAllEffect(int power, int toughness, Duration duration, boolean excludeSource) { + this(power, toughness, duration, new FilterCreaturePermanent(), excludeSource); + } public BoostAllEffect(int power, int toughness, Duration duration, FilterCreaturePermanent filter, boolean excludeSource) { this(new StaticValue(power), new StaticValue(toughness), duration, filter, excludeSource); } - public BoostAllEffect(DynamicValue power, DynamicValue toughness, Duration duration, FilterCreaturePermanent filter, boolean excludeSource) { - super(duration, Layer.PTChangingEffects_7, SubLayer.ModifyPT_7c, Outcome.BoostCreature); - this.power = power; - this.toughness = toughness; - this.filter = filter; - this.excludeSource = excludeSource; - setText(); - } + public BoostAllEffect(DynamicValue power, DynamicValue toughness, Duration duration, FilterCreaturePermanent filter, boolean excludeSource) { + super(duration, Layer.PTChangingEffects_7, SubLayer.ModifyPT_7c, Outcome.BoostCreature); + this.power = power; + this.toughness = toughness; + this.filter = filter; + this.excludeSource = excludeSource; + setText(); + } - public BoostAllEffect(final BoostAllEffect effect) { - super(effect); - this.power = effect.power; - this.toughness = effect.toughness; - this.filter = effect.filter.copy(); - this.excludeSource = effect.excludeSource; - } + public BoostAllEffect(final BoostAllEffect effect) { + super(effect); + this.power = effect.power; + this.toughness = effect.toughness; + this.filter = effect.filter.copy(); + this.excludeSource = effect.excludeSource; + } - @Override - public BoostAllEffect copy() { - return new BoostAllEffect(this); - } + @Override + public BoostAllEffect copy() { + return new BoostAllEffect(this); + } - @Override - public void init(Ability source, Game game) { - super.init(source, game); - if (this.affectedObjectsSet) { - for (Permanent perm: game.getBattlefield().getActivePermanents(filter, source.getControllerId(), source.getSourceId(), game)) { - if (!(excludeSource && perm.getId().equals(source.getSourceId()))) { - objects.add(perm.getId()); - } - } - } - } + @Override + public void init(Ability source, Game game) { + super.init(source, game); + if (this.affectedObjectsSet) { + for (Permanent perm: game.getBattlefield().getActivePermanents(filter, source.getControllerId(), source.getSourceId(), game)) { + if (!(excludeSource && perm.getId().equals(source.getSourceId()))) { + objects.add(perm.getId()); + } + } + } + } - @Override - public boolean apply(Game game, Ability source) { - for (Permanent perm: game.getBattlefield().getActivePermanents(filter, source.getControllerId(), source.getSourceId(), game)) { - if (!this.affectedObjectsSet || objects.contains(perm.getId())) { - if (!(excludeSource && perm.getId().equals(source.getSourceId()))) { - perm.addPower(power.calculate(game, source)); - perm.addToughness(toughness.calculate(game, source)); - } - } - } - return true; - } + @Override + public boolean apply(Game game, Ability source) { + for (Permanent perm: game.getBattlefield().getActivePermanents(filter, source.getControllerId(), source.getSourceId(), game)) { + if (!this.affectedObjectsSet || objects.contains(perm.getId())) { + if (!(excludeSource && perm.getId().equals(source.getSourceId()))) { + perm.addPower(power.calculate(game, source)); + perm.addToughness(toughness.calculate(game, source)); + } + } + } + return true; + } - private void setText() { - StringBuilder sb = new StringBuilder(); - if (excludeSource) - sb.append("Other "); - sb.append(filter.getMessage()).append(" gets "); + private void setText() { + StringBuilder sb = new StringBuilder(); + if (excludeSource) + sb.append("Other "); + sb.append(filter.getMessage()).append(" gets "); String p = power.toString(); if(!p.startsWith("-")) sb.append("+"); @@ -131,9 +131,9 @@ public class BoostAllEffect extends ContinuousEffectImpl { sb.append("+"); } sb.append(t); - sb.append((duration==Duration.EndOfTurn?" until end of turn":"")); + sb.append((duration==Duration.EndOfTurn?" until end of turn":"")); sb.append(power.getMessage()); - staticText = sb.toString(); - } + staticText = sb.toString(); + } } diff --git a/Mage/src/mage/abilities/effects/common/continious/BoostEnchantedEffect.java b/Mage/src/mage/abilities/effects/common/continious/BoostEnchantedEffect.java index e124f74d91..27a785c9b3 100644 --- a/Mage/src/mage/abilities/effects/common/continious/BoostEnchantedEffect.java +++ b/Mage/src/mage/abilities/effects/common/continious/BoostEnchantedEffect.java @@ -45,55 +45,55 @@ import mage.game.permanent.Permanent; */ public class BoostEnchantedEffect extends ContinuousEffectImpl { - private DynamicValue power; - private DynamicValue toughness; + private DynamicValue power; + private DynamicValue toughness; public BoostEnchantedEffect(int power, int toughness) { - this(power, toughness, Duration.WhileOnBattlefield); - } + this(power, toughness, Duration.WhileOnBattlefield); + } public BoostEnchantedEffect(int power, int toughness, Duration duration) { this(new StaticValue(power), new StaticValue(toughness), duration); - } + } - public BoostEnchantedEffect(DynamicValue power, DynamicValue toughness) { - this(power, toughness, Duration.WhileOnBattlefield); - } + public BoostEnchantedEffect(DynamicValue power, DynamicValue toughness) { + this(power, toughness, Duration.WhileOnBattlefield); + } - public BoostEnchantedEffect(DynamicValue power, DynamicValue toughness, Duration duration) { - super(duration, Layer.PTChangingEffects_7, SubLayer.ModifyPT_7c, Outcome.BoostCreature); - this.power = power; - this.toughness = toughness; - setText(); - } + public BoostEnchantedEffect(DynamicValue power, DynamicValue toughness, Duration duration) { + super(duration, Layer.PTChangingEffects_7, SubLayer.ModifyPT_7c, Outcome.BoostCreature); + this.power = power; + this.toughness = toughness; + setText(); + } - public BoostEnchantedEffect(final BoostEnchantedEffect effect) { - super(effect); - this.power = effect.power.clone(); - this.toughness = effect.toughness.clone(); - } + public BoostEnchantedEffect(final BoostEnchantedEffect effect) { + super(effect); + this.power = effect.power.clone(); + this.toughness = effect.toughness.clone(); + } - @Override - public BoostEnchantedEffect copy() { - return new BoostEnchantedEffect(this); - } + @Override + public BoostEnchantedEffect copy() { + return new BoostEnchantedEffect(this); + } - @Override - public boolean apply(Game game, Ability source) { - Permanent enchantment = game.getPermanent(source.getSourceId()); - if (enchantment != null && enchantment.getAttachedTo() != null) { - Permanent creature = game.getPermanent(enchantment.getAttachedTo()); - if (creature != null) { - creature.addPower(power.calculate(game, source)); - creature.addToughness(toughness.calculate(game, source)); - } - } - return true; - } + @Override + public boolean apply(Game game, Ability source) { + Permanent enchantment = game.getPermanent(source.getSourceId()); + if (enchantment != null && enchantment.getAttachedTo() != null) { + Permanent creature = game.getPermanent(enchantment.getAttachedTo()); + if (creature != null) { + creature.addPower(power.calculate(game, source)); + creature.addToughness(toughness.calculate(game, source)); + } + } + return true; + } - private void setText() { + private void setText() { StringBuilder sb = new StringBuilder(); - sb.append("Enchanted creature gets "); + sb.append("Enchanted creature gets "); String p = power.toString(); if(!p.startsWith("-")) sb.append("+"); @@ -106,14 +106,14 @@ public class BoostEnchantedEffect extends ContinuousEffectImpl 0) { sb.append(" for each "); } sb.append(message); - staticText = sb.toString(); - } + staticText = sb.toString(); + } } diff --git a/Mage/src/mage/abilities/effects/common/continious/BoostEquippedEffect.java b/Mage/src/mage/abilities/effects/common/continious/BoostEquippedEffect.java index e8126b9a56..e4dea98b77 100644 --- a/Mage/src/mage/abilities/effects/common/continious/BoostEquippedEffect.java +++ b/Mage/src/mage/abilities/effects/common/continious/BoostEquippedEffect.java @@ -45,16 +45,16 @@ import mage.game.permanent.Permanent; */ public class BoostEquippedEffect extends ContinuousEffectImpl { - private DynamicValue power; - private DynamicValue toughness; + private DynamicValue power; + private DynamicValue toughness; - public BoostEquippedEffect(int power, int toughness) { - this(power, toughness, Duration.WhileOnBattlefield); - } + public BoostEquippedEffect(int power, int toughness) { + this(power, toughness, Duration.WhileOnBattlefield); + } - public BoostEquippedEffect(int power, int toughness, Duration duration) { + public BoostEquippedEffect(int power, int toughness, Duration duration) { this(new StaticValue(power), new StaticValue(toughness), duration); - } + } public BoostEquippedEffect(DynamicValue powerDynamicValue, DynamicValue toughnessDynamicValue) { this(powerDynamicValue, toughnessDynamicValue, Duration.WhileOnBattlefield); @@ -64,36 +64,36 @@ public class BoostEquippedEffect extends ContinuousEffectImpl 0) { sb.append(" for each "); } sb.append(message); - staticText = sb.toString(); - } + staticText = sb.toString(); + } } diff --git a/Mage/src/mage/abilities/effects/common/continious/BoostOpponentsEffect.java b/Mage/src/mage/abilities/effects/common/continious/BoostOpponentsEffect.java index 7a5b98ba07..71064ab7fb 100644 --- a/Mage/src/mage/abilities/effects/common/continious/BoostOpponentsEffect.java +++ b/Mage/src/mage/abilities/effects/common/continious/BoostOpponentsEffect.java @@ -12,65 +12,65 @@ import java.util.UUID; public class BoostOpponentsEffect extends ContinuousEffectImpl { protected int power; - protected int toughness; - protected FilterCreaturePermanent filter; + protected int toughness; + protected FilterCreaturePermanent filter; - public BoostOpponentsEffect(int power, int toughness, Constants.Duration duration) { - this(power, toughness, duration, new FilterCreaturePermanent("Creatures")); - } + public BoostOpponentsEffect(int power, int toughness, Constants.Duration duration) { + this(power, toughness, duration, new FilterCreaturePermanent("Creatures")); + } - public BoostOpponentsEffect(int power, int toughness, Constants.Duration duration, FilterCreaturePermanent filter) { - super(duration, Constants.Layer.PTChangingEffects_7, Constants.SubLayer.ModifyPT_7c, Constants.Outcome.BoostCreature); - this.power = power; - this.toughness = toughness; - this.filter = filter; - setText(); - } + public BoostOpponentsEffect(int power, int toughness, Constants.Duration duration, FilterCreaturePermanent filter) { + super(duration, Constants.Layer.PTChangingEffects_7, Constants.SubLayer.ModifyPT_7c, Constants.Outcome.BoostCreature); + this.power = power; + this.toughness = toughness; + this.filter = filter; + setText(); + } - public BoostOpponentsEffect(final BoostOpponentsEffect effect) { - super(effect); - this.power = effect.power; - this.toughness = effect.toughness; - this.filter = effect.filter.copy(); - } + public BoostOpponentsEffect(final BoostOpponentsEffect effect) { + super(effect); + this.power = effect.power; + this.toughness = effect.toughness; + this.filter = effect.filter.copy(); + } - @Override - public BoostOpponentsEffect copy() { - return new BoostOpponentsEffect(this); - } + @Override + public BoostOpponentsEffect copy() { + return new BoostOpponentsEffect(this); + } - @Override - public void init(Ability source, Game game) { - super.init(source, game); - if (this.affectedObjectsSet) { + @Override + public void init(Ability source, Game game) { + super.init(source, game); + if (this.affectedObjectsSet) { Set opponents = game.getOpponents(source.getControllerId()); - for (Permanent perm: game.getBattlefield().getAllActivePermanents(filter, game)) { + for (Permanent perm: game.getBattlefield().getAllActivePermanents(filter, game)) { if (opponents.contains(perm.getControllerId())) { - objects.add(perm.getId()); + objects.add(perm.getId()); } - } - } - } + } + } + } - @Override - public boolean apply(Game game, Ability source) { + @Override + public boolean apply(Game game, Ability source) { Set opponents = game.getOpponents(source.getControllerId()); - for (Permanent perm: game.getBattlefield().getAllActivePermanents(filter, game)) { - if (!this.affectedObjectsSet || objects.contains(perm.getId())) { + for (Permanent perm: game.getBattlefield().getAllActivePermanents(filter, game)) { + if (!this.affectedObjectsSet || objects.contains(perm.getId())) { if (opponents.contains(perm.getControllerId())) { - perm.addPower(power); - perm.addToughness(toughness); + perm.addPower(power); + perm.addToughness(toughness); } - } - } - return true; - } + } + } + return true; + } - private void setText() { - StringBuilder sb = new StringBuilder(); - sb.append(filter.getMessage()); - sb.append(" your opponents control get ").append(String.format("%1$+d/%2$+d", power, toughness)); - sb.append((duration== Constants.Duration.EndOfTurn?" until end of turn":"")); - staticText = sb.toString(); - } + private void setText() { + StringBuilder sb = new StringBuilder(); + sb.append(filter.getMessage()); + sb.append(" your opponents control get ").append(String.format("%1$+d/%2$+d", power, toughness)); + sb.append((duration== Constants.Duration.EndOfTurn?" until end of turn":"")); + staticText = sb.toString(); + } } diff --git a/Mage/src/mage/abilities/effects/common/continious/BoostPairedEffect.java b/Mage/src/mage/abilities/effects/common/continious/BoostPairedEffect.java index 6896efa7ea..751653c14c 100644 --- a/Mage/src/mage/abilities/effects/common/continious/BoostPairedEffect.java +++ b/Mage/src/mage/abilities/effects/common/continious/BoostPairedEffect.java @@ -44,28 +44,28 @@ import mage.game.permanent.Permanent; public class BoostPairedEffect extends ContinuousEffectImpl { private int power; - private int toughness; + private int toughness; - public BoostPairedEffect(int power, int toughness, String rule) { + public BoostPairedEffect(int power, int toughness, String rule) { super(Duration.WhileOnBattlefield, Layer.PTChangingEffects_7, SubLayer.ModifyPT_7c, Outcome.BoostCreature); this.power = power; this.toughness = toughness; staticText = rule; } - public BoostPairedEffect(final BoostPairedEffect effect) { - super(effect); - power = effect.power; + public BoostPairedEffect(final BoostPairedEffect effect) { + super(effect); + power = effect.power; toughness = effect.toughness; - } + } - @Override - public BoostPairedEffect copy() { - return new BoostPairedEffect(this); - } + @Override + public BoostPairedEffect copy() { + return new BoostPairedEffect(this); + } - @Override - public boolean apply(Game game, Ability source) { + @Override + public boolean apply(Game game, Ability source) { Permanent permanent = game.getPermanent(source.getSourceId()); if (permanent != null && permanent.getPairedCard() != null) { Permanent paired = game.getPermanent(permanent.getPairedCard()); @@ -78,6 +78,6 @@ public class BoostPairedEffect extends ContinuousEffectImpl { } } return false; - } + } } diff --git a/Mage/src/mage/abilities/effects/common/continious/BoostSourceWhileControlsEffect.java b/Mage/src/mage/abilities/effects/common/continious/BoostSourceWhileControlsEffect.java index 3c2a30064d..1d42384867 100644 --- a/Mage/src/mage/abilities/effects/common/continious/BoostSourceWhileControlsEffect.java +++ b/Mage/src/mage/abilities/effects/common/continious/BoostSourceWhileControlsEffect.java @@ -48,39 +48,39 @@ import java.util.List; */ public class BoostSourceWhileControlsEffect extends WhileConditionContiniousEffect { - private int power; - private int toughness; + private int power; + private int toughness; private List filterDescription; - public BoostSourceWhileControlsEffect(FilterPermanent filter, int power, int toughness) { - super(Duration.WhileOnBattlefield, Layer.PTChangingEffects_7, SubLayer.ModifyPT_7c, new ControlsPermanentCondition(filter), Outcome.BoostCreature); - this.power = power; - this.toughness = toughness; + public BoostSourceWhileControlsEffect(FilterPermanent filter, int power, int toughness) { + super(Duration.WhileOnBattlefield, Layer.PTChangingEffects_7, SubLayer.ModifyPT_7c, new ControlsPermanentCondition(filter), Outcome.BoostCreature); + this.power = power; + this.toughness = toughness; this.filterDescription = filter.getName(); - staticText = "{this} gets " + String.format("%1$+d/%2$+d", power, toughness) + " as long as you control a " + filterDescription; - } + staticText = "{this} gets " + String.format("%1$+d/%2$+d", power, toughness) + " as long as you control a " + filterDescription; + } - public BoostSourceWhileControlsEffect(final BoostSourceWhileControlsEffect effect) { - super(effect); - this.power = effect.power; - this.toughness = effect.toughness; + public BoostSourceWhileControlsEffect(final BoostSourceWhileControlsEffect effect) { + super(effect); + this.power = effect.power; + this.toughness = effect.toughness; this.filterDescription = new ArrayList(); this.filterDescription.addAll(effect.filterDescription); - } + } - @Override - public BoostSourceWhileControlsEffect copy() { - return new BoostSourceWhileControlsEffect(this); - } + @Override + public BoostSourceWhileControlsEffect copy() { + return new BoostSourceWhileControlsEffect(this); + } - @Override - public boolean applyEffect(Game game, Ability source) { - Permanent permanent = game.getPermanent(source.getSourceId()); - if (permanent != null) { - permanent.addPower(power); - permanent.addToughness(toughness); - } - return true; - } + @Override + public boolean applyEffect(Game game, Ability source) { + Permanent permanent = game.getPermanent(source.getSourceId()); + if (permanent != null) { + permanent.addPower(power); + permanent.addToughness(toughness); + } + return true; + } } diff --git a/Mage/src/mage/abilities/effects/common/continious/BoostTargetEffect.java b/Mage/src/mage/abilities/effects/common/continious/BoostTargetEffect.java index 82f587a7a4..6823ffa707 100644 --- a/Mage/src/mage/abilities/effects/common/continious/BoostTargetEffect.java +++ b/Mage/src/mage/abilities/effects/common/continious/BoostTargetEffect.java @@ -81,7 +81,7 @@ public class BoostTargetEffect extends ContinuousEffectImpl { public BoostTargetEffect copy() { return new BoostTargetEffect(this); } - + @Override public void init(Ability source, Game game) { super.init(source, game); @@ -91,7 +91,7 @@ public class BoostTargetEffect extends ContinuousEffectImpl { } targetPointer.init(game, source); } - + @Override public boolean apply(Game game, Ability source) { int affectedTargets = 0; diff --git a/Mage/src/mage/abilities/effects/common/continious/CantBeBlockedByOneEffect.java b/Mage/src/mage/abilities/effects/common/continious/CantBeBlockedByOneEffect.java index db2e1ef76b..c2c6a28a0b 100644 --- a/Mage/src/mage/abilities/effects/common/continious/CantBeBlockedByOneEffect.java +++ b/Mage/src/mage/abilities/effects/common/continious/CantBeBlockedByOneEffect.java @@ -47,7 +47,7 @@ public class CantBeBlockedByOneEffect extends ContinuousEffectImpl { - public ControlEnchantedEffect() { - super(Constants.Duration.WhileOnBattlefield, Constants.Outcome.Detriment); - staticText = "You control enchanted creature"; - } + public ControlEnchantedEffect() { + super(Constants.Duration.WhileOnBattlefield, Constants.Outcome.Detriment); + staticText = "You control enchanted creature"; + } - public ControlEnchantedEffect(final ControlEnchantedEffect effect) { - super(effect); - } + public ControlEnchantedEffect(final ControlEnchantedEffect effect) { + super(effect); + } - @Override - public ControlEnchantedEffect copy() { - return new ControlEnchantedEffect(this); - } + @Override + public ControlEnchantedEffect copy() { + return new ControlEnchantedEffect(this); + } - @Override - public boolean apply(Constants.Layer layer, Constants.SubLayer sublayer, Ability source, Game game) { - Permanent enchantment = game.getPermanent(source.getSourceId()); - if (enchantment != null && enchantment.getAttachedTo() != null) { - Permanent permanent = game.getPermanent(enchantment.getAttachedTo()); - if (permanent != null) { - switch (layer) { - case ControlChangingEffects_2: - if (sublayer == Constants.SubLayer.NA) { - permanent.changeControllerId(source.getControllerId(), game); - } - break; - } - return true; - } - } - return false; - } + @Override + public boolean apply(Constants.Layer layer, Constants.SubLayer sublayer, Ability source, Game game) { + Permanent enchantment = game.getPermanent(source.getSourceId()); + if (enchantment != null && enchantment.getAttachedTo() != null) { + Permanent permanent = game.getPermanent(enchantment.getAttachedTo()); + if (permanent != null) { + switch (layer) { + case ControlChangingEffects_2: + if (sublayer == Constants.SubLayer.NA) { + permanent.changeControllerId(source.getControllerId(), game); + } + break; + } + return true; + } + } + return false; + } - @Override - public boolean apply(Game game, Ability source) { - return false; - } + @Override + public boolean apply(Game game, Ability source) { + return false; + } - @Override - public boolean hasLayer(Constants.Layer layer) { - return layer == Constants.Layer.ControlChangingEffects_2; - } + @Override + public boolean hasLayer(Constants.Layer layer) { + return layer == Constants.Layer.ControlChangingEffects_2; + } } diff --git a/Mage/src/mage/abilities/effects/common/continious/GainAbilityAllEffect.java b/Mage/src/mage/abilities/effects/common/continious/GainAbilityAllEffect.java index 515fd59c77..fc1fe5123f 100644 --- a/Mage/src/mage/abilities/effects/common/continious/GainAbilityAllEffect.java +++ b/Mage/src/mage/abilities/effects/common/continious/GainAbilityAllEffect.java @@ -44,74 +44,74 @@ import mage.game.permanent.Permanent; */ public class GainAbilityAllEffect extends ContinuousEffectImpl { - protected Ability ability; - protected boolean excludeSource; - protected FilterPermanent filter; + protected Ability ability; + protected boolean excludeSource; + protected FilterPermanent filter; - public GainAbilityAllEffect(Ability ability, Duration duration) { - this(ability, duration, new FilterPermanent()); - } + public GainAbilityAllEffect(Ability ability, Duration duration) { + this(ability, duration, new FilterPermanent()); + } - public GainAbilityAllEffect(Ability ability, Duration duration, FilterPermanent filter) { - this(ability, duration, filter, false); - } + public GainAbilityAllEffect(Ability ability, Duration duration, FilterPermanent filter) { + this(ability, duration, filter, false); + } - public GainAbilityAllEffect(Ability ability, Duration duration, FilterPermanent filter, boolean excludeSource) { - super(duration, Layer.AbilityAddingRemovingEffects_6, SubLayer.NA, Outcome.AddAbility); - this.ability = ability; - this.filter = filter; - this.excludeSource = excludeSource; - setText(); - } + public GainAbilityAllEffect(Ability ability, Duration duration, FilterPermanent filter, boolean excludeSource) { + super(duration, Layer.AbilityAddingRemovingEffects_6, SubLayer.NA, Outcome.AddAbility); + this.ability = ability; + this.filter = filter; + this.excludeSource = excludeSource; + setText(); + } - public GainAbilityAllEffect(final GainAbilityAllEffect effect) { - super(effect); - this.ability = effect.ability.copy(); - this.filter = effect.filter.copy(); - this.excludeSource = effect.excludeSource; - } + public GainAbilityAllEffect(final GainAbilityAllEffect effect) { + super(effect); + this.ability = effect.ability.copy(); + this.filter = effect.filter.copy(); + this.excludeSource = effect.excludeSource; + } - @Override - public void init(Ability source, Game game) { - super.init(source, game); - if (this.affectedObjectsSet) { + @Override + public void init(Ability source, Game game) { + super.init(source, game); + if (this.affectedObjectsSet) { for (Permanent perm: game.getBattlefield().getAllActivePermanents(filter, source.getControllerId(), game)) { if (!(excludeSource && perm.getId().equals(source.getSourceId()))) { objects.add(perm.getId()); } } - } - } + } + } - @Override - public GainAbilityAllEffect copy() { - return new GainAbilityAllEffect(this); - } + @Override + public GainAbilityAllEffect copy() { + return new GainAbilityAllEffect(this); + } - @Override - public boolean apply(Game game, Ability source) { - for (Permanent perm: game.getBattlefield().getAllActivePermanents(filter, source.getControllerId(), game)) { - if (!this.affectedObjectsSet || objects.contains(perm.getId())) { - if (!(excludeSource && perm.getId().equals(source.getSourceId()))) { - perm.addAbility(ability, game); - } - } - } - return true; - } + @Override + public boolean apply(Game game, Ability source) { + for (Permanent perm: game.getBattlefield().getAllActivePermanents(filter, source.getControllerId(), game)) { + if (!this.affectedObjectsSet || objects.contains(perm.getId())) { + if (!(excludeSource && perm.getId().equals(source.getSourceId()))) { + perm.addAbility(ability, game); + } + } + } + return true; + } - private void setText() { - StringBuilder sb = new StringBuilder(); - if (excludeSource) - sb.append("Other "); + private void setText() { + StringBuilder sb = new StringBuilder(); + if (excludeSource) + sb.append("Other "); sb.append(filter.getMessage()); if (duration.equals(Duration.WhileOnBattlefield)) sb.append(" have "); else sb.append(" gain "); - sb.append(ability.getRule()); - sb.append(" ").append(duration.toString()); - staticText = sb.toString(); - } + sb.append(ability.getRule()); + sb.append(" ").append(duration.toString()); + staticText = sb.toString(); + } } diff --git a/Mage/src/mage/abilities/effects/common/continious/GainAbilityAttachedEffect.java b/Mage/src/mage/abilities/effects/common/continious/GainAbilityAttachedEffect.java index c85cae2a14..f468aa3312 100644 --- a/Mage/src/mage/abilities/effects/common/continious/GainAbilityAttachedEffect.java +++ b/Mage/src/mage/abilities/effects/common/continious/GainAbilityAttachedEffect.java @@ -44,54 +44,54 @@ import mage.game.permanent.Permanent; */ public class GainAbilityAttachedEffect extends ContinuousEffectImpl { - protected Ability ability; + protected Ability ability; protected AttachmentType attachmentType; - public GainAbilityAttachedEffect(Ability ability, AttachmentType attachmentType) { - super(Duration.WhileOnBattlefield, Layer.AbilityAddingRemovingEffects_6, SubLayer.NA, Outcome.AddAbility); - this.ability = ability; + public GainAbilityAttachedEffect(Ability ability, AttachmentType attachmentType) { + super(Duration.WhileOnBattlefield, Layer.AbilityAddingRemovingEffects_6, SubLayer.NA, Outcome.AddAbility); + this.ability = ability; this.attachmentType = attachmentType; - setText(); - } + setText(); + } - public GainAbilityAttachedEffect(final GainAbilityAttachedEffect effect) { - super(effect); - this.ability = effect.ability.copy(); + public GainAbilityAttachedEffect(final GainAbilityAttachedEffect effect) { + super(effect); + this.ability = effect.ability.copy(); this.attachmentType = effect.attachmentType; - } + } - @Override - public GainAbilityAttachedEffect copy() { - return new GainAbilityAttachedEffect(this); - } + @Override + public GainAbilityAttachedEffect copy() { + return new GainAbilityAttachedEffect(this); + } - @Override - public boolean apply(Game game, Ability source) { - Permanent equipment = game.getPermanent(source.getSourceId()); - if (equipment != null && equipment.getAttachedTo() != null) { - Permanent creature = game.getPermanent(equipment.getAttachedTo()); - if (creature != null) { - creature.addAbility(ability, game); + @Override + public boolean apply(Game game, Ability source) { + Permanent equipment = game.getPermanent(source.getSourceId()); + if (equipment != null && equipment.getAttachedTo() != null) { + Permanent creature = game.getPermanent(equipment.getAttachedTo()); + if (creature != null) { + creature.addAbility(ability, game); } - } - return true; - } + } + return true; + } - private void setText() { + private void setText() { StringBuilder sb = new StringBuilder(); if (attachmentType == AttachmentType.AURA) { sb.append("Enchanted"); - } else if (attachmentType == AttachmentType.EQUIPMENT) { + } else if (attachmentType == AttachmentType.EQUIPMENT) { sb.append("Equipped"); - } - sb.append(" creature "); - if (duration == Duration.WhileOnBattlefield) { - sb.append("has "); - } else { - sb.append("gains "); - } - sb.append(ability.getRule()); - staticText = sb.toString(); - } + } + sb.append(" creature "); + if (duration == Duration.WhileOnBattlefield) { + sb.append("has "); + } else { + sb.append("gains "); + } + sb.append(ability.getRule()); + staticText = sb.toString(); + } } diff --git a/Mage/src/mage/abilities/effects/common/continious/GainAbilityControlledEffect.java b/Mage/src/mage/abilities/effects/common/continious/GainAbilityControlledEffect.java index cf69c1b492..581509e3d0 100644 --- a/Mage/src/mage/abilities/effects/common/continious/GainAbilityControlledEffect.java +++ b/Mage/src/mage/abilities/effects/common/continious/GainAbilityControlledEffect.java @@ -44,73 +44,73 @@ import mage.game.permanent.Permanent; */ public class GainAbilityControlledEffect extends ContinuousEffectImpl { - protected Ability ability; - protected boolean excludeSource; - protected FilterPermanent filter; + protected Ability ability; + protected boolean excludeSource; + protected FilterPermanent filter; - public GainAbilityControlledEffect(Ability ability, Duration duration) { - this(ability, duration, new FilterPermanent()); - } + public GainAbilityControlledEffect(Ability ability, Duration duration) { + this(ability, duration, new FilterPermanent()); + } - public GainAbilityControlledEffect(Ability ability, Duration duration, FilterPermanent filter) { - this(ability, duration, filter, false); - } + public GainAbilityControlledEffect(Ability ability, Duration duration, FilterPermanent filter) { + this(ability, duration, filter, false); + } - public GainAbilityControlledEffect(Ability ability, Duration duration, FilterPermanent filter, boolean excludeSource) { - super(duration, Layer.AbilityAddingRemovingEffects_6, SubLayer.NA, Outcome.AddAbility); - this.ability = ability; - this.filter = filter; - this.excludeSource = excludeSource; - setText(); - } + public GainAbilityControlledEffect(Ability ability, Duration duration, FilterPermanent filter, boolean excludeSource) { + super(duration, Layer.AbilityAddingRemovingEffects_6, SubLayer.NA, Outcome.AddAbility); + this.ability = ability; + this.filter = filter; + this.excludeSource = excludeSource; + setText(); + } - public GainAbilityControlledEffect(final GainAbilityControlledEffect effect) { - super(effect); - this.ability = effect.ability.copy(); - this.filter = effect.filter.copy(); - this.excludeSource = effect.excludeSource; - } + public GainAbilityControlledEffect(final GainAbilityControlledEffect effect) { + super(effect); + this.ability = effect.ability.copy(); + this.filter = effect.filter.copy(); + this.excludeSource = effect.excludeSource; + } - @Override - public void init(Ability source, Game game) { - super.init(source, game); - if (this.affectedObjectsSet) { - for (Permanent perm: game.getBattlefield().getAllActivePermanents(filter, source.getControllerId(), game)) { - if (!(excludeSource && perm.getId().equals(source.getSourceId()))) { - objects.add(perm.getId()); - } - } - } - } + @Override + public void init(Ability source, Game game) { + super.init(source, game); + if (this.affectedObjectsSet) { + for (Permanent perm: game.getBattlefield().getAllActivePermanents(filter, source.getControllerId(), game)) { + if (!(excludeSource && perm.getId().equals(source.getSourceId()))) { + objects.add(perm.getId()); + } + } + } + } - @Override - public GainAbilityControlledEffect copy() { - return new GainAbilityControlledEffect(this); - } + @Override + public GainAbilityControlledEffect copy() { + return new GainAbilityControlledEffect(this); + } - @Override - public boolean apply(Game game, Ability source) { - for (Permanent perm: game.getBattlefield().getAllActivePermanents(filter, source.getControllerId(), game)) { - if (!this.affectedObjectsSet || objects.contains(perm.getId())) { - if (!(excludeSource && perm.getId().equals(source.getSourceId()))) { - perm.addAbility(ability, game); - } - } - } - return true; - } + @Override + public boolean apply(Game game, Ability source) { + for (Permanent perm: game.getBattlefield().getAllActivePermanents(filter, source.getControllerId(), game)) { + if (!this.affectedObjectsSet || objects.contains(perm.getId())) { + if (!(excludeSource && perm.getId().equals(source.getSourceId()))) { + perm.addAbility(ability, game); + } + } + } + return true; + } - private void setText() { - StringBuilder sb = new StringBuilder(); - if (excludeSource) - sb.append("Other "); - sb.append(filter.getMessage()).append(" you control "); + private void setText() { + StringBuilder sb = new StringBuilder(); + if (excludeSource) + sb.append("Other "); + sb.append(filter.getMessage()).append(" you control "); if (duration.equals(Duration.WhileOnBattlefield)) sb.append("have "); else sb.append("gain "); - sb.append(ability.getRule()).append(" ").append(duration.toString()); - staticText = sb.toString(); - } + sb.append(ability.getRule()).append(" ").append(duration.toString()); + staticText = sb.toString(); + } } diff --git a/Mage/src/mage/abilities/effects/common/continious/GainAbilityControllerEffect.java b/Mage/src/mage/abilities/effects/common/continious/GainAbilityControllerEffect.java index 35ac739347..dce32e5a06 100644 --- a/Mage/src/mage/abilities/effects/common/continious/GainAbilityControllerEffect.java +++ b/Mage/src/mage/abilities/effects/common/continious/GainAbilityControllerEffect.java @@ -43,40 +43,40 @@ import mage.players.Player; */ public class GainAbilityControllerEffect extends ContinuousEffectImpl { - protected Ability ability; + protected Ability ability; - /** - * Add ability with Duration.WhileOnBattlefield - * @param ability - */ - public GainAbilityControllerEffect(Ability ability) { - this(ability, Duration.WhileOnBattlefield); - } + /** + * Add ability with Duration.WhileOnBattlefield + * @param ability + */ + public GainAbilityControllerEffect(Ability ability) { + this(ability, Duration.WhileOnBattlefield); + } - public GainAbilityControllerEffect(Ability ability, Duration duration) { - super(duration, Layer.AbilityAddingRemovingEffects_6, SubLayer.NA, Outcome.AddAbility); - this.ability = ability; - staticText = "You have " + ability.getRule() + " " + duration.toString(); - } + public GainAbilityControllerEffect(Ability ability, Duration duration) { + super(duration, Layer.AbilityAddingRemovingEffects_6, SubLayer.NA, Outcome.AddAbility); + this.ability = ability; + staticText = "You have " + ability.getRule() + " " + duration.toString(); + } - public GainAbilityControllerEffect(final GainAbilityControllerEffect effect) { - super(effect); - this.ability = effect.ability.copy(); - } + public GainAbilityControllerEffect(final GainAbilityControllerEffect effect) { + super(effect); + this.ability = effect.ability.copy(); + } - @Override - public GainAbilityControllerEffect copy() { - return new GainAbilityControllerEffect(this); - } + @Override + public GainAbilityControllerEffect copy() { + return new GainAbilityControllerEffect(this); + } - @Override - public boolean apply(Game game, Ability source) { - Player player = game.getPlayer(source.getControllerId()); - if (player != null) { - player.addAbility(ability); - return true; - } - return false; - } + @Override + public boolean apply(Game game, Ability source) { + Player player = game.getPlayer(source.getControllerId()); + if (player != null) { + player.addAbility(ability); + return true; + } + return false; + } } diff --git a/Mage/src/mage/abilities/effects/common/continious/GainAbilityPairedEffect.java b/Mage/src/mage/abilities/effects/common/continious/GainAbilityPairedEffect.java index 4b4457d8fa..fec952b558 100644 --- a/Mage/src/mage/abilities/effects/common/continious/GainAbilityPairedEffect.java +++ b/Mage/src/mage/abilities/effects/common/continious/GainAbilityPairedEffect.java @@ -43,26 +43,26 @@ import mage.game.permanent.Permanent; */ public class GainAbilityPairedEffect extends ContinuousEffectImpl { - protected Ability ability; + protected Ability ability; - public GainAbilityPairedEffect(Ability ability, String rule) { - super(Duration.WhileOnBattlefield, Layer.AbilityAddingRemovingEffects_6, SubLayer.NA, Outcome.AddAbility); - this.ability = ability; + public GainAbilityPairedEffect(Ability ability, String rule) { + super(Duration.WhileOnBattlefield, Layer.AbilityAddingRemovingEffects_6, SubLayer.NA, Outcome.AddAbility); + this.ability = ability; staticText = rule; - } + } - public GainAbilityPairedEffect(final GainAbilityPairedEffect effect) { - super(effect); - this.ability = effect.ability.copy(); - } + public GainAbilityPairedEffect(final GainAbilityPairedEffect effect) { + super(effect); + this.ability = effect.ability.copy(); + } - @Override - public GainAbilityPairedEffect copy() { - return new GainAbilityPairedEffect(this); - } + @Override + public GainAbilityPairedEffect copy() { + return new GainAbilityPairedEffect(this); + } - @Override - public boolean apply(Game game, Ability source) { + @Override + public boolean apply(Game game, Ability source) { Permanent permanent = game.getPermanent(source.getSourceId()); if (permanent != null && permanent.getPairedCard() != null) { Permanent paired = game.getPermanent(permanent.getPairedCard()); @@ -73,6 +73,6 @@ public class GainAbilityPairedEffect extends ContinuousEffectImpl { - protected Ability ability; + protected Ability ability; - /** - * Add ability with Duration.WhileOnBattlefield - * @param ability - */ - public GainAbilitySourceEffect(Ability ability) { - this(ability, Duration.WhileOnBattlefield); - } + /** + * Add ability with Duration.WhileOnBattlefield + * @param ability + */ + public GainAbilitySourceEffect(Ability ability) { + this(ability, Duration.WhileOnBattlefield); + } - public GainAbilitySourceEffect(Ability ability, Duration duration) { - super(duration, Layer.AbilityAddingRemovingEffects_6, SubLayer.NA, Outcome.AddAbility); - this.ability = ability; - staticText = "{this} gains \"" + ability.getRule() + "\"" + duration.toString(); - } + public GainAbilitySourceEffect(Ability ability, Duration duration) { + super(duration, Layer.AbilityAddingRemovingEffects_6, SubLayer.NA, Outcome.AddAbility); + this.ability = ability; + staticText = "{this} gains \"" + ability.getRule() + "\"" + duration.toString(); + } - public GainAbilitySourceEffect(final GainAbilitySourceEffect effect) { - super(effect); - this.ability = effect.ability.copy(); - } + public GainAbilitySourceEffect(final GainAbilitySourceEffect effect) { + super(effect); + this.ability = effect.ability.copy(); + } - @Override - public GainAbilitySourceEffect copy() { - return new GainAbilitySourceEffect(this); - } + @Override + public GainAbilitySourceEffect copy() { + return new GainAbilitySourceEffect(this); + } - @Override - public boolean apply(Game game, Ability source) { - Permanent permanent = game.getPermanent(source.getSourceId()); - if (permanent != null) { - permanent.addAbility(ability, game); - return true; - } - return false; - } + @Override + public boolean apply(Game game, Ability source) { + Permanent permanent = game.getPermanent(source.getSourceId()); + if (permanent != null) { + permanent.addAbility(ability, game); + return true; + } + return false; + } } diff --git a/Mage/src/mage/abilities/effects/common/continious/GainAbilityTargetEffect.java b/Mage/src/mage/abilities/effects/common/continious/GainAbilityTargetEffect.java index 9f9713e6b7..cedc045774 100644 --- a/Mage/src/mage/abilities/effects/common/continious/GainAbilityTargetEffect.java +++ b/Mage/src/mage/abilities/effects/common/continious/GainAbilityTargetEffect.java @@ -47,23 +47,23 @@ import java.util.UUID; */ public class GainAbilityTargetEffect extends ContinuousEffectImpl { - protected Ability ability; + protected Ability ability; - public GainAbilityTargetEffect(Ability ability, Duration duration) { - super(duration, Layer.AbilityAddingRemovingEffects_6, SubLayer.NA, + public GainAbilityTargetEffect(Ability ability, Duration duration) { + super(duration, Layer.AbilityAddingRemovingEffects_6, SubLayer.NA, ability.getEffects().size() > 0 ? ability.getEffects().get(0).getOutcome() : Outcome.AddAbility); - this.ability = ability; - } + this.ability = ability; + } - public GainAbilityTargetEffect(final GainAbilityTargetEffect effect) { - super(effect); - this.ability = effect.ability.copy(); - } + public GainAbilityTargetEffect(final GainAbilityTargetEffect effect) { + super(effect); + this.ability = effect.ability.copy(); + } - @Override - public GainAbilityTargetEffect copy() { - return new GainAbilityTargetEffect(this); - } + @Override + public GainAbilityTargetEffect copy() { + return new GainAbilityTargetEffect(this); + } @Override public void init(Ability source, Game game) { @@ -71,22 +71,22 @@ public class GainAbilityTargetEffect extends ContinuousEffectImpl 0; - } + @Override + public boolean apply(Game game, Ability source) { + int affectedTargets = 0; + for (UUID permanentId : targetPointer.getTargets(game, source)) { + Permanent permanent = game.getPermanent(permanentId); + if (permanent != null) { + permanent.addAbility(ability, game); + affectedTargets++; + } + } + return affectedTargets > 0; + } - @Override - public String getText(Mode mode) { - StringBuilder sb = new StringBuilder(); + @Override + public String getText(Mode mode) { + StringBuilder sb = new StringBuilder(); Target target = mode.getTargets().get(0); if(target.getNumberOfTargets() > 1){ if (target.getNumberOfTargets() < target.getMaxNumberOfTargets()) { @@ -96,8 +96,8 @@ public class GainAbilityTargetEffect extends ContinuousEffectImpl { - public GainControlTargetEffect(Duration duration) { - super(duration, Layer.ControlChangingEffects_2, SubLayer.NA, Outcome.GainControl); - } + public GainControlTargetEffect(Duration duration) { + super(duration, Layer.ControlChangingEffects_2, SubLayer.NA, Outcome.GainControl); + } - public GainControlTargetEffect(final GainControlTargetEffect effect) { - super(effect); - } + public GainControlTargetEffect(final GainControlTargetEffect effect) { + super(effect); + } - @Override - public GainControlTargetEffect copy() { - return new GainControlTargetEffect(this); - } + @Override + public GainControlTargetEffect copy() { + return new GainControlTargetEffect(this); + } - @Override - public boolean apply(Game game, Ability source) { - Permanent permanent = game.getPermanent(source.getFirstTarget()); - if (permanent != null) { - return permanent.changeControllerId(source.getControllerId(), game); - } - return false; - } + @Override + public boolean apply(Game game, Ability source) { + Permanent permanent = game.getPermanent(source.getFirstTarget()); + if (permanent != null) { + return permanent.changeControllerId(source.getControllerId(), game); + } + return false; + } - @Override - public String getText(Mode mode) { - return "Gain control of target " + mode.getTargets().get(0).getTargetName() + " " + duration.toString(); - } + @Override + public String getText(Mode mode) { + return "Gain control of target " + mode.getTargets().get(0).getTargetName() + " " + duration.toString(); + } } diff --git a/Mage/src/mage/abilities/effects/common/continious/GainProtectionFromColorTargetEffect.java b/Mage/src/mage/abilities/effects/common/continious/GainProtectionFromColorTargetEffect.java index 2dc4f49059..4ef00e3473 100644 --- a/Mage/src/mage/abilities/effects/common/continious/GainProtectionFromColorTargetEffect.java +++ b/Mage/src/mage/abilities/effects/common/continious/GainProtectionFromColorTargetEffect.java @@ -43,38 +43,38 @@ import mage.game.permanent.Permanent; */ public class GainProtectionFromColorTargetEffect extends GainAbilityTargetEffect { - FilterCard protectionFilter; + FilterCard protectionFilter; - public GainProtectionFromColorTargetEffect(Duration duration) { - super(new ProtectionAbility(new FilterCard()), duration); - protectionFilter = (FilterCard)((ProtectionAbility)ability).getFilter(); - protectionFilter.setUseColor(true); - protectionFilter.setScopeColor(ComparisonScope.Any); - staticText = "target creature you control gains protection from the color of your choice " + duration.toString(); - } + public GainProtectionFromColorTargetEffect(Duration duration) { + super(new ProtectionAbility(new FilterCard()), duration); + protectionFilter = (FilterCard)((ProtectionAbility)ability).getFilter(); + protectionFilter.setUseColor(true); + protectionFilter.setScopeColor(ComparisonScope.Any); + staticText = "target creature you control gains protection from the color of your choice " + duration.toString(); + } - public GainProtectionFromColorTargetEffect(final GainProtectionFromColorTargetEffect effect) { - super(effect); - this.protectionFilter = effect.protectionFilter.copy(); - } + public GainProtectionFromColorTargetEffect(final GainProtectionFromColorTargetEffect effect) { + super(effect); + this.protectionFilter = effect.protectionFilter.copy(); + } - @Override - public GainProtectionFromColorTargetEffect copy() { - return new GainProtectionFromColorTargetEffect(this); - } + @Override + public GainProtectionFromColorTargetEffect copy() { + return new GainProtectionFromColorTargetEffect(this); + } - @Override - public boolean apply(Game game, Ability source) { - Permanent creature = game.getPermanent(source.getFirstTarget()); - if (creature != null) { - ChoiceColor choice = (ChoiceColor) source.getChoices().get(0); - protectionFilter.setColor(choice.getColor()); - protectionFilter.setMessage(choice.getChoice()); - ((ProtectionAbility)ability).setFilter(protectionFilter); - creature.addAbility(ability, game); - return true; - } - return false; - } + @Override + public boolean apply(Game game, Ability source) { + Permanent creature = game.getPermanent(source.getFirstTarget()); + if (creature != null) { + ChoiceColor choice = (ChoiceColor) source.getChoices().get(0); + protectionFilter.setColor(choice.getColor()); + protectionFilter.setMessage(choice.getChoice()); + ((ProtectionAbility)ability).setFilter(protectionFilter); + creature.addAbility(ability, game); + return true; + } + return false; + } } diff --git a/Mage/src/mage/abilities/effects/common/continious/GainProtectionFromTypeTargetEffect.java b/Mage/src/mage/abilities/effects/common/continious/GainProtectionFromTypeTargetEffect.java index 9cee613a97..662277236c 100644 --- a/Mage/src/mage/abilities/effects/common/continious/GainProtectionFromTypeTargetEffect.java +++ b/Mage/src/mage/abilities/effects/common/continious/GainProtectionFromTypeTargetEffect.java @@ -41,33 +41,33 @@ import mage.game.permanent.Permanent; */ public class GainProtectionFromTypeTargetEffect extends GainAbilityTargetEffect { - private String typeName; + private String typeName; - public GainProtectionFromTypeTargetEffect(Duration duration, FilterCard protectionFrom) { - super(new ProtectionAbility(new FilterCard()), duration); - ((ProtectionAbility)ability).setFilter(protectionFrom); - typeName = protectionFrom.getMessage(); - staticText = "Target creature gains protection from " + typeName + " " + duration.toString(); - } + public GainProtectionFromTypeTargetEffect(Duration duration, FilterCard protectionFrom) { + super(new ProtectionAbility(new FilterCard()), duration); + ((ProtectionAbility)ability).setFilter(protectionFrom); + typeName = protectionFrom.getMessage(); + staticText = "Target creature gains protection from " + typeName + " " + duration.toString(); + } - public GainProtectionFromTypeTargetEffect(final GainProtectionFromTypeTargetEffect effect) { - super(effect); - this.typeName = effect.typeName; - } + public GainProtectionFromTypeTargetEffect(final GainProtectionFromTypeTargetEffect effect) { + super(effect); + this.typeName = effect.typeName; + } - @Override - public GainProtectionFromTypeTargetEffect copy() { - return new GainProtectionFromTypeTargetEffect(this); - } + @Override + public GainProtectionFromTypeTargetEffect copy() { + return new GainProtectionFromTypeTargetEffect(this); + } - @Override - public boolean apply(Game game, Ability source) { - Permanent creature = game.getPermanent(source.getFirstTarget()); - if (creature != null) { - creature.addAbility(ability, game); - return true; - } - return false; - } + @Override + public boolean apply(Game game, Ability source) { + Permanent creature = game.getPermanent(source.getFirstTarget()); + if (creature != null) { + creature.addAbility(ability, game); + return true; + } + return false; + } } diff --git a/Mage/src/mage/abilities/effects/common/continious/LifeTotalCantChangeControllerEffect.java b/Mage/src/mage/abilities/effects/common/continious/LifeTotalCantChangeControllerEffect.java index 06277b393a..e200a56bb1 100644 --- a/Mage/src/mage/abilities/effects/common/continious/LifeTotalCantChangeControllerEffect.java +++ b/Mage/src/mage/abilities/effects/common/continious/LifeTotalCantChangeControllerEffect.java @@ -42,32 +42,32 @@ import mage.players.Player; */ public class LifeTotalCantChangeControllerEffect extends ContinuousEffectImpl { - public LifeTotalCantChangeControllerEffect(Duration duration) { - super(duration, Layer.PlayerEffects, SubLayer.NA, Outcome.Benefit); - setText(); - } + public LifeTotalCantChangeControllerEffect(Duration duration) { + super(duration, Layer.PlayerEffects, SubLayer.NA, Outcome.Benefit); + setText(); + } - public LifeTotalCantChangeControllerEffect(final LifeTotalCantChangeControllerEffect effect) { - super(effect); - } + public LifeTotalCantChangeControllerEffect(final LifeTotalCantChangeControllerEffect effect) { + super(effect); + } - @Override - public LifeTotalCantChangeControllerEffect copy() { - return new LifeTotalCantChangeControllerEffect(this); - } + @Override + public LifeTotalCantChangeControllerEffect copy() { + return new LifeTotalCantChangeControllerEffect(this); + } - @Override - public boolean apply(Game game, Ability source) { - Player player = game.getPlayer(source.getControllerId()); - if (player != null) { - player.setLifeTotalCanChange(false); - return true; - } - return true; - } + @Override + public boolean apply(Game game, Ability source) { + Player player = game.getPlayer(source.getControllerId()); + if (player != null) { + player.setLifeTotalCanChange(false); + return true; + } + return true; + } - private void setText() { - staticText = "Your life total can't change. (You can't gain or lose life. You can't pay any amount of life except 0.)"; - } + private void setText() { + staticText = "Your life total can't change. (You can't gain or lose life. You can't pay any amount of life except 0.)"; + } } \ No newline at end of file diff --git a/Mage/src/mage/abilities/effects/common/continious/LoseAbilityAttachedEffect.java b/Mage/src/mage/abilities/effects/common/continious/LoseAbilityAttachedEffect.java index 5f13b3e968..389cefd760 100644 --- a/Mage/src/mage/abilities/effects/common/continious/LoseAbilityAttachedEffect.java +++ b/Mage/src/mage/abilities/effects/common/continious/LoseAbilityAttachedEffect.java @@ -40,56 +40,56 @@ import mage.game.permanent.Permanent; */ public class LoseAbilityAttachedEffect extends ContinuousEffectImpl { - protected Ability ability; + protected Ability ability; protected AttachmentType attachmentType; - public LoseAbilityAttachedEffect(Ability ability, AttachmentType attachmentType) { - super(Duration.WhileOnBattlefield, Layer.AbilityAddingRemovingEffects_6, SubLayer.NA, Outcome.LoseAbility); - this.ability = ability; + public LoseAbilityAttachedEffect(Ability ability, AttachmentType attachmentType) { + super(Duration.WhileOnBattlefield, Layer.AbilityAddingRemovingEffects_6, SubLayer.NA, Outcome.LoseAbility); + this.ability = ability; this.attachmentType = attachmentType; - setText(); - } + setText(); + } - public LoseAbilityAttachedEffect(final LoseAbilityAttachedEffect effect) { - super(effect); - this.ability = effect.ability.copy(); + public LoseAbilityAttachedEffect(final LoseAbilityAttachedEffect effect) { + super(effect); + this.ability = effect.ability.copy(); this.attachmentType = effect.attachmentType; - } + } - @Override - public LoseAbilityAttachedEffect copy() { - return new LoseAbilityAttachedEffect(this); - } + @Override + public LoseAbilityAttachedEffect copy() { + return new LoseAbilityAttachedEffect(this); + } - @Override - public boolean apply(Game game, Ability source) { - Permanent equipment = game.getPermanent(source.getSourceId()); - if (equipment != null && equipment.getAttachedTo() != null) { - Permanent creature = game.getPermanent(equipment.getAttachedTo()); - if (creature != null) { + @Override + public boolean apply(Game game, Ability source) { + Permanent equipment = game.getPermanent(source.getSourceId()); + if (equipment != null && equipment.getAttachedTo() != null) { + Permanent creature = game.getPermanent(equipment.getAttachedTo()); + if (creature != null) { while (creature.getAbilities().contains(ability)) { creature.getAbilities().remove(ability); } } - } - return true; - } + } + return true; + } - private void setText() { + private void setText() { StringBuilder sb = new StringBuilder(); if (attachmentType == AttachmentType.AURA) { sb.append("Enchanted"); - } else if (attachmentType == AttachmentType.EQUIPMENT) { + } else if (attachmentType == AttachmentType.EQUIPMENT) { sb.append("Equipped"); - } - sb.append(" creature "); - if (duration == Duration.WhileOnBattlefield) { - sb.append("loses "); - } else { - sb.append("loses "); - } - sb.append(ability.getRule()); - staticText = sb.toString(); - } + } + sb.append(" creature "); + if (duration == Duration.WhileOnBattlefield) { + sb.append("loses "); + } else { + sb.append("loses "); + } + sb.append(ability.getRule()); + staticText = sb.toString(); + } } diff --git a/Mage/src/mage/abilities/effects/common/continious/LoseAllAbilitiesTargetEffect.java b/Mage/src/mage/abilities/effects/common/continious/LoseAllAbilitiesTargetEffect.java index 32b02a35a7..1a980347fe 100644 --- a/Mage/src/mage/abilities/effects/common/continious/LoseAllAbilitiesTargetEffect.java +++ b/Mage/src/mage/abilities/effects/common/continious/LoseAllAbilitiesTargetEffect.java @@ -46,37 +46,37 @@ import java.util.UUID; */ public class LoseAllAbilitiesTargetEffect extends ContinuousEffectImpl { - public LoseAllAbilitiesTargetEffect(Duration duration) { - super(duration, Layer.AbilityAddingRemovingEffects_6, SubLayer.NA, Outcome.AddAbility); - } + public LoseAllAbilitiesTargetEffect(Duration duration) { + super(duration, Layer.AbilityAddingRemovingEffects_6, SubLayer.NA, Outcome.AddAbility); + } - public LoseAllAbilitiesTargetEffect(final LoseAllAbilitiesTargetEffect effect) { - super(effect); - } + public LoseAllAbilitiesTargetEffect(final LoseAllAbilitiesTargetEffect effect) { + super(effect); + } - @Override - public LoseAllAbilitiesTargetEffect copy() { - return new LoseAllAbilitiesTargetEffect(this); - } + @Override + public LoseAllAbilitiesTargetEffect copy() { + return new LoseAllAbilitiesTargetEffect(this); + } - @Override - public boolean apply(Game game, Ability source) { - int affectedTargets = 0; - for (UUID permanentId : targetPointer.getTargets(game, source)) { - Permanent permanent = game.getPermanent(permanentId); - if (permanent != null) { - permanent.getAbilities().clear(); - affectedTargets++; - } - } - return affectedTargets > 0; - } + @Override + public boolean apply(Game game, Ability source) { + int affectedTargets = 0; + for (UUID permanentId : targetPointer.getTargets(game, source)) { + Permanent permanent = game.getPermanent(permanentId); + if (permanent != null) { + permanent.getAbilities().clear(); + affectedTargets++; + } + } + return affectedTargets > 0; + } - @Override - public String getText(Mode mode) { - StringBuilder sb = new StringBuilder(); - sb.append("Target ").append(mode.getTargets().get(0).getTargetName()).append(" loses all abilities ").append(duration.toString()); - return sb.toString(); - } + @Override + public String getText(Mode mode) { + StringBuilder sb = new StringBuilder(); + sb.append("Target ").append(mode.getTargets().get(0).getTargetName()).append(" loses all abilities ").append(duration.toString()); + return sb.toString(); + } } \ No newline at end of file diff --git a/Mage/src/mage/abilities/effects/common/continious/MaximumHandSizeControllerEffect.java b/Mage/src/mage/abilities/effects/common/continious/MaximumHandSizeControllerEffect.java index 26a99a9629..8b1a398cdd 100644 --- a/Mage/src/mage/abilities/effects/common/continious/MaximumHandSizeControllerEffect.java +++ b/Mage/src/mage/abilities/effects/common/continious/MaximumHandSizeControllerEffect.java @@ -42,60 +42,60 @@ import mage.players.Player; */ public class MaximumHandSizeControllerEffect extends ContinuousEffectImpl { - protected int handSize; - protected boolean reduce; + protected int handSize; + protected boolean reduce; - /** - * @param handSize Maximum hand size to set or to reduce by - * @param duration Effect duration - * @param reduce If true, the hand size will be reduced related to current value, otherwise it will be set. - */ - public MaximumHandSizeControllerEffect(int handSize, Duration duration, boolean reduce) { - super(duration, Layer.PlayerEffects, SubLayer.NA, Outcome.Benefit); - this.handSize = handSize; - this.reduce = reduce; - setText(); - } + /** + * @param handSize Maximum hand size to set or to reduce by + * @param duration Effect duration + * @param reduce If true, the hand size will be reduced related to current value, otherwise it will be set. + */ + public MaximumHandSizeControllerEffect(int handSize, Duration duration, boolean reduce) { + super(duration, Layer.PlayerEffects, SubLayer.NA, Outcome.Benefit); + this.handSize = handSize; + this.reduce = reduce; + setText(); + } - public MaximumHandSizeControllerEffect(final MaximumHandSizeControllerEffect effect) { - super(effect); - this.handSize = effect.handSize; - this.reduce = effect.reduce; - } + public MaximumHandSizeControllerEffect(final MaximumHandSizeControllerEffect effect) { + super(effect); + this.handSize = effect.handSize; + this.reduce = effect.reduce; + } - @Override - public MaximumHandSizeControllerEffect copy() { - return new MaximumHandSizeControllerEffect(this); - } + @Override + public MaximumHandSizeControllerEffect copy() { + return new MaximumHandSizeControllerEffect(this); + } - @Override - public boolean apply(Game game, Ability source) { - Player player = game.getPlayer(source.getControllerId()); - if (player != null) { - if (reduce) { - player.setMaxHandSize(player.getMaxHandSize() - handSize); - } else { - player.setMaxHandSize(handSize); - } - return true; - } - return true; - } + @Override + public boolean apply(Game game, Ability source) { + Player player = game.getPlayer(source.getControllerId()); + if (player != null) { + if (reduce) { + player.setMaxHandSize(player.getMaxHandSize() - handSize); + } else { + player.setMaxHandSize(handSize); + } + return true; + } + return true; + } - private void setText() { + private void setText() { - if (handSize == Integer.MAX_VALUE) { - staticText = "You have no maximum hand size"; - } else { - StringBuilder sb = new StringBuilder("Your maximum hand size is "); - if (reduce) { - sb.append("reduced by "); - sb.append(Integer.toString(handSize)); - } else { - sb.append(Integer.toString(handSize)); - } - staticText = sb.toString(); - } - } + if (handSize == Integer.MAX_VALUE) { + staticText = "You have no maximum hand size"; + } else { + StringBuilder sb = new StringBuilder("Your maximum hand size is "); + if (reduce) { + sb.append("reduced by "); + sb.append(Integer.toString(handSize)); + } else { + sb.append(Integer.toString(handSize)); + } + staticText = sb.toString(); + } + } } \ No newline at end of file diff --git a/Mage/src/mage/abilities/effects/common/continious/PlayAdditionalLandsAllEffect.java b/Mage/src/mage/abilities/effects/common/continious/PlayAdditionalLandsAllEffect.java index 7a4452fa37..96819b1fae 100644 --- a/Mage/src/mage/abilities/effects/common/continious/PlayAdditionalLandsAllEffect.java +++ b/Mage/src/mage/abilities/effects/common/continious/PlayAdditionalLandsAllEffect.java @@ -41,28 +41,28 @@ import mage.players.Player; */ public class PlayAdditionalLandsAllEffect extends ContinuousEffectImpl { - public PlayAdditionalLandsAllEffect() { - super(Constants.Duration.WhileOnBattlefield, Constants.Layer.PlayerEffects, Constants.SubLayer.NA, Constants.Outcome.Benefit); - staticText = "Each player may play an additional land on each of his or her turns"; - } + public PlayAdditionalLandsAllEffect() { + super(Constants.Duration.WhileOnBattlefield, Constants.Layer.PlayerEffects, Constants.SubLayer.NA, Constants.Outcome.Benefit); + staticText = "Each player may play an additional land on each of his or her turns"; + } - public PlayAdditionalLandsAllEffect(final PlayAdditionalLandsAllEffect effect) { - super(effect); - } + public PlayAdditionalLandsAllEffect(final PlayAdditionalLandsAllEffect effect) { + super(effect); + } - @Override - public PlayAdditionalLandsAllEffect copy() { - return new PlayAdditionalLandsAllEffect(this); - } + @Override + public PlayAdditionalLandsAllEffect copy() { + return new PlayAdditionalLandsAllEffect(this); + } - @Override - public boolean apply(Game game, Ability source) { - Player player = game.getPlayer(game.getActivePlayerId()); - if (player != null) { - player.setLandsPerTurn(player.getLandsPerTurn() + 1); - return true; - } - return true; - } + @Override + public boolean apply(Game game, Ability source) { + Player player = game.getPlayer(game.getActivePlayerId()); + if (player != null) { + player.setLandsPerTurn(player.getLandsPerTurn() + 1); + return true; + } + return true; + } } \ No newline at end of file diff --git a/Mage/src/mage/abilities/effects/common/continious/PlayAdditionalLandsControllerEffect.java b/Mage/src/mage/abilities/effects/common/continious/PlayAdditionalLandsControllerEffect.java index 90d06b6ab3..e60993331c 100644 --- a/Mage/src/mage/abilities/effects/common/continious/PlayAdditionalLandsControllerEffect.java +++ b/Mage/src/mage/abilities/effects/common/continious/PlayAdditionalLandsControllerEffect.java @@ -43,39 +43,39 @@ import mage.players.Player; */ public class PlayAdditionalLandsControllerEffect extends ContinuousEffectImpl { - protected int additionalCards; + protected int additionalCards; - public PlayAdditionalLandsControllerEffect(int additionalCards, Duration duration) { - super(duration, Layer.PlayerEffects, SubLayer.NA, Outcome.Benefit); - this.additionalCards = additionalCards; - setText(); - } + public PlayAdditionalLandsControllerEffect(int additionalCards, Duration duration) { + super(duration, Layer.PlayerEffects, SubLayer.NA, Outcome.Benefit); + this.additionalCards = additionalCards; + setText(); + } - public PlayAdditionalLandsControllerEffect(final PlayAdditionalLandsControllerEffect effect) { - super(effect); - this.additionalCards = effect.additionalCards; - } + public PlayAdditionalLandsControllerEffect(final PlayAdditionalLandsControllerEffect effect) { + super(effect); + this.additionalCards = effect.additionalCards; + } - @Override - public PlayAdditionalLandsControllerEffect copy() { - return new PlayAdditionalLandsControllerEffect(this); - } + @Override + public PlayAdditionalLandsControllerEffect copy() { + return new PlayAdditionalLandsControllerEffect(this); + } - @Override - public boolean apply(Game game, Ability source) { - Player player = game.getPlayer(source.getControllerId()); - if (player != null) { - player.setLandsPerTurn(player.getLandsPerTurn() + this.additionalCards); - return true; - } - return true; - } + @Override + public boolean apply(Game game, Ability source) { + Player player = game.getPlayer(source.getControllerId()); + if (player != null) { + player.setLandsPerTurn(player.getLandsPerTurn() + this.additionalCards); + return true; + } + return true; + } - private void setText() { - StringBuilder sb = new StringBuilder(); - sb.append("You may play ").append(Integer.toString(additionalCards)).append(" additional land").append((additionalCards == 1?"":"s")); - sb.append((duration==Duration.EndOfTurn?" this turn":"")); - staticText = sb.toString(); - } + private void setText() { + StringBuilder sb = new StringBuilder(); + sb.append("You may play ").append(Integer.toString(additionalCards)).append(" additional land").append((additionalCards == 1?"":"s")); + sb.append((duration==Duration.EndOfTurn?" this turn":"")); + staticText = sb.toString(); + } } \ No newline at end of file diff --git a/Mage/src/mage/abilities/effects/common/continious/PlayTheTopCardEffect.java b/Mage/src/mage/abilities/effects/common/continious/PlayTheTopCardEffect.java index 9ddce7fe72..0f3d35ca1f 100644 --- a/Mage/src/mage/abilities/effects/common/continious/PlayTheTopCardEffect.java +++ b/Mage/src/mage/abilities/effects/common/continious/PlayTheTopCardEffect.java @@ -43,39 +43,39 @@ import static mage.Constants.*; */ public class PlayTheTopCardEffect extends AsThoughEffectImpl { - private FilterCard filter; + private FilterCard filter; - public PlayTheTopCardEffect(FilterCard filter) { - super(AsThoughEffectType.CAST, Duration.WhileOnBattlefield, Outcome.Benefit); - this.filter = filter; - staticText = "You may play the top card of your library if it's a " + filter.getMessage(); - } + public PlayTheTopCardEffect(FilterCard filter) { + super(AsThoughEffectType.CAST, Duration.WhileOnBattlefield, Outcome.Benefit); + this.filter = filter; + staticText = "You may play the top card of your library if it's a " + filter.getMessage(); + } - public PlayTheTopCardEffect(final PlayTheTopCardEffect effect) { - super(effect); - this.filter = effect.filter; - } + public PlayTheTopCardEffect(final PlayTheTopCardEffect effect) { + super(effect); + this.filter = effect.filter; + } - @Override - public boolean apply(Game game, Ability source) { - return true; - } + @Override + public boolean apply(Game game, Ability source) { + return true; + } - @Override - public PlayTheTopCardEffect copy() { - return new PlayTheTopCardEffect(this); - } + @Override + public PlayTheTopCardEffect copy() { + return new PlayTheTopCardEffect(this); + } - @Override - public boolean applies(UUID sourceId, Ability source, Game game) { - Card card = game.getCard(sourceId); - if (card != null && filter.match(card, game)) { - Player player = game.getPlayer(card.getOwnerId()); - if (player != null && card.equals(player.getLibrary().getFromTop(game))) { - return true; - } - } - return false; - } + @Override + public boolean applies(UUID sourceId, Ability source, Game game) { + Card card = game.getCard(sourceId); + if (card != null && filter.match(card, game)) { + Player player = game.getPlayer(card.getOwnerId()); + if (player != null && card.equals(player.getLibrary().getFromTop(game))) { + return true; + } + } + return false; + } } \ No newline at end of file diff --git a/Mage/src/mage/abilities/effects/common/continious/PlayWithTheTopCardRevealedEffect.java b/Mage/src/mage/abilities/effects/common/continious/PlayWithTheTopCardRevealedEffect.java index 78bf5fff36..912d50e1e2 100644 --- a/Mage/src/mage/abilities/effects/common/continious/PlayWithTheTopCardRevealedEffect.java +++ b/Mage/src/mage/abilities/effects/common/continious/PlayWithTheTopCardRevealedEffect.java @@ -39,28 +39,28 @@ import mage.players.Player; */ public class PlayWithTheTopCardRevealedEffect extends ContinuousEffectImpl { - public PlayWithTheTopCardRevealedEffect() { - super(Duration.WhileOnBattlefield, Layer.PlayerEffects, SubLayer.NA, Outcome.Detriment); - staticText = "Play with the top card of your library revealed"; - } + public PlayWithTheTopCardRevealedEffect() { + super(Duration.WhileOnBattlefield, Layer.PlayerEffects, SubLayer.NA, Outcome.Detriment); + staticText = "Play with the top card of your library revealed"; + } - public PlayWithTheTopCardRevealedEffect(final PlayWithTheTopCardRevealedEffect effect) { - super(effect); - } + public PlayWithTheTopCardRevealedEffect(final PlayWithTheTopCardRevealedEffect effect) { + super(effect); + } - @Override - public boolean apply(Game game, Ability source) { - Player player = game.getPlayer(source.getControllerId()); - if (player != null) { - player.setTopCardRevealed(true); - return true; - } - return false; - } + @Override + public boolean apply(Game game, Ability source) { + Player player = game.getPlayer(source.getControllerId()); + if (player != null) { + player.setTopCardRevealed(true); + return true; + } + return false; + } - @Override - public PlayWithTheTopCardRevealedEffect copy() { - return new PlayWithTheTopCardRevealedEffect(this); - } + @Override + public PlayWithTheTopCardRevealedEffect copy() { + return new PlayWithTheTopCardRevealedEffect(this); + } } \ No newline at end of file diff --git a/Mage/src/mage/abilities/effects/common/continious/SetCardColorAttachedEffect.java b/Mage/src/mage/abilities/effects/common/continious/SetCardColorAttachedEffect.java index 4b7437f3c5..99698a7fde 100644 --- a/Mage/src/mage/abilities/effects/common/continious/SetCardColorAttachedEffect.java +++ b/Mage/src/mage/abilities/effects/common/continious/SetCardColorAttachedEffect.java @@ -39,14 +39,14 @@ import mage.game.permanent.Permanent; */ public class SetCardColorAttachedEffect extends ContinuousEffectImpl { - private ObjectColor setColor; + private ObjectColor setColor; private Constants.AttachmentType attachmentType; public SetCardColorAttachedEffect(ObjectColor setColor, Constants.Duration duration, Constants.AttachmentType attachmentType) { super(duration, Constants.Layer.ColorChangingEffects_5, Constants.SubLayer.NA, Constants.Outcome.Benefit); this.setColor = setColor; this.attachmentType = attachmentType; - setText(); + setText(); } public SetCardColorAttachedEffect(final SetCardColorAttachedEffect effect) { diff --git a/Mage/src/mage/abilities/effects/common/continious/SetCardColorTargetEffect.java b/Mage/src/mage/abilities/effects/common/continious/SetCardColorTargetEffect.java index bee0e5f663..b0cad7aa68 100644 --- a/Mage/src/mage/abilities/effects/common/continious/SetCardColorTargetEffect.java +++ b/Mage/src/mage/abilities/effects/common/continious/SetCardColorTargetEffect.java @@ -44,13 +44,13 @@ import mage.game.stack.StackObject; * @author LevelX */ public class SetCardColorTargetEffect extends ContinuousEffectImpl { - + private ObjectColor setColor; public SetCardColorTargetEffect(ObjectColor setColor, Constants.Duration duration, String text) { super(duration, Constants.Layer.ColorChangingEffects_5, Constants.SubLayer.NA, Constants.Outcome.Benefit); this.setColor = setColor; - staticText = text; + staticText = text; } public SetCardColorTargetEffect(ObjectColor setColor, Constants.Duration duration) { @@ -62,7 +62,7 @@ public class SetCardColorTargetEffect extends ContinuousEffectImpl setSubtypes, Constants.Duration duration, Constants.AttachmentType attachmentType) { super(duration, Constants.Layer.TypeChangingEffects_4, Constants.SubLayer.NA, Constants.Outcome.Benefit); this.setSubtypes.addAll(setSubtypes); this.attachmentType = attachmentType; - setText(); + setText(); } public SetCardSubtypeAttachedEffect(final SetCardSubtypeAttachedEffect effect) { @@ -68,10 +68,10 @@ public class SetCardSubtypeAttachedEffect extends ContinuousEffectImpl { - private DynamicValue amount; + private DynamicValue amount; private int power; private int toughness; public SetPowerToughnessSourceEffect(DynamicValue amount, Duration duration) { super(duration, Layer.PTChangingEffects_7, SubLayer.SetPT_7b, Outcome.BoostCreature); this.amount = amount; - staticText = "{this}'s power and toughness are each equal to the number of " + amount.getMessage(); + staticText = "{this}'s power and toughness are each equal to the number of " + amount.getMessage(); } public SetPowerToughnessSourceEffect(int power, int toughness, Duration duration) { super(duration, Layer.PTChangingEffects_7, SubLayer.SetPT_7b, Outcome.BoostCreature); this.power = power; this.toughness = toughness; - staticText = "{this}'s power and toughness is " + power + "/" + toughness; + staticText = "{this}'s power and toughness is " + power + "/" + toughness; } public SetPowerToughnessSourceEffect(final SetPowerToughnessSourceEffect effect) { - super(effect); - this.amount = effect.amount; + super(effect); + this.amount = effect.amount; this.power = effect.power; this.toughness = effect.toughness; - } + } - @Override - public SetPowerToughnessSourceEffect copy() { - return new SetPowerToughnessSourceEffect(this); - } + @Override + public SetPowerToughnessSourceEffect copy() { + return new SetPowerToughnessSourceEffect(this); + } - @Override - public boolean apply(Game game, Ability source) { - Permanent target = game.getPermanent(source.getSourceId()); - if (target != null) { + @Override + public boolean apply(Game game, Ability source) { + Permanent target = game.getPermanent(source.getSourceId()); + if (target != null) { if (amount != null) { int value = amount.calculate(game, source); target.getPower().setValue(value); @@ -89,8 +89,8 @@ public class SetPowerToughnessSourceEffect extends ContinuousEffectImpl { - private DynamicValue power; - private DynamicValue toughness; + private DynamicValue power; + private DynamicValue toughness; public SetPowerToughnessTargetEffect(DynamicValue power, DynamicValue toughness, Duration duration) { super(duration, Layer.PTChangingEffects_7, SubLayer.SetPT_7b, Outcome.BoostCreature); this.power = power; - this.toughness = toughness; + this.toughness = toughness; } - public SetPowerToughnessTargetEffect(int power, int toughness, Duration duration) { - this(new StaticValue(power), new StaticValue(toughness), duration); - } + public SetPowerToughnessTargetEffect(int power, int toughness, Duration duration) { + this(new StaticValue(power), new StaticValue(toughness), duration); + } - public SetPowerToughnessTargetEffect(final SetPowerToughnessTargetEffect effect) { - super(effect); - this.power = effect.power; - this.toughness = effect.toughness; - } + public SetPowerToughnessTargetEffect(final SetPowerToughnessTargetEffect effect) { + super(effect); + this.power = effect.power; + this.toughness = effect.toughness; + } - @Override - public SetPowerToughnessTargetEffect copy() { - return new SetPowerToughnessTargetEffect(this); - } + @Override + public SetPowerToughnessTargetEffect copy() { + return new SetPowerToughnessTargetEffect(this); + } - @Override - public boolean apply(Game game, Ability source) { - Permanent target = game.getPermanent(source.getFirstTarget()); - if (target != null) { - target.getPower().setValue(power.calculate(game, source)); - target.getToughness().setValue(toughness.calculate(game, source)); - return true; - } - return false; - } + @Override + public boolean apply(Game game, Ability source) { + Permanent target = game.getPermanent(source.getFirstTarget()); + if (target != null) { + target.getPower().setValue(power.calculate(game, source)); + target.getToughness().setValue(toughness.calculate(game, source)); + return true; + } + return false; + } - @Override - public String getText(Mode mode) { - StringBuilder sb = new StringBuilder(); - sb.append("target ").append(mode.getTargets().get(0).getTargetName()).append(" becomes "); - sb.append(power).append("/").append(toughness).append(" ").append(duration.toString()); - return sb.toString(); - } + @Override + public String getText(Mode mode) { + StringBuilder sb = new StringBuilder(); + sb.append("target ").append(mode.getTargets().get(0).getTargetName()).append(" becomes "); + sb.append(power).append("/").append(toughness).append(" ").append(duration.toString()); + return sb.toString(); + } } \ No newline at end of file diff --git a/Mage/src/mage/abilities/effects/common/continious/SwitchPowerToughnessTargetEffect.java b/Mage/src/mage/abilities/effects/common/continious/SwitchPowerToughnessTargetEffect.java index ae09dddd1b..2c32834fe4 100644 --- a/Mage/src/mage/abilities/effects/common/continious/SwitchPowerToughnessTargetEffect.java +++ b/Mage/src/mage/abilities/effects/common/continious/SwitchPowerToughnessTargetEffect.java @@ -44,38 +44,38 @@ import mage.game.permanent.Permanent; */ public class SwitchPowerToughnessTargetEffect extends ContinuousEffectImpl { - public SwitchPowerToughnessTargetEffect(Duration duration) { - super(duration, Layer.PTChangingEffects_7, SubLayer.SwitchPT_e, Outcome.BoostCreature); - } + public SwitchPowerToughnessTargetEffect(Duration duration) { + super(duration, Layer.PTChangingEffects_7, SubLayer.SwitchPT_e, Outcome.BoostCreature); + } - public SwitchPowerToughnessTargetEffect(final SwitchPowerToughnessTargetEffect effect) { - super(effect); - } + public SwitchPowerToughnessTargetEffect(final SwitchPowerToughnessTargetEffect effect) { + super(effect); + } - @Override - public SwitchPowerToughnessTargetEffect copy() { - return new SwitchPowerToughnessTargetEffect(this); - } + @Override + public SwitchPowerToughnessTargetEffect copy() { + return new SwitchPowerToughnessTargetEffect(this); + } - @Override - public boolean apply(Game game, Ability source) { - Permanent target = (Permanent) game.getPermanent(source.getFirstTarget()); - if (target != null) { - int power = target.getPower().getValue(); - target.getPower().setValue(target.getToughness().getValue()); - target.getToughness().setValue(power); - return true; - } - return false; - } + @Override + public boolean apply(Game game, Ability source) { + Permanent target = (Permanent) game.getPermanent(source.getFirstTarget()); + if (target != null) { + int power = target.getPower().getValue(); + target.getPower().setValue(target.getToughness().getValue()); + target.getToughness().setValue(power); + return true; + } + return false; + } - @Override - public String getText(Mode mode) { - StringBuilder sb = new StringBuilder(); - sb.append("Switch target ").append(mode.getTargets().get(0).getTargetName()).append("'s power and toughness") - .append(" ").append(duration.toString()); - return sb.toString(); - } + @Override + public String getText(Mode mode) { + StringBuilder sb = new StringBuilder(); + sb.append("Switch target ").append(mode.getTargets().get(0).getTargetName()).append("'s power and toughness") + .append(" ").append(duration.toString()); + return sb.toString(); + } } \ No newline at end of file diff --git a/Mage/src/mage/abilities/effects/common/counter/AddCountersAllEffect.java b/Mage/src/mage/abilities/effects/common/counter/AddCountersAllEffect.java index 53c2a627c4..14973b5f1f 100644 --- a/Mage/src/mage/abilities/effects/common/counter/AddCountersAllEffect.java +++ b/Mage/src/mage/abilities/effects/common/counter/AddCountersAllEffect.java @@ -50,7 +50,7 @@ public class AddCountersAllEffect extends OneShotEffect { super(Outcome.Benefit); this.counter = counter; this.filter = filter; - setText(); + setText(); } public AddCountersAllEffect(final AddCountersAllEffect effect) { diff --git a/Mage/src/mage/abilities/effects/common/counter/AddCountersControllerEffect.java b/Mage/src/mage/abilities/effects/common/counter/AddCountersControllerEffect.java index 3098b5041c..7d509a5875 100644 --- a/Mage/src/mage/abilities/effects/common/counter/AddCountersControllerEffect.java +++ b/Mage/src/mage/abilities/effects/common/counter/AddCountersControllerEffect.java @@ -50,54 +50,54 @@ public class AddCountersControllerEffect extends OneShotEffect 1) { - StringBuilder sb = new StringBuilder(); - sb.append("its controller gets ").append(Integer.toString(counter.getCount())).append(" ").append(counter.getName()).append(" counters"); - staticText = sb.toString(); - } else - staticText = "its controller gets a " + counter.getName() + " counter"; - } + if (counter.getCount() > 1) { + StringBuilder sb = new StringBuilder(); + sb.append("its controller gets ").append(Integer.toString(counter.getCount())).append(" ").append(counter.getName()).append(" counters"); + staticText = sb.toString(); + } else + staticText = "its controller gets a " + counter.getName() + " counter"; + } - @Override - public AddCountersControllerEffect copy() { - return new AddCountersControllerEffect(this); - } + @Override + public AddCountersControllerEffect copy() { + return new AddCountersControllerEffect(this); + } } diff --git a/Mage/src/mage/abilities/effects/common/counter/AddCountersSourceEffect.java b/Mage/src/mage/abilities/effects/common/counter/AddCountersSourceEffect.java index cc6b3a96c9..ce83f345b3 100644 --- a/Mage/src/mage/abilities/effects/common/counter/AddCountersSourceEffect.java +++ b/Mage/src/mage/abilities/effects/common/counter/AddCountersSourceEffect.java @@ -42,42 +42,42 @@ public class AddCountersSourceEffect extends OneShotEffect 1) { - StringBuilder sb = new StringBuilder(); - sb.append("put ").append(Integer.toString(counter.getCount())).append(" ").append(counter.getName()).append(" counters on {this}"); - staticText = sb.toString(); - } else - staticText = "put a " + counter.getName() + " counter on {this}"; - } + if (counter.getCount() > 1) { + StringBuilder sb = new StringBuilder(); + sb.append("put ").append(Integer.toString(counter.getCount())).append(" ").append(counter.getName()).append(" counters on {this}"); + staticText = sb.toString(); + } else + staticText = "put a " + counter.getName() + " counter on {this}"; + } - @Override - public AddCountersSourceEffect copy() { - return new AddCountersSourceEffect(this); - } + @Override + public AddCountersSourceEffect copy() { + return new AddCountersSourceEffect(this); + } } diff --git a/Mage/src/mage/abilities/effects/common/counter/AddCountersTargetEffect.java b/Mage/src/mage/abilities/effects/common/counter/AddCountersTargetEffect.java index 92ec607c90..22c462b91b 100644 --- a/Mage/src/mage/abilities/effects/common/counter/AddCountersTargetEffect.java +++ b/Mage/src/mage/abilities/effects/common/counter/AddCountersTargetEffect.java @@ -45,63 +45,63 @@ import mage.abilities.Mode; */ public class AddCountersTargetEffect extends OneShotEffect { - private Counter counter; + private Counter counter; - public AddCountersTargetEffect(Counter counter) { - this(counter, Outcome.Benefit); - } + public AddCountersTargetEffect(Counter counter) { + this(counter, Outcome.Benefit); + } public AddCountersTargetEffect(Counter counter, Outcome outcome) { - super(outcome); - this.counter = counter; - } + super(outcome); + this.counter = counter; + } - public AddCountersTargetEffect(final AddCountersTargetEffect effect) { - super(effect); - this.counter = effect.counter.copy(); - } + public AddCountersTargetEffect(final AddCountersTargetEffect effect) { + super(effect); + this.counter = effect.counter.copy(); + } - @Override - public boolean apply(Game game, Ability source) { - int affectedTargets = 0; - for (UUID uuid : targetPointer.getTargets(game, source)) { - Permanent permanent = game.getPermanent(uuid); - if (permanent != null) { - if (counter != null) { - permanent.addCounters(counter.copy(), game); + @Override + public boolean apply(Game game, Ability source) { + int affectedTargets = 0; + for (UUID uuid : targetPointer.getTargets(game, source)) { + Permanent permanent = game.getPermanent(uuid); + if (permanent != null) { + if (counter != null) { + permanent.addCounters(counter.copy(), game); affectedTargets ++; - } - } else { - Player player = game.getPlayer(uuid); - if (player != null) { - player.addCounters(counter.copy(), game); + } + } else { + Player player = game.getPlayer(uuid); + if (player != null) { + player.addCounters(counter.copy(), game); affectedTargets ++; - } - } - } - return affectedTargets > 0; - } + } + } + } + return affectedTargets > 0; + } - @Override - public String getText(Mode mode) { - StringBuilder sb = new StringBuilder(); - sb.append("put "); - if (counter.getCount() > 1) { - sb.append(Integer.toString(counter.getCount())).append(" ").append(counter.getName()).append(" counters on target "); - } - else { - sb.append("a ").append(counter.getName()).append(" counter on target "); - } + @Override + public String getText(Mode mode) { + StringBuilder sb = new StringBuilder(); + sb.append("put "); + if (counter.getCount() > 1) { + sb.append(Integer.toString(counter.getCount())).append(" ").append(counter.getName()).append(" counters on target "); + } + else { + sb.append("a ").append(counter.getName()).append(" counter on target "); + } // TODO add normal text infrastructure for target pointers if (mode.getTargets().size() > 0) - sb.append(mode.getTargets().get(0).getTargetName()); - return sb.toString(); - } + sb.append(mode.getTargets().get(0).getTargetName()); + return sb.toString(); + } - @Override - public AddCountersTargetEffect copy() { - return new AddCountersTargetEffect(this); - } + @Override + public AddCountersTargetEffect copy() { + return new AddCountersTargetEffect(this); + } } diff --git a/Mage/src/mage/abilities/effects/common/counter/AddPlusOneCountersAttachedEffect.java b/Mage/src/mage/abilities/effects/common/counter/AddPlusOneCountersAttachedEffect.java index acc8570e93..47c1f37687 100644 --- a/Mage/src/mage/abilities/effects/common/counter/AddPlusOneCountersAttachedEffect.java +++ b/Mage/src/mage/abilities/effects/common/counter/AddPlusOneCountersAttachedEffect.java @@ -41,41 +41,41 @@ import mage.game.permanent.Permanent; */ public class AddPlusOneCountersAttachedEffect extends OneShotEffect { - private int amount; + private int amount; - public AddPlusOneCountersAttachedEffect(int amount) { - super(Outcome.BoostCreature); - this.amount = amount; - setText(); - } + public AddPlusOneCountersAttachedEffect(int amount) { + super(Outcome.BoostCreature); + this.amount = amount; + setText(); + } - public AddPlusOneCountersAttachedEffect(final AddPlusOneCountersAttachedEffect effect) { - super(effect); - this.amount = effect.amount; - } + public AddPlusOneCountersAttachedEffect(final AddPlusOneCountersAttachedEffect effect) { + super(effect); + this.amount = effect.amount; + } - @Override - public AddPlusOneCountersAttachedEffect copy() { - return new AddPlusOneCountersAttachedEffect(this); - } + @Override + public AddPlusOneCountersAttachedEffect copy() { + return new AddPlusOneCountersAttachedEffect(this); + } - @Override - public boolean apply(Game game, Ability source) { - Permanent enchantment = game.getPermanent(source.getSourceId()); - if (enchantment != null && enchantment.getAttachedTo() != null) { - Permanent creature = game.getPermanent(enchantment.getAttachedTo()); - if (creature != null) { - creature.addCounters(new PlusOneCounter(amount), game); - } - } - return true; - } + @Override + public boolean apply(Game game, Ability source) { + Permanent enchantment = game.getPermanent(source.getSourceId()); + if (enchantment != null && enchantment.getAttachedTo() != null) { + Permanent creature = game.getPermanent(enchantment.getAttachedTo()); + if (creature != null) { + creature.addCounters(new PlusOneCounter(amount), game); + } + } + return true; + } private void setText() { - if (amount > 1) - staticText = "put " + Integer.toString(amount) + " +1/+1 counters on enchanted creature"; - else - staticText = "put a +1/+1 counter on enchanted creature"; - } + if (amount > 1) + staticText = "put " + Integer.toString(amount) + " +1/+1 counters on enchanted creature"; + else + staticText = "put a +1/+1 counter on enchanted creature"; + } } diff --git a/Mage/src/mage/abilities/effects/common/counter/ProliferateEffect.java b/Mage/src/mage/abilities/effects/common/counter/ProliferateEffect.java index 243c979421..445f507d66 100644 --- a/Mage/src/mage/abilities/effects/common/counter/ProliferateEffect.java +++ b/Mage/src/mage/abilities/effects/common/counter/ProliferateEffect.java @@ -47,98 +47,98 @@ import java.util.*; */ public class ProliferateEffect extends OneShotEffect { - public ProliferateEffect() { - super(Outcome.Benefit); - staticText = "Proliferate. (You choose any number of permanents and/or players with counters on them, then give each another counter of a kind already there.)"; - } + public ProliferateEffect() { + super(Outcome.Benefit); + staticText = "Proliferate. (You choose any number of permanents and/or players with counters on them, then give each another counter of a kind already there.)"; + } - public ProliferateEffect(ProliferateEffect effect) { - super(effect); - } + public ProliferateEffect(ProliferateEffect effect) { + super(effect); + } - @Override - public boolean apply(Game game, Ability source) { - Player controller = game.getPlayer(source.getControllerId()); - Target target = new TargetPermanentOrPlayerWithCounter(0, Integer.MAX_VALUE, true); + @Override + public boolean apply(Game game, Ability source) { + Player controller = game.getPlayer(source.getControllerId()); + Target target = new TargetPermanentOrPlayerWithCounter(0, Integer.MAX_VALUE, true); - //A spell or ability could have removed the only legal target this player - //had, if thats the case this ability should fizzle. - if (target.canChoose(controller.getId(), game)) { - boolean abilityApplied = false; - Map options = new HashMap(); - options.put("UI.right.btn.text", "Done"); - while (target.canChoose(controller.getId(), game)) { - if (controller.choose(Outcome.Benefit, target, source.getSourceId(), game, options)) { - break; - } - } + //A spell or ability could have removed the only legal target this player + //had, if thats the case this ability should fizzle. + if (target.canChoose(controller.getId(), game)) { + boolean abilityApplied = false; + Map options = new HashMap(); + options.put("UI.right.btn.text", "Done"); + while (target.canChoose(controller.getId(), game)) { + if (controller.choose(Outcome.Benefit, target, source.getSourceId(), game, options)) { + break; + } + } - for (int idx = 0; idx < target.getTargets().size(); idx++) { - UUID chosen = (UUID) target.getTargets().get(idx); - Permanent permanent = game.getPermanent(chosen); - if (permanent != null) { - if (permanent.getCounters().size() > 0) { - if (permanent.getCounters().size() == 1) { - for (Counter counter : permanent.getCounters().values()) { - permanent.addCounters(counter.getName(), 1, game); - } - } else { - Choice choice = new ChoiceImpl(true); - Set choices = new HashSet(); - for (Counter counter : permanent.getCounters().values()) { - choices.add(counter.getName()); - } - choice.setChoices(choices); - choice.setMessage("Choose a counter to proliferate (" + permanent.getName() + ")"); - controller.choose(Outcome.Benefit, choice, game); - for (Counter counter : permanent.getCounters().values()) { - if (counter.getName().equals(choice.getChoice())) { - permanent.addCounters(counter.getName(), 1, game); - break; - } - } - } - } - } else { - Player player = game.getPlayer(chosen); - if (player != null) { - if (player.getCounters().size() > 0) { - if (player.getCounters().size() == 1) { - for (Counter counter : player.getCounters().values()) { + for (int idx = 0; idx < target.getTargets().size(); idx++) { + UUID chosen = (UUID) target.getTargets().get(idx); + Permanent permanent = game.getPermanent(chosen); + if (permanent != null) { + if (permanent.getCounters().size() > 0) { + if (permanent.getCounters().size() == 1) { + for (Counter counter : permanent.getCounters().values()) { + permanent.addCounters(counter.getName(), 1, game); + } + } else { + Choice choice = new ChoiceImpl(true); + Set choices = new HashSet(); + for (Counter counter : permanent.getCounters().values()) { + choices.add(counter.getName()); + } + choice.setChoices(choices); + choice.setMessage("Choose a counter to proliferate (" + permanent.getName() + ")"); + controller.choose(Outcome.Benefit, choice, game); + for (Counter counter : permanent.getCounters().values()) { + if (counter.getName().equals(choice.getChoice())) { + permanent.addCounters(counter.getName(), 1, game); + break; + } + } + } + } + } else { + Player player = game.getPlayer(chosen); + if (player != null) { + if (player.getCounters().size() > 0) { + if (player.getCounters().size() == 1) { + for (Counter counter : player.getCounters().values()) { Counter newCounter = new Counter(counter.getName(), 1); - player.addCounters(newCounter, game); - } - } else { - Choice choice = new ChoiceImpl(true); - Set choices = new HashSet(); - for (Counter counter : player.getCounters().values()) { - choices.add(counter.getName()); - } - choice.setChoices(choices); - choice.setMessage("Choose a counter to proliferate (" + player.getName() + ")"); - controller.choose(Outcome.Benefit, choice, game); - for (Counter counter : player.getCounters().values()) { - if (counter.getName().equals(choice.getChoice())) { + player.addCounters(newCounter, game); + } + } else { + Choice choice = new ChoiceImpl(true); + Set choices = new HashSet(); + for (Counter counter : player.getCounters().values()) { + choices.add(counter.getName()); + } + choice.setChoices(choices); + choice.setMessage("Choose a counter to proliferate (" + player.getName() + ")"); + controller.choose(Outcome.Benefit, choice, game); + for (Counter counter : player.getCounters().values()) { + if (counter.getName().equals(choice.getChoice())) { Counter newCounter = new Counter(counter.getName(), 1); player.addCounters(newCounter, game); - break; - } - } - } - } - } - } + break; + } + } + } + } + } + } - } + } - return abilityApplied; - } - return false; - } + return abilityApplied; + } + return false; + } - @Override - public ProliferateEffect copy() { - return new ProliferateEffect(this); - } + @Override + public ProliferateEffect copy() { + return new ProliferateEffect(this); + } } diff --git a/Mage/src/mage/abilities/effects/common/counter/RemoveCounterSourceEffect.java b/Mage/src/mage/abilities/effects/common/counter/RemoveCounterSourceEffect.java index bc7e9d5b6d..e499f192be 100644 --- a/Mage/src/mage/abilities/effects/common/counter/RemoveCounterSourceEffect.java +++ b/Mage/src/mage/abilities/effects/common/counter/RemoveCounterSourceEffect.java @@ -13,7 +13,7 @@ public class RemoveCounterSourceEffect extends OneShotEffect 1) { - StringBuilder sb = new StringBuilder(); - sb.append("remove ").append(Integer.toString(counter.getCount())).append(" ").append(counter.getName()).append(" counters from {this}"); - staticText = sb.toString(); - } else - staticText = "remove a " + counter.getName() + " counter from {this}"; + StringBuilder sb = new StringBuilder(); + sb.append("remove ").append(Integer.toString(counter.getCount())).append(" ").append(counter.getName()).append(" counters from {this}"); + staticText = sb.toString(); + } else + staticText = "remove a " + counter.getName() + " counter from {this}"; } } diff --git a/Mage/src/mage/abilities/effects/common/discard/DiscardCardYouChooseTargetOpponentEffect.java b/Mage/src/mage/abilities/effects/common/discard/DiscardCardYouChooseTargetOpponentEffect.java index 8146326238..972737355c 100644 --- a/Mage/src/mage/abilities/effects/common/discard/DiscardCardYouChooseTargetOpponentEffect.java +++ b/Mage/src/mage/abilities/effects/common/discard/DiscardCardYouChooseTargetOpponentEffect.java @@ -42,38 +42,38 @@ import mage.target.TargetCard; */ public class DiscardCardYouChooseTargetOpponentEffect extends OneShotEffect { - public DiscardCardYouChooseTargetOpponentEffect() { - super(Constants.Outcome.Discard); - staticText = "Target opponent reveals his or her hand. You choose a card from it. That player discards that card"; - } + public DiscardCardYouChooseTargetOpponentEffect() { + super(Constants.Outcome.Discard); + staticText = "Target opponent reveals his or her hand. You choose a card from it. That player discards that card"; + } - public DiscardCardYouChooseTargetOpponentEffect(final DiscardCardYouChooseTargetOpponentEffect effect) { - super(effect); - } + public DiscardCardYouChooseTargetOpponentEffect(final DiscardCardYouChooseTargetOpponentEffect effect) { + super(effect); + } - @Override - public boolean apply(Game game, Ability source) { - Player player = game.getPlayer(source.getFirstTarget()); - if (player != null) { - player.revealCards("Discard", player.getHand(), game); - Player you = game.getPlayer(source.getControllerId()); - if (you != null) { - TargetCard target = new TargetCard(Constants.Zone.PICK, new FilterCard()); + @Override + public boolean apply(Game game, Ability source) { + Player player = game.getPlayer(source.getFirstTarget()); + if (player != null) { + player.revealCards("Discard", player.getHand(), game); + Player you = game.getPlayer(source.getControllerId()); + if (you != null) { + TargetCard target = new TargetCard(Constants.Zone.PICK, new FilterCard()); target.setRequired(true); - if (you.choose(Constants.Outcome.Benefit, player.getHand(), target, game)) { - Card card = player.getHand().get(target.getFirstTarget(), game); - if (card != null) { - return player.discard(card, source, game); - } - } - } - } - return false; - } + if (you.choose(Constants.Outcome.Benefit, player.getHand(), target, game)) { + Card card = player.getHand().get(target.getFirstTarget(), game); + if (card != null) { + return player.discard(card, source, game); + } + } + } + } + return false; + } - @Override - public DiscardCardYouChooseTargetOpponentEffect copy() { - return new DiscardCardYouChooseTargetOpponentEffect(this); - } + @Override + public DiscardCardYouChooseTargetOpponentEffect copy() { + return new DiscardCardYouChooseTargetOpponentEffect(this); + } } \ No newline at end of file diff --git a/Mage/src/mage/abilities/effects/common/search/SearchLibraryPutInHandEffect.java b/Mage/src/mage/abilities/effects/common/search/SearchLibraryPutInHandEffect.java index d8ff5322e0..e363bb1876 100644 --- a/Mage/src/mage/abilities/effects/common/search/SearchLibraryPutInHandEffect.java +++ b/Mage/src/mage/abilities/effects/common/search/SearchLibraryPutInHandEffect.java @@ -59,28 +59,28 @@ public class SearchLibraryPutInHandEffect extends SearchEffect 0) { Cards cards = new CardsImpl(); for (UUID cardId: (List)target.getTargets()) { @@ -113,18 +113,18 @@ public class SearchLibraryPutInHandEffect extends SearchEffect 0) { - sb.append("up to ").append(target.getMaxNumberOfTargets()).append(" "); - sb.append(target.getTargetName()).append(revealCards ? ", reveal them, " : "").append(" and put them into your hand"); - } - else { - sb.append("a ").append(target.getTargetName()).append(revealCards ? ", reveal it, " : "").append(" and put that card into your hand"); - } + sb.append("up to ").append(target.getMaxNumberOfTargets()).append(" "); + sb.append(target.getTargetName()).append(revealCards ? ", reveal them, " : "").append(" and put them into your hand"); + } + else { + sb.append("a ").append(target.getTargetName()).append(revealCards ? ", reveal it, " : "").append(" and put that card into your hand"); + } if (forceShuffle) sb.append(". Then shuffle your library"); else sb.append(". If you do, shuffle your library"); - staticText = sb.toString(); + staticText = sb.toString(); } } diff --git a/Mage/src/mage/abilities/effects/common/search/SearchLibraryPutInPlayEffect.java b/Mage/src/mage/abilities/effects/common/search/SearchLibraryPutInPlayEffect.java index 003741cd70..9f1f5e0a13 100644 --- a/Mage/src/mage/abilities/effects/common/search/SearchLibraryPutInPlayEffect.java +++ b/Mage/src/mage/abilities/effects/common/search/SearchLibraryPutInPlayEffect.java @@ -47,94 +47,94 @@ import java.util.UUID; */ public class SearchLibraryPutInPlayEffect extends SearchEffect { - private boolean tapped; + private boolean tapped; private boolean forceShuffle; - public SearchLibraryPutInPlayEffect(TargetCardInLibrary target) { - this(target, false, true, Outcome.PutCardInPlay); - } - - public SearchLibraryPutInPlayEffect(TargetCardInLibrary target, boolean tapped) { - this(target, tapped, true, Outcome.PutCardInPlay); - } + public SearchLibraryPutInPlayEffect(TargetCardInLibrary target) { + this(target, false, true, Outcome.PutCardInPlay); + } + + public SearchLibraryPutInPlayEffect(TargetCardInLibrary target, boolean tapped) { + this(target, tapped, true, Outcome.PutCardInPlay); + } + + public SearchLibraryPutInPlayEffect(TargetCardInLibrary target, boolean tapped, boolean forceShuffle) { + this(target, tapped, forceShuffle, Outcome.PutCardInPlay); + } - public SearchLibraryPutInPlayEffect(TargetCardInLibrary target, boolean tapped, boolean forceShuffle) { - this(target, tapped, forceShuffle, Outcome.PutCardInPlay); - } - public SearchLibraryPutInPlayEffect(TargetCardInLibrary target, boolean tapped, Outcome outcome) { this(target, tapped, true, outcome); } public SearchLibraryPutInPlayEffect(TargetCardInLibrary target, boolean tapped, boolean forceShuffle, Outcome outcome) { - super(target, outcome); - this.tapped = tapped; + super(target, outcome); + this.tapped = tapped; this.forceShuffle = forceShuffle; - setText(); - } + setText(); + } - public SearchLibraryPutInPlayEffect(final SearchLibraryPutInPlayEffect effect) { - super(effect); - this.tapped = effect.tapped; + public SearchLibraryPutInPlayEffect(final SearchLibraryPutInPlayEffect effect) { + super(effect); + this.tapped = effect.tapped; this.forceShuffle = effect.forceShuffle; - } + } - @Override - public SearchLibraryPutInPlayEffect copy() { - return new SearchLibraryPutInPlayEffect(this); - } + @Override + public SearchLibraryPutInPlayEffect copy() { + return new SearchLibraryPutInPlayEffect(this); + } - @Override - public boolean apply(Game game, Ability source) { - Player player = game.getPlayer(source.getControllerId()); + @Override + public boolean apply(Game game, Ability source) { + Player player = game.getPlayer(source.getControllerId()); if (player == null) return false; - if (player.searchLibrary(target, game)) { - if (target.getTargets().size() > 0) { - for (UUID cardId: (List)target.getTargets()) { - Card card = player.getLibrary().getCard(cardId, game); - if (card != null) { - if (card.putOntoBattlefield(game, Zone.LIBRARY, source.getId(), source.getControllerId())) { - if (tapped) { - Permanent permanent = game.getPermanent(card.getId()); - if (permanent != null) - permanent.setTapped(true); - } - } - } - } - } + if (player.searchLibrary(target, game)) { + if (target.getTargets().size() > 0) { + for (UUID cardId: (List)target.getTargets()) { + Card card = player.getLibrary().getCard(cardId, game); + if (card != null) { + if (card.putOntoBattlefield(game, Zone.LIBRARY, source.getId(), source.getControllerId())) { + if (tapped) { + Permanent permanent = game.getPermanent(card.getId()); + if (permanent != null) + permanent.setTapped(true); + } + } + } + } + } player.shuffleLibrary(game); - return true; - } + return true; + } if (forceShuffle) player.shuffleLibrary(game); - return false; - } + return false; + } - private void setText() { - StringBuilder sb = new StringBuilder(); - sb.append("Search your library for "); - if (target.getNumberOfTargets() == 0 && target.getMaxNumberOfTargets() > 0) { - if ( target.getMaxNumberOfTargets() == Integer.MAX_VALUE ) { - sb.append("any number of ").append(" "); - } - else { - sb.append("up to ").append(target.getMaxNumberOfTargets()).append(" "); - } - sb.append(target.getTargetName()).append(" and put them onto the battlefield"); - } - else { - sb.append("a ").append(target.getTargetName()).append(" and put it onto the battlefield"); - } - if (tapped) - sb.append(" tapped"); + private void setText() { + StringBuilder sb = new StringBuilder(); + sb.append("Search your library for "); + if (target.getNumberOfTargets() == 0 && target.getMaxNumberOfTargets() > 0) { + if ( target.getMaxNumberOfTargets() == Integer.MAX_VALUE ) { + sb.append("any number of ").append(" "); + } + else { + sb.append("up to ").append(target.getMaxNumberOfTargets()).append(" "); + } + sb.append(target.getTargetName()).append(" and put them onto the battlefield"); + } + else { + sb.append("a ").append(target.getTargetName()).append(" and put it onto the battlefield"); + } + if (tapped) + sb.append(" tapped"); if (forceShuffle) sb.append(". Then shuffle your library"); else sb.append(". If you do, shuffle your library"); - staticText = sb.toString(); - } + staticText = sb.toString(); + } public List getTargets() { return target.getTargets(); diff --git a/Mage/src/mage/abilities/effects/common/search/SearchLibraryPutOnLibraryEffect.java b/Mage/src/mage/abilities/effects/common/search/SearchLibraryPutOnLibraryEffect.java index cacf773153..742cd1f48e 100644 --- a/Mage/src/mage/abilities/effects/common/search/SearchLibraryPutOnLibraryEffect.java +++ b/Mage/src/mage/abilities/effects/common/search/SearchLibraryPutOnLibraryEffect.java @@ -47,25 +47,25 @@ import mage.target.common.TargetCardInLibrary; public class SearchLibraryPutOnLibraryEffect extends SearchEffect { public SearchLibraryPutOnLibraryEffect(TargetCardInLibrary target) { - super(target, Outcome.DrawCard); - setText(); + super(target, Outcome.DrawCard); + setText(); } - public SearchLibraryPutOnLibraryEffect(final SearchLibraryPutOnLibraryEffect effect) { - super(effect); - } + public SearchLibraryPutOnLibraryEffect(final SearchLibraryPutOnLibraryEffect effect) { + super(effect); + } - @Override - public SearchLibraryPutOnLibraryEffect copy() { - return new SearchLibraryPutOnLibraryEffect(this); - } + @Override + public SearchLibraryPutOnLibraryEffect copy() { + return new SearchLibraryPutOnLibraryEffect(this); + } @Override public boolean apply(Game game, Ability source) { Player player = game.getPlayer(source.getControllerId()); if (player == null) return false; - if (player.searchLibrary(target, game)) { + if (player.searchLibrary(target, game)) { List cards = new ArrayList(); for (UUID cardId: (List)target.getTargets()) { Card card = player.getLibrary().remove(cardId, game); @@ -86,7 +86,7 @@ public class SearchLibraryPutOnLibraryEffect extends SearchEffect { boolean forceShuffle; - + public SearchLibraryRevealPutInHandEffect(TargetCardInLibrary target) { - this(target, true); - } + this(target, true); + } public SearchLibraryRevealPutInHandEffect(TargetCardInLibrary target, boolean forceShuffle) { - super(target, Outcome.DrawCard); + super(target, Outcome.DrawCard); this.forceShuffle = forceShuffle; - setText(); - } + setText(); + } - public SearchLibraryRevealPutInHandEffect(final SearchLibraryRevealPutInHandEffect effect) { - super(effect); + public SearchLibraryRevealPutInHandEffect(final SearchLibraryRevealPutInHandEffect effect) { + super(effect); this.forceShuffle = effect.forceShuffle; - } + } - @Override - public SearchLibraryRevealPutInHandEffect copy() { - return new SearchLibraryRevealPutInHandEffect(this); - } + @Override + public SearchLibraryRevealPutInHandEffect copy() { + return new SearchLibraryRevealPutInHandEffect(this); + } - @Override - public boolean apply(Game game, Ability source) { - Player player = game.getPlayer(source.getControllerId()); + @Override + public boolean apply(Game game, Ability source) { + Player player = game.getPlayer(source.getControllerId()); if (player == null) return false; - if (player.searchLibrary(target, game)) { + if (player.searchLibrary(target, game)) { if (target.getTargets().size() > 0) { Cards revealed = new CardsImpl(); for (UUID cardId: (List)target.getTargets()) { @@ -92,23 +92,23 @@ public class SearchLibraryRevealPutInHandEffect extends SearchEffect 0) { - sb.append("up to ").append(target.getMaxNumberOfTargets()).append(" "); - sb.append(target.getTargetName()).append(", reveal them, and put them into your hand"); - } - else { - sb.append("a ").append(target.getTargetName()).append(", reveal that card, and put it into your hand"); - } + private void setText() { + StringBuilder sb = new StringBuilder(); + sb.append("Search your library for "); + if (target.getNumberOfTargets() == 0 && target.getMaxNumberOfTargets() > 0) { + sb.append("up to ").append(target.getMaxNumberOfTargets()).append(" "); + sb.append(target.getTargetName()).append(", reveal them, and put them into your hand"); + } + else { + sb.append("a ").append(target.getTargetName()).append(", reveal that card, and put it into your hand"); + } if (forceShuffle) sb.append(". Then shuffle your library"); else sb.append(". If you do, shuffle your library"); - staticText = sb.toString(); - } + staticText = sb.toString(); + } } diff --git a/Mage/src/mage/abilities/effects/common/turn/ControlTargetPlayerNextTurnEffect.java b/Mage/src/mage/abilities/effects/common/turn/ControlTargetPlayerNextTurnEffect.java index af38be782e..7c246b25a8 100644 --- a/Mage/src/mage/abilities/effects/common/turn/ControlTargetPlayerNextTurnEffect.java +++ b/Mage/src/mage/abilities/effects/common/turn/ControlTargetPlayerNextTurnEffect.java @@ -40,28 +40,28 @@ import java.util.UUID; */ public class ControlTargetPlayerNextTurnEffect extends OneShotEffect { - public ControlTargetPlayerNextTurnEffect() { - super(Constants.Outcome.Benefit); - staticText = "You control target player during that player's next turn. (You see all cards that player could see and make all decisions for the player.)"; - } + public ControlTargetPlayerNextTurnEffect() { + super(Constants.Outcome.Benefit); + staticText = "You control target player during that player's next turn. (You see all cards that player could see and make all decisions for the player.)"; + } - public ControlTargetPlayerNextTurnEffect(ControlTargetPlayerNextTurnEffect effect) { - super(effect); - } + public ControlTargetPlayerNextTurnEffect(ControlTargetPlayerNextTurnEffect effect) { + super(effect); + } - @Override - public boolean apply(Game game, Ability source) { - UUID targetId = source.getFirstTarget(); - UUID controllerId = source.getControllerId(); - if (targetId != null && controllerId != null && !targetId.equals(controllerId)) { - game.getState().getTurnMods().add(new TurnMod(targetId, controllerId)); - return true; - } - return false; - } + @Override + public boolean apply(Game game, Ability source) { + UUID targetId = source.getFirstTarget(); + UUID controllerId = source.getControllerId(); + if (targetId != null && controllerId != null && !targetId.equals(controllerId)) { + game.getState().getTurnMods().add(new TurnMod(targetId, controllerId)); + return true; + } + return false; + } - @Override - public ControlTargetPlayerNextTurnEffect copy() { - return new ControlTargetPlayerNextTurnEffect(); - } + @Override + public ControlTargetPlayerNextTurnEffect copy() { + return new ControlTargetPlayerNextTurnEffect(); + } } diff --git a/Mage/src/mage/abilities/keyword/AnnihilatorAbility.java b/Mage/src/mage/abilities/keyword/AnnihilatorAbility.java index c15d4de47c..0fab1ccbeb 100644 --- a/Mage/src/mage/abilities/keyword/AnnihilatorAbility.java +++ b/Mage/src/mage/abilities/keyword/AnnihilatorAbility.java @@ -52,96 +52,96 @@ import java.util.UUID; */ public class AnnihilatorAbility extends TriggeredAbilityImpl { - int count; + int count; - public AnnihilatorAbility ( int count ) { - super(Zone.BATTLEFIELD, new AnnihilatorEffect(count), false); - this.count = count; - } + public AnnihilatorAbility ( int count ) { + super(Zone.BATTLEFIELD, new AnnihilatorEffect(count), false); + this.count = count; + } - public AnnihilatorAbility ( final AnnihilatorAbility ability ) { - super(ability); - this.count = ability.count; - } + public AnnihilatorAbility ( final AnnihilatorAbility ability ) { + super(ability); + this.count = ability.count; + } - @Override - public boolean checkTrigger ( GameEvent event, Game game ) { - if ( event.getType() == EventType.ATTACKER_DECLARED && event.getSourceId().equals(this.getSourceId()) ) { - return true; - } - return false; - } + @Override + public boolean checkTrigger ( GameEvent event, Game game ) { + if ( event.getType() == EventType.ATTACKER_DECLARED && event.getSourceId().equals(this.getSourceId()) ) { + return true; + } + return false; + } - @Override - public String getRule ( ) { - return "Annihilator " + count; - } + @Override + public String getRule ( ) { + return "Annihilator " + count; + } - @Override - public AnnihilatorAbility copy ( ) { - return new AnnihilatorAbility(this); - } + @Override + public AnnihilatorAbility copy ( ) { + return new AnnihilatorAbility(this); + } } class AnnihilatorEffect extends OneShotEffect { - private final int count; - private static final FilterControlledPermanent filter; + private final int count; + private static final FilterControlledPermanent filter; - static { - filter = new FilterControlledPermanent(); - } + static { + filter = new FilterControlledPermanent(); + } - AnnihilatorEffect ( int count ) { - super(Outcome.Sacrifice); - this.count = count; - } + AnnihilatorEffect ( int count ) { + super(Outcome.Sacrifice); + this.count = count; + } - AnnihilatorEffect(AnnihilatorEffect effect) { - super(effect); - this.count = effect.count; - } + AnnihilatorEffect(AnnihilatorEffect effect) { + super(effect); + this.count = effect.count; + } - @Override - public boolean apply(Game game, Ability source) { - UUID defenderId = game.getCombat().getDefendingPlayer(source.getSourceId()); - Player player = game.getPlayer(defenderId); + @Override + public boolean apply(Game game, Ability source) { + UUID defenderId = game.getCombat().getDefendingPlayer(source.getSourceId()); + Player player = game.getPlayer(defenderId); - //Defender may be a planeswalker. - if ( player == null ) { - Permanent permanent = game.getPermanent(defenderId); - player = game.getPlayer(permanent.getControllerId()); - } + //Defender may be a planeswalker. + if ( player == null ) { + Permanent permanent = game.getPermanent(defenderId); + player = game.getPlayer(permanent.getControllerId()); + } - filter.setTargetController(TargetController.YOU); - int amount = Math.min(count, game.getBattlefield().countAll(filter, player.getId(), game)); - Target target = new TargetControlledPermanent(amount, amount, filter, false); + filter.setTargetController(TargetController.YOU); + int amount = Math.min(count, game.getBattlefield().countAll(filter, player.getId(), game)); + Target target = new TargetControlledPermanent(amount, amount, filter, false); - //A spell or ability could have removed the only legal target this player - //had, if thats the case this ability should fizzle. - if (target.canChoose(player.getId(), game)) { - boolean abilityApplied = false; - while (!target.isChosen() && target.canChoose(player.getId(), game)) { - player.choose(Outcome.Sacrifice, target, source.getSourceId(), game); - } + //A spell or ability could have removed the only legal target this player + //had, if thats the case this ability should fizzle. + if (target.canChoose(player.getId(), game)) { + boolean abilityApplied = false; + while (!target.isChosen() && target.canChoose(player.getId(), game)) { + player.choose(Outcome.Sacrifice, target, source.getSourceId(), game); + } - for ( int idx = 0; idx < target.getTargets().size(); idx++) { - Permanent permanent = game.getPermanent((UUID)target.getTargets().get(idx)); + for ( int idx = 0; idx < target.getTargets().size(); idx++) { + Permanent permanent = game.getPermanent((UUID)target.getTargets().get(idx)); - if ( permanent != null ) { - abilityApplied |= permanent.sacrifice(source.getId(), game); - } - } + if ( permanent != null ) { + abilityApplied |= permanent.sacrifice(source.getId(), game); + } + } - return abilityApplied; - } - return false; - } + return abilityApplied; + } + return false; + } - @Override - public AnnihilatorEffect copy() { - return new AnnihilatorEffect(this); - } + @Override + public AnnihilatorEffect copy() { + return new AnnihilatorEffect(this); + } } diff --git a/Mage/src/mage/abilities/keyword/BasicLandcyclingAbility.java b/Mage/src/mage/abilities/keyword/BasicLandcyclingAbility.java index 7d14f3f092..6a43beb530 100644 --- a/Mage/src/mage/abilities/keyword/BasicLandcyclingAbility.java +++ b/Mage/src/mage/abilities/keyword/BasicLandcyclingAbility.java @@ -59,6 +59,6 @@ public class BasicLandcyclingAbility extends ActivatedAbilityImpl { BloodthirstEffect(int amount) { super(Constants.Outcome.BoostCreature); this.amount = amount; - staticText = "this permanent comes into play with " + amount + " +1/+1 counters on it"; + staticText = "this permanent comes into play with " + amount + " +1/+1 counters on it"; } BloodthirstEffect(final BloodthirstEffect effect) { diff --git a/Mage/src/mage/abilities/keyword/CascadeAbility.java b/Mage/src/mage/abilities/keyword/CascadeAbility.java index 153a0c69b2..b79e5e8422 100644 --- a/Mage/src/mage/abilities/keyword/CascadeAbility.java +++ b/Mage/src/mage/abilities/keyword/CascadeAbility.java @@ -47,80 +47,80 @@ import mage.players.Player; * @author BetaSteward_at_googlemail.com */ public class CascadeAbility extends TriggeredAbilityImpl { - //20091005 - 702.82 + //20091005 - 702.82 - public CascadeAbility() { - super(Zone.STACK, new CascadeEffect()); - } + public CascadeAbility() { + super(Zone.STACK, new CascadeEffect()); + } - public CascadeAbility(CascadeAbility ability) { - super(ability); - } + public CascadeAbility(CascadeAbility ability) { + super(ability); + } - @Override - public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == EventType.SPELL_CAST) { - Spell spell = game.getStack().getSpell(event.getTargetId()); - if (spell != null && spell.getSourceId().equals(this.getSourceId())) { - return true; - } - } - return false; - } + @Override + public boolean checkTrigger(GameEvent event, Game game) { + if (event.getType() == EventType.SPELL_CAST) { + Spell spell = game.getStack().getSpell(event.getTargetId()); + if (spell != null && spell.getSourceId().equals(this.getSourceId())) { + return true; + } + } + return false; + } - @Override - public String getRule() { - return "Cascade"; - } + @Override + public String getRule() { + return "Cascade"; + } - @Override - public CascadeAbility copy() { - return new CascadeAbility(this); - } + @Override + public CascadeAbility copy() { + return new CascadeAbility(this); + } } class CascadeEffect extends OneShotEffect { - public CascadeEffect() { - super(Outcome.PutCardInPlay); - } + public CascadeEffect() { + super(Outcome.PutCardInPlay); + } - public CascadeEffect(CascadeEffect effect) { - super(effect); - } + public CascadeEffect(CascadeEffect effect) { + super(effect); + } - @Override - public boolean apply(Game game, Ability source) { - Card card; - Player player = game.getPlayer(source.getControllerId()); - ExileZone exile = game.getExile().createZone(source.getSourceId(), player.getName() + " Cascade"); - int sourceCost = game.getCard(source.getSourceId()).getManaCost().convertedManaCost(); - do { - card = player.getLibrary().removeFromTop(game); - if (card == null) - break; - card.moveToExile(exile.getId(), exile.getName(), source.getId(), game); - } while (card.getCardType().contains(CardType.LAND) || card.getManaCost().convertedManaCost() >= sourceCost); + @Override + public boolean apply(Game game, Ability source) { + Card card; + Player player = game.getPlayer(source.getControllerId()); + ExileZone exile = game.getExile().createZone(source.getSourceId(), player.getName() + " Cascade"); + int sourceCost = game.getCard(source.getSourceId()).getManaCost().convertedManaCost(); + do { + card = player.getLibrary().removeFromTop(game); + if (card == null) + break; + card.moveToExile(exile.getId(), exile.getName(), source.getId(), game); + } while (card.getCardType().contains(CardType.LAND) || card.getManaCost().convertedManaCost() >= sourceCost); - if (card != null) { - if (player.chooseUse(outcome, "Use cascade effect on " + card.getName() + "?", game)) { - player.cast(card.getSpellAbility(), game, true); - exile.remove(card.getId()); - } - } + if (card != null) { + if (player.chooseUse(outcome, "Use cascade effect on " + card.getName() + "?", game)) { + player.cast(card.getSpellAbility(), game, true); + exile.remove(card.getId()); + } + } - while (exile.size() > 0) { - card = exile.getRandom(game); - exile.remove(card.getId()); - card.moveToZone(Zone.LIBRARY, source.getId(), game, false); - } + while (exile.size() > 0) { + card = exile.getRandom(game); + exile.remove(card.getId()); + card.moveToZone(Zone.LIBRARY, source.getId(), game, false); + } - return true; - } + return true; + } - @Override - public CascadeEffect copy() { - return new CascadeEffect(this); - } + @Override + public CascadeEffect copy() { + return new CascadeEffect(this); + } } \ No newline at end of file diff --git a/Mage/src/mage/abilities/keyword/ChangelingAbility.java b/Mage/src/mage/abilities/keyword/ChangelingAbility.java index 639148f82f..ff6ee5a76c 100644 --- a/Mage/src/mage/abilities/keyword/ChangelingAbility.java +++ b/Mage/src/mage/abilities/keyword/ChangelingAbility.java @@ -39,28 +39,28 @@ import java.io.ObjectStreamException; */ public class ChangelingAbility extends StaticAbility { - private static final ChangelingAbility fINSTANCE = new ChangelingAbility(); + private static final ChangelingAbility fINSTANCE = new ChangelingAbility(); - private Object readResolve() throws ObjectStreamException { - return fINSTANCE; - } + private Object readResolve() throws ObjectStreamException { + return fINSTANCE; + } - public static ChangelingAbility getInstance() { - return fINSTANCE; - } + public static ChangelingAbility getInstance() { + return fINSTANCE; + } - private ChangelingAbility() { - super(Zone.BATTLEFIELD, null); - } + private ChangelingAbility() { + super(Zone.BATTLEFIELD, null); + } - @Override - public String getRule() { - return "Changeling (This card is every creature type at all times.)"; - } + @Override + public String getRule() { + return "Changeling (This card is every creature type at all times.)"; + } - @Override - public ChangelingAbility copy() { - return fINSTANCE; - } + @Override + public ChangelingAbility copy() { + return fINSTANCE; + } } diff --git a/Mage/src/mage/abilities/keyword/CyclingAbility.java b/Mage/src/mage/abilities/keyword/CyclingAbility.java index 75e176e6f5..e23db30242 100644 --- a/Mage/src/mage/abilities/keyword/CyclingAbility.java +++ b/Mage/src/mage/abilities/keyword/CyclingAbility.java @@ -45,48 +45,48 @@ import mage.players.Player; */ public class CyclingAbility extends ActivatedAbilityImpl { - public CyclingAbility(ManaCosts costs) { - super(Zone.HAND, new CycleEffect(), costs); - this.addCost(new DiscardSourceCost()); - } + public CyclingAbility(ManaCosts costs) { + super(Zone.HAND, new CycleEffect(), costs); + this.addCost(new DiscardSourceCost()); + } - public CyclingAbility(final CyclingAbility ability) { - super(ability); - } + public CyclingAbility(final CyclingAbility ability) { + super(ability); + } - @Override - public CyclingAbility copy() { - return new CyclingAbility(this); - } + @Override + public CyclingAbility copy() { + return new CyclingAbility(this); + } - @Override - public String getRule() { - return "Cycling " + super.getRule(); - } + @Override + public String getRule() { + return "Cycling " + super.getRule(); + } } class CycleEffect extends OneShotEffect { - public CycleEffect() { - super(Outcome.DrawCard); - staticText = "Draw a card"; - } + public CycleEffect() { + super(Outcome.DrawCard); + staticText = "Draw a card"; + } - public CycleEffect(final CycleEffect effect) { - super(effect); - } + public CycleEffect(final CycleEffect effect) { + super(effect); + } - @Override - public CycleEffect copy() { - return new CycleEffect(this); - } + @Override + public CycleEffect copy() { + return new CycleEffect(this); + } - @Override - public boolean apply(Game game, Ability source) { - Player player = game.getPlayer(source.getControllerId()); - player.drawCards(1, game); - return true; - } + @Override + public boolean apply(Game game, Ability source) { + Player player = game.getPlayer(source.getControllerId()); + player.drawCards(1, game); + return true; + } } \ No newline at end of file diff --git a/Mage/src/mage/abilities/keyword/DeathtouchAbility.java b/Mage/src/mage/abilities/keyword/DeathtouchAbility.java index 33f0e485b3..3c56e742e1 100644 --- a/Mage/src/mage/abilities/keyword/DeathtouchAbility.java +++ b/Mage/src/mage/abilities/keyword/DeathtouchAbility.java @@ -38,29 +38,29 @@ import mage.abilities.StaticAbility; */ public class DeathtouchAbility extends StaticAbility { - private static final DeathtouchAbility fINSTANCE = new DeathtouchAbility(); + private static final DeathtouchAbility fINSTANCE = new DeathtouchAbility(); - private Object readResolve() throws ObjectStreamException { - return fINSTANCE; - } + private Object readResolve() throws ObjectStreamException { + return fINSTANCE; + } - public static DeathtouchAbility getInstance() { - return fINSTANCE; - } + public static DeathtouchAbility getInstance() { + return fINSTANCE; + } - private DeathtouchAbility() { - super(Zone.ALL, null); - } + private DeathtouchAbility() { + super(Zone.ALL, null); + } - @Override - public String getRule() { - return "Deathtouch"; - } + @Override + public String getRule() { + return "Deathtouch"; + } - @Override - public DeathtouchAbility copy() { - return fINSTANCE; - } + @Override + public DeathtouchAbility copy() { + return fINSTANCE; + } diff --git a/Mage/src/mage/abilities/keyword/DefenderAbility.java b/Mage/src/mage/abilities/keyword/DefenderAbility.java index 5b5a9a1c1b..723e56cef5 100644 --- a/Mage/src/mage/abilities/keyword/DefenderAbility.java +++ b/Mage/src/mage/abilities/keyword/DefenderAbility.java @@ -38,28 +38,28 @@ import mage.abilities.StaticAbility; */ public class DefenderAbility extends StaticAbility { - private static final DefenderAbility fINSTANCE = new DefenderAbility(); + private static final DefenderAbility fINSTANCE = new DefenderAbility(); - private Object readResolve() throws ObjectStreamException { - return fINSTANCE; - } + private Object readResolve() throws ObjectStreamException { + return fINSTANCE; + } - public static DefenderAbility getInstance() { - return fINSTANCE; - } + public static DefenderAbility getInstance() { + return fINSTANCE; + } - private DefenderAbility() { - super(Zone.BATTLEFIELD, null); - } + private DefenderAbility() { + super(Zone.BATTLEFIELD, null); + } - @Override - public String getRule() { - return "Defender"; - } + @Override + public String getRule() { + return "Defender"; + } - @Override - public DefenderAbility copy() { - return fINSTANCE; - } + @Override + public DefenderAbility copy() { + return fINSTANCE; + } } diff --git a/Mage/src/mage/abilities/keyword/DoubleStrikeAbility.java b/Mage/src/mage/abilities/keyword/DoubleStrikeAbility.java index 9eb38fdf39..0094a4b849 100644 --- a/Mage/src/mage/abilities/keyword/DoubleStrikeAbility.java +++ b/Mage/src/mage/abilities/keyword/DoubleStrikeAbility.java @@ -38,28 +38,28 @@ import mage.abilities.StaticAbility; */ public class DoubleStrikeAbility extends StaticAbility { - private static final DoubleStrikeAbility fINSTANCE = new DoubleStrikeAbility(); + private static final DoubleStrikeAbility fINSTANCE = new DoubleStrikeAbility(); - private Object readResolve() throws ObjectStreamException { - return fINSTANCE; - } + private Object readResolve() throws ObjectStreamException { + return fINSTANCE; + } - public static DoubleStrikeAbility getInstance() { - return fINSTANCE; - } + public static DoubleStrikeAbility getInstance() { + return fINSTANCE; + } - private DoubleStrikeAbility() { - super(Zone.BATTLEFIELD, null); - } + private DoubleStrikeAbility() { + super(Zone.BATTLEFIELD, null); + } - @Override - public String getRule() { - return "Double Strike"; - } + @Override + public String getRule() { + return "Double Strike"; + } - @Override - public DoubleStrikeAbility copy() { - return fINSTANCE; - } + @Override + public DoubleStrikeAbility copy() { + return fINSTANCE; + } } \ No newline at end of file diff --git a/Mage/src/mage/abilities/keyword/EchoAbility.java b/Mage/src/mage/abilities/keyword/EchoAbility.java index c4c16cf67d..3bd6c5f9cc 100644 --- a/Mage/src/mage/abilities/keyword/EchoAbility.java +++ b/Mage/src/mage/abilities/keyword/EchoAbility.java @@ -118,18 +118,18 @@ class EchoEffect extends OneShotEffect { @Override public boolean apply(Game game, Ability source) { Player player = game.getPlayer(source.getControllerId()); - Permanent permanent = game.getPermanent(source.getSourceId()); - if (player != null && permanent != null) { - if (player.chooseUse(Outcome.Benefit, "Pay " + cost.getText() /* + " or sacrifice " + permanent.getName() */ + "?", game)) { - cost.clearPaid(); - if (cost.pay(source, game, source.getId(), source.getControllerId(), false)) { - return true; + Permanent permanent = game.getPermanent(source.getSourceId()); + if (player != null && permanent != null) { + if (player.chooseUse(Outcome.Benefit, "Pay " + cost.getText() /* + " or sacrifice " + permanent.getName() */ + "?", game)) { + cost.clearPaid(); + if (cost.pay(source, game, source.getId(), source.getControllerId(), false)) { + return true; } - } - permanent.sacrifice(source.getSourceId(), game); - return true; - } - return false; + } + permanent.sacrifice(source.getSourceId(), game); + return true; + } + return false; } @Override @@ -137,8 +137,8 @@ class EchoEffect extends OneShotEffect { return new EchoEffect(this); } - @Override - public String getText(Mode mode) { + @Override + public String getText(Mode mode) { StringBuilder sb = new StringBuilder("sacrifice {this} unless you "); String costText = cost.getText(); if (costText.toLowerCase().startsWith("discard")) { @@ -147,8 +147,8 @@ class EchoEffect extends OneShotEffect { } else sb.append("pay ").append(costText); - + return sb.toString(); - } + } } diff --git a/Mage/src/mage/abilities/keyword/ExaltedAbility.java b/Mage/src/mage/abilities/keyword/ExaltedAbility.java index f24ccbba29..e7e4ad9c66 100644 --- a/Mage/src/mage/abilities/keyword/ExaltedAbility.java +++ b/Mage/src/mage/abilities/keyword/ExaltedAbility.java @@ -43,33 +43,33 @@ import mage.target.targetpointer.FixedTarget; */ public class ExaltedAbility extends TriggeredAbilityImpl { - public ExaltedAbility() { - super(Zone.BATTLEFIELD, new BoostTargetEffect(1, 1, Duration.EndOfTurn)); - } + public ExaltedAbility() { + super(Zone.BATTLEFIELD, new BoostTargetEffect(1, 1, Duration.EndOfTurn)); + } - public ExaltedAbility(final ExaltedAbility ability) { - super(ability); - } + public ExaltedAbility(final ExaltedAbility ability) { + super(ability); + } - @Override - public ExaltedAbility copy() { - return new ExaltedAbility(this); - } + @Override + public ExaltedAbility copy() { + return new ExaltedAbility(this); + } - @Override - public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == EventType.DECLARED_ATTACKERS && game.getActivePlayerId().equals(this.controllerId) ) { - if (game.getCombat().attacksAlone()) { - this.getEffects().get(0).setTargetPointer(new FixedTarget(game.getCombat().getAttackers().get(0))); - return true; - } - } - return false; - } + @Override + public boolean checkTrigger(GameEvent event, Game game) { + if (event.getType() == EventType.DECLARED_ATTACKERS && game.getActivePlayerId().equals(this.controllerId) ) { + if (game.getCombat().attacksAlone()) { + this.getEffects().get(0).setTargetPointer(new FixedTarget(game.getCombat().getAttackers().get(0))); + return true; + } + } + return false; + } - @Override - public String getRule() { - return "Exalted"; - } + @Override + public String getRule() { + return "Exalted"; + } } diff --git a/Mage/src/mage/abilities/keyword/FearAbility.java b/Mage/src/mage/abilities/keyword/FearAbility.java index b8cb03ac12..0498643b9f 100644 --- a/Mage/src/mage/abilities/keyword/FearAbility.java +++ b/Mage/src/mage/abilities/keyword/FearAbility.java @@ -44,61 +44,61 @@ import mage.game.permanent.Permanent; */ public class FearAbility extends EvasionAbility { - private static final FearAbility fINSTANCE = new FearAbility(); + private static final FearAbility fINSTANCE = new FearAbility(); - private Object readResolve() throws ObjectStreamException { - return fINSTANCE; - } + private Object readResolve() throws ObjectStreamException { + return fINSTANCE; + } - public static FearAbility getInstance() { - return fINSTANCE; - } + public static FearAbility getInstance() { + return fINSTANCE; + } - private FearAbility() { - this.addEffect(new FearEffect()); - } + private FearAbility() { + this.addEffect(new FearEffect()); + } - @Override - public String getRule() { - return "Fear"; - } + @Override + public String getRule() { + return "Fear"; + } - @Override - public FearAbility copy() { - return fINSTANCE; - } + @Override + public FearAbility copy() { + return fINSTANCE; + } } class FearEffect extends RestrictionEffect { - public FearEffect() { - super(Duration.WhileOnBattlefield); - } + public FearEffect() { + super(Duration.WhileOnBattlefield); + } - public FearEffect(final FearEffect effect) { - super(effect); - } + public FearEffect(final FearEffect effect) { + super(effect); + } - @Override - public boolean applies(Permanent permanent, Ability source, Game game) { - if (permanent.getAbilities().containsKey(FearAbility.getInstance().getId())) { - return true; - } - return false; - } - - @Override - public boolean canBeBlocked(Permanent attacker, Permanent blocker, Ability source, Game game) { - if (blocker.getCardType().contains(Constants.CardType.ARTIFACT) || blocker.getColor().isBlack()) { - return true; + @Override + public boolean applies(Permanent permanent, Ability source, Game game) { + if (permanent.getAbilities().containsKey(FearAbility.getInstance().getId())) { + return true; } - return false; - } + return false; + } - @Override - public FearEffect copy() { - return new FearEffect(this); - } + @Override + public boolean canBeBlocked(Permanent attacker, Permanent blocker, Ability source, Game game) { + if (blocker.getCardType().contains(Constants.CardType.ARTIFACT) || blocker.getColor().isBlack()) { + return true; + } + return false; + } + + @Override + public FearEffect copy() { + return new FearEffect(this); + } } \ No newline at end of file diff --git a/Mage/src/mage/abilities/keyword/FirstStrikeAbility.java b/Mage/src/mage/abilities/keyword/FirstStrikeAbility.java index 89bc371612..8c18709bce 100644 --- a/Mage/src/mage/abilities/keyword/FirstStrikeAbility.java +++ b/Mage/src/mage/abilities/keyword/FirstStrikeAbility.java @@ -38,28 +38,28 @@ import mage.abilities.StaticAbility; */ public class FirstStrikeAbility extends StaticAbility { - private static final FirstStrikeAbility fINSTANCE = new FirstStrikeAbility(); + private static final FirstStrikeAbility fINSTANCE = new FirstStrikeAbility(); - private Object readResolve() throws ObjectStreamException { - return fINSTANCE; - } + private Object readResolve() throws ObjectStreamException { + return fINSTANCE; + } - public static FirstStrikeAbility getInstance() { - return fINSTANCE; - } + public static FirstStrikeAbility getInstance() { + return fINSTANCE; + } - private FirstStrikeAbility() { - super(Zone.BATTLEFIELD, null); - } + private FirstStrikeAbility() { + super(Zone.BATTLEFIELD, null); + } - @Override - public String getRule() { - return "First strike"; - } + @Override + public String getRule() { + return "First strike"; + } - @Override - public FirstStrikeAbility copy() { - return fINSTANCE; - } + @Override + public FirstStrikeAbility copy() { + return fINSTANCE; + } } \ No newline at end of file diff --git a/Mage/src/mage/abilities/keyword/FlashAbility.java b/Mage/src/mage/abilities/keyword/FlashAbility.java index 4dee70c178..6b216d1272 100644 --- a/Mage/src/mage/abilities/keyword/FlashAbility.java +++ b/Mage/src/mage/abilities/keyword/FlashAbility.java @@ -38,28 +38,28 @@ import mage.abilities.StaticAbility; */ public class FlashAbility extends StaticAbility { - private static final FlashAbility fINSTANCE = new FlashAbility(); + private static final FlashAbility fINSTANCE = new FlashAbility(); - private Object readResolve() throws ObjectStreamException { - return fINSTANCE; - } + private Object readResolve() throws ObjectStreamException { + return fINSTANCE; + } - public static FlashAbility getInstance() { - return fINSTANCE; - } + public static FlashAbility getInstance() { + return fINSTANCE; + } - private FlashAbility() { - super(Zone.BATTLEFIELD, null); - } + private FlashAbility() { + super(Zone.BATTLEFIELD, null); + } - @Override - public String getRule() { - return "Flash"; - } + @Override + public String getRule() { + return "Flash"; + } - @Override - public FlashAbility copy() { - return fINSTANCE; - } + @Override + public FlashAbility copy() { + return fINSTANCE; + } } diff --git a/Mage/src/mage/abilities/keyword/FlashbackAbility.java b/Mage/src/mage/abilities/keyword/FlashbackAbility.java index 758ccdf775..63a0e07e89 100644 --- a/Mage/src/mage/abilities/keyword/FlashbackAbility.java +++ b/Mage/src/mage/abilities/keyword/FlashbackAbility.java @@ -46,110 +46,110 @@ import mage.players.Player; */ public class FlashbackAbility extends ActivatedAbilityImpl { - public FlashbackAbility(Cost cost, Constants.TimingRule timingRule) { - super(Constants.Zone.GRAVEYARD, new FlashbackEffect(), cost); - this.timing = timingRule; - this.usesStack = false; - this.addEffect(new CreateDelayedTriggeredAbilityEffect(new FlashbackTriggeredAbility())); - } + public FlashbackAbility(Cost cost, Constants.TimingRule timingRule) { + super(Constants.Zone.GRAVEYARD, new FlashbackEffect(), cost); + this.timing = timingRule; + this.usesStack = false; + this.addEffect(new CreateDelayedTriggeredAbilityEffect(new FlashbackTriggeredAbility())); + } -// @Override -// public boolean activate(Game game, boolean noMana) { -// Card card = game.getCard(sourceId); -// if (card != null) { -// getEffects().get(0).setTargetPointer(new FixedTarget(card.getId())); -// return super.activate(game, noMana); -// } -// return false; -// } +// @Override +// public boolean activate(Game game, boolean noMana) { +// Card card = game.getCard(sourceId); +// if (card != null) { +// getEffects().get(0).setTargetPointer(new FixedTarget(card.getId())); +// return super.activate(game, noMana); +// } +// return false; +// } - public FlashbackAbility(final FlashbackAbility ability) { - super(ability); - } + public FlashbackAbility(final FlashbackAbility ability) { + super(ability); + } - @Override - public FlashbackAbility copy() { - return new FlashbackAbility(this); - } + @Override + public FlashbackAbility copy() { + return new FlashbackAbility(this); + } - @Override - public String getRule() { - StringBuilder sbRule = new StringBuilder("Flashback "); - if (manaCosts.size() > 0) { - sbRule.append(manaCosts.getText()); - } - if (costs.size() > 0) { - if (sbRule.length() > 0) { - sbRule.append(","); - } - sbRule.append(costs.getText()); - } - return sbRule.toString(); - } + @Override + public String getRule() { + StringBuilder sbRule = new StringBuilder("Flashback "); + if (manaCosts.size() > 0) { + sbRule.append(manaCosts.getText()); + } + if (costs.size() > 0) { + if (sbRule.length() > 0) { + sbRule.append(","); + } + sbRule.append(costs.getText()); + } + return sbRule.toString(); + } } class FlashbackEffect extends OneShotEffect { - public FlashbackEffect() { - super(Constants.Outcome.Benefit); - staticText = ""; - } + public FlashbackEffect() { + super(Constants.Outcome.Benefit); + staticText = ""; + } - public FlashbackEffect(final FlashbackEffect effect) { - super(effect); - } + public FlashbackEffect(final FlashbackEffect effect) { + super(effect); + } - @Override - public FlashbackEffect copy() { - return new FlashbackEffect(this); - } + @Override + public FlashbackEffect copy() { + return new FlashbackEffect(this); + } - @Override - public boolean apply(Game game, Ability source) { - Card card = (Card) game.getObject(source.getSourceId()); - if (card != null) { - Player controller = game.getPlayer(source.getControllerId()); - if (controller != null) { + @Override + public boolean apply(Game game, Ability source) { + Card card = (Card) game.getObject(source.getSourceId()); + if (card != null) { + Player controller = game.getPlayer(source.getControllerId()); + if (controller != null) { card.getSpellAbility().clear(); int amount = source.getManaCostsToPay().getX(); card.getSpellAbility().getManaCostsToPay().setX(amount); - return controller.cast(card.getSpellAbility(), game, true); - } - } - return false; - } + return controller.cast(card.getSpellAbility(), game, true); + } + } + return false; + } } class FlashbackTriggeredAbility extends DelayedTriggeredAbility { - public FlashbackTriggeredAbility() { - super(new ExileSourceEffect()); - usesStack = false; - } + public FlashbackTriggeredAbility() { + super(new ExileSourceEffect()); + usesStack = false; + } - public FlashbackTriggeredAbility(final FlashbackTriggeredAbility ability) { - super(ability); - } + public FlashbackTriggeredAbility(final FlashbackTriggeredAbility ability) { + super(ability); + } - @Override - public FlashbackTriggeredAbility copy() { - return new FlashbackTriggeredAbility(this); - } + @Override + public FlashbackTriggeredAbility copy() { + return new FlashbackTriggeredAbility(this); + } - @Override - public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == GameEvent.EventType.ZONE_CHANGE && event.getTargetId().equals(this.sourceId)) { - ZoneChangeEvent zEvent = (ZoneChangeEvent) event; - if (zEvent.getFromZone() == Constants.Zone.STACK) { - return true; - } - } - return false; - } + @Override + public boolean checkTrigger(GameEvent event, Game game) { + if (event.getType() == GameEvent.EventType.ZONE_CHANGE && event.getTargetId().equals(this.sourceId)) { + ZoneChangeEvent zEvent = (ZoneChangeEvent) event; + if (zEvent.getFromZone() == Constants.Zone.STACK) { + return true; + } + } + return false; + } - @Override - public String getRule() { - return "(If the flashback cost was paid, exile this card instead of putting it anywhere else any time it would leave the stack)"; - } + @Override + public String getRule() { + return "(If the flashback cost was paid, exile this card instead of putting it anywhere else any time it would leave the stack)"; + } } \ No newline at end of file diff --git a/Mage/src/mage/abilities/keyword/FlyingAbility.java b/Mage/src/mage/abilities/keyword/FlyingAbility.java index f99cdfc609..e6903b6353 100644 --- a/Mage/src/mage/abilities/keyword/FlyingAbility.java +++ b/Mage/src/mage/abilities/keyword/FlyingAbility.java @@ -43,65 +43,65 @@ import java.io.ObjectStreamException; */ public class FlyingAbility extends EvasionAbility { - private static final FlyingAbility fINSTANCE = new FlyingAbility(); + private static final FlyingAbility fINSTANCE = new FlyingAbility(); - private Object readResolve() throws ObjectStreamException { - return fINSTANCE; - } + private Object readResolve() throws ObjectStreamException { + return fINSTANCE; + } - public static FlyingAbility getInstance() { - return fINSTANCE; - } + public static FlyingAbility getInstance() { + return fINSTANCE; + } - private FlyingAbility() { - this.addEffect(new FlyingEffect()); - } + private FlyingAbility() { + this.addEffect(new FlyingEffect()); + } - @Override - public String getRule() { - return "Flying"; - } + @Override + public String getRule() { + return "Flying"; + } - @Override - public FlyingAbility copy() { - return fINSTANCE; - } + @Override + public FlyingAbility copy() { + return fINSTANCE; + } } class FlyingEffect extends RestrictionEffect { - public FlyingEffect() { - super(Duration.EndOfGame); - } + public FlyingEffect() { + super(Duration.EndOfGame); + } - public FlyingEffect(final FlyingEffect effect) { - super(effect); - } + public FlyingEffect(final FlyingEffect effect) { + super(effect); + } @Override public void newId() { // do nothing } - @Override - public boolean applies(Permanent permanent, Ability source, Game game) { - if (permanent.getAbilities().containsKey(FlyingAbility.getInstance().getId())) { - return true; - } - return false; - } + @Override + public boolean applies(Permanent permanent, Ability source, Game game) { + if (permanent.getAbilities().containsKey(FlyingAbility.getInstance().getId())) { + return true; + } + return false; + } - @Override - public boolean canBeBlocked(Permanent attacker, Permanent blocker, Ability source, Game game) { - if (blocker.getAbilities().containsKey(FlyingAbility.getInstance().getId()) || blocker.getAbilities().containsKey(ReachAbility.getInstance().getId())) - return true; - return false; - } + @Override + public boolean canBeBlocked(Permanent attacker, Permanent blocker, Ability source, Game game) { + if (blocker.getAbilities().containsKey(FlyingAbility.getInstance().getId()) || blocker.getAbilities().containsKey(ReachAbility.getInstance().getId())) + return true; + return false; + } - @Override - public FlyingEffect copy() { - return new FlyingEffect(this); - } + @Override + public FlyingEffect copy() { + return new FlyingEffect(this); + } } \ No newline at end of file diff --git a/Mage/src/mage/abilities/keyword/ForestwalkAbility.java b/Mage/src/mage/abilities/keyword/ForestwalkAbility.java index 3f17518676..057a1bb480 100644 --- a/Mage/src/mage/abilities/keyword/ForestwalkAbility.java +++ b/Mage/src/mage/abilities/keyword/ForestwalkAbility.java @@ -37,23 +37,23 @@ import mage.filter.common.FilterLandPermanent; */ public class ForestwalkAbility extends LandwalkAbility { - private static final FilterLandPermanent filter = new FilterLandPermanent("Forest"); + private static final FilterLandPermanent filter = new FilterLandPermanent("Forest"); - static { - filter.getSubtype().add("Forest"); - filter.setScopeSubtype(ComparisonScope.Any); - } + static { + filter.getSubtype().add("Forest"); + filter.setScopeSubtype(ComparisonScope.Any); + } - public ForestwalkAbility() { - super(filter); - } + public ForestwalkAbility() { + super(filter); + } - public ForestwalkAbility(final ForestwalkAbility ability) { - super(ability); - } + public ForestwalkAbility(final ForestwalkAbility ability) { + super(ability); + } - @Override - public ForestwalkAbility copy() { - return new ForestwalkAbility(this); - } + @Override + public ForestwalkAbility copy() { + return new ForestwalkAbility(this); + } } \ No newline at end of file diff --git a/Mage/src/mage/abilities/keyword/FortifyAbility.java b/Mage/src/mage/abilities/keyword/FortifyAbility.java index 24a27fffd7..c7b5cbc03c 100644 --- a/Mage/src/mage/abilities/keyword/FortifyAbility.java +++ b/Mage/src/mage/abilities/keyword/FortifyAbility.java @@ -45,26 +45,26 @@ import mage.target.common.TargetLandPermanent; //20091005 - 702.64 public class FortifyAbility extends ActivatedAbilityImpl { - private static final FilterLandPermanent filter = new FilterLandPermanent("land you control"); + private static final FilterLandPermanent filter = new FilterLandPermanent("land you control"); - static { - filter.setTargetController(TargetController.YOU); - } + static { + filter.setTargetController(TargetController.YOU); + } - public FortifyAbility(Zone zone, AttachEffect effect, Cost cost) { - super(zone, effect, cost); - this.addTarget(new TargetLandPermanent(filter)); - timing = TimingRule.SORCERY; - } + public FortifyAbility(Zone zone, AttachEffect effect, Cost cost) { + super(zone, effect, cost); + this.addTarget(new TargetLandPermanent(filter)); + timing = TimingRule.SORCERY; + } - public FortifyAbility(final FortifyAbility ability) { - super(ability); - } + public FortifyAbility(final FortifyAbility ability) { + super(ability); + } - @Override - public FortifyAbility copy() { - return new FortifyAbility(this); - } + @Override + public FortifyAbility copy() { + return new FortifyAbility(this); + } } \ No newline at end of file diff --git a/Mage/src/mage/abilities/keyword/HasteAbility.java b/Mage/src/mage/abilities/keyword/HasteAbility.java index 778d9550b3..5ed68bcaaf 100644 --- a/Mage/src/mage/abilities/keyword/HasteAbility.java +++ b/Mage/src/mage/abilities/keyword/HasteAbility.java @@ -38,28 +38,28 @@ import mage.abilities.StaticAbility; */ public class HasteAbility extends StaticAbility { - private static final HasteAbility fINSTANCE = new HasteAbility(); + private static final HasteAbility fINSTANCE = new HasteAbility(); - private Object readResolve() throws ObjectStreamException { - return fINSTANCE; - } + private Object readResolve() throws ObjectStreamException { + return fINSTANCE; + } - public static HasteAbility getInstance() { - return fINSTANCE; - } + public static HasteAbility getInstance() { + return fINSTANCE; + } - private HasteAbility() { - super(Zone.BATTLEFIELD, null); - } + private HasteAbility() { + super(Zone.BATTLEFIELD, null); + } - @Override - public String getRule() { - return "Haste"; - } + @Override + public String getRule() { + return "Haste"; + } - @Override - public HasteAbility copy() { - return fINSTANCE; - } + @Override + public HasteAbility copy() { + return fINSTANCE; + } } diff --git a/Mage/src/mage/abilities/keyword/HexproofAbility.java b/Mage/src/mage/abilities/keyword/HexproofAbility.java index 6aa3d89006..596e5dcf58 100644 --- a/Mage/src/mage/abilities/keyword/HexproofAbility.java +++ b/Mage/src/mage/abilities/keyword/HexproofAbility.java @@ -14,22 +14,22 @@ import mage.filter.FilterStackObject; */ public class HexproofAbility extends SimpleStaticAbility { - private static final HexproofAbility fINSTANCE; + private static final HexproofAbility fINSTANCE; private static final FilterStackObject filter; - + static { filter = new FilterStackObject("spells or abilities your opponents control"); filter.setTargetController(Constants.TargetController.OPPONENT); fINSTANCE = new HexproofAbility(); } - - private Object readResolve() throws ObjectStreamException { - return fINSTANCE; - } - public static HexproofAbility getInstance() { - return fINSTANCE; - } + private Object readResolve() throws ObjectStreamException { + return fINSTANCE; + } + + public static HexproofAbility getInstance() { + return fINSTANCE; + } private HexproofAbility() { super(Constants.Zone.BATTLEFIELD, new CantTargetSourceEffect(filter, Constants.Duration.WhileOnBattlefield)); diff --git a/Mage/src/mage/abilities/keyword/IndestructibleAbility.java b/Mage/src/mage/abilities/keyword/IndestructibleAbility.java index a5de961e14..7918e58929 100644 --- a/Mage/src/mage/abilities/keyword/IndestructibleAbility.java +++ b/Mage/src/mage/abilities/keyword/IndestructibleAbility.java @@ -38,28 +38,28 @@ import mage.abilities.StaticAbility; */ public class IndestructibleAbility extends StaticAbility { - private static final IndestructibleAbility fINSTANCE = new IndestructibleAbility(); + private static final IndestructibleAbility fINSTANCE = new IndestructibleAbility(); - private Object readResolve() throws ObjectStreamException { - return fINSTANCE; - } + private Object readResolve() throws ObjectStreamException { + return fINSTANCE; + } - public static IndestructibleAbility getInstance() { - return fINSTANCE; - } + public static IndestructibleAbility getInstance() { + return fINSTANCE; + } - private IndestructibleAbility() { - super(Zone.BATTLEFIELD, null); - } + private IndestructibleAbility() { + super(Zone.BATTLEFIELD, null); + } - @Override - public String getRule() { - return "Indestructible"; - } + @Override + public String getRule() { + return "Indestructible"; + } - @Override - public IndestructibleAbility copy() { - return fINSTANCE; - } + @Override + public IndestructibleAbility copy() { + return fINSTANCE; + } } diff --git a/Mage/src/mage/abilities/keyword/InfectAbility.java b/Mage/src/mage/abilities/keyword/InfectAbility.java index 5c35d540a2..bd9b44aaee 100644 --- a/Mage/src/mage/abilities/keyword/InfectAbility.java +++ b/Mage/src/mage/abilities/keyword/InfectAbility.java @@ -57,28 +57,28 @@ import mage.abilities.StaticAbility; */ public class InfectAbility extends StaticAbility { - private static final InfectAbility fINSTANCE = new InfectAbility(); + private static final InfectAbility fINSTANCE = new InfectAbility(); - private Object readResolve() throws ObjectStreamException { - return fINSTANCE; - } + private Object readResolve() throws ObjectStreamException { + return fINSTANCE; + } - public static InfectAbility getInstance() { - return fINSTANCE; - } + public static InfectAbility getInstance() { + return fINSTANCE; + } - private InfectAbility() { - super(Zone.ALL, null); - } + private InfectAbility() { + super(Zone.ALL, null); + } - @Override - public String getRule() { - return "Infect"; - } + @Override + public String getRule() { + return "Infect"; + } - @Override - public InfectAbility copy() { - return fINSTANCE; - } + @Override + public InfectAbility copy() { + return fINSTANCE; + } } diff --git a/Mage/src/mage/abilities/keyword/IntimidateAbility.java b/Mage/src/mage/abilities/keyword/IntimidateAbility.java index edd941caa2..db6cf27aad 100644 --- a/Mage/src/mage/abilities/keyword/IntimidateAbility.java +++ b/Mage/src/mage/abilities/keyword/IntimidateAbility.java @@ -19,9 +19,9 @@ public class IntimidateAbility extends EvasionAbility { } @Override - public String getRule() { - return "Intimidate"; - } + public String getRule() { + return "Intimidate"; + } @Override public IntimidateAbility copy() { @@ -41,20 +41,20 @@ class IntimidateEffect extends RestrictionEffect { @Override public boolean applies(Permanent permanent, Ability source, Game game) { if (permanent.getAbilities().containsKey(IntimidateAbility.getInstance().getId())) { - return true; - } - return false; + return true; + } + return false; } @Override - public boolean canBeBlocked(Permanent attacker, Permanent blocker, Ability source, Game game) { + public boolean canBeBlocked(Permanent attacker, Permanent blocker, Ability source, Game game) { boolean result = false; - if (blocker.getCardType().contains(Constants.CardType.ARTIFACT) && (blocker.getCardType().contains(Constants.CardType.CREATURE))) - result = true; + if (blocker.getCardType().contains(Constants.CardType.ARTIFACT) && (blocker.getCardType().contains(Constants.CardType.CREATURE))) + result = true; if (attacker.getColor().shares(blocker.getColor())) result = true; - return result; - } + return result; + } @Override public IntimidateEffect copy() { diff --git a/Mage/src/mage/abilities/keyword/IslandwalkAbility.java b/Mage/src/mage/abilities/keyword/IslandwalkAbility.java index 5233ab9632..1243e77078 100644 --- a/Mage/src/mage/abilities/keyword/IslandwalkAbility.java +++ b/Mage/src/mage/abilities/keyword/IslandwalkAbility.java @@ -39,21 +39,21 @@ public class IslandwalkAbility extends LandwalkAbility { private static final FilterLandPermanent filter = new FilterLandPermanent("Island"); - static { - filter.getSubtype().add("Island"); - filter.setScopeSubtype(ComparisonScope.Any); - } + static { + filter.getSubtype().add("Island"); + filter.setScopeSubtype(ComparisonScope.Any); + } - public IslandwalkAbility() { - super(filter); - } + public IslandwalkAbility() { + super(filter); + } - public IslandwalkAbility(final IslandwalkAbility ability) { - super(ability); - } + public IslandwalkAbility(final IslandwalkAbility ability) { + super(ability); + } - @Override - public IslandwalkAbility copy() { - return new IslandwalkAbility(this); - } + @Override + public IslandwalkAbility copy() { + return new IslandwalkAbility(this); + } } diff --git a/Mage/src/mage/abilities/keyword/KickerAbility.java b/Mage/src/mage/abilities/keyword/KickerAbility.java index 6074565aca..79bcf8c6a0 100644 --- a/Mage/src/mage/abilities/keyword/KickerAbility.java +++ b/Mage/src/mage/abilities/keyword/KickerAbility.java @@ -41,72 +41,72 @@ import mage.players.Player; */ public class KickerAbility extends StaticAbility { - protected boolean kicked = false; - protected boolean replaces = false; + protected boolean kicked = false; + protected boolean replaces = false; - public KickerAbility(Effect effect, boolean replaces) { - super(Zone.STACK, effect); - this.replaces = replaces; - } + public KickerAbility(Effect effect, boolean replaces) { + super(Zone.STACK, effect); + this.replaces = replaces; + } - public KickerAbility(final KickerAbility ability) { - super(ability); - this.kicked = ability.kicked; - this.replaces = ability.replaces; - } + public KickerAbility(final KickerAbility ability) { + super(ability); + this.kicked = ability.kicked; + this.replaces = ability.replaces; + } - @Override - public KickerAbility copy() { - return new KickerAbility(this); - } + @Override + public KickerAbility copy() { + return new KickerAbility(this); + } - @Override - public boolean activate(Game game, boolean noMana) { - Player player = game.getPlayer(this.getControllerId()); + @Override + public boolean activate(Game game, boolean noMana) { + Player player = game.getPlayer(this.getControllerId()); - String message = "Use kicker - " + getRule() + "?"; - Card card = game.getCard(sourceId); - // replace by card name or just plain "this" - String text = card == null ? "this" : card.getName(); - message = message.replace("{this}", text).replace("{source}", text); - if (player.chooseUse(getEffects().get(0).getOutcome(), message, game)) { - int bookmark = game.bookmarkState(); - if (super.activate(game, noMana)) { - game.removeBookmark(bookmark); - kicked = true; - } - else { - game.restoreState(bookmark); - kicked = false; - } - return kicked; - } - return false; - } + String message = "Use kicker - " + getRule() + "?"; + Card card = game.getCard(sourceId); + // replace by card name or just plain "this" + String text = card == null ? "this" : card.getName(); + message = message.replace("{this}", text).replace("{source}", text); + if (player.chooseUse(getEffects().get(0).getOutcome(), message, game)) { + int bookmark = game.bookmarkState(); + if (super.activate(game, noMana)) { + game.removeBookmark(bookmark); + kicked = true; + } + else { + game.restoreState(bookmark); + kicked = false; + } + return kicked; + } + return false; + } - public boolean isKicked() { - return kicked; - } + public boolean isKicked() { + return kicked; + } - public boolean isReplaces() { - return replaces; - } + public boolean isReplaces() { + return replaces; + } - @Override - public String getRule() { - StringBuilder sb = new StringBuilder(); - sb.append("Kicker"); - if (manaCosts.size() > 0) { - sb.append(manaCosts.getText()); - if (costs.size() > 0) - sb.append(","); - } - if (costs.size() > 0) - sb.append(costs.getText()); - sb.append(":").append(modes.getText()); - if (replaces) - sb.append(" instead"); - return sb.toString(); - } + @Override + public String getRule() { + StringBuilder sb = new StringBuilder(); + sb.append("Kicker"); + if (manaCosts.size() > 0) { + sb.append(manaCosts.getText()); + if (costs.size() > 0) + sb.append(","); + } + if (costs.size() > 0) + sb.append(costs.getText()); + sb.append(":").append(modes.getText()); + if (replaces) + sb.append(" instead"); + return sb.toString(); + } } diff --git a/Mage/src/mage/abilities/keyword/LandwalkAbility.java b/Mage/src/mage/abilities/keyword/LandwalkAbility.java index f2bc3a7b84..d7c17086f6 100644 --- a/Mage/src/mage/abilities/keyword/LandwalkAbility.java +++ b/Mage/src/mage/abilities/keyword/LandwalkAbility.java @@ -42,52 +42,52 @@ import mage.game.permanent.Permanent; */ public class LandwalkAbility extends EvasionAbility { - public LandwalkAbility(FilterLandPermanent filter) { - this.addEffect(new LandwalkEffect(filter)); - } + public LandwalkAbility(FilterLandPermanent filter) { + this.addEffect(new LandwalkEffect(filter)); + } - public LandwalkAbility(final LandwalkAbility ability) { - super(ability); - } + public LandwalkAbility(final LandwalkAbility ability) { + super(ability); + } - @Override - public LandwalkAbility copy() { - return new LandwalkAbility(this); - } + @Override + public LandwalkAbility copy() { + return new LandwalkAbility(this); + } } class LandwalkEffect extends RestrictionEffect { - protected FilterLandPermanent filter; + protected FilterLandPermanent filter; - public LandwalkEffect(FilterLandPermanent filter) { - super(Duration.WhileOnBattlefield); - this.filter = filter; - staticText = filter.getMessage() + "walk"; - } + public LandwalkEffect(FilterLandPermanent filter) { + super(Duration.WhileOnBattlefield); + this.filter = filter; + staticText = filter.getMessage() + "walk"; + } - public LandwalkEffect(final LandwalkEffect effect) { - super(effect); - this.filter = effect.filter.copy(); - } + public LandwalkEffect(final LandwalkEffect effect) { + super(effect); + this.filter = effect.filter.copy(); + } - @Override - public boolean canBeBlocked(Permanent attacker, Permanent blocker, Ability source, Game game) { - return !game.getBattlefield().contains(filter, blocker.getControllerId(), 1, game); - } + @Override + public boolean canBeBlocked(Permanent attacker, Permanent blocker, Ability source, Game game) { + return !game.getBattlefield().contains(filter, blocker.getControllerId(), 1, game); + } - @Override - public boolean applies(Permanent permanent, Ability source, Game game) { - if (permanent.getId().equals(source.getSourceId())) { - return true; - } - return false; - } + @Override + public boolean applies(Permanent permanent, Ability source, Game game) { + if (permanent.getId().equals(source.getSourceId())) { + return true; + } + return false; + } - @Override - public LandwalkEffect copy() { - return new LandwalkEffect(this); - } + @Override + public LandwalkEffect copy() { + return new LandwalkEffect(this); + } } \ No newline at end of file diff --git a/Mage/src/mage/abilities/keyword/LevelUpAbility.java b/Mage/src/mage/abilities/keyword/LevelUpAbility.java index f308a31c25..d171a78f3e 100644 --- a/Mage/src/mage/abilities/keyword/LevelUpAbility.java +++ b/Mage/src/mage/abilities/keyword/LevelUpAbility.java @@ -41,19 +41,19 @@ import mage.counters.common.LevelCounter; */ public class LevelUpAbility extends ActivatedAbilityImpl { - public LevelUpAbility(ManaCosts costs) { - super(Zone.BATTLEFIELD, new AddCountersSourceEffect(new LevelCounter()), costs); - this.timing = TimingRule.SORCERY; - } + public LevelUpAbility(ManaCosts costs) { + super(Zone.BATTLEFIELD, new AddCountersSourceEffect(new LevelCounter()), costs); + this.timing = TimingRule.SORCERY; + } - public LevelUpAbility(final LevelUpAbility ability) { - super(ability); - } + public LevelUpAbility(final LevelUpAbility ability) { + super(ability); + } - @Override - public LevelUpAbility copy() { - return new LevelUpAbility(this); - } + @Override + public LevelUpAbility copy() { + return new LevelUpAbility(this); + } @Override public String getRule() { diff --git a/Mage/src/mage/abilities/keyword/LevelerCardBuilder.java b/Mage/src/mage/abilities/keyword/LevelerCardBuilder.java index 65aad738f9..eb986474c0 100644 --- a/Mage/src/mage/abilities/keyword/LevelerCardBuilder.java +++ b/Mage/src/mage/abilities/keyword/LevelerCardBuilder.java @@ -111,7 +111,7 @@ public class LevelerCardBuilder { this.abilities.add(ability); return this; } - + public LevelerCardBuilder setRule(String rule) { this.rule = rule; return this; diff --git a/Mage/src/mage/abilities/keyword/LeylineAbility.java b/Mage/src/mage/abilities/keyword/LeylineAbility.java index c17bf1a53e..1483b520a2 100644 --- a/Mage/src/mage/abilities/keyword/LeylineAbility.java +++ b/Mage/src/mage/abilities/keyword/LeylineAbility.java @@ -38,28 +38,28 @@ import mage.abilities.StaticAbility; */ public class LeylineAbility extends StaticAbility{ - private static final LeylineAbility fINSTANCE = new LeylineAbility(); + private static final LeylineAbility fINSTANCE = new LeylineAbility(); - private Object readResolve() throws ObjectStreamException { - return fINSTANCE; - } + private Object readResolve() throws ObjectStreamException { + return fINSTANCE; + } - public static LeylineAbility getInstance() { - return fINSTANCE; - } + public static LeylineAbility getInstance() { + return fINSTANCE; + } - private LeylineAbility() { - super(Zone.HAND, null); - } + private LeylineAbility() { + super(Zone.HAND, null); + } - @Override - public String getRule() { - return "If {this} is in your opening hand, you may begin the game with it on the battlefield."; - } + @Override + public String getRule() { + return "If {this} is in your opening hand, you may begin the game with it on the battlefield."; + } - @Override - public LeylineAbility copy() { - return fINSTANCE; - } + @Override + public LeylineAbility copy() { + return fINSTANCE; + } } diff --git a/Mage/src/mage/abilities/keyword/LifelinkAbility.java b/Mage/src/mage/abilities/keyword/LifelinkAbility.java index 42b246446f..d2a950b0ad 100644 --- a/Mage/src/mage/abilities/keyword/LifelinkAbility.java +++ b/Mage/src/mage/abilities/keyword/LifelinkAbility.java @@ -38,28 +38,28 @@ import mage.abilities.StaticAbility; */ public class LifelinkAbility extends StaticAbility { - private static final LifelinkAbility fINSTANCE = new LifelinkAbility(); + private static final LifelinkAbility fINSTANCE = new LifelinkAbility(); - private Object readResolve() throws ObjectStreamException { - return fINSTANCE; - } + private Object readResolve() throws ObjectStreamException { + return fINSTANCE; + } - public static LifelinkAbility getInstance() { - return fINSTANCE; - } + public static LifelinkAbility getInstance() { + return fINSTANCE; + } - private LifelinkAbility() { - super(Zone.ALL, null); - } + private LifelinkAbility() { + super(Zone.ALL, null); + } - @Override - public String getRule() { - return "Lifelink"; - } + @Override + public String getRule() { + return "Lifelink"; + } - @Override - public LifelinkAbility copy() { - return fINSTANCE; - } + @Override + public LifelinkAbility copy() { + return fINSTANCE; + } } diff --git a/Mage/src/mage/abilities/keyword/LivingWeaponAbility.java b/Mage/src/mage/abilities/keyword/LivingWeaponAbility.java index d29c0bee69..fee8b6b205 100644 --- a/Mage/src/mage/abilities/keyword/LivingWeaponAbility.java +++ b/Mage/src/mage/abilities/keyword/LivingWeaponAbility.java @@ -60,9 +60,9 @@ class GermToken extends Token { public GermToken() { super("Germ", "a 0/0 black Germ creature token"); cardType.add(Constants.CardType.CREATURE); - color = ObjectColor.BLACK; - subtype.add("Germ"); - power = new MageInt(0); - toughness = new MageInt(0); + color = ObjectColor.BLACK; + subtype.add("Germ"); + power = new MageInt(0); + toughness = new MageInt(0); } } \ No newline at end of file diff --git a/Mage/src/mage/abilities/keyword/MountainwalkAbility.java b/Mage/src/mage/abilities/keyword/MountainwalkAbility.java index b20824325d..ad9a9cc412 100644 --- a/Mage/src/mage/abilities/keyword/MountainwalkAbility.java +++ b/Mage/src/mage/abilities/keyword/MountainwalkAbility.java @@ -37,23 +37,23 @@ import mage.filter.common.FilterLandPermanent; */ public class MountainwalkAbility extends LandwalkAbility { - private static final FilterLandPermanent filter = new FilterLandPermanent("Mountain"); + private static final FilterLandPermanent filter = new FilterLandPermanent("Mountain"); - static { - filter.getSubtype().add("Mountain"); - filter.setScopeSubtype(ComparisonScope.Any); - } + static { + filter.getSubtype().add("Mountain"); + filter.setScopeSubtype(ComparisonScope.Any); + } - public MountainwalkAbility() { - super(filter); - } + public MountainwalkAbility() { + super(filter); + } - public MountainwalkAbility(final MountainwalkAbility ability) { - super(ability); - } + public MountainwalkAbility(final MountainwalkAbility ability) { + super(ability); + } - @Override - public MountainwalkAbility copy() { - return new MountainwalkAbility(this); - } + @Override + public MountainwalkAbility copy() { + return new MountainwalkAbility(this); + } } \ No newline at end of file diff --git a/Mage/src/mage/abilities/keyword/MultikickerAbility.java b/Mage/src/mage/abilities/keyword/MultikickerAbility.java index e5def5c6b6..baf7d48c32 100644 --- a/Mage/src/mage/abilities/keyword/MultikickerAbility.java +++ b/Mage/src/mage/abilities/keyword/MultikickerAbility.java @@ -37,61 +37,61 @@ import mage.game.Game; */ public class MultikickerAbility extends KickerAbility { - int activateCount; + int activateCount; - public MultikickerAbility(Effect effect, boolean replaces) { - super(effect, replaces); - } + public MultikickerAbility(Effect effect, boolean replaces) { + super(effect, replaces); + } - public MultikickerAbility(final MultikickerAbility ability) { - super(ability); - this.activateCount = ability.activateCount; - } + public MultikickerAbility(final MultikickerAbility ability) { + super(ability); + this.activateCount = ability.activateCount; + } - @Override - public MultikickerAbility copy() { - return new MultikickerAbility(this); - } + @Override + public MultikickerAbility copy() { + return new MultikickerAbility(this); + } - @Override - public boolean activate(Game game, boolean noMana) { - activateCount = 0; - while (true) { - this.costs.clearPaid(); - this.manaCostsToPay.clearPaid(); - if (!super.activate(game, noMana)) - break; - activateCount++; - } - kicked = activateCount > 0; - return kicked; - } + @Override + public boolean activate(Game game, boolean noMana) { + activateCount = 0; + while (true) { + this.costs.clearPaid(); + this.manaCostsToPay.clearPaid(); + if (!super.activate(game, noMana)) + break; + activateCount++; + } + kicked = activateCount > 0; + return kicked; + } - @Override - public boolean resolve(Game game) { - boolean result = false; - for (int i = 0; i < activateCount; i++) { - result |= super.resolve(game); - } - return result; - } + @Override + public boolean resolve(Game game) { + boolean result = false; + for (int i = 0; i < activateCount; i++) { + result |= super.resolve(game); + } + return result; + } - @Override - public String getRule() { - StringBuilder sb = new StringBuilder(); - sb.append("Multikicker"); - if (manaCosts.size() > 0) { - sb.append(manaCosts.getText()); - if (costs.size() > 0) - sb.append(","); - } - if (costs.size() > 0) - sb.append(costs.getText()); - sb.append(":").append(modes.getText()); - if (replaces) - sb.append(" instead"); - return sb.toString(); - } + @Override + public String getRule() { + StringBuilder sb = new StringBuilder(); + sb.append("Multikicker"); + if (manaCosts.size() > 0) { + sb.append(manaCosts.getText()); + if (costs.size() > 0) + sb.append(","); + } + if (costs.size() > 0) + sb.append(costs.getText()); + sb.append(":").append(modes.getText()); + if (replaces) + sb.append(" instead"); + return sb.toString(); + } public int getActivateCount() { return activateCount; diff --git a/Mage/src/mage/abilities/keyword/PhasingAbility.java b/Mage/src/mage/abilities/keyword/PhasingAbility.java index 7be2c2cbb1..c986ac8ffe 100644 --- a/Mage/src/mage/abilities/keyword/PhasingAbility.java +++ b/Mage/src/mage/abilities/keyword/PhasingAbility.java @@ -38,28 +38,28 @@ import mage.abilities.StaticAbility; */ public class PhasingAbility extends StaticAbility { - private static final PhasingAbility fINSTANCE = new PhasingAbility(); + private static final PhasingAbility fINSTANCE = new PhasingAbility(); - private Object readResolve() throws ObjectStreamException { - return fINSTANCE; - } + private Object readResolve() throws ObjectStreamException { + return fINSTANCE; + } - public static PhasingAbility getInstance() { - return fINSTANCE; - } + public static PhasingAbility getInstance() { + return fINSTANCE; + } - private PhasingAbility() { - super(Zone.BATTLEFIELD, null); - } + private PhasingAbility() { + super(Zone.BATTLEFIELD, null); + } - @Override - public String getRule() { - return "Phasing"; - } + @Override + public String getRule() { + return "Phasing"; + } - @Override - public PhasingAbility copy() { - return fINSTANCE; - } + @Override + public PhasingAbility copy() { + return fINSTANCE; + } } diff --git a/Mage/src/mage/abilities/keyword/PlainswalkAbility.java b/Mage/src/mage/abilities/keyword/PlainswalkAbility.java index 070e988882..f10b9db822 100644 --- a/Mage/src/mage/abilities/keyword/PlainswalkAbility.java +++ b/Mage/src/mage/abilities/keyword/PlainswalkAbility.java @@ -37,23 +37,23 @@ import mage.filter.common.FilterLandPermanent; */ public class PlainswalkAbility extends LandwalkAbility { - private static final FilterLandPermanent filter = new FilterLandPermanent("Plains"); + private static final FilterLandPermanent filter = new FilterLandPermanent("Plains"); - static { - filter.getSubtype().add("Plains"); - filter.setScopeSubtype(ComparisonScope.Any); - } + static { + filter.getSubtype().add("Plains"); + filter.setScopeSubtype(ComparisonScope.Any); + } - public PlainswalkAbility() { - super(filter); - } + public PlainswalkAbility() { + super(filter); + } - public PlainswalkAbility(final PlainswalkAbility ability) { - super(ability); - } + public PlainswalkAbility(final PlainswalkAbility ability) { + super(ability); + } - @Override - public PlainswalkAbility copy() { - return new PlainswalkAbility(this); - } + @Override + public PlainswalkAbility copy() { + return new PlainswalkAbility(this); + } } \ No newline at end of file diff --git a/Mage/src/mage/abilities/keyword/ProtectionAbility.java b/Mage/src/mage/abilities/keyword/ProtectionAbility.java index b4b75c76e8..a08eeba1e9 100644 --- a/Mage/src/mage/abilities/keyword/ProtectionAbility.java +++ b/Mage/src/mage/abilities/keyword/ProtectionAbility.java @@ -43,55 +43,55 @@ import mage.game.stack.Spell; */ public class ProtectionAbility extends StaticAbility { - protected Filter filter; + protected Filter filter; - public ProtectionAbility(Filter filter) { - super(Zone.BATTLEFIELD, null); - this.filter = filter; - } + public ProtectionAbility(Filter filter) { + super(Zone.BATTLEFIELD, null); + this.filter = filter; + } - public ProtectionAbility(final ProtectionAbility ability) { - super(ability); - this.filter = ability.filter.copy(); - } + public ProtectionAbility(final ProtectionAbility ability) { + super(ability); + this.filter = ability.filter.copy(); + } - @Override - public ProtectionAbility copy() { - return new ProtectionAbility(this); - } + @Override + public ProtectionAbility copy() { + return new ProtectionAbility(this); + } - @Override - public String getRule() { - return "Protection from " + filter.getMessage(); - } + @Override + public String getRule() { + return "Protection from " + filter.getMessage(); + } - public boolean canTarget(MageObject source, Game game) { - if (filter instanceof FilterPermanent) { - if (source instanceof Permanent) - return !filter.match(source, game); - return true; - } - if (filter instanceof FilterSpell) { - if (source instanceof Spell) - return !filter.match(source, game); - return true; - } - if (filter instanceof FilterCard) { - if (source instanceof Card) - return !filter.match(source, game); - return true; - } - if (filter instanceof FilterObject) { - return !filter.match(source, game); - } - return true; - } + public boolean canTarget(MageObject source, Game game) { + if (filter instanceof FilterPermanent) { + if (source instanceof Permanent) + return !filter.match(source, game); + return true; + } + if (filter instanceof FilterSpell) { + if (source instanceof Spell) + return !filter.match(source, game); + return true; + } + if (filter instanceof FilterCard) { + if (source instanceof Card) + return !filter.match(source, game); + return true; + } + if (filter instanceof FilterObject) { + return !filter.match(source, game); + } + return true; + } - public Filter getFilter() { - return filter; - } + public Filter getFilter() { + return filter; + } - public void setFilter(FilterCard filter) { - this.filter = filter; - } + public void setFilter(FilterCard filter) { + this.filter = filter; + } } diff --git a/Mage/src/mage/abilities/keyword/ReachAbility.java b/Mage/src/mage/abilities/keyword/ReachAbility.java index ff515b6cc6..d7ea618c61 100644 --- a/Mage/src/mage/abilities/keyword/ReachAbility.java +++ b/Mage/src/mage/abilities/keyword/ReachAbility.java @@ -38,28 +38,28 @@ import mage.abilities.StaticAbility; */ public class ReachAbility extends StaticAbility { - private static final ReachAbility fINSTANCE = new ReachAbility(); + private static final ReachAbility fINSTANCE = new ReachAbility(); - private Object readResolve() throws ObjectStreamException { - return fINSTANCE; - } + private Object readResolve() throws ObjectStreamException { + return fINSTANCE; + } - public static ReachAbility getInstance() { - return fINSTANCE; - } + public static ReachAbility getInstance() { + return fINSTANCE; + } - private ReachAbility() { - super(Zone.BATTLEFIELD, null); - } + private ReachAbility() { + super(Zone.BATTLEFIELD, null); + } - @Override - public String getRule() { - return "Reach"; - } + @Override + public String getRule() { + return "Reach"; + } - @Override - public ReachAbility copy() { - return fINSTANCE; - } + @Override + public ReachAbility copy() { + return fINSTANCE; + } } diff --git a/Mage/src/mage/abilities/keyword/ReboundAbility.java b/Mage/src/mage/abilities/keyword/ReboundAbility.java index c34ae9722c..ba5d67c664 100644 --- a/Mage/src/mage/abilities/keyword/ReboundAbility.java +++ b/Mage/src/mage/abilities/keyword/ReboundAbility.java @@ -70,55 +70,55 @@ import mage.players.Player; * @author maurer.it_at_gmail.com */ public class ReboundAbility extends TriggeredAbilityImpl { - //20101001 - 702.85 - private boolean installReboundEffect; - private static String reboundText = "Rebound (If you cast this spell from your hand, exile it as it resolves. At the beginning of your next upkeep, you may cast this card from exile without paying its mana cost.)"; + //20101001 - 702.85 + private boolean installReboundEffect; + private static String reboundText = "Rebound (If you cast this spell from your hand, exile it as it resolves. At the beginning of your next upkeep, you may cast this card from exile without paying its mana cost.)"; - public ReboundAbility ( ) { - super(Zone.STACK, null); - this.installReboundEffect = false; - } + public ReboundAbility ( ) { + super(Zone.STACK, null); + this.installReboundEffect = false; + } - public ReboundAbility ( final ReboundAbility ability ) { - super(ability); - this.installReboundEffect = ability.installReboundEffect; - } + public ReboundAbility ( final ReboundAbility ability ) { + super(ability); + this.installReboundEffect = ability.installReboundEffect; + } - @Override - public boolean checkTrigger(GameEvent event, Game game) { - //Something hit the stack from the hand, see if its a spell with this ability. - if ( event.getType() == EventType.ZONE_CHANGE && - ((ZoneChangeEvent)event).getFromZone() == Zone.HAND && - ((ZoneChangeEvent)event).getToZone() == Zone.STACK ) - { - Card card = (Card)game.getObject(event.getTargetId()); + @Override + public boolean checkTrigger(GameEvent event, Game game) { + //Something hit the stack from the hand, see if its a spell with this ability. + if ( event.getType() == EventType.ZONE_CHANGE && + ((ZoneChangeEvent)event).getFromZone() == Zone.HAND && + ((ZoneChangeEvent)event).getToZone() == Zone.STACK ) + { + Card card = (Card)game.getObject(event.getTargetId()); - if ( card.getAbilities().contains(this) ) { - this.installReboundEffect = true; - } - } + if ( card.getAbilities().contains(this) ) { + this.installReboundEffect = true; + } + } - //Only 'install' the effect on a successfully cast spell otherwise the user - //may cancel before paying its costs and potentially having two copies rebound - if ( event.getType() == EventType.SPELL_CAST && this.installReboundEffect ) { - Spell spell = game.getStack().getSpell(event.getTargetId()); - if (spell != null && spell.getSourceId().equals(this.getSourceId())) { - spell.getSpellAbility().addEffect(new ReboundEffect()); - this.installReboundEffect = false; - } - } - return false; - } + //Only 'install' the effect on a successfully cast spell otherwise the user + //may cancel before paying its costs and potentially having two copies rebound + if ( event.getType() == EventType.SPELL_CAST && this.installReboundEffect ) { + Spell spell = game.getStack().getSpell(event.getTargetId()); + if (spell != null && spell.getSourceId().equals(this.getSourceId())) { + spell.getSpellAbility().addEffect(new ReboundEffect()); + this.installReboundEffect = false; + } + } + return false; + } - @Override - public String getRule() { - return reboundText; - } + @Override + public String getRule() { + return reboundText; + } - @Override - public ReboundAbility copy() { - return new ReboundAbility(this); - } + @Override + public ReboundAbility copy() { + return new ReboundAbility(this); + } } /** @@ -131,35 +131,35 @@ public class ReboundAbility extends TriggeredAbilityImpl { */ class ReboundEffect extends OneShotEffect { - public ReboundEffect() { - super(Outcome.Benefit); - } + public ReboundEffect() { + super(Outcome.Benefit); + } - public ReboundEffect ( ReboundEffect effect ) { - super(effect); - } + public ReboundEffect ( ReboundEffect effect ) { + super(effect); + } - @Override - public boolean apply(Game game, Ability source) { - Spell sourceSpell = (Spell)game.getObject(source.getId()); - if ( sourceSpell != null && sourceSpell.isCopiedSpell() ) { - return false; - } - else { - Card sourceCard = (Card)game.getObject(source.getSourceId()); - ReboundEffectCastFromExileDelayedTrigger trigger = new ReboundEffectCastFromExileDelayedTrigger(sourceCard.getId(), sourceCard.getId()); - trigger.setControllerId(source.getControllerId()); - game.addDelayedTriggeredAbility(trigger); + @Override + public boolean apply(Game game, Ability source) { + Spell sourceSpell = (Spell)game.getObject(source.getId()); + if ( sourceSpell != null && sourceSpell.isCopiedSpell() ) { + return false; + } + else { + Card sourceCard = (Card)game.getObject(source.getSourceId()); + ReboundEffectCastFromExileDelayedTrigger trigger = new ReboundEffectCastFromExileDelayedTrigger(sourceCard.getId(), sourceCard.getId()); + trigger.setControllerId(source.getControllerId()); + game.addDelayedTriggeredAbility(trigger); - game.getContinuousEffects().addEffect(new ReboundCastFromHandReplacementEffect(sourceCard.getId()), source); - return true; - } - } + game.getContinuousEffects().addEffect(new ReboundCastFromHandReplacementEffect(sourceCard.getId()), source); + return true; + } + } - @Override - public ReboundEffect copy() { - return new ReboundEffect(this); - } + @Override + public ReboundEffect copy() { + return new ReboundEffect(this); + } } /** @@ -172,58 +172,58 @@ class ReboundEffect extends OneShotEffect { */ class ReboundCastFromHandReplacementEffect extends ReplacementEffectImpl { - private static String replacementText = "Rebound - If you cast {this} from your hand, exile it as it resolves"; - private UUID cardId; + private static String replacementText = "Rebound - If you cast {this} from your hand, exile it as it resolves"; + private UUID cardId; - ReboundCastFromHandReplacementEffect ( UUID cardId ) { - super(Duration.OneUse, Outcome.Exile); - this.cardId = cardId; - this.staticText = replacementText; - } + ReboundCastFromHandReplacementEffect ( UUID cardId ) { + super(Duration.OneUse, Outcome.Exile); + this.cardId = cardId; + this.staticText = replacementText; + } - ReboundCastFromHandReplacementEffect ( ReboundCastFromHandReplacementEffect effect ) { - super(effect); - this.cardId = effect.cardId; - } + ReboundCastFromHandReplacementEffect ( ReboundCastFromHandReplacementEffect effect ) { + super(effect); + this.cardId = effect.cardId; + } - @Override - public boolean apply(Game game, Ability source) { - throw new UnsupportedOperationException("Not supported."); - } + @Override + public boolean apply(Game game, Ability source) { + throw new UnsupportedOperationException("Not supported."); + } - @Override - public ReboundCastFromHandReplacementEffect copy() { - return new ReboundCastFromHandReplacementEffect(this); - } + @Override + public ReboundCastFromHandReplacementEffect copy() { + return new ReboundCastFromHandReplacementEffect(this); + } - @Override - public boolean replaceEvent(GameEvent event, Ability source, Game game) { - Spell sourceSpell = (Spell)game.getObject(source.getId()); - if ( sourceSpell != null && sourceSpell.isCopiedSpell() ) { - return false; - } - else { - Card sourceCard = (Card)game.getObject(source.getSourceId()); - Player player = game.getPlayer(sourceCard.getOwnerId()); + @Override + public boolean replaceEvent(GameEvent event, Ability source, Game game) { + Spell sourceSpell = (Spell)game.getObject(source.getId()); + if ( sourceSpell != null && sourceSpell.isCopiedSpell() ) { + return false; + } + else { + Card sourceCard = (Card)game.getObject(source.getSourceId()); + Player player = game.getPlayer(sourceCard.getOwnerId()); - sourceCard.moveToExile(source.getSourceId(), player.getName() + " Rebound Exile", source.getId(), game); - this.used = true; + sourceCard.moveToExile(source.getSourceId(), player.getName() + " Rebound Exile", source.getId(), game); + this.used = true; - return true; - } - } + return true; + } + } - @Override - public boolean applies(GameEvent event, Ability source, Game game) { - if ( event.getType() == EventType.ZONE_CHANGE && - ((ZoneChangeEvent)event).getFromZone() == Zone.STACK && - ((ZoneChangeEvent)event).getToZone() == Zone.GRAVEYARD && - source.getSourceId() == this.cardId ) - { - return true; - } - return false; - } + @Override + public boolean applies(GameEvent event, Ability source, Game game) { + if ( event.getType() == EventType.ZONE_CHANGE && + ((ZoneChangeEvent)event).getFromZone() == Zone.STACK && + ((ZoneChangeEvent)event).getToZone() == Zone.GRAVEYARD && + source.getSourceId() == this.cardId ) + { + return true; + } + return false; + } } @@ -237,28 +237,28 @@ class ReboundCastFromHandReplacementEffect extends ReplacementEffectImpl { - ReboundEffectCastFromExileDelayedTrigger ( UUID cardId, UUID sourceId ) { - super(new ReboundCastSpellFromExileEffect(cardId)); - setSourceId(sourceId); - this.optional = true; - } + ReboundEffectCastFromExileDelayedTrigger ( UUID cardId, UUID sourceId ) { + super(new ReboundCastSpellFromExileEffect(cardId)); + setSourceId(sourceId); + this.optional = true; + } - ReboundEffectCastFromExileDelayedTrigger ( ReboundEffectCastFromExileDelayedTrigger ability ) { - super(ability); - } + ReboundEffectCastFromExileDelayedTrigger ( ReboundEffectCastFromExileDelayedTrigger ability ) { + super(ability); + } - @Override - public ReboundEffectCastFromExileDelayedTrigger copy() { - return new ReboundEffectCastFromExileDelayedTrigger(this); - } + @Override + public ReboundEffectCastFromExileDelayedTrigger copy() { + return new ReboundEffectCastFromExileDelayedTrigger(this); + } - @Override - public boolean checkTrigger(GameEvent event, Game game) { - if ( event.getType() == EventType.UPKEEP_STEP_PRE && MyTurnCondition.getInstance().apply(game, this) ) { - return true; - } - return false; - } + @Override + public boolean checkTrigger(GameEvent event, Game game) { + if ( event.getType() == EventType.UPKEEP_STEP_PRE && MyTurnCondition.getInstance().apply(game, this) ) { + return true; + } + return false; + } } /** @@ -269,37 +269,37 @@ class ReboundEffectCastFromExileDelayedTrigger extends DelayedTriggeredAbility { - private static String castFromExileText = "Rebound - You may cast {this} from exile without paying its mana cost"; - private UUID cardId; + private static String castFromExileText = "Rebound - You may cast {this} from exile without paying its mana cost"; + private UUID cardId; - ReboundCastSpellFromExileEffect ( UUID cardId ) { - super(Outcome.Benefit); - this.cardId = cardId; - staticText = castFromExileText; - } + ReboundCastSpellFromExileEffect ( UUID cardId ) { + super(Outcome.Benefit); + this.cardId = cardId; + staticText = castFromExileText; + } - ReboundCastSpellFromExileEffect ( ReboundCastSpellFromExileEffect effect ) { - super(effect); - this.cardId = effect.cardId; - } + ReboundCastSpellFromExileEffect ( ReboundCastSpellFromExileEffect effect ) { + super(effect); + this.cardId = effect.cardId; + } - @Override - public boolean apply(Game game, Ability source) { - ExileZone zone = game.getExile().getExileZone(this.cardId); - if (zone == null || zone.isEmpty()) return false; - Card reboundCard = zone.get(this.cardId, game); - Player player = game.getPlayer(source.getControllerId()); - SpellAbility ability = reboundCard.getSpellAbility(); + @Override + public boolean apply(Game game, Ability source) { + ExileZone zone = game.getExile().getExileZone(this.cardId); + if (zone == null || zone.isEmpty()) return false; + Card reboundCard = zone.get(this.cardId, game); + Player player = game.getPlayer(source.getControllerId()); + SpellAbility ability = reboundCard.getSpellAbility(); - player.cast(ability, game, true); - zone.remove(reboundCard.getId()); + player.cast(ability, game, true); + zone.remove(reboundCard.getId()); - return true; - } + return true; + } - @Override - public ReboundCastSpellFromExileEffect copy() { - return new ReboundCastSpellFromExileEffect(this); - } + @Override + public ReboundCastSpellFromExileEffect copy() { + return new ReboundCastSpellFromExileEffect(this); + } } diff --git a/Mage/src/mage/abilities/keyword/ShroudAbility.java b/Mage/src/mage/abilities/keyword/ShroudAbility.java index 4a58de35dd..34a61b9c64 100644 --- a/Mage/src/mage/abilities/keyword/ShroudAbility.java +++ b/Mage/src/mage/abilities/keyword/ShroudAbility.java @@ -38,28 +38,28 @@ import mage.abilities.StaticAbility; */ public class ShroudAbility extends StaticAbility { - private static final ShroudAbility fINSTANCE = new ShroudAbility(); + private static final ShroudAbility fINSTANCE = new ShroudAbility(); - private Object readResolve() throws ObjectStreamException { - return fINSTANCE; - } + private Object readResolve() throws ObjectStreamException { + return fINSTANCE; + } - public static ShroudAbility getInstance() { - return fINSTANCE; - } + public static ShroudAbility getInstance() { + return fINSTANCE; + } - private ShroudAbility() { - super(Zone.BATTLEFIELD, null); - } + private ShroudAbility() { + super(Zone.BATTLEFIELD, null); + } - @Override - public String getRule() { - return "Shroud"; - } + @Override + public String getRule() { + return "Shroud"; + } - @Override - public ShroudAbility copy() { - return fINSTANCE; - } + @Override + public ShroudAbility copy() { + return fINSTANCE; + } } diff --git a/Mage/src/mage/abilities/keyword/SoulbondAbility.java b/Mage/src/mage/abilities/keyword/SoulbondAbility.java index dc5068add7..18b36a44ec 100644 --- a/Mage/src/mage/abilities/keyword/SoulbondAbility.java +++ b/Mage/src/mage/abilities/keyword/SoulbondAbility.java @@ -39,7 +39,7 @@ import java.io.ObjectStreamException; public class SoulbondAbility extends StaticAbility { private static final SoulbondAbility fINSTANCE = new SoulbondAbility(); - + private Object readResolve() throws ObjectStreamException { return fINSTANCE; } diff --git a/Mage/src/mage/abilities/keyword/SwampwalkAbility.java b/Mage/src/mage/abilities/keyword/SwampwalkAbility.java index 2c4f757c4b..792ff6fda5 100644 --- a/Mage/src/mage/abilities/keyword/SwampwalkAbility.java +++ b/Mage/src/mage/abilities/keyword/SwampwalkAbility.java @@ -37,23 +37,23 @@ import mage.filter.common.FilterLandPermanent; */ public class SwampwalkAbility extends LandwalkAbility { - private static final FilterLandPermanent filter = new FilterLandPermanent("Swamp"); + private static final FilterLandPermanent filter = new FilterLandPermanent("Swamp"); - static { - filter.getSubtype().add("Swamp"); - filter.setScopeSubtype(ComparisonScope.Any); - } + static { + filter.getSubtype().add("Swamp"); + filter.setScopeSubtype(ComparisonScope.Any); + } - public SwampwalkAbility() { - super(filter); - } + public SwampwalkAbility() { + super(filter); + } - public SwampwalkAbility(final SwampwalkAbility ability) { - super(ability); - } + public SwampwalkAbility(final SwampwalkAbility ability) { + super(ability); + } - @Override - public SwampwalkAbility copy() { - return new SwampwalkAbility(this); - } + @Override + public SwampwalkAbility copy() { + return new SwampwalkAbility(this); + } } \ No newline at end of file diff --git a/Mage/src/mage/abilities/keyword/TrampleAbility.java b/Mage/src/mage/abilities/keyword/TrampleAbility.java index 5b20819b3d..bd04b36182 100644 --- a/Mage/src/mage/abilities/keyword/TrampleAbility.java +++ b/Mage/src/mage/abilities/keyword/TrampleAbility.java @@ -38,28 +38,28 @@ import mage.abilities.StaticAbility; */ public class TrampleAbility extends StaticAbility { - private static final TrampleAbility fINSTANCE = new TrampleAbility(); + private static final TrampleAbility fINSTANCE = new TrampleAbility(); - private Object readResolve() throws ObjectStreamException { - return fINSTANCE; - } + private Object readResolve() throws ObjectStreamException { + return fINSTANCE; + } - public static TrampleAbility getInstance() { - return fINSTANCE; - } + public static TrampleAbility getInstance() { + return fINSTANCE; + } - private TrampleAbility() { - super(Zone.BATTLEFIELD, null); - } + private TrampleAbility() { + super(Zone.BATTLEFIELD, null); + } - @Override - public String getRule() { - return "Trample"; - } + @Override + public String getRule() { + return "Trample"; + } - @Override - public TrampleAbility copy() { - return fINSTANCE; - } + @Override + public TrampleAbility copy() { + return fINSTANCE; + } } \ No newline at end of file diff --git a/Mage/src/mage/abilities/keyword/TransformAbility.java b/Mage/src/mage/abilities/keyword/TransformAbility.java index 6d27dc4325..2dd275ca2b 100644 --- a/Mage/src/mage/abilities/keyword/TransformAbility.java +++ b/Mage/src/mage/abilities/keyword/TransformAbility.java @@ -63,7 +63,7 @@ public class TransformAbility extends SimpleStaticAbility { } public static void transform(Permanent permanent, Card sourceCard, Game game) { - + if (sourceCard == null) { return; } @@ -127,7 +127,7 @@ class TransformEffect extends ContinuousEffectImpl { if (card == null) { return false; } - + TransformAbility.transform(permanent, card, game); return true; diff --git a/Mage/src/mage/abilities/keyword/UnearthAbility.java b/Mage/src/mage/abilities/keyword/UnearthAbility.java index aa0c5d75d4..3636ae087f 100644 --- a/Mage/src/mage/abilities/keyword/UnearthAbility.java +++ b/Mage/src/mage/abilities/keyword/UnearthAbility.java @@ -52,102 +52,102 @@ import mage.game.events.ZoneChangeEvent; */ public class UnearthAbility extends ActivatedAbilityImpl { - protected boolean unearthed; + protected boolean unearthed; - public UnearthAbility(ManaCosts costs) { - super(Zone.GRAVEYARD, new ReturnSourceFromGraveyardToBattlefieldEffect(), costs); - this.timing = TimingRule.SORCERY; - this.addEffect(new GainAbilitySourceEffect(HasteAbility.getInstance(), Duration.WhileOnBattlefield)); - this.addEffect(new CreateDelayedTriggeredAbilityEffect(new UnearthDelayedTriggeredAbility())); - this.addEffect(new UnearthLeavesBattlefieldEffect()); - } + public UnearthAbility(ManaCosts costs) { + super(Zone.GRAVEYARD, new ReturnSourceFromGraveyardToBattlefieldEffect(), costs); + this.timing = TimingRule.SORCERY; + this.addEffect(new GainAbilitySourceEffect(HasteAbility.getInstance(), Duration.WhileOnBattlefield)); + this.addEffect(new CreateDelayedTriggeredAbilityEffect(new UnearthDelayedTriggeredAbility())); + this.addEffect(new UnearthLeavesBattlefieldEffect()); + } - public UnearthAbility(final UnearthAbility ability) { - super(ability); - this.unearthed = ability.unearthed; - } + public UnearthAbility(final UnearthAbility ability) { + super(ability); + this.unearthed = ability.unearthed; + } - @Override - public UnearthAbility copy() { - return new UnearthAbility(this); - } + @Override + public UnearthAbility copy() { + return new UnearthAbility(this); + } - public boolean isUnearthed() { - return unearthed; - } + public boolean isUnearthed() { + return unearthed; + } - @Override - public String getRule() { - return "Unearth " + super.getRule(); - } + @Override + public String getRule() { + return "Unearth " + super.getRule(); + } } class UnearthDelayedTriggeredAbility extends DelayedTriggeredAbility { - public UnearthDelayedTriggeredAbility() { - super(new ExileSourceEffect()); - } + public UnearthDelayedTriggeredAbility() { + super(new ExileSourceEffect()); + } - public UnearthDelayedTriggeredAbility(final UnearthDelayedTriggeredAbility ability) { - super(ability); - } + public UnearthDelayedTriggeredAbility(final UnearthDelayedTriggeredAbility ability) { + super(ability); + } - @Override - public UnearthDelayedTriggeredAbility copy() { - return new UnearthDelayedTriggeredAbility(this); - } + @Override + public UnearthDelayedTriggeredAbility copy() { + return new UnearthDelayedTriggeredAbility(this); + } - @Override - public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == EventType.END_TURN_STEP_PRE && event.getPlayerId().equals(this.controllerId)) { - return true; - } - return false; - } + @Override + public boolean checkTrigger(GameEvent event, Game game) { + if (event.getType() == EventType.END_TURN_STEP_PRE && event.getPlayerId().equals(this.controllerId)) { + return true; + } + return false; + } - @Override - public String getRule() { - return "Exile {this} at the beginning of the next end step"; - } + @Override + public String getRule() { + return "Exile {this} at the beginning of the next end step"; + } } class UnearthLeavesBattlefieldEffect extends ReplacementEffectImpl { - public UnearthLeavesBattlefieldEffect() { - super(Duration.WhileOnBattlefield, Outcome.Exile); - staticText = "When {this} leaves the battlefield, exile it"; - } + public UnearthLeavesBattlefieldEffect() { + super(Duration.WhileOnBattlefield, Outcome.Exile); + staticText = "When {this} leaves the battlefield, exile it"; + } - public UnearthLeavesBattlefieldEffect(final UnearthLeavesBattlefieldEffect effect) { - super(effect); - } + public UnearthLeavesBattlefieldEffect(final UnearthLeavesBattlefieldEffect effect) { + super(effect); + } - @Override - public UnearthLeavesBattlefieldEffect copy() { - return new UnearthLeavesBattlefieldEffect(this); - } + @Override + public UnearthLeavesBattlefieldEffect copy() { + return new UnearthLeavesBattlefieldEffect(this); + } - @Override - public boolean applies(GameEvent event, Ability source, Game game) { - if (event.getType() == EventType.ZONE_CHANGE && event.getTargetId().equals(source.getSourceId())) { - ZoneChangeEvent zEvent = (ZoneChangeEvent)event; - if (zEvent.getFromZone() == Zone.BATTLEFIELD && zEvent.getToZone() != Zone.EXILED) - return true; - } - return false; - } + @Override + public boolean applies(GameEvent event, Ability source, Game game) { + if (event.getType() == EventType.ZONE_CHANGE && event.getTargetId().equals(source.getSourceId())) { + ZoneChangeEvent zEvent = (ZoneChangeEvent)event; + if (zEvent.getFromZone() == Zone.BATTLEFIELD && zEvent.getToZone() != Zone.EXILED) + return true; + } + return false; + } - @Override - public boolean apply(Game game, Ability source) { - ExileSourceEffect effect = new ExileSourceEffect(); - return effect.apply(game, source); - } + @Override + public boolean apply(Game game, Ability source) { + ExileSourceEffect effect = new ExileSourceEffect(); + return effect.apply(game, source); + } - @Override - public boolean replaceEvent(GameEvent event, Ability source, Game game) { - return apply(game, source); - } + @Override + public boolean replaceEvent(GameEvent event, Ability source, Game game) { + return apply(game, source); + } } \ No newline at end of file diff --git a/Mage/src/mage/abilities/keyword/VigilanceAbility.java b/Mage/src/mage/abilities/keyword/VigilanceAbility.java index 8470b8ffa4..4a1020c516 100644 --- a/Mage/src/mage/abilities/keyword/VigilanceAbility.java +++ b/Mage/src/mage/abilities/keyword/VigilanceAbility.java @@ -38,28 +38,28 @@ import mage.abilities.StaticAbility; */ public class VigilanceAbility extends StaticAbility { - private static final VigilanceAbility fINSTANCE = new VigilanceAbility(); + private static final VigilanceAbility fINSTANCE = new VigilanceAbility(); - private Object readResolve() throws ObjectStreamException { - return fINSTANCE; - } + private Object readResolve() throws ObjectStreamException { + return fINSTANCE; + } - public static VigilanceAbility getInstance() { - return fINSTANCE; - } + public static VigilanceAbility getInstance() { + return fINSTANCE; + } - private VigilanceAbility() { - super(Zone.BATTLEFIELD, null); - } + private VigilanceAbility() { + super(Zone.BATTLEFIELD, null); + } - @Override - public String getRule() { - return "Vigilance"; - } + @Override + public String getRule() { + return "Vigilance"; + } - @Override - public VigilanceAbility copy() { - return fINSTANCE; - } + @Override + public VigilanceAbility copy() { + return fINSTANCE; + } } diff --git a/Mage/src/mage/abilities/keyword/WitherAbility.java b/Mage/src/mage/abilities/keyword/WitherAbility.java index 53d05434cf..053b432bfd 100644 --- a/Mage/src/mage/abilities/keyword/WitherAbility.java +++ b/Mage/src/mage/abilities/keyword/WitherAbility.java @@ -48,28 +48,28 @@ import java.io.ObjectStreamException; */ public class WitherAbility extends StaticAbility { - private static final WitherAbility fINSTANCE = new WitherAbility(); + private static final WitherAbility fINSTANCE = new WitherAbility(); - private Object readResolve() throws ObjectStreamException { - return fINSTANCE; - } + private Object readResolve() throws ObjectStreamException { + return fINSTANCE; + } - public static WitherAbility getInstance() { - return fINSTANCE; - } + public static WitherAbility getInstance() { + return fINSTANCE; + } - private WitherAbility() { - super(Zone.ALL, null); - } + private WitherAbility() { + super(Zone.ALL, null); + } - @Override - public String getRule() { - return "Wither"; - } + @Override + public String getRule() { + return "Wither"; + } - @Override - public WitherAbility copy() { - return fINSTANCE; - } + @Override + public WitherAbility copy() { + return fINSTANCE; + } } diff --git a/Mage/src/mage/abilities/mana/BasicManaAbility.java b/Mage/src/mage/abilities/mana/BasicManaAbility.java index f4ec6c6228..de90457779 100644 --- a/Mage/src/mage/abilities/mana/BasicManaAbility.java +++ b/Mage/src/mage/abilities/mana/BasicManaAbility.java @@ -38,12 +38,12 @@ import mage.abilities.effects.common.ManaEffect; */ public abstract class BasicManaAbility> extends ManaAbility { - public BasicManaAbility(ManaEffect effect) { - super(Zone.BATTLEFIELD, effect, new TapSourceCost()); - } + public BasicManaAbility(ManaEffect effect) { + super(Zone.BATTLEFIELD, effect, new TapSourceCost()); + } - public BasicManaAbility(BasicManaAbility ability) { - super(ability); - } + public BasicManaAbility(BasicManaAbility ability) { + super(ability); + } } diff --git a/Mage/src/mage/abilities/mana/BlackManaAbility.java b/Mage/src/mage/abilities/mana/BlackManaAbility.java index 954ded3934..f12fa2fe5a 100644 --- a/Mage/src/mage/abilities/mana/BlackManaAbility.java +++ b/Mage/src/mage/abilities/mana/BlackManaAbility.java @@ -37,18 +37,18 @@ import mage.abilities.effects.common.BasicManaEffect; */ public class BlackManaAbility extends BasicManaAbility { - public BlackManaAbility() { - super(new BasicManaEffect(Mana.BlackMana)); - this.netMana.setBlack(1); - } + public BlackManaAbility() { + super(new BasicManaEffect(Mana.BlackMana)); + this.netMana.setBlack(1); + } - public BlackManaAbility(BlackManaAbility ability) { - super(ability); - } + public BlackManaAbility(BlackManaAbility ability) { + super(ability); + } - @Override - public BlackManaAbility copy() { - return new BlackManaAbility(this); - } + @Override + public BlackManaAbility copy() { + return new BlackManaAbility(this); + } } diff --git a/Mage/src/mage/abilities/mana/BlueManaAbility.java b/Mage/src/mage/abilities/mana/BlueManaAbility.java index e4ca770bc4..0ad2ea24aa 100644 --- a/Mage/src/mage/abilities/mana/BlueManaAbility.java +++ b/Mage/src/mage/abilities/mana/BlueManaAbility.java @@ -37,18 +37,18 @@ import mage.abilities.effects.common.BasicManaEffect; */ public class BlueManaAbility extends BasicManaAbility { - public BlueManaAbility() { - super(new BasicManaEffect(Mana.BlueMana)); - this.netMana.setBlue(1); - } + public BlueManaAbility() { + super(new BasicManaEffect(Mana.BlueMana)); + this.netMana.setBlue(1); + } - public BlueManaAbility(BlueManaAbility ability) { - super(ability); - } + public BlueManaAbility(BlueManaAbility ability) { + super(ability); + } - @Override - public BlueManaAbility copy() { - return new BlueManaAbility(this); - } + @Override + public BlueManaAbility copy() { + return new BlueManaAbility(this); + } } diff --git a/Mage/src/mage/abilities/mana/ColorlessManaAbility.java b/Mage/src/mage/abilities/mana/ColorlessManaAbility.java index 86cd4d1ca9..54419a9a60 100644 --- a/Mage/src/mage/abilities/mana/ColorlessManaAbility.java +++ b/Mage/src/mage/abilities/mana/ColorlessManaAbility.java @@ -37,17 +37,17 @@ import mage.abilities.effects.common.BasicManaEffect; */ public class ColorlessManaAbility extends BasicManaAbility { - public ColorlessManaAbility() { - super(new BasicManaEffect(Mana.ColorlessMana)); - this.netMana.setColorless(1); - } + public ColorlessManaAbility() { + super(new BasicManaEffect(Mana.ColorlessMana)); + this.netMana.setColorless(1); + } - public ColorlessManaAbility(ColorlessManaAbility ability) { - super(ability); - } + public ColorlessManaAbility(ColorlessManaAbility ability) { + super(ability); + } - @Override - public ColorlessManaAbility copy() { - return new ColorlessManaAbility(this); - } + @Override + public ColorlessManaAbility copy() { + return new ColorlessManaAbility(this); + } } diff --git a/Mage/src/mage/abilities/mana/DynamicManaAbility.java b/Mage/src/mage/abilities/mana/DynamicManaAbility.java index 6caadc78db..482996001a 100644 --- a/Mage/src/mage/abilities/mana/DynamicManaAbility.java +++ b/Mage/src/mage/abilities/mana/DynamicManaAbility.java @@ -57,7 +57,7 @@ public class DynamicManaAbility extends ManaAbility { public DynamicManaAbility(final DynamicManaAbility ability) { super(ability); - manaEffect = ability.manaEffect; + manaEffect = ability.manaEffect; } @Override diff --git a/Mage/src/mage/abilities/mana/GreenManaAbility.java b/Mage/src/mage/abilities/mana/GreenManaAbility.java index 561a89518f..eaaf6628df 100644 --- a/Mage/src/mage/abilities/mana/GreenManaAbility.java +++ b/Mage/src/mage/abilities/mana/GreenManaAbility.java @@ -37,18 +37,18 @@ import mage.abilities.effects.common.BasicManaEffect; */ public class GreenManaAbility extends BasicManaAbility { - public GreenManaAbility() { - super(new BasicManaEffect(Mana.GreenMana)); - this.netMana.setGreen(1); - } + public GreenManaAbility() { + super(new BasicManaEffect(Mana.GreenMana)); + this.netMana.setGreen(1); + } - public GreenManaAbility(GreenManaAbility ability) { - super(ability); - } + public GreenManaAbility(GreenManaAbility ability) { + super(ability); + } - @Override - public GreenManaAbility copy() { - return new GreenManaAbility(this); - } + @Override + public GreenManaAbility copy() { + return new GreenManaAbility(this); + } } diff --git a/Mage/src/mage/abilities/mana/ManaAbility.java b/Mage/src/mage/abilities/mana/ManaAbility.java index ed2f781a6a..6c1590bbd0 100644 --- a/Mage/src/mage/abilities/mana/ManaAbility.java +++ b/Mage/src/mage/abilities/mana/ManaAbility.java @@ -44,32 +44,32 @@ import java.util.UUID; */ public abstract class ManaAbility> extends ActivatedAbilityImpl { - protected Mana netMana = new Mana(); + protected Mana netMana = new Mana(); - public ManaAbility(Zone zone, ManaEffect effect, Cost cost) { - super(AbilityType.MANA, zone); - this.usesStack = false; - if (effect != null) { - this.addEffect(effect); - } - if (cost != null) - this.addCost(cost); - } + public ManaAbility(Zone zone, ManaEffect effect, Cost cost) { + super(AbilityType.MANA, zone); + this.usesStack = false; + if (effect != null) { + this.addEffect(effect); + } + if (cost != null) + this.addCost(cost); + } - public ManaAbility(ManaAbility ability) { - super(ability); - this.netMana = ability.netMana.copy(); - } + public ManaAbility(ManaAbility ability) { + super(ability); + this.netMana = ability.netMana.copy(); + } - @Override - public boolean canActivate(UUID playerId, Game game) { - if (!controlsAbility(playerId, game)) - return false; - //20091005 - 605.3a - return costs.canPay(sourceId, controllerId, game); - } + @Override + public boolean canActivate(UUID playerId, Game game) { + if (!controlsAbility(playerId, game)) + return false; + //20091005 - 605.3a + return costs.canPay(sourceId, controllerId, game); + } - public Mana getNetMana(Game game) { - return netMana; - } + public Mana getNetMana(Game game) { + return netMana; + } } diff --git a/Mage/src/mage/abilities/mana/ManaOptions.java b/Mage/src/mage/abilities/mana/ManaOptions.java index 7994ef0f7b..b9ed490ea2 100644 --- a/Mage/src/mage/abilities/mana/ManaOptions.java +++ b/Mage/src/mage/abilities/mana/ManaOptions.java @@ -44,44 +44,44 @@ import mage.game.Game; */ public class ManaOptions extends ArrayList { - public ManaOptions () {}; + public ManaOptions () {}; - public ManaOptions(final ManaOptions options) { - for (Mana mana: options) { - this.add(mana.copy()); - } - } + public ManaOptions(final ManaOptions options) { + for (Mana mana: options) { + this.add(mana.copy()); + } + } - public void addMana(List abilities, Game game) { - if (isEmpty()) - this.add(new Mana()); - if (!abilities.isEmpty()) { - if (abilities.size() == 1) { - //if there is only one mana option available add it to all the existing options - addMana(abilities.get(0).getNetMana(game)); - } - else if (abilities.size() > 1) { - //perform a union of all existing options and the new options - List copy = copy(); - this.clear(); - for (ManaAbility ability: abilities) { - for (Mana mana: copy) { - Mana newMana = new Mana(); - newMana.add(mana); - newMana.add(ability.getNetMana(game)); - this.add(newMana); - } - } - } - } - } + public void addMana(List abilities, Game game) { + if (isEmpty()) + this.add(new Mana()); + if (!abilities.isEmpty()) { + if (abilities.size() == 1) { + //if there is only one mana option available add it to all the existing options + addMana(abilities.get(0).getNetMana(game)); + } + else if (abilities.size() > 1) { + //perform a union of all existing options and the new options + List copy = copy(); + this.clear(); + for (ManaAbility ability: abilities) { + for (Mana mana: copy) { + Mana newMana = new Mana(); + newMana.add(mana); + newMana.add(ability.getNetMana(game)); + this.add(newMana); + } + } + } + } + } - public void addManaWithCost(List abilities, Game game) { - if (isEmpty()) - this.add(new Mana()); - if (!abilities.isEmpty()) { - if (abilities.size() == 1) { - //if there is only one mana option available add it to all the existing options + public void addManaWithCost(List abilities, Game game) { + if (isEmpty()) + this.add(new Mana()); + if (!abilities.isEmpty()) { + if (abilities.size() == 1) { + //if there is only one mana option available add it to all the existing options ManaAbility ability = abilities.get(0); if (ability.getManaCosts().isEmpty()) { addMana(ability.getNetMana(game)); @@ -89,12 +89,12 @@ public class ManaOptions extends ArrayList { else { addMana(ability.getManaCosts().getMana(), ability.getNetMana(game)); } - } - else if (abilities.size() > 1) { - //perform a union of all existing options and the new options - List copy = copy(); - this.clear(); - for (ManaAbility ability: abilities) { + } + else if (abilities.size() > 1) { + //perform a union of all existing options and the new options + List copy = copy(); + this.clear(); + for (ManaAbility ability: abilities) { if (ability.getManaCosts().isEmpty()) { for (Mana mana: copy) { Mana newMana = new Mana(); @@ -114,56 +114,56 @@ public class ManaOptions extends ArrayList { this.add(newMana); } } - } - } - } - } - - public void addMana(Mana addMana) { - if (isEmpty()) - this.add(new Mana()); - for (Mana mana: this) { - mana.add(addMana); - } - } + } + } + } + } - public void addMana(ManaOptions options) { - if (isEmpty()) - this.add(new Mana()); - if (!options.isEmpty()) { - if (options.size() == 1) { - //if there is only one mana option available add it to all the existing options - addMana(options.get(0)); - } - else if (options.size() > 1) { - //perform a union of all existing options and the new options - List copy = copy(); - this.clear(); - for (Mana addMana: options) { - for (Mana mana: copy) { - Mana newMana = new Mana(); - newMana.add(mana); - newMana.add(addMana); - this.add(newMana); - } - } - } - } - } + public void addMana(Mana addMana) { + if (isEmpty()) + this.add(new Mana()); + for (Mana mana: this) { + mana.add(addMana); + } + } - public ManaOptions copy() { - return new ManaOptions(this); - } + public void addMana(ManaOptions options) { + if (isEmpty()) + this.add(new Mana()); + if (!options.isEmpty()) { + if (options.size() == 1) { + //if there is only one mana option available add it to all the existing options + addMana(options.get(0)); + } + else if (options.size() > 1) { + //perform a union of all existing options and the new options + List copy = copy(); + this.clear(); + for (Mana addMana: options) { + for (Mana mana: copy) { + Mana newMana = new Mana(); + newMana.add(mana); + newMana.add(addMana); + this.add(newMana); + } + } + } + } + } - public void addMana(Mana cost, Mana addMana) { - if (isEmpty()) - this.add(new Mana()); - for (Mana mana: this) { + public ManaOptions copy() { + return new ManaOptions(this); + } + + public void addMana(Mana cost, Mana addMana) { + if (isEmpty()) + this.add(new Mana()); + for (Mana mana: this) { if (mana.contains(cost)) { mana.subtract(cost); mana.add(addMana); } - } - } + } + } } \ No newline at end of file diff --git a/Mage/src/mage/abilities/mana/RedManaAbility.java b/Mage/src/mage/abilities/mana/RedManaAbility.java index f85f5c464b..ed0e5fa818 100644 --- a/Mage/src/mage/abilities/mana/RedManaAbility.java +++ b/Mage/src/mage/abilities/mana/RedManaAbility.java @@ -37,18 +37,18 @@ import mage.abilities.effects.common.BasicManaEffect; */ public class RedManaAbility extends BasicManaAbility { - public RedManaAbility() { - super(new BasicManaEffect(Mana.RedMana)); - this.netMana.setRed(1); - } + public RedManaAbility() { + super(new BasicManaEffect(Mana.RedMana)); + this.netMana.setRed(1); + } - public RedManaAbility(RedManaAbility ability) { - super(ability); - } + public RedManaAbility(RedManaAbility ability) { + super(ability); + } - @Override - public RedManaAbility copy() { - return new RedManaAbility(this); - } + @Override + public RedManaAbility copy() { + return new RedManaAbility(this); + } } diff --git a/Mage/src/mage/abilities/mana/SimpleManaAbility.java b/Mage/src/mage/abilities/mana/SimpleManaAbility.java index 173109a5b8..8792c5a50d 100644 --- a/Mage/src/mage/abilities/mana/SimpleManaAbility.java +++ b/Mage/src/mage/abilities/mana/SimpleManaAbility.java @@ -38,17 +38,17 @@ import mage.abilities.effects.common.ManaEffect; */ public class SimpleManaAbility extends ManaAbility { - public SimpleManaAbility(Zone zone, ManaEffect effect, Cost cost) { - super(zone, effect, cost); - } + public SimpleManaAbility(Zone zone, ManaEffect effect, Cost cost) { + super(zone, effect, cost); + } - public SimpleManaAbility(final SimpleManaAbility ability) { - super(ability); - } + public SimpleManaAbility(final SimpleManaAbility ability) { + super(ability); + } - @Override - public SimpleManaAbility copy() { - return new SimpleManaAbility(this); - } + @Override + public SimpleManaAbility copy() { + return new SimpleManaAbility(this); + } } diff --git a/Mage/src/mage/abilities/mana/TriggeredManaAbility.java b/Mage/src/mage/abilities/mana/TriggeredManaAbility.java index 5decbdb99e..c4293e0b34 100644 --- a/Mage/src/mage/abilities/mana/TriggeredManaAbility.java +++ b/Mage/src/mage/abilities/mana/TriggeredManaAbility.java @@ -36,11 +36,11 @@ import mage.abilities.effects.common.ManaEffect; * @author BetaSteward_at_googlemail.com */ public abstract class TriggeredManaAbility> extends TriggeredAbilityImpl { - + public TriggeredManaAbility(Zone zone, ManaEffect effect) { super(zone, effect); } - + public TriggeredManaAbility(final TriggeredManaAbility ability) { super(ability); } diff --git a/Mage/src/mage/abilities/mana/WhiteManaAbility.java b/Mage/src/mage/abilities/mana/WhiteManaAbility.java index 2d981d722b..6116959bfb 100644 --- a/Mage/src/mage/abilities/mana/WhiteManaAbility.java +++ b/Mage/src/mage/abilities/mana/WhiteManaAbility.java @@ -37,18 +37,18 @@ import mage.abilities.effects.common.BasicManaEffect; */ public class WhiteManaAbility extends BasicManaAbility { - public WhiteManaAbility() { - super(new BasicManaEffect(Mana.WhiteMana)); - this.netMana.setWhite(1); - } + public WhiteManaAbility() { + super(new BasicManaEffect(Mana.WhiteMana)); + this.netMana.setWhite(1); + } - public WhiteManaAbility(WhiteManaAbility ability) { - super(ability); - } + public WhiteManaAbility(WhiteManaAbility ability) { + super(ability); + } - @Override - public WhiteManaAbility copy() { - return new WhiteManaAbility(this); - } + @Override + public WhiteManaAbility copy() { + return new WhiteManaAbility(this); + } } diff --git a/Mage/src/mage/abilities/mana/builder/ConditionalManaBuilder.java b/Mage/src/mage/abilities/mana/builder/ConditionalManaBuilder.java index 9c22335be0..c9495dc18a 100644 --- a/Mage/src/mage/abilities/mana/builder/ConditionalManaBuilder.java +++ b/Mage/src/mage/abilities/mana/builder/ConditionalManaBuilder.java @@ -36,11 +36,11 @@ import mage.Mana; public abstract class ConditionalManaBuilder implements Builder { protected Mana mana; - + public ConditionalManaBuilder setMana(Mana mana) { this.mana = mana; return this; } - + public abstract String getRule(); } diff --git a/Mage/src/mage/abilities/mana/conditional/ManaCondition.java b/Mage/src/mage/abilities/mana/conditional/ManaCondition.java index 4841e7c912..468c9769a7 100644 --- a/Mage/src/mage/abilities/mana/conditional/ManaCondition.java +++ b/Mage/src/mage/abilities/mana/conditional/ManaCondition.java @@ -41,6 +41,6 @@ public abstract class ManaCondition implements Condition { public boolean apply(Game game, Ability source) { return false; } - + public abstract boolean apply(Game game, Ability source, UUID originalId); } \ No newline at end of file diff --git a/Mage/src/mage/cards/Card.java b/Mage/src/mage/cards/Card.java index f143144949..ddc4dc9b9e 100644 --- a/Mage/src/mage/cards/Card.java +++ b/Mage/src/mage/cards/Card.java @@ -42,33 +42,33 @@ import java.util.UUID; public interface Card extends MageObject { - public UUID getOwnerId(); - public int getCardNumber(); + public UUID getOwnerId(); + public int getCardNumber(); public void setCardNumber(int cid); - public Rarity getRarity(); - public void setRarity(Rarity rarity); - public void setControllerId(UUID controllerId); - public void setOwnerId(UUID ownerId); - public void addAbility(Ability ability); - public void addWatcher(Watcher watcher); - public SpellAbility getSpellAbility(); - public List getRules(); - public List getWatchers(); - public String getExpansionSetCode(); - public void setExpansionSetCode(String expansionSetCode); - public void setFaceDown(boolean value); - public boolean isFaceDown(); + public Rarity getRarity(); + public void setRarity(Rarity rarity); + public void setControllerId(UUID controllerId); + public void setOwnerId(UUID ownerId); + public void addAbility(Ability ability); + public void addWatcher(Watcher watcher); + public SpellAbility getSpellAbility(); + public List getRules(); + public List getWatchers(); + public String getExpansionSetCode(); + public void setExpansionSetCode(String expansionSetCode); + public void setFaceDown(boolean value); + public boolean isFaceDown(); public boolean isFlipCard(); - public boolean canTransform(); - public Card getSecondCardFace(); + public boolean canTransform(); + public Card getSecondCardFace(); public void setSecondCardFace(Card card); - public boolean isNightCard(); + public boolean isNightCard(); - public void assignNewId(); + public void assignNewId(); public int getZoneChangeCounter(); - + public void addInfo(String key, String value); /** @@ -84,7 +84,7 @@ public interface Card extends MageObject { * * @return true if card was moved to zone */ - public boolean moveToZone(Zone zone, UUID sourceId, Game game, boolean flag); + public boolean moveToZone(Zone zone, UUID sourceId, Game game, boolean flag); /** * Moves the card to an exile zone @@ -94,11 +94,11 @@ public interface Card extends MageObject { * @param game * @return true if card was moved to zone */ - public boolean moveToExile(UUID exileId, String name, UUID sourceId, Game game); - public boolean cast(Game game, Zone fromZone, SpellAbility ability, UUID controllerId); - public boolean putOntoBattlefield(Game game, Zone fromZone, UUID sourceId, UUID controllerId); - public List getMana(); + public boolean moveToExile(UUID exileId, String name, UUID sourceId, Game game); + public boolean cast(Game game, Zone fromZone, SpellAbility ability, UUID controllerId); + public boolean putOntoBattlefield(Game game, Zone fromZone, UUID sourceId, UUID controllerId); + public List getMana(); - @Override - public Card copy(); + @Override + public Card copy(); } diff --git a/Mage/src/mage/cards/CardImpl.java b/Mage/src/mage/cards/CardImpl.java index c93f16cfc0..7786365bb9 100644 --- a/Mage/src/mage/cards/CardImpl.java +++ b/Mage/src/mage/cards/CardImpl.java @@ -105,7 +105,7 @@ public abstract class CardImpl> extends MageObjectImpl secondSideCard = card.secondSideCard; nightCard = card.nightCard; } - + if (card.info != null) { info = new HashMap(); info.putAll(card.info); @@ -204,7 +204,7 @@ public abstract class CardImpl> extends MageObjectImpl public List getWatchers() { return watchers; } - + @Override public String getExpansionSetCode() { return expansionSetCode; diff --git a/Mage/src/mage/cards/Cards.java b/Mage/src/mage/cards/Cards.java index 96c6b76cf5..7edfb78569 100644 --- a/Mage/src/mage/cards/Cards.java +++ b/Mage/src/mage/cards/Cards.java @@ -38,17 +38,17 @@ import mage.game.Game; public interface Cards extends Set, Serializable { - public void add(Card card); - public Card get(UUID cardId, Game game); - public void remove(Card card); - public void setOwner(UUID ownerId, Game game); - public void addAll(List createCards); - public Set getCards(Game game); - public Set getCards(FilterCard filter, Game game); - public Collection getUniqueCards(Game game); - public Card getRandom(Game game); - public int count(FilterCard filter, Game game); - public int count(FilterCard filter, UUID playerId, Game game); + public void add(Card card); + public Card get(UUID cardId, Game game); + public void remove(Card card); + public void setOwner(UUID ownerId, Game game); + public void addAll(List createCards); + public Set getCards(Game game); + public Set getCards(FilterCard filter, Game game); + public Collection getUniqueCards(Game game); + public Card getRandom(Game game); + public int count(FilterCard filter, Game game); + public int count(FilterCard filter, UUID playerId, Game game); - public Cards copy(); + public Cards copy(); } diff --git a/Mage/src/mage/cards/CardsImpl.java b/Mage/src/mage/cards/CardsImpl.java index 61c7b94316..81aae08395 100644 --- a/Mage/src/mage/cards/CardsImpl.java +++ b/Mage/src/mage/cards/CardsImpl.java @@ -41,130 +41,130 @@ import java.util.*; */ public class CardsImpl extends LinkedHashSet implements Cards, Serializable { - private static Random rnd = new Random(); - private UUID ownerId; - private Zone zone; + private static Random rnd = new Random(); + private UUID ownerId; + private Zone zone; - public CardsImpl() { } + public CardsImpl() { } public CardsImpl(Card card) { this.add(card.getId()); } - public CardsImpl(Zone zone) { - this.zone = zone; - } + public CardsImpl(Zone zone) { + this.zone = zone; + } - public CardsImpl(Zone zone, List cards) { - this(zone); - for (Card card: cards) { - this.add(card.getId()); - } - } + public CardsImpl(Zone zone, List cards) { + this(zone); + for (Card card: cards) { + this.add(card.getId()); + } + } - public CardsImpl(final CardsImpl cards) { + public CardsImpl(final CardsImpl cards) { this.addAll(cards); - this.ownerId = cards.ownerId; - this.zone = cards.zone; - } + this.ownerId = cards.ownerId; + this.zone = cards.zone; + } - @Override - public Cards copy() { - return new CardsImpl(this); - } + @Override + public Cards copy() { + return new CardsImpl(this); + } - @Override - public void add(Card card) { - this.add(card.getId()); - } + @Override + public void add(Card card) { + this.add(card.getId()); + } - @Override - public Card get(UUID cardId, Game game) { - if (this.contains(cardId)) - return game.getCard(cardId); - return null; - } + @Override + public Card get(UUID cardId, Game game) { + if (this.contains(cardId)) + return game.getCard(cardId); + return null; + } - @Override - public void remove(Card card) { - if (card == null) - return; - this.remove(card.getId()); - } + @Override + public void remove(Card card) { + if (card == null) + return; + this.remove(card.getId()); + } - @Override - public void setOwner(UUID ownerId, Game game) { - this.ownerId = ownerId; - for (UUID card: this) { - game.getCard(card).setOwnerId(ownerId); - } - } + @Override + public void setOwner(UUID ownerId, Game game) { + this.ownerId = ownerId; + for (UUID card: this) { + game.getCard(card).setOwnerId(ownerId); + } + } - @Override - public Card getRandom(Game game) { + @Override + public Card getRandom(Game game) { if (this.size() == 0) return null; - UUID[] cards = this.toArray(new UUID[0]); - return game.getCard(cards[rnd.nextInt(cards.length)]); - } + UUID[] cards = this.toArray(new UUID[0]); + return game.getCard(cards[rnd.nextInt(cards.length)]); + } - @Override - public int count(FilterCard filter, Game game) { - int result = 0; - for (UUID card: this) { - if (filter.match(game.getCard(card), game)) - result++; - } - return result; - } + @Override + public int count(FilterCard filter, Game game) { + int result = 0; + for (UUID card: this) { + if (filter.match(game.getCard(card), game)) + result++; + } + return result; + } - @Override - public int count(FilterCard filter, UUID playerId, Game game) { - int result = 0; - for (UUID card: this) { - if (filter.match(game.getCard(card), playerId, game)) - result++; - } - return result; - } + @Override + public int count(FilterCard filter, UUID playerId, Game game) { + int result = 0; + for (UUID card: this) { + if (filter.match(game.getCard(card), playerId, game)) + result++; + } + return result; + } - @Override - public Set getCards(FilterCard filter, Game game) { - Set cards = new LinkedHashSet(); - for (UUID card: this) { - boolean match = filter.match(game.getCard(card), game); - if (match) - cards.add(game.getCard(card)); - } - return cards; - } + @Override + public Set getCards(FilterCard filter, Game game) { + Set cards = new LinkedHashSet(); + for (UUID card: this) { + boolean match = filter.match(game.getCard(card), game); + if (match) + cards.add(game.getCard(card)); + } + return cards; + } - @Override - public Set getCards(Game game) { - Set cards = new LinkedHashSet(); - for (UUID card: this) { - cards.add(game.getCard(card)); - } - return cards; - } + @Override + public Set getCards(Game game) { + Set cards = new LinkedHashSet(); + for (UUID card: this) { + cards.add(game.getCard(card)); + } + return cards; + } - @Override - public void addAll(List cards) { - for (Card card: cards) { - add(card.getId()); - } - } + @Override + public void addAll(List cards) { + for (Card card: cards) { + add(card.getId()); + } + } - @Override - public Collection getUniqueCards(Game game) { - Map cards = new HashMap(); - for(UUID cardId: this) { + @Override + public Collection getUniqueCards(Game game) { + Map cards = new HashMap(); + for(UUID cardId: this) { Card card = game.getCard(cardId); - if (!cards.containsKey(card.getName())) { - cards.put(card.getName(), card); - } - } - return cards.values(); - } + if (!cards.containsKey(card.getName())) { + cards.put(card.getName(), card); + } + } + return cards.values(); + } } diff --git a/Mage/src/mage/cards/LevelerCard.java b/Mage/src/mage/cards/LevelerCard.java index 9ae49d502b..7e2e4fbbba 100644 --- a/Mage/src/mage/cards/LevelerCard.java +++ b/Mage/src/mage/cards/LevelerCard.java @@ -40,14 +40,14 @@ import java.util.UUID; public abstract class LevelerCard> extends CardImpl { private int maxLevelCounters; - - public LevelerCard(UUID ownerId, int cardNumber, String name, Rarity rarity, CardType[] cardTypes, String costs) { - super(ownerId, cardNumber, name, rarity, cardTypes, costs); - } - public LevelerCard(LevelerCard card) { - super(card); - } + public LevelerCard(UUID ownerId, int cardNumber, String name, Rarity rarity, CardType[] cardTypes, String costs) { + super(ownerId, cardNumber, name, rarity, cardTypes, costs); + } + + public LevelerCard(LevelerCard card) { + super(card); + } public int getMaxLevelCounters() { return maxLevelCounters; diff --git a/Mage/src/mage/cards/basiclands/BasicLand.java b/Mage/src/mage/cards/basiclands/BasicLand.java index bf07bd1c46..793d1db668 100644 --- a/Mage/src/mage/cards/basiclands/BasicLand.java +++ b/Mage/src/mage/cards/basiclands/BasicLand.java @@ -40,15 +40,15 @@ import mage.cards.CardImpl; */ public abstract class BasicLand> extends CardImpl { - public BasicLand(UUID ownerId, int cardNumber, String name, ManaAbility mana) { - super(ownerId, cardNumber, name, Rarity.LAND, new CardType[]{CardType.LAND}, null); - this.supertype.add("Basic"); - this.subtype.add(name); - this.addAbility(mana); - } + public BasicLand(UUID ownerId, int cardNumber, String name, ManaAbility mana) { + super(ownerId, cardNumber, name, Rarity.LAND, new CardType[]{CardType.LAND}, null); + this.supertype.add("Basic"); + this.subtype.add(name); + this.addAbility(mana); + } + + public BasicLand(BasicLand land) { + super(land); + } - public BasicLand(BasicLand land) { - super(land); - } - } diff --git a/Mage/src/mage/cards/basiclands/Forest.java b/Mage/src/mage/cards/basiclands/Forest.java index ead4d6a4e3..e009698999 100644 --- a/Mage/src/mage/cards/basiclands/Forest.java +++ b/Mage/src/mage/cards/basiclands/Forest.java @@ -37,12 +37,12 @@ import mage.abilities.mana.GreenManaAbility; */ public abstract class Forest extends BasicLand { - public Forest(UUID ownerId, int cardNumber) { - super(ownerId, cardNumber, "Forest", new GreenManaAbility()); - } + public Forest(UUID ownerId, int cardNumber) { + super(ownerId, cardNumber, "Forest", new GreenManaAbility()); + } - public Forest(final Forest land) { - super(land); - } + public Forest(final Forest land) { + super(land); + } } diff --git a/Mage/src/mage/cards/basiclands/Island.java b/Mage/src/mage/cards/basiclands/Island.java index 19b724038b..80f62388d5 100644 --- a/Mage/src/mage/cards/basiclands/Island.java +++ b/Mage/src/mage/cards/basiclands/Island.java @@ -37,12 +37,12 @@ import mage.abilities.mana.BlueManaAbility; */ public abstract class Island extends BasicLand { - public Island(UUID ownerId, int cardNumber) { - super(ownerId, cardNumber, "Island", new BlueManaAbility()); - } + public Island(UUID ownerId, int cardNumber) { + super(ownerId, cardNumber, "Island", new BlueManaAbility()); + } - public Island(Island land) { - super(land); - } + public Island(Island land) { + super(land); + } } diff --git a/Mage/src/mage/cards/basiclands/Mountain.java b/Mage/src/mage/cards/basiclands/Mountain.java index a443b88af5..7ed61d046a 100644 --- a/Mage/src/mage/cards/basiclands/Mountain.java +++ b/Mage/src/mage/cards/basiclands/Mountain.java @@ -37,12 +37,12 @@ import mage.abilities.mana.RedManaAbility; */ public abstract class Mountain extends BasicLand { - public Mountain(UUID ownerId, int cardNumber) { - super(ownerId, cardNumber, "Mountain", new RedManaAbility()); - } + public Mountain(UUID ownerId, int cardNumber) { + super(ownerId, cardNumber, "Mountain", new RedManaAbility()); + } - public Mountain(Mountain land) { - super(land); - } + public Mountain(Mountain land) { + super(land); + } } diff --git a/Mage/src/mage/cards/basiclands/Plains.java b/Mage/src/mage/cards/basiclands/Plains.java index 8585444f2c..7a8d9bc517 100644 --- a/Mage/src/mage/cards/basiclands/Plains.java +++ b/Mage/src/mage/cards/basiclands/Plains.java @@ -37,12 +37,12 @@ import mage.abilities.mana.WhiteManaAbility; */ public abstract class Plains extends BasicLand { - public Plains(UUID ownerId, int cardNumber) { - super(ownerId, cardNumber, "Plains", new WhiteManaAbility()); - } + public Plains(UUID ownerId, int cardNumber) { + super(ownerId, cardNumber, "Plains", new WhiteManaAbility()); + } - public Plains(Plains land) { - super(land); - } + public Plains(Plains land) { + super(land); + } } diff --git a/Mage/src/mage/cards/basiclands/Swamp.java b/Mage/src/mage/cards/basiclands/Swamp.java index c2166b7550..f1df4fbd7f 100644 --- a/Mage/src/mage/cards/basiclands/Swamp.java +++ b/Mage/src/mage/cards/basiclands/Swamp.java @@ -37,12 +37,12 @@ import mage.abilities.mana.BlackManaAbility; */ public abstract class Swamp extends BasicLand { - public Swamp(UUID ownerId, int cardNumber) { - super(ownerId, cardNumber, "Swamp", new BlackManaAbility()); - } + public Swamp(UUID ownerId, int cardNumber) { + super(ownerId, cardNumber, "Swamp", new BlackManaAbility()); + } - public Swamp(Swamp land) { - super(land); - } + public Swamp(Swamp land) { + super(land); + } } diff --git a/Mage/src/mage/cards/decks/Constructed.java b/Mage/src/mage/cards/decks/Constructed.java index 91b9e7d795..afa71832c5 100644 --- a/Mage/src/mage/cards/decks/Constructed.java +++ b/Mage/src/mage/cards/decks/Constructed.java @@ -42,80 +42,80 @@ import mage.cards.Card; */ public class Constructed extends DeckValidatorImpl { - protected List banned = new ArrayList(); - protected List restricted = new ArrayList(); - protected List setCodes = new ArrayList(); + protected List banned = new ArrayList(); + protected List restricted = new ArrayList(); + protected List setCodes = new ArrayList(); - public Constructed() { - super("Constructed"); - } + public Constructed() { + super("Constructed"); + } - protected Constructed(String name) { - super(name); - } + protected Constructed(String name) { + super(name); + } - @Override - public boolean validate(Deck deck) { - boolean valid = true; - //20091005 - 100.2a - if (deck.getCards().size() < 60) { - invalid.put("Deck", "Must contain at least 60 cards: has only " + deck.getCards().size() + " cards"); - valid = false; - } - //20091005 - 100.4a - if (!deck.getSideboard().isEmpty() && deck.getSideboard().size() != 15) { - invalid.put("Sideboard", "Must have 0 or 15 cards: has " + deck.getSideboard().size() + " cards"); - valid = false; - } + @Override + public boolean validate(Deck deck) { + boolean valid = true; + //20091005 - 100.2a + if (deck.getCards().size() < 60) { + invalid.put("Deck", "Must contain at least 60 cards: has only " + deck.getCards().size() + " cards"); + valid = false; + } + //20091005 - 100.4a + if (!deck.getSideboard().isEmpty() && deck.getSideboard().size() != 15) { + invalid.put("Sideboard", "Must have 0 or 15 cards: has " + deck.getSideboard().size() + " cards"); + valid = false; + } - List basicLandNames = new ArrayList(Arrays.asList("Forest", "Island", "Mountain", "Swamp", "Plains")); - Map counts = new HashMap(); - countCards(counts, deck.getCards()); - countCards(counts, deck.getSideboard()); - for (Entry entry: counts.entrySet()) { - if (entry.getValue() > 4) { - if (!basicLandNames.contains(entry.getKey()) && !entry.getKey().equals("Relentless Rats")) { - invalid.put(entry.getKey(), "Too many: " + entry.getValue()); - valid = false; - } - } - } - for (String bannedCard: banned) { - if (counts.containsKey(bannedCard)) { - invalid.put(bannedCard, "Banned"); - valid = false; - } - } + List basicLandNames = new ArrayList(Arrays.asList("Forest", "Island", "Mountain", "Swamp", "Plains")); + Map counts = new HashMap(); + countCards(counts, deck.getCards()); + countCards(counts, deck.getSideboard()); + for (Entry entry: counts.entrySet()) { + if (entry.getValue() > 4) { + if (!basicLandNames.contains(entry.getKey()) && !entry.getKey().equals("Relentless Rats")) { + invalid.put(entry.getKey(), "Too many: " + entry.getValue()); + valid = false; + } + } + } + for (String bannedCard: banned) { + if (counts.containsKey(bannedCard)) { + invalid.put(bannedCard, "Banned"); + valid = false; + } + } - for (String restrictedCard: restricted) { - if (counts.containsKey(restrictedCard)) { - int count = counts.get(restrictedCard); - if (count > 1) { - invalid.put(restrictedCard, "Restricted: " + count); - valid = false; - } - } - } - if (!setCodes.isEmpty()) { - for (Card card: deck.getCards()) { - if (!setCodes.contains(card.getExpansionSetCode())) { - if (!invalid.containsKey(card.getName())) { - invalid.put(card.getName(), "Invalid set: " + card.getExpansionSetCode()); - valid = false; - } - } - } - for (Card card: deck.getSideboard()) { - if (!setCodes.contains(card.getExpansionSetCode())) { - if (!invalid.containsKey(card.getName())) { - invalid.put(card.getName(), "Invalid set: " + card.getExpansionSetCode()); - valid = false; - } - } - } - } + for (String restrictedCard: restricted) { + if (counts.containsKey(restrictedCard)) { + int count = counts.get(restrictedCard); + if (count > 1) { + invalid.put(restrictedCard, "Restricted: " + count); + valid = false; + } + } + } + if (!setCodes.isEmpty()) { + for (Card card: deck.getCards()) { + if (!setCodes.contains(card.getExpansionSetCode())) { + if (!invalid.containsKey(card.getName())) { + invalid.put(card.getName(), "Invalid set: " + card.getExpansionSetCode()); + valid = false; + } + } + } + for (Card card: deck.getSideboard()) { + if (!setCodes.contains(card.getExpansionSetCode())) { + if (!invalid.containsKey(card.getName())) { + invalid.put(card.getName(), "Invalid set: " + card.getExpansionSetCode()); + valid = false; + } + } + } + } - return valid; - } + return valid; + } } diff --git a/Mage/src/mage/cards/decks/Deck.java b/Mage/src/mage/cards/decks/Deck.java index 7332352a18..fb9578273e 100644 --- a/Mage/src/mage/cards/decks/Deck.java +++ b/Mage/src/mage/cards/decks/Deck.java @@ -36,78 +36,78 @@ import mage.game.GameException; public class Deck implements Serializable { - private String name; - private Set cards = new LinkedHashSet(); - private Set sideboard = new LinkedHashSet(); + private String name; + private Set cards = new LinkedHashSet(); + private Set sideboard = new LinkedHashSet(); - public static Deck load(DeckCardLists deckCardLists) throws GameException { - return Deck.load(deckCardLists, false); - } + public static Deck load(DeckCardLists deckCardLists) throws GameException { + return Deck.load(deckCardLists, false); + } - public static Deck load(DeckCardLists deckCardLists, boolean ignoreErrors) throws GameException { - Deck deck = new Deck(); - deck.setName(deckCardLists.getName()); - for (String cardName: deckCardLists.getCards()) { - Card card = CardImpl.createCard(cardName); - if (card != null) - deck.cards.add(CardImpl.createCard(cardName)); - else { - if (!ignoreErrors) - throw new GameException("Error loading card - " + cardName + " for deck - " + deck.getName()); - } - } - for (String cardName: deckCardLists.getSideboard()) { - Card card = CardImpl.createCard(cardName); - if (card != null) - deck.sideboard.add(CardImpl.createCard(cardName)); - else { - if (!ignoreErrors) - throw new GameException("Error loading card - " + cardName + " for deck - " + deck.getName()); - } - } + public static Deck load(DeckCardLists deckCardLists, boolean ignoreErrors) throws GameException { + Deck deck = new Deck(); + deck.setName(deckCardLists.getName()); + for (String cardName: deckCardLists.getCards()) { + Card card = CardImpl.createCard(cardName); + if (card != null) + deck.cards.add(CardImpl.createCard(cardName)); + else { + if (!ignoreErrors) + throw new GameException("Error loading card - " + cardName + " for deck - " + deck.getName()); + } + } + for (String cardName: deckCardLists.getSideboard()) { + Card card = CardImpl.createCard(cardName); + if (card != null) + deck.sideboard.add(CardImpl.createCard(cardName)); + else { + if (!ignoreErrors) + throw new GameException("Error loading card - " + cardName + " for deck - " + deck.getName()); + } + } - return deck; - } + return deck; + } - public DeckCardLists getDeckCardLists() { - DeckCardLists deckCardLists = new DeckCardLists(); + public DeckCardLists getDeckCardLists() { + DeckCardLists deckCardLists = new DeckCardLists(); - deckCardLists.setName(name); - for (Card card: cards) { - deckCardLists.getCards().add(card.getClass().getCanonicalName()); - } - for (Card card: sideboard) { - deckCardLists.getSideboard().add(card.getClass().getCanonicalName()); - } - - return deckCardLists; - } + deckCardLists.setName(name); + for (Card card: cards) { + deckCardLists.getCards().add(card.getClass().getCanonicalName()); + } + for (Card card: sideboard) { + deckCardLists.getSideboard().add(card.getClass().getCanonicalName()); + } - /** - * @return the name - */ - public String getName() { - return name; - } + return deckCardLists; + } - /** - * @param name the name to set - */ - public void setName(String name) { - this.name = name; - } + /** + * @return the name + */ + public String getName() { + return name; + } - /** - * @return the cards - */ - public Set getCards() { - return cards; - } + /** + * @param name the name to set + */ + public void setName(String name) { + this.name = name; + } - /** - * @return the sideboard - */ - public Set getSideboard() { - return sideboard; - } + /** + * @return the cards + */ + public Set getCards() { + return cards; + } + + /** + * @return the sideboard + */ + public Set getSideboard() { + return sideboard; + } } diff --git a/Mage/src/mage/cards/decks/DeckCardLists.java b/Mage/src/mage/cards/decks/DeckCardLists.java index d4153b2514..e07f55d3f8 100644 --- a/Mage/src/mage/cards/decks/DeckCardLists.java +++ b/Mage/src/mage/cards/decks/DeckCardLists.java @@ -38,52 +38,52 @@ import java.util.List; */ public class DeckCardLists implements Serializable { - private String name; - private String author; - private List cards = new ArrayList(); - private List sideboard = new ArrayList(); + private String name; + private String author; + private List cards = new ArrayList(); + private List sideboard = new ArrayList(); - /** - * @return the cards - */ - public List getCards() { - return cards; - } + /** + * @return the cards + */ + public List getCards() { + return cards; + } - /** - * @param cards the cards to set - */ - public void setCards(List cards) { - this.cards = cards; - } + /** + * @param cards the cards to set + */ + public void setCards(List cards) { + this.cards = cards; + } - /** - * @return the sideboard - */ - public List getSideboard() { - return sideboard; - } + /** + * @return the sideboard + */ + public List getSideboard() { + return sideboard; + } - /** - * @param sideboard the sideboard to set - */ - public void setSideboard(List sideboard) { - this.sideboard = sideboard; - } + /** + * @param sideboard the sideboard to set + */ + public void setSideboard(List sideboard) { + this.sideboard = sideboard; + } - public String getName() { - return name; - } + public String getName() { + return name; + } - public void setName(String name) { - this.name = name; - } + public void setName(String name) { + this.name = name; + } - public String getAuthor() { - return author; - } + public String getAuthor() { + return author; + } - public void setAuthor(String author) { - this.author = author; - } + public void setAuthor(String author) { + this.author = author; + } } diff --git a/Mage/src/mage/cards/decks/DeckValidator.java b/Mage/src/mage/cards/decks/DeckValidator.java index c450583f41..f66d05f67a 100644 --- a/Mage/src/mage/cards/decks/DeckValidator.java +++ b/Mage/src/mage/cards/decks/DeckValidator.java @@ -37,8 +37,8 @@ import java.util.Map; */ public interface DeckValidator extends Serializable { - public String getName(); - public boolean validate(Deck deck); - public Map getInvalid(); - + public String getName(); + public boolean validate(Deck deck); + public Map getInvalid(); + } diff --git a/Mage/src/mage/cards/decks/DeckValidatorImpl.java b/Mage/src/mage/cards/decks/DeckValidatorImpl.java index 76d31d32b7..9593f09603 100644 --- a/Mage/src/mage/cards/decks/DeckValidatorImpl.java +++ b/Mage/src/mage/cards/decks/DeckValidatorImpl.java @@ -39,32 +39,32 @@ import mage.cards.Card; */ public abstract class DeckValidatorImpl implements DeckValidator { - protected String name; + protected String name; - protected Map invalid = new HashMap(); + protected Map invalid = new HashMap(); - public DeckValidatorImpl(String name) { - this.name = name; - } + public DeckValidatorImpl(String name) { + this.name = name; + } - @Override - public String getName() { - return name; - } + @Override + public String getName() { + return name; + } - protected void countCards(Map counts, Collection cards) { - for (Card card: cards) { - if (counts.containsKey(card.getName())) { - counts.put(card.getName(), counts.get(card.getName()) + 1); - } - else { - counts.put(card.getName(), 1); - } - } - } + protected void countCards(Map counts, Collection cards) { + for (Card card: cards) { + if (counts.containsKey(card.getName())) { + counts.put(card.getName(), counts.get(card.getName()) + 1); + } + else { + counts.put(card.getName(), 1); + } + } + } - @Override - public Map getInvalid() { - return invalid; - } + @Override + public Map getInvalid() { + return invalid; + } } diff --git a/Mage/src/mage/cards/decks/InvalidDeckException.java b/Mage/src/mage/cards/decks/InvalidDeckException.java index 39aeb5aa81..c67c7491d0 100644 --- a/Mage/src/mage/cards/decks/InvalidDeckException.java +++ b/Mage/src/mage/cards/decks/InvalidDeckException.java @@ -38,17 +38,17 @@ import mage.game.GameException; */ public class InvalidDeckException extends GameException { - Map invalid; + Map invalid; - public InvalidDeckException (String message, Map invalid) { - super(message); - this.invalid = invalid; - } + public InvalidDeckException (String message, Map invalid) { + super(message); + this.invalid = invalid; + } + + public Map getInvalid() { + return invalid; + } - public Map getInvalid() { - return invalid; - } - @Override public String getMessage() { StringBuilder sb = new StringBuilder(); diff --git a/Mage/src/mage/choices/Choice.java b/Mage/src/mage/choices/Choice.java index 9be4d1d973..010018f577 100644 --- a/Mage/src/mage/choices/Choice.java +++ b/Mage/src/mage/choices/Choice.java @@ -35,16 +35,16 @@ import java.util.Set; * @author BetaSteward_at_googlemail.com */ public interface Choice { - - public boolean isChosen(); - public boolean isRequired(); - public void clearChoice(); - public String getMessage(); - public void setMessage(String message); - public void setChoice(String choice); - public Set getChoices(); - public void setChoices(Set choices); - public String getChoice(); - public Choice copy(); + public boolean isChosen(); + public boolean isRequired(); + public void clearChoice(); + public String getMessage(); + public void setMessage(String message); + public void setChoice(String choice); + public Set getChoices(); + public void setChoices(Set choices); + public String getChoice(); + + public Choice copy(); } diff --git a/Mage/src/mage/choices/ChoiceColor.java b/Mage/src/mage/choices/ChoiceColor.java index 01c4832357..67d79bb7fc 100644 --- a/Mage/src/mage/choices/ChoiceColor.java +++ b/Mage/src/mage/choices/ChoiceColor.java @@ -36,38 +36,38 @@ import mage.ObjectColor; */ public class ChoiceColor extends ChoiceImpl { - public ChoiceColor() { + public ChoiceColor() { super(true); - this.choices.add("Black"); - this.choices.add("Blue"); - this.choices.add("Green"); - this.choices.add("Red"); - this.choices.add("White"); - this.message = "Choose color"; - } + this.choices.add("Black"); + this.choices.add("Blue"); + this.choices.add("Green"); + this.choices.add("Red"); + this.choices.add("White"); + this.message = "Choose color"; + } - public ChoiceColor(final ChoiceColor choice) { - super(choice); - } + public ChoiceColor(final ChoiceColor choice) { + super(choice); + } - @Override - public ChoiceColor copy() { - return new ChoiceColor(this); - } + @Override + public ChoiceColor copy() { + return new ChoiceColor(this); + } - public ObjectColor getColor() { - ObjectColor color = new ObjectColor(); - if (choice.equals("Black")) - color.setBlack(true); - else if (choice.equals("Blue")) - color.setBlue(true); - else if (choice.equals("Green")) - color.setGreen(true); - else if (choice.equals("Red")) - color.setRed(true); - else if (choice.equals("White")) - color.setWhite(true); - return color; - } + public ObjectColor getColor() { + ObjectColor color = new ObjectColor(); + if (choice.equals("Black")) + color.setBlack(true); + else if (choice.equals("Blue")) + color.setBlue(true); + else if (choice.equals("Green")) + color.setGreen(true); + else if (choice.equals("Red")) + color.setRed(true); + else if (choice.equals("White")) + color.setWhite(true); + return color; + } } diff --git a/Mage/src/mage/choices/ChoiceColorOrArtifact.java b/Mage/src/mage/choices/ChoiceColorOrArtifact.java index c777366ba0..546534f77e 100644 --- a/Mage/src/mage/choices/ChoiceColorOrArtifact.java +++ b/Mage/src/mage/choices/ChoiceColorOrArtifact.java @@ -3,17 +3,17 @@ package mage.choices; public class ChoiceColorOrArtifact extends ChoiceColor { public ChoiceColorOrArtifact() { this.choices.add("Artifacts"); - this.message = "Choose protection from"; + this.message = "Choose protection from"; } public ChoiceColorOrArtifact(final ChoiceColorOrArtifact choice) { - super(choice); - } + super(choice); + } - @Override - public ChoiceColorOrArtifact copy() { - return new ChoiceColorOrArtifact(this); - } + @Override + public ChoiceColorOrArtifact copy() { + return new ChoiceColorOrArtifact(this); + } public boolean isArtifactSelected() { return choice.equals("Artifacts"); diff --git a/Mage/src/mage/choices/ChoiceImpl.java b/Mage/src/mage/choices/ChoiceImpl.java index dcf1413181..e8110937f4 100644 --- a/Mage/src/mage/choices/ChoiceImpl.java +++ b/Mage/src/mage/choices/ChoiceImpl.java @@ -38,80 +38,80 @@ import java.util.Set; */ public class ChoiceImpl> implements Choice, Serializable { - protected boolean chosen; - protected boolean required; - protected String choice; - protected Set choices = new HashSet(); - protected String message; + protected boolean chosen; + protected boolean required; + protected String choice; + protected Set choices = new HashSet(); + protected String message; - public ChoiceImpl() { - this(false); - } + public ChoiceImpl() { + this(false); + } - public ChoiceImpl(boolean required) { - this.required = required; - } + public ChoiceImpl(boolean required) { + this.required = required; + } - public ChoiceImpl(ChoiceImpl choice) { - this.choice = choice.choice; - this.chosen = choice.chosen; - this.required = choice.required; - this.message = choice.message; + public ChoiceImpl(ChoiceImpl choice) { + this.choice = choice.choice; + this.chosen = choice.chosen; + this.required = choice.required; + this.message = choice.message; this.choices.addAll(choice.choices); - } + } - @Override - public boolean isChosen() { - return chosen; - } + @Override + public boolean isChosen() { + return chosen; + } - @Override - public void clearChoice() { - choice = null; - chosen = false; - } + @Override + public void clearChoice() { + choice = null; + chosen = false; + } - @Override - public String getMessage() { - return message; - } + @Override + public String getMessage() { + return message; + } - @Override - public void setMessage(String message) { - this.message = message; - } + @Override + public void setMessage(String message) { + this.message = message; + } - @Override - public Set getChoices() { - return choices; - } + @Override + public Set getChoices() { + return choices; + } - @Override - public void setChoices(Set choices) { - this.choices = choices; - } + @Override + public void setChoices(Set choices) { + this.choices = choices; + } - @Override - public String getChoice() { - return choice; - } + @Override + public String getChoice() { + return choice; + } - @Override - public void setChoice(String choice) { - if (choices.contains(choice)) { - this.choice = choice; - this.chosen = true; - } - } + @Override + public void setChoice(String choice) { + if (choices.contains(choice)) { + this.choice = choice; + this.chosen = true; + } + } - @Override - public boolean isRequired() { - return this.required; - } + @Override + public boolean isRequired() { + return this.required; + } - @Override - public T copy() { - return (T)new ChoiceImpl(this); - } + @Override + public T copy() { + return (T)new ChoiceImpl(this); + } } diff --git a/Mage/src/mage/choices/Choices.java b/Mage/src/mage/choices/Choices.java index 511ab58a3b..b6ae4b98b0 100644 --- a/Mage/src/mage/choices/Choices.java +++ b/Mage/src/mage/choices/Choices.java @@ -41,54 +41,54 @@ import mage.players.Player; */ public class Choices extends ArrayList { - protected Outcome outcome; + protected Outcome outcome; - public Choices() {} + public Choices() {} - public Choices(final Choices choices) { - this.outcome = choices.outcome; - for (Choice choice: choices) { - this.add(choice.copy()); - } - } + public Choices(final Choices choices) { + this.outcome = choices.outcome; + for (Choice choice: choices) { + this.add(choice.copy()); + } + } - public Choices copy() { - return new Choices(this); - } + public Choices copy() { + return new Choices(this); + } - public List getUnchosen() { - List unchosen = new ArrayList(); - for (Choice choice: this) { - if (!choice.isChosen()) - unchosen.add(choice); - } - return unchosen; - } + public List getUnchosen() { + List unchosen = new ArrayList(); + for (Choice choice: this) { + if (!choice.isChosen()) + unchosen.add(choice); + } + return unchosen; + } - public void clearChosen() { - for (Choice choice: this) { - choice.clearChoice(); - } - } + public void clearChosen() { + for (Choice choice: this) { + choice.clearChoice(); + } + } - public boolean isChosen() { - for (Choice choice: this) { - if (!choice.isChosen()) - return false; - } - return true; - } + public boolean isChosen() { + for (Choice choice: this) { + if (!choice.isChosen()) + return false; + } + return true; + } - public boolean choose(Game game, Ability source) { - if (this.size() > 0) { - Player player = game.getPlayer(source.getControllerId()); - while (!isChosen()) { - Choice choice = this.getUnchosen().get(0); - if (!player.choose(outcome, choice, game)) - return false; - } - } - return true; - } + public boolean choose(Game game, Ability source) { + if (this.size() > 0) { + Player player = game.getPlayer(source.getControllerId()); + while (!isChosen()) { + Choice choice = this.getUnchosen().get(0); + if (!player.choose(outcome, choice, game)) + return false; + } + } + return true; + } } diff --git a/Mage/src/mage/counters/BoostCounter.java b/Mage/src/mage/counters/BoostCounter.java index 3c38598024..82fa730e01 100644 --- a/Mage/src/mage/counters/BoostCounter.java +++ b/Mage/src/mage/counters/BoostCounter.java @@ -34,27 +34,27 @@ package mage.counters; */ public abstract class BoostCounter> extends Counter { - protected int power; - protected int toughness; + protected int power; + protected int toughness; - public BoostCounter(int power, int toughness) { - super(String.format("%1$+d/%2$+d", power, toughness)); - this.power = power; - this.toughness = toughness; - } + public BoostCounter(int power, int toughness) { + super(String.format("%1$+d/%2$+d", power, toughness)); + this.power = power; + this.toughness = toughness; + } - public BoostCounter(final BoostCounter counter) { - super(counter); - this.power = counter.power; - this.toughness = counter.toughness; - } + public BoostCounter(final BoostCounter counter) { + super(counter); + this.power = counter.power; + this.toughness = counter.toughness; + } - public int getPower() { - return power; - } + public int getPower() { + return power; + } - public int getToughness() { - return toughness; - } + public int getToughness() { + return toughness; + } } diff --git a/Mage/src/mage/counters/Counter.java b/Mage/src/mage/counters/Counter.java index f1acdd3be8..fe61f93eac 100644 --- a/Mage/src/mage/counters/Counter.java +++ b/Mage/src/mage/counters/Counter.java @@ -36,53 +36,53 @@ import java.io.Serializable; */ public class Counter> implements Serializable { - protected String name; - protected int count; + protected String name; + protected int count; - public Counter(String name) { - this.name = name; + public Counter(String name) { + this.name = name; this.count = 1; - } + } public Counter(String name, int count) { this.name = name; this.count = count; } - public Counter(Counter counter) { - this.name = counter.name; - this.count = counter.count; - } + public Counter(Counter counter) { + this.name = counter.name; + this.count = counter.count; + } - public void add() { - count++; - } + public void add() { + count++; + } - public void add(int amount) { - count += amount; - } + public void add(int amount) { + count += amount; + } - public void remove() { - if (count > 0) - count--; - } + public void remove() { + if (count > 0) + count--; + } - public void remove(int amount) { - if (count > amount) - count -= amount; - else - count = 0; - } + public void remove(int amount) { + if (count > amount) + count -= amount; + else + count = 0; + } - public String getName() { - return name; - } + public String getName() { + return name; + } - public int getCount() { - return count; - } + public int getCount() { + return count; + } - public T copy() { - return (T)new Counter(this); - } + public T copy() { + return (T)new Counter(this); + } } diff --git a/Mage/src/mage/counters/CounterType.java b/Mage/src/mage/counters/CounterType.java index 58bd1f9792..83ca48fab5 100644 --- a/Mage/src/mage/counters/CounterType.java +++ b/Mage/src/mage/counters/CounterType.java @@ -128,14 +128,14 @@ public enum CounterType { return new AimCounter(amount); case EON: return new EonCounter(amount); - case AWAKENING: - return new AwakeningCounter(amount); + case AWAKENING: + return new AwakeningCounter(amount); case DEVOTION: - return new DevotionCounter(amount); + return new DevotionCounter(amount); case DIVINITY: return new DivinityCounter(amount); - case WISH: - return new WishCounter(amount); + case WISH: + return new WishCounter(amount); case HOOFPRINT: return new HoofprintCounter(amount); case HATCHLING: diff --git a/Mage/src/mage/counters/Counters.java b/Mage/src/mage/counters/Counters.java index 1f37ece721..7ce7a28f38 100644 --- a/Mage/src/mage/counters/Counters.java +++ b/Mage/src/mage/counters/Counters.java @@ -40,75 +40,75 @@ import java.util.Map; */ public class Counters extends HashMap implements Serializable { - public Counters() {} - - public Counters(final Counters counters) { + public Counters() {} + + public Counters(final Counters counters) { for (Map.Entry entry: counters.entrySet()) { this.put(entry.getKey(), entry.getValue().copy()); } - } + } - public Counters copy() { - return new Counters(this); - } + public Counters copy() { + return new Counters(this); + } - public void addCounter(String name) { - if (!this.containsKey(name)) - this.put(name, new Counter(name)); - this.get(name).add(); - } + public void addCounter(String name) { + if (!this.containsKey(name)) + this.put(name, new Counter(name)); + this.get(name).add(); + } - public void addCounter(String name, int amount) { - if (!this.containsKey(name)) - this.put(name, new Counter(name)); - this.get(name).add(amount); - } + public void addCounter(String name, int amount) { + if (!this.containsKey(name)) + this.put(name, new Counter(name)); + this.get(name).add(amount); + } - public void addCounter(Counter counter) { - if (!this.containsKey(counter.name)) - put(counter.name, counter); - else - get(counter.name).add(counter.getCount()); - } + public void addCounter(Counter counter) { + if (!this.containsKey(counter.name)) + put(counter.name, counter); + else + get(counter.name).add(counter.getCount()); + } - public void removeCounter(String name) { - if (this.containsKey(name)) - this.get(name).remove(); - } - - public void removeCounter(CounterType counterType, int amount) { - if (this.containsKey(counterType.getName())) { - get(counterType.getName()).remove(amount); - } - } + public void removeCounter(String name) { + if (this.containsKey(name)) + this.get(name).remove(); + } - public void removeCounter(String name, int amount) { - if (this.containsKey(name)) - this.get(name).remove(amount); - } + public void removeCounter(CounterType counterType, int amount) { + if (this.containsKey(counterType.getName())) { + get(counterType.getName()).remove(amount); + } + } - public int getCount(String name) { - if (this.containsKey(name)) - return this.get(name).getCount(); - return 0; - } - - public boolean containsKey(CounterType counterType) { - return getCount(counterType) > 0; - } + public void removeCounter(String name, int amount) { + if (this.containsKey(name)) + this.get(name).remove(amount); + } - public int getCount(CounterType type) { - if (this.containsKey(type.getName())) - return this.get(type.getName()).getCount(); - return 0; - } + public int getCount(String name) { + if (this.containsKey(name)) + return this.get(name).getCount(); + return 0; + } - public List getBoostCounters() { - List boosters = new ArrayList(); - for (Counter counter: this.values()) { - if (counter instanceof BoostCounter) - boosters.add((BoostCounter)counter); - } - return boosters; - } + public boolean containsKey(CounterType counterType) { + return getCount(counterType) > 0; + } + + public int getCount(CounterType type) { + if (this.containsKey(type.getName())) + return this.get(type.getName()).getCount(); + return 0; + } + + public List getBoostCounters() { + List boosters = new ArrayList(); + for (Counter counter: this.values()) { + if (counter instanceof BoostCounter) + boosters.add((BoostCounter)counter); + } + return boosters; + } } diff --git a/Mage/src/mage/counters/common/AimCounter.java b/Mage/src/mage/counters/common/AimCounter.java index 0cb59fcb1c..a4d188a05e 100644 --- a/Mage/src/mage/counters/common/AimCounter.java +++ b/Mage/src/mage/counters/common/AimCounter.java @@ -46,7 +46,7 @@ public class AimCounter extends Counter { super("aim"); this.count = amount; } - + // public AimCounter(DynamicValue amountDynamicValue) { // super("aim"); // this.count = StaticValue(amountDynamicValue); diff --git a/Mage/src/mage/counters/common/AwakeningCounter.java b/Mage/src/mage/counters/common/AwakeningCounter.java index 9fa9aee26f..bf910837ce 100644 --- a/Mage/src/mage/counters/common/AwakeningCounter.java +++ b/Mage/src/mage/counters/common/AwakeningCounter.java @@ -3,11 +3,11 @@ package mage.counters.common; import mage.counters.Counter; public class AwakeningCounter extends Counter { - public AwakeningCounter() { - this(1); - } + public AwakeningCounter() { + this(1); + } - public AwakeningCounter(int amount) { + public AwakeningCounter(int amount) { super("Awakening"); this.count = amount; } diff --git a/Mage/src/mage/counters/common/MinusOneCounter.java b/Mage/src/mage/counters/common/MinusOneCounter.java index 0e8e4a842b..83a4d52239 100644 --- a/Mage/src/mage/counters/common/MinusOneCounter.java +++ b/Mage/src/mage/counters/common/MinusOneCounter.java @@ -36,21 +36,21 @@ import mage.counters.BoostCounter; */ public class MinusOneCounter extends BoostCounter { - public MinusOneCounter() { - super(-1, -1); - } + public MinusOneCounter() { + super(-1, -1); + } - public MinusOneCounter(int amount) { - super(-1, -1); - this.count = amount; - } + public MinusOneCounter(int amount) { + super(-1, -1); + this.count = amount; + } - public MinusOneCounter(final MinusOneCounter counter) { - super(counter); - } + public MinusOneCounter(final MinusOneCounter counter) { + super(counter); + } - @Override - public MinusOneCounter copy() { - return new MinusOneCounter(this); - } + @Override + public MinusOneCounter copy() { + return new MinusOneCounter(this); + } } diff --git a/Mage/src/mage/counters/common/PlusOneCounter.java b/Mage/src/mage/counters/common/PlusOneCounter.java index 6fb6c72c35..bd468eac5a 100644 --- a/Mage/src/mage/counters/common/PlusOneCounter.java +++ b/Mage/src/mage/counters/common/PlusOneCounter.java @@ -36,21 +36,21 @@ import mage.counters.BoostCounter; */ public class PlusOneCounter extends BoostCounter { - public PlusOneCounter() { - this(1); - } + public PlusOneCounter() { + this(1); + } - public PlusOneCounter(int amount) { - super(1, 1); - this.count = amount; - } + public PlusOneCounter(int amount) { + super(1, 1); + this.count = amount; + } - public PlusOneCounter(final PlusOneCounter counter) { - super(counter); - } + public PlusOneCounter(final PlusOneCounter counter) { + super(counter); + } - @Override - public PlusOneCounter copy() { - return new PlusOneCounter(this); - } + @Override + public PlusOneCounter copy() { + return new PlusOneCounter(this); + } } diff --git a/Mage/src/mage/filter/Filter.java b/Mage/src/mage/filter/Filter.java index eecfda94eb..69255936df 100644 --- a/Mage/src/mage/filter/Filter.java +++ b/Mage/src/mage/filter/Filter.java @@ -38,19 +38,19 @@ import java.io.Serializable; */ public interface Filter extends Serializable { - public enum ComparisonType { - GreaterThan, Equal, LessThan - } - - public enum ComparisonScope { - Any, All - } - - public boolean match(E o, Game game); - public String getMessage(); - public void setMessage(String message); - public void setNotFilter(boolean notFilter); - - public Filter copy(); - + public enum ComparisonType { + GreaterThan, Equal, LessThan + } + + public enum ComparisonScope { + Any, All + } + + public boolean match(E o, Game game); + public String getMessage(); + public void setMessage(String message); + public void setNotFilter(boolean notFilter); + + public Filter copy(); + } diff --git a/Mage/src/mage/filter/FilterAbility.java b/Mage/src/mage/filter/FilterAbility.java index 72d81232c0..e6086dcc21 100644 --- a/Mage/src/mage/filter/FilterAbility.java +++ b/Mage/src/mage/filter/FilterAbility.java @@ -43,87 +43,87 @@ import java.util.List; */ public class FilterAbility extends FilterImpl> implements Filter { - protected static ListComparer compOutcome = new ListComparer(); + protected static ListComparer compOutcome = new ListComparer(); - protected List outcomes = new ArrayList(); - protected ComparisonScope scopeOutcome = ComparisonScope.All; - protected boolean notOutcome; - protected List types = new ArrayList(); - protected boolean notType; - protected Zone zone; - protected boolean notZone; + protected List outcomes = new ArrayList(); + protected ComparisonScope scopeOutcome = ComparisonScope.All; + protected boolean notOutcome; + protected List types = new ArrayList(); + protected boolean notType; + protected Zone zone; + protected boolean notZone; - public FilterAbility() { - super(""); - } + public FilterAbility() { + super(""); + } - public FilterAbility(FilterAbility filter) { - super(filter); - for (Outcome outcome: filter.outcomes) { - this.outcomes.add(outcome); - } - this.scopeOutcome = filter.scopeOutcome; - this.notOutcome = filter.notOutcome; - for (AbilityType aType: filter.types) { - this.types.add(aType); - } - this.notType = filter.notType; - this.zone = filter.zone; - this.notZone = filter.notZone; - } + public FilterAbility(FilterAbility filter) { + super(filter); + for (Outcome outcome: filter.outcomes) { + this.outcomes.add(outcome); + } + this.scopeOutcome = filter.scopeOutcome; + this.notOutcome = filter.notOutcome; + for (AbilityType aType: filter.types) { + this.types.add(aType); + } + this.notType = filter.notType; + this.zone = filter.zone; + this.notZone = filter.notZone; + } - @Override - public boolean match(T object, Game game) { + @Override + public boolean match(T object, Game game) { - if (zone != null) { - if (object.getZone().match(zone) == notZone) - return notFilter; - } + if (zone != null) { + if (object.getZone().match(zone) == notZone) + return notFilter; + } - if (outcomes.size() > 0) { - if (!compOutcome.compare(outcomes, object.getEffects().getOutcomes(), scopeOutcome, notOutcome)) - return notFilter; - } - - if (types.size() > 0) { - if (types.contains(object.getAbilityType()) == notType) - return notFilter; - } + if (outcomes.size() > 0) { + if (!compOutcome.compare(outcomes, object.getEffects().getOutcomes(), scopeOutcome, notOutcome)) + return notFilter; + } - return !notFilter; - } + if (types.size() > 0) { + if (types.contains(object.getAbilityType()) == notType) + return notFilter; + } - public List getOutcomes() { - return this.outcomes; - } + return !notFilter; + } - public void setScopeOutcome(ComparisonScope scopeOutcome) { - this.scopeOutcome = scopeOutcome; - } + public List getOutcomes() { + return this.outcomes; + } - public void setNotOutcome(boolean notOutcome) { - this.notOutcome = notOutcome; - } + public void setScopeOutcome(ComparisonScope scopeOutcome) { + this.scopeOutcome = scopeOutcome; + } - public List getTypes() { - return types; - } + public void setNotOutcome(boolean notOutcome) { + this.notOutcome = notOutcome; + } - public void setNotType(boolean notType) { - this.notType = notType; - } + public List getTypes() { + return types; + } - public void setZone(Zone zone) { - this.zone = zone; - } + public void setNotType(boolean notType) { + this.notType = notType; + } - public void setNotZone(boolean notZone) { - this.notZone = notZone; - } + public void setZone(Zone zone) { + this.zone = zone; + } - @Override - public FilterAbility copy() { - return new FilterAbility(this); - } + public void setNotZone(boolean notZone) { + this.notZone = notZone; + } + + @Override + public FilterAbility copy() { + return new FilterAbility(this); + } } diff --git a/Mage/src/mage/filter/FilterCard.java b/Mage/src/mage/filter/FilterCard.java index 4f34b27eaa..d687a7eda0 100644 --- a/Mage/src/mage/filter/FilterCard.java +++ b/Mage/src/mage/filter/FilterCard.java @@ -40,53 +40,53 @@ import java.util.*; */ public class FilterCard> extends FilterObject> { - private static final long serialVersionUID = 1L; + private static final long serialVersionUID = 1L; - protected List ownerId = new ArrayList(); - protected boolean notOwner; - protected List expansionSetCode = new ArrayList(); - protected boolean notExpansionSetCode; + protected List ownerId = new ArrayList(); + protected boolean notOwner; + protected List expansionSetCode = new ArrayList(); + protected boolean notExpansionSetCode; protected TargetController owner = TargetController.ANY; - /** - * Text that appears on card. - * At the moment only card name and rules are checked. - */ - protected String text = ""; + /** + * Text that appears on card. + * At the moment only card name and rules are checked. + */ + protected String text = ""; - public FilterCard() { - super("card"); - } + public FilterCard() { + super("card"); + } - public FilterCard(String name) { - super(name); - } + public FilterCard(String name) { + super(name); + } - public FilterCard(FilterCard filter) { - super(filter); + public FilterCard(FilterCard filter) { + super(filter); this.ownerId.addAll(filter.ownerId); - this.notOwner = filter.notOwner; + this.notOwner = filter.notOwner; this.expansionSetCode.addAll(filter.expansionSetCode); - this.notExpansionSetCode = filter.notExpansionSetCode; + this.notExpansionSetCode = filter.notExpansionSetCode; this.owner = filter.owner; - } + } - @Override - public boolean match(Card card, Game game) { - if (!super.match(card, game)) - return notFilter; + @Override + public boolean match(Card card, Game game) { + if (!super.match(card, game)) + return notFilter; - if (ownerId.size() > 0 && ownerId.contains(card.getOwnerId()) == notOwner) - return notFilter; + if (ownerId.size() > 0 && ownerId.contains(card.getOwnerId()) == notOwner) + return notFilter; - if (expansionSetCode.size() > 0 && expansionSetCode.contains(card.getExpansionSetCode()) == notExpansionSetCode) - return notFilter; + if (expansionSetCode.size() > 0 && expansionSetCode.contains(card.getExpansionSetCode()) == notExpansionSetCode) + return notFilter; - if (text.length() > 0) { - // first check in card name - boolean filterOut = !card.getName().toLowerCase().contains(text.toLowerCase()); - // if couldn't find - if (filterOut) { + if (text.length() > 0) { + // first check in card name + boolean filterOut = !card.getName().toLowerCase().contains(text.toLowerCase()); + // if couldn't find + if (filterOut) { //separate by spaces String[] tokens = text.toLowerCase().split(" "); int count = 0; @@ -113,81 +113,81 @@ public class FilterCard> extends FilterObject getOwnerId() { - return ownerId; - } + if (owner != TargetController.ANY && playerId != null) { + switch(owner) { + case YOU: + if (!card.getOwnerId().equals(playerId)) + return notFilter; + break; + case OPPONENT: + if (!game.getOpponents(playerId).contains(card.getOwnerId())) + return notFilter; + break; + case NOT_YOU: + if (card.getOwnerId().equals(playerId)) + return notFilter; + break; + } + } - public void setNotOwner(boolean notOwner) { - this.notOwner = notOwner; - } - - public List getExpansionSetCode() { - return expansionSetCode; - } + return !notFilter; + } - public void setNotExpansionSetCode(boolean notExpansionSetCode) { - this.notExpansionSetCode = notExpansionSetCode; - } + public List getOwnerId() { + return ownerId; + } - public void setText(String text) { - this.text = text; - } + public void setNotOwner(boolean notOwner) { + this.notOwner = notOwner; + } + + public List getExpansionSetCode() { + return expansionSetCode; + } + + public void setNotExpansionSetCode(boolean notExpansionSetCode) { + this.notExpansionSetCode = notExpansionSetCode; + } + + public void setText(String text) { + this.text = text; + } public void setTargetOwner(TargetController owner) { - this.owner = owner; - } + this.owner = owner; + } - public boolean matchOwner(UUID testOwnerId) { - if (ownerId.size() > 0 && ownerId.contains(testOwnerId) == notOwner) - return false; - return true; - } + public boolean matchOwner(UUID testOwnerId) { + if (ownerId.size() > 0 && ownerId.contains(testOwnerId) == notOwner) + return false; + return true; + } - public Set filter(Set cards, Game game) { - Set filtered = new HashSet(); - for (Card card: cards) { - if (match(card, game)) { - filtered.add(card); - } - } - return filtered; - } + public Set filter(Set cards, Game game) { + Set filtered = new HashSet(); + for (Card card: cards) { + if (match(card, game)) { + filtered.add(card); + } + } + return filtered; + } - @Override - public FilterCard copy() { - return new FilterCard(this); - } + @Override + public FilterCard copy() { + return new FilterCard(this); + } } diff --git a/Mage/src/mage/filter/FilterImpl.java b/Mage/src/mage/filter/FilterImpl.java index 463c4961c0..1dcc6e91ee 100644 --- a/Mage/src/mage/filter/FilterImpl.java +++ b/Mage/src/mage/filter/FilterImpl.java @@ -37,62 +37,62 @@ import mage.ObjectColor; */ public abstract class FilterImpl> implements Filter { - protected static ListComparer compCardType = new ListComparer(); - protected static ListComparer compString = new ListComparer(); + protected static ListComparer compCardType = new ListComparer(); + protected static ListComparer compString = new ListComparer(); - protected String message; - protected boolean notFilter = false; + protected String message; + protected boolean notFilter = false; - @Override - public abstract FilterImpl copy(); + @Override + public abstract FilterImpl copy(); - public FilterImpl(String name) { - this.message = name; - } + public FilterImpl(String name) { + this.message = name; + } - public FilterImpl(FilterImpl filter) { - this.message = filter.message; - this.notFilter = filter.notFilter; - } + public FilterImpl(FilterImpl filter) { + this.message = filter.message; + this.notFilter = filter.notFilter; + } - protected boolean compareInts(int int1, int int2, ComparisonType type) { - switch (type) { - case Equal: - if (int1 != int2) - return false; - break; - case GreaterThan: - if (int1 <= int2) - return false; - break; - case LessThan: - if (int1 >= int2) - return false; - break; - } - return true; - } + protected boolean compareInts(int int1, int int2, ComparisonType type) { + switch (type) { + case Equal: + if (int1 != int2) + return false; + break; + case GreaterThan: + if (int1 <= int2) + return false; + break; + case LessThan: + if (int1 >= int2) + return false; + break; + } + return true; + } - protected boolean compareColors(ObjectColor color1, ObjectColor color2, ComparisonScope scope) { - if (scope == ComparisonScope.All) - return color2.equals(color1); - else - return color2.contains(color1); - } + protected boolean compareColors(ObjectColor color1, ObjectColor color2, ComparisonScope scope) { + if (scope == ComparisonScope.All) + return color2.equals(color1); + else + return color2.contains(color1); + } - @Override - public String getMessage() { - return message; - } + @Override + public String getMessage() { + return message; + } - @Override - public void setMessage(String message) { - this.message = message; - } + @Override + public void setMessage(String message) { + this.message = message; + } - @Override - public void setNotFilter(boolean notFilter) { - this.notFilter = notFilter; - } + @Override + public void setNotFilter(boolean notFilter) { + this.notFilter = notFilter; + } } diff --git a/Mage/src/mage/filter/FilterInPlay.java b/Mage/src/mage/filter/FilterInPlay.java index ff299ab6e6..627b602009 100644 --- a/Mage/src/mage/filter/FilterInPlay.java +++ b/Mage/src/mage/filter/FilterInPlay.java @@ -38,8 +38,8 @@ import mage.game.Game; */ public interface FilterInPlay extends Filter { - public boolean match(E o, UUID sourceId, UUID playerId, Game game); - @Override - public FilterInPlay copy(); + public boolean match(E o, UUID sourceId, UUID playerId, Game game); + @Override + public FilterInPlay copy(); } diff --git a/Mage/src/mage/filter/FilterMana.java b/Mage/src/mage/filter/FilterMana.java index 2836f3f3a9..04376af229 100644 --- a/Mage/src/mage/filter/FilterMana.java +++ b/Mage/src/mage/filter/FilterMana.java @@ -34,74 +34,74 @@ import java.io.Serializable; */ public class FilterMana implements Serializable { - protected boolean black; - protected boolean green; - protected boolean white; - protected boolean red; - protected boolean blue; - protected boolean colorless; + protected boolean black; + protected boolean green; + protected boolean white; + protected boolean red; + protected boolean blue; + protected boolean colorless; - public FilterMana() { - } + public FilterMana() { + } - public FilterMana(FilterMana filter) { - black = filter.black; - green = filter.green; - white = filter.white; - red = filter.red; - blue = filter.blue; - colorless = filter.colorless; - } + public FilterMana(FilterMana filter) { + black = filter.black; + green = filter.green; + white = filter.white; + red = filter.red; + blue = filter.blue; + colorless = filter.colorless; + } - public boolean isBlack() { - return black; - } + public boolean isBlack() { + return black; + } - public void setBlack(boolean black) { - this.black = black; - } + public void setBlack(boolean black) { + this.black = black; + } - public boolean isGreen() { - return green; - } + public boolean isGreen() { + return green; + } - public void setGreen(boolean green) { - this.green = green; - } + public void setGreen(boolean green) { + this.green = green; + } - public boolean isWhite() { - return white; - } + public boolean isWhite() { + return white; + } - public void setWhite(boolean white) { - this.white = white; - } + public void setWhite(boolean white) { + this.white = white; + } - public boolean isRed() { - return red; - } + public boolean isRed() { + return red; + } - public void setRed(boolean red) { - this.red = red; - } + public void setRed(boolean red) { + this.red = red; + } - public boolean isBlue() { - return blue; - } + public boolean isBlue() { + return blue; + } - public void setBlue(boolean blue) { - this.blue = blue; - } + public void setBlue(boolean blue) { + this.blue = blue; + } - public boolean isColorless() { - return colorless; - } + public boolean isColorless() { + return colorless; + } - public void setColorless(boolean colorless) { - this.colorless = colorless; - } + public void setColorless(boolean colorless) { + this.colorless = colorless; + } - public FilterMana copy() { - return new FilterMana(this); - } + public FilterMana copy() { + return new FilterMana(this); + } } diff --git a/Mage/src/mage/filter/FilterObject.java b/Mage/src/mage/filter/FilterObject.java index afdd575b20..ad53a188cc 100644 --- a/Mage/src/mage/filter/FilterObject.java +++ b/Mage/src/mage/filter/FilterObject.java @@ -45,134 +45,134 @@ import java.util.List; * @author BetaSteward_at_googlemail.com */ public class FilterObject> extends FilterImpl implements Filter { - protected Abilities abilities; - protected boolean notAbilities; - protected List cardType = new ArrayList(); - protected ComparisonScope scopeCardType = ComparisonScope.Any; - protected List notCardTypeList = new ArrayList(); - protected ComparisonScope notScopeCardType = ComparisonScope.Any; - protected boolean notCardType; - protected boolean colorless; - protected boolean useColorless; - protected boolean useColor; - protected ObjectColor color; - protected ComparisonScope scopeColor = ComparisonScope.Any; - protected boolean notColor; - protected List name = new ArrayList(); - protected boolean notName; - protected List subtype = new ArrayList(); - protected ComparisonScope scopeSubtype = ComparisonScope.All; - protected boolean notSubtype; - protected List supertype = new ArrayList(); - protected ComparisonScope scopeSupertype = ComparisonScope.Any; - protected boolean notSupertype; - protected int convertedManaCost; - protected ComparisonType convertedManaCostComparison; - protected int power; - protected ComparisonType powerComparison; - protected int toughness; - protected ComparisonType toughnessComparison; + protected Abilities abilities; + protected boolean notAbilities; + protected List cardType = new ArrayList(); + protected ComparisonScope scopeCardType = ComparisonScope.Any; + protected List notCardTypeList = new ArrayList(); + protected ComparisonScope notScopeCardType = ComparisonScope.Any; + protected boolean notCardType; + protected boolean colorless; + protected boolean useColorless; + protected boolean useColor; + protected ObjectColor color; + protected ComparisonScope scopeColor = ComparisonScope.Any; + protected boolean notColor; + protected List name = new ArrayList(); + protected boolean notName; + protected List subtype = new ArrayList(); + protected ComparisonScope scopeSubtype = ComparisonScope.All; + protected boolean notSubtype; + protected List supertype = new ArrayList(); + protected ComparisonScope scopeSupertype = ComparisonScope.Any; + protected boolean notSupertype; + protected int convertedManaCost; + protected ComparisonType convertedManaCostComparison; + protected int power; + protected ComparisonType powerComparison; + protected int toughness; + protected ComparisonType toughnessComparison; - /** - * Indicates that filter shouldn't match the source. - */ - protected boolean another; + /** + * Indicates that filter shouldn't match the source. + */ + protected boolean another; - @Override - public FilterObject copy() { - return new FilterObject(this); - } + @Override + public FilterObject copy() { + return new FilterObject(this); + } - public FilterObject(String name) { - super(name); - abilities = new AbilitiesImpl(); - color = new ObjectColor(); - } + public FilterObject(String name) { + super(name); + abilities = new AbilitiesImpl(); + color = new ObjectColor(); + } - public FilterObject(FilterObject filter) { - super(filter); - this.abilities = filter.abilities.copy(); - this.notAbilities = filter.notAbilities; + public FilterObject(FilterObject filter) { + super(filter); + this.abilities = filter.abilities.copy(); + this.notAbilities = filter.notAbilities; this.cardType.addAll(filter.cardType); this.notCardTypeList.addAll(filter.notCardTypeList); - this.scopeCardType = filter.scopeCardType; - this.notCardType = filter.notCardType; - this.notScopeCardType = filter.notScopeCardType; - this.colorless = filter.colorless; - this.useColorless = filter.useColorless; - this.useColor = filter.useColor; - this.color = filter.color.copy(); - this.scopeColor = filter.scopeColor; - this.notColor = filter.notColor; + this.scopeCardType = filter.scopeCardType; + this.notCardType = filter.notCardType; + this.notScopeCardType = filter.notScopeCardType; + this.colorless = filter.colorless; + this.useColorless = filter.useColorless; + this.useColor = filter.useColor; + this.color = filter.color.copy(); + this.scopeColor = filter.scopeColor; + this.notColor = filter.notColor; this.name.addAll(filter.name); - this.notName = filter.notName; + this.notName = filter.notName; this.subtype.addAll(filter.subtype); - this.scopeSubtype = filter.scopeSubtype; - this.notSubtype = filter.notSubtype; + this.scopeSubtype = filter.scopeSubtype; + this.notSubtype = filter.notSubtype; this.supertype.addAll(filter.supertype); - this.scopeSupertype = filter.scopeSupertype; - this.notSupertype = filter.notSupertype; - this.convertedManaCost = filter.convertedManaCost; - this.convertedManaCostComparison = filter.convertedManaCostComparison; - this.power = filter.power; - this.powerComparison = filter.powerComparison; - this.toughness = filter.toughness; - this.toughnessComparison = filter.toughnessComparison; - this.another = filter.another; - } + this.scopeSupertype = filter.scopeSupertype; + this.notSupertype = filter.notSupertype; + this.convertedManaCost = filter.convertedManaCost; + this.convertedManaCostComparison = filter.convertedManaCostComparison; + this.power = filter.power; + this.powerComparison = filter.powerComparison; + this.toughness = filter.toughness; + this.toughnessComparison = filter.toughnessComparison; + this.another = filter.another; + } - @Override - public boolean match(E object, Game game) { + @Override + public boolean match(E object, Game game) { - if (name.size() > 0) { - if (name.contains(object.getName()) == notName) - return notFilter; - } + if (name.size() > 0) { + if (name.contains(object.getName()) == notName) + return notFilter; + } - if (useColor) { - if (scopeColor == ComparisonScope.All) { - if (object.getColor().equals(color) == notColor) { - return notFilter; - } - } - else if (object.getColor().contains(color) == notColor) { - if (useColorless && colorless) { //need to treat colorless like a color in this case - if (object.getColor().isColorless() != colorless) { - return notFilter; - } - } - else { - return notFilter; - } - } - } - else if (useColorless && object.getColor().isColorless() != colorless) { - return notFilter; - } + if (useColor) { + if (scopeColor == ComparisonScope.All) { + if (object.getColor().equals(color) == notColor) { + return notFilter; + } + } + else if (object.getColor().contains(color) == notColor) { + if (useColorless && colorless) { //need to treat colorless like a color in this case + if (object.getColor().isColorless() != colorless) { + return notFilter; + } + } + else { + return notFilter; + } + } + } + else if (useColorless && object.getColor().isColorless() != colorless) { + return notFilter; + } - if (cardType.size() > 0) { - if (!compCardType.compare(cardType, object.getCardType(), scopeCardType, notCardType)) - return notFilter; - } + if (cardType.size() > 0) { + if (!compCardType.compare(cardType, object.getCardType(), scopeCardType, notCardType)) + return notFilter; + } - if (notCardTypeList.size() > 0) { - if (compCardType.compare(notCardTypeList, object.getCardType(), notScopeCardType, false)) - return notFilter; - } - - if (subtype.size() > 0) { - if (!object.getAbilities().contains(ChangelingAbility.getInstance())) { - if (!compString.compare(subtype, object.getSubtype(), scopeSubtype, notSubtype)) - return notFilter; - } - } + if (notCardTypeList.size() > 0) { + if (compCardType.compare(notCardTypeList, object.getCardType(), notScopeCardType, false)) + return notFilter; + } - if (supertype.size() > 0) { - if (!compString.compare(supertype, object.getSupertype(), scopeSupertype, notSupertype)) - return notFilter; - } + if (subtype.size() > 0) { + if (!object.getAbilities().contains(ChangelingAbility.getInstance())) { + if (!compString.compare(subtype, object.getSubtype(), scopeSubtype, notSubtype)) + return notFilter; + } + } - if (abilities.size() > 0) { + if (supertype.size() > 0) { + if (!compString.compare(supertype, object.getSupertype(), scopeSupertype, notSupertype)) + return notFilter; + } + + if (abilities.size() > 0) { List test = new ArrayList(abilities); for (Ability ability: object.getAbilities()) { for (Ability abilityTest: test) { @@ -184,143 +184,143 @@ public class FilterObject> ex } if (test.isEmpty() == notAbilities) return notFilter; - } + } - if (convertedManaCostComparison != null) { - if (!compareInts(object.getManaCost().convertedManaCost(), convertedManaCost, convertedManaCostComparison)) - return notFilter; - } + if (convertedManaCostComparison != null) { + if (!compareInts(object.getManaCost().convertedManaCost(), convertedManaCost, convertedManaCostComparison)) + return notFilter; + } - if (powerComparison != null) { - if (!compareInts(object.getPower().getValue(), power, powerComparison)) - return notFilter; - } + if (powerComparison != null) { + if (!compareInts(object.getPower().getValue(), power, powerComparison)) + return notFilter; + } - if (toughnessComparison != null) { - if (!compareInts(object.getToughness().getValue(), toughness, toughnessComparison)) - return notFilter; - } + if (toughnessComparison != null) { + if (!compareInts(object.getToughness().getValue(), toughness, toughnessComparison)) + return notFilter; + } - return !notFilter; - } + return !notFilter; + } - public Abilities getAbilities() { - return this.abilities; - } + public Abilities getAbilities() { + return this.abilities; + } - public void setNotAbilities(boolean notAbilities) { - this.notAbilities = notAbilities; - } + public void setNotAbilities(boolean notAbilities) { + this.notAbilities = notAbilities; + } - public List getCardType() { - return this.cardType; - } - - public List getNotCardType() { - return this.notCardTypeList; - } + public List getCardType() { + return this.cardType; + } - public void setScopeCardType(ComparisonScope scopeCardType) { - this.scopeCardType = scopeCardType; - } - - public void setNotScopeCardType(ComparisonScope notScopeCardType) { - this.notScopeCardType = notScopeCardType; - } + public List getNotCardType() { + return this.notCardTypeList; + } - public void setNotCardType(boolean notCardTypeList) { - this.notCardType = notCardTypeList; - } + public void setScopeCardType(ComparisonScope scopeCardType) { + this.scopeCardType = scopeCardType; + } - public void setColor(ObjectColor color) { - this.color = color; - } + public void setNotScopeCardType(ComparisonScope notScopeCardType) { + this.notScopeCardType = notScopeCardType; + } - public ObjectColor getColor() { - return this.color; - } + public void setNotCardType(boolean notCardTypeList) { + this.notCardType = notCardTypeList; + } - public void setScopeColor(ComparisonScope scopeColor) { - this.scopeColor = scopeColor; - } + public void setColor(ObjectColor color) { + this.color = color; + } - public void setNotColor(boolean notColor) { - this.notColor = notColor; - } + public ObjectColor getColor() { + return this.color; + } - public List getName() { - return this.name; - } + public void setScopeColor(ComparisonScope scopeColor) { + this.scopeColor = scopeColor; + } - public void setNotName(boolean notName) { - this.notName = notName; - } + public void setNotColor(boolean notColor) { + this.notColor = notColor; + } - public List getSubtype() { - return this.subtype; - } + public List getName() { + return this.name; + } - public void setScopeSubtype(ComparisonScope scopeSubtype) { - this.scopeSubtype = scopeSubtype; - } + public void setNotName(boolean notName) { + this.notName = notName; + } - public void setNotSubtype(boolean notSubtype) { - this.notSubtype = notSubtype; - } + public List getSubtype() { + return this.subtype; + } - public List getSupertype() { - return this.supertype; - } + public void setScopeSubtype(ComparisonScope scopeSubtype) { + this.scopeSubtype = scopeSubtype; + } - public void setScopeSupertype(ComparisonScope scopeSupertype) { - this.scopeSupertype = scopeSupertype; - } + public void setNotSubtype(boolean notSubtype) { + this.notSubtype = notSubtype; + } - public void setNotSupertype(boolean notSupertype) { - this.notSupertype = notSupertype; - } + public List getSupertype() { + return this.supertype; + } - public void setConvertedManaCost(int convertedManaCost) { - this.convertedManaCost = convertedManaCost; - } + public void setScopeSupertype(ComparisonScope scopeSupertype) { + this.scopeSupertype = scopeSupertype; + } - public void setConvertedManaCostComparison(ComparisonType convertedManaCostComparison) { - this.convertedManaCostComparison = convertedManaCostComparison; - } + public void setNotSupertype(boolean notSupertype) { + this.notSupertype = notSupertype; + } - public void setPower(int power) { - this.power = power; - } + public void setConvertedManaCost(int convertedManaCost) { + this.convertedManaCost = convertedManaCost; + } - public void setPowerComparison(ComparisonType powerComparison) { - this.powerComparison = powerComparison; - } + public void setConvertedManaCostComparison(ComparisonType convertedManaCostComparison) { + this.convertedManaCostComparison = convertedManaCostComparison; + } - public void setToughness(int toughness) { - this.toughness = toughness; - } + public void setPower(int power) { + this.power = power; + } - public void setToughnessComparison(ComparisonType toughnessComparison) { - this.toughnessComparison = toughnessComparison; - } + public void setPowerComparison(ComparisonType powerComparison) { + this.powerComparison = powerComparison; + } - public void setUseColor(boolean useColor) { - this.useColor = useColor; - } + public void setToughness(int toughness) { + this.toughness = toughness; + } - public void setColorless(boolean colorless) { - this.colorless = colorless; - } + public void setToughnessComparison(ComparisonType toughnessComparison) { + this.toughnessComparison = toughnessComparison; + } - public void setUseColorless(boolean useColorless) { - this.useColorless = useColorless; - } + public void setUseColor(boolean useColor) { + this.useColor = useColor; + } - public boolean isAnother() { - return another; - } + public void setColorless(boolean colorless) { + this.colorless = colorless; + } - public void setAnother(boolean another) { - this.another = another; - } + public void setUseColorless(boolean useColorless) { + this.useColorless = useColorless; + } + + public boolean isAnother() { + return another; + } + + public void setAnother(boolean another) { + this.another = another; + } } diff --git a/Mage/src/mage/filter/FilterPermanent.java b/Mage/src/mage/filter/FilterPermanent.java index d135caee44..f41cad2b77 100644 --- a/Mage/src/mage/filter/FilterPermanent.java +++ b/Mage/src/mage/filter/FilterPermanent.java @@ -41,184 +41,184 @@ import java.util.UUID; * @author BetaSteward_at_googlemail.com */ public class FilterPermanent> extends FilterObject> { - protected List ownerId = new ArrayList(); - protected boolean notOwner; - protected List controllerId = new ArrayList(); - protected boolean notController; - protected boolean useTapped; - protected boolean tapped; - protected boolean useFlipped; - protected boolean flipped; - protected boolean useFaceup; - protected boolean faceup; - protected boolean usePhased; - protected boolean phasedIn; - protected TargetController controller = TargetController.ANY; + protected List ownerId = new ArrayList(); + protected boolean notOwner; + protected List controllerId = new ArrayList(); + protected boolean notController; + protected boolean useTapped; + protected boolean tapped; + protected boolean useFlipped; + protected boolean flipped; + protected boolean useFaceup; + protected boolean faceup; + protected boolean usePhased; + protected boolean phasedIn; + protected TargetController controller = TargetController.ANY; protected TargetController owner = TargetController.ANY; - public FilterPermanent() { - super("permanent"); - } + public FilterPermanent() { + super("permanent"); + } - public FilterPermanent(final FilterPermanent filter) { - super(filter); + public FilterPermanent(final FilterPermanent filter) { + super(filter); this.ownerId = new ArrayList(filter.ownerId); - this.notOwner = filter.notOwner; + this.notOwner = filter.notOwner; this.controllerId = new ArrayList(filter.controllerId); - this.notController = filter.notController; - this.useTapped = filter.useTapped; - this.tapped = filter.tapped; - this.useFlipped = filter.useFlipped; - this.flipped = filter.flipped; - this.useFaceup = filter.useFaceup; - this.faceup = filter.faceup; - this.usePhased = filter.usePhased; - this.phasedIn = filter.phasedIn; - this.controller = filter.controller; + this.notController = filter.notController; + this.useTapped = filter.useTapped; + this.tapped = filter.tapped; + this.useFlipped = filter.useFlipped; + this.flipped = filter.flipped; + this.useFaceup = filter.useFaceup; + this.faceup = filter.faceup; + this.usePhased = filter.usePhased; + this.phasedIn = filter.phasedIn; + this.controller = filter.controller; this.owner = filter.owner; - } + } - public FilterPermanent(String name) { - super(name); - } + public FilterPermanent(String name) { + super(name); + } - @Override - public boolean match(Permanent permanent, Game game) { - if (!super.match(permanent, game)) - return notFilter; + @Override + public boolean match(Permanent permanent, Game game) { + if (!super.match(permanent, game)) + return notFilter; - if (ownerId.size() > 0 && ownerId.contains(permanent.getOwnerId()) == notOwner) - return notFilter; + if (ownerId.size() > 0 && ownerId.contains(permanent.getOwnerId()) == notOwner) + return notFilter; - if (controllerId.size() > 0 && controllerId.contains(permanent.getControllerId()) == notController) - return notFilter; + if (controllerId.size() > 0 && controllerId.contains(permanent.getControllerId()) == notController) + return notFilter; - if (useTapped && permanent.isTapped() != tapped) - return notFilter; + if (useTapped && permanent.isTapped() != tapped) + return notFilter; - if (useFlipped && permanent.isFlipped() != flipped) - return notFilter; + if (useFlipped && permanent.isFlipped() != flipped) + return notFilter; - if (useFaceup && permanent.isFaceUp() != faceup) - return notFilter; + if (useFaceup && permanent.isFaceUp() != faceup) + return notFilter; - if (usePhased && permanent.isPhasedIn() != phasedIn) - return notFilter; + if (usePhased && permanent.isPhasedIn() != phasedIn) + return notFilter; - return !notFilter; - } + return !notFilter; + } - public boolean match(Permanent permanent, UUID sourceId, UUID playerId, Game game) { - if (!this.match(permanent, game)) - return notFilter; + public boolean match(Permanent permanent, UUID sourceId, UUID playerId, Game game) { + if (!this.match(permanent, game)) + return notFilter; - if (controller != TargetController.ANY && playerId != null) { - switch(controller) { - case YOU: - if (!permanent.getControllerId().equals(playerId)) - return notFilter; - break; - case OPPONENT: - if (!game.getOpponents(playerId).contains(permanent.getControllerId())) - return notFilter; - break; - case NOT_YOU: - if (permanent.getControllerId().equals(playerId)) - return notFilter; - break; - } - } + if (controller != TargetController.ANY && playerId != null) { + switch(controller) { + case YOU: + if (!permanent.getControllerId().equals(playerId)) + return notFilter; + break; + case OPPONENT: + if (!game.getOpponents(playerId).contains(permanent.getControllerId())) + return notFilter; + break; + case NOT_YOU: + if (permanent.getControllerId().equals(playerId)) + return notFilter; + break; + } + } - if (owner != TargetController.ANY && playerId != null) { - switch(owner) { - case YOU: - if (!permanent.getOwnerId().equals(playerId)) - return notFilter; - break; - case OPPONENT: - if (!game.getOpponents(playerId).contains(permanent.getOwnerId())) - return notFilter; - break; - case NOT_YOU: - if (permanent.getOwnerId().equals(playerId)) - return notFilter; - break; - } - } + if (owner != TargetController.ANY && playerId != null) { + switch(owner) { + case YOU: + if (!permanent.getOwnerId().equals(playerId)) + return notFilter; + break; + case OPPONENT: + if (!game.getOpponents(playerId).contains(permanent.getOwnerId())) + return notFilter; + break; + case NOT_YOU: + if (permanent.getOwnerId().equals(playerId)) + return notFilter; + break; + } + } if (another) { - // filter out itself - if (permanent.getId().equals(sourceId)) { - return notFilter; - } - } + // filter out itself + if (permanent.getId().equals(sourceId)) { + return notFilter; + } + } - return !notFilter; - } + return !notFilter; + } - public List getOwnerId() { - return ownerId; - } + public List getOwnerId() { + return ownerId; + } - public void setNotOwner(boolean notOwner) { - this.notOwner = notOwner; - } + public void setNotOwner(boolean notOwner) { + this.notOwner = notOwner; + } - public List getControllerId() { - return controllerId; - } + public List getControllerId() { + return controllerId; + } - public void setNotController(boolean notController) { - this.notController = notController; - } + public void setNotController(boolean notController) { + this.notController = notController; + } - public void setUseTapped(boolean useTapped) { - this.useTapped = useTapped; - } + public void setUseTapped(boolean useTapped) { + this.useTapped = useTapped; + } - public void setTapped(boolean tapped) { - this.tapped = tapped; - } + public void setTapped(boolean tapped) { + this.tapped = tapped; + } - public void setUseFlipped(boolean useFlipped) { - this.useFlipped = useFlipped; - } + public void setUseFlipped(boolean useFlipped) { + this.useFlipped = useFlipped; + } - public void setFlipped(boolean flipped) { - this.flipped = flipped; - } + public void setFlipped(boolean flipped) { + this.flipped = flipped; + } - public void setUseFaceup(boolean useFaceup) { - this.useFaceup = useFaceup; - } + public void setUseFaceup(boolean useFaceup) { + this.useFaceup = useFaceup; + } - public void setFaceup(boolean faceup) { - this.faceup = faceup; - } + public void setFaceup(boolean faceup) { + this.faceup = faceup; + } - public void setTargetController(TargetController controller) { - this.controller = controller; - } + public void setTargetController(TargetController controller) { + this.controller = controller; + } public void setTargetOwner(TargetController owner) { - this.owner = owner; - } + this.owner = owner; + } - public boolean matchOwner(UUID testOwnerId) { - if (ownerId.size() > 0 && ownerId.contains(testOwnerId) == notOwner) - return false; - return true; - } + public boolean matchOwner(UUID testOwnerId) { + if (ownerId.size() > 0 && ownerId.contains(testOwnerId) == notOwner) + return false; + return true; + } - public boolean matchController(UUID testControllerId) { - if (controllerId.size() > 0 && controllerId.contains(testControllerId) == notController) - return false; - return true; - } + public boolean matchController(UUID testControllerId) { + if (controllerId.size() > 0 && controllerId.contains(testControllerId) == notController) + return false; + return true; + } - @Override - public FilterPermanent copy() { - return new FilterPermanent(this); - } + @Override + public FilterPermanent copy() { + return new FilterPermanent(this); + } } diff --git a/Mage/src/mage/filter/FilterPlayer.java b/Mage/src/mage/filter/FilterPlayer.java index d9fd64c6c0..c413500451 100644 --- a/Mage/src/mage/filter/FilterPlayer.java +++ b/Mage/src/mage/filter/FilterPlayer.java @@ -42,69 +42,69 @@ import java.util.UUID; */ public class FilterPlayer extends FilterImpl implements Filter { - protected List playerId = new ArrayList(); - protected boolean notPlayer; - protected TargetController playerTarget = TargetController.ANY; + protected List playerId = new ArrayList(); + protected boolean notPlayer; + protected TargetController playerTarget = TargetController.ANY; - public FilterPlayer() { - super("player"); - } + public FilterPlayer() { + super("player"); + } - public FilterPlayer(FilterPlayer filter) { - super(filter); + public FilterPlayer(FilterPlayer filter) { + super(filter); this.playerId.addAll(filter.playerId); - this.notPlayer = filter.notPlayer; - this.playerTarget = filter.playerTarget; - } + this.notPlayer = filter.notPlayer; + this.playerTarget = filter.playerTarget; + } - @Override - public boolean match(Player player, Game game) { + @Override + public boolean match(Player player, Game game) { - if (playerId.size() > 0 && playerId.contains(player.getId()) == notPlayer) - return notFilter; + if (playerId.size() > 0 && playerId.contains(player.getId()) == notPlayer) + return notFilter; - return !notFilter; - } + return !notFilter; + } - public boolean match(Player player, UUID sourceId, UUID playerId, Game game) { - if (!this.match(player, game)) - return notFilter; + public boolean match(Player player, UUID sourceId, UUID playerId, Game game) { + if (!this.match(player, game)) + return notFilter; - if (playerTarget != TargetController.ANY && playerId != null) { - switch(playerTarget) { - case YOU: - if (!player.getId().equals(playerId)) - return notFilter; - break; - case OPPONENT: - if (!game.getOpponents(playerId).contains(player.getId())) - return notFilter; - break; - case NOT_YOU: - if (player.getId().equals(playerId)) - return notFilter; - break; - } - } + if (playerTarget != TargetController.ANY && playerId != null) { + switch(playerTarget) { + case YOU: + if (!player.getId().equals(playerId)) + return notFilter; + break; + case OPPONENT: + if (!game.getOpponents(playerId).contains(player.getId())) + return notFilter; + break; + case NOT_YOU: + if (player.getId().equals(playerId)) + return notFilter; + break; + } + } - return !notFilter; - } + return !notFilter; + } - public List getPlayerId() { - return playerId; - } + public List getPlayerId() { + return playerId; + } - public void setNotPlayer(boolean notPlayer) { - this.notPlayer = notPlayer; - } + public void setNotPlayer(boolean notPlayer) { + this.notPlayer = notPlayer; + } - public void setPlayerTarget(TargetController playerTarget) { - this.playerTarget = playerTarget; - } + public void setPlayerTarget(TargetController playerTarget) { + this.playerTarget = playerTarget; + } - @Override - public FilterPlayer copy() { - return new FilterPlayer(this); - } + @Override + public FilterPlayer copy() { + return new FilterPlayer(this); + } } diff --git a/Mage/src/mage/filter/FilterSpell.java b/Mage/src/mage/filter/FilterSpell.java index 7733130865..7157ffd607 100644 --- a/Mage/src/mage/filter/FilterSpell.java +++ b/Mage/src/mage/filter/FilterSpell.java @@ -43,54 +43,54 @@ public class FilterSpell> extends FilterStackObject> extends FilterObject> { - protected List controllerId = new ArrayList(); - protected boolean notController = false; - protected TargetController controller = TargetController.ANY; + protected List controllerId = new ArrayList(); + protected boolean notController = false; + protected TargetController controller = TargetController.ANY; - public FilterStackObject() { - super("spell or ability"); - } + public FilterStackObject() { + super("spell or ability"); + } - public FilterStackObject(String name) { - super(name); - } + public FilterStackObject(String name) { + super(name); + } - public FilterStackObject(final FilterStackObject filter) { - super(filter); + public FilterStackObject(final FilterStackObject filter) { + super(filter); this.controllerId.addAll(filter.controllerId); - this.notController = filter.notController; - this.controller = filter.controller; - } + this.notController = filter.notController; + this.controller = filter.controller; + } - @Override - public boolean match(StackObject spell, Game game) { + @Override + public boolean match(StackObject spell, Game game) { - if (!super.match(spell, game)) - return notFilter; + if (!super.match(spell, game)) + return notFilter; - if (controllerId.size() > 0 && controllerId.contains(spell.getControllerId()) == notController) - return notFilter; + if (controllerId.size() > 0 && controllerId.contains(spell.getControllerId()) == notController) + return notFilter; - return !notFilter; - } + return !notFilter; + } - public boolean match(StackObject spell, UUID playerId, Game game) { - if (!this.match(spell, game)) - return notFilter; + public boolean match(StackObject spell, UUID playerId, Game game) { + if (!this.match(spell, game)) + return notFilter; - if (controller != TargetController.ANY && playerId != null) { - switch(controller) { - case YOU: - if (!spell.getControllerId().equals(playerId)) - return notFilter; - break; - case OPPONENT: - if (!game.getOpponents(playerId).contains(spell.getControllerId())) - return notFilter; - break; - case NOT_YOU: - if (spell.getControllerId().equals(playerId)) - return notFilter; - break; - } - } + if (controller != TargetController.ANY && playerId != null) { + switch(controller) { + case YOU: + if (!spell.getControllerId().equals(playerId)) + return notFilter; + break; + case OPPONENT: + if (!game.getOpponents(playerId).contains(spell.getControllerId())) + return notFilter; + break; + case NOT_YOU: + if (spell.getControllerId().equals(playerId)) + return notFilter; + break; + } + } - return !notFilter; - } + return !notFilter; + } - public List getControllerId() { - return controllerId; - } + public List getControllerId() { + return controllerId; + } - public void setNotController(boolean notController) { - this.notController = notController; - } + public void setNotController(boolean notController) { + this.notController = notController; + } - public void setTargetController(TargetController controller) { - this.controller = controller; - } + public void setTargetController(TargetController controller) { + this.controller = controller; + } - @Override - public FilterStackObject copy() { - return new FilterStackObject(this); - } + @Override + public FilterStackObject copy() { + return new FilterStackObject(this); + } } diff --git a/Mage/src/mage/filter/ListComparer.java b/Mage/src/mage/filter/ListComparer.java index cf8dd866fc..75f870d49a 100644 --- a/Mage/src/mage/filter/ListComparer.java +++ b/Mage/src/mage/filter/ListComparer.java @@ -38,18 +38,18 @@ import mage.filter.Filter.ComparisonScope; */ public class ListComparer { - public boolean compare(List list1, List list2, ComparisonScope scope, boolean negate) { - if (scope == ComparisonScope.All) { - if (list2.containsAll(list1) == negate) { - return false; - } - } - else { - List check = new ArrayList(list1); - if (check.removeAll(list2) == negate) { - return false; - } - } - return true; - } + public boolean compare(List list1, List list2, ComparisonScope scope, boolean negate) { + if (scope == ComparisonScope.All) { + if (list2.containsAll(list1) == negate) { + return false; + } + } + else { + List check = new ArrayList(list1); + if (check.removeAll(list2) == negate) { + return false; + } + } + return true; + } } diff --git a/Mage/src/mage/filter/common/FilterArtifactCard.java b/Mage/src/mage/filter/common/FilterArtifactCard.java index 33fd8b6547..a6b9c6b726 100644 --- a/Mage/src/mage/filter/common/FilterArtifactCard.java +++ b/Mage/src/mage/filter/common/FilterArtifactCard.java @@ -37,21 +37,21 @@ import mage.filter.FilterCard; */ public class FilterArtifactCard extends FilterCard { - public FilterArtifactCard() { - this("artifact"); - } + public FilterArtifactCard() { + this("artifact"); + } - public FilterArtifactCard(String name) { - super(name); - this.cardType.add(CardType.ARTIFACT); - } + public FilterArtifactCard(String name) { + super(name); + this.cardType.add(CardType.ARTIFACT); + } - public FilterArtifactCard(final FilterArtifactCard filter) { - super(filter); - } + public FilterArtifactCard(final FilterArtifactCard filter) { + super(filter); + } - @Override - public FilterArtifactCard copy() { - return new FilterArtifactCard(this); - } + @Override + public FilterArtifactCard copy() { + return new FilterArtifactCard(this); + } } diff --git a/Mage/src/mage/filter/common/FilterArtifactPermanent.java b/Mage/src/mage/filter/common/FilterArtifactPermanent.java index 73ae91d9ea..8072a52527 100644 --- a/Mage/src/mage/filter/common/FilterArtifactPermanent.java +++ b/Mage/src/mage/filter/common/FilterArtifactPermanent.java @@ -39,65 +39,65 @@ import mage.game.permanent.Permanent; */ public class FilterArtifactPermanent> extends FilterPermanent> { - protected boolean useAttacking; - protected boolean attacking; - protected boolean useBlocking; - protected boolean blocking; + protected boolean useAttacking; + protected boolean attacking; + protected boolean useBlocking; + protected boolean blocking; - public FilterArtifactPermanent() { - this("artifact"); - } + public FilterArtifactPermanent() { + this("artifact"); + } - public FilterArtifactPermanent(String name) { - super(name); - cardType.add(CardType.ARTIFACT); - } + public FilterArtifactPermanent(String name) { + super(name); + cardType.add(CardType.ARTIFACT); + } - public FilterArtifactPermanent(final FilterArtifactPermanent filter) { - super(filter); - this.useAttacking = filter.useAttacking; - this.attacking = filter.attacking; - this.useBlocking = filter.useBlocking; - this.blocking = filter.blocking; - this.useTapped = filter.useTapped; - this.tapped = filter.tapped; - } + public FilterArtifactPermanent(final FilterArtifactPermanent filter) { + super(filter); + this.useAttacking = filter.useAttacking; + this.attacking = filter.attacking; + this.useBlocking = filter.useBlocking; + this.blocking = filter.blocking; + this.useTapped = filter.useTapped; + this.tapped = filter.tapped; + } - @Override - public boolean match(Permanent permanent, Game game) { - if (!super.match(permanent, game)) - return notFilter; + @Override + public boolean match(Permanent permanent, Game game) { + if (!super.match(permanent, game)) + return notFilter; - if (useAttacking && permanent.isAttacking() != attacking) - return notFilter; + if (useAttacking && permanent.isAttacking() != attacking) + return notFilter; - if (useBlocking && (permanent.getBlocking() > 0) != blocking) - return notFilter; + if (useBlocking && (permanent.getBlocking() > 0) != blocking) + return notFilter; - if (useTapped && permanent.isTapped() != tapped) - return notFilter; + if (useTapped && permanent.isTapped() != tapped) + return notFilter; - return !notFilter; - } + return !notFilter; + } - public void setUseAttacking ( boolean useAttacking ) { - this.useAttacking = useAttacking; - } + public void setUseAttacking ( boolean useAttacking ) { + this.useAttacking = useAttacking; + } - public void setAttacking ( boolean attacking ) { - this.attacking = attacking; - } + public void setAttacking ( boolean attacking ) { + this.attacking = attacking; + } - public void setUseBlocking ( boolean useBlocking ) { - this.useBlocking = useBlocking; - } + public void setUseBlocking ( boolean useBlocking ) { + this.useBlocking = useBlocking; + } - public void setBlocking ( boolean blocking ) { - this.blocking = blocking; - } + public void setBlocking ( boolean blocking ) { + this.blocking = blocking; + } - @Override - public FilterArtifactPermanent copy() { - return new FilterArtifactPermanent(this); - } + @Override + public FilterArtifactPermanent copy() { + return new FilterArtifactPermanent(this); + } } diff --git a/Mage/src/mage/filter/common/FilterAttackingCreature.java b/Mage/src/mage/filter/common/FilterAttackingCreature.java index 256eb582dd..8c78208dcc 100644 --- a/Mage/src/mage/filter/common/FilterAttackingCreature.java +++ b/Mage/src/mage/filter/common/FilterAttackingCreature.java @@ -34,22 +34,22 @@ package mage.filter.common; */ public class FilterAttackingCreature extends FilterCreaturePermanent { - public FilterAttackingCreature() { - this("attacking creature"); - } + public FilterAttackingCreature() { + this("attacking creature"); + } - public FilterAttackingCreature(String name) { - super(name); - this.attacking = true; - this.useAttacking = true; - } + public FilterAttackingCreature(String name) { + super(name); + this.attacking = true; + this.useAttacking = true; + } - public FilterAttackingCreature(final FilterAttackingCreature filter) { - super(filter); - } + public FilterAttackingCreature(final FilterAttackingCreature filter) { + super(filter); + } - @Override - public FilterAttackingCreature copy() { - return new FilterAttackingCreature(this); - } + @Override + public FilterAttackingCreature copy() { + return new FilterAttackingCreature(this); + } } diff --git a/Mage/src/mage/filter/common/FilterAttackingOrBlockingCreature.java b/Mage/src/mage/filter/common/FilterAttackingOrBlockingCreature.java index d98d20d73c..29ad952c0f 100644 --- a/Mage/src/mage/filter/common/FilterAttackingOrBlockingCreature.java +++ b/Mage/src/mage/filter/common/FilterAttackingOrBlockingCreature.java @@ -34,24 +34,24 @@ package mage.filter.common; */ public class FilterAttackingOrBlockingCreature extends FilterCreaturePermanent { - public FilterAttackingOrBlockingCreature() { - this("attacking or blocking creature"); - } + public FilterAttackingOrBlockingCreature() { + this("attacking or blocking creature"); + } - public FilterAttackingOrBlockingCreature(String name) { - super(name); - this.attacking = true; - this.useAttacking = true; - this.blocking = true; - this.useBlocking = true; - } + public FilterAttackingOrBlockingCreature(String name) { + super(name); + this.attacking = true; + this.useAttacking = true; + this.blocking = true; + this.useBlocking = true; + } - public FilterAttackingOrBlockingCreature(final FilterAttackingOrBlockingCreature filter) { - super(filter); - } + public FilterAttackingOrBlockingCreature(final FilterAttackingOrBlockingCreature filter) { + super(filter); + } - @Override - public FilterAttackingOrBlockingCreature copy() { - return new FilterAttackingOrBlockingCreature(this); - } + @Override + public FilterAttackingOrBlockingCreature copy() { + return new FilterAttackingOrBlockingCreature(this); + } } diff --git a/Mage/src/mage/filter/common/FilterAura.java b/Mage/src/mage/filter/common/FilterAura.java index 96c470230e..5d80317edc 100644 --- a/Mage/src/mage/filter/common/FilterAura.java +++ b/Mage/src/mage/filter/common/FilterAura.java @@ -37,22 +37,22 @@ import mage.filter.FilterPermanent; */ public class FilterAura extends FilterPermanent { - public FilterAura() { - this("aura"); - } + public FilterAura() { + this("aura"); + } - public FilterAura(String name) { - super(name); - this.cardType.add(CardType.ENCHANTMENT); - this.getSubtype().add("Aura"); - } + public FilterAura(String name) { + super(name); + this.cardType.add(CardType.ENCHANTMENT); + this.getSubtype().add("Aura"); + } - public FilterAura(final FilterAura filter) { - super(filter); - } + public FilterAura(final FilterAura filter) { + super(filter); + } - @Override - public FilterAura copy() { - return new FilterAura(this); - } + @Override + public FilterAura copy() { + return new FilterAura(this); + } } diff --git a/Mage/src/mage/filter/common/FilterAuraCard.java b/Mage/src/mage/filter/common/FilterAuraCard.java index 7cd0ae328d..e9ae06cfde 100644 --- a/Mage/src/mage/filter/common/FilterAuraCard.java +++ b/Mage/src/mage/filter/common/FilterAuraCard.java @@ -37,21 +37,21 @@ import mage.filter.FilterCard; */ public class FilterAuraCard extends FilterCard { - public FilterAuraCard() { - this("aura"); - } + public FilterAuraCard() { + this("aura"); + } - public FilterAuraCard(String name) { - super(name); - this.cardType.add(CardType.ENCHANTMENT); - } + public FilterAuraCard(String name) { + super(name); + this.cardType.add(CardType.ENCHANTMENT); + } - public FilterAuraCard(final FilterAuraCard filter) { - super(filter); - } + public FilterAuraCard(final FilterAuraCard filter) { + super(filter); + } - @Override - public FilterAuraCard copy() { - return new FilterAuraCard(this); - } + @Override + public FilterAuraCard copy() { + return new FilterAuraCard(this); + } } diff --git a/Mage/src/mage/filter/common/FilterBasicLandCard.java b/Mage/src/mage/filter/common/FilterBasicLandCard.java index ceab76807a..afa7efa9ab 100644 --- a/Mage/src/mage/filter/common/FilterBasicLandCard.java +++ b/Mage/src/mage/filter/common/FilterBasicLandCard.java @@ -37,20 +37,20 @@ import mage.filter.FilterCard; */ public class FilterBasicLandCard extends FilterCard { - public FilterBasicLandCard() { - super("basic land card"); - this.cardType.add(CardType.LAND); - this.setScopeCardType(ComparisonScope.Any); - this.supertype.add("Basic"); - this.setScopeSupertype(ComparisonScope.Any); - } + public FilterBasicLandCard() { + super("basic land card"); + this.cardType.add(CardType.LAND); + this.setScopeCardType(ComparisonScope.Any); + this.supertype.add("Basic"); + this.setScopeSupertype(ComparisonScope.Any); + } - public FilterBasicLandCard(final FilterBasicLandCard filter) { - super(filter); - } + public FilterBasicLandCard(final FilterBasicLandCard filter) { + super(filter); + } - @Override - public FilterBasicLandCard copy() { - return new FilterBasicLandCard(this); - } + @Override + public FilterBasicLandCard copy() { + return new FilterBasicLandCard(this); + } } diff --git a/Mage/src/mage/filter/common/FilterBlockingCreature.java b/Mage/src/mage/filter/common/FilterBlockingCreature.java index b7e4d96db7..2144467f89 100644 --- a/Mage/src/mage/filter/common/FilterBlockingCreature.java +++ b/Mage/src/mage/filter/common/FilterBlockingCreature.java @@ -34,22 +34,22 @@ package mage.filter.common; */ public class FilterBlockingCreature extends FilterCreaturePermanent { - public FilterBlockingCreature() { - this("Blocking creature"); - } + public FilterBlockingCreature() { + this("Blocking creature"); + } - public FilterBlockingCreature(String name) { - super(name); - this.blocking = true; - this.useBlocking = true; - } + public FilterBlockingCreature(String name) { + super(name); + this.blocking = true; + this.useBlocking = true; + } - public FilterBlockingCreature(final FilterBlockingCreature filter) { - super(filter); - } + public FilterBlockingCreature(final FilterBlockingCreature filter) { + super(filter); + } - @Override - public FilterBlockingCreature copy() { - return new FilterBlockingCreature(this); - } + @Override + public FilterBlockingCreature copy() { + return new FilterBlockingCreature(this); + } } diff --git a/Mage/src/mage/filter/common/FilterControlledCreaturePermanent.java b/Mage/src/mage/filter/common/FilterControlledCreaturePermanent.java index 0dd07d892d..245936e7c0 100644 --- a/Mage/src/mage/filter/common/FilterControlledCreaturePermanent.java +++ b/Mage/src/mage/filter/common/FilterControlledCreaturePermanent.java @@ -36,22 +36,22 @@ import mage.Constants.CardType; */ public class FilterControlledCreaturePermanent extends FilterControlledPermanent> { - public FilterControlledCreaturePermanent() { - this("creature you control"); - } + public FilterControlledCreaturePermanent() { + this("creature you control"); + } - public FilterControlledCreaturePermanent(String name) { - super(name); - cardType.add(CardType.CREATURE); - } + public FilterControlledCreaturePermanent(String name) { + super(name); + cardType.add(CardType.CREATURE); + } - public FilterControlledCreaturePermanent(final FilterControlledCreaturePermanent filter) { - super(filter); - } + public FilterControlledCreaturePermanent(final FilterControlledCreaturePermanent filter) { + super(filter); + } - @Override - public FilterControlledCreaturePermanent copy() { - return new FilterControlledCreaturePermanent(this); - } + @Override + public FilterControlledCreaturePermanent copy() { + return new FilterControlledCreaturePermanent(this); + } } diff --git a/Mage/src/mage/filter/common/FilterControlledPermanent.java b/Mage/src/mage/filter/common/FilterControlledPermanent.java index 7b58e98714..c56239ee3c 100644 --- a/Mage/src/mage/filter/common/FilterControlledPermanent.java +++ b/Mage/src/mage/filter/common/FilterControlledPermanent.java @@ -37,22 +37,22 @@ import mage.filter.FilterPermanent; */ public class FilterControlledPermanent> extends FilterPermanent> { - public FilterControlledPermanent() { - this("permanent you control"); - } + public FilterControlledPermanent() { + this("permanent you control"); + } - public FilterControlledPermanent(String name) { - super(name); - this.controller = TargetController.YOU; - } + public FilterControlledPermanent(String name) { + super(name); + this.controller = TargetController.YOU; + } - public FilterControlledPermanent(final FilterControlledPermanent filter) { - super(filter); - } + public FilterControlledPermanent(final FilterControlledPermanent filter) { + super(filter); + } - @Override - public FilterControlledPermanent copy() { - return new FilterControlledPermanent(this); - } + @Override + public FilterControlledPermanent copy() { + return new FilterControlledPermanent(this); + } } diff --git a/Mage/src/mage/filter/common/FilterCreatureCard.java b/Mage/src/mage/filter/common/FilterCreatureCard.java index 87e999265d..ecfd289475 100644 --- a/Mage/src/mage/filter/common/FilterCreatureCard.java +++ b/Mage/src/mage/filter/common/FilterCreatureCard.java @@ -37,21 +37,21 @@ import mage.filter.FilterCard; */ public class FilterCreatureCard extends FilterCard { - public FilterCreatureCard() { - this("creature card"); - } + public FilterCreatureCard() { + this("creature card"); + } - public FilterCreatureCard(String name) { - super(name); - cardType.add(CardType.CREATURE); - } + public FilterCreatureCard(String name) { + super(name); + cardType.add(CardType.CREATURE); + } - public FilterCreatureCard(final FilterCreatureCard filter) { - super(filter); - } + public FilterCreatureCard(final FilterCreatureCard filter) { + super(filter); + } - @Override - public FilterCreatureCard copy() { - return new FilterCreatureCard(this); - } + @Override + public FilterCreatureCard copy() { + return new FilterCreatureCard(this); + } } diff --git a/Mage/src/mage/filter/common/FilterCreatureForAttack.java b/Mage/src/mage/filter/common/FilterCreatureForAttack.java index 78f0e6c513..235b634d55 100644 --- a/Mage/src/mage/filter/common/FilterCreatureForAttack.java +++ b/Mage/src/mage/filter/common/FilterCreatureForAttack.java @@ -38,36 +38,36 @@ import mage.game.permanent.Permanent; */ public class FilterCreatureForAttack extends FilterCreaturePermanent { - public FilterCreatureForAttack() { - this(""); - } - - public FilterCreatureForAttack(String name) { - super(name); - this.attacking = false; - this.useAttacking = true; - this.blocking = false; - this.useBlocking = true; - this.tapped = false; - this.useTapped = true; - this.abilities.add(DefenderAbility.getInstance()); - this.notAbilities = true; - } + public FilterCreatureForAttack() { + this(""); + } - public FilterCreatureForAttack(final FilterCreatureForAttack filter) { - super(filter); - } + public FilterCreatureForAttack(String name) { + super(name); + this.attacking = false; + this.useAttacking = true; + this.blocking = false; + this.useBlocking = true; + this.tapped = false; + this.useTapped = true; + this.abilities.add(DefenderAbility.getInstance()); + this.notAbilities = true; + } - @Override - public boolean match(Permanent permanent, Game game) { - if (!super.match(permanent, game)) - return notFilter; + public FilterCreatureForAttack(final FilterCreatureForAttack filter) { + super(filter); + } - return permanent.canTap(); - } + @Override + public boolean match(Permanent permanent, Game game) { + if (!super.match(permanent, game)) + return notFilter; - @Override - public FilterCreatureForAttack copy() { - return new FilterCreatureForAttack(this); - } + return permanent.canTap(); + } + + @Override + public FilterCreatureForAttack copy() { + return new FilterCreatureForAttack(this); + } } diff --git a/Mage/src/mage/filter/common/FilterCreatureForCombat.java b/Mage/src/mage/filter/common/FilterCreatureForCombat.java index e68079646c..35543beef7 100644 --- a/Mage/src/mage/filter/common/FilterCreatureForCombat.java +++ b/Mage/src/mage/filter/common/FilterCreatureForCombat.java @@ -37,35 +37,35 @@ import mage.game.permanent.Permanent; */ public class FilterCreatureForCombat extends FilterCreaturePermanent { - public FilterCreatureForCombat() { - this(""); - } - - public FilterCreatureForCombat(String name) { - super(name); - this.attacking = false; - this.useAttacking = true; - this.tapped = false; - this.useTapped = true; - this.phasedIn = true; - this.usePhased = true; - } + public FilterCreatureForCombat() { + this(""); + } - public FilterCreatureForCombat(final FilterCreatureForCombat filter) { - super(filter); - } + public FilterCreatureForCombat(String name) { + super(name); + this.attacking = false; + this.useAttacking = true; + this.tapped = false; + this.useTapped = true; + this.phasedIn = true; + this.usePhased = true; + } - @Override - public boolean match(Permanent permanent, Game game) { - if (!super.match(permanent, game)) - return notFilter; + public FilterCreatureForCombat(final FilterCreatureForCombat filter) { + super(filter); + } - return permanent.getMaxBlocks() == 0 || permanent.getBlocking() < permanent.getMaxBlocks(); - } + @Override + public boolean match(Permanent permanent, Game game) { + if (!super.match(permanent, game)) + return notFilter; - @Override - public FilterCreatureForCombat copy() { - return new FilterCreatureForCombat(this); - } + return permanent.getMaxBlocks() == 0 || permanent.getBlocking() < permanent.getMaxBlocks(); + } + + @Override + public FilterCreatureForCombat copy() { + return new FilterCreatureForCombat(this); + } } diff --git a/Mage/src/mage/filter/common/FilterCreatureOrPlayer.java b/Mage/src/mage/filter/common/FilterCreatureOrPlayer.java index 78511c070f..67a56cbbea 100644 --- a/Mage/src/mage/filter/common/FilterCreatureOrPlayer.java +++ b/Mage/src/mage/filter/common/FilterCreatureOrPlayer.java @@ -43,66 +43,66 @@ import java.util.UUID; */ public class FilterCreatureOrPlayer extends FilterImpl implements FilterInPlay { - protected FilterCreaturePermanent creatureFilter; - protected FilterPlayer playerFilter; + protected FilterCreaturePermanent creatureFilter; + protected FilterPlayer playerFilter; - public FilterCreatureOrPlayer() { - this("player or creature"); - } + public FilterCreatureOrPlayer() { + this("player or creature"); + } - public FilterCreatureOrPlayer(String name, UUID controllerId) { - super(name); - creatureFilter = new FilterCreaturePermanent(); - playerFilter = new FilterPlayer(); - creatureFilter.getControllerId().add(controllerId); - playerFilter.getPlayerId().add(controllerId); - } + public FilterCreatureOrPlayer(String name, UUID controllerId) { + super(name); + creatureFilter = new FilterCreaturePermanent(); + playerFilter = new FilterPlayer(); + creatureFilter.getControllerId().add(controllerId); + playerFilter.getPlayerId().add(controllerId); + } - public FilterCreatureOrPlayer(String name) { - super(name); - creatureFilter = new FilterCreaturePermanent(); - playerFilter = new FilterPlayer(); - } + public FilterCreatureOrPlayer(String name) { + super(name); + creatureFilter = new FilterCreaturePermanent(); + playerFilter = new FilterPlayer(); + } - public FilterCreatureOrPlayer(final FilterCreatureOrPlayer filter) { - super(filter); - this.creatureFilter = filter.creatureFilter.copy(); - this.playerFilter = filter.playerFilter.copy(); - } + public FilterCreatureOrPlayer(final FilterCreatureOrPlayer filter) { + super(filter); + this.creatureFilter = filter.creatureFilter.copy(); + this.playerFilter = filter.playerFilter.copy(); + } - @Override - public boolean match(Object o, Game game) { - if (o instanceof Player) { - return playerFilter.match((Player)o, game); - } - else if (o instanceof Permanent) { - return creatureFilter.match((Permanent)o, game); - } - return notFilter; - } + @Override + public boolean match(Object o, Game game) { + if (o instanceof Player) { + return playerFilter.match((Player)o, game); + } + else if (o instanceof Permanent) { + return creatureFilter.match((Permanent)o, game); + } + return notFilter; + } - @Override - public boolean match(Object o, UUID sourceId, UUID playerId, Game game) { - if (o instanceof Player) { - return playerFilter.match((Player)o, sourceId, playerId, game); - } - else if (o instanceof Permanent) { - return creatureFilter.match((Permanent)o, sourceId, playerId, game); - } - return notFilter; - } + @Override + public boolean match(Object o, UUID sourceId, UUID playerId, Game game) { + if (o instanceof Player) { + return playerFilter.match((Player)o, sourceId, playerId, game); + } + else if (o instanceof Permanent) { + return creatureFilter.match((Permanent)o, sourceId, playerId, game); + } + return notFilter; + } - public FilterCreaturePermanent getCreatureFilter() { - return this.creatureFilter; - } + public FilterCreaturePermanent getCreatureFilter() { + return this.creatureFilter; + } - public FilterPlayer getPlayerFilter() { - return this.playerFilter; - } + public FilterPlayer getPlayerFilter() { + return this.playerFilter; + } - @Override - public FilterCreatureOrPlayer copy() { - return new FilterCreatureOrPlayer(this); - } + @Override + public FilterCreatureOrPlayer copy() { + return new FilterCreatureOrPlayer(this); + } } diff --git a/Mage/src/mage/filter/common/FilterCreaturePermanent.java b/Mage/src/mage/filter/common/FilterCreaturePermanent.java index 1fa55cc268..6ce0c9ef32 100644 --- a/Mage/src/mage/filter/common/FilterCreaturePermanent.java +++ b/Mage/src/mage/filter/common/FilterCreaturePermanent.java @@ -39,81 +39,81 @@ import mage.game.permanent.Permanent; */ public class FilterCreaturePermanent> extends FilterPermanent> { - protected boolean useAttacking; - protected boolean attacking; - protected boolean useBlocking; - protected boolean blocking; + protected boolean useAttacking; + protected boolean attacking; + protected boolean useBlocking; + protected boolean blocking; protected boolean useDamageDealt; protected boolean damageDealt; - public FilterCreaturePermanent() { - this("creature"); - } + public FilterCreaturePermanent() { + this("creature"); + } - public FilterCreaturePermanent(String name) { - super(name); - cardType.add(CardType.CREATURE); - } + public FilterCreaturePermanent(String name) { + super(name); + cardType.add(CardType.CREATURE); + } - public FilterCreaturePermanent(final FilterCreaturePermanent filter) { - super(filter); - this.useAttacking = filter.useAttacking; - this.attacking = filter.attacking; - this.useBlocking = filter.useBlocking; - this.blocking = filter.blocking; + public FilterCreaturePermanent(final FilterCreaturePermanent filter) { + super(filter); + this.useAttacking = filter.useAttacking; + this.attacking = filter.attacking; + this.useBlocking = filter.useBlocking; + this.blocking = filter.blocking; this.useDamageDealt = filter.useDamageDealt; this.damageDealt = filter.damageDealt; - this.useTapped = filter.useTapped; - this.tapped = filter.tapped; - } + this.useTapped = filter.useTapped; + this.tapped = filter.tapped; + } - @Override - public boolean match(Permanent permanent, Game game) { - if (!super.match(permanent, game)) - return notFilter; + @Override + public boolean match(Permanent permanent, Game game) { + if (!super.match(permanent, game)) + return notFilter; - if (useAttacking) { - if (permanent.isAttacking() != attacking) { // failed checking - // for "target attacking OR blocking" filters - // we have to make sure it is not blocking before returning false - if (useBlocking) { - if ((permanent.getBlocking() > 0) != blocking) { - return notFilter; - } - } else { - // filter doesn't use 'blocking', so as checking for attacking failed return false - return notFilter; - } - } + if (useAttacking) { + if (permanent.isAttacking() != attacking) { // failed checking + // for "target attacking OR blocking" filters + // we have to make sure it is not blocking before returning false + if (useBlocking) { + if ((permanent.getBlocking() > 0) != blocking) { + return notFilter; + } + } else { + // filter doesn't use 'blocking', so as checking for attacking failed return false + return notFilter; + } + } return !notFilter; } - if (useBlocking && (permanent.getBlocking() > 0) != blocking) - return notFilter; + if (useBlocking && (permanent.getBlocking() > 0) != blocking) + return notFilter; if (useDamageDealt) { // use this instead of getDamage() because damage is reset in case of regeneration if (permanent.getDealtDamageByThisTurn().isEmpty()) return notFilter; } - return !notFilter; - } + return !notFilter; + } - public void setUseAttacking ( boolean useAttacking ) { - this.useAttacking = useAttacking; - } + public void setUseAttacking ( boolean useAttacking ) { + this.useAttacking = useAttacking; + } - public void setAttacking ( boolean attacking ) { - this.attacking = attacking; - } + public void setAttacking ( boolean attacking ) { + this.attacking = attacking; + } - public void setUseBlocking ( boolean useBlocking ) { - this.useBlocking = useBlocking; - } + public void setUseBlocking ( boolean useBlocking ) { + this.useBlocking = useBlocking; + } - public void setBlocking ( boolean blocking ) { - this.blocking = blocking; - } + public void setBlocking ( boolean blocking ) { + this.blocking = blocking; + } /** * Select creatures dependant if they already got damage * during the current turn. Works also if the creature @@ -121,19 +121,19 @@ public class FilterCreaturePermanent> exten * * @param useDamageDealt */ - public void setUseDamageDealt ( boolean useDamageDealt ) { - this.useDamageDealt = useDamageDealt; - } + public void setUseDamageDealt ( boolean useDamageDealt ) { + this.useDamageDealt = useDamageDealt; + } /** * Select creatures that got damage dealt to this turn. * @param damageDealt */ public void setDamageDealt ( boolean damageDealt ) { - this.damageDealt = damageDealt; - } + this.damageDealt = damageDealt; + } - @Override - public FilterCreaturePermanent copy() { - return new FilterCreaturePermanent(this); - } + @Override + public FilterCreaturePermanent copy() { + return new FilterCreaturePermanent(this); + } } diff --git a/Mage/src/mage/filter/common/FilterEnchantment.java b/Mage/src/mage/filter/common/FilterEnchantment.java index da02a286c9..7b105a022c 100644 --- a/Mage/src/mage/filter/common/FilterEnchantment.java +++ b/Mage/src/mage/filter/common/FilterEnchantment.java @@ -37,21 +37,21 @@ import mage.filter.FilterPermanent; */ public class FilterEnchantment extends FilterPermanent { - public FilterEnchantment() { - this("enchantment"); - } + public FilterEnchantment() { + this("enchantment"); + } - public FilterEnchantment(String name) { - super(name); - this.cardType.add(CardType.ENCHANTMENT); - } + public FilterEnchantment(String name) { + super(name); + this.cardType.add(CardType.ENCHANTMENT); + } - public FilterEnchantment(final FilterEnchantment filter) { - super(filter); - } + public FilterEnchantment(final FilterEnchantment filter) { + super(filter); + } - @Override - public FilterEnchantment copy() { - return new FilterEnchantment(this); - } + @Override + public FilterEnchantment copy() { + return new FilterEnchantment(this); + } } diff --git a/Mage/src/mage/filter/common/FilterEquipment.java b/Mage/src/mage/filter/common/FilterEquipment.java index 4fdb17f818..0cc822db56 100644 --- a/Mage/src/mage/filter/common/FilterEquipment.java +++ b/Mage/src/mage/filter/common/FilterEquipment.java @@ -37,22 +37,22 @@ import mage.filter.FilterPermanent; */ public class FilterEquipment extends FilterPermanent { - public FilterEquipment() { - this("equipment"); - } + public FilterEquipment() { + this("equipment"); + } - public FilterEquipment(String name) { - super(name); - this.cardType.add(CardType.ARTIFACT); - this.getSubtype().add("Equipment"); - } + public FilterEquipment(String name) { + super(name); + this.cardType.add(CardType.ARTIFACT); + this.getSubtype().add("Equipment"); + } - public FilterEquipment(final FilterEquipment filter) { - super(filter); - } + public FilterEquipment(final FilterEquipment filter) { + super(filter); + } - @Override - public FilterEquipment copy() { - return new FilterEquipment(this); - } + @Override + public FilterEquipment copy() { + return new FilterEquipment(this); + } } diff --git a/Mage/src/mage/filter/common/FilterFortification.java b/Mage/src/mage/filter/common/FilterFortification.java index e49b732821..241aa4cb64 100644 --- a/Mage/src/mage/filter/common/FilterFortification.java +++ b/Mage/src/mage/filter/common/FilterFortification.java @@ -37,22 +37,22 @@ import mage.filter.FilterPermanent; */ public class FilterFortification extends FilterPermanent { - public FilterFortification() { - this("fortification"); - } + public FilterFortification() { + this("fortification"); + } - public FilterFortification(String name) { - super(name); - this.cardType.add(CardType.ARTIFACT); - this.getSubtype().add("Fortification"); - } + public FilterFortification(String name) { + super(name); + this.cardType.add(CardType.ARTIFACT); + this.getSubtype().add("Fortification"); + } - public FilterFortification(final FilterFortification filter) { - super(filter); - } + public FilterFortification(final FilterFortification filter) { + super(filter); + } - @Override - public FilterFortification copy() { - return new FilterFortification(this); - } + @Override + public FilterFortification copy() { + return new FilterFortification(this); + } } diff --git a/Mage/src/mage/filter/common/FilterLandCard.java b/Mage/src/mage/filter/common/FilterLandCard.java index 739ddb455e..ddee1319c5 100644 --- a/Mage/src/mage/filter/common/FilterLandCard.java +++ b/Mage/src/mage/filter/common/FilterLandCard.java @@ -37,22 +37,22 @@ import mage.filter.FilterCard; */ public class FilterLandCard extends FilterCard { - public FilterLandCard() { - this("land card"); - } + public FilterLandCard() { + this("land card"); + } - public FilterLandCard(String name) { - super(name); - cardType.add(CardType.LAND); - } + public FilterLandCard(String name) { + super(name); + cardType.add(CardType.LAND); + } - public FilterLandCard(final FilterLandCard filter) { - super(filter); - } + public FilterLandCard(final FilterLandCard filter) { + super(filter); + } - @Override - public FilterLandCard copy() { - return new FilterLandCard(this); - } + @Override + public FilterLandCard copy() { + return new FilterLandCard(this); + } } diff --git a/Mage/src/mage/filter/common/FilterLandPermanent.java b/Mage/src/mage/filter/common/FilterLandPermanent.java index 5e0bf6aa6e..db01bd89bf 100644 --- a/Mage/src/mage/filter/common/FilterLandPermanent.java +++ b/Mage/src/mage/filter/common/FilterLandPermanent.java @@ -37,21 +37,21 @@ import mage.filter.FilterPermanent; */ public class FilterLandPermanent extends FilterPermanent { - public FilterLandPermanent() { - this("land"); - } + public FilterLandPermanent() { + this("land"); + } - public FilterLandPermanent(String name) { - super(name); - cardType.add(CardType.LAND); - } + public FilterLandPermanent(String name) { + super(name); + cardType.add(CardType.LAND); + } - public FilterLandPermanent(final FilterLandPermanent filter) { - super(filter); - } + public FilterLandPermanent(final FilterLandPermanent filter) { + super(filter); + } - @Override - public FilterLandPermanent copy() { - return new FilterLandPermanent(this); - } + @Override + public FilterLandPermanent copy() { + return new FilterLandPermanent(this); + } } diff --git a/Mage/src/mage/filter/common/FilterLegendaryPermanent.java b/Mage/src/mage/filter/common/FilterLegendaryPermanent.java index d8ba7431e7..df92661116 100644 --- a/Mage/src/mage/filter/common/FilterLegendaryPermanent.java +++ b/Mage/src/mage/filter/common/FilterLegendaryPermanent.java @@ -36,22 +36,22 @@ import mage.filter.FilterPermanent; */ public class FilterLegendaryPermanent extends FilterPermanent { - public FilterLegendaryPermanent() { - this("legend"); - } + public FilterLegendaryPermanent() { + this("legend"); + } - public FilterLegendaryPermanent(String name) { - super(name); - this.supertype.add("Legendary"); - } + public FilterLegendaryPermanent(String name) { + super(name); + this.supertype.add("Legendary"); + } - public FilterLegendaryPermanent(final FilterLegendaryPermanent filter) { - super(filter); - } + public FilterLegendaryPermanent(final FilterLegendaryPermanent filter) { + super(filter); + } - @Override - public FilterLegendaryPermanent copy() { - return new FilterLegendaryPermanent(this); - } + @Override + public FilterLegendaryPermanent copy() { + return new FilterLegendaryPermanent(this); + } } diff --git a/Mage/src/mage/filter/common/FilterNonTokenPermanent.java b/Mage/src/mage/filter/common/FilterNonTokenPermanent.java index 323c679609..6436b7868d 100644 --- a/Mage/src/mage/filter/common/FilterNonTokenPermanent.java +++ b/Mage/src/mage/filter/common/FilterNonTokenPermanent.java @@ -39,17 +39,17 @@ import mage.game.permanent.PermanentToken; */ public class FilterNonTokenPermanent extends FilterPermanent { - public FilterNonTokenPermanent() { - this("nontoken permanent"); - } - - public FilterNonTokenPermanent(String name) { - super(name); - } + public FilterNonTokenPermanent() { + this("nontoken permanent"); + } - public FilterNonTokenPermanent(final FilterNonTokenPermanent filter) { - super(filter); - } + public FilterNonTokenPermanent(String name) { + super(name); + } + + public FilterNonTokenPermanent(final FilterNonTokenPermanent filter) { + super(filter); + } @Override public boolean match(Permanent permanent, Game game) { @@ -63,10 +63,10 @@ public class FilterNonTokenPermanent extends FilterPermanent { - public FilterNonlandCard() { - this("nonland card"); - } + public FilterNonlandCard() { + this("nonland card"); + } - public FilterNonlandCard(String name) { - super(name); - this.notCardTypeList.add(CardType.LAND); - } + public FilterNonlandCard(String name) { + super(name); + this.notCardTypeList.add(CardType.LAND); + } - public FilterNonlandCard(final FilterNonlandCard filter) { - super(filter); - } + public FilterNonlandCard(final FilterNonlandCard filter) { + super(filter); + } - @Override - public FilterNonlandCard copy() { - return new FilterNonlandCard(this); - } + @Override + public FilterNonlandCard copy() { + return new FilterNonlandCard(this); + } } diff --git a/Mage/src/mage/filter/common/FilterNonlandPermanent.java b/Mage/src/mage/filter/common/FilterNonlandPermanent.java index 23a48a4f13..3af4f60a0d 100644 --- a/Mage/src/mage/filter/common/FilterNonlandPermanent.java +++ b/Mage/src/mage/filter/common/FilterNonlandPermanent.java @@ -37,23 +37,23 @@ import mage.filter.FilterPermanent; */ public class FilterNonlandPermanent extends FilterPermanent { - public FilterNonlandPermanent() { - this("nonland permanent"); - } - - public FilterNonlandPermanent(String name) { - super(name); - notCardType = true; - cardType.add(CardType.LAND); - } + public FilterNonlandPermanent() { + this("nonland permanent"); + } - public FilterNonlandPermanent(final FilterNonlandPermanent filter) { - super(filter); - } + public FilterNonlandPermanent(String name) { + super(name); + notCardType = true; + cardType.add(CardType.LAND); + } - @Override - public FilterNonlandPermanent copy() { - return new FilterNonlandPermanent(this); - } + public FilterNonlandPermanent(final FilterNonlandPermanent filter) { + super(filter); + } + + @Override + public FilterNonlandPermanent copy() { + return new FilterNonlandPermanent(this); + } } diff --git a/Mage/src/mage/filter/common/FilterNotPairedControlledCreaturePermanent.java b/Mage/src/mage/filter/common/FilterNotPairedControlledCreaturePermanent.java index 53feccb2b7..b4390b7c11 100644 --- a/Mage/src/mage/filter/common/FilterNotPairedControlledCreaturePermanent.java +++ b/Mage/src/mage/filter/common/FilterNotPairedControlledCreaturePermanent.java @@ -39,17 +39,17 @@ import java.util.UUID; */ public class FilterNotPairedControlledCreaturePermanent extends FilterControlledCreaturePermanent { - public FilterNotPairedControlledCreaturePermanent() { - this("not paired creature you control"); - } + public FilterNotPairedControlledCreaturePermanent() { + this("not paired creature you control"); + } - public FilterNotPairedControlledCreaturePermanent(String name) { - super(name); - } + public FilterNotPairedControlledCreaturePermanent(String name) { + super(name); + } - public FilterNotPairedControlledCreaturePermanent(final FilterNotPairedControlledCreaturePermanent filter) { - super(filter); - } + public FilterNotPairedControlledCreaturePermanent(final FilterNotPairedControlledCreaturePermanent filter) { + super(filter); + } @Override public boolean match(Permanent permanent, Game game) { @@ -73,9 +73,9 @@ public class FilterNotPairedControlledCreaturePermanent extends FilterControlled return !notFilter; } - @Override - public FilterNotPairedControlledCreaturePermanent copy() { - return new FilterNotPairedControlledCreaturePermanent(this); - } + @Override + public FilterNotPairedControlledCreaturePermanent copy() { + return new FilterNotPairedControlledCreaturePermanent(this); + } } diff --git a/Mage/src/mage/filter/common/FilterPermanentOrPlayer.java b/Mage/src/mage/filter/common/FilterPermanentOrPlayer.java index 856fadc913..b9f12ec893 100644 --- a/Mage/src/mage/filter/common/FilterPermanentOrPlayer.java +++ b/Mage/src/mage/filter/common/FilterPermanentOrPlayer.java @@ -43,64 +43,64 @@ import java.util.UUID; */ public class FilterPermanentOrPlayer extends FilterImpl implements FilterInPlay { - protected FilterPermanent permanentFilter; - protected FilterPlayer playerFilter; + protected FilterPermanent permanentFilter; + protected FilterPlayer playerFilter; - public FilterPermanentOrPlayer() { - this("player or permanent"); - } + public FilterPermanentOrPlayer() { + this("player or permanent"); + } - public FilterPermanentOrPlayer(String name, UUID controllerId) { - super(name); - permanentFilter = new FilterPermanent(); - playerFilter = new FilterPlayer(); - permanentFilter.getControllerId().add(controllerId); - playerFilter.getPlayerId().add(controllerId); - } + public FilterPermanentOrPlayer(String name, UUID controllerId) { + super(name); + permanentFilter = new FilterPermanent(); + playerFilter = new FilterPlayer(); + permanentFilter.getControllerId().add(controllerId); + playerFilter.getPlayerId().add(controllerId); + } - public FilterPermanentOrPlayer(String name) { - super(name); - permanentFilter = new FilterPermanent(); - playerFilter = new FilterPlayer(); - } + public FilterPermanentOrPlayer(String name) { + super(name); + permanentFilter = new FilterPermanent(); + playerFilter = new FilterPlayer(); + } - public FilterPermanentOrPlayer(final FilterPermanentOrPlayer filter) { - super(filter); - this.permanentFilter = filter.permanentFilter.copy(); - this.playerFilter = filter.playerFilter.copy(); - } + public FilterPermanentOrPlayer(final FilterPermanentOrPlayer filter) { + super(filter); + this.permanentFilter = filter.permanentFilter.copy(); + this.playerFilter = filter.playerFilter.copy(); + } - @Override - public boolean match(Object o, Game game) { - if (o instanceof Player) { - return playerFilter.match((Player) o, game); - } else if (o instanceof Permanent) { - return permanentFilter.match((Permanent) o, game); - } - return notFilter; - } + @Override + public boolean match(Object o, Game game) { + if (o instanceof Player) { + return playerFilter.match((Player) o, game); + } else if (o instanceof Permanent) { + return permanentFilter.match((Permanent) o, game); + } + return notFilter; + } - @Override - public boolean match(Object o, UUID sourceId, UUID playerId, Game game) { - if (o instanceof Player) { - return playerFilter.match((Player) o, sourceId, playerId, game); - } else if (o instanceof Permanent) { - return permanentFilter.match((Permanent) o, sourceId, playerId, game); - } - return notFilter; - } + @Override + public boolean match(Object o, UUID sourceId, UUID playerId, Game game) { + if (o instanceof Player) { + return playerFilter.match((Player) o, sourceId, playerId, game); + } else if (o instanceof Permanent) { + return permanentFilter.match((Permanent) o, sourceId, playerId, game); + } + return notFilter; + } - public FilterPermanent getPermanentFilter() { - return this.permanentFilter; - } + public FilterPermanent getPermanentFilter() { + return this.permanentFilter; + } - public FilterPlayer getPlayerFilter() { - return this.playerFilter; - } + public FilterPlayer getPlayerFilter() { + return this.playerFilter; + } - @Override - public FilterPermanentOrPlayer copy() { - return new FilterPermanentOrPlayer(this); - } + @Override + public FilterPermanentOrPlayer copy() { + return new FilterPermanentOrPlayer(this); + } } diff --git a/Mage/src/mage/filter/common/FilterPermanentOrPlayerWithCounter.java b/Mage/src/mage/filter/common/FilterPermanentOrPlayerWithCounter.java index 4266c41755..5df07140be 100644 --- a/Mage/src/mage/filter/common/FilterPermanentOrPlayerWithCounter.java +++ b/Mage/src/mage/filter/common/FilterPermanentOrPlayerWithCounter.java @@ -41,60 +41,60 @@ import java.util.UUID; */ public class FilterPermanentOrPlayerWithCounter extends FilterPermanentOrPlayer { - protected FilterPermanent permanentFilter; - protected FilterPlayer playerFilter; + protected FilterPermanent permanentFilter; + protected FilterPlayer playerFilter; - public FilterPermanentOrPlayerWithCounter() { - this("player or permanent with counters on them"); - } + public FilterPermanentOrPlayerWithCounter() { + this("player or permanent with counters on them"); + } - public FilterPermanentOrPlayerWithCounter(String name, UUID controllerId) { - super(name); - permanentFilter = new FilterPermanent(); - playerFilter = new FilterPlayer(); - permanentFilter.getControllerId().add(controllerId); - playerFilter.getPlayerId().add(controllerId); - } + public FilterPermanentOrPlayerWithCounter(String name, UUID controllerId) { + super(name); + permanentFilter = new FilterPermanent(); + playerFilter = new FilterPlayer(); + permanentFilter.getControllerId().add(controllerId); + playerFilter.getPlayerId().add(controllerId); + } - public FilterPermanentOrPlayerWithCounter(String name) { - super(name); - permanentFilter = new FilterPermanent(); - playerFilter = new FilterPlayer(); - } + public FilterPermanentOrPlayerWithCounter(String name) { + super(name); + permanentFilter = new FilterPermanent(); + playerFilter = new FilterPlayer(); + } - public FilterPermanentOrPlayerWithCounter(final FilterPermanentOrPlayerWithCounter filter) { - super(filter); - this.permanentFilter = filter.permanentFilter.copy(); - this.playerFilter = filter.playerFilter.copy(); - } + public FilterPermanentOrPlayerWithCounter(final FilterPermanentOrPlayerWithCounter filter) { + super(filter); + this.permanentFilter = filter.permanentFilter.copy(); + this.playerFilter = filter.playerFilter.copy(); + } - @Override - public boolean match(Object o, Game game) { - if (o instanceof Player) { - if (((Player)o).getCounters().size() == 0) { - return false; - } - } else if (o instanceof Permanent) { - if (((Permanent)o).getCounters().size() == 0) { - return false; - } - } - return super.match(o, game); - } + @Override + public boolean match(Object o, Game game) { + if (o instanceof Player) { + if (((Player)o).getCounters().size() == 0) { + return false; + } + } else if (o instanceof Permanent) { + if (((Permanent)o).getCounters().size() == 0) { + return false; + } + } + return super.match(o, game); + } - @Override - public boolean match(Object o, UUID sourceId, UUID playerId, Game game) { - if (o instanceof Player) { - return playerFilter.match((Player) o, sourceId, playerId, game); - } else if (o instanceof Permanent) { - return permanentFilter.match((Permanent) o, sourceId, playerId, game); - } - return notFilter; - } + @Override + public boolean match(Object o, UUID sourceId, UUID playerId, Game game) { + if (o instanceof Player) { + return playerFilter.match((Player) o, sourceId, playerId, game); + } else if (o instanceof Permanent) { + return permanentFilter.match((Permanent) o, sourceId, playerId, game); + } + return notFilter; + } - @Override - public FilterPermanentOrPlayerWithCounter copy() { - return new FilterPermanentOrPlayerWithCounter(this); - } + @Override + public FilterPermanentOrPlayerWithCounter copy() { + return new FilterPermanentOrPlayerWithCounter(this); + } } diff --git a/Mage/src/mage/filter/common/FilterPlaneswalkerOrPlayer.java b/Mage/src/mage/filter/common/FilterPlaneswalkerOrPlayer.java index d5b098ddeb..50b7a69ae7 100644 --- a/Mage/src/mage/filter/common/FilterPlaneswalkerOrPlayer.java +++ b/Mage/src/mage/filter/common/FilterPlaneswalkerOrPlayer.java @@ -44,36 +44,36 @@ import java.util.UUID; */ public class FilterPlaneswalkerOrPlayer extends FilterImpl implements Filter { - protected FilterPlaneswalkerPermanent planeswalkerFilter; - protected FilterPlayer playerFilter; + protected FilterPlaneswalkerPermanent planeswalkerFilter; + protected FilterPlayer playerFilter; - public FilterPlaneswalkerOrPlayer(Set defenders) { - super("planeswalker or player"); - planeswalkerFilter = new FilterPlaneswalkerPermanent(); - planeswalkerFilter.getControllerId().addAll(defenders); - playerFilter = new FilterPlayer(); - playerFilter.getPlayerId().addAll(defenders); - } + public FilterPlaneswalkerOrPlayer(Set defenders) { + super("planeswalker or player"); + planeswalkerFilter = new FilterPlaneswalkerPermanent(); + planeswalkerFilter.getControllerId().addAll(defenders); + playerFilter = new FilterPlayer(); + playerFilter.getPlayerId().addAll(defenders); + } - public FilterPlaneswalkerOrPlayer(final FilterPlaneswalkerOrPlayer filter) { - super(filter); - this.planeswalkerFilter = filter.planeswalkerFilter.copy(); - this.playerFilter = filter.playerFilter.copy(); - } + public FilterPlaneswalkerOrPlayer(final FilterPlaneswalkerOrPlayer filter) { + super(filter); + this.planeswalkerFilter = filter.planeswalkerFilter.copy(); + this.playerFilter = filter.playerFilter.copy(); + } - @Override - public boolean match(Object o, Game game) { - if (o instanceof Player) { - return playerFilter.match((Player)o, game); - } - else if (o instanceof Permanent) { - return planeswalkerFilter.match((Permanent)o, game); - } - return notFilter; - } + @Override + public boolean match(Object o, Game game) { + if (o instanceof Player) { + return playerFilter.match((Player)o, game); + } + else if (o instanceof Permanent) { + return planeswalkerFilter.match((Permanent)o, game); + } + return notFilter; + } - @Override - public FilterPlaneswalkerOrPlayer copy() { - return new FilterPlaneswalkerOrPlayer(this); - } + @Override + public FilterPlaneswalkerOrPlayer copy() { + return new FilterPlaneswalkerOrPlayer(this); + } } \ No newline at end of file diff --git a/Mage/src/mage/filter/common/FilterPlaneswalkerPermanent.java b/Mage/src/mage/filter/common/FilterPlaneswalkerPermanent.java index 9ad4c9841b..a8423f85c3 100644 --- a/Mage/src/mage/filter/common/FilterPlaneswalkerPermanent.java +++ b/Mage/src/mage/filter/common/FilterPlaneswalkerPermanent.java @@ -37,21 +37,21 @@ import mage.filter.FilterPermanent; */ public class FilterPlaneswalkerPermanent extends FilterPermanent { - public FilterPlaneswalkerPermanent() { - this("planeswalker"); - } + public FilterPlaneswalkerPermanent() { + this("planeswalker"); + } - public FilterPlaneswalkerPermanent(String name) { - super(name); - cardType.add(CardType.PLANESWALKER); - } + public FilterPlaneswalkerPermanent(String name) { + super(name); + cardType.add(CardType.PLANESWALKER); + } - public FilterPlaneswalkerPermanent(final FilterPlaneswalkerPermanent filter) { - super(filter); - } + public FilterPlaneswalkerPermanent(final FilterPlaneswalkerPermanent filter) { + super(filter); + } - @Override - public FilterPlaneswalkerPermanent copy() { - return new FilterPlaneswalkerPermanent(this); - } + @Override + public FilterPlaneswalkerPermanent copy() { + return new FilterPlaneswalkerPermanent(this); + } } diff --git a/Mage/src/mage/filter/common/FilterSpellOrPermanent.java b/Mage/src/mage/filter/common/FilterSpellOrPermanent.java index 7df5af2e67..1b12e089d6 100644 --- a/Mage/src/mage/filter/common/FilterSpellOrPermanent.java +++ b/Mage/src/mage/filter/common/FilterSpellOrPermanent.java @@ -45,64 +45,64 @@ import java.util.UUID; */ public class FilterSpellOrPermanent extends FilterImpl implements FilterInPlay { - protected FilterPermanent permanentFilter; - protected FilterSpell spellFilter; + protected FilterPermanent permanentFilter; + protected FilterSpell spellFilter; - public FilterSpellOrPermanent() { - this("spell or permanent"); - } + public FilterSpellOrPermanent() { + this("spell or permanent"); + } - public FilterSpellOrPermanent(String name, UUID controllerId) { - super(name); - permanentFilter = new FilterPermanent(); - spellFilter = new FilterSpell(); - permanentFilter.getControllerId().add(controllerId); - spellFilter.getControllerId().add(controllerId); - } + public FilterSpellOrPermanent(String name, UUID controllerId) { + super(name); + permanentFilter = new FilterPermanent(); + spellFilter = new FilterSpell(); + permanentFilter.getControllerId().add(controllerId); + spellFilter.getControllerId().add(controllerId); + } - public FilterSpellOrPermanent(String name) { - super(name); - permanentFilter = new FilterPermanent(); - spellFilter = new FilterSpell(); - } + public FilterSpellOrPermanent(String name) { + super(name); + permanentFilter = new FilterPermanent(); + spellFilter = new FilterSpell(); + } - public FilterSpellOrPermanent(final FilterSpellOrPermanent filter) { - super(filter); - this.permanentFilter = filter.permanentFilter.copy(); - this.spellFilter = filter.spellFilter.copy(); - } + public FilterSpellOrPermanent(final FilterSpellOrPermanent filter) { + super(filter); + this.permanentFilter = filter.permanentFilter.copy(); + this.spellFilter = filter.spellFilter.copy(); + } - @Override - public boolean match(Object o, Game game) { - if (o instanceof Spell) { - return spellFilter.match((Spell) o, game); - } else if (o instanceof Permanent) { - return permanentFilter.match((Permanent) o, game); - } - return notFilter; - } + @Override + public boolean match(Object o, Game game) { + if (o instanceof Spell) { + return spellFilter.match((Spell) o, game); + } else if (o instanceof Permanent) { + return permanentFilter.match((Permanent) o, game); + } + return notFilter; + } - @Override - public boolean match(Object o, UUID sourceId, UUID playerId, Game game) { - if (o instanceof Spell) { - return spellFilter.match((Spell) o, playerId, game); - } else if (o instanceof Permanent) { - return permanentFilter.match((Permanent) o, sourceId, playerId, game); - } - return notFilter; - } + @Override + public boolean match(Object o, UUID sourceId, UUID playerId, Game game) { + if (o instanceof Spell) { + return spellFilter.match((Spell) o, playerId, game); + } else if (o instanceof Permanent) { + return permanentFilter.match((Permanent) o, sourceId, playerId, game); + } + return notFilter; + } - public FilterPermanent getPermanentFilter() { - return this.permanentFilter; - } + public FilterPermanent getPermanentFilter() { + return this.permanentFilter; + } - public FilterSpell getspellFilter() { - return this.spellFilter; - } + public FilterSpell getspellFilter() { + return this.spellFilter; + } - @Override - public FilterSpellOrPermanent copy() { - return new FilterSpellOrPermanent(this); - } + @Override + public FilterSpellOrPermanent copy() { + return new FilterSpellOrPermanent(this); + } } diff --git a/Mage/src/mage/filter/common/FilterSpiritOrArcaneCard.java b/Mage/src/mage/filter/common/FilterSpiritOrArcaneCard.java index 3638273744..7a37670528 100644 --- a/Mage/src/mage/filter/common/FilterSpiritOrArcaneCard.java +++ b/Mage/src/mage/filter/common/FilterSpiritOrArcaneCard.java @@ -6,22 +6,22 @@ import mage.filter.FilterSpell; public class FilterSpiritOrArcaneCard extends FilterSpell { public FilterSpiritOrArcaneCard() { - this("a Spirit or Arcane spell"); - } + this("a Spirit or Arcane spell"); + } - public FilterSpiritOrArcaneCard(String name) { - super(name); - this.getSubtype().add("Spirit"); + public FilterSpiritOrArcaneCard(String name) { + super(name); + this.getSubtype().add("Spirit"); this.getSubtype().add("Arcane"); this.setScopeSubtype(Filter.ComparisonScope.Any); - } + } - public FilterSpiritOrArcaneCard(final FilterSpiritOrArcaneCard filter) { - super(filter); - } + public FilterSpiritOrArcaneCard(final FilterSpiritOrArcaneCard filter) { + super(filter); + } - @Override - public FilterSpiritOrArcaneCard copy() { - return new FilterSpiritOrArcaneCard(this); - } + @Override + public FilterSpiritOrArcaneCard copy() { + return new FilterSpiritOrArcaneCard(this); + } } diff --git a/Mage/src/mage/filter/common/FilterToken.java b/Mage/src/mage/filter/common/FilterToken.java index 0a288523d7..def8455f47 100644 --- a/Mage/src/mage/filter/common/FilterToken.java +++ b/Mage/src/mage/filter/common/FilterToken.java @@ -38,30 +38,30 @@ import mage.game.permanent.PermanentToken; */ public class FilterToken> extends FilterCreaturePermanent> { - public FilterToken() { - this("creature token"); - } + public FilterToken() { + this("creature token"); + } - public FilterToken(String name) { - super(name); - } + public FilterToken(String name) { + super(name); + } - public FilterToken(final FilterToken filter) { - super(filter); - } + public FilterToken(final FilterToken filter) { + super(filter); + } - @Override - public boolean match(Permanent permanent, Game game) { + @Override + public boolean match(Permanent permanent, Game game) { if (!(permanent instanceof PermanentToken)) return notFilter; - if (!super.match(permanent, game)) - return notFilter; + if (!super.match(permanent, game)) + return notFilter; - return !notFilter; - } + return !notFilter; + } - @Override - public FilterToken copy() { - return new FilterToken(this); - } + @Override + public FilterToken copy() { + return new FilterToken(this); + } } diff --git a/Mage/src/mage/filter/common/FilterUntappedCreature.java b/Mage/src/mage/filter/common/FilterUntappedCreature.java index 6bdeca3357..b64c13ce1e 100644 --- a/Mage/src/mage/filter/common/FilterUntappedCreature.java +++ b/Mage/src/mage/filter/common/FilterUntappedCreature.java @@ -34,22 +34,22 @@ package mage.filter.common; */ public class FilterUntappedCreature extends FilterCreaturePermanent { - public FilterUntappedCreature() { - this("untapped creature"); - } + public FilterUntappedCreature() { + this("untapped creature"); + } - public FilterUntappedCreature(String name) { - super(name); - this.tapped = false; - this.useTapped = true; - } + public FilterUntappedCreature(String name) { + super(name); + this.tapped = false; + this.useTapped = true; + } - public FilterUntappedCreature(final FilterUntappedCreature filter) { - super(filter); - } + public FilterUntappedCreature(final FilterUntappedCreature filter) { + super(filter); + } - @Override - public FilterUntappedCreature copy() { - return new FilterUntappedCreature(this); - } + @Override + public FilterUntappedCreature copy() { + return new FilterUntappedCreature(this); + } } diff --git a/Mage/src/mage/game/Exile.java b/Mage/src/mage/game/Exile.java index d6a00ea17e..0ff60a73ba 100644 --- a/Mage/src/mage/game/Exile.java +++ b/Mage/src/mage/game/Exile.java @@ -41,60 +41,60 @@ import java.util.Map.Entry; */ public class Exile implements Serializable, Copyable { - private static final UUID PERMANENT = UUID.randomUUID(); + private static final UUID PERMANENT = UUID.randomUUID(); - private Map exileZones = new HashMap(); + private Map exileZones = new HashMap(); - public Exile() { - createZone(PERMANENT, "Permanent"); - } + public Exile() { + createZone(PERMANENT, "Permanent"); + } - public Exile(final Exile exile) { - for (Entry entry: exile.exileZones.entrySet()) { - exileZones.put(entry.getKey(), entry.getValue().copy()); - } - } + public Exile(final Exile exile) { + for (Entry entry: exile.exileZones.entrySet()) { + exileZones.put(entry.getKey(), entry.getValue().copy()); + } + } - public Collection getExileZones() { - return exileZones.values(); - } + public Collection getExileZones() { + return exileZones.values(); + } - public ExileZone getPermanentExile() { - return exileZones.get(PERMANENT); - } + public ExileZone getPermanentExile() { + return exileZones.get(PERMANENT); + } - public void add(UUID id, String name, Card card) { - createZone(id, name).add(card); - } - - public void add(Card card) { - exileZones.get(PERMANENT).add(card); - } + public void add(UUID id, String name, Card card) { + createZone(id, name).add(card); + } - public ExileZone createZone(UUID id, String name) { - return createZone(id, name + " - Exile", false); - } + public void add(Card card) { + exileZones.get(PERMANENT).add(card); + } - public ExileZone createZone(UUID id, String name, boolean hidden) { - if (!exileZones.containsKey(id)) { - ExileZone exile = new ExileZone(id, name, hidden); - exileZones.put(id, exile); - } - return exileZones.get(id); - } + public ExileZone createZone(UUID id, String name) { + return createZone(id, name + " - Exile", false); + } - public ExileZone getExileZone(UUID id) { - return exileZones.get(id); - } + public ExileZone createZone(UUID id, String name, boolean hidden) { + if (!exileZones.containsKey(id)) { + ExileZone exile = new ExileZone(id, name, hidden); + exileZones.put(id, exile); + } + return exileZones.get(id); + } + + public ExileZone getExileZone(UUID id) { + return exileZones.get(id); + } + + public Card getCard(UUID cardId, Game game) { + for (ExileZone exile: exileZones.values()) { + if (exile.contains(cardId)) + return game.getCard(cardId); + } + return null; + } - public Card getCard(UUID cardId, Game game) { - for (ExileZone exile: exileZones.values()) { - if (exile.contains(cardId)) - return game.getCard(cardId); - } - return null; - } - public List getAllCards(Game game) { List cards = new ArrayList(); for (ExileZone exile: exileZones.values()) { @@ -104,16 +104,16 @@ public class Exile implements Serializable, Copyable { } public void removeCard(Card card, Game game) { - for (ExileZone exile: exileZones.values()) { - if (exile.contains(card.getId())) - exile.remove(card); - } + for (ExileZone exile: exileZones.values()) { + if (exile.contains(card.getId())) + exile.remove(card); + } + } + + @Override + public Exile copy() { + return new Exile(this); } - - @Override - public Exile copy() { - return new Exile(this); - } public void clear() { for (ExileZone exile: exileZones.values()) { diff --git a/Mage/src/mage/game/ExileZone.java b/Mage/src/mage/game/ExileZone.java index 4d35805dc3..0c0c9c8585 100644 --- a/Mage/src/mage/game/ExileZone.java +++ b/Mage/src/mage/game/ExileZone.java @@ -39,42 +39,42 @@ import mage.cards.CardsImpl; */ public class ExileZone extends CardsImpl implements Serializable { - private UUID id; - private String name; - private boolean hidden; + private UUID id; + private String name; + private boolean hidden; - public ExileZone(UUID id, String name) { - this(id, name, false); - } + public ExileZone(UUID id, String name) { + this(id, name, false); + } - public ExileZone(UUID id, String name, boolean hidden) { - super(Zone.EXILED); - this.id = id; - this.name = name; - this.hidden = hidden; - } + public ExileZone(UUID id, String name, boolean hidden) { + super(Zone.EXILED); + this.id = id; + this.name = name; + this.hidden = hidden; + } - public ExileZone(final ExileZone zone) { - super(zone); - this.id = zone.id; - this.name = zone.name; - this.hidden = zone.hidden; - } + public ExileZone(final ExileZone zone) { + super(zone); + this.id = zone.id; + this.name = zone.name; + this.hidden = zone.hidden; + } - public UUID getId() { - return id; - } + public UUID getId() { + return id; + } - public String getName() { - return name; - } + public String getName() { + return name; + } - public boolean isHidden() { - return hidden; - } + public boolean isHidden() { + return hidden; + } - @Override - public ExileZone copy() { - return new ExileZone(this); - } + @Override + public ExileZone copy() { + return new ExileZone(this); + } } diff --git a/Mage/src/mage/game/Game.java b/Mage/src/mage/game/Game.java index 0cf596473b..a15051b7d3 100644 --- a/Mage/src/mage/game/Game.java +++ b/Mage/src/mage/game/Game.java @@ -68,102 +68,102 @@ import java.util.*; public interface Game extends MageItem, Serializable { - public MatchType getGameType(); - public int getNumPlayers(); - public int getLife(); - public RangeOfInfluence getRangeOfInfluence(); - public MultiplayerAttackOption getAttackOption(); - - //game data methods - public void loadCards(Set cards, UUID ownerId); - public Collection getCards(); - public Object getCustomData(); - public void setCustomData(Object data); + public MatchType getGameType(); + public int getNumPlayers(); + public int getLife(); + public RangeOfInfluence getRangeOfInfluence(); + public MultiplayerAttackOption getAttackOption(); + + //game data methods + public void loadCards(Set cards, UUID ownerId); + public Collection getCards(); + public Object getCustomData(); + public void setCustomData(Object data); public GameOptions getOptions(); - public MageObject getObject(UUID objectId); + public MageObject getObject(UUID objectId); public MageObject getEmblem(UUID objectId); - public UUID getControllerId(UUID objectId); - public Permanent getPermanent(UUID permanentId); - public Card getCard(UUID cardId); - public void setZone(UUID objectId, Zone zone); - public void addPlayer(Player player, Deck deck) throws GameException; - public Player getPlayer(UUID playerId); - public Players getPlayers(); - public PlayerList getPlayerList(); - public Set getOpponents(UUID playerId); - public Turn getTurn(); - public Phase getPhase(); - public Step getStep(); - public int getTurnNum(); - public boolean isMainPhase(); - public boolean canPlaySorcery(UUID playerId); - public UUID getActivePlayerId(); - public UUID getPriorityPlayerId(); - public void leave(UUID playerId); - public boolean isGameOver(); - public Battlefield getBattlefield(); - public SpellStack getStack(); - public Exile getExile(); - public Combat getCombat(); - public GameState getState(); - public String getWinner(); - public ContinuousEffects getContinuousEffects(); - public GameStates getGameStates(); - public void loadGameStates(GameStates states); - public Game copy(); - public boolean isSimulation(); - public void setSimulation(boolean simulation); - public MageObject getLastKnownInformation(UUID objectId, Zone zone); + public UUID getControllerId(UUID objectId); + public Permanent getPermanent(UUID permanentId); + public Card getCard(UUID cardId); + public void setZone(UUID objectId, Zone zone); + public void addPlayer(Player player, Deck deck) throws GameException; + public Player getPlayer(UUID playerId); + public Players getPlayers(); + public PlayerList getPlayerList(); + public Set getOpponents(UUID playerId); + public Turn getTurn(); + public Phase getPhase(); + public Step getStep(); + public int getTurnNum(); + public boolean isMainPhase(); + public boolean canPlaySorcery(UUID playerId); + public UUID getActivePlayerId(); + public UUID getPriorityPlayerId(); + public void leave(UUID playerId); + public boolean isGameOver(); + public Battlefield getBattlefield(); + public SpellStack getStack(); + public Exile getExile(); + public Combat getCombat(); + public GameState getState(); + public String getWinner(); + public ContinuousEffects getContinuousEffects(); + public GameStates getGameStates(); + public void loadGameStates(GameStates states); + public Game copy(); + public boolean isSimulation(); + public void setSimulation(boolean simulation); + public MageObject getLastKnownInformation(UUID objectId, Zone zone); public MageObject getShortLivingLKI(UUID objectId, Zone zone); - public void rememberLKI(UUID objectId, Zone zone, MageObject object); - public void resetLKI(); + public void rememberLKI(UUID objectId, Zone zone, MageObject object); + public void resetLKI(); public void resetShortLivingLKI(); public void setLosingPlayer(Player player); public Player getLosingPlayer(); public void setStateCheckRequired(); public boolean getStateCheckRequired(); - //client event methods - public void addTableEventListener(Listener listener); - public void addPlayerQueryEventListener(Listener listener); - public void fireAskPlayerEvent(UUID playerId, String message); - public void fireChooseEvent(UUID playerId, Choice choice); - public void fireSelectTargetEvent(UUID playerId, String message, Set targets, boolean required, Map options); - public void fireSelectTargetEvent(UUID playerId, String message, Cards cards, boolean required, Map options); - public void fireSelectTargetEvent(UUID playerId, String message, List abilities); - public void fireSelectTargetEvent(UUID playerId, String message, List perms, boolean required); - public void fireSelectEvent(UUID playerId, String message); - public void fireLookAtCardsEvent(UUID playerId, String message, Cards cards); - public void firePriorityEvent(UUID playerId); - public void firePlayManaEvent(UUID playerId, String message); - public void firePlayXManaEvent(UUID playerId, String message); - public void fireGetChoiceEvent(UUID playerId, String message, Collection choices); - public void fireGetModeEvent(UUID playerId, String message, Map modes); - public void fireGetAmountEvent(UUID playerId, String message, int min, int max); + //client event methods + public void addTableEventListener(Listener listener); + public void addPlayerQueryEventListener(Listener listener); + public void fireAskPlayerEvent(UUID playerId, String message); + public void fireChooseEvent(UUID playerId, Choice choice); + public void fireSelectTargetEvent(UUID playerId, String message, Set targets, boolean required, Map options); + public void fireSelectTargetEvent(UUID playerId, String message, Cards cards, boolean required, Map options); + public void fireSelectTargetEvent(UUID playerId, String message, List abilities); + public void fireSelectTargetEvent(UUID playerId, String message, List perms, boolean required); + public void fireSelectEvent(UUID playerId, String message); + public void fireLookAtCardsEvent(UUID playerId, String message, Cards cards); + public void firePriorityEvent(UUID playerId); + public void firePlayManaEvent(UUID playerId, String message); + public void firePlayXManaEvent(UUID playerId, String message); + public void fireGetChoiceEvent(UUID playerId, String message, Collection choices); + public void fireGetModeEvent(UUID playerId, String message, Map modes); + public void fireGetAmountEvent(UUID playerId, String message, int min, int max); public void fireChoosePileEvent(UUID playerId, String message, List pile1, List pile2); - public void fireInformEvent(String message); - public void fireUpdatePlayersEvent(); - public void informPlayers(String message); + public void fireInformEvent(String message); + public void fireUpdatePlayersEvent(); + public void informPlayers(String message); public void informPlayer(Player player, String message); public void debugMessage(String message); - public void fireErrorEvent(String message, Exception ex); - - //game event methods - public void fireEvent(GameEvent event); - public boolean replaceEvent(GameEvent event); + public void fireErrorEvent(String message, Exception ex); - //game play methods - public void start(UUID choosingPlayerId); - public void start(UUID choosingPlayerId, GameOptions options); + //game event methods + public void fireEvent(GameEvent event); + public boolean replaceEvent(GameEvent event); + + //game play methods + public void start(UUID choosingPlayerId); + public void start(UUID choosingPlayerId, GameOptions options); public void resume(); public void pause(); public boolean isPaused(); - public void end(); - public void mulligan(UUID playerId); - public void quit(UUID playerId); - public void concede(UUID playerId); - public void emptyManaPools(); - public void addEffect(ContinuousEffect continuousEffect, Ability source); + public void end(); + public void mulligan(UUID playerId); + public void quit(UUID playerId); + public void concede(UUID playerId); + public void emptyManaPools(); + public void addEffect(ContinuousEffect continuousEffect, Ability source); public void addEmblem(Emblem emblem, Ability source); /** @@ -177,28 +177,28 @@ public interface Game extends MageItem, Serializable { public void copyPermanent(Permanent copyFromPermanent, Permanent copyToPermanent, Ability source, ApplyToPermanent applier); public void addTriggeredAbility(TriggeredAbility ability); - public void addDelayedTriggeredAbility(DelayedTriggeredAbility delayedAbility); - public void applyEffects(); - public boolean checkStateAndTriggered(); - public void playPriority(UUID activePlayerId, boolean resuming); - public boolean endTurn(UUID playerId); + public void addDelayedTriggeredAbility(DelayedTriggeredAbility delayedAbility); + public void applyEffects(); + public boolean checkStateAndTriggered(); + public void playPriority(UUID activePlayerId, boolean resuming); + public boolean endTurn(UUID playerId); public int doAction(MageAction action); - //game transaction methods - public void saveState(); - public int bookmarkState(); - public void restoreState(int bookmark); - public void removeBookmark(int bookmark); + //game transaction methods + public void saveState(); + public int bookmarkState(); + public void restoreState(int bookmark); + public void removeBookmark(int bookmark); - // game options - public void setGameOptions(GameOptions options); + // game options + public void setGameOptions(GameOptions options); // game times public Date getStartTime(); public Date getEndTime(); - - // game cheats (for tests only) - public void cheat(UUID ownerId, Map commands); - public void cheat(UUID ownerId, List library, List hand, List battlefield, List graveyard); + + // game cheats (for tests only) + public void cheat(UUID ownerId, Map commands); + public void cheat(UUID ownerId, List library, List hand, List battlefield, List graveyard); } diff --git a/Mage/src/mage/game/GameException.java b/Mage/src/mage/game/GameException.java index 53fb6db049..61ae6182a4 100644 --- a/Mage/src/mage/game/GameException.java +++ b/Mage/src/mage/game/GameException.java @@ -36,8 +36,8 @@ import mage.MageException; */ public class GameException extends MageException { - public GameException (String message) { - super(message); - } + public GameException (String message) { + super(message); + } } diff --git a/Mage/src/mage/game/GameImpl.java b/Mage/src/mage/game/GameImpl.java index 5e5942357b..629a355242 100644 --- a/Mage/src/mage/game/GameImpl.java +++ b/Mage/src/mage/game/GameImpl.java @@ -82,37 +82,37 @@ import java.util.*; public abstract class GameImpl> implements Game, Serializable { - private final static transient Logger logger = Logger.getLogger(GameImpl.class); + private final static transient Logger logger = Logger.getLogger(GameImpl.class); - private static FilterAura filterAura = new FilterAura(); + private static FilterAura filterAura = new FilterAura(); private static FilterLegendaryPermanent filterLegendary = new FilterLegendaryPermanent(); - private static FilterEquipment filterEquipment = new FilterEquipment(); - private static FilterFortification filterFortification = new FilterFortification(); - private static Random rnd = new Random(); + private static FilterEquipment filterEquipment = new FilterEquipment(); + private static FilterFortification filterFortification = new FilterFortification(); + private static Random rnd = new Random(); - private transient Stack savedStates = new Stack(); - private transient Object customData; - protected boolean simulation = false; + private transient Stack savedStates = new Stack(); + private transient Object customData; + protected boolean simulation = false; - protected final UUID id; - protected boolean ready; - protected transient TableEventSource tableEventSource = new TableEventSource(); - protected transient PlayerQueryEventSource playerQueryEventSource = new PlayerQueryEventSource(); + protected final UUID id; + protected boolean ready; + protected transient TableEventSource tableEventSource = new TableEventSource(); + protected transient PlayerQueryEventSource playerQueryEventSource = new PlayerQueryEventSource(); - protected Map gameCards = new HashMap(); - protected Map lki = new HashMap(); + protected Map gameCards = new HashMap(); + protected Map lki = new HashMap(); protected Map shortLivingLKI = new HashMap(); - protected GameState state; + protected GameState state; protected Date startTime; protected Date endTime; - protected UUID startingPlayerId; - protected UUID winnerId; + protected UUID startingPlayerId; + protected UUID winnerId; - protected transient GameStates gameStates = new GameStates(); - protected RangeOfInfluence range; - protected MultiplayerAttackOption attackOption; - protected GameOptions gameOptions; + protected transient GameStates gameStates = new GameStates(); + protected RangeOfInfluence range; + protected MultiplayerAttackOption attackOption; + protected GameOptions gameOptions; public static volatile int copyCount = 0; public static volatile long copyTime = 0; @@ -123,35 +123,35 @@ public abstract class GameImpl> implements Game, Serializa private Player losingPlayer; private boolean stateCheckRequired = false; - @Override - public abstract T copy(); + @Override + public abstract T copy(); - public GameImpl(MultiplayerAttackOption attackOption, RangeOfInfluence range) { - this.id = UUID.randomUUID(); - this.range = range; - this.attackOption = attackOption; - this.state = new GameState(); + public GameImpl(MultiplayerAttackOption attackOption, RangeOfInfluence range) { + this.id = UUID.randomUUID(); + this.range = range; + this.attackOption = attackOption; + this.state = new GameState(); this.actions = new LinkedList(); - } + } - public GameImpl(final GameImpl game) { + public GameImpl(final GameImpl game) { long t1 = 0; if (logger.isDebugEnabled()) { t1 = System.currentTimeMillis(); } - this.id = game.id; - this.ready = game.ready; - this.startingPlayerId = game.startingPlayerId; - this.winnerId = game.winnerId; - this.range = game.range; - this.attackOption = game.attackOption; - this.state = game.state.copy(); - // Issue 350 - this.gameCards = game.gameCards; + this.id = game.id; + this.ready = game.ready; + this.startingPlayerId = game.startingPlayerId; + this.winnerId = game.winnerId; + this.range = game.range; + this.attackOption = game.attackOption; + this.state = game.state.copy(); + // Issue 350 + this.gameCards = game.gameCards; // for (Map.Entry entry: game.gameCards.entrySet()) { // this.gameCards.put(entry.getKey(), entry.getValue().copy()); -// } - this.simulation = game.simulation; +// } + this.simulation = game.simulation; this.gameOptions = game.gameOptions; this.lki.putAll(game.lki); this.shortLivingLKI.putAll(game.shortLivingLKI); @@ -162,98 +162,98 @@ public abstract class GameImpl> implements Game, Serializa this.actions = new LinkedList(); this.stateCheckRequired = game.stateCheckRequired; this.scorePlayer = game.scorePlayer; - } + } - @Override - public boolean isSimulation() { - return simulation; - } - - @Override - public void setSimulation(boolean simulation) { - this.simulation = simulation; - } + @Override + public boolean isSimulation() { + return simulation; + } - @Override - public UUID getId() { - return id; - } + @Override + public void setSimulation(boolean simulation) { + this.simulation = simulation; + } - @Override - public Object getCustomData() { - return customData; - } + @Override + public UUID getId() { + return id; + } + + @Override + public Object getCustomData() { + return customData; + } + + @Override + public void setCustomData(Object data) { + this.customData = data; + } - @Override - public void setCustomData(Object data) { - this.customData = data; - } - @Override public GameOptions getOptions() { return gameOptions; } - @Override - public void loadCards(Set cards, UUID ownerId) { - for (Card card: cards) { + @Override + public void loadCards(Set cards, UUID ownerId) { + for (Card card: cards) { if (card instanceof PermanentCard) { card = ((PermanentCard)card).getCard(); } - card.setOwnerId(ownerId); - gameCards.put(card.getId(), card); + card.setOwnerId(ownerId); + gameCards.put(card.getId(), card); state.addCard(card); - } - } + } + } - @Override - public Collection getCards() { - return gameCards.values(); - } + @Override + public Collection getCards() { + return gameCards.values(); + } - @Override - public void addPlayer(Player player, Deck deck) throws GameException { - player.useDeck(deck, this); - state.addPlayer(player); - } + @Override + public void addPlayer(Player player, Deck deck) throws GameException { + player.useDeck(deck, this); + state.addPlayer(player); + } - @Override - public RangeOfInfluence getRangeOfInfluence() { - return range; - } + @Override + public RangeOfInfluence getRangeOfInfluence() { + return range; + } - @Override - public MultiplayerAttackOption getAttackOption() { - return attackOption; - } + @Override + public MultiplayerAttackOption getAttackOption() { + return attackOption; + } - @Override - public Player getPlayer(UUID playerId) { - if (playerId == null) - return null; - return state.getPlayer(playerId); - } + @Override + public Player getPlayer(UUID playerId) { + if (playerId == null) + return null; + return state.getPlayer(playerId); + } - @Override - public MageObject getObject(UUID objectId) { - if (objectId == null) - return null; - MageObject object; - if (state.getBattlefield().containsPermanent(objectId)) { - object = state.getBattlefield().getPermanent(objectId); - state.setZone(objectId, Zone.BATTLEFIELD); - return object; - } - for (StackObject item: state.getStack()) { - if (item.getId().equals(objectId)) { - state.setZone(objectId, Zone.STACK); - return item; - } + @Override + public MageObject getObject(UUID objectId) { + if (objectId == null) + return null; + MageObject object; + if (state.getBattlefield().containsPermanent(objectId)) { + object = state.getBattlefield().getPermanent(objectId); + state.setZone(objectId, Zone.BATTLEFIELD); + return object; + } + for (StackObject item: state.getStack()) { + if (item.getId().equals(objectId)) { + state.setZone(objectId, Zone.STACK); + return item; + } if (item.getSourceId().equals(objectId)) { return item; } - } - object = getCard(objectId); + } + object = getCard(objectId); if (object == null) { for (CommandObject commandObject : state.getCommand()) { @@ -263,8 +263,8 @@ public abstract class GameImpl> implements Game, Serializa } } - return object; - } + return object; + } @Override public MageObject getEmblem(UUID objectId) { @@ -278,108 +278,108 @@ public abstract class GameImpl> implements Game, Serializa return null; } - @Override - public UUID getControllerId(UUID objectId) { - if (objectId == null) { - return null; - } - MageObject object = getObject(objectId); - if (object != null) { - if (object instanceof Permanent) { - return ((Permanent)object).getControllerId(); - } - if (object instanceof Card) { - return ((Card)object).getOwnerId(); - } - } - return null; - } + @Override + public UUID getControllerId(UUID objectId) { + if (objectId == null) { + return null; + } + MageObject object = getObject(objectId); + if (object != null) { + if (object instanceof Permanent) { + return ((Permanent)object).getControllerId(); + } + if (object instanceof Card) { + return ((Card)object).getOwnerId(); + } + } + return null; + } - @Override - public Permanent getPermanent(UUID permanentId) { - return state.getPermanent(permanentId); - } + @Override + public Permanent getPermanent(UUID permanentId) { + return state.getPermanent(permanentId); + } - @Override - public Card getCard(UUID cardId) { - if (cardId == null) - return null; - return gameCards.get(cardId); - } + @Override + public Card getCard(UUID cardId) { + if (cardId == null) + return null; + return gameCards.get(cardId); + } -// @Override -// public Zone getZone(UUID objectId) { -// return state.getZone(objectId); -// } +// @Override +// public Zone getZone(UUID objectId) { +// return state.getZone(objectId); +// } - @Override - public void setZone(UUID objectId, Zone zone) { - state.setZone(objectId, zone); - } + @Override + public void setZone(UUID objectId, Zone zone) { + state.setZone(objectId, zone); + } - @Override - public GameStates getGameStates() { - return gameStates; - } - - @Override - public void loadGameStates(GameStates states) { - this.gameStates = states; - } + @Override + public GameStates getGameStates() { + return gameStates; + } - @Override - public void saveState() { - if (!simulation && gameStates != null) - gameStates.save(state); - } + @Override + public void loadGameStates(GameStates states) { + this.gameStates = states; + } - @Override - public boolean isGameOver() { - if (state.isGameOver()) - return true; - int remainingPlayers = 0; - int numLosers = 0; - for (Player player: state.getPlayers().values()) { - if (!player.hasLeft()) - remainingPlayers++; - if (player.hasLost()) - numLosers++; - } - if (remainingPlayers <= 1 || numLosers >= state.getPlayers().size() - 1) { - state.endGame(); + @Override + public void saveState() { + if (!simulation && gameStates != null) + gameStates.save(state); + } + + @Override + public boolean isGameOver() { + if (state.isGameOver()) + return true; + int remainingPlayers = 0; + int numLosers = 0; + for (Player player: state.getPlayers().values()) { + if (!player.hasLeft()) + remainingPlayers++; + if (player.hasLost()) + numLosers++; + } + if (remainingPlayers <= 1 || numLosers >= state.getPlayers().size() - 1) { + state.endGame(); endTime = new Date(); - return true; - } - return false; - } + return true; + } + return false; + } - @Override - public String getWinner() { - if (winnerId == null) - return "Game is a draw"; - return "Player " + state.getPlayer(winnerId).getName() + " is the winner"; - } + @Override + public String getWinner() { + if (winnerId == null) + return "Game is a draw"; + return "Player " + state.getPlayer(winnerId).getName() + " is the winner"; + } - @Override - public GameState getState() { - return state; - } + @Override + public GameState getState() { + return state; + } - @Override - public int bookmarkState() { - if (!simulation) { - saveState(); - if (logger.isDebugEnabled()) - logger.debug("Bookmarking state: " + gameStates.getSize()); - savedStates.push(gameStates.getSize() - 1); + @Override + public int bookmarkState() { + if (!simulation) { + saveState(); + if (logger.isDebugEnabled()) + logger.debug("Bookmarking state: " + gameStates.getSize()); + savedStates.push(gameStates.getSize() - 1); return savedStates.size(); - } + } return 0; - } + } - @Override - public void restoreState(int bookmark) { - if (!simulation) { + @Override + public void restoreState(int bookmark) { + if (!simulation) { if (bookmark != 0) { int stateNum = savedStates.get(bookmark - 1); removeBookmark(bookmark); @@ -387,55 +387,55 @@ public abstract class GameImpl> implements Game, Serializa if (restore != null) state.restore(restore); } - } - } + } + } - @Override - public void removeBookmark(int bookmark) { - if (!simulation) { + @Override + public void removeBookmark(int bookmark) { + if (!simulation) { if (bookmark != 0) { while (savedStates.size() > bookmark) savedStates.pop(); } - } - } + } + } - @Override - public void start(UUID choosingPlayerId) { - start(choosingPlayerId, this.gameOptions != null ? gameOptions : GameOptions.getDefault()); - } + @Override + public void start(UUID choosingPlayerId) { + start(choosingPlayerId, this.gameOptions != null ? gameOptions : GameOptions.getDefault()); + } - @Override - public void start(UUID choosingPlayerId, GameOptions options) { + @Override + public void start(UUID choosingPlayerId, GameOptions options) { startTime = new Date(); this.gameOptions = options; scorePlayer = state.getPlayers().values().iterator().next(); - init(choosingPlayerId, options); + init(choosingPlayerId, options); play(startingPlayerId); - //saveState(); - } + //saveState(); + } @Override public void resume() { - PlayerList players = state.getPlayerList(state.getActivePlayerId()); - Player player = getPlayer(players.get()); + PlayerList players = state.getPlayerList(state.getActivePlayerId()); + Player player = getPlayer(players.get()); boolean wasPaused = state.isPaused(); state.resume(); - if (!isGameOver()) { + if (!isGameOver()) { // if (simulation) // logger.info("Turn " + Integer.toString(state.getTurnNum())); - fireInformEvent("Turn " + Integer.toString(state.getTurnNum())); - if (checkStopOnTurnOption()) return; - state.getTurn().resumePlay(this, wasPaused); - if (!isPaused() && !isGameOver()) { + fireInformEvent("Turn " + Integer.toString(state.getTurnNum())); + if (checkStopOnTurnOption()) return; + state.getTurn().resumePlay(this, wasPaused); + if (!isPaused() && !isGameOver()) { endOfTurn(); player = players.getNext(this); state.setTurnNum(state.getTurnNum() + 1); } - } + } play(player.getId()); } - + protected void play(UUID nextPlayerId) { if (!isPaused() && !isGameOver()) { PlayerList players = state.getPlayerList(nextPlayerId); @@ -457,73 +457,73 @@ public abstract class GameImpl> implements Game, Serializa if (isGameOver()) winnerId = findWinnersAndLosers(); } - - private boolean checkStopOnTurnOption() { - if (gameOptions.stopOnTurn != null && gameOptions.stopAtStep == PhaseStep.UNTAP) { - if (gameOptions.stopOnTurn.equals(state.getTurnNum())) { - winnerId = null; //DRAW - saveState(); - return true; - } - } - return false; - } - - protected void init(UUID choosingPlayerId, GameOptions gameOptions) { - for (Player player: state.getPlayers().values()) { - player.beginTurn(this); - } - fireInformEvent("game has started"); - //saveState(); - //20091005 - 103.1 + private boolean checkStopOnTurnOption() { + if (gameOptions.stopOnTurn != null && gameOptions.stopAtStep == PhaseStep.UNTAP) { + if (gameOptions.stopOnTurn.equals(state.getTurnNum())) { + winnerId = null; //DRAW + saveState(); + return true; + } + } + return false; + } + + protected void init(UUID choosingPlayerId, GameOptions gameOptions) { + for (Player player: state.getPlayers().values()) { + player.beginTurn(this); + } + fireInformEvent("game has started"); + //saveState(); + + //20091005 - 103.1 if (!gameOptions.skipInitShuffling) { //don't shuffle in test mode for card injection on top of player's libraries for (Player player: state.getPlayers().values()) { player.shuffleLibrary(this); } } - //20091005 - 103.2 - TargetPlayer targetPlayer = new TargetPlayer(); - targetPlayer.setRequired(true); - targetPlayer.setTargetName("starting player"); - Player choosingPlayer; - if (choosingPlayerId == null) { - choosingPlayer = getPlayer(pickChoosingPlayer()); - } - else { - choosingPlayer = this.getPlayer(choosingPlayerId); - } - if (choosingPlayer.choose(Outcome.Benefit, targetPlayer, null, this)) { - startingPlayerId = ((List)targetPlayer.getTargets()).get(0); - fireInformEvent(state.getPlayer(startingPlayerId).getName() + " will start"); - } - else { - return; - } + //20091005 - 103.2 + TargetPlayer targetPlayer = new TargetPlayer(); + targetPlayer.setRequired(true); + targetPlayer.setTargetName("starting player"); + Player choosingPlayer; + if (choosingPlayerId == null) { + choosingPlayer = getPlayer(pickChoosingPlayer()); + } + else { + choosingPlayer = this.getPlayer(choosingPlayerId); + } + if (choosingPlayer.choose(Outcome.Benefit, targetPlayer, null, this)) { + startingPlayerId = ((List)targetPlayer.getTargets()).get(0); + fireInformEvent(state.getPlayer(startingPlayerId).getName() + " will start"); + } + else { + return; + } - //saveState(); + //saveState(); - //20091005 - 103.3 - for (UUID playerId: state.getPlayerList(startingPlayerId)) { - Player player = getPlayer(playerId); - if (!gameOptions.testMode || player.getLife() == 0) { - player.setLife(this.getLife(), this); - } - if (!gameOptions.testMode) { - player.drawCards(7, this); - } - } + //20091005 - 103.3 + for (UUID playerId: state.getPlayerList(startingPlayerId)) { + Player player = getPlayer(playerId); + if (!gameOptions.testMode || player.getLife() == 0) { + player.setLife(this.getLife(), this); + } + if (!gameOptions.testMode) { + player.drawCards(7, this); + } + } - //20091005 - 103.4 - for (UUID playerId: state.getPlayerList(startingPlayerId)) { - Player player = getPlayer(playerId); - while (player.getHand().size() > 0 && player.chooseMulligan(this)) { - mulligan(player.getId()); - } - fireInformEvent(player.getName() + " keeps hand"); - //saveState(); - } + //20091005 - 103.4 + for (UUID playerId: state.getPlayerList(startingPlayerId)) { + Player player = getPlayer(playerId); + while (player.getHand().size() > 0 && player.chooseMulligan(this)) { + mulligan(player.getId()); + } + fireInformEvent(player.getName() + " keeps hand"); + //saveState(); + } for (UUID playerId : state.getPlayerList(startingPlayerId)) { state.getWatchers().add(new PlayerDamagedBySourceWatcher(playerId)); @@ -532,16 +532,16 @@ public abstract class GameImpl> implements Game, Serializa state.getWatchers().add(new CastSpellLastTurnWatcher()); state.getWatchers().add(new MiracleWatcher()); state.getWatchers().add(new SoulbondWatcher()); - - //20100716 - 103.5 - for (UUID playerId: state.getPlayerList(startingPlayerId)) { - Player player = getPlayer(playerId); - for (Card card: player.getHand().getCards(this)) { - if (card.getAbilities().containsKey(LeylineAbility.getInstance().getId())) { - if (player.chooseUse(Outcome.PutCardInPlay, "Do you wish to put " + card.getName() + " on the battlefield?", this)) { - card.putOntoBattlefield(this, Zone.HAND, null, player.getId()); - } - } + + //20100716 - 103.5 + for (UUID playerId: state.getPlayerList(startingPlayerId)) { + Player player = getPlayer(playerId); + for (Card card: player.getHand().getCards(this)) { + if (card.getAbilities().containsKey(LeylineAbility.getInstance().getId())) { + if (player.chooseUse(Outcome.PutCardInPlay, "Do you wish to put " + card.getName() + " on the battlefield?", this)) { + card.putOntoBattlefield(this, Zone.HAND, null, player.getId()); + } + } for (Ability ability: card.getAbilities()) { if (ability instanceof ChancellorAbility) { if (player.chooseUse(Outcome.PutCardInPlay, "Do you wish to reveal " + card.getName() + "?", this)) { @@ -552,98 +552,98 @@ public abstract class GameImpl> implements Game, Serializa } } } - } - } - } + } + } + } - protected UUID findWinnersAndLosers() { - UUID winner = null; - for (Player player: state.getPlayers().values()) { - if (player.hasWon() || (!player.hasLost() && !player.hasLeft())) { - player.won(this); - winner = player.getId(); - break; - } - } - for (Player player: state.getPlayers().values()) { - if (winner != null && !player.getId().equals(winner)) { - player.lost(this); - } - } - return winner; - } + protected UUID findWinnersAndLosers() { + UUID winner = null; + for (Player player: state.getPlayers().values()) { + if (player.hasWon() || (!player.hasLost() && !player.hasLeft())) { + player.won(this); + winner = player.getId(); + break; + } + } + for (Player player: state.getPlayers().values()) { + if (winner != null && !player.getId().equals(winner)) { + player.lost(this); + } + } + return winner; + } - protected void endOfTurn() { - for (Player player: getPlayers().values()) { - player.endOfTurn(this); - } - state.getWatchers().reset(); - } + protected void endOfTurn() { + for (Player player: getPlayers().values()) { + player.endOfTurn(this); + } + state.getWatchers().reset(); + } - protected UUID pickChoosingPlayer() { - UUID[] players = getPlayers().keySet().toArray(new UUID[0]); - UUID playerId = players[rnd.nextInt(players.length)]; - fireInformEvent(state.getPlayer(playerId).getName() + " won the toss"); - return playerId; - } + protected UUID pickChoosingPlayer() { + UUID[] players = getPlayers().keySet().toArray(new UUID[0]); + UUID playerId = players[rnd.nextInt(players.length)]; + fireInformEvent(state.getPlayer(playerId).getName() + " won the toss"); + return playerId; + } @Override public void pause() { state.pause(); } - + @Override public boolean isPaused() { return state.isPaused(); } - - @Override - public void end() { - state.endGame(); - for (Player player: state.getPlayers().values()) { - player.abort(); - } - } - @Override - public void addTableEventListener(Listener listener) { - tableEventSource.addListener(listener); - } + @Override + public void end() { + state.endGame(); + for (Player player: state.getPlayers().values()) { + player.abort(); + } + } - @Override - public void mulligan(UUID playerId) { - Player player = getPlayer(playerId); - int numCards = player.getHand().size(); - player.getLibrary().addAll(player.getHand().getCards(this), this); - player.getHand().clear(); - player.shuffleLibrary(this); - player.drawCards(numCards - 1, this); - fireInformEvent(player.getName() + " mulligans down to " + Integer.toString(numCards - 1) + " cards"); - } + @Override + public void addTableEventListener(Listener listener) { + tableEventSource.addListener(listener); + } - @Override - public synchronized void quit(UUID playerId) { - Player player = state.getPlayer(playerId); - if (player != null) { - leave(playerId); - fireInformEvent(player.getName() + " has left the game."); - } - } + @Override + public void mulligan(UUID playerId) { + Player player = getPlayer(playerId); + int numCards = player.getHand().size(); + player.getLibrary().addAll(player.getHand().getCards(this), this); + player.getHand().clear(); + player.shuffleLibrary(this); + player.drawCards(numCards - 1, this); + fireInformEvent(player.getName() + " mulligans down to " + Integer.toString(numCards - 1) + " cards"); + } - @Override - public synchronized void concede(UUID playerId) { - Player player = state.getPlayer(playerId); - if (player != null) { - player.concede(this); - fireInformEvent(player.getName() + " has conceded."); - } - } + @Override + public synchronized void quit(UUID playerId) { + Player player = state.getPlayer(playerId); + if (player != null) { + leave(playerId); + fireInformEvent(player.getName() + " has left the game."); + } + } - @Override - public void playPriority(UUID activePlayerId, boolean resuming) { + @Override + public synchronized void concede(UUID playerId) { + Player player = state.getPlayer(playerId); + if (player != null) { + player.concede(this); + fireInformEvent(player.getName() + " has conceded."); + } + } + + @Override + public void playPriority(UUID activePlayerId, boolean resuming) { int bookmark = 0; - try { - while (!isPaused() && !isGameOver()) { + try { + while (!isPaused() && !isGameOver()) { if (!resuming) { state.getPlayers().resetPassed(); state.getPlayerList().setCurrent(activePlayerId); @@ -651,8 +651,8 @@ public abstract class GameImpl> implements Game, Serializa else { state.getPlayerList().setCurrent(this.getPriorityPlayerId()); } - Player player; - while (!isPaused() && !isGameOver()) { + Player player; + while (!isPaused() && !isGameOver()) { try { //if (bookmark == 0) //bookmark = bookmarkState(); @@ -701,64 +701,64 @@ public abstract class GameImpl> implements Game, Serializa bookmark = 0; continue; } - state.getPlayerList().getNext(); - } + state.getPlayerList().getNext(); + } //removeBookmark(bookmark); bookmark = 0; - } - } catch (Exception ex) { - logger.fatal("Game exception ", ex); - this.fireErrorEvent("Game exception occurred: ", ex); - } finally { - resetLKI(); - } - } + } + } catch (Exception ex) { + logger.fatal("Game exception ", ex); + this.fireErrorEvent("Game exception occurred: ", ex); + } finally { + resetLKI(); + } + } - //resolve top StackObject - protected void resolve() { - StackObject top = null; - try { - top = state.getStack().peek(); - top.resolve(this); - } finally { - if (top != null) - state.getStack().remove(top); - } - } + //resolve top StackObject + protected void resolve() { + StackObject top = null; + try { + top = state.getStack().peek(); + top.resolve(this); + } finally { + if (top != null) + state.getStack().remove(top); + } + } protected boolean allPassed() { - for (Player player: state.getPlayers().values()) { - if (!player.isPassed() && !player.hasLost() && !player.hasLeft()) - return false; - } - return true; - } + for (Player player: state.getPlayers().values()) { + if (!player.isPassed() && !player.hasLost() && !player.hasLeft()) + return false; + } + return true; + } - @Override - public void emptyManaPools() { - if (!replaceEvent(new GameEvent(GameEvent.EventType.EMPTY_MANA_POOLS, null, null, null))) { - for (Player player: getPlayers().values()) { - player.getManaPool().emptyPool(); - } - } - } + @Override + public void emptyManaPools() { + if (!replaceEvent(new GameEvent(GameEvent.EventType.EMPTY_MANA_POOLS, null, null, null))) { + for (Player player: getPlayers().values()) { + player.getManaPool().emptyPool(); + } + } + } - @Override - public synchronized void applyEffects() { - state.applyEffects(this); - } + @Override + public synchronized void applyEffects() { + state.applyEffects(this); + } - @Override - public void addEffect(ContinuousEffect continuousEffect, Ability source) { + @Override + public void addEffect(ContinuousEffect continuousEffect, Ability source) { Ability newAbility = source.copy(); ContinuousEffect newEffect = (ContinuousEffect)continuousEffect.copy(); - newEffect.newId(); - newEffect.setTimestamp(); - newEffect.init(newAbility, this); + newEffect.newId(); + newEffect.setTimestamp(); + newEffect.init(newAbility, this); state.addEffect(newEffect, newAbility); - } + } @Override public void addEmblem(Emblem emblem, Ability source) { @@ -814,8 +814,8 @@ public abstract class GameImpl> implements Game, Serializa state.addEffect(newEffect, newAbility); } - @Override - public void addTriggeredAbility(TriggeredAbility ability) { + @Override + public void addTriggeredAbility(TriggeredAbility ability) { if (ability instanceof TriggeredManaAbility) { // 20110715 - 605.4 ability.resolve(this); @@ -825,62 +825,62 @@ public abstract class GameImpl> implements Game, Serializa newAbility.newId(); state.addTriggeredAbility(newAbility); } - } - - @Override - public void addDelayedTriggeredAbility(DelayedTriggeredAbility delayedAbility) { - DelayedTriggeredAbility newAbility = (DelayedTriggeredAbility) delayedAbility.copy(); - newAbility.newId(); - state.addDelayedTriggeredAbility(newAbility); - } + } - @Override - public boolean checkStateAndTriggered() { - boolean somethingHappened = false; - //20091005 - 115.5 - while (!isPaused() && !this.isGameOver()) { - if (!checkStateBasedActions() ) { - if (isPaused() || this.isGameOver() || !checkTriggered()) { - break; - } - } - somethingHappened = true; - } - return somethingHappened; - } + @Override + public void addDelayedTriggeredAbility(DelayedTriggeredAbility delayedAbility) { + DelayedTriggeredAbility newAbility = (DelayedTriggeredAbility) delayedAbility.copy(); + newAbility.newId(); + state.addDelayedTriggeredAbility(newAbility); + } - public boolean checkTriggered() { - boolean played = false; - for (UUID playerId: state.getPlayerList(state.getActivePlayerId())) { - Player player = getPlayer(playerId); - while (true) { - List abilities = state.getTriggered(player.getId()); - if (abilities.isEmpty()) - break; - if (abilities.size() == 1) { - state.removeTriggeredAbility(abilities.get(0)); - played |= player.triggerAbility(abilities.get(0), this); - } - else { - TriggeredAbility ability = player.chooseTriggeredAbility(abilities, this); - state.removeTriggeredAbility(ability); - played |= player.triggerAbility(ability, this); - } - } - } - return played; - } + @Override + public boolean checkStateAndTriggered() { + boolean somethingHappened = false; + //20091005 - 115.5 + while (!isPaused() && !this.isGameOver()) { + if (!checkStateBasedActions() ) { + if (isPaused() || this.isGameOver() || !checkTriggered()) { + break; + } + } + somethingHappened = true; + } + return somethingHappened; + } - protected boolean checkStateBasedActions() { - boolean somethingHappened = false; + public boolean checkTriggered() { + boolean played = false; + for (UUID playerId: state.getPlayerList(state.getActivePlayerId())) { + Player player = getPlayer(playerId); + while (true) { + List abilities = state.getTriggered(player.getId()); + if (abilities.isEmpty()) + break; + if (abilities.size() == 1) { + state.removeTriggeredAbility(abilities.get(0)); + played |= player.triggerAbility(abilities.get(0), this); + } + else { + TriggeredAbility ability = player.chooseTriggeredAbility(abilities, this); + state.removeTriggeredAbility(ability); + played |= player.triggerAbility(ability, this); + } + } + } + return played; + } + + protected boolean checkStateBasedActions() { + boolean somethingHappened = false; + + //20091005 - 704.5a/704.5b/704.5c + for (Player player: state.getPlayers().values()) { + if (!player.hasLost() && (player.getLife() <= 0 || player.isEmptyDraw() || player.getCounters().getCount(CounterType.POISON) >= 10)) { + player.lost(this); + } + } - //20091005 - 704.5a/704.5b/704.5c - for (Player player: state.getPlayers().values()) { - if (!player.hasLost() && (player.getLife() <= 0 || player.isEmptyDraw() || player.getCounters().getCount(CounterType.POISON) >= 10)) { - player.lost(this); - } - } - List planeswalkers = new ArrayList(); List legendary = new ArrayList(); for (Permanent perm: getBattlefield().getAllActivePermanents()) { @@ -996,345 +996,345 @@ public abstract class GameImpl> implements Game, Serializa } } //20091005 - 704.5q - if (perm.getAttachments().size() > 0) { - for (UUID attachmentId: perm.getAttachments()) { - Permanent attachment = getPermanent(attachmentId); - if (attachment != null && !(attachment.getSubtype().contains("Aura") || - attachment.getSubtype().contains("Equipment") || - attachment.getSubtype().contains("Fortification"))) { - if (perm.removeAttachment(attachment.getId(), this)) { - somethingHappened = true; + if (perm.getAttachments().size() > 0) { + for (UUID attachmentId: perm.getAttachments()) { + Permanent attachment = getPermanent(attachmentId); + if (attachment != null && !(attachment.getSubtype().contains("Aura") || + attachment.getSubtype().contains("Equipment") || + attachment.getSubtype().contains("Fortification"))) { + if (perm.removeAttachment(attachment.getId(), this)) { + somethingHappened = true; break; } - } - } - } + } + } + } //20110501 - 704.5r if (perm.getCounters().containsKey(CounterType.P1P1) && perm.getCounters().containsKey(CounterType.M1M1)) { - int p1p1 = perm.getCounters().getCount(CounterType.P1P1); - int m1m1 = perm.getCounters().getCount(CounterType.M1M1); - int min = Math.min(p1p1, m1m1); - perm.getCounters().removeCounter(CounterType.P1P1, min); - perm.getCounters().removeCounter(CounterType.M1M1, min); - } + int p1p1 = perm.getCounters().getCount(CounterType.P1P1); + int m1m1 = perm.getCounters().getCount(CounterType.M1M1); + int min = Math.min(p1p1, m1m1); + perm.getCounters().removeCounter(CounterType.P1P1, min); + perm.getCounters().removeCounter(CounterType.M1M1, min); + } } - //20091005 - 704.5j, 801.14 - if (planeswalkers.size() > 1) { //don't bother checking if less than 2 planeswalkers in play - for (Permanent planeswalker: planeswalkers) { - for (String planeswalkertype: planeswalker.getSubtype()) { - FilterPlaneswalkerPermanent filterPlaneswalker = new FilterPlaneswalkerPermanent(); - filterPlaneswalker.getSubtype().add(planeswalkertype); - filterPlaneswalker.setScopeSubtype(ComparisonScope.Any); - if (getBattlefield().contains(filterPlaneswalker, planeswalker.getControllerId(), this, 2)) { - for (Permanent perm: getBattlefield().getActivePermanents(filterPlaneswalker, planeswalker.getControllerId(), this)) { - perm.moveToZone(Zone.GRAVEYARD, null, this, false); - } - return true; - } - } - } - } - //20091005 - 704.5k, 801.12 - if (legendary.size() > 1) { //don't bother checking if less than 2 legends in play - for (Permanent legend: legendary) { - FilterLegendaryPermanent filterLegendName = new FilterLegendaryPermanent(); - filterLegendName.getName().add(legend.getName()); - if (getBattlefield().contains(filterLegendName, legend.getControllerId(), this, 2)) { - for (Permanent dupLegend: getBattlefield().getActivePermanents(filterLegendName, legend.getControllerId(), this)) { - dupLegend.moveToZone(Zone.GRAVEYARD, null, this, false); - } - return true; - } - } - } + //20091005 - 704.5j, 801.14 + if (planeswalkers.size() > 1) { //don't bother checking if less than 2 planeswalkers in play + for (Permanent planeswalker: planeswalkers) { + for (String planeswalkertype: planeswalker.getSubtype()) { + FilterPlaneswalkerPermanent filterPlaneswalker = new FilterPlaneswalkerPermanent(); + filterPlaneswalker.getSubtype().add(planeswalkertype); + filterPlaneswalker.setScopeSubtype(ComparisonScope.Any); + if (getBattlefield().contains(filterPlaneswalker, planeswalker.getControllerId(), this, 2)) { + for (Permanent perm: getBattlefield().getActivePermanents(filterPlaneswalker, planeswalker.getControllerId(), this)) { + perm.moveToZone(Zone.GRAVEYARD, null, this, false); + } + return true; + } + } + } + } + //20091005 - 704.5k, 801.12 + if (legendary.size() > 1) { //don't bother checking if less than 2 legends in play + for (Permanent legend: legendary) { + FilterLegendaryPermanent filterLegendName = new FilterLegendaryPermanent(); + filterLegendName.getName().add(legend.getName()); + if (getBattlefield().contains(filterLegendName, legend.getControllerId(), this, 2)) { + for (Permanent dupLegend: getBattlefield().getActivePermanents(filterLegendName, legend.getControllerId(), this)) { + dupLegend.moveToZone(Zone.GRAVEYARD, null, this, false); + } + return true; + } + } + } - //TODO: implement the rest + //TODO: implement the rest - return somethingHappened; - } + return somethingHappened; + } - @Override - public void addPlayerQueryEventListener(Listener listener) { - playerQueryEventSource.addListener(listener); - } + @Override + public void addPlayerQueryEventListener(Listener listener) { + playerQueryEventSource.addListener(listener); + } - @Override - public synchronized void firePriorityEvent(UUID playerId) { + @Override + public synchronized void firePriorityEvent(UUID playerId) { if (simulation) return; - String message = this.state.getTurn().getStepType().toString(); - if (this.canPlaySorcery(playerId)) - message += " - play spells and abilities."; - else - message += " - play instants and activated abilities."; + String message = this.state.getTurn().getStepType().toString(); + if (this.canPlaySorcery(playerId)) + message += " - play spells and abilities."; + else + message += " - play instants and activated abilities."; - playerQueryEventSource.select(playerId, message); - } + playerQueryEventSource.select(playerId, message); + } - @Override - public synchronized void fireSelectEvent(UUID playerId, String message) { + @Override + public synchronized void fireSelectEvent(UUID playerId, String message) { if (simulation) return; - playerQueryEventSource.select(playerId, message); - } + playerQueryEventSource.select(playerId, message); + } - @Override - public void firePlayManaEvent(UUID playerId, String message) { + @Override + public void firePlayManaEvent(UUID playerId, String message) { if (simulation) return; - playerQueryEventSource.playMana(playerId, message); - } + playerQueryEventSource.playMana(playerId, message); + } - @Override - public void firePlayXManaEvent(UUID playerId, String message) { + @Override + public void firePlayXManaEvent(UUID playerId, String message) { if (simulation) return; - playerQueryEventSource.playXMana(playerId, message); - } + playerQueryEventSource.playXMana(playerId, message); + } - @Override - public void fireAskPlayerEvent(UUID playerId, String message) { + @Override + public void fireAskPlayerEvent(UUID playerId, String message) { if (simulation) return; - playerQueryEventSource.ask(playerId, message); - } + playerQueryEventSource.ask(playerId, message); + } - @Override - public void fireGetChoiceEvent(UUID playerId, String message, Collection choices) { + @Override + public void fireGetChoiceEvent(UUID playerId, String message, Collection choices) { if (simulation) return; - playerQueryEventSource.chooseAbility(playerId, message, choices); - } + playerQueryEventSource.chooseAbility(playerId, message, choices); + } - @Override - public void fireGetModeEvent(UUID playerId, String message, Map modes) { + @Override + public void fireGetModeEvent(UUID playerId, String message, Map modes) { if (simulation) return; - playerQueryEventSource.chooseMode(playerId, message, modes); - } + playerQueryEventSource.chooseMode(playerId, message, modes); + } - @Override - public void fireSelectTargetEvent(UUID playerId, String message, Set targets, boolean required, Map options) { + @Override + public void fireSelectTargetEvent(UUID playerId, String message, Set targets, boolean required, Map options) { if (simulation) return; - playerQueryEventSource.target(playerId, message, targets, required, options); - } + playerQueryEventSource.target(playerId, message, targets, required, options); + } - @Override - public void fireSelectTargetEvent(UUID playerId, String message, Cards cards, boolean required, Map options) { + @Override + public void fireSelectTargetEvent(UUID playerId, String message, Cards cards, boolean required, Map options) { if (simulation) return; - playerQueryEventSource.target(playerId, message, cards, required, options); - } + playerQueryEventSource.target(playerId, message, cards, required, options); + } - @Override - public void fireSelectTargetEvent(UUID playerId, String message, List abilities) { + @Override + public void fireSelectTargetEvent(UUID playerId, String message, List abilities) { if (simulation) return; - playerQueryEventSource.target(playerId, message, abilities); - } + playerQueryEventSource.target(playerId, message, abilities); + } - @Override - public void fireSelectTargetEvent(UUID playerId, String message, List perms, boolean required) { + @Override + public void fireSelectTargetEvent(UUID playerId, String message, List perms, boolean required) { if (simulation) return; - playerQueryEventSource.target(playerId, message, perms, required); - } + playerQueryEventSource.target(playerId, message, perms, required); + } - @Override - public void fireLookAtCardsEvent(UUID playerId, String message, Cards cards) { + @Override + public void fireLookAtCardsEvent(UUID playerId, String message, Cards cards) { if (simulation) return; - playerQueryEventSource.target(playerId, message, cards); - } + playerQueryEventSource.target(playerId, message, cards); + } - @Override - public void fireGetAmountEvent(UUID playerId, String message, int min, int max) { + @Override + public void fireGetAmountEvent(UUID playerId, String message, int min, int max) { if (simulation) return; - playerQueryEventSource.amount(playerId, message, min, max); - } + playerQueryEventSource.amount(playerId, message, min, max); + } - @Override - public void fireChooseEvent(UUID playerId, Choice choice) { + @Override + public void fireChooseEvent(UUID playerId, Choice choice) { if (simulation) return; - playerQueryEventSource.choose(playerId, choice.getMessage(), choice.getChoices()); - } - + playerQueryEventSource.choose(playerId, choice.getMessage(), choice.getChoices()); + } + @Override public void fireChoosePileEvent(UUID playerId, String message, List pile1, List pile2) { if (simulation) return; playerQueryEventSource.choosePile(playerId, message, pile1, pile2); } - - @Override - public void informPlayers(String message) { - if (simulation) return; -// state.addMessage(message); - fireInformEvent(message); - } @Override - public void debugMessage(String message) { + public void informPlayers(String message) { + if (simulation) return; +// state.addMessage(message); + fireInformEvent(message); + } + + @Override + public void debugMessage(String message) { logger.warn(message); - } + } - @Override - public void fireInformEvent(String message) { + @Override + public void fireInformEvent(String message) { if (simulation) return; - tableEventSource.fireTableEvent(EventType.INFO, message, this); - } + tableEventSource.fireTableEvent(EventType.INFO, message, this); + } - @Override - public void fireUpdatePlayersEvent() { + @Override + public void fireUpdatePlayersEvent() { if (simulation) return; - tableEventSource.fireTableEvent(EventType.UPDATE, null, this); - } - - @Override - public void fireErrorEvent(String message, Exception ex) { - tableEventSource.fireTableEvent(EventType.ERROR, message, ex, this); - } + tableEventSource.fireTableEvent(EventType.UPDATE, null, this); + } - @Override - public Players getPlayers() { - return state.getPlayers(); - } + @Override + public void fireErrorEvent(String message, Exception ex) { + tableEventSource.fireTableEvent(EventType.ERROR, message, ex, this); + } - @Override - public PlayerList getPlayerList() { - return state.getPlayerList(); - } + @Override + public Players getPlayers() { + return state.getPlayers(); + } - @Override - public Turn getTurn() { - return state.getTurn(); - } + @Override + public PlayerList getPlayerList() { + return state.getPlayerList(); + } - @Override - public Phase getPhase() { - return state.getTurn().getPhase(); - } + @Override + public Turn getTurn() { + return state.getTurn(); + } - @Override - public Step getStep() { - return state.getTurn().getStep(); - } + @Override + public Phase getPhase() { + return state.getTurn().getPhase(); + } - @Override - public Battlefield getBattlefield() { - return state.getBattlefield(); - } + @Override + public Step getStep() { + return state.getTurn().getStep(); + } - @Override - public SpellStack getStack() { - return state.getStack(); - } + @Override + public Battlefield getBattlefield() { + return state.getBattlefield(); + } - @Override - public Exile getExile() { - return state.getExile(); - } + @Override + public SpellStack getStack() { + return state.getStack(); + } - @Override - public Combat getCombat() { - return state.getCombat(); - } + @Override + public Exile getExile() { + return state.getExile(); + } - @Override - public int getTurnNum() { - return state.getTurnNum(); - } + @Override + public Combat getCombat() { + return state.getCombat(); + } - @Override - public boolean isMainPhase() { - return state.getTurn().getStepType() == PhaseStep.PRECOMBAT_MAIN || state.getTurn().getStepType() == PhaseStep.POSTCOMBAT_MAIN; - } + @Override + public int getTurnNum() { + return state.getTurnNum(); + } - @Override - public boolean canPlaySorcery(UUID playerId) { - return getActivePlayerId().equals(playerId) && getStack().isEmpty() && isMainPhase(); - } + @Override + public boolean isMainPhase() { + return state.getTurn().getStepType() == PhaseStep.PRECOMBAT_MAIN || state.getTurn().getStepType() == PhaseStep.POSTCOMBAT_MAIN; + } - @Override - public void leave(UUID playerId) { - Player player = getPlayer(playerId); - player.leave(); - //20100423 - 800.4a - for (Iterator it = getBattlefield().getAllPermanents().iterator(); it.hasNext();) { - Permanent perm = it.next(); - if (perm.getOwnerId().equals(playerId)) { - if (perm.getAttachedTo() != null) { - Permanent attachedTo = getPermanent(perm.getAttachedTo()); - if (attachedTo != null) - attachedTo.removeAttachment(perm.getId(), this); - } - it.remove(); - } - } - for (Iterator it = getStack().iterator(); it.hasNext();) { - StackObject object = it.next(); - if (object.getControllerId().equals(playerId)) { - it.remove(); - } - } - for (Iterator it = getBattlefield().getAllPermanents().iterator(); it.hasNext();) { - Permanent perm = it.next(); - if (perm.getControllerId().equals(playerId)) { - perm.moveToExile(null, "", null, this); - } - } - } + @Override + public boolean canPlaySorcery(UUID playerId) { + return getActivePlayerId().equals(playerId) && getStack().isEmpty() && isMainPhase(); + } - @Override - public UUID getActivePlayerId() { - return state.getActivePlayerId(); - } + @Override + public void leave(UUID playerId) { + Player player = getPlayer(playerId); + player.leave(); + //20100423 - 800.4a + for (Iterator it = getBattlefield().getAllPermanents().iterator(); it.hasNext();) { + Permanent perm = it.next(); + if (perm.getOwnerId().equals(playerId)) { + if (perm.getAttachedTo() != null) { + Permanent attachedTo = getPermanent(perm.getAttachedTo()); + if (attachedTo != null) + attachedTo.removeAttachment(perm.getId(), this); + } + it.remove(); + } + } + for (Iterator it = getStack().iterator(); it.hasNext();) { + StackObject object = it.next(); + if (object.getControllerId().equals(playerId)) { + it.remove(); + } + } + for (Iterator it = getBattlefield().getAllPermanents().iterator(); it.hasNext();) { + Permanent perm = it.next(); + if (perm.getControllerId().equals(playerId)) { + perm.moveToExile(null, "", null, this); + } + } + } - @Override - public UUID getPriorityPlayerId() { - return state.getPriorityPlayerId(); - } + @Override + public UUID getActivePlayerId() { + return state.getActivePlayerId(); + } - @Override - public void fireEvent(GameEvent event) { - state.handleEvent(event, this); - } + @Override + public UUID getPriorityPlayerId() { + return state.getPriorityPlayerId(); + } - @Override - public boolean replaceEvent(GameEvent event) { - return state.replaceEvent(event, this); - } + @Override + public void fireEvent(GameEvent event) { + state.handleEvent(event, this); + } - protected void removeCreaturesFromCombat() { - //20091005 - 511.3 - getCombat().endCombat(this); - } + @Override + public boolean replaceEvent(GameEvent event) { + return state.replaceEvent(event, this); + } - @Override - public ContinuousEffects getContinuousEffects() { - return state.getContinuousEffects(); - } + protected void removeCreaturesFromCombat() { + //20091005 - 511.3 + getCombat().endCombat(this); + } - private void readObject(java.io.ObjectInputStream in) throws IOException, ClassNotFoundException { - //initialize transient objects during deserialization - in.defaultReadObject(); - savedStates = new Stack(); - tableEventSource = new TableEventSource(); - playerQueryEventSource = new PlayerQueryEventSource(); - gameStates = new GameStates(); - } + @Override + public ContinuousEffects getContinuousEffects() { + return state.getContinuousEffects(); + } - /** - * Gets last known information about object in the zone. - * At the moment doesn't take into account zone (it is expected that it doesn't really matter, if not, then Map> should be used instead). - * - * Can return null. - * - * @param objectId - * @param zone - * @return - */ - @Override - public MageObject getLastKnownInformation(UUID objectId, Zone zone) { - /*if (!lki.containsKey(objectId)) { - return getCard(objectId); - }*/ + private void readObject(java.io.ObjectInputStream in) throws IOException, ClassNotFoundException { + //initialize transient objects during deserialization + in.defaultReadObject(); + savedStates = new Stack(); + tableEventSource = new TableEventSource(); + playerQueryEventSource = new PlayerQueryEventSource(); + gameStates = new GameStates(); + } + + /** + * Gets last known information about object in the zone. + * At the moment doesn't take into account zone (it is expected that it doesn't really matter, if not, then Map> should be used instead). + * + * Can return null. + * + * @param objectId + * @param zone + * @return + */ + @Override + public MageObject getLastKnownInformation(UUID objectId, Zone zone) { + /*if (!lki.containsKey(objectId)) { + return getCard(objectId); + }*/ MageObject object = lki.get(objectId); if (object != null) { return object.copy(); } return null; - } + } @Override public MageObject getShortLivingLKI(UUID objectId, Zone zone) { @@ -1345,106 +1345,106 @@ public abstract class GameImpl> implements Game, Serializa return null; } - /** - * Remembers object state to be used as Last Known Information. - * - * @param objectId - * @param zone - * @param object - */ - @Override - public void rememberLKI(UUID objectId, Zone zone, MageObject object) { + /** + * Remembers object state to be used as Last Known Information. + * + * @param objectId + * @param zone + * @param object + */ + @Override + public void rememberLKI(UUID objectId, Zone zone, MageObject object) { if (object instanceof Permanent || object instanceof StackObject) { MageObject copy = object.copy(); lki.put(objectId, copy); shortLivingLKI.put(objectId, copy); } - } + } - /** - * Reset objects stored for Last Known Information. - */ - @Override - public void resetLKI() { - lki.clear(); - } + /** + * Reset objects stored for Last Known Information. + */ + @Override + public void resetLKI() { + lki.clear(); + } @Override public void resetShortLivingLKI() { shortLivingLKI.clear(); } - @Override - public void cheat(UUID ownerId, Map commands) { - if (commands != null) { - Player player = getPlayer(ownerId); - if (player != null) { - for (Map.Entry command : commands.entrySet()) { - switch (command.getKey()) { - case HAND: - if (command.getValue().equals("clear")) { - removeCards(player.getHand()); - } - break; - case LIBRARY: - if (command.getValue().equals("clear")) { - for (UUID card : player.getLibrary().getCardList()) { - gameCards.remove(card); - } - player.getLibrary().clear(); - } - break; - case OUTSIDE: - if (command.getValue().contains("life:")) { - String[] s = command.getValue().split(":"); - if (s.length == 2) { - try { - Integer amount = Integer.parseInt(s[1]); - player.setLife(amount, this); - logger.info("Setting player's life: "); - } catch (NumberFormatException e) { - logger.fatal("error setting life", e); - } - } + @Override + public void cheat(UUID ownerId, Map commands) { + if (commands != null) { + Player player = getPlayer(ownerId); + if (player != null) { + for (Map.Entry command : commands.entrySet()) { + switch (command.getKey()) { + case HAND: + if (command.getValue().equals("clear")) { + removeCards(player.getHand()); + } + break; + case LIBRARY: + if (command.getValue().equals("clear")) { + for (UUID card : player.getLibrary().getCardList()) { + gameCards.remove(card); + } + player.getLibrary().clear(); + } + break; + case OUTSIDE: + if (command.getValue().contains("life:")) { + String[] s = command.getValue().split(":"); + if (s.length == 2) { + try { + Integer amount = Integer.parseInt(s[1]); + player.setLife(amount, this); + logger.info("Setting player's life: "); + } catch (NumberFormatException e) { + logger.fatal("error setting life", e); + } + } - } - break; - } - } - } - } - } + } + break; + } + } + } + } + } - private void removeCards(Cards cards) { - for (UUID card : cards) { - gameCards.remove(card); - } - cards.clear(); - } + private void removeCards(Cards cards) { + for (UUID card : cards) { + gameCards.remove(card); + } + cards.clear(); + } - @Override - public void cheat(UUID ownerId, List library, List hand, List battlefield, List graveyard) { - Player player = getPlayer(ownerId); - if (player != null) { - loadCards(ownerId, library); - loadCards(ownerId, hand); - loadCards(ownerId, battlefield); - loadCards(ownerId, graveyard); + @Override + public void cheat(UUID ownerId, List library, List hand, List battlefield, List graveyard) { + Player player = getPlayer(ownerId); + if (player != null) { + loadCards(ownerId, library); + loadCards(ownerId, hand); + loadCards(ownerId, battlefield); + loadCards(ownerId, graveyard); - for (Card card : library) { - setZone(card.getId(), Zone.LIBRARY); - player.getLibrary().putOnTop(card, this); - } + for (Card card : library) { + setZone(card.getId(), Zone.LIBRARY); + player.getLibrary().putOnTop(card, this); + } for (Card card : hand) { - setZone(card.getId(), Zone.HAND); - player.getHand().add(card); - } - for (Card card : graveyard) { - setZone(card.getId(), Zone.GRAVEYARD); - player.getGraveyard().add(card); - } - for (PermanentCard card : battlefield) { + setZone(card.getId(), Zone.HAND); + player.getHand().add(card); + } + for (Card card : graveyard) { + setZone(card.getId(), Zone.GRAVEYARD); + player.getGraveyard().add(card); + } + for (PermanentCard card : battlefield) { setZone(card.getId(), Zone.BATTLEFIELD); card.setOwnerId(ownerId); PermanentCard permanent = new PermanentCard(card.getCard(), ownerId); @@ -1453,52 +1453,52 @@ public abstract class GameImpl> implements Game, Serializa ((PermanentImpl)permanent).removeSummoningSickness(); if (card.isTapped()) permanent.setTapped(true); - } - applyEffects(); - } - } + } + applyEffects(); + } + } - private void loadCards(UUID ownerId, List cards) { - if (cards == null) { - return; - } - Set set = new HashSet(cards); - loadCards(set, ownerId); - } + private void loadCards(UUID ownerId, List cards) { + if (cards == null) { + return; + } + Set set = new HashSet(cards); + loadCards(set, ownerId); + } - public void replaceLibrary(List cardsDownToTop, UUID ownerId) { - Player player = getPlayer(ownerId); - if (player != null) { - for (UUID card : player.getLibrary().getCardList()) { - gameCards.remove(card); - } - player.getLibrary().clear(); - Set cards = new HashSet(); - for (Card card : cardsDownToTop) { - cards.add(card); - } - loadCards(cards, ownerId); + public void replaceLibrary(List cardsDownToTop, UUID ownerId) { + Player player = getPlayer(ownerId); + if (player != null) { + for (UUID card : player.getLibrary().getCardList()) { + gameCards.remove(card); + } + player.getLibrary().clear(); + Set cards = new HashSet(); + for (Card card : cardsDownToTop) { + cards.add(card); + } + loadCards(cards, ownerId); - for (Card card : cards) { - player.getLibrary().putOnTop(card, this); - } - } - } + for (Card card : cards) { + player.getLibrary().putOnTop(card, this); + } + } + } - @Override - public boolean endTurn(UUID playerId) { - if (!getActivePlayerId().equals(playerId)) { - return false; - } - getTurn().endTurn(this, getActivePlayerId()); - return true; - } + @Override + public boolean endTurn(UUID playerId) { + if (!getActivePlayerId().equals(playerId)) { + return false; + } + getTurn().endTurn(this, getActivePlayerId()); + return true; + } @Override public int doAction(MageAction action) { //actions.add(action); - int value = action.doAction(this); - score += action.getScore(scorePlayer); + int value = action.doAction(this); + score += action.getScore(scorePlayer); return value; } @@ -1506,16 +1506,16 @@ public abstract class GameImpl> implements Game, Serializa public Date getStartTime() { return startTime; } - + @Override public Date getEndTime() { return endTime; } - + @Override - public void setGameOptions(GameOptions options) { - this.gameOptions = options; - } + public void setGameOptions(GameOptions options) { + this.gameOptions = options; + } @Override public void setLosingPlayer(Player player) { diff --git a/Mage/src/mage/game/GameOptions.java b/Mage/src/mage/game/GameOptions.java index 919cca10e6..a5c388160e 100644 --- a/Mage/src/mage/game/GameOptions.java +++ b/Mage/src/mage/game/GameOptions.java @@ -11,23 +11,23 @@ import mage.Constants.PhaseStep; */ public class GameOptions implements Serializable { - private static GameOptions defInstance = new GameOptions(); + private static GameOptions defInstance = new GameOptions(); - public static GameOptions getDefault() { - return defInstance; - } + public static GameOptions getDefault() { + return defInstance; + } - /** - * Defines the running mode. There are some exclusions made for test mode. - */ - public boolean testMode = false; + /** + * Defines the running mode. There are some exclusions made for test mode. + */ + public boolean testMode = false; + + /** + * Defines the turn number game should stop on. + * By default, is null meaning that game shouldn't stop on any specific turn. + */ + public Integer stopOnTurn = null; - /** - * Defines the turn number game should stop on. - * By default, is null meaning that game shouldn't stop on any specific turn. - */ - public Integer stopOnTurn = null; - /** * Stop at the end of the turn if true otherwise stop at the beginning */ diff --git a/Mage/src/mage/game/GameReplay.java b/Mage/src/mage/game/GameReplay.java index e9c2037c3f..3ebb5dd4b2 100644 --- a/Mage/src/mage/game/GameReplay.java +++ b/Mage/src/mage/game/GameReplay.java @@ -34,29 +34,29 @@ package mage.game; */ public class GameReplay { - private GameStates savedGame; - private int stateIndex; + private GameStates savedGame; + private int stateIndex; - public GameReplay(GameStates savedGame) { - this.savedGame = savedGame; - } + public GameReplay(GameStates savedGame) { + this.savedGame = savedGame; + } - public void start() { - this.stateIndex = 0; - } + public void start() { + this.stateIndex = 0; + } - public GameState next() { - if (this.stateIndex < savedGame.getSize()) { - return savedGame.get(stateIndex++); - } - return null; - } + public GameState next() { + if (this.stateIndex < savedGame.getSize()) { + return savedGame.get(stateIndex++); + } + return null; + } - public GameState previous() { - if (this.stateIndex > 0) { - return savedGame.get(--stateIndex); - } - return null; - } + public GameState previous() { + if (this.stateIndex > 0) { + return savedGame.get(--stateIndex); + } + return null; + } } diff --git a/Mage/src/mage/game/GameState.java b/Mage/src/mage/game/GameState.java index 2e401897b1..2e43491530 100644 --- a/Mage/src/mage/game/GameState.java +++ b/Mage/src/mage/game/GameState.java @@ -69,136 +69,136 @@ import java.util.*; */ public class GameState implements Serializable, Copyable { - private Players players; - private PlayerList playerList; - private UUID activePlayerId; - private UUID priorityPlayerId; - private Turn turn; - private SpellStack stack; - private Command command; - private Exile exile; - private Revealed revealed; - private Map lookedAt = new HashMap(); - private Battlefield battlefield; - private int turnNum = 1; - private boolean gameOver; + private Players players; + private PlayerList playerList; + private UUID activePlayerId; + private UUID priorityPlayerId; + private Turn turn; + private SpellStack stack; + private Command command; + private Exile exile; + private Revealed revealed; + private Map lookedAt = new HashMap(); + private Battlefield battlefield; + private int turnNum = 1; + private boolean gameOver; private boolean paused; -// private List messages = new ArrayList(); - private ContinuousEffects effects; +// private List messages = new ArrayList(); + private ContinuousEffects effects; private TriggeredAbilities triggers; - private List triggered = new ArrayList(); - private DelayedTriggeredAbilities delayed; - private SpecialActions specialActions; + private List triggered = new ArrayList(); + private DelayedTriggeredAbilities delayed; + private SpecialActions specialActions; private Map> otherAbilities = new HashMap>(); - private Combat combat; - private TurnMods turnMods; - private Watchers watchers; - private Map values = new HashMap(); - private Map zones = new HashMap(); + private Combat combat; + private TurnMods turnMods; + private Watchers watchers; + private Map values = new HashMap(); + private Map zones = new HashMap(); - public GameState() { - players = new Players(); - playerList = new PlayerList(); - turn = new Turn(); - stack = new SpellStack(); - command = new Command(); - exile = new Exile(); - revealed = new Revealed(); - battlefield = new Battlefield(); - effects = new ContinuousEffects(); + public GameState() { + players = new Players(); + playerList = new PlayerList(); + turn = new Turn(); + stack = new SpellStack(); + command = new Command(); + exile = new Exile(); + revealed = new Revealed(); + battlefield = new Battlefield(); + effects = new ContinuousEffects(); triggers = new TriggeredAbilities(); - delayed = new DelayedTriggeredAbilities(); - specialActions = new SpecialActions(); - combat = new Combat(); - turnMods = new TurnMods(); - watchers = new Watchers(); - } + delayed = new DelayedTriggeredAbilities(); + specialActions = new SpecialActions(); + combat = new Combat(); + turnMods = new TurnMods(); + watchers = new Watchers(); + } - public GameState(final GameState state) { - this.players = state.players.copy(); - this.playerList = state.playerList.copy(); - this.activePlayerId = state.activePlayerId; - this.priorityPlayerId = state.priorityPlayerId; - this.turn = state.turn.copy(); - this.stack = state.stack.copy(); - this.command = state.command.copy(); - this.exile = state.exile.copy(); - this.revealed = state.revealed.copy(); + public GameState(final GameState state) { + this.players = state.players.copy(); + this.playerList = state.playerList.copy(); + this.activePlayerId = state.activePlayerId; + this.priorityPlayerId = state.priorityPlayerId; + this.turn = state.turn.copy(); + this.stack = state.stack.copy(); + this.command = state.command.copy(); + this.exile = state.exile.copy(); + this.revealed = state.revealed.copy(); this.lookedAt.putAll(state.lookedAt); - this.battlefield = state.battlefield.copy(); - this.turnNum = state.turnNum; - this.gameOver = state.gameOver; - this.effects = state.effects.copy(); + this.battlefield = state.battlefield.copy(); + this.turnNum = state.turnNum; + this.gameOver = state.gameOver; + this.effects = state.effects.copy(); for (TriggeredAbility trigger: state.triggered) { this.triggered.add(trigger.copy()); } this.triggers = state.triggers.copy(); - this.delayed = state.delayed.copy(); - this.specialActions = state.specialActions.copy(); - this.combat = state.combat.copy(); - this.turnMods = state.turnMods.copy(); - this.watchers = state.watchers.copy(); + this.delayed = state.delayed.copy(); + this.specialActions = state.specialActions.copy(); + this.combat = state.combat.copy(); + this.turnMods = state.turnMods.copy(); + this.watchers = state.watchers.copy(); this.values.putAll(state.values); this.zones.putAll(state.zones); - for (Map.Entry> entry: state.otherAbilities.entrySet()) { - otherAbilities.put(entry.getKey(), entry.getValue().copy()); - } + for (Map.Entry> entry: state.otherAbilities.entrySet()) { + otherAbilities.put(entry.getKey(), entry.getValue().copy()); + } this.paused = state.paused; - } + } - @Override - public GameState copy() { - return new GameState(this); - } + @Override + public GameState copy() { + return new GameState(this); + } - public void addPlayer(Player player) { - players.put(player.getId(), player); - playerList.add(player.getId()); - } + public void addPlayer(Player player) { + players.put(player.getId(), player); + playerList.add(player.getId()); + } - public String getValue(boolean useHidden) { - StringBuilder sb = new StringBuilder(1024); + public String getValue(boolean useHidden) { + StringBuilder sb = new StringBuilder(1024); - sb.append(turnNum).append(turn.getPhaseType()).append(turn.getStepType()).append(activePlayerId).append(priorityPlayerId); + sb.append(turnNum).append(turn.getPhaseType()).append(turn.getStepType()).append(activePlayerId).append(priorityPlayerId); - for (Player player: players.values()) { - sb.append("player").append(player.getLife()).append("hand"); + for (Player player: players.values()) { + sb.append("player").append(player.getLife()).append("hand"); if (useHidden) sb.append(player.getHand()); else sb.append(player.getHand().size()); sb.append("library").append(player.getLibrary().size()).append("graveyard").append(player.getGraveyard()); - } + } sb.append("permanents"); - for (Permanent permanent: battlefield.getAllPermanents()) { - sb.append(permanent.getValue()); - } + for (Permanent permanent: battlefield.getAllPermanents()) { + sb.append(permanent.getValue()); + } sb.append("spells"); - for (StackObject spell: stack) { - sb.append(spell.getControllerId()).append(spell.getName()); - } - + for (StackObject spell: stack) { + sb.append(spell.getControllerId()).append(spell.getName()); + } + for (ExileZone zone: exile.getExileZones()) { sb.append("exile").append(zone.getName()).append(zone); } - + sb.append("combat"); for (CombatGroup group: combat.getGroups()) { sb.append(group.getDefenderId()).append(group.getAttackers()).append(group.getBlockers()); } - return sb.toString(); - } + return sb.toString(); + } - public String getValue(boolean useHidden, Game game) { - StringBuilder sb = new StringBuilder(1024); + public String getValue(boolean useHidden, Game game) { + StringBuilder sb = new StringBuilder(1024); - sb.append(turnNum).append(turn.getPhaseType()).append(turn.getStepType()).append(activePlayerId).append(priorityPlayerId); + sb.append(turnNum).append(turn.getPhaseType()).append(turn.getStepType()).append(activePlayerId).append(priorityPlayerId); - for (Player player: players.values()) { - sb.append("player").append(player.isPassed()).append(player.getLife()).append("hand"); + for (Player player: players.values()) { + sb.append("player").append(player.isPassed()).append(player.getLife()).append("hand"); if (useHidden) sb.append(player.getHand()); else @@ -208,19 +208,19 @@ public class GameState implements Serializable, Copyable { for (Card card: player.getGraveyard().getCards(game)) { sb.append(card.getName()); } - } + } sb.append("permanents"); List perms = new ArrayList(); - for (Permanent permanent: battlefield.getAllPermanents()) { - perms.add(permanent.getValue()); - } + for (Permanent permanent: battlefield.getAllPermanents()) { + perms.add(permanent.getValue()); + } Collections.sort(perms); sb.append(perms); sb.append("spells"); - for (StackObject spell: stack) { - sb.append(spell.getControllerId()).append(spell.getName()); + for (StackObject spell: stack) { + sb.append(spell.getControllerId()).append(spell.getName()); sb.append(spell.getStackAbility().toString()); for (Mode mode: spell.getStackAbility().getModes().values()) { if (!mode.getTargets().isEmpty()) { @@ -236,195 +236,195 @@ public class GameState implements Serializable, Copyable { } } } - } - + } + for (ExileZone zone: exile.getExileZones()) { sb.append("exile").append(zone.getName()).append(zone); } - + sb.append("combat"); for (CombatGroup group: combat.getGroups()) { sb.append(group.getDefenderId()).append(group.getAttackers()).append(group.getBlockers()); } - return sb.toString(); - } - - public Players getPlayers() { - return players; - } + return sb.toString(); + } - public Player getPlayer(UUID playerId) { - return players.get(playerId); - } + public Players getPlayers() { + return players; + } - public UUID getActivePlayerId() { - return activePlayerId; - } + public Player getPlayer(UUID playerId) { + return players.get(playerId); + } - public void setActivePlayerId(UUID activePlayerId) { - this.activePlayerId = activePlayerId; - } + public UUID getActivePlayerId() { + return activePlayerId; + } - public UUID getPriorityPlayerId() { - return priorityPlayerId; - } + public void setActivePlayerId(UUID activePlayerId) { + this.activePlayerId = activePlayerId; + } - public void setPriorityPlayerId(UUID priorityPlayerId) { - this.priorityPlayerId = priorityPlayerId; - } + public UUID getPriorityPlayerId() { + return priorityPlayerId; + } - public Battlefield getBattlefield() { - return this.battlefield; - } + public void setPriorityPlayerId(UUID priorityPlayerId) { + this.priorityPlayerId = priorityPlayerId; + } - public SpellStack getStack() { - return this.stack; - } + public Battlefield getBattlefield() { + return this.battlefield; + } - public Exile getExile() { - return exile; - } + public SpellStack getStack() { + return this.stack; + } - public Command getCommand() { - return command; - } + public Exile getExile() { + return exile; + } - public Revealed getRevealed() { - return revealed; - } + public Command getCommand() { + return command; + } - public LookedAt getLookedAt(UUID playerId) { - if (lookedAt.get(playerId) == null) { - LookedAt l = new LookedAt(); - lookedAt.put(playerId, l); - return l; - } - return lookedAt.get(playerId); - } + public Revealed getRevealed() { + return revealed; + } + + public LookedAt getLookedAt(UUID playerId) { + if (lookedAt.get(playerId) == null) { + LookedAt l = new LookedAt(); + lookedAt.put(playerId, l); + return l; + } + return lookedAt.get(playerId); + } public void clearLookedAt() { lookedAt.clear(); } - - public Turn getTurn() { - return turn; - } - public Combat getCombat() { - return combat; - } + public Turn getTurn() { + return turn; + } - public int getTurnNum() { - return turnNum; - } + public Combat getCombat() { + return combat; + } - public void setTurnNum(int turnNum) { - this.turnNum = turnNum; - } + public int getTurnNum() { + return turnNum; + } - public boolean isGameOver() { - return this.gameOver; - } + public void setTurnNum(int turnNum) { + this.turnNum = turnNum; + } - public TurnMods getTurnMods() { - return this.turnMods; - } + public boolean isGameOver() { + return this.gameOver; + } - public Watchers getWatchers() { - return this.watchers; - } + public TurnMods getTurnMods() { + return this.turnMods; + } - public SpecialActions getSpecialActions() { - return this.specialActions; - } - - public void endGame() { - this.gameOver = true; - } + public Watchers getWatchers() { + return this.watchers; + } - public void applyEffects(Game game) { - for (Player player: players.values()) { - player.reset(); - } - battlefield.reset(game); + public SpecialActions getSpecialActions() { + return this.specialActions; + } + + public void endGame() { + this.gameOver = true; + } + + public void applyEffects(Game game) { + for (Player player: players.values()) { + player.reset(); + } + battlefield.reset(game); resetOtherAbilities(); - effects.apply(game); - battlefield.fireControlChangeEvents(game); - } + effects.apply(game); + battlefield.fireControlChangeEvents(game); + } - public void removeEotEffects(Game game) { - effects.removeEndOfTurnEffects(); + public void removeEotEffects(Game game) { + effects.removeEndOfTurnEffects(); delayed.removeEndOfTurnAbilities(); - applyEffects(game); - } + applyEffects(game); + } - public void addEffect(ContinuousEffect effect, Ability source) { - effects.addEffect(effect, source); - } + public void addEffect(ContinuousEffect effect, Ability source) { + effects.addEffect(effect, source); + } -// public void addMessage(String message) { -// this.messages.add(message); -// } +// public void addMessage(String message) { +// this.messages.add(message); +// } - public PlayerList getPlayerList() { - return playerList; - } + public PlayerList getPlayerList() { + return playerList; + } - public PlayerList getPlayerList(UUID playerId) { - PlayerList newPlayerList = new PlayerList(); - for (Player player: players.values()) { - if (!player.hasLeft() && !player.hasLost()) - newPlayerList.add(player.getId()); - } - newPlayerList.setCurrent(playerId); - return newPlayerList; - } + public PlayerList getPlayerList(UUID playerId) { + PlayerList newPlayerList = new PlayerList(); + for (Player player: players.values()) { + if (!player.hasLeft() && !player.hasLost()) + newPlayerList.add(player.getId()); + } + newPlayerList.setCurrent(playerId); + return newPlayerList; + } - public Permanent getPermanent(UUID permanentId) { + public Permanent getPermanent(UUID permanentId) { if (permanentId != null && battlefield.containsPermanent(permanentId)) { Permanent permanent = battlefield.getPermanent(permanentId); setZone(permanent.getId(), Zone.BATTLEFIELD); return permanent; } - return null; - } + return null; + } - public Zone getZone(UUID id) { - if (id != null && zones.containsKey(id)) - return zones.get(id); - return null; - } + public Zone getZone(UUID id) { + if (id != null && zones.containsKey(id)) + return zones.get(id); + return null; + } - public void setZone(UUID id, Zone zone) { - zones.put(id, zone); - } + public void setZone(UUID id, Zone zone) { + zones.put(id, zone); + } - public void restore(GameState state) { - this.stack = state.stack; - this.command = state.command; - this.effects = state.effects; + public void restore(GameState state) { + this.stack = state.stack; + this.command = state.command; + this.effects = state.effects; this.triggers = state.triggers; - this.triggered = state.triggered; - this.combat = state.combat; - this.exile = state.exile; - this.battlefield = state.battlefield; - this.zones = state.zones; - for (Player copyPlayer: state.players.values()) { - Player origPlayer = players.get(copyPlayer.getId()); - origPlayer.restore(copyPlayer); - } - } + this.triggered = state.triggered; + this.combat = state.combat; + this.exile = state.exile; + this.battlefield = state.battlefield; + this.zones = state.zones; + for (Player copyPlayer: state.players.values()) { + Player origPlayer = players.get(copyPlayer.getId()); + origPlayer.restore(copyPlayer); + } + } - public void handleEvent(GameEvent event, Game game) { - watchers.watch(event, game); + public void handleEvent(GameEvent event, Game game) { + watchers.watch(event, game); delayed.checkTriggers(event, game); triggers.checkTriggers(event, game); - } + } - public boolean replaceEvent(GameEvent event, Game game) { - return effects.replaceEvent(event, game); - } + public boolean replaceEvent(GameEvent event, Game game) { + return effects.replaceEvent(event, game); + } public void addCard(Card card) { setZone(card.getId(), Zone.OUTSIDE); @@ -437,8 +437,8 @@ public class GameState implements Serializable, Copyable { addAbility(ability); } } - - public void addAbility(Ability ability) { + + public void addAbility(Ability ability) { if (ability instanceof StaticAbility) { for (Mode mode: ability.getModes().values()) { for (Effect effect: mode.getEffects()) { @@ -451,7 +451,7 @@ public class GameState implements Serializable, Copyable { else if (ability instanceof TriggeredAbility) { this.triggers.add((TriggeredAbility)ability); } - } + } public void addEmblem(Emblem emblem) { getCommand().add(emblem); @@ -461,50 +461,50 @@ public class GameState implements Serializable, Copyable { } public void addTriggeredAbility(TriggeredAbility ability) { - this.triggered.add(ability); - } + this.triggered.add(ability); + } public void removeTriggeredAbility(TriggeredAbility ability) { - this.triggered.remove(ability); - } + this.triggered.remove(ability); + } public void addDelayedTriggeredAbility(DelayedTriggeredAbility ability) { - this.delayed.add(ability); - } + this.delayed.add(ability); + } - public void removeDelayedTriggeredAbility(UUID abilityId) { - for (DelayedTriggeredAbility ability: delayed) { - if (ability.getId().equals(abilityId)) { - delayed.remove(ability); - break; - } - } - } + public void removeDelayedTriggeredAbility(UUID abilityId) { + for (DelayedTriggeredAbility ability: delayed) { + if (ability.getId().equals(abilityId)) { + delayed.remove(ability); + break; + } + } + } - public List getTriggered(UUID controllerId) { + public List getTriggered(UUID controllerId) { List triggereds = new ArrayList(); for (TriggeredAbility ability: triggered) { if (ability.getControllerId().equals(controllerId)) triggereds.add(ability); } - return triggereds; - } + return triggereds; + } public DelayedTriggeredAbilities getDelayed() { return this.delayed; } - - public ContinuousEffects getContinuousEffects() { - return effects; - } - public Object getValue(String valueId) { - return values.get(valueId); - } + public ContinuousEffects getContinuousEffects() { + return effects; + } - public void setValue(String valueId, Object value) { - values.put(valueId, value); - } + public Object getValue(String valueId) { + return values.get(valueId); + } + + public void setValue(String valueId, Object value) { + values.put(valueId, value); + } public Abilities getOtherAbilities(UUID objectId, Zone zone) { if (otherAbilities.containsKey(objectId)) { @@ -512,20 +512,20 @@ public class GameState implements Serializable, Copyable { } return null; } - + public void addOtherAbility(UUID objectId, ActivatedAbility ability) { if (!otherAbilities.containsKey(objectId)) { otherAbilities.put(objectId, new AbilitiesImpl()); } otherAbilities.get(objectId).add(ability); } - + private void resetOtherAbilities() { for (Abilities abilities: otherAbilities.values()) { abilities.clear(); } } - + public void clear() { battlefield.clear(); effects.clear(); @@ -539,7 +539,7 @@ public class GameState implements Serializable, Copyable { lookedAt.clear(); turnNum = 0; gameOver = false; - specialActions.clear(); + specialActions.clear(); otherAbilities.clear(); combat.clear(); turnMods.clear(); @@ -551,11 +551,11 @@ public class GameState implements Serializable, Copyable { public void pause() { this.paused = true; } - + public void resume() { this.paused = false; } - + public boolean isPaused() { return this.paused; } diff --git a/Mage/src/mage/game/GameStates.java b/Mage/src/mage/game/GameStates.java index d299dae147..a1c5c0926d 100644 --- a/Mage/src/mage/game/GameStates.java +++ b/Mage/src/mage/game/GameStates.java @@ -39,38 +39,38 @@ import org.apache.log4j.Logger; */ public class GameStates implements Serializable { - private final static transient Logger logger = Logger.getLogger(GameStates.class); + private final static transient Logger logger = Logger.getLogger(GameStates.class); -// private List states = new LinkedList(); - private List states = new LinkedList(); +// private List states = new LinkedList(); + private List states = new LinkedList(); - public void save(GameState gameState) { -// states.add(new Copier().copyCompressed(gameState)); - states.add(gameState.copy()); - logger.debug("Saved game state: " + states.size()); - } + public void save(GameState gameState) { +// states.add(new Copier().copyCompressed(gameState)); + states.add(gameState.copy()); + logger.debug("Saved game state: " + states.size()); + } - public int getSize() { - return states.size(); - } + public int getSize() { + return states.size(); + } - public GameState rollback(int index) { - if (states.size() > 0 && index < states.size()) { - while (states.size() > index + 1) { - states.remove(states.size() - 1); - } -// return new Copier().uncompressCopy(states.get(index)); - logger.debug("Rolling back state: " + index); - return states.get(index); - } - return null; - } + public GameState rollback(int index) { + if (states.size() > 0 && index < states.size()) { + while (states.size() > index + 1) { + states.remove(states.size() - 1); + } +// return new Copier().uncompressCopy(states.get(index)); + logger.debug("Rolling back state: " + index); + return states.get(index); + } + return null; + } - public GameState get(int index) { - if (index < states.size()) -// return new Copier().uncompressCopy(states.get(index)); - return states.get(index); - return null; - } + public GameState get(int index) { + if (index < states.size()) +// return new Copier().uncompressCopy(states.get(index)); + return states.get(index); + return null; + } } diff --git a/Mage/src/mage/game/LookedAt.java b/Mage/src/mage/game/LookedAt.java index 63c04c93b5..17b8af9b8a 100644 --- a/Mage/src/mage/game/LookedAt.java +++ b/Mage/src/mage/game/LookedAt.java @@ -44,45 +44,45 @@ import java.util.UUID; */ public class LookedAt extends HashMap implements Serializable, Copyable { - public LookedAt() { } + public LookedAt() { } - public LookedAt(final LookedAt lookedAt) { + public LookedAt(final LookedAt lookedAt) { for (Map.Entry entry: lookedAt.entrySet()) { this.put(entry.getKey(), entry.getValue().copy()); - } - } + } + } - public void add(String name, Card card) { - this.get(name).add(card); - } + public void add(String name, Card card) { + this.get(name).add(card); + } - public void add(String name, Cards cards) { - if (!this.containsKey(name)) - createLookedAt(name); - this.put(name, cards.copy()); - } + public void add(String name, Cards cards) { + if (!this.containsKey(name)) + createLookedAt(name); + this.put(name, cards.copy()); + } - public Cards createLookedAt(String name) { - if (!this.containsKey(name)) { - this.put(name, new CardsImpl()); - } - return this.get(name); - } + public Cards createLookedAt(String name) { + if (!this.containsKey(name)) { + this.put(name, new CardsImpl()); + } + return this.get(name); + } - public void reset() { - this.clear(); - } + public void reset() { + this.clear(); + } - public Card getCard(UUID cardId, Game game) { - for (Cards cards: this.values()) { - if (cards.contains(cardId)) - return game.getCard(cardId); - } - return null; - } + public Card getCard(UUID cardId, Game game) { + for (Cards cards: this.values()) { + if (cards.contains(cardId)) + return game.getCard(cardId); + } + return null; + } - @Override - public LookedAt copy() { - return new LookedAt(this); - } + @Override + public LookedAt copy() { + return new LookedAt(this); + } } diff --git a/Mage/src/mage/game/Revealed.java b/Mage/src/mage/game/Revealed.java index db70a2621c..472ae193b9 100644 --- a/Mage/src/mage/game/Revealed.java +++ b/Mage/src/mage/game/Revealed.java @@ -43,49 +43,49 @@ import mage.util.Copyable; */ public class Revealed extends HashMap implements Serializable, Copyable { - public Revealed() { } + public Revealed() { } - public Revealed(final Revealed revealed) { + public Revealed(final Revealed revealed) { for (Map.Entry entry: revealed.entrySet()) { this.put(entry.getKey(), entry.getValue().copy()); - } - } + } + } - public void add(String name, Card card) { - this.get(name).add(card); - } + public void add(String name, Card card) { + this.get(name).add(card); + } - public void add(String name, Cards cards) { - if (!this.containsKey(name)) - createRevealed(name); - this.put(name, cards.copy()); - } + public void add(String name, Cards cards) { + if (!this.containsKey(name)) + createRevealed(name); + this.put(name, cards.copy()); + } - public Cards createRevealed(String name) { - if (!this.containsKey(name)) { - this.put(name, new CardsImpl()); - } - return this.get(name); - } + public Cards createRevealed(String name) { + if (!this.containsKey(name)) { + this.put(name, new CardsImpl()); + } + return this.get(name); + } - public Cards getRevealed(String name) { - return this.get(name); - } + public Cards getRevealed(String name) { + return this.get(name); + } - public void reset() { - this.clear(); - } + public void reset() { + this.clear(); + } - public Card getCard(UUID cardId, Game game) { - for (Cards cards: this.values()) { - if (cards.contains(cardId)) - return game.getCard(cardId); - } - return null; - } + public Card getCard(UUID cardId, Game game) { + for (Cards cards: this.values()) { + if (cards.contains(cardId)) + return game.getCard(cardId); + } + return null; + } - @Override - public Revealed copy() { - return new Revealed(this); - } + @Override + public Revealed copy() { + return new Revealed(this); + } } diff --git a/Mage/src/mage/game/Seat.java b/Mage/src/mage/game/Seat.java index c3a89d9577..d32cf3a8ca 100644 --- a/Mage/src/mage/game/Seat.java +++ b/Mage/src/mage/game/Seat.java @@ -37,29 +37,29 @@ import mage.players.Player; */ public class Seat implements Serializable { -// private final static Logger logger = Logger.getLogger(Seat.class); +// private final static Logger logger = Logger.getLogger(Seat.class); - private String playerType; - private Player player; + private String playerType; + private Player player; - public Seat(String playerType) { - this.playerType = playerType; - } + public Seat(String playerType) { + this.playerType = playerType; + } - public String getPlayerType() { - return playerType; - } + public String getPlayerType() { + return playerType; + } - public void setPlayerType(String playerType) { - this.playerType = playerType; - } + public void setPlayerType(String playerType) { + this.playerType = playerType; + } - public Player getPlayer() { - return player; - } + public Player getPlayer() { + return player; + } - public void setPlayer(Player player) { - this.player = player; - } + public void setPlayer(Player player) { + this.player = player; + } } diff --git a/Mage/src/mage/game/Table.java b/Mage/src/mage/game/Table.java index 7a7528fc3a..0873c6695e 100644 --- a/Mage/src/mage/game/Table.java +++ b/Mage/src/mage/game/Table.java @@ -47,171 +47,171 @@ import mage.players.Player; */ public class Table implements Serializable { - private UUID tableId; - private UUID roomId; - private String name; - private String controllerName; - private String gameType; - private Date createTime; - private Seat[] seats; - private int numSeats; - private boolean isTournament; - private DeckValidator validator; - private TableState state = TableState.WAITING; - private Match match; - private Tournament tournament; + private UUID tableId; + private UUID roomId; + private String name; + private String controllerName; + private String gameType; + private Date createTime; + private Seat[] seats; + private int numSeats; + private boolean isTournament; + private DeckValidator validator; + private TableState state = TableState.WAITING; + private Match match; + private Tournament tournament; - protected TableEventSource tableEventSource = new TableEventSource(); + protected TableEventSource tableEventSource = new TableEventSource(); - public Table(UUID roomId, String gameType, String name, String controllerName, DeckValidator validator, List playerTypes, Tournament tournament) { - this(roomId, gameType, name, controllerName, validator, playerTypes); - this.tournament = tournament; - this.isTournament = true; - } + public Table(UUID roomId, String gameType, String name, String controllerName, DeckValidator validator, List playerTypes, Tournament tournament) { + this(roomId, gameType, name, controllerName, validator, playerTypes); + this.tournament = tournament; + this.isTournament = true; + } - public Table(UUID roomId, String gameType, String name, String controllerName, DeckValidator validator, List playerTypes, Match match) { - this(roomId, gameType, name, controllerName, validator, playerTypes); - this.match = match; - this.isTournament = false; - } + public Table(UUID roomId, String gameType, String name, String controllerName, DeckValidator validator, List playerTypes, Match match) { + this(roomId, gameType, name, controllerName, validator, playerTypes); + this.match = match; + this.isTournament = false; + } - protected Table(UUID roomId, String gameType, String name, String controllerName, DeckValidator validator, List playerTypes) { - tableId = UUID.randomUUID(); - this.roomId = roomId; - this.numSeats = playerTypes.size(); - this.gameType = gameType; - this.name = name; - this.controllerName = controllerName; - this.createTime = new Date(); - createSeats(playerTypes); - this.validator = validator; - } + protected Table(UUID roomId, String gameType, String name, String controllerName, DeckValidator validator, List playerTypes) { + tableId = UUID.randomUUID(); + this.roomId = roomId; + this.numSeats = playerTypes.size(); + this.gameType = gameType; + this.name = name; + this.controllerName = controllerName; + this.createTime = new Date(); + createSeats(playerTypes); + this.validator = validator; + } - private void createSeats(List playerTypes) { - int i = 0; - seats = new Seat[numSeats]; - for(String playerType: playerTypes) { - seats[i] = new Seat(playerType); - i++; - } - } + private void createSeats(List playerTypes) { + int i = 0; + seats = new Seat[numSeats]; + for(String playerType: playerTypes) { + seats[i] = new Seat(playerType); + i++; + } + } - public UUID getId() { - return tableId; - } + public UUID getId() { + return tableId; + } - public UUID getRoomId() { - return roomId; - } + public UUID getRoomId() { + return roomId; + } - public void initGame() { - state = TableState.DUELING; - } + public void initGame() { + state = TableState.DUELING; + } - public void initTournament() { - state = TableState.DUELING; - } + public void initTournament() { + state = TableState.DUELING; + } - public void initDraft() { - state = TableState.DRAFTING; - } + public void initDraft() { + state = TableState.DRAFTING; + } - public void construct() { - state = TableState.CONSTRUCTING; - } + public void construct() { + state = TableState.CONSTRUCTING; + } - public void endGame() { - state = TableState.FINISHED; - } + public void endGame() { + state = TableState.FINISHED; + } - public String getGameType() { - return gameType; - } + public String getGameType() { + return gameType; + } - public String getDeckType() { - return validator.getName(); - } + public String getDeckType() { + return validator.getName(); + } - public Date getCreateTime() { - return createTime; - } - - public boolean isTournament() { - return this.isTournament; - } + public Date getCreateTime() { + return createTime; + } - public UUID joinTable(Player player, Seat seat) throws GameException { - if (seat.getPlayer() != null) { - throw new GameException("Seat is occupied."); - } - seat.setPlayer(player); - if (isReady()) - state = TableState.STARTING; - return seat.getPlayer().getId(); - } + public boolean isTournament() { + return this.isTournament; + } - private boolean isReady() { - for (int i = 0; i < numSeats; i++ ) { - if (seats[i].getPlayer() == null) - return false; - } - return true; - } + public UUID joinTable(Player player, Seat seat) throws GameException { + if (seat.getPlayer() != null) { + throw new GameException("Seat is occupied."); + } + seat.setPlayer(player); + if (isReady()) + state = TableState.STARTING; + return seat.getPlayer().getId(); + } - public Seat[] getSeats() { - return seats; - } + private boolean isReady() { + for (int i = 0; i < numSeats; i++ ) { + if (seats[i].getPlayer() == null) + return false; + } + return true; + } - public Seat getNextAvailableSeat(String playerType) { - for (int i = 0; i < numSeats; i++ ) { - if (seats[i].getPlayer() == null && seats[i].getPlayerType().equals(playerType)) - return seats[i]; - } - return null; - } + public Seat[] getSeats() { + return seats; + } - public void leaveTable(UUID playerId) { - for (int i = 0; i < numSeats; i++ ) { + public Seat getNextAvailableSeat(String playerType) { + for (int i = 0; i < numSeats; i++ ) { + if (seats[i].getPlayer() == null && seats[i].getPlayerType().equals(playerType)) + return seats[i]; + } + return null; + } + + public void leaveTable(UUID playerId) { + for (int i = 0; i < numSeats; i++ ) { Player player = seats[i].getPlayer(); - if (player != null && player.getId().equals(playerId)) { - seats[i].setPlayer(null); - if (state == TableState.STARTING) - state = TableState.WAITING; - break; - } - } - } + if (player != null && player.getId().equals(playerId)) { + seats[i].setPlayer(null); + if (state == TableState.STARTING) + state = TableState.WAITING; + break; + } + } + } - public TableState getState() { - return state; - } + public TableState getState() { + return state; + } - public DeckValidator getValidator() { - return this.validator; - } + public DeckValidator getValidator() { + return this.validator; + } - public void sideboard() { - state = TableState.SIDEBOARDING; - } + public void sideboard() { + state = TableState.SIDEBOARDING; + } - public String getName() { - return this.name; - } + public String getName() { + return this.name; + } - public void addTableEventListener(Listener listener) { - tableEventSource.addListener(listener); - } + public void addTableEventListener(Listener listener) { + tableEventSource.addListener(listener); + } - public Match getMatch() { - return match; - } + public Match getMatch() { + return match; + } - public Tournament getTournament() { - return tournament; - } + public Tournament getTournament() { + return tournament; + } - public String getControllerName() { - return controllerName; - } + public String getControllerName() { + return controllerName; + } } diff --git a/Mage/src/mage/game/Team.java b/Mage/src/mage/game/Team.java index dfd0b93690..f43d07875f 100644 --- a/Mage/src/mage/game/Team.java +++ b/Mage/src/mage/game/Team.java @@ -39,21 +39,21 @@ import mage.players.Players; */ public class Team implements MageItem { - private UUID teamId; - private String name; - private Players players = new Players(); + private UUID teamId; + private String name; + private Players players = new Players(); - public Team (String name) { - teamId = UUID.randomUUID(); - this.name = name; - } + public Team (String name) { + teamId = UUID.randomUUID(); + this.name = name; + } - public UUID getId() { - return teamId; - } + public UUID getId() { + return teamId; + } - public void addPlayer(Player player) { - players.addPlayer(player); - } + public void addPlayer(Player player) { + players.addPlayer(player); + } } diff --git a/Mage/src/mage/game/combat/Combat.java b/Mage/src/mage/game/combat/Combat.java index ff3ca2c3a0..4078656937 100644 --- a/Mage/src/mage/game/combat/Combat.java +++ b/Mage/src/mage/game/combat/Combat.java @@ -50,89 +50,89 @@ import java.util.*; */ public class Combat implements Serializable, Copyable { - private static FilterPlaneswalkerPermanent filterPlaneswalker = new FilterPlaneswalkerPermanent(); - private static FilterCreatureForCombat filterBlockers = new FilterCreatureForCombat(); + private static FilterPlaneswalkerPermanent filterPlaneswalker = new FilterPlaneswalkerPermanent(); + private static FilterCreatureForCombat filterBlockers = new FilterCreatureForCombat(); - protected List groups = new ArrayList(); - protected Map blockingGroups = new HashMap(); - protected Set defenders = new HashSet(); - protected UUID attackerId; //the player that is attacking + protected List groups = new ArrayList(); + protected Map blockingGroups = new HashMap(); + protected Set defenders = new HashSet(); + protected UUID attackerId; //the player that is attacking - public Combat() { - } + public Combat() { + } - public Combat(final Combat combat) { - this.attackerId = combat.attackerId; - for (CombatGroup group : combat.groups) { - groups.add(group.copy()); - } + public Combat(final Combat combat) { + this.attackerId = combat.attackerId; + for (CombatGroup group : combat.groups) { + groups.add(group.copy()); + } defenders.addAll(combat.defenders); - for (Map.Entry group : combat.blockingGroups.entrySet()) { - blockingGroups.put(group.getKey(), group.getValue()); - } - } + for (Map.Entry group : combat.blockingGroups.entrySet()) { + blockingGroups.put(group.getKey(), group.getValue()); + } + } - public List getGroups() { - return groups; - } + public List getGroups() { + return groups; + } - public Collection getBlockingGroups() { - return blockingGroups.values(); - } + public Collection getBlockingGroups() { + return blockingGroups.values(); + } - public Set getDefenders() { - return defenders; - } + public Set getDefenders() { + return defenders; + } - public List getAttackers() { - List attackers = new ArrayList(); - for (CombatGroup group : groups) { - attackers.addAll(group.attackers); - } - return attackers; - } + public List getAttackers() { + List attackers = new ArrayList(); + for (CombatGroup group : groups) { + attackers.addAll(group.attackers); + } + return attackers; + } - public List getBlockers() { - List blockers = new ArrayList(); - for (CombatGroup group : groups) { - blockers.addAll(group.blockers); - } - return blockers; - } + public List getBlockers() { + List blockers = new ArrayList(); + for (CombatGroup group : groups) { + blockers.addAll(group.blockers); + } + return blockers; + } - public void clear() { - groups.clear(); - blockingGroups.clear(); - defenders.clear(); - attackerId = null; - } + public void clear() { + groups.clear(); + blockingGroups.clear(); + defenders.clear(); + attackerId = null; + } - public String getValue() { - StringBuilder sb = new StringBuilder(); - sb.append(attackerId).append(defenders); - for (CombatGroup group : groups) { - sb.append(group.defenderId).append(group.attackers).append(group.attackerOrder).append(group.blockers).append(group.blockerOrder); - } - return sb.toString(); - } + public String getValue() { + StringBuilder sb = new StringBuilder(); + sb.append(attackerId).append(defenders); + for (CombatGroup group : groups) { + sb.append(group.defenderId).append(group.attackers).append(group.attackerOrder).append(group.blockers).append(group.blockerOrder); + } + return sb.toString(); + } - public void setAttacker(UUID playerId) { - this.attackerId = playerId; - } + public void setAttacker(UUID playerId) { + this.attackerId = playerId; + } - public void selectAttackers(Game game) { - if (!game.replaceEvent(GameEvent.getEvent(GameEvent.EventType.DECLARING_ATTACKERS, attackerId, attackerId))) { - Player player = game.getPlayer(attackerId); - //20101001 - 508.1d - checkAttackRequirements(player, game); - player.selectAttackers(game); + public void selectAttackers(Game game) { + if (!game.replaceEvent(GameEvent.getEvent(GameEvent.EventType.DECLARING_ATTACKERS, attackerId, attackerId))) { + Player player = game.getPlayer(attackerId); + //20101001 - 508.1d + checkAttackRequirements(player, game); + player.selectAttackers(game); if (game.isPaused() || game.isGameOver()) return; resumeSelectAttackers(game); - } - } - - public void resumeSelectAttackers(Game game) { + } + } + + public void resumeSelectAttackers(Game game) { Player player = game.getPlayer(attackerId); for (CombatGroup group: groups) { for (UUID attacker: group.getAttackers()) { @@ -142,44 +142,44 @@ public class Combat implements Serializable, Copyable { game.fireEvent(GameEvent.getEvent(GameEvent.EventType.DECLARED_ATTACKERS, attackerId, attackerId)); game.fireInformEvent(player.getName() + " attacks with " + groups.size() + " creatures"); } - - protected void checkAttackRequirements(Player player, Game game) { - //20101001 - 508.1d - for (Permanent creature : player.getAvailableAttackers(game)) { - for (RequirementEffect effect : game.getContinuousEffects().getApplicableRequirementEffects(creature, game)) { - if (effect.mustAttack(game)) { - UUID defenderId = effect.mustAttackDefender(game.getContinuousEffects().getAbility(effect.getId()), game); - if (defenderId == null) { - if (defenders.size() == 1) { - player.declareAttacker(creature.getId(), defenders.iterator().next(), game); - } else { - TargetDefender target = new TargetDefender(defenders, creature.getId()); - target.setRequired(true); - if (player.chooseTarget(Outcome.Damage, target, null, game)) { - player.declareAttacker(creature.getId(), target.getFirstTarget(), game); - } - } - } else { - player.declareAttacker(creature.getId(), defenderId, game); - } - } - } - } - } - public void selectBlockers(Game game) { - if (!game.replaceEvent(GameEvent.getEvent(GameEvent.EventType.DECLARING_BLOCKERS, attackerId, attackerId))) { - Player player = game.getPlayer(attackerId); - //20101001 - 509.1c - checkBlockRequirements(player, game); - for (UUID defenderId : getPlayerDefenders(game)) { - game.getPlayer(defenderId).selectBlockers(game); + protected void checkAttackRequirements(Player player, Game game) { + //20101001 - 508.1d + for (Permanent creature : player.getAvailableAttackers(game)) { + for (RequirementEffect effect : game.getContinuousEffects().getApplicableRequirementEffects(creature, game)) { + if (effect.mustAttack(game)) { + UUID defenderId = effect.mustAttackDefender(game.getContinuousEffects().getAbility(effect.getId()), game); + if (defenderId == null) { + if (defenders.size() == 1) { + player.declareAttacker(creature.getId(), defenders.iterator().next(), game); + } else { + TargetDefender target = new TargetDefender(defenders, creature.getId()); + target.setRequired(true); + if (player.chooseTarget(Outcome.Damage, target, null, game)) { + player.declareAttacker(creature.getId(), target.getFirstTarget(), game); + } + } + } else { + player.declareAttacker(creature.getId(), defenderId, game); + } + } + } + } + } + + public void selectBlockers(Game game) { + if (!game.replaceEvent(GameEvent.getEvent(GameEvent.EventType.DECLARING_BLOCKERS, attackerId, attackerId))) { + Player player = game.getPlayer(attackerId); + //20101001 - 509.1c + checkBlockRequirements(player, game); + for (UUID defenderId : getPlayerDefenders(game)) { + game.getPlayer(defenderId).selectBlockers(game); if (game.isPaused() || game.isGameOver()) return; - game.fireEvent(GameEvent.getEvent(GameEvent.EventType.DECLARED_BLOCKERS, defenderId, defenderId)); - } - } - } + game.fireEvent(GameEvent.getEvent(GameEvent.EventType.DECLARED_BLOCKERS, defenderId, defenderId)); + } + } + } public void resumeSelectBlockers(Game game) { //TODO: this isn't quite right - but will work fine for two-player games @@ -188,227 +188,227 @@ public class Combat implements Serializable, Copyable { } } - protected void checkBlockRequirements(Player player, Game game) { - //20101001 - 509.1c - //TODO: handle case where more than one attacker must be blocked - for (Permanent creature : game.getBattlefield().getActivePermanents(filterBlockers, player.getId(), game)) { - if (game.getOpponents(attackerId).contains(creature.getControllerId())) { - for (RequirementEffect effect : game.getContinuousEffects().getApplicableRequirementEffects(creature, game)) { - if (effect.mustBlock(game)) { - UUID attackId = effect.mustBlockAttacker(game.getContinuousEffects().getAbility(effect.getId()), game); - Player defender = game.getPlayer(creature.getControllerId()); - if (attackId != null && defender != null) { - defender.declareBlocker(creature.getId(), attackId, game); - } - } - } - } - } - } + protected void checkBlockRequirements(Player player, Game game) { + //20101001 - 509.1c + //TODO: handle case where more than one attacker must be blocked + for (Permanent creature : game.getBattlefield().getActivePermanents(filterBlockers, player.getId(), game)) { + if (game.getOpponents(attackerId).contains(creature.getControllerId())) { + for (RequirementEffect effect : game.getContinuousEffects().getApplicableRequirementEffects(creature, game)) { + if (effect.mustBlock(game)) { + UUID attackId = effect.mustBlockAttacker(game.getContinuousEffects().getAbility(effect.getId()), game); + Player defender = game.getPlayer(creature.getControllerId()); + if (attackId != null && defender != null) { + defender.declareBlocker(creature.getId(), attackId, game); + } + } + } + } + } + } - public void checkBlockRestrictions(Game game) { - for (CombatGroup group : groups) { - group.checkBlockRestrictions(game); - } - } + public void checkBlockRestrictions(Game game) { + for (CombatGroup group : groups) { + group.checkBlockRestrictions(game); + } + } - public void setDefenders(Game game) { - Set opponents = game.getOpponents(attackerId); - PlayerList players; - switch (game.getAttackOption()) { - case LEFT: - players = game.getState().getPlayerList(attackerId); - while (true) { - Player opponent = players.getNext(game); - if (opponents.contains(opponent.getId())) { - addDefender(opponent.getId(), game); - break; - } - } - break; - case RIGHT: - players = game.getState().getPlayerList(attackerId); - while (true) { - Player opponent = players.getPrevious(game); - if (opponents.contains(opponent.getId())) { - addDefender(opponent.getId(), game); - break; - } - } - break; - case MULTIPLE: - for (UUID opponentId : game.getOpponents(attackerId)) { - addDefender(opponentId, game); - } - break; - } - } + public void setDefenders(Game game) { + Set opponents = game.getOpponents(attackerId); + PlayerList players; + switch (game.getAttackOption()) { + case LEFT: + players = game.getState().getPlayerList(attackerId); + while (true) { + Player opponent = players.getNext(game); + if (opponents.contains(opponent.getId())) { + addDefender(opponent.getId(), game); + break; + } + } + break; + case RIGHT: + players = game.getState().getPlayerList(attackerId); + while (true) { + Player opponent = players.getPrevious(game); + if (opponents.contains(opponent.getId())) { + addDefender(opponent.getId(), game); + break; + } + } + break; + case MULTIPLE: + for (UUID opponentId : game.getOpponents(attackerId)) { + addDefender(opponentId, game); + } + break; + } + } - private void addDefender(UUID defenderId, Game game) { - defenders.add(defenderId); - for (Permanent permanent : game.getBattlefield().getAllActivePermanents(filterPlaneswalker, defenderId, game)) { - defenders.add(permanent.getId()); - } - } + private void addDefender(UUID defenderId, Game game) { + defenders.add(defenderId); + for (Permanent permanent : game.getBattlefield().getAllActivePermanents(filterPlaneswalker, defenderId, game)) { + defenders.add(permanent.getId()); + } + } - public void declareAttacker(UUID attackerId, UUID defenderId, Game game) { - if (!defenders.contains(defenderId)) - return; - Permanent defender = game.getPermanent(defenderId); - CombatGroup newGroup = new CombatGroup(defenderId, defender != null); - newGroup.attackers.add(attackerId); - Permanent attacker = game.getPermanent(attackerId); - if (!attacker.getAbilities().containsKey(VigilanceAbility.getInstance().getId())) { - attacker.tap(game); - } - attacker.setAttacking(true); - groups.add(newGroup); - } + public void declareAttacker(UUID attackerId, UUID defenderId, Game game) { + if (!defenders.contains(defenderId)) + return; + Permanent defender = game.getPermanent(defenderId); + CombatGroup newGroup = new CombatGroup(defenderId, defender != null); + newGroup.attackers.add(attackerId); + Permanent attacker = game.getPermanent(attackerId); + if (!attacker.getAbilities().containsKey(VigilanceAbility.getInstance().getId())) { + attacker.tap(game); + } + attacker.setAttacking(true); + groups.add(newGroup); + } - // add blocking group for creatures that block more than one creature - public void addBlockingGroup(UUID blockerId, UUID attackerId, UUID playerId, Game game) { - Permanent blocker = game.getPermanent(blockerId); - if (blockerId != null && blocker != null && blocker.getBlocking() > 1) { - if (!blockingGroups.containsKey(blockerId)) { - CombatGroup newGroup = new CombatGroup(playerId, playerId != null); - newGroup.blockers.add(blockerId); - // add all blocked attackers - for (CombatGroup group : groups) { - if (group.getBlockers().contains(blockerId)) { - // take into account banding - for (UUID attacker : group.attackers) { - newGroup.attackers.add(attacker); - } - } - } - blockingGroups.put(blockerId, newGroup); - } else { - //TODO: handle banding - blockingGroups.get(blockerId).attackers.add(attackerId); - } - } - } + // add blocking group for creatures that block more than one creature + public void addBlockingGroup(UUID blockerId, UUID attackerId, UUID playerId, Game game) { + Permanent blocker = game.getPermanent(blockerId); + if (blockerId != null && blocker != null && blocker.getBlocking() > 1) { + if (!blockingGroups.containsKey(blockerId)) { + CombatGroup newGroup = new CombatGroup(playerId, playerId != null); + newGroup.blockers.add(blockerId); + // add all blocked attackers + for (CombatGroup group : groups) { + if (group.getBlockers().contains(blockerId)) { + // take into account banding + for (UUID attacker : group.attackers) { + newGroup.attackers.add(attacker); + } + } + } + blockingGroups.put(blockerId, newGroup); + } else { + //TODO: handle banding + blockingGroups.get(blockerId).attackers.add(attackerId); + } + } + } - public void removeFromCombat(UUID creatureId, Game game) { - Permanent creature = game.getPermanent(creatureId); - if (creature != null) { - creature.setAttacking(false); - creature.setBlocking(0); - for (CombatGroup group : groups) { - group.remove(creatureId); - } - } - } + public void removeFromCombat(UUID creatureId, Game game) { + Permanent creature = game.getPermanent(creatureId); + if (creature != null) { + creature.setAttacking(false); + creature.setBlocking(0); + for (CombatGroup group : groups) { + group.remove(creatureId); + } + } + } - public void endCombat(Game game) { - Permanent creature; - for (CombatGroup group : groups) { - for (UUID attacker : group.attackers) { - creature = game.getPermanent(attacker); - if (creature != null) { - creature.setAttacking(false); - creature.setBlocking(0); - } - } - for (UUID blocker : group.blockers) { - creature = game.getPermanent(blocker); - if (creature != null) { - creature.setAttacking(false); - creature.setBlocking(0); - } - } - } - clear(); - } + public void endCombat(Game game) { + Permanent creature; + for (CombatGroup group : groups) { + for (UUID attacker : group.attackers) { + creature = game.getPermanent(attacker); + if (creature != null) { + creature.setAttacking(false); + creature.setBlocking(0); + } + } + for (UUID blocker : group.blockers) { + creature = game.getPermanent(blocker); + if (creature != null) { + creature.setAttacking(false); + creature.setBlocking(0); + } + } + } + clear(); + } - public boolean hasFirstOrDoubleStrike(Game game) { - for (CombatGroup group : groups) { - if (group.hasFirstOrDoubleStrike(game)) - return true; - } - return false; - } + public boolean hasFirstOrDoubleStrike(Game game) { + for (CombatGroup group : groups) { + if (group.hasFirstOrDoubleStrike(game)) + return true; + } + return false; + } - public CombatGroup findGroup(UUID attackerId) { - for (CombatGroup group : groups) { - if (group.getAttackers().contains(attackerId)) - return group; - } - return null; - } + public CombatGroup findGroup(UUID attackerId) { + for (CombatGroup group : groups) { + if (group.getAttackers().contains(attackerId)) + return group; + } + return null; + } - public int totalUnblockedDamage(Game game) { - int total = 0; - for (CombatGroup group : groups) { - if (group.getBlockers().isEmpty()) { - total += group.totalAttackerDamage(game); - } - } - return total; - } + public int totalUnblockedDamage(Game game) { + int total = 0; + for (CombatGroup group : groups) { + if (group.getBlockers().isEmpty()) { + total += group.totalAttackerDamage(game); + } + } + return total; + } - public boolean attacksAlone() { - return (groups.size() == 1 && groups.get(0).getAttackers().size() == 1); - } + public boolean attacksAlone() { + return (groups.size() == 1 && groups.get(0).getAttackers().size() == 1); + } - public boolean noAttackers() { - if (groups.isEmpty() || getAttackers().isEmpty()) - return true; - return false; - } + public boolean noAttackers() { + if (groups.isEmpty() || getAttackers().isEmpty()) + return true; + return false; + } - public boolean isAttacked(UUID defenderId, Game game) { - for (CombatGroup group : groups) { - if (group.getDefenderId().equals(defenderId)) - return true; - if (group.defenderIsPlaneswalker) { - Permanent permanent = game.getPermanent(group.getDefenderId()); - if (permanent.getControllerId().equals(defenderId)) - return true; - } - } - return false; - } + public boolean isAttacked(UUID defenderId, Game game) { + for (CombatGroup group : groups) { + if (group.getDefenderId().equals(defenderId)) + return true; + if (group.defenderIsPlaneswalker) { + Permanent permanent = game.getPermanent(group.getDefenderId()); + if (permanent.getControllerId().equals(defenderId)) + return true; + } + } + return false; + } - public UUID getDefendingPlayer(UUID attackerId) { - UUID defenderId = null; - for (CombatGroup group : groups) { - if (group.getAttackers().contains(attackerId)) { - defenderId = group.getDefenderId(); - break; - } - } - return defenderId; - } + public UUID getDefendingPlayer(UUID attackerId) { + UUID defenderId = null; + for (CombatGroup group : groups) { + if (group.getAttackers().contains(attackerId)) { + defenderId = group.getDefenderId(); + break; + } + } + return defenderId; + } - private Set getPlayerDefenders(Game game) { - Set playerDefenders = new HashSet(); - for (CombatGroup group : groups) { - if (group.defenderIsPlaneswalker) { - Permanent permanent = game.getPermanent(group.getDefenderId()); - if (permanent != null) - playerDefenders.add(permanent.getControllerId()); - } else { - playerDefenders.add(group.getDefenderId()); - } - } - return playerDefenders; - } + private Set getPlayerDefenders(Game game) { + Set playerDefenders = new HashSet(); + for (CombatGroup group : groups) { + if (group.defenderIsPlaneswalker) { + Permanent permanent = game.getPermanent(group.getDefenderId()); + if (permanent != null) + playerDefenders.add(permanent.getControllerId()); + } else { + playerDefenders.add(group.getDefenderId()); + } + } + return playerDefenders; + } - public void damageAssignmentOrder(Game game) { - for (CombatGroup group : groups) { - group.pickBlockerOrder(attackerId, game); - } - for (Map.Entry blockingGroup : blockingGroups.entrySet()) { - Permanent blocker = game.getPermanent(blockingGroup.getKey()); - if (blocker != null) { - blockingGroup.getValue().pickAttackerOrder(blocker.getControllerId(), game); - } - } - } + public void damageAssignmentOrder(Game game) { + for (CombatGroup group : groups) { + group.pickBlockerOrder(attackerId, game); + } + for (Map.Entry blockingGroup : blockingGroups.entrySet()) { + Permanent blocker = game.getPermanent(blockingGroup.getKey()); + if (blocker != null) { + blockingGroup.getValue().pickAttackerOrder(blocker.getControllerId(), game); + } + } + } public void removeAttacker(UUID attackerId, Game game) { - for (CombatGroup group : groups) { + for (CombatGroup group : groups) { if (group.attackers.contains(attackerId)) { group.attackers.remove(attackerId); group.attackerOrder.remove(attackerId); @@ -426,7 +426,7 @@ public class Combat implements Serializable, Copyable { } public void removeBlocker(UUID blockerId, Game game) { - for (CombatGroup group : groups) { + for (CombatGroup group : groups) { if (group.blockers.contains(blockerId)) { group.blockers.remove(blockerId); group.blockerOrder.remove(blockerId); @@ -444,8 +444,8 @@ public class Combat implements Serializable, Copyable { } @Override - public Combat copy() { - return new Combat(this); - } + public Combat copy() { + return new Combat(this); + } } diff --git a/Mage/src/mage/game/combat/CombatGroup.java b/Mage/src/mage/game/combat/CombatGroup.java index 4b3f3adc8b..d9709e196f 100644 --- a/Mage/src/mage/game/combat/CombatGroup.java +++ b/Mage/src/mage/game/combat/CombatGroup.java @@ -49,98 +49,98 @@ import java.util.*; */ public class CombatGroup implements Serializable, Copyable { - protected List attackers = new ArrayList(); - protected List blockers = new ArrayList(); - protected List blockerOrder = new ArrayList(); - protected List attackerOrder = new ArrayList(); - protected Map players = new HashMap(); - protected boolean blocked; - protected UUID defenderId; - protected boolean defenderIsPlaneswalker; + protected List attackers = new ArrayList(); + protected List blockers = new ArrayList(); + protected List blockerOrder = new ArrayList(); + protected List attackerOrder = new ArrayList(); + protected Map players = new HashMap(); + protected boolean blocked; + protected UUID defenderId; + protected boolean defenderIsPlaneswalker; - public CombatGroup(UUID defenderId, boolean defenderIsPlaneswalker) { - this.defenderId = defenderId; - this.defenderIsPlaneswalker = defenderIsPlaneswalker; - } + public CombatGroup(UUID defenderId, boolean defenderIsPlaneswalker) { + this.defenderId = defenderId; + this.defenderIsPlaneswalker = defenderIsPlaneswalker; + } - public CombatGroup(final CombatGroup group) { - this.blocked = group.blocked; - this.defenderId = group.defenderId; - this.defenderIsPlaneswalker = group.defenderIsPlaneswalker; + public CombatGroup(final CombatGroup group) { + this.blocked = group.blocked; + this.defenderId = group.defenderId; + this.defenderIsPlaneswalker = group.defenderIsPlaneswalker; this.attackers.addAll(group.attackers); this.blockers.addAll(group.blockers); this.blockerOrder.addAll(group.blockerOrder); this.attackerOrder.addAll(group.attackerOrder); this.players.putAll(group.players); - } + } -// protected String getValue(Game game) { -// StringBuilder sb = new StringBuilder(1024); -// for (UUID attackerId: attackers) { -// getPermanentValue(attackerId, sb, game); -// } -// for (UUID blockerId: blockers) { -// getPermanentValue(blockerId, sb, game); -// } -// return sb.toString(); -// } +// protected String getValue(Game game) { +// StringBuilder sb = new StringBuilder(1024); +// for (UUID attackerId: attackers) { +// getPermanentValue(attackerId, sb, game); +// } +// for (UUID blockerId: blockers) { +// getPermanentValue(blockerId, sb, game); +// } +// return sb.toString(); +// } // -// private void getPermanentValue(UUID permId, StringBuilder sb, Game game) { -// Permanent perm = game.getPermanent(permId); -// sb.append(perm.getValue()); -// } +// private void getPermanentValue(UUID permId, StringBuilder sb, Game game) { +// Permanent perm = game.getPermanent(permId); +// sb.append(perm.getValue()); +// } - public boolean hasFirstOrDoubleStrike(Game game) { - for (UUID permId: attackers) { - if (hasFirstOrDoubleStrike(game.getPermanent(permId))) { - return true; - } - } - for (UUID permId: blockers) { - if (hasFirstOrDoubleStrike(game.getPermanent(permId))) { - return true; - } - } - return false; - } + public boolean hasFirstOrDoubleStrike(Game game) { + for (UUID permId: attackers) { + if (hasFirstOrDoubleStrike(game.getPermanent(permId))) { + return true; + } + } + for (UUID permId: blockers) { + if (hasFirstOrDoubleStrike(game.getPermanent(permId))) { + return true; + } + } + return false; + } - public UUID getDefenderId() { - return defenderId; - } + public UUID getDefenderId() { + return defenderId; + } - public List getAttackers() { - return attackers; - } + public List getAttackers() { + return attackers; + } - public List getBlockers() { - return blockers; - } + public List getBlockers() { + return blockers; + } - public List getBlockerOrder() { - return blockerOrder; - } + public List getBlockerOrder() { + return blockerOrder; + } - private boolean hasFirstOrDoubleStrike(Permanent perm) { - return perm.getAbilities().containsKey(FirstStrikeAbility.getInstance().getId()) || perm.getAbilities().containsKey(DoubleStrikeAbility.getInstance().getId()); - } + private boolean hasFirstOrDoubleStrike(Permanent perm) { + return perm.getAbilities().containsKey(FirstStrikeAbility.getInstance().getId()) || perm.getAbilities().containsKey(DoubleStrikeAbility.getInstance().getId()); + } - private boolean hasFirstStrike(Permanent perm) { - return perm.getAbilities().containsKey(FirstStrikeAbility.getInstance().getId()); - } + private boolean hasFirstStrike(Permanent perm) { + return perm.getAbilities().containsKey(FirstStrikeAbility.getInstance().getId()); + } - private boolean hasDoubleStrike(Permanent perm) { - return perm.getAbilities().containsKey(DoubleStrikeAbility.getInstance().getId()); - } + private boolean hasDoubleStrike(Permanent perm) { + return perm.getAbilities().containsKey(DoubleStrikeAbility.getInstance().getId()); + } - private boolean hasTrample(Permanent perm) { - return perm.getAbilities().containsKey(TrampleAbility.getInstance().getId()); - } + private boolean hasTrample(Permanent perm) { + return perm.getAbilities().containsKey(TrampleAbility.getInstance().getId()); + } - public void assignDamageToBlockers(boolean first, Game game) { - if (attackers.size() > 0 && (!first || hasFirstOrDoubleStrike(game))) { - if (blockers.isEmpty()) { - unblockedDamage(first, game); - } + public void assignDamageToBlockers(boolean first, Game game) { + if (attackers.size() > 0 && (!first || hasFirstOrDoubleStrike(game))) { + if (blockers.isEmpty()) { + unblockedDamage(first, game); + } else { Permanent attacker = game.getPermanent(attackers.get(0)); if (attacker.getAbilities().containsKey(DamageAsThoughNotBlockedAbility.getInstance().getId())) { @@ -157,115 +157,115 @@ public class CombatGroup implements Serializable, Copyable { multiBlockerDamage(first, game); } } - } - } + } + } - public void assignDamageToAttackers(boolean first, Game game) { - if (blockers.size() > 0 && (!first || hasFirstOrDoubleStrike(game))) { - if (attackers.size() == 1) { - singleAttackerDamage(first, game); - } - else { - multiAttackerDamage(first, game); - } - } - } + public void assignDamageToAttackers(boolean first, Game game) { + if (blockers.size() > 0 && (!first || hasFirstOrDoubleStrike(game))) { + if (attackers.size() == 1) { + singleAttackerDamage(first, game); + } + else { + multiAttackerDamage(first, game); + } + } + } - public void applyDamage(Game game) { - for (UUID uuid : attackers) { - Permanent permanent = game.getPermanent(uuid); - if (permanent != null) { - permanent.applyDamage(game); - } - } - for (UUID uuid : blockers) { - Permanent permanent = game.getPermanent(uuid); - if (permanent != null) { - permanent.applyDamage(game); - } - } - } + public void applyDamage(Game game) { + for (UUID uuid : attackers) { + Permanent permanent = game.getPermanent(uuid); + if (permanent != null) { + permanent.applyDamage(game); + } + } + for (UUID uuid : blockers) { + Permanent permanent = game.getPermanent(uuid); + if (permanent != null) { + permanent.applyDamage(game); + } + } + } - /** - * Determines if permanent can damage in current (First Strike or not) combat damage step - * - * @param perm Permanent to check - * @param first First strike or common combat damage step - * @return - */ - private boolean canDamage(Permanent perm, boolean first) { - // if now first strike combat damage step - if (first) { - // should have first strike or double strike - return hasFirstOrDoubleStrike(perm); - } - // if now not first strike combat - else { - if (hasFirstStrike(perm)) { - // if it has first strike in non FS combat damage step - // then it can damage only if it has ALSO double strike - // Fixes Issue 200 - return hasDoubleStrike(perm); - } - // can damage otherwise - return true; - } - } + /** + * Determines if permanent can damage in current (First Strike or not) combat damage step + * + * @param perm Permanent to check + * @param first First strike or common combat damage step + * @return + */ + private boolean canDamage(Permanent perm, boolean first) { + // if now first strike combat damage step + if (first) { + // should have first strike or double strike + return hasFirstOrDoubleStrike(perm); + } + // if now not first strike combat + else { + if (hasFirstStrike(perm)) { + // if it has first strike in non FS combat damage step + // then it can damage only if it has ALSO double strike + // Fixes Issue 200 + return hasDoubleStrike(perm); + } + // can damage otherwise + return true; + } + } - private void unblockedDamage(boolean first, Game game) { - for (UUID attackerId: attackers) { - Permanent attacker = game.getPermanent(attackerId); - if (canDamage(attacker, first)) { - //20091005 - 510.1c, 702.17c - if (!blocked || hasTrample(attacker)) - defenderDamage(attacker, attacker.getPower().getValue(), game); - } - } - } + private void unblockedDamage(boolean first, Game game) { + for (UUID attackerId: attackers) { + Permanent attacker = game.getPermanent(attackerId); + if (canDamage(attacker, first)) { + //20091005 - 510.1c, 702.17c + if (!blocked || hasTrample(attacker)) + defenderDamage(attacker, attacker.getPower().getValue(), game); + } + } + } - private void singleBlockerDamage(boolean first, Game game) { - //TODO: handle banding - Permanent blocker = game.getPermanent(blockers.get(0)); - Permanent attacker = game.getPermanent(attackers.get(0)); - if (blocker != null && attacker != null) { - if (blocked && canDamage(attacker, first)) { - int damage = attacker.getPower().getValue(); - if (hasTrample(attacker)) { - int lethalDamage = blocker.getToughness().getValue() - blocker.getDamage(); - if (lethalDamage >= damage) { - blocker.markDamage(damage, attacker.getId(), game, true, true); - } - else { - Player player = game.getPlayer(attacker.getControllerId()); - int damageAssigned = player.getAmount(lethalDamage, damage, "Assign damage to " + blocker.getName(), game); - blocker.markDamage(damageAssigned, attacker.getId(), game, true, true); - damage -= damageAssigned; - if (damage > 0) - defenderDamage(attacker, damage, game); - } - } - else { - blocker.markDamage(damage, attacker.getId(), game, true, true); - } - } - if (canDamage(blocker, first)) { - if (blocker.getBlocking() == 1) { // blocking several creatures handled separately - int blockerDamage = blocker.getPower().getValue(); - attacker.markDamage(blockerDamage, blocker.getId(), game, true, true); - } - } - } - } + private void singleBlockerDamage(boolean first, Game game) { + //TODO: handle banding + Permanent blocker = game.getPermanent(blockers.get(0)); + Permanent attacker = game.getPermanent(attackers.get(0)); + if (blocker != null && attacker != null) { + if (blocked && canDamage(attacker, first)) { + int damage = attacker.getPower().getValue(); + if (hasTrample(attacker)) { + int lethalDamage = blocker.getToughness().getValue() - blocker.getDamage(); + if (lethalDamage >= damage) { + blocker.markDamage(damage, attacker.getId(), game, true, true); + } + else { + Player player = game.getPlayer(attacker.getControllerId()); + int damageAssigned = player.getAmount(lethalDamage, damage, "Assign damage to " + blocker.getName(), game); + blocker.markDamage(damageAssigned, attacker.getId(), game, true, true); + damage -= damageAssigned; + if (damage > 0) + defenderDamage(attacker, damage, game); + } + } + else { + blocker.markDamage(damage, attacker.getId(), game, true, true); + } + } + if (canDamage(blocker, first)) { + if (blocker.getBlocking() == 1) { // blocking several creatures handled separately + int blockerDamage = blocker.getPower().getValue(); + attacker.markDamage(blockerDamage, blocker.getId(), game, true, true); + } + } + } + } - private void multiBlockerDamage(boolean first, Game game) { - //TODO: handle banding - Permanent attacker = game.getPermanent(attackers.get(0)); - if (attacker == null) { - return; - } - Player player = game.getPlayer(attacker.getControllerId()); - int damage = attacker.getPower().getValue(); - if (canDamage(attacker, first)) { + private void multiBlockerDamage(boolean first, Game game) { + //TODO: handle banding + Permanent attacker = game.getPermanent(attackers.get(0)); + if (attacker == null) { + return; + } + Player player = game.getPlayer(attacker.getControllerId()); + int damage = attacker.getPower().getValue(); + if (canDamage(attacker, first)) { Map assigned = new HashMap(); if (blocked) { for (UUID blockerId: blockerOrder) { @@ -292,193 +292,193 @@ public class CombatGroup implements Serializable, Copyable { defenderDamage(attacker, damage, game); } } - for (UUID blockerId: blockerOrder) { - Permanent blocker = game.getPermanent(blockerId); - if (canDamage(blocker, first)) { - if (blocker.getBlocking() == 1) { // blocking several creatures handled separately - attacker.markDamage(blocker.getPower().getValue(), blocker.getId(), game, true, true); - } - } - } - // Issue#73 - for (Map.Entry entry : assigned.entrySet()) { - Permanent blocker = game.getPermanent(entry.getKey()); - blocker.markDamage(entry.getValue(), attacker.getId(), game, true, true); - } - } - else { - for (UUID blockerId: blockerOrder) { - Permanent blocker = game.getPermanent(blockerId); - if (canDamage(blocker, first)) { - attacker.markDamage(blocker.getPower().getValue(), blocker.getId(), game, true, true); - } - } - } - } + for (UUID blockerId: blockerOrder) { + Permanent blocker = game.getPermanent(blockerId); + if (canDamage(blocker, first)) { + if (blocker.getBlocking() == 1) { // blocking several creatures handled separately + attacker.markDamage(blocker.getPower().getValue(), blocker.getId(), game, true, true); + } + } + } + // Issue#73 + for (Map.Entry entry : assigned.entrySet()) { + Permanent blocker = game.getPermanent(entry.getKey()); + blocker.markDamage(entry.getValue(), attacker.getId(), game, true, true); + } + } + else { + for (UUID blockerId: blockerOrder) { + Permanent blocker = game.getPermanent(blockerId); + if (canDamage(blocker, first)) { + attacker.markDamage(blocker.getPower().getValue(), blocker.getId(), game, true, true); + } + } + } + } - /** - * Damages attacking creatures by a creature that blocked several ones - * Damages only attackers as blocker was damage in {@link #singleBlockerDamage}. - * - * Handles abilities like "{this} an block any number of creatures.". - * - * @param first - * @param game - */ - private void singleAttackerDamage(boolean first, Game game) { - Permanent blocker = game.getPermanent(blockers.get(0)); - Permanent attacker = game.getPermanent(attackers.get(0)); - if (blocker != null && attacker != null) { - if (canDamage(blocker, first)) { - int damage = blocker.getPower().getValue(); - attacker.markDamage(damage, blocker.getId(), game, true, true); - } - } - } + /** + * Damages attacking creatures by a creature that blocked several ones + * Damages only attackers as blocker was damage in {@link #singleBlockerDamage}. + * + * Handles abilities like "{this} an block any number of creatures.". + * + * @param first + * @param game + */ + private void singleAttackerDamage(boolean first, Game game) { + Permanent blocker = game.getPermanent(blockers.get(0)); + Permanent attacker = game.getPermanent(attackers.get(0)); + if (blocker != null && attacker != null) { + if (canDamage(blocker, first)) { + int damage = blocker.getPower().getValue(); + attacker.markDamage(damage, blocker.getId(), game, true, true); + } + } + } - /** - * Damages attacking creatures by a creature that blocked several ones - * Damages only attackers as blocker was damage in either {@link #singleBlockerDamage} or {@link #multiBlockerDamage}. - * - * Handles abilities like "{this} an block any number of creatures.". - * - * @param first - * @param game - */ - private void multiAttackerDamage(boolean first, Game game) { - Permanent blocker = game.getPermanent(blockers.get(0)); - Player player = game.getPlayer(blocker.getControllerId()); - if (blocker == null) { - return; - } - int damage = blocker.getPower().getValue(); + /** + * Damages attacking creatures by a creature that blocked several ones + * Damages only attackers as blocker was damage in either {@link #singleBlockerDamage} or {@link #multiBlockerDamage}. + * + * Handles abilities like "{this} an block any number of creatures.". + * + * @param first + * @param game + */ + private void multiAttackerDamage(boolean first, Game game) { + Permanent blocker = game.getPermanent(blockers.get(0)); + Player player = game.getPlayer(blocker.getControllerId()); + if (blocker == null) { + return; + } + int damage = blocker.getPower().getValue(); - if (canDamage(blocker, first)) { - Map assigned = new HashMap(); - for (UUID attackerId: attackerOrder) { - Permanent attacker = game.getPermanent(attackerId); - int lethalDamage; - if (blocker.getAbilities().containsKey(DeathtouchAbility.getInstance().getId())) - lethalDamage = 1; - else - lethalDamage = attacker.getToughness().getValue() - attacker.getDamage(); - if (lethalDamage >= damage) { - assigned.put(attackerId, damage); - break; - } - int damageAssigned = player.getAmount(lethalDamage, damage, "Assign damage to " + attacker.getName(), game); - assigned.put(attackerId, damageAssigned); - damage -= damageAssigned; - } + if (canDamage(blocker, first)) { + Map assigned = new HashMap(); + for (UUID attackerId: attackerOrder) { + Permanent attacker = game.getPermanent(attackerId); + int lethalDamage; + if (blocker.getAbilities().containsKey(DeathtouchAbility.getInstance().getId())) + lethalDamage = 1; + else + lethalDamage = attacker.getToughness().getValue() - attacker.getDamage(); + if (lethalDamage >= damage) { + assigned.put(attackerId, damage); + break; + } + int damageAssigned = player.getAmount(lethalDamage, damage, "Assign damage to " + attacker.getName(), game); + assigned.put(attackerId, damageAssigned); + damage -= damageAssigned; + } - for (Map.Entry entry : assigned.entrySet()) { - Permanent attacker = game.getPermanent(entry.getKey()); - attacker.markDamage(entry.getValue(), blocker.getId(), game, true, true); - } - } - } + for (Map.Entry entry : assigned.entrySet()) { + Permanent attacker = game.getPermanent(entry.getKey()); + attacker.markDamage(entry.getValue(), blocker.getId(), game, true, true); + } + } + } - private void defenderDamage(Permanent attacker, int amount, Game game) { - if (this.defenderIsPlaneswalker) { - Permanent defender = game.getPermanent(defenderId); - if (defender != null) { - defender.markDamage(amount, attacker.getId(), game, true, true); - } - } - else { - Player defender = game.getPlayer(defenderId); - defender.damage(amount, attacker.getId(), game, true, true); - } - } + private void defenderDamage(Permanent attacker, int amount, Game game) { + if (this.defenderIsPlaneswalker) { + Permanent defender = game.getPermanent(defenderId); + if (defender != null) { + defender.markDamage(amount, attacker.getId(), game, true, true); + } + } + else { + Player defender = game.getPlayer(defenderId); + defender.damage(amount, attacker.getId(), game, true, true); + } + } - public boolean canBlock(Permanent blocker, Game game) { - for (UUID attackerId: attackers) { - if (!blocker.canBlock(attackerId, game)) - return false; - } - return true; - } + public boolean canBlock(Permanent blocker, Game game) { + for (UUID attackerId: attackers) { + if (!blocker.canBlock(attackerId, game)) + return false; + } + return true; + } - public void addBlocker(UUID blockerId, UUID playerId, Game game) { - for (UUID attackerId: attackers) { - if (game.replaceEvent(GameEvent.getEvent(GameEvent.EventType.DECLARE_BLOCKER, attackerId, blockerId, playerId))) { - return; - } - } - Permanent blocker = game.getPermanent(blockerId); - if (blockerId != null && blocker != null) { - blocker.setBlocking(blocker.getBlocking() + 1); - blockers.add(blockerId); - blockerOrder.add(blockerId); - this.blocked = true; - this.players.put(blockerId, playerId); - } - } + public void addBlocker(UUID blockerId, UUID playerId, Game game) { + for (UUID attackerId: attackers) { + if (game.replaceEvent(GameEvent.getEvent(GameEvent.EventType.DECLARE_BLOCKER, attackerId, blockerId, playerId))) { + return; + } + } + Permanent blocker = game.getPermanent(blockerId); + if (blockerId != null && blocker != null) { + blocker.setBlocking(blocker.getBlocking() + 1); + blockers.add(blockerId); + blockerOrder.add(blockerId); + this.blocked = true; + this.players.put(blockerId, playerId); + } + } - public void pickBlockerOrder(UUID playerId, Game game) { - if (blockers.isEmpty()) - return; - Player player = game.getPlayer(playerId); - List blockerList = new ArrayList(blockers); - blockerOrder.clear(); - while (true) { - if (blockerList.size() == 1) { - blockerOrder.add(blockerList.get(0)); - break; - } - else { - List blockerPerms = new ArrayList(); - for (UUID blockerId: blockerList) { - blockerPerms.add(game.getPermanent(blockerId)); - } - UUID blockerId = player.chooseBlockerOrder(blockerPerms, game); - blockerOrder.add(blockerId); - blockerList.remove(blockerId); - } - } - } + public void pickBlockerOrder(UUID playerId, Game game) { + if (blockers.isEmpty()) + return; + Player player = game.getPlayer(playerId); + List blockerList = new ArrayList(blockers); + blockerOrder.clear(); + while (true) { + if (blockerList.size() == 1) { + blockerOrder.add(blockerList.get(0)); + break; + } + else { + List blockerPerms = new ArrayList(); + for (UUID blockerId: blockerList) { + blockerPerms.add(game.getPermanent(blockerId)); + } + UUID blockerId = player.chooseBlockerOrder(blockerPerms, game); + blockerOrder.add(blockerId); + blockerList.remove(blockerId); + } + } + } - public void pickAttackerOrder(UUID playerId, Game game) { - if (attackers.isEmpty()) - return; - Player player = game.getPlayer(playerId); - List attackerList = new ArrayList(attackers); - attackerOrder.clear(); - while (true) { - if (attackerList.size() == 1) { - attackerOrder.add(attackerList.get(0)); - break; - } - else { - List attackerPerms = new ArrayList(); - for (UUID attackerId: attackerList) { - attackerPerms.add(game.getPermanent(attackerId)); - } - UUID attackerId = player.chooseAttackerOrder(attackerPerms, game); - attackerOrder.add(attackerId); - attackerList.remove(attackerId); - } - } - } - - public int totalAttackerDamage(Game game) { - int total = 0; - for (UUID attackerId: attackers) { - total += game.getPermanent(attackerId).getPower().getValue(); - } - return total; - } + public void pickAttackerOrder(UUID playerId, Game game) { + if (attackers.isEmpty()) + return; + Player player = game.getPlayer(playerId); + List attackerList = new ArrayList(attackers); + attackerOrder.clear(); + while (true) { + if (attackerList.size() == 1) { + attackerOrder.add(attackerList.get(0)); + break; + } + else { + List attackerPerms = new ArrayList(); + for (UUID attackerId: attackerList) { + attackerPerms.add(game.getPermanent(attackerId)); + } + UUID attackerId = player.chooseAttackerOrder(attackerPerms, game); + attackerOrder.add(attackerId); + attackerList.remove(attackerId); + } + } + } - public boolean isDefenderIsPlaneswalker() { - return defenderIsPlaneswalker; - } + public int totalAttackerDamage(Game game) { + int total = 0; + for (UUID attackerId: attackers) { + total += game.getPermanent(attackerId).getPower().getValue(); + } + return total; + } - public void remove(UUID creatureId) { - if (attackers.contains(creatureId)) { - attackers.remove(creatureId); - } - if (blockers.contains(creatureId)) { - blockers.remove(creatureId); + public boolean isDefenderIsPlaneswalker() { + return defenderIsPlaneswalker; + } + + public void remove(UUID creatureId) { + if (attackers.contains(creatureId)) { + attackers.remove(creatureId); + } + if (blockers.contains(creatureId)) { + blockers.remove(creatureId); // ayratn: Issue 375 /* @@ -486,47 +486,47 @@ public class CombatGroup implements Serializable, Copyable { blocked = false; */ - //20100423 - 509.2a - if (blockerOrder.contains(creatureId)) - blockerOrder.remove(creatureId); - } - } + //20100423 - 509.2a + if (blockerOrder.contains(creatureId)) + blockerOrder.remove(creatureId); + } + } - public void checkBlockRestrictions(Game game) { - if (attackers.isEmpty()) { - return; - } - for (UUID uuid : attackers) { - Permanent attacker = game.getPermanent(uuid); - if (attacker != null && this.blocked && attacker.getMinBlockedBy() > 1 && blockers.size() > 0 && blockers.size() < attacker.getMinBlockedBy()) { - for (UUID blockerId : blockers) { - Permanent blocker = game.getPermanent(blockerId); - if (blocker != null) { - blocker.setBlocking(blocker.getBlocking() - 1); - } - } - blockers.clear(); - blockerOrder.clear(); - this.blocked = false; - game.informPlayers(attacker.getName() + " can't be blocked except by " + attacker.getMinBlockedBy() + " or more creatures. Blockers discarded."); - return; - } - } - for (UUID blockerId : blockers) { - for (UUID attackerId: attackers) { - game.fireEvent(GameEvent.getEvent(GameEvent.EventType.BLOCKER_DECLARED, attackerId, blockerId, players.get(blockerId))); - } - } - if(!blockers.isEmpty()) { - for (UUID attackerId: attackers) { - game.fireEvent(GameEvent.getEvent(GameEvent.EventType.CREATURE_BLOCKED, attackerId, null)); - } - } - } + public void checkBlockRestrictions(Game game) { + if (attackers.isEmpty()) { + return; + } + for (UUID uuid : attackers) { + Permanent attacker = game.getPermanent(uuid); + if (attacker != null && this.blocked && attacker.getMinBlockedBy() > 1 && blockers.size() > 0 && blockers.size() < attacker.getMinBlockedBy()) { + for (UUID blockerId : blockers) { + Permanent blocker = game.getPermanent(blockerId); + if (blocker != null) { + blocker.setBlocking(blocker.getBlocking() - 1); + } + } + blockers.clear(); + blockerOrder.clear(); + this.blocked = false; + game.informPlayers(attacker.getName() + " can't be blocked except by " + attacker.getMinBlockedBy() + " or more creatures. Blockers discarded."); + return; + } + } + for (UUID blockerId : blockers) { + for (UUID attackerId: attackers) { + game.fireEvent(GameEvent.getEvent(GameEvent.EventType.BLOCKER_DECLARED, attackerId, blockerId, players.get(blockerId))); + } + } + if(!blockers.isEmpty()) { + for (UUID attackerId: attackers) { + game.fireEvent(GameEvent.getEvent(GameEvent.EventType.CREATURE_BLOCKED, attackerId, null)); + } + } + } - @Override - public CombatGroup copy() { - return new CombatGroup(this); - } + @Override + public CombatGroup copy() { + return new CombatGroup(this); + } } diff --git a/Mage/src/mage/game/command/Command.java b/Mage/src/mage/game/command/Command.java index 48be8f0286..4ee5ffb2bd 100644 --- a/Mage/src/mage/game/command/Command.java +++ b/Mage/src/mage/game/command/Command.java @@ -36,19 +36,19 @@ import java.util.ArrayList; */ public class Command extends ArrayList { - public Command () {} + public Command () {} - public Command(final Command command) { - addAll(command); - } + public Command(final Command command) { + addAll(command); + } - /*public void checkTriggers(GameEvent event, Game game) { - for (CommandObject commandObject: this) { - commandObject.checkTriggers(event, game); - } + /*public void checkTriggers(GameEvent event, Game game) { + for (CommandObject commandObject: this) { + commandObject.checkTriggers(event, game); + } }*/ - public Command copy() { - return new Command(this); - } + public Command copy() { + return new Command(this); + } } diff --git a/Mage/src/mage/game/command/CommandObject.java b/Mage/src/mage/game/command/CommandObject.java index 9464dfe571..76ded00771 100644 --- a/Mage/src/mage/game/command/CommandObject.java +++ b/Mage/src/mage/game/command/CommandObject.java @@ -38,11 +38,11 @@ import java.util.UUID; */ public interface CommandObject extends MageObject { - public UUID getSourceId(); - public UUID getControllerId(); + public UUID getSourceId(); + public UUID getControllerId(); public void assignNewId(); -// public void checkTriggers(GameEvent event, Game game); - - @Override - public CommandObject copy(); +// public void checkTriggers(GameEvent event, Game game); + + @Override + public CommandObject copy(); } diff --git a/Mage/src/mage/game/command/Emblem.java b/Mage/src/mage/game/command/Emblem.java index 0831d392b6..8d8b80ab16 100644 --- a/Mage/src/mage/game/command/Emblem.java +++ b/Mage/src/mage/game/command/Emblem.java @@ -47,111 +47,111 @@ import java.util.UUID; */ public class Emblem implements CommandObject { - private static List emptyList = new ArrayList(); - private static ObjectColor emptyColor = new ObjectColor(); - private static ManaCosts emptyCost = new ManaCostsImpl(); + private static List emptyList = new ArrayList(); + private static ObjectColor emptyColor = new ObjectColor(); + private static ManaCosts emptyCost = new ManaCostsImpl(); - private UUID id; - private UUID controllerId; - private UUID sourceId; - private Abilities abilites = new AbilitiesImpl(); + private UUID id; + private UUID controllerId; + private UUID sourceId; + private Abilities abilites = new AbilitiesImpl(); - public Emblem() { - this.id = UUID.randomUUID(); - } + public Emblem() { + this.id = UUID.randomUUID(); + } - public Emblem(Emblem emblem) { - this.id = emblem.id; - this.controllerId = emblem.controllerId; - this.sourceId = emblem.sourceId; - this.abilites = emblem.abilites.copy(); - } + public Emblem(Emblem emblem) { + this.id = emblem.id; + this.controllerId = emblem.controllerId; + this.sourceId = emblem.sourceId; + this.abilites = emblem.abilites.copy(); + } @Override public void assignNewId() { this.id = UUID.randomUUID(); } - @Override - public UUID getSourceId() { - return this.sourceId; - } + @Override + public UUID getSourceId() { + return this.sourceId; + } - @Override - public UUID getControllerId() { - return this.controllerId; - } + @Override + public UUID getControllerId() { + return this.controllerId; + } public void setControllerId(UUID controllerId) { - this.controllerId = controllerId; + this.controllerId = controllerId; this.abilites.setControllerId(controllerId); - } + } - public void setSourceId(UUID sourceId) { - this.sourceId = sourceId; - } + public void setSourceId(UUID sourceId) { + this.sourceId = sourceId; + } - @Override - public String getName() { - return ""; - } + @Override + public String getName() { + return ""; + } - @Override - public void setName(String name) {} + @Override + public void setName(String name) {} - @Override - public List getCardType() { - return emptyList; - } + @Override + public List getCardType() { + return emptyList; + } - @Override - public List getSubtype() { - return emptyList; - } + @Override + public List getSubtype() { + return emptyList; + } - @Override - public boolean hasSubtype(String subtype) { - return false; - } + @Override + public boolean hasSubtype(String subtype) { + return false; + } - @Override - public List getSupertype() { - return emptyList; - } + @Override + public List getSupertype() { + return emptyList; + } - @Override - public Abilities getAbilities() { - return abilites; - } + @Override + public Abilities getAbilities() { + return abilites; + } - @Override - public ObjectColor getColor() { - return emptyColor; - } + @Override + public ObjectColor getColor() { + return emptyColor; + } - @Override - public ManaCosts getManaCost() { - return emptyCost; - } + @Override + public ManaCosts getManaCost() { + return emptyCost; + } - @Override - public MageInt getPower() { - return MageInt.EmptyMageInt; - } + @Override + public MageInt getPower() { + return MageInt.EmptyMageInt; + } - @Override - public MageInt getToughness() { - return MageInt.EmptyMageInt; - } + @Override + public MageInt getToughness() { + return MageInt.EmptyMageInt; + } - @Override - public void adjustCosts(Ability ability, Game game) {} + @Override + public void adjustCosts(Ability ability, Game game) {} - @Override - public UUID getId() { - return this.id; - } + @Override + public UUID getId() { + return this.id; + } @Override public void setCopy(boolean isCopy) { @@ -163,7 +163,7 @@ public class Emblem implements CommandObject { } @Override - public Emblem copy() { - return new Emblem(this); - } + public Emblem copy() { + return new Emblem(this); + } } diff --git a/Mage/src/mage/game/draft/BoosterDraft.java b/Mage/src/mage/game/draft/BoosterDraft.java index c7919d8eae..4c337c8e1f 100644 --- a/Mage/src/mage/game/draft/BoosterDraft.java +++ b/Mage/src/mage/game/draft/BoosterDraft.java @@ -37,23 +37,23 @@ import mage.cards.ExpansionSet; */ public class BoosterDraft extends DraftImpl { - public BoosterDraft(DraftOptions options, List sets) { - super(options, sets); - } + public BoosterDraft(DraftOptions options, List sets) { + super(options, sets); + } - @Override - public void start() { - while (boosterNum < sets.size()) { - openBooster(); - while (pickCards()) { - if (boosterNum % 2 == 1) - passLeft(); - else - passRight(); - fireUpdatePlayersEvent(); - } - } - this.fireEndDraftEvent(); - } + @Override + public void start() { + while (boosterNum < sets.size()) { + openBooster(); + while (pickCards()) { + if (boosterNum % 2 == 1) + passLeft(); + else + passRight(); + fireUpdatePlayersEvent(); + } + } + this.fireEndDraftEvent(); + } } diff --git a/Mage/src/mage/game/draft/Draft.java b/Mage/src/mage/game/draft/Draft.java index d3b04b7d13..5188dd69e5 100644 --- a/Mage/src/mage/game/draft/Draft.java +++ b/Mage/src/mage/game/draft/Draft.java @@ -45,22 +45,22 @@ import mage.players.Player; */ public interface Draft extends MageItem, Serializable { - public void addPlayer(Player player); - public Collection getPlayers(); - public DraftPlayer getPlayer(UUID playerId); - public List getSets(); - public int getBoosterNum(); - public int getCardNum(); - public boolean addPick(UUID playerId, UUID cardId); - public void start(); - public boolean allJoined(); - public void leave(UUID playerId); - public void autoPick(UUID playerId); + public void addPlayer(Player player); + public Collection getPlayers(); + public DraftPlayer getPlayer(UUID playerId); + public List getSets(); + public int getBoosterNum(); + public int getCardNum(); + public boolean addPick(UUID playerId, UUID cardId); + public void start(); + public boolean allJoined(); + public void leave(UUID playerId); + public void autoPick(UUID playerId); - public void addTableEventListener(Listener listener); - public void fireUpdatePlayersEvent(); - public void fireEndDraftEvent(); - public void addPlayerQueryEventListener(Listener listener); - public void firePickCardEvent(UUID playerId); + public void addTableEventListener(Listener listener); + public void fireUpdatePlayersEvent(); + public void fireEndDraftEvent(); + public void addPlayerQueryEventListener(Listener listener); + public void firePickCardEvent(UUID playerId); } diff --git a/Mage/src/mage/game/draft/DraftImpl.java b/Mage/src/mage/game/draft/DraftImpl.java index ca5f62b61d..272b49d072 100644 --- a/Mage/src/mage/game/draft/DraftImpl.java +++ b/Mage/src/mage/game/draft/DraftImpl.java @@ -51,204 +51,204 @@ import mage.players.PlayerList; */ public abstract class DraftImpl> implements Draft { - protected final UUID id; - protected Map players = new HashMap(); - protected PlayerList table = new PlayerList(); - protected List sets; - protected List setCodes; - protected int boosterNum = 0; - protected int cardNum = 0; - protected TimingOption timing; - protected int[] times = {75, 70, 65, 60, 55, 50, 45, 40, 35, 30, 25, 20, 15, 10, 5}; + protected final UUID id; + protected Map players = new HashMap(); + protected PlayerList table = new PlayerList(); + protected List sets; + protected List setCodes; + protected int boosterNum = 0; + protected int cardNum = 0; + protected TimingOption timing; + protected int[] times = {75, 70, 65, 60, 55, 50, 45, 40, 35, 30, 25, 20, 15, 10, 5}; - protected transient TableEventSource tableEventSource = new TableEventSource(); - protected transient PlayerQueryEventSource playerQueryEventSource = new PlayerQueryEventSource(); + protected transient TableEventSource tableEventSource = new TableEventSource(); + protected transient PlayerQueryEventSource playerQueryEventSource = new PlayerQueryEventSource(); - public DraftImpl(DraftOptions options, List sets) { - id = UUID.randomUUID(); - this.setCodes = options.getSetCodes(); - this.timing = options.getTiming(); - this.sets = sets; - } + public DraftImpl(DraftOptions options, List sets) { + id = UUID.randomUUID(); + this.setCodes = options.getSetCodes(); + this.timing = options.getTiming(); + this.sets = sets; + } - @Override - public UUID getId() { - return id; - } + @Override + public UUID getId() { + return id; + } - @Override - public void addPlayer(Player player) { - DraftPlayer draftPlayer = new DraftPlayer(player); - players.put(player.getId(), draftPlayer); - table.add(player.getId()); - } + @Override + public void addPlayer(Player player) { + DraftPlayer draftPlayer = new DraftPlayer(player); + players.put(player.getId(), draftPlayer); + table.add(player.getId()); + } - @Override - public Collection getPlayers() { - return players.values(); - } + @Override + public Collection getPlayers() { + return players.values(); + } - @Override - public DraftPlayer getPlayer(UUID playerId) { - return players.get(playerId); - } + @Override + public DraftPlayer getPlayer(UUID playerId) { + return players.get(playerId); + } - @Override - public List getSets() { - return sets; - } + @Override + public List getSets() { + return sets; + } - @Override - public int getBoosterNum() { - return boosterNum; - } + @Override + public int getBoosterNum() { + return boosterNum; + } - @Override - public int getCardNum() { - return cardNum; - } + @Override + public int getCardNum() { + return cardNum; + } - @Override - public void leave(UUID playerId) { - //TODO: implement this - } + @Override + public void leave(UUID playerId) { + //TODO: implement this + } - @Override - public void autoPick(UUID playerId) { - this.addPick(playerId, players.get(playerId).getBooster().get(0).getId()); - } + @Override + public void autoPick(UUID playerId) { + this.addPick(playerId, players.get(playerId).getBooster().get(0).getId()); + } - protected void passLeft() { - UUID startId = table.get(0); - UUID currentId = startId; - UUID nextId = table.getNext(); - DraftPlayer current = players.get(currentId); - DraftPlayer next = players.get(nextId); - List currentBooster = current.booster; - while (true) { - List nextBooster = next.booster; - next.setBooster(currentBooster); - if (nextId == startId) - break; - currentBooster = nextBooster; - current = next; - currentId = nextId; - nextId = table.getNext(); - next = players.get(nextId); - } - } + protected void passLeft() { + UUID startId = table.get(0); + UUID currentId = startId; + UUID nextId = table.getNext(); + DraftPlayer current = players.get(currentId); + DraftPlayer next = players.get(nextId); + List currentBooster = current.booster; + while (true) { + List nextBooster = next.booster; + next.setBooster(currentBooster); + if (nextId == startId) + break; + currentBooster = nextBooster; + current = next; + currentId = nextId; + nextId = table.getNext(); + next = players.get(nextId); + } + } - protected void passRight() { - UUID startId = table.get(0); - UUID currentId = startId; - UUID prevId = table.getPrevious(); - DraftPlayer current = players.get(currentId); - DraftPlayer prev = players.get(prevId); - List currentBooster = current.booster; - while (true) { - List prevBooster = prev.booster; - prev.setBooster(currentBooster); - if (prevId == startId) - break; - currentBooster = prevBooster; - current = prev; - currentId = prevId; - prevId = table.getPrevious(); - prev = players.get(prevId); - } - } + protected void passRight() { + UUID startId = table.get(0); + UUID currentId = startId; + UUID prevId = table.getPrevious(); + DraftPlayer current = players.get(currentId); + DraftPlayer prev = players.get(prevId); + List currentBooster = current.booster; + while (true) { + List prevBooster = prev.booster; + prev.setBooster(currentBooster); + if (prevId == startId) + break; + currentBooster = prevBooster; + current = prev; + currentId = prevId; + prevId = table.getPrevious(); + prev = players.get(prevId); + } + } - protected void openBooster() { - if (boosterNum < sets.size()) { - for (DraftPlayer player: players.values()) { - player.setBooster(sets.get(boosterNum).createBooster()); - } - } - boosterNum++; - cardNum = 1; - fireUpdatePlayersEvent(); - } + protected void openBooster() { + if (boosterNum < sets.size()) { + for (DraftPlayer player: players.values()) { + player.setBooster(sets.get(boosterNum).createBooster()); + } + } + boosterNum++; + cardNum = 1; + fireUpdatePlayersEvent(); + } - protected boolean pickCards() { - cardNum++; - for (DraftPlayer player: players.values()) { - if (player.getBooster().size() == 0) - return false; - player.setPicking(); - player.getPlayer().pickCard(player.getBooster(), player.getDeck(), this); - } - synchronized(this) { - while (!donePicking()) { - try { - this.wait(); - } catch (InterruptedException ex) { } - } - } - return true; - } + protected boolean pickCards() { + cardNum++; + for (DraftPlayer player: players.values()) { + if (player.getBooster().size() == 0) + return false; + player.setPicking(); + player.getPlayer().pickCard(player.getBooster(), player.getDeck(), this); + } + synchronized(this) { + while (!donePicking()) { + try { + this.wait(); + } catch (InterruptedException ex) { } + } + } + return true; + } - protected boolean donePicking() { - for (DraftPlayer player: players.values()) { - if (player.isPicking()) - return false; - } - return true; - } + protected boolean donePicking() { + for (DraftPlayer player: players.values()) { + if (player.isPicking()) + return false; + } + return true; + } - @Override - public boolean allJoined() { - for (DraftPlayer player: this.players.values()) { - if (!player.isJoined()) - return false; - } - return true; - } + @Override + public boolean allJoined() { + for (DraftPlayer player: this.players.values()) { + if (!player.isJoined()) + return false; + } + return true; + } - @Override - public void addTableEventListener(Listener listener) { - tableEventSource.addListener(listener); - } + @Override + public void addTableEventListener(Listener listener) { + tableEventSource.addListener(listener); + } - @Override - public void fireUpdatePlayersEvent() { - tableEventSource.fireTableEvent(EventType.UPDATE, null, this); - } + @Override + public void fireUpdatePlayersEvent() { + tableEventSource.fireTableEvent(EventType.UPDATE, null, this); + } - @Override - public void fireEndDraftEvent() { - tableEventSource.fireTableEvent(EventType.END, null, this); - } + @Override + public void fireEndDraftEvent() { + tableEventSource.fireTableEvent(EventType.END, null, this); + } - @Override - public void addPlayerQueryEventListener(Listener listener) { - playerQueryEventSource.addListener(listener); - } + @Override + public void addPlayerQueryEventListener(Listener listener) { + playerQueryEventSource.addListener(listener); + } - @Override - public void firePickCardEvent(UUID playerId) { - DraftPlayer player = players.get(playerId); - if (cardNum > 15) - cardNum = 15; - int time = times[cardNum - 1] * timing.getFactor(); - playerQueryEventSource.pickCard(playerId, "Pick card", player.getBooster(), time); - } + @Override + public void firePickCardEvent(UUID playerId) { + DraftPlayer player = players.get(playerId); + if (cardNum > 15) + cardNum = 15; + int time = times[cardNum - 1] * timing.getFactor(); + playerQueryEventSource.pickCard(playerId, "Pick card", player.getBooster(), time); + } - @Override - public boolean addPick(UUID playerId, UUID cardId) { - DraftPlayer player = players.get(playerId); - if (player.isPicking()) { - for (Card card: player.booster) { - if (card.getId().equals(cardId)) { - player.addPick(card); - player.booster.remove(card); - break; - } - } - synchronized(this) { - this.notifyAll(); - } - } - return !player.isPicking(); - } + @Override + public boolean addPick(UUID playerId, UUID cardId) { + DraftPlayer player = players.get(playerId); + if (player.isPicking()) { + for (Card card: player.booster) { + if (card.getId().equals(cardId)) { + player.addPick(card); + player.booster.remove(card); + break; + } + } + synchronized(this) { + this.notifyAll(); + } + } + return !player.isPicking(); + } } diff --git a/Mage/src/mage/game/draft/DraftOptions.java b/Mage/src/mage/game/draft/DraftOptions.java index 58b192b4d8..adff6821fe 100644 --- a/Mage/src/mage/game/draft/DraftOptions.java +++ b/Mage/src/mage/game/draft/DraftOptions.java @@ -37,38 +37,38 @@ import mage.game.tournament.LimitedOptions; */ public class DraftOptions extends LimitedOptions implements Serializable { - protected String draftType; - protected TimingOption timing; + protected String draftType; + protected TimingOption timing; - public enum TimingOption { - REGULAR (1), - BEGINNER (2), - NONE (0); - - private int factor; + public enum TimingOption { + REGULAR (1), + BEGINNER (2), + NONE (0); - TimingOption(int factor) { - this.factor = factor; - } + private int factor; - public int getFactor() { - return this.factor; - } - } + TimingOption(int factor) { + this.factor = factor; + } - public String getDraftType() { - return draftType; - } + public int getFactor() { + return this.factor; + } + } - public void setDraftType(String draftType) { - this.draftType = draftType; - } + public String getDraftType() { + return draftType; + } - public TimingOption getTiming() { - return timing; - } + public void setDraftType(String draftType) { + this.draftType = draftType; + } - public void setTiming(TimingOption timing) { - this.timing = timing; - } + public TimingOption getTiming() { + return timing; + } + + public void setTiming(TimingOption timing) { + this.timing = timing; + } } diff --git a/Mage/src/mage/game/draft/DraftPlayer.java b/Mage/src/mage/game/draft/DraftPlayer.java index 671d262fa5..c794ffbc2f 100644 --- a/Mage/src/mage/game/draft/DraftPlayer.java +++ b/Mage/src/mage/game/draft/DraftPlayer.java @@ -42,69 +42,69 @@ import mage.players.Player; */ public class DraftPlayer { - protected UUID id; - protected Player player; - protected Deck deck; - protected List booster; - protected boolean picking; - protected boolean joined = false; + protected UUID id; + protected Player player; + protected Deck deck; + protected List booster; + protected boolean picking; + protected boolean joined = false; - public DraftPlayer(Player player) { - id = UUID.randomUUID(); - this.player = player; - this.deck = new Deck(); - } + public DraftPlayer(Player player) { + id = UUID.randomUUID(); + this.player = player; + this.deck = new Deck(); + } - public UUID getId() { - return id; - } + public UUID getId() { + return id; + } - public Player getPlayer() { - return player; - } + public Player getPlayer() { + return player; + } - public Deck getDeck() { - return deck; - } + public Deck getDeck() { + return deck; + } - public void addPick(Card card) { - deck.getSideboard().add(card); - synchronized(booster) { - booster.remove(card); - } - picking = false; - } + public void addPick(Card card) { + deck.getSideboard().add(card); + synchronized(booster) { + booster.remove(card); + } + picking = false; + } - public void openBooster(ExpansionSet set) { - synchronized(booster) { - booster = set.createBooster(); - } - } + public void openBooster(ExpansionSet set) { + synchronized(booster) { + booster = set.createBooster(); + } + } - public void setBooster(List booster) { - this.booster = booster; - } + public void setBooster(List booster) { + this.booster = booster; + } - public List getBooster() { - synchronized(booster) { - return new ArrayList(booster); - } - } + public List getBooster() { + synchronized(booster) { + return new ArrayList(booster); + } + } - public void setPicking() { - picking = true; - } + public void setPicking() { + picking = true; + } - public boolean isPicking() { - return picking; - } + public boolean isPicking() { + return picking; + } - public boolean isJoined() { - return joined; - } + public boolean isJoined() { + return joined; + } - public void setJoined() { - this.joined = true; - } + public void setJoined() { + this.joined = true; + } } diff --git a/Mage/src/mage/game/events/DamageCreatureEvent.java b/Mage/src/mage/game/events/DamageCreatureEvent.java index 7110ad3d23..c47ae1fd0a 100644 --- a/Mage/src/mage/game/events/DamageCreatureEvent.java +++ b/Mage/src/mage/game/events/DamageCreatureEvent.java @@ -36,8 +36,8 @@ import java.util.UUID; */ public class DamageCreatureEvent extends DamageEvent { - public DamageCreatureEvent(UUID targetId, UUID sourceId, UUID playerId, int amount, boolean preventable, boolean combat) { - super(EventType.DAMAGE_CREATURE, targetId, sourceId, playerId, amount, preventable, combat); - } + public DamageCreatureEvent(UUID targetId, UUID sourceId, UUID playerId, int amount, boolean preventable, boolean combat) { + super(EventType.DAMAGE_CREATURE, targetId, sourceId, playerId, amount, preventable, combat); + } } diff --git a/Mage/src/mage/game/events/DamageEvent.java b/Mage/src/mage/game/events/DamageEvent.java index 47e8b5fd82..ec4cfd8d5a 100644 --- a/Mage/src/mage/game/events/DamageEvent.java +++ b/Mage/src/mage/game/events/DamageEvent.java @@ -36,19 +36,19 @@ import java.util.UUID; */ public abstract class DamageEvent extends GameEvent { - protected boolean combat; + protected boolean combat; - public DamageEvent(EventType type, UUID targetId, UUID sourceId, UUID playerId, int amount, boolean preventable, boolean combat) { - super(type, targetId, sourceId, playerId, amount, preventable); - this.combat = combat; - } - - public boolean isCombatDamage() { - return combat; - } + public DamageEvent(EventType type, UUID targetId, UUID sourceId, UUID playerId, int amount, boolean preventable, boolean combat) { + super(type, targetId, sourceId, playerId, amount, preventable); + this.combat = combat; + } - public boolean isPreventable() { - return flag; - } + public boolean isCombatDamage() { + return combat; + } + + public boolean isPreventable() { + return flag; + } } diff --git a/Mage/src/mage/game/events/DamagePlaneswalkerEvent.java b/Mage/src/mage/game/events/DamagePlaneswalkerEvent.java index cf3414bba7..1416250e47 100644 --- a/Mage/src/mage/game/events/DamagePlaneswalkerEvent.java +++ b/Mage/src/mage/game/events/DamagePlaneswalkerEvent.java @@ -36,8 +36,8 @@ import java.util.UUID; */ public class DamagePlaneswalkerEvent extends DamageEvent { - public DamagePlaneswalkerEvent(UUID targetId, UUID sourceId, UUID playerId, int amount, boolean preventable, boolean combat) { - super(EventType.DAMAGE_PLANESWALKER, targetId, sourceId, playerId, amount, preventable, combat); - } + public DamagePlaneswalkerEvent(UUID targetId, UUID sourceId, UUID playerId, int amount, boolean preventable, boolean combat) { + super(EventType.DAMAGE_PLANESWALKER, targetId, sourceId, playerId, amount, preventable, combat); + } } diff --git a/Mage/src/mage/game/events/DamagePlayerEvent.java b/Mage/src/mage/game/events/DamagePlayerEvent.java index c25f60c8e9..29b5815cd7 100644 --- a/Mage/src/mage/game/events/DamagePlayerEvent.java +++ b/Mage/src/mage/game/events/DamagePlayerEvent.java @@ -36,8 +36,8 @@ import java.util.UUID; */ public class DamagePlayerEvent extends DamageEvent { - public DamagePlayerEvent(UUID targetId, UUID sourceId, UUID playerId, int amount, boolean preventable, boolean combat) { - super(EventType.DAMAGE_PLAYER, targetId, sourceId, playerId, amount, preventable, combat); - } - + public DamagePlayerEvent(UUID targetId, UUID sourceId, UUID playerId, int amount, boolean preventable, boolean combat) { + super(EventType.DAMAGE_PLAYER, targetId, sourceId, playerId, amount, preventable, combat); + } + } diff --git a/Mage/src/mage/game/events/DamagedCreatureEvent.java b/Mage/src/mage/game/events/DamagedCreatureEvent.java index 11075283e3..c26967f21d 100644 --- a/Mage/src/mage/game/events/DamagedCreatureEvent.java +++ b/Mage/src/mage/game/events/DamagedCreatureEvent.java @@ -36,8 +36,8 @@ import java.util.UUID; */ public class DamagedCreatureEvent extends DamagedEvent { - public DamagedCreatureEvent(UUID targetId, UUID sourceId, UUID playerId, int amount, boolean combat) { - super(EventType.DAMAGED_CREATURE, targetId, sourceId, playerId, amount, combat); - } + public DamagedCreatureEvent(UUID targetId, UUID sourceId, UUID playerId, int amount, boolean combat) { + super(EventType.DAMAGED_CREATURE, targetId, sourceId, playerId, amount, combat); + } } diff --git a/Mage/src/mage/game/events/DamagedEvent.java b/Mage/src/mage/game/events/DamagedEvent.java index 03f31209be..59cd531756 100644 --- a/Mage/src/mage/game/events/DamagedEvent.java +++ b/Mage/src/mage/game/events/DamagedEvent.java @@ -36,19 +36,19 @@ import java.util.UUID; */ public abstract class DamagedEvent extends GameEvent { - protected boolean combat; + protected boolean combat; - public DamagedEvent(EventType type, UUID targetId, UUID sourceId, UUID playerId, int amount, boolean combat) { - super(type, targetId, sourceId, playerId, amount, false); - this.combat = combat; - } - - public boolean isCombatDamage() { - return combat; - } + public DamagedEvent(EventType type, UUID targetId, UUID sourceId, UUID playerId, int amount, boolean combat) { + super(type, targetId, sourceId, playerId, amount, false); + this.combat = combat; + } - public boolean isPreventable() { - return flag; - } + public boolean isCombatDamage() { + return combat; + } + + public boolean isPreventable() { + return flag; + } } diff --git a/Mage/src/mage/game/events/DamagedPlaneswalkerEvent.java b/Mage/src/mage/game/events/DamagedPlaneswalkerEvent.java index f15e237aff..14d254d538 100644 --- a/Mage/src/mage/game/events/DamagedPlaneswalkerEvent.java +++ b/Mage/src/mage/game/events/DamagedPlaneswalkerEvent.java @@ -36,8 +36,8 @@ import java.util.UUID; */ public class DamagedPlaneswalkerEvent extends DamagedEvent { - public DamagedPlaneswalkerEvent(UUID targetId, UUID sourceId, UUID playerId, int amount, boolean combat) { - super(EventType.DAMAGED_PLANESWALKER, targetId, sourceId, playerId, amount, combat); - } + public DamagedPlaneswalkerEvent(UUID targetId, UUID sourceId, UUID playerId, int amount, boolean combat) { + super(EventType.DAMAGED_PLANESWALKER, targetId, sourceId, playerId, amount, combat); + } } diff --git a/Mage/src/mage/game/events/DamagedPlayerEvent.java b/Mage/src/mage/game/events/DamagedPlayerEvent.java index 172f8edaae..2082193b28 100644 --- a/Mage/src/mage/game/events/DamagedPlayerEvent.java +++ b/Mage/src/mage/game/events/DamagedPlayerEvent.java @@ -36,8 +36,8 @@ import java.util.UUID; */ public class DamagedPlayerEvent extends DamagedEvent { - public DamagedPlayerEvent(UUID targetId, UUID sourceId, UUID playerId, int amount, boolean combat) { - super(EventType.DAMAGED_PLAYER, targetId, sourceId, playerId, amount, combat); - } - + public DamagedPlayerEvent(UUID targetId, UUID sourceId, UUID playerId, int amount, boolean combat) { + super(EventType.DAMAGED_PLAYER, targetId, sourceId, playerId, amount, combat); + } + } diff --git a/Mage/src/mage/game/events/EventDispatcher.java b/Mage/src/mage/game/events/EventDispatcher.java index a603b33ebb..25f2b45ea8 100644 --- a/Mage/src/mage/game/events/EventDispatcher.java +++ b/Mage/src/mage/game/events/EventDispatcher.java @@ -38,21 +38,21 @@ import java.util.concurrent.CopyOnWriteArrayList; */ public abstract class EventDispatcher implements Serializable { - private List> listeners = new CopyOnWriteArrayList>(); + private List> listeners = new CopyOnWriteArrayList>(); - public void addListener(Listener listener) { - if (!listeners.contains(listener)) { - listeners.add(listener); - } - } + public void addListener(Listener listener) { + if (!listeners.contains(listener)) { + listeners.add(listener); + } + } - public void removeListener(Listener listener) { - listeners.remove(listener); - } + public void removeListener(Listener listener) { + listeners.remove(listener); + } - public void fireEvent(E event) { - for (Listener listener : listeners) { - listener.event(event); - } - } + public void fireEvent(E event) { + for (Listener listener : listeners) { + listener.event(event); + } + } } diff --git a/Mage/src/mage/game/events/EventSource.java b/Mage/src/mage/game/events/EventSource.java index 091f9a5781..5a46c14be4 100644 --- a/Mage/src/mage/game/events/EventSource.java +++ b/Mage/src/mage/game/events/EventSource.java @@ -36,5 +36,5 @@ import java.io.Serializable; */ public interface EventSource extends Serializable { - void addListener(Listener listener); + void addListener(Listener listener); } diff --git a/Mage/src/mage/game/events/GameEvent.java b/Mage/src/mage/game/events/GameEvent.java index a6342bc2cd..ec25173bc7 100644 --- a/Mage/src/mage/game/events/GameEvent.java +++ b/Mage/src/mage/game/events/GameEvent.java @@ -38,172 +38,172 @@ import java.util.UUID; */ public class GameEvent { - protected EventType type; - protected UUID targetId; - protected UUID sourceId; - protected UUID playerId; - protected int amount; - protected boolean flag; - protected String data; + protected EventType type; + protected UUID targetId; + protected UUID sourceId; + protected UUID playerId; + protected int amount; + protected boolean flag; + protected String data; protected Zone zone; - public enum EventType { + public enum EventType { - //Game events - BEGINNING, - PREVENT_DAMAGE, PREVENTED_DAMAGE, + //Game events + BEGINNING, + PREVENT_DAMAGE, PREVENTED_DAMAGE, - //Turn-based events - CHANGE_PHASE, PHASE_CHANGED, - CHANGE_STEP, STEP_CHANGED, - BEGINNING_PHASE, BEGINNING_PHASE_PRE, BEGINNING_PHASE_POST, - UNTAP_STEP_PRE, UNTAP_STEP, UNTAP_STEP_POST, - UPKEEP_STEP_PRE, UPKEEP_STEP, UPKEEP_STEP_POST, - DRAW_STEP_PRE, DRAW_STEP, DRAW_STEP_POST, - PRECOMBAT_MAIN_PHASE, PRECOMBAT_MAIN_PHASE_PRE, PRECOMBAT_MAIN_PHASE_POST, - PRECOMBAT_MAIN_STEP_PRE, PRECOMBAT_MAIN_STEP, PRECOMBAT_MAIN_STEP_POST, - COMBAT_PHASE, COMBAT_PHASE_PRE, COMBAT_PHASE_POST, - BEGIN_COMBAT_STEP_PRE, BEGIN_COMBAT_STEP, BEGIN_COMBAT_STEP_POST, - DECLARE_ATTACKERS_STEP_PRE, DECLARE_ATTACKERS_STEP, DECLARE_ATTACKERS_STEP_POST, - DECLARE_BLOCKERS_STEP_PRE, DECLARE_BLOCKERS_STEP, DECLARE_BLOCKERS_STEP_POST, - COMBAT_DAMAGE_STEP_PRE, COMBAT_DAMAGE_STEP, COMBAT_DAMAGE_STEP_POST, - END_COMBAT_STEP_PRE, END_COMBAT_STEP, END_COMBAT_STEP_POST, - POSTCOMBAT_MAIN_PHASE, POSTCOMBAT_MAIN_PHASE_PRE, POSTCOMBAT_MAIN_PHASE_POST, - POSTCOMBAT_MAIN_STEP_PRE, POSTCOMBAT_MAIN_STEP, POSTCOMBAT_MAIN_STEP_POST, - END_PHASE, END_PHASE_PRE, END_PHASE_POST, - END_TURN_STEP_PRE, END_TURN_STEP, END_TURN_STEP_POST, - CLEANUP_STEP_PRE, CLEANUP_STEP, CLEANUP_STEP_POST, - EMPTY_MANA_POOLS, - AT_END_OF_TURN, + //Turn-based events + CHANGE_PHASE, PHASE_CHANGED, + CHANGE_STEP, STEP_CHANGED, + BEGINNING_PHASE, BEGINNING_PHASE_PRE, BEGINNING_PHASE_POST, + UNTAP_STEP_PRE, UNTAP_STEP, UNTAP_STEP_POST, + UPKEEP_STEP_PRE, UPKEEP_STEP, UPKEEP_STEP_POST, + DRAW_STEP_PRE, DRAW_STEP, DRAW_STEP_POST, + PRECOMBAT_MAIN_PHASE, PRECOMBAT_MAIN_PHASE_PRE, PRECOMBAT_MAIN_PHASE_POST, + PRECOMBAT_MAIN_STEP_PRE, PRECOMBAT_MAIN_STEP, PRECOMBAT_MAIN_STEP_POST, + COMBAT_PHASE, COMBAT_PHASE_PRE, COMBAT_PHASE_POST, + BEGIN_COMBAT_STEP_PRE, BEGIN_COMBAT_STEP, BEGIN_COMBAT_STEP_POST, + DECLARE_ATTACKERS_STEP_PRE, DECLARE_ATTACKERS_STEP, DECLARE_ATTACKERS_STEP_POST, + DECLARE_BLOCKERS_STEP_PRE, DECLARE_BLOCKERS_STEP, DECLARE_BLOCKERS_STEP_POST, + COMBAT_DAMAGE_STEP_PRE, COMBAT_DAMAGE_STEP, COMBAT_DAMAGE_STEP_POST, + END_COMBAT_STEP_PRE, END_COMBAT_STEP, END_COMBAT_STEP_POST, + POSTCOMBAT_MAIN_PHASE, POSTCOMBAT_MAIN_PHASE_PRE, POSTCOMBAT_MAIN_PHASE_POST, + POSTCOMBAT_MAIN_STEP_PRE, POSTCOMBAT_MAIN_STEP, POSTCOMBAT_MAIN_STEP_POST, + END_PHASE, END_PHASE_PRE, END_PHASE_POST, + END_TURN_STEP_PRE, END_TURN_STEP, END_TURN_STEP_POST, + CLEANUP_STEP_PRE, CLEANUP_STEP, CLEANUP_STEP_POST, + EMPTY_MANA_POOLS, + AT_END_OF_TURN, - //player events - ZONE_CHANGE, - DRAW_CARD, DREW_CARD, - DISCARDED_CARD, - CYCLE_CARD, CYCLED_CARD, - DAMAGE_PLAYER, DAMAGED_PLAYER, - PLAYER_LIFE_CHANGE, - GAIN_LIFE, GAINED_LIFE, - LOSE_LIFE, LOST_LIFE, - PLAY_LAND, LAND_PLAYED, - CAST_SPELL, SPELL_CAST, - ACTIVATE_ABILITY, ACTIVATED_ABILITY, - MANA_ADDED, MANA_PAYED, - LOSES, LOST, WINS, - TARGET, TARGETED, - COUNTER, COUNTERED, - DECLARING_ATTACKERS, DECLARED_ATTACKERS, - DECLARE_ATTACKER, ATTACKER_DECLARED, - DECLARING_BLOCKERS, DECLARED_BLOCKERS, - DECLARE_BLOCKER, BLOCKER_DECLARED, - CREATURE_BLOCKED, - SEARCH_LIBRARY, LIBRARY_SEARCHED, - SHUFFLE_LIBRARY, LIBRARY_SHUFFLED, - ENCHANT_PLAYER, ENCHANTED_PLAYER, + //player events + ZONE_CHANGE, + DRAW_CARD, DREW_CARD, + DISCARDED_CARD, + CYCLE_CARD, CYCLED_CARD, + DAMAGE_PLAYER, DAMAGED_PLAYER, + PLAYER_LIFE_CHANGE, + GAIN_LIFE, GAINED_LIFE, + LOSE_LIFE, LOST_LIFE, + PLAY_LAND, LAND_PLAYED, + CAST_SPELL, SPELL_CAST, + ACTIVATE_ABILITY, ACTIVATED_ABILITY, + MANA_ADDED, MANA_PAYED, + LOSES, LOST, WINS, + TARGET, TARGETED, + COUNTER, COUNTERED, + DECLARING_ATTACKERS, DECLARED_ATTACKERS, + DECLARE_ATTACKER, ATTACKER_DECLARED, + DECLARING_BLOCKERS, DECLARED_BLOCKERS, + DECLARE_BLOCKER, BLOCKER_DECLARED, + CREATURE_BLOCKED, + SEARCH_LIBRARY, LIBRARY_SEARCHED, + SHUFFLE_LIBRARY, LIBRARY_SHUFFLED, + ENCHANT_PLAYER, ENCHANTED_PLAYER, - //permanent events - ENTERS_THE_BATTLEFIELD, - TAP, TAPPED, TAPPED_FOR_MANA, - UNTAP, UNTAPPED, - FLIP, FLIPPED, - UNFLIP, UNFLIPPED, - TRANSFORM, TRANSFORMED, - PHASE_OUT, PHASED_OUT, - PHASE_IN, PHASED_IN, - TURNFACEUP, TURNEDFACEUP, - TURNFACEDOWN, TURNEDFACEDOWN, - DAMAGE_CREATURE, DAMAGED_CREATURE, - DAMAGE_PLANESWALKER, DAMAGED_PLANESWALKER, - DESTROY_PERMANENT, DESTROYED_PERMANENT, - SACRIFICE_PERMANENT, SACRIFICED_PERMANENT, - ATTACH, ATTACHED, - UNATTACH, UNATTACHED, + //permanent events + ENTERS_THE_BATTLEFIELD, + TAP, TAPPED, TAPPED_FOR_MANA, + UNTAP, UNTAPPED, + FLIP, FLIPPED, + UNFLIP, UNFLIPPED, + TRANSFORM, TRANSFORMED, + PHASE_OUT, PHASED_OUT, + PHASE_IN, PHASED_IN, + TURNFACEUP, TURNEDFACEUP, + TURNFACEDOWN, TURNEDFACEDOWN, + DAMAGE_CREATURE, DAMAGED_CREATURE, + DAMAGE_PLANESWALKER, DAMAGED_PLANESWALKER, + DESTROY_PERMANENT, DESTROYED_PERMANENT, + SACRIFICE_PERMANENT, SACRIFICED_PERMANENT, + ATTACH, ATTACHED, + UNATTACH, UNATTACHED, ADD_COUNTER, COUNTER_ADDED, - COUNTER_REMOVED, - LOSE_CONTROL, LOST_CONTROL, - GAIN_CONTROL, GAINED_CONTROL, - CREATE_TOKEN, - REGENERATE, REGENERATED, + COUNTER_REMOVED, + LOSE_CONTROL, LOST_CONTROL, + GAIN_CONTROL, GAINED_CONTROL, + CREATE_TOKEN, + REGENERATE, REGENERATED, - //combat events - COMBAT_DAMAGE_APPLIED, - SELECTED_ATTACKER, SELECTED_BLOCKER; + //combat events + COMBAT_DAMAGE_APPLIED, + SELECTED_ATTACKER, SELECTED_BLOCKER; - } + } - public GameEvent(EventType type, UUID targetId, UUID sourceId, UUID playerId) { - this(type, targetId, sourceId, playerId, 0, false); - } + public GameEvent(EventType type, UUID targetId, UUID sourceId, UUID playerId) { + this(type, targetId, sourceId, playerId, 0, false); + } - public GameEvent(EventType type, UUID targetId, UUID sourceId, UUID playerId, int amount, boolean flag) { - this.type = type; - this.targetId = targetId; - this.sourceId = sourceId; - this.amount = amount; - this.playerId = playerId; - this.flag = flag; - } + public GameEvent(EventType type, UUID targetId, UUID sourceId, UUID playerId, int amount, boolean flag) { + this.type = type; + this.targetId = targetId; + this.sourceId = sourceId; + this.amount = amount; + this.playerId = playerId; + this.flag = flag; + } - public static GameEvent getEvent(EventType type, UUID targetId, UUID sourceId, UUID playerId, int amount) { - return new GameEvent(type, targetId, sourceId, playerId, amount, false); - } + public static GameEvent getEvent(EventType type, UUID targetId, UUID sourceId, UUID playerId, int amount) { + return new GameEvent(type, targetId, sourceId, playerId, amount, false); + } - public static GameEvent getEvent(EventType type, UUID targetId, UUID sourceId, UUID playerId) { - return new GameEvent(type, targetId, sourceId, playerId); - } + public static GameEvent getEvent(EventType type, UUID targetId, UUID sourceId, UUID playerId) { + return new GameEvent(type, targetId, sourceId, playerId); + } - public static GameEvent getEvent(EventType type, UUID targetId, UUID playerId) { - return new GameEvent(type, targetId, null, playerId); - } + public static GameEvent getEvent(EventType type, UUID targetId, UUID playerId) { + return new GameEvent(type, targetId, null, playerId); + } - public static GameEvent getEvent(EventType type, UUID targetId, UUID playerId, String data, int amount) { - GameEvent event = getEvent(type, targetId,playerId); - event.setAmount(amount); - event.setData(data); - return event; - } + public static GameEvent getEvent(EventType type, UUID targetId, UUID playerId, String data, int amount) { + GameEvent event = getEvent(type, targetId,playerId); + event.setAmount(amount); + event.setData(data); + return event; + } public EventType getType() { - return type; - } + return type; + } - public UUID getTargetId() { - return targetId; - } + public UUID getTargetId() { + return targetId; + } - public UUID getSourceId() { - return sourceId; - } + public UUID getSourceId() { + return sourceId; + } - public UUID getPlayerId() { - return playerId; - } + public UUID getPlayerId() { + return playerId; + } - public int getAmount() { - return amount; - } + public int getAmount() { + return amount; + } - public boolean getFlag() { - return flag; - } + public boolean getFlag() { + return flag; + } - public void setAmount(int amount) { - this.amount = amount; - } + public void setAmount(int amount) { + this.amount = amount; + } - public String getData() { - return data; - } + public String getData() { + return data; + } - public void setData(String data) { - this.data = data; - } - - public Zone getZone() { - return zone; - } - - public void setZone(Zone zone) { - this.zone = zone; - } + public void setData(String data) { + this.data = data; + } + + public Zone getZone() { + return zone; + } + + public void setZone(Zone zone) { + this.zone = zone; + } } diff --git a/Mage/src/mage/game/events/Listener.java b/Mage/src/mage/game/events/Listener.java index ee35c0ba48..696526e186 100644 --- a/Mage/src/mage/game/events/Listener.java +++ b/Mage/src/mage/game/events/Listener.java @@ -35,5 +35,5 @@ import java.io.Serializable; * @author BetaSteward_at_googlemail.com */ public interface Listener extends Serializable { - void event(E event); + void event(E event); } diff --git a/Mage/src/mage/game/events/PlayerQueryEvent.java b/Mage/src/mage/game/events/PlayerQueryEvent.java index 2e737c82e2..f9d388cb99 100644 --- a/Mage/src/mage/game/events/PlayerQueryEvent.java +++ b/Mage/src/mage/game/events/PlayerQueryEvent.java @@ -43,81 +43,81 @@ import mage.game.permanent.Permanent; */ public class PlayerQueryEvent extends EventObject implements ExternalEvent, Serializable { - public enum QueryType { - ASK, CHOOSE, CHOOSE_ABILITY, CHOOSE_MODE, PICK_TARGET, PICK_ABILITY, SELECT, PLAY_MANA, PLAY_X_MANA, AMOUNT, LOOK, PICK_CARD, CONSTRUCT, CHOOSE_PILE - } + public enum QueryType { + ASK, CHOOSE, CHOOSE_ABILITY, CHOOSE_MODE, PICK_TARGET, PICK_ABILITY, SELECT, PLAY_MANA, PLAY_X_MANA, AMOUNT, LOOK, PICK_CARD, CONSTRUCT, CHOOSE_PILE + } - private String message; - private Collection abilities; - private List perms; - private Set choices; - private Set targets; - private Cards cards; - private List booster; - private QueryType queryType; - private UUID playerId; - private boolean required; - private int min; - private int max; - private Map options; - private Map modes; + private String message; + private Collection abilities; + private List perms; + private Set choices; + private Set targets; + private Cards cards; + private List booster; + private QueryType queryType; + private UUID playerId; + private boolean required; + private int min; + private int max; + private Map options; + private Map modes; private List pile1; private List pile2; - - private PlayerQueryEvent(UUID playerId, String message, Collection abilities, Set choices, Set targets, Cards cards, QueryType queryType, int min, int max, boolean required, Map options) { - this(playerId, message, abilities, choices, targets, cards, queryType, min, max, required); - this.options = options; - } - private PlayerQueryEvent(UUID playerId, String message, Collection abilities, Set choices, Set targets, Cards cards, QueryType queryType, int min, int max, boolean required) { - super(playerId); - this.queryType = queryType; - this.message = message; - this.playerId = playerId; - this.abilities = abilities; - this.choices = choices; - this.targets = targets; - this.cards = cards; - this.required = required; - this.min = min; - this.max = max; - } + private PlayerQueryEvent(UUID playerId, String message, Collection abilities, Set choices, Set targets, Cards cards, QueryType queryType, int min, int max, boolean required, Map options) { + this(playerId, message, abilities, choices, targets, cards, queryType, min, max, required); + this.options = options; + } - private PlayerQueryEvent(UUID playerId, String message, List booster, QueryType queryType, int time) { - super(playerId); - this.queryType = queryType; - this.message = message; - this.playerId = playerId; - this.booster = booster; - this.max = time; - } + private PlayerQueryEvent(UUID playerId, String message, Collection abilities, Set choices, Set targets, Cards cards, QueryType queryType, int min, int max, boolean required) { + super(playerId); + this.queryType = queryType; + this.message = message; + this.playerId = playerId; + this.abilities = abilities; + this.choices = choices; + this.targets = targets; + this.cards = cards; + this.required = required; + this.min = min; + this.max = max; + } - private PlayerQueryEvent(UUID playerId, String message, QueryType queryType, int time) { - super(playerId); - this.queryType = queryType; - this.message = message; - this.playerId = playerId; - this.max = time; - } + private PlayerQueryEvent(UUID playerId, String message, List booster, QueryType queryType, int time) { + super(playerId); + this.queryType = queryType; + this.message = message; + this.playerId = playerId; + this.booster = booster; + this.max = time; + } - private PlayerQueryEvent(UUID playerId, String message, QueryType queryType, List perms, boolean required) { - super(playerId); - this.queryType = queryType; - this.message = message; - this.playerId = playerId; - this.perms = perms; - this.required = required; - } + private PlayerQueryEvent(UUID playerId, String message, QueryType queryType, int time) { + super(playerId); + this.queryType = queryType; + this.message = message; + this.playerId = playerId; + this.max = time; + } + + private PlayerQueryEvent(UUID playerId, String message, QueryType queryType, List perms, boolean required) { + super(playerId); + this.queryType = queryType; + this.message = message; + this.playerId = playerId; + this.perms = perms; + this.required = required; + } + + private PlayerQueryEvent(UUID playerId, String message, Map modes) { + super(playerId); + this.queryType = QueryType.CHOOSE_MODE; + this.message = message; + this.playerId = playerId; + this.modes = modes; + } - private PlayerQueryEvent(UUID playerId, String message, Map modes) { - super(playerId); - this.queryType = QueryType.CHOOSE_MODE; - this.message = message; - this.playerId = playerId; - this.modes = modes; - } - private PlayerQueryEvent(UUID playerId, String message, List pile1, List pile2) { super(playerId); this.queryType = QueryType.CHOOSE_PILE; @@ -127,135 +127,135 @@ public class PlayerQueryEvent extends EventObject implements ExternalEvent, Seri this.pile2 = pile2; } - public static PlayerQueryEvent askEvent(UUID playerId, String message) { - return new PlayerQueryEvent(playerId, message, null, null, null, null, QueryType.ASK, 0, 0, false); - } - - public static PlayerQueryEvent chooseAbilityEvent(UUID playerId, String message, Collection choices) { - return new PlayerQueryEvent(playerId, message, choices, null, null, null, QueryType.CHOOSE_ABILITY, 0, 0, false); - } + public static PlayerQueryEvent askEvent(UUID playerId, String message) { + return new PlayerQueryEvent(playerId, message, null, null, null, null, QueryType.ASK, 0, 0, false); + } - public static PlayerQueryEvent choosePileEvent(UUID playerId, String message, List pile1, List pile2) { - return new PlayerQueryEvent(playerId, message, pile1, pile2); - } + public static PlayerQueryEvent chooseAbilityEvent(UUID playerId, String message, Collection choices) { + return new PlayerQueryEvent(playerId, message, choices, null, null, null, QueryType.CHOOSE_ABILITY, 0, 0, false); + } + + public static PlayerQueryEvent choosePileEvent(UUID playerId, String message, List pile1, List pile2) { + return new PlayerQueryEvent(playerId, message, pile1, pile2); + } public static PlayerQueryEvent chooseModeEvent(UUID playerId, String message, Map modes) { - return new PlayerQueryEvent(playerId, message, modes); - } + return new PlayerQueryEvent(playerId, message, modes); + } - public static PlayerQueryEvent chooseEvent(UUID playerId, String message, Set choices) { - return new PlayerQueryEvent(playerId, message, null, choices, null, null, QueryType.CHOOSE, 0, 0, false); - } + public static PlayerQueryEvent chooseEvent(UUID playerId, String message, Set choices) { + return new PlayerQueryEvent(playerId, message, null, choices, null, null, QueryType.CHOOSE, 0, 0, false); + } - public static PlayerQueryEvent targetEvent(UUID playerId, String message, Set targets, boolean required) { - return new PlayerQueryEvent(playerId, message, null, null, targets, null, QueryType.PICK_TARGET, 0, 0, required); - } + public static PlayerQueryEvent targetEvent(UUID playerId, String message, Set targets, boolean required) { + return new PlayerQueryEvent(playerId, message, null, null, targets, null, QueryType.PICK_TARGET, 0, 0, required); + } - public static PlayerQueryEvent targetEvent(UUID playerId, String message, Set targets, boolean required, Map options) { - return new PlayerQueryEvent(playerId, message, null, null, targets, null, QueryType.PICK_TARGET, 0, 0, required, options); - } + public static PlayerQueryEvent targetEvent(UUID playerId, String message, Set targets, boolean required, Map options) { + return new PlayerQueryEvent(playerId, message, null, null, targets, null, QueryType.PICK_TARGET, 0, 0, required, options); + } - public static PlayerQueryEvent targetEvent(UUID playerId, String message, Cards cards, boolean required, Map options) { - return new PlayerQueryEvent(playerId, message, null, null, null, cards, QueryType.PICK_TARGET, 0, 0, required, options); - } + public static PlayerQueryEvent targetEvent(UUID playerId, String message, Cards cards, boolean required, Map options) { + return new PlayerQueryEvent(playerId, message, null, null, null, cards, QueryType.PICK_TARGET, 0, 0, required, options); + } - public static PlayerQueryEvent targetEvent(UUID playerId, String message, List abilities) { - return new PlayerQueryEvent(playerId, message, abilities, null, null, null, QueryType.PICK_ABILITY, 0, 0, true); - } + public static PlayerQueryEvent targetEvent(UUID playerId, String message, List abilities) { + return new PlayerQueryEvent(playerId, message, abilities, null, null, null, QueryType.PICK_ABILITY, 0, 0, true); + } - public static PlayerQueryEvent targetEvent(UUID playerId, String message, List perms, boolean required) { - return new PlayerQueryEvent(playerId, message, QueryType.PICK_TARGET, perms, required); - } + public static PlayerQueryEvent targetEvent(UUID playerId, String message, List perms, boolean required) { + return new PlayerQueryEvent(playerId, message, QueryType.PICK_TARGET, perms, required); + } - public static PlayerQueryEvent selectEvent(UUID playerId, String message) { - return new PlayerQueryEvent(playerId, message, null, null, null, null, QueryType.SELECT, 0, 0, false); - } + public static PlayerQueryEvent selectEvent(UUID playerId, String message) { + return new PlayerQueryEvent(playerId, message, null, null, null, null, QueryType.SELECT, 0, 0, false); + } - public static PlayerQueryEvent playManaEvent(UUID playerId, String message) { - return new PlayerQueryEvent(playerId, message, null, null, null, null, QueryType.PLAY_MANA, 0, 0, false); - } + public static PlayerQueryEvent playManaEvent(UUID playerId, String message) { + return new PlayerQueryEvent(playerId, message, null, null, null, null, QueryType.PLAY_MANA, 0, 0, false); + } - public static PlayerQueryEvent playXManaEvent(UUID playerId, String message) { - return new PlayerQueryEvent(playerId, message, null, null, null, null, QueryType.PLAY_X_MANA, 0, 0, false); - } + public static PlayerQueryEvent playXManaEvent(UUID playerId, String message) { + return new PlayerQueryEvent(playerId, message, null, null, null, null, QueryType.PLAY_X_MANA, 0, 0, false); + } - public static PlayerQueryEvent amountEvent(UUID playerId, String message, int min , int max) { - return new PlayerQueryEvent(playerId, message, null, null, null, null, QueryType.AMOUNT, min, max, false); - } + public static PlayerQueryEvent amountEvent(UUID playerId, String message, int min , int max) { + return new PlayerQueryEvent(playerId, message, null, null, null, null, QueryType.AMOUNT, min, max, false); + } - public static PlayerQueryEvent lookEvent(UUID playerId, String message, Cards cards) { - return new PlayerQueryEvent(playerId, message, null, null, null, cards, QueryType.LOOK, 0, 0, false); - } - - public static PlayerQueryEvent pickCard(UUID playerId, String message, List booster, int time) { - return new PlayerQueryEvent(playerId, message, booster, QueryType.PICK_CARD, time); - } + public static PlayerQueryEvent lookEvent(UUID playerId, String message, Cards cards) { + return new PlayerQueryEvent(playerId, message, null, null, null, cards, QueryType.LOOK, 0, 0, false); + } - public static PlayerQueryEvent construct(UUID playerId, String message, int time) { - return new PlayerQueryEvent(playerId, message, QueryType.CONSTRUCT, time); - } + public static PlayerQueryEvent pickCard(UUID playerId, String message, List booster, int time) { + return new PlayerQueryEvent(playerId, message, booster, QueryType.PICK_CARD, time); + } + + public static PlayerQueryEvent construct(UUID playerId, String message, int time) { + return new PlayerQueryEvent(playerId, message, QueryType.CONSTRUCT, time); + } - public String getMessage() { - return message; - } + public String getMessage() { + return message; + } - public QueryType getQueryType() { - return queryType; - } + public QueryType getQueryType() { + return queryType; + } - public Collection getAbilities() { - return abilities; - } + public Collection getAbilities() { + return abilities; + } - public Set getChoices() { - return choices; - } + public Set getChoices() { + return choices; + } - public Set getTargets() { - return targets; - } + public Set getTargets() { + return targets; + } - public UUID getPlayerId() { - return playerId; - } + public UUID getPlayerId() { + return playerId; + } - public boolean isRequired() { - return required; - } + public boolean isRequired() { + return required; + } - public Cards getCards() { - return cards; - } + public Cards getCards() { + return cards; + } - public List getPerms() { - return perms; - } - - public List getBooster() { - return booster; - } + public List getPerms() { + return perms; + } - public int getMin() { - return min; - } + public List getBooster() { + return booster; + } - public int getMax() { - return max; - } + public int getMin() { + return min; + } + + public int getMax() { + return max; + } + + public Map getOptions() { + return options; + } + + public Map getModes() { + return modes; + } - public Map getOptions() { - return options; - } - - public Map getModes() { - return modes; - } - public List getPile1() { return pile1; } - + public List getPile2() { return pile2; } diff --git a/Mage/src/mage/game/events/PlayerQueryEventSource.java b/Mage/src/mage/game/events/PlayerQueryEventSource.java index 7b2a673bdd..ff49d6c196 100644 --- a/Mage/src/mage/game/events/PlayerQueryEventSource.java +++ b/Mage/src/mage/game/events/PlayerQueryEventSource.java @@ -42,79 +42,79 @@ import mage.game.permanent.Permanent; */ public class PlayerQueryEventSource implements EventSource, Serializable { - protected final EventDispatcher dispatcher = new EventDispatcher() {}; + protected final EventDispatcher dispatcher = new EventDispatcher() {}; - @Override - public void addListener(Listener listener) { - dispatcher.addListener(listener); - } + @Override + public void addListener(Listener listener) { + dispatcher.addListener(listener); + } - public void ask(UUID playerId, String message) { - dispatcher.fireEvent(PlayerQueryEvent.askEvent(playerId, message)); - } + public void ask(UUID playerId, String message) { + dispatcher.fireEvent(PlayerQueryEvent.askEvent(playerId, message)); + } - public void select(UUID playerId, String message) { - dispatcher.fireEvent(PlayerQueryEvent.selectEvent(playerId, message)); - } + public void select(UUID playerId, String message) { + dispatcher.fireEvent(PlayerQueryEvent.selectEvent(playerId, message)); + } - public void chooseAbility(UUID playerId, String message, Collection choices) { - dispatcher.fireEvent(PlayerQueryEvent.chooseAbilityEvent(playerId, message, choices)); - } + public void chooseAbility(UUID playerId, String message, Collection choices) { + dispatcher.fireEvent(PlayerQueryEvent.chooseAbilityEvent(playerId, message, choices)); + } - public void choosePile(UUID playerId, String message, List pile1, List pile2) { - dispatcher.fireEvent(PlayerQueryEvent.choosePileEvent(playerId, message, pile1, pile2)); - } - - public void chooseMode(UUID playerId, String message, Map modes) { - dispatcher.fireEvent(PlayerQueryEvent.chooseModeEvent(playerId, message, modes)); - } + public void choosePile(UUID playerId, String message, List pile1, List pile2) { + dispatcher.fireEvent(PlayerQueryEvent.choosePileEvent(playerId, message, pile1, pile2)); + } - public void target(UUID playerId, String message, Set targets, boolean required) { - dispatcher.fireEvent(PlayerQueryEvent.targetEvent(playerId, message, targets, required)); - } + public void chooseMode(UUID playerId, String message, Map modes) { + dispatcher.fireEvent(PlayerQueryEvent.chooseModeEvent(playerId, message, modes)); + } - public void target(UUID playerId, String message, Set targets, boolean required, Map options) { - dispatcher.fireEvent(PlayerQueryEvent.targetEvent(playerId, message, targets, required, options)); - } + public void target(UUID playerId, String message, Set targets, boolean required) { + dispatcher.fireEvent(PlayerQueryEvent.targetEvent(playerId, message, targets, required)); + } - public void target(UUID playerId, String message, Cards cards, boolean required, Map options) { - dispatcher.fireEvent(PlayerQueryEvent.targetEvent(playerId, message, cards, required, options)); - } + public void target(UUID playerId, String message, Set targets, boolean required, Map options) { + dispatcher.fireEvent(PlayerQueryEvent.targetEvent(playerId, message, targets, required, options)); + } - public void target(UUID playerId, String message, Cards cards) { - dispatcher.fireEvent(PlayerQueryEvent.lookEvent(playerId, message, cards)); - } + public void target(UUID playerId, String message, Cards cards, boolean required, Map options) { + dispatcher.fireEvent(PlayerQueryEvent.targetEvent(playerId, message, cards, required, options)); + } - public void target(UUID playerId, String message, List abilities) { - dispatcher.fireEvent(PlayerQueryEvent.targetEvent(playerId, message, abilities)); - } + public void target(UUID playerId, String message, Cards cards) { + dispatcher.fireEvent(PlayerQueryEvent.lookEvent(playerId, message, cards)); + } - public void target(UUID playerId, String message, List perms, boolean required) { - dispatcher.fireEvent(PlayerQueryEvent.targetEvent(playerId, message, perms, required)); - } + public void target(UUID playerId, String message, List abilities) { + dispatcher.fireEvent(PlayerQueryEvent.targetEvent(playerId, message, abilities)); + } - public void playMana(UUID playerId, String message) { - dispatcher.fireEvent(PlayerQueryEvent.playManaEvent(playerId, message)); - } + public void target(UUID playerId, String message, List perms, boolean required) { + dispatcher.fireEvent(PlayerQueryEvent.targetEvent(playerId, message, perms, required)); + } - public void amount(UUID playerId, String message, int min, int max) { - dispatcher.fireEvent(PlayerQueryEvent.amountEvent(playerId, message, min, max)); - } + public void playMana(UUID playerId, String message) { + dispatcher.fireEvent(PlayerQueryEvent.playManaEvent(playerId, message)); + } - public void choose(UUID playerId, String message, Set choices) { - dispatcher.fireEvent(PlayerQueryEvent.chooseEvent(playerId, message, choices)); - } + public void amount(UUID playerId, String message, int min, int max) { + dispatcher.fireEvent(PlayerQueryEvent.amountEvent(playerId, message, min, max)); + } - public void playXMana(UUID playerId, String message) { - dispatcher.fireEvent(PlayerQueryEvent.playXManaEvent(playerId, message)); - } + public void choose(UUID playerId, String message, Set choices) { + dispatcher.fireEvent(PlayerQueryEvent.chooseEvent(playerId, message, choices)); + } - public void pickCard(UUID playerId, String message, List booster, int time) { - dispatcher.fireEvent(PlayerQueryEvent.pickCard(playerId, message, booster, time)); - } + public void playXMana(UUID playerId, String message) { + dispatcher.fireEvent(PlayerQueryEvent.playXManaEvent(playerId, message)); + } - public void construct(UUID playerId, String message, int time) { - dispatcher.fireEvent(PlayerQueryEvent.construct(playerId, message, time)); - } + public void pickCard(UUID playerId, String message, List booster, int time) { + dispatcher.fireEvent(PlayerQueryEvent.pickCard(playerId, message, booster, time)); + } + + public void construct(UUID playerId, String message, int time) { + dispatcher.fireEvent(PlayerQueryEvent.construct(playerId, message, time)); + } } diff --git a/Mage/src/mage/game/events/TableEvent.java b/Mage/src/mage/game/events/TableEvent.java index 8fa5f4bd78..3840fa5249 100644 --- a/Mage/src/mage/game/events/TableEvent.java +++ b/Mage/src/mage/game/events/TableEvent.java @@ -44,107 +44,107 @@ import mage.game.tournament.TournamentPairing; */ public class TableEvent extends EventObject implements ExternalEvent, Serializable { - public enum EventType { - UPDATE, INFO, REVEAL, LOOK, START_DRAFT, START_MATCH, SIDEBOARD, CONSTRUCT, SUBMIT_DECK, END, ERROR - } + public enum EventType { + UPDATE, INFO, REVEAL, LOOK, START_DRAFT, START_MATCH, SIDEBOARD, CONSTRUCT, SUBMIT_DECK, END, ERROR + } - private Game game; - private Draft draft; - private EventType eventType; - private String message; + private Game game; + private Draft draft; + private EventType eventType; + private String message; private Exception ex; - private Cards cards; - private UUID playerId; - private Deck deck; - private TournamentPairing pair; - private MatchOptions options; - private int timeout; + private Cards cards; + private UUID playerId; + private Deck deck; + private TournamentPairing pair; + private MatchOptions options; + private int timeout; - public TableEvent(EventType eventType) { - super(eventType); - this.eventType = eventType; - } + public TableEvent(EventType eventType) { + super(eventType); + this.eventType = eventType; + } - public TableEvent(EventType eventType, String message, Game game) { - super(game); - this.game = game; - this.message = message; - this.eventType = eventType; - } + public TableEvent(EventType eventType, String message, Game game) { + super(game); + this.game = game; + this.message = message; + this.eventType = eventType; + } - public TableEvent(EventType eventType, String message, Cards cards, Game game) { + public TableEvent(EventType eventType, String message, Cards cards, Game game) { this(eventType, message, game); - this.cards = cards; - } + this.cards = cards; + } - public TableEvent(EventType eventType, String message, Exception ex, Game game) { + public TableEvent(EventType eventType, String message, Exception ex, Game game) { this(eventType, message, game); this.ex = ex; - } + } - public TableEvent(EventType eventType, UUID playerId, Deck deck, int timeout) { - super(playerId); - this.playerId = playerId; - this.deck = deck; - this.eventType = eventType; - this.timeout = timeout; - } + public TableEvent(EventType eventType, UUID playerId, Deck deck, int timeout) { + super(playerId); + this.playerId = playerId; + this.deck = deck; + this.eventType = eventType; + this.timeout = timeout; + } - public TableEvent(EventType eventType, String message, Draft draft) { - super(draft); - this.draft = draft; - this.message = message; - this.eventType = eventType; - } + public TableEvent(EventType eventType, String message, Draft draft) { + super(draft); + this.draft = draft; + this.message = message; + this.eventType = eventType; + } - public TableEvent(EventType eventType, TournamentPairing pair, MatchOptions options) { - super(options); - this.pair = pair; - this.options = options; - this.eventType = eventType; - } + public TableEvent(EventType eventType, TournamentPairing pair, MatchOptions options) { + super(options); + this.pair = pair; + this.options = options; + this.eventType = eventType; + } - public Game getGame() { - return game; - } + public Game getGame() { + return game; + } - public Draft getDraft() { - return draft; - } + public Draft getDraft() { + return draft; + } - public EventType getEventType() { - return eventType; - } + public EventType getEventType() { + return eventType; + } + + public String getMessage() { + return message; + } - public String getMessage() { - return message; - } - public Exception getException() { return ex; } - public Cards getCards() { - return cards; - } + public Cards getCards() { + return cards; + } - public UUID getPlayerId() { - return playerId; - } + public UUID getPlayerId() { + return playerId; + } - public Deck getDeck() { - return deck; - } + public Deck getDeck() { + return deck; + } - public TournamentPairing getPair() { - return pair; - } + public TournamentPairing getPair() { + return pair; + } - public MatchOptions getMatchOptions() { - return options; - } + public MatchOptions getMatchOptions() { + return options; + } - public int getTimeout() { - return timeout; - } + public int getTimeout() { + return timeout; + } } diff --git a/Mage/src/mage/game/events/TableEventSource.java b/Mage/src/mage/game/events/TableEventSource.java index 0508c0c217..44d8212a7d 100644 --- a/Mage/src/mage/game/events/TableEventSource.java +++ b/Mage/src/mage/game/events/TableEventSource.java @@ -44,38 +44,38 @@ import mage.game.tournament.TournamentPairing; */ public class TableEventSource implements EventSource, Serializable { - protected final EventDispatcher dispatcher = new EventDispatcher() {}; + protected final EventDispatcher dispatcher = new EventDispatcher() {}; - @Override - public void addListener(Listener listener) { - dispatcher.addListener(listener); - } + @Override + public void addListener(Listener listener) { + dispatcher.addListener(listener); + } - public void fireTableEvent(EventType eventType) { - dispatcher.fireEvent(new TableEvent(eventType)); - } + public void fireTableEvent(EventType eventType) { + dispatcher.fireEvent(new TableEvent(eventType)); + } - public void fireTableEvent(EventType eventType, String message, Game game) { - dispatcher.fireEvent(new TableEvent(eventType, message, game)); - } + public void fireTableEvent(EventType eventType, String message, Game game) { + dispatcher.fireEvent(new TableEvent(eventType, message, game)); + } - public void fireTableEvent(EventType eventType, String message, Exception ex, Game game) { - dispatcher.fireEvent(new TableEvent(eventType, message, ex, game)); - } + public void fireTableEvent(EventType eventType, String message, Exception ex, Game game) { + dispatcher.fireEvent(new TableEvent(eventType, message, ex, game)); + } - public void fireTableEvent(EventType eventType, String message, Draft draft) { - dispatcher.fireEvent(new TableEvent(eventType, message, draft)); - } + public void fireTableEvent(EventType eventType, String message, Draft draft) { + dispatcher.fireEvent(new TableEvent(eventType, message, draft)); + } - public void fireTableEvent(EventType eventType, String message, Cards cards, Game game) { - dispatcher.fireEvent(new TableEvent(eventType, message, cards, game)); - } + public void fireTableEvent(EventType eventType, String message, Cards cards, Game game) { + dispatcher.fireEvent(new TableEvent(eventType, message, cards, game)); + } - public void fireTableEvent(EventType eventType, UUID playerId, Deck deck, int timeout) { - dispatcher.fireEvent(new TableEvent(eventType, playerId, deck, timeout)); - } + public void fireTableEvent(EventType eventType, UUID playerId, Deck deck, int timeout) { + dispatcher.fireEvent(new TableEvent(eventType, playerId, deck, timeout)); + } - public void fireTableEvent(EventType eventType, TournamentPairing pair, MatchOptions options) { - dispatcher.fireEvent(new TableEvent(eventType, pair, options)); - } + public void fireTableEvent(EventType eventType, TournamentPairing pair, MatchOptions options) { + dispatcher.fireEvent(new TableEvent(eventType, pair, options)); + } } diff --git a/Mage/src/mage/game/events/ZoneChangeEvent.java b/Mage/src/mage/game/events/ZoneChangeEvent.java index fbd0c24e2f..d813235529 100644 --- a/Mage/src/mage/game/events/ZoneChangeEvent.java +++ b/Mage/src/mage/game/events/ZoneChangeEvent.java @@ -38,46 +38,46 @@ import mage.game.permanent.Permanent; */ public class ZoneChangeEvent extends GameEvent { - private Zone fromZone; - private Zone toZone; - private Permanent target; + private Zone fromZone; + private Zone toZone; + private Permanent target; - public ZoneChangeEvent(Permanent target, UUID sourceId, UUID playerId, Zone fromZone, Zone toZone) { - super(EventType.ZONE_CHANGE, target.getId(), sourceId, playerId); - this.fromZone = fromZone; - this.toZone = toZone; - this.target = target; - } + public ZoneChangeEvent(Permanent target, UUID sourceId, UUID playerId, Zone fromZone, Zone toZone) { + super(EventType.ZONE_CHANGE, target.getId(), sourceId, playerId); + this.fromZone = fromZone; + this.toZone = toZone; + this.target = target; + } - public ZoneChangeEvent(UUID targetId, UUID sourceId, UUID playerId, Zone fromZone, Zone toZone) { - super(EventType.ZONE_CHANGE, targetId, sourceId, playerId); - this.fromZone = fromZone; - this.toZone = toZone; - } + public ZoneChangeEvent(UUID targetId, UUID sourceId, UUID playerId, Zone fromZone, Zone toZone) { + super(EventType.ZONE_CHANGE, targetId, sourceId, playerId); + this.fromZone = fromZone; + this.toZone = toZone; + } - public ZoneChangeEvent(Permanent target, UUID playerId, Zone fromZone, Zone toZone) { - this(target, null, playerId, fromZone, toZone); - } + public ZoneChangeEvent(Permanent target, UUID playerId, Zone fromZone, Zone toZone) { + this(target, null, playerId, fromZone, toZone); + } - public ZoneChangeEvent(UUID targetId, UUID playerId, Zone fromZone, Zone toZone) { - this(targetId, null, playerId, fromZone, toZone); - } + public ZoneChangeEvent(UUID targetId, UUID playerId, Zone fromZone, Zone toZone) { + this(targetId, null, playerId, fromZone, toZone); + } - public Zone getFromZone() { - return fromZone; - } + public Zone getFromZone() { + return fromZone; + } - public Zone getToZone() { - return toZone; - } + public Zone getToZone() { + return toZone; + } - public void setToZone(Zone toZone) { - this.toZone = toZone; - } + public void setToZone(Zone toZone) { + this.toZone = toZone; + } - public Permanent getTarget() { - return target; - } + public Permanent getTarget() { + return target; + } public void setTarget(Permanent target) { this.target = target; diff --git a/Mage/src/mage/game/match/Match.java b/Mage/src/mage/game/match/Match.java index 9cfef6ae4a..26190d7dbf 100644 --- a/Mage/src/mage/game/match/Match.java +++ b/Mage/src/mage/game/match/Match.java @@ -43,29 +43,29 @@ import mage.players.Player; */ public interface Match { - public static final int SIDEBOARD_TIME = 180; + public static final int SIDEBOARD_TIME = 180; public UUID getId(); public String getName(); - public boolean isMatchOver(); - public List getPlayers(); - public MatchPlayer getPlayer(UUID playerId); - public void addPlayer(Player player, Deck deck); - public void submitDeck(UUID playerId, Deck deck); - public void updateDeck(UUID playerId, Deck deck); - public void startMatch() throws GameException; - public void startGame() throws GameException; - public void sideboard(); - public void endGame(); - public Game getGame(); - public List getGames(); + public boolean isMatchOver(); + public List getPlayers(); + public MatchPlayer getPlayer(UUID playerId); + public void addPlayer(Player player, Deck deck); + public void submitDeck(UUID playerId, Deck deck); + public void updateDeck(UUID playerId, Deck deck); + public void startMatch() throws GameException; + public void startGame() throws GameException; + public void sideboard(); + public void endGame(); + public Game getGame(); + public List getGames(); public int getWinsNeeded(); - public int getNumGames(); - public boolean isDoneSideboarding(); - public UUID getChooser(); + public int getNumGames(); + public boolean isDoneSideboarding(); + public UUID getChooser(); public MatchOptions getOptions(); - public void addTableEventListener(Listener listener); - public void fireSideboardEvent(UUID playerId, Deck deck); + public void addTableEventListener(Listener listener); + public void fireSideboardEvent(UUID playerId, Deck deck); } diff --git a/Mage/src/mage/game/match/MatchImpl.java b/Mage/src/mage/game/match/MatchImpl.java index cd0c02b828..24db7ccbdc 100644 --- a/Mage/src/mage/game/match/MatchImpl.java +++ b/Mage/src/mage/game/match/MatchImpl.java @@ -46,183 +46,183 @@ import mage.players.Player; */ public abstract class MatchImpl implements Match { -// private final static Logger logger = Logging.getLogger(MatchImpl.class.getName()); +// private final static Logger logger = Logging.getLogger(MatchImpl.class.getName()); - protected UUID id = UUID.randomUUID(); + protected UUID id = UUID.randomUUID(); protected String name; - protected List players = new ArrayList(); - protected List games = new ArrayList(); - protected MatchOptions options; + protected List players = new ArrayList(); + protected List games = new ArrayList(); + protected MatchOptions options; - protected TableEventSource tableEventSource = new TableEventSource(); - - public MatchImpl(MatchOptions options) { - this.options = options; - } + protected TableEventSource tableEventSource = new TableEventSource(); - @Override - public List getPlayers() { - return players; - } + public MatchImpl(MatchOptions options) { + this.options = options; + } - @Override - public MatchPlayer getPlayer(UUID playerId) { - for (MatchPlayer player: players) { - if (player.getPlayer().getId().equals(playerId)) - return player; - } - return null; - } + @Override + public List getPlayers() { + return players; + } - @Override - public void addPlayer(Player player, Deck deck) { - MatchPlayer mPlayer = new MatchPlayer(player, deck); - players.add(mPlayer); - } + @Override + public MatchPlayer getPlayer(UUID playerId) { + for (MatchPlayer player: players) { + if (player.getPlayer().getId().equals(playerId)) + return player; + } + return null; + } - @Override - public void startMatch() throws GameException { + @Override + public void addPlayer(Player player, Deck deck) { + MatchPlayer mPlayer = new MatchPlayer(player, deck); + players.add(mPlayer); + } - } + @Override + public void startMatch() throws GameException { - @Override - public UUID getId() { - return id; - } + } + + @Override + public UUID getId() { + return id; + } @Override public String getName() { return options.getName(); } - + @Override public MatchOptions getOptions() { return options; } - - @Override - public boolean isMatchOver() { - for (MatchPlayer player: players) { - if (player.getWins() >= options.getWinsNeeded()) { - return true; - } - } - return false; - } - - @Override - public Game getGame() { - if (games.size() == 0) return null; - return games.get(games.size() -1); - } - - @Override - public List getGames() { - return games; - } - - @Override - public int getNumGames() { - return games.size(); - } - - @Override - public int getWinsNeeded() { - return options.getWinsNeeded(); - } - - protected void initGame(Game game) throws GameException { - for (MatchPlayer matchPlayer: this.players) { - matchPlayer.getPlayer().init(game); - game.loadCards(matchPlayer.getDeck().getCards(), matchPlayer.getPlayer().getId()); - game.loadCards(matchPlayer.getDeck().getSideboard(), matchPlayer.getPlayer().getId()); - game.addPlayer(matchPlayer.getPlayer(), matchPlayer.getDeck()); - } - } - - @Override - public void endGame() { - Game game = getGame(); - for (MatchPlayer player: this.players) { - Player p = game.getPlayer(player.getPlayer().getId()); - if (p != null) { - if (p.hasWon()) - player.addWin(); - if (p.hasLost()) - player.addLose(); - } - } - } - - @Override - public UUID getChooser() { - UUID loserId = null; - Game game = getGame(); - for (MatchPlayer player: this.players) { - Player p = game.getPlayer(player.getPlayer().getId()); - if (p != null) { - if (p.hasLost()) - loserId = p.getId(); - } - } - return loserId; - } - - @Override - public void addTableEventListener(Listener listener) { - tableEventSource.addListener(listener); - } - - @Override - public void sideboard() { - for (MatchPlayer player: this.players) { - player.setSideboarding(); - player.getPlayer().sideboard(this, player.getDeck()); - } - synchronized(this) { - while (!isDoneSideboarding()) { - try { - this.wait(); - } catch (InterruptedException ex) { } - } - } - } - - @Override - public boolean isDoneSideboarding() { - for (MatchPlayer player: this.players) { - if (!player.isDoneSideboarding()) - return false; - } - return true; - } @Override - public void fireSideboardEvent(UUID playerId, Deck deck) { - MatchPlayer player = getPlayer(playerId); - if (player != null) { - tableEventSource.fireTableEvent(EventType.SIDEBOARD, playerId, deck, SIDEBOARD_TIME); - } - } - - @Override - public void submitDeck(UUID playerId, Deck deck) { - MatchPlayer player = getPlayer(playerId); - if (player != null) { - player.submitDeck(deck); - } - synchronized (this) { - this.notifyAll(); - } - } + public boolean isMatchOver() { + for (MatchPlayer player: players) { + if (player.getWins() >= options.getWinsNeeded()) { + return true; + } + } + return false; + } @Override - public void updateDeck(UUID playerId, Deck deck) { - MatchPlayer player = getPlayer(playerId); - if (player != null) { - player.updateDeck(deck); - } - } + public Game getGame() { + if (games.size() == 0) return null; + return games.get(games.size() -1); + } + + @Override + public List getGames() { + return games; + } + + @Override + public int getNumGames() { + return games.size(); + } + + @Override + public int getWinsNeeded() { + return options.getWinsNeeded(); + } + + protected void initGame(Game game) throws GameException { + for (MatchPlayer matchPlayer: this.players) { + matchPlayer.getPlayer().init(game); + game.loadCards(matchPlayer.getDeck().getCards(), matchPlayer.getPlayer().getId()); + game.loadCards(matchPlayer.getDeck().getSideboard(), matchPlayer.getPlayer().getId()); + game.addPlayer(matchPlayer.getPlayer(), matchPlayer.getDeck()); + } + } + + @Override + public void endGame() { + Game game = getGame(); + for (MatchPlayer player: this.players) { + Player p = game.getPlayer(player.getPlayer().getId()); + if (p != null) { + if (p.hasWon()) + player.addWin(); + if (p.hasLost()) + player.addLose(); + } + } + } + + @Override + public UUID getChooser() { + UUID loserId = null; + Game game = getGame(); + for (MatchPlayer player: this.players) { + Player p = game.getPlayer(player.getPlayer().getId()); + if (p != null) { + if (p.hasLost()) + loserId = p.getId(); + } + } + return loserId; + } + + @Override + public void addTableEventListener(Listener listener) { + tableEventSource.addListener(listener); + } + + @Override + public void sideboard() { + for (MatchPlayer player: this.players) { + player.setSideboarding(); + player.getPlayer().sideboard(this, player.getDeck()); + } + synchronized(this) { + while (!isDoneSideboarding()) { + try { + this.wait(); + } catch (InterruptedException ex) { } + } + } + } + + @Override + public boolean isDoneSideboarding() { + for (MatchPlayer player: this.players) { + if (!player.isDoneSideboarding()) + return false; + } + return true; + } + + @Override + public void fireSideboardEvent(UUID playerId, Deck deck) { + MatchPlayer player = getPlayer(playerId); + if (player != null) { + tableEventSource.fireTableEvent(EventType.SIDEBOARD, playerId, deck, SIDEBOARD_TIME); + } + } + + @Override + public void submitDeck(UUID playerId, Deck deck) { + MatchPlayer player = getPlayer(playerId); + if (player != null) { + player.submitDeck(deck); + } + synchronized (this) { + this.notifyAll(); + } + } + + @Override + public void updateDeck(UUID playerId, Deck deck) { + MatchPlayer player = getPlayer(playerId); + if (player != null) { + player.updateDeck(deck); + } + } + - } diff --git a/Mage/src/mage/game/match/MatchOptions.java b/Mage/src/mage/game/match/MatchOptions.java index 7b94d6afb7..aedeb8647c 100644 --- a/Mage/src/mage/game/match/MatchOptions.java +++ b/Mage/src/mage/game/match/MatchOptions.java @@ -40,68 +40,68 @@ import mage.Constants.RangeOfInfluence; */ public class MatchOptions implements Serializable { - protected String name; - protected MultiplayerAttackOption attackOption; - protected RangeOfInfluence range; - protected int winsNeeded; - protected String gameType; - protected String deckType; + protected String name; + protected MultiplayerAttackOption attackOption; + protected RangeOfInfluence range; + protected int winsNeeded; + protected String gameType; + protected String deckType; protected boolean limited; - protected List playerTypes = new ArrayList(); + protected List playerTypes = new ArrayList(); - public MatchOptions(String name, String gameType) { - this.name = name; - this.gameType = gameType; - } + public MatchOptions(String name, String gameType) { + this.name = name; + this.gameType = gameType; + } - public String getName() { - return name; - } + public String getName() { + return name; + } - public MultiplayerAttackOption getAttackOption() { - return attackOption; - } + public MultiplayerAttackOption getAttackOption() { + return attackOption; + } - public void setAttackOption(MultiplayerAttackOption attackOption) { - this.attackOption = attackOption; - } + public void setAttackOption(MultiplayerAttackOption attackOption) { + this.attackOption = attackOption; + } - public RangeOfInfluence getRange() { - return range; - } + public RangeOfInfluence getRange() { + return range; + } - public void setRange(RangeOfInfluence range) { - this.range = range; - } + public void setRange(RangeOfInfluence range) { + this.range = range; + } - public int getWinsNeeded() { - return winsNeeded; - } + public int getWinsNeeded() { + return winsNeeded; + } - public void setWinsNeeded(int winsNeeded) { - this.winsNeeded = winsNeeded; - } + public void setWinsNeeded(int winsNeeded) { + this.winsNeeded = winsNeeded; + } - public String getGameType() { - return gameType; - } + public String getGameType() { + return gameType; + } - public void setGameType(String gameType) { - this.gameType = gameType; - } + public void setGameType(String gameType) { + this.gameType = gameType; + } - public String getDeckType() { - return deckType; - } + public String getDeckType() { + return deckType; + } - public void setDeckType(String deckType) { - this.deckType = deckType; - } + public void setDeckType(String deckType) { + this.deckType = deckType; + } + + public List getPlayerTypes() { + return playerTypes; + } - public List getPlayerTypes() { - return playerTypes; - } - public boolean isLimited() { return limited; } diff --git a/Mage/src/mage/game/match/MatchPlayer.java b/Mage/src/mage/game/match/MatchPlayer.java index 5714724a91..c158307493 100644 --- a/Mage/src/mage/game/match/MatchPlayer.java +++ b/Mage/src/mage/game/match/MatchPlayer.java @@ -37,48 +37,48 @@ import mage.players.Player; * @author BetaSteward_at_googlemail.com */ public class MatchPlayer { - private int wins; - private int loses; - private Deck deck; - private Player player; - private boolean doneSideboarding; + private int wins; + private int loses; + private Deck deck; + private Player player; + private boolean doneSideboarding; - public MatchPlayer(Player player, Deck deck) { - this.player = player; - this.deck = deck; - this.wins = 0; - this.loses = 0; - this.doneSideboarding = true; - } + public MatchPlayer(Player player, Deck deck) { + this.player = player; + this.deck = deck; + this.wins = 0; + this.loses = 0; + this.doneSideboarding = true; + } - public int getWins() { - return wins; - } + public int getWins() { + return wins; + } - public void addWin() { - this.wins++; - } + public void addWin() { + this.wins++; + } - public int getLoses() { - return loses; - } + public int getLoses() { + return loses; + } - public void addLose() { - this.loses++; - } + public void addLose() { + this.loses++; + } - public Deck getDeck() { - return deck; - } + public Deck getDeck() { + return deck; + } - public void submitDeck(Deck deck) { - this.deck = deck; - this.doneSideboarding = true; - } + public void submitDeck(Deck deck) { + this.deck = deck; + this.doneSideboarding = true; + } - public void updateDeck(Deck deck) { - this.deck = deck; - } + public void updateDeck(Deck deck) { + this.deck = deck; + } public Deck generateDeck() { //TODO: improve this @@ -89,17 +89,17 @@ public class MatchPlayer { } return deck; } - - public Player getPlayer() { - return player; - } - public void setSideboarding() { - this.doneSideboarding = false; - } + public Player getPlayer() { + return player; + } - public boolean isDoneSideboarding() { - return this.doneSideboarding; - } + public void setSideboarding() { + this.doneSideboarding = false; + } + + public boolean isDoneSideboarding() { + return this.doneSideboarding; + } } diff --git a/Mage/src/mage/game/match/MatchType.java b/Mage/src/mage/game/match/MatchType.java index 8446965791..3edbc1f125 100644 --- a/Mage/src/mage/game/match/MatchType.java +++ b/Mage/src/mage/game/match/MatchType.java @@ -36,59 +36,59 @@ import java.io.Serializable; */ public abstract class MatchType> implements Serializable { - protected String name; - protected int minPlayers; - protected int maxPlayers; - protected int numTeams; - protected int playersPerTeam; - protected boolean useRange; - protected boolean useAttackOption; + protected String name; + protected int minPlayers; + protected int maxPlayers; + protected int numTeams; + protected int playersPerTeam; + protected boolean useRange; + protected boolean useAttackOption; - protected MatchType() {} - - protected MatchType(final MatchType matchType) { - this.name = matchType.name; - this.maxPlayers = matchType.maxPlayers; - this.minPlayers = matchType.minPlayers; - this.numTeams = matchType.numTeams; - this.playersPerTeam = matchType.playersPerTeam; - this.useRange = matchType.useRange; - this.useAttackOption = matchType.useAttackOption; - } + protected MatchType() {} - public abstract T copy(); + protected MatchType(final MatchType matchType) { + this.name = matchType.name; + this.maxPlayers = matchType.maxPlayers; + this.minPlayers = matchType.minPlayers; + this.numTeams = matchType.numTeams; + this.playersPerTeam = matchType.playersPerTeam; + this.useRange = matchType.useRange; + this.useAttackOption = matchType.useAttackOption; + } - @Override - public String toString() { - return name; - } - - public String getName() { - return name; - } + public abstract T copy(); - public int getMinPlayers() { - return minPlayers; - } + @Override + public String toString() { + return name; + } - public int getMaxPlayers() { - return maxPlayers; - } + public String getName() { + return name; + } - public int getNumTeams() { - return numTeams; - } + public int getMinPlayers() { + return minPlayers; + } - public int getPlayersPerTeam() { - return playersPerTeam; - } + public int getMaxPlayers() { + return maxPlayers; + } - public boolean isUseRange() { - return useRange; - } + public int getNumTeams() { + return numTeams; + } - public boolean isUseAttackOption() { - return useAttackOption; - } + public int getPlayersPerTeam() { + return playersPerTeam; + } + + public boolean isUseRange() { + return useRange; + } + + public boolean isUseAttackOption() { + return useAttackOption; + } } diff --git a/Mage/src/mage/game/permanent/Battlefield.java b/Mage/src/mage/game/permanent/Battlefield.java index 6f61ae5515..b3713dcab3 100644 --- a/Mage/src/mage/game/permanent/Battlefield.java +++ b/Mage/src/mage/game/permanent/Battlefield.java @@ -44,93 +44,93 @@ import java.util.Map.Entry; */ public class Battlefield implements Serializable { - private Map field = new LinkedHashMap(); + private Map field = new LinkedHashMap(); - public Battlefield () {} + public Battlefield () {} - public Battlefield(final Battlefield battlefield) { - for (Entry entry: battlefield.field.entrySet()) { - field.put(entry.getKey(), entry.getValue().copy()); - } - } + public Battlefield(final Battlefield battlefield) { + for (Entry entry: battlefield.field.entrySet()) { + field.put(entry.getKey(), entry.getValue().copy()); + } + } - public Battlefield copy() { - return new Battlefield(this); - } + public Battlefield copy() { + return new Battlefield(this); + } - public void reset(Game game) { - for (Permanent perm: field.values()) { - perm.reset(game); - } - } + public void reset(Game game) { + for (Permanent perm: field.values()) { + perm.reset(game); + } + } - public void clear() { - field.clear(); - } + public void clear() { + field.clear(); + } - /** - * Returns a count of all {@link Permanent} that match the filter. - * This method ignores the range of influence. - * - * @param filter - * @return count - */ - public int countAll(FilterPermanent filter, Game game) { - int count = 0; - for (Permanent permanent: field.values()) { - if (filter.match(permanent, game)) { - count++; - } - } - return count; - } + /** + * Returns a count of all {@link Permanent} that match the filter. + * This method ignores the range of influence. + * + * @param filter + * @return count + */ + public int countAll(FilterPermanent filter, Game game) { + int count = 0; + for (Permanent permanent: field.values()) { + if (filter.match(permanent, game)) { + count++; + } + } + return count; + } - /** - * Returns a count of all {@link Permanent} that match the filter and are controlled by controllerId. - * This method ignores the range of influence. - * - * @param filter - * @param controllerId - * @return count - */ - public int countAll(FilterPermanent filter, UUID controllerId, Game game) { - int count = 0; - for (Permanent permanent: field.values()) { - if (permanent.getControllerId().equals(controllerId) && filter.match(permanent, game)) { - count++; - } - } - return count; - } + /** + * Returns a count of all {@link Permanent} that match the filter and are controlled by controllerId. + * This method ignores the range of influence. + * + * @param filter + * @param controllerId + * @return count + */ + public int countAll(FilterPermanent filter, UUID controllerId, Game game) { + int count = 0; + for (Permanent permanent: field.values()) { + if (permanent.getControllerId().equals(controllerId) && filter.match(permanent, game)) { + count++; + } + } + return count; + } - /** - * Returns a count of all {@link Permanent} that are within the range of influence of the specified player id - * and that match the supplied filter. - * - * @param filter - * @param sourcePlayerId - * @param game - * @return count - */ - public int count(FilterPermanent filter, UUID sourcePlayerId, Game game) { - int count = 0; - if (game.getRangeOfInfluence() == RangeOfInfluence.ALL) { - for (Permanent permanent: field.values()) { - if (filter.match(permanent, null, sourcePlayerId, game)) { - count++; - } - } - } - else { - Set range = game.getPlayer(sourcePlayerId).getInRange(); - for (Permanent permanent: field.values()) { - if (range.contains(permanent.getControllerId()) && filter.match(permanent, null, sourcePlayerId, game)) { - count++; - } - } - } - return count; - } + /** + * Returns a count of all {@link Permanent} that are within the range of influence of the specified player id + * and that match the supplied filter. + * + * @param filter + * @param sourcePlayerId + * @param game + * @return count + */ + public int count(FilterPermanent filter, UUID sourcePlayerId, Game game) { + int count = 0; + if (game.getRangeOfInfluence() == RangeOfInfluence.ALL) { + for (Permanent permanent: field.values()) { + if (filter.match(permanent, null, sourcePlayerId, game)) { + count++; + } + } + } + else { + Set range = game.getPlayer(sourcePlayerId).getInRange(); + for (Permanent permanent: field.values()) { + if (range.contains(permanent.getControllerId()) && filter.match(permanent, null, sourcePlayerId, game)) { + count++; + } + } + } + return count; + } public int count(FilterPermanent filter, UUID sourceId, UUID sourcePlayerId, Game game) { int count = 0; @@ -152,280 +152,280 @@ public class Battlefield implements Serializable { return count; } - /** - * Returns true if the battlefield contains at least 1 {@link Permanent} - * that matches the filter. - * This method ignores the range of influence. - * - * @param filter - * @return boolean - */ - public boolean contains(FilterPermanent filter, int num, Game game) { - int count = 0; - for (Permanent permanent: field.values()) { - if (filter.match(permanent, game)) { - count++; - if (num == count) - return true; - } - } - return false; - } + /** + * Returns true if the battlefield contains at least 1 {@link Permanent} + * that matches the filter. + * This method ignores the range of influence. + * + * @param filter + * @return boolean + */ + public boolean contains(FilterPermanent filter, int num, Game game) { + int count = 0; + for (Permanent permanent: field.values()) { + if (filter.match(permanent, game)) { + count++; + if (num == count) + return true; + } + } + return false; + } - /** - * Returns true if the battlefield contains num or more {@link Permanent} - * that matches the filter and is controlled by controllerId. - * This method ignores the range of influence. - * - * @param filter - * @param controllerId - * @return boolean - */ - public boolean contains(FilterPermanent filter, UUID controllerId, int num, Game game) { - int count = 0; - for (Permanent permanent: field.values()) { - if (permanent.getControllerId().equals(controllerId) && filter.match(permanent, game)) { - count++; - if (num == count) - return true; - } - } - return false; - } + /** + * Returns true if the battlefield contains num or more {@link Permanent} + * that matches the filter and is controlled by controllerId. + * This method ignores the range of influence. + * + * @param filter + * @param controllerId + * @return boolean + */ + public boolean contains(FilterPermanent filter, UUID controllerId, int num, Game game) { + int count = 0; + for (Permanent permanent: field.values()) { + if (permanent.getControllerId().equals(controllerId) && filter.match(permanent, game)) { + count++; + if (num == count) + return true; + } + } + return false; + } - /** - * Returns true if the battlefield contains num or more {@link Permanent} - * that is within the range of influence of the specified player id - * and that matches the supplied filter. - * - * @param filter - * @param sourcePlayerId - * @param game - * @return boolean - */ - public boolean contains(FilterPermanent filter, UUID sourcePlayerId, Game game, int num) { - int count = 0; - if (game.getRangeOfInfluence() == RangeOfInfluence.ALL) { - for (Permanent permanent: field.values()) { - if (filter.match(permanent, null, sourcePlayerId, game)) { - count++; - if (num == count) - return true; - } - } - } - else { - Set range = game.getPlayer(sourcePlayerId).getInRange(); - for (Permanent permanent: field.values()) { - if (range.contains(permanent.getControllerId()) && filter.match(permanent, null, sourcePlayerId, game)) { - count++; - if (num == count) - return true; - } - } - } - return false; - } + /** + * Returns true if the battlefield contains num or more {@link Permanent} + * that is within the range of influence of the specified player id + * and that matches the supplied filter. + * + * @param filter + * @param sourcePlayerId + * @param game + * @return boolean + */ + public boolean contains(FilterPermanent filter, UUID sourcePlayerId, Game game, int num) { + int count = 0; + if (game.getRangeOfInfluence() == RangeOfInfluence.ALL) { + for (Permanent permanent: field.values()) { + if (filter.match(permanent, null, sourcePlayerId, game)) { + count++; + if (num == count) + return true; + } + } + } + else { + Set range = game.getPlayer(sourcePlayerId).getInRange(); + for (Permanent permanent: field.values()) { + if (range.contains(permanent.getControllerId()) && filter.match(permanent, null, sourcePlayerId, game)) { + count++; + if (num == count) + return true; + } + } + } + return false; + } - public void addPermanent(Permanent permanent) { - field.put(permanent.getId(), permanent); - } + public void addPermanent(Permanent permanent) { + field.put(permanent.getId(), permanent); + } - public Permanent getPermanent(UUID key) { - return field.get(key); - } + public Permanent getPermanent(UUID key) { + return field.get(key); + } - public void removePermanent(UUID key) { - field.remove(key); - } + public void removePermanent(UUID key) { + field.remove(key); + } - public boolean containsPermanent(UUID key) { - return field.containsKey(key); - } + public boolean containsPermanent(UUID key) { + return field.containsKey(key); + } public void beginningOfTurn(Game game) { - for (Permanent perm: field.values()) { - perm.beginningOfTurn(game); - } + for (Permanent perm: field.values()) { + perm.beginningOfTurn(game); + } } - + public void endOfTurn(UUID controllerId, Game game) { - for (Permanent perm: field.values()) { - perm.endOfTurn(game); - } - } + for (Permanent perm: field.values()) { + perm.endOfTurn(game); + } + } - public Collection getAllPermanents() { - return field.values(); - } + public Collection getAllPermanents() { + return field.values(); + } - public Set getAllPermanentIds() { - return field.keySet(); - } + public Set getAllPermanentIds() { + return field.keySet(); + } - public List getAllActivePermanents() { - List active = new ArrayList(); - for (Permanent perm: field.values()) { - if (perm.isPhasedIn()) - active.add(perm); - } - return active; - } + public List getAllActivePermanents() { + List active = new ArrayList(); + for (Permanent perm: field.values()) { + if (perm.isPhasedIn()) + active.add(perm); + } + return active; + } - /** - * Returns all {@link Permanent} on the battlefield that are controlled by the specified - * player id. The method ignores the range of influence. - * - * @param controllerId - * @return a list of {@link Permanent} - * @see Permanent - */ - public List getAllActivePermanents(UUID controllerId) { - List active = new ArrayList(); - for (Permanent perm: field.values()) { - if (perm.isPhasedIn() && perm.getControllerId().equals(controllerId)) - active.add(perm); - } - return active; - } + /** + * Returns all {@link Permanent} on the battlefield that are controlled by the specified + * player id. The method ignores the range of influence. + * + * @param controllerId + * @return a list of {@link Permanent} + * @see Permanent + */ + public List getAllActivePermanents(UUID controllerId) { + List active = new ArrayList(); + for (Permanent perm: field.values()) { + if (perm.isPhasedIn() && perm.getControllerId().equals(controllerId)) + active.add(perm); + } + return active; + } - /** - * Returns all {@link Permanent} on the battlefield that match the specified {@link CardType}. - * This method ignores the range of influence. - * - * @param type - * @return a list of {@link Permanent} - * @see Permanent - */ - public List getAllActivePermanents(CardType type) { - List active = new ArrayList(); - for (Permanent perm: field.values()) { - if (perm.isPhasedIn() && perm.getCardType().contains(type)) - active.add(perm); - } - return active; - } + /** + * Returns all {@link Permanent} on the battlefield that match the specified {@link CardType}. + * This method ignores the range of influence. + * + * @param type + * @return a list of {@link Permanent} + * @see Permanent + */ + public List getAllActivePermanents(CardType type) { + List active = new ArrayList(); + for (Permanent perm: field.values()) { + if (perm.isPhasedIn() && perm.getCardType().contains(type)) + active.add(perm); + } + return active; + } - /** - * Returns all {@link Permanent} on the battlefield that match the supplied filter. - * This method ignores the range of influence. - * - * + /** + * Returns all {@link Permanent} on the battlefield that match the supplied filter. + * This method ignores the range of influence. + * + * * @param filter * @return a list of {@link Permanent} - * @see Permanent - */ - public List getAllActivePermanents(FilterPermanent filter, Game game) { - List active = new ArrayList(); - for (Permanent perm: field.values()) { - if (perm.isPhasedIn() && filter.match(perm, game)) - active.add(perm); - } - return active; - } + * @see Permanent + */ + public List getAllActivePermanents(FilterPermanent filter, Game game) { + List active = new ArrayList(); + for (Permanent perm: field.values()) { + if (perm.isPhasedIn() && filter.match(perm, game)) + active.add(perm); + } + return active; + } - /** - * Returns all {@link Permanent} that match the filter and are controlled by controllerId. - * This method ignores the range of influence. - * - * @param filter - * @param controllerId - * @return a list of {@link Permanent} - * @see Permanent - */ - public List getAllActivePermanents(FilterPermanent filter, UUID controllerId, Game game) { - List active = new ArrayList(); - for (Permanent perm: field.values()) { - if (perm.isPhasedIn() && perm.getControllerId().equals(controllerId) && filter.match(perm, game)) - active.add(perm); - } - return active; - } + /** + * Returns all {@link Permanent} that match the filter and are controlled by controllerId. + * This method ignores the range of influence. + * + * @param filter + * @param controllerId + * @return a list of {@link Permanent} + * @see Permanent + */ + public List getAllActivePermanents(FilterPermanent filter, UUID controllerId, Game game) { + List active = new ArrayList(); + for (Permanent perm: field.values()) { + if (perm.isPhasedIn() && perm.getControllerId().equals(controllerId) && filter.match(perm, game)) + active.add(perm); + } + return active; + } public List getActivePermanents(FilterPermanent filter, UUID sourcePlayerId, Game game) { return getActivePermanents(filter, sourcePlayerId, null, game); } - /** - * Returns all {@link Permanent} that are within the range of influence of the specified player id - * and that match the supplied filter. - * - * @param filter - * @param sourcePlayerId - * @param game - * @return a list of {@link Permanent} - * @see Permanent - */ - public List getActivePermanents(FilterPermanent filter, UUID sourcePlayerId, UUID sourceId, Game game) { - List active = new ArrayList(); - if (game.getRangeOfInfluence() == RangeOfInfluence.ALL) { - for (Permanent perm: field.values()) { - if (perm.isPhasedIn() && filter.match(perm, sourceId, sourcePlayerId, game)) - active.add(perm); - } - } - else { - Set range = game.getPlayer(sourcePlayerId).getInRange(); - for (Permanent perm: field.values()) { - if (perm.isPhasedIn() && range.contains(perm.getControllerId()) && filter.match(perm, sourceId, sourcePlayerId, game)) - active.add(perm); - } - } - return active; - } + /** + * Returns all {@link Permanent} that are within the range of influence of the specified player id + * and that match the supplied filter. + * + * @param filter + * @param sourcePlayerId + * @param game + * @return a list of {@link Permanent} + * @see Permanent + */ + public List getActivePermanents(FilterPermanent filter, UUID sourcePlayerId, UUID sourceId, Game game) { + List active = new ArrayList(); + if (game.getRangeOfInfluence() == RangeOfInfluence.ALL) { + for (Permanent perm: field.values()) { + if (perm.isPhasedIn() && filter.match(perm, sourceId, sourcePlayerId, game)) + active.add(perm); + } + } + else { + Set range = game.getPlayer(sourcePlayerId).getInRange(); + for (Permanent perm: field.values()) { + if (perm.isPhasedIn() && range.contains(perm.getControllerId()) && filter.match(perm, sourceId, sourcePlayerId, game)) + active.add(perm); + } + } + return active; + } - /** - * Returns all {@link Permanent} that are within the range of influence of the specified player id. - * - * @param sourcePlayerId - * @param game - * @return a list of {@link Permanent} - * @see Permanent - */ - public List getActivePermanents(UUID sourcePlayerId, Game game) { - if (game.getRangeOfInfluence() == RangeOfInfluence.ALL) { - return getAllActivePermanents(); - } - else { - List active = new ArrayList(); - Set range = game.getPlayer(sourcePlayerId).getInRange(); - for (Permanent perm: field.values()) { - if (perm.isPhasedIn() && range.contains(perm.getControllerId())) - active.add(perm); - } - return active; - } - } + /** + * Returns all {@link Permanent} that are within the range of influence of the specified player id. + * + * @param sourcePlayerId + * @param game + * @return a list of {@link Permanent} + * @see Permanent + */ + public List getActivePermanents(UUID sourcePlayerId, Game game) { + if (game.getRangeOfInfluence() == RangeOfInfluence.ALL) { + return getAllActivePermanents(); + } + else { + List active = new ArrayList(); + Set range = game.getPlayer(sourcePlayerId).getInRange(); + for (Permanent perm: field.values()) { + if (perm.isPhasedIn() && range.contains(perm.getControllerId())) + active.add(perm); + } + return active; + } + } - public List getPhasedIn(UUID controllerId) { - List phasedIn = new ArrayList(); - for (Permanent perm: field.values()) { - if (perm.getAbilities().containsKey(PhasingAbility.getInstance().getId()) && perm.isPhasedIn() && perm.getControllerId().equals(controllerId)) - phasedIn.add(perm); - } - return phasedIn; - } + public List getPhasedIn(UUID controllerId) { + List phasedIn = new ArrayList(); + for (Permanent perm: field.values()) { + if (perm.getAbilities().containsKey(PhasingAbility.getInstance().getId()) && perm.isPhasedIn() && perm.getControllerId().equals(controllerId)) + phasedIn.add(perm); + } + return phasedIn; + } - public List getPhasedOut(UUID controllerId) { - List phasedOut = new ArrayList(); - for (Permanent perm: field.values()) { - if (!perm.isPhasedIn() && perm.getControllerId().equals(controllerId)) - phasedOut.add(perm); - } - return phasedOut; - } + public List getPhasedOut(UUID controllerId) { + List phasedOut = new ArrayList(); + for (Permanent perm: field.values()) { + if (!perm.isPhasedIn() && perm.getControllerId().equals(controllerId)) + phasedOut.add(perm); + } + return phasedOut; + } - /** - * since control could change several times during applyEvents we only want to fire - * control changed events after all control change effects have been applied - * - * @param game - */ - public void fireControlChangeEvents(Game game) { - for (Permanent perm: field.values()) { - if (perm.isPhasedIn()) - perm.checkControlChanged(game); - } - } + /** + * since control could change several times during applyEvents we only want to fire + * control changed events after all control change effects have been applied + * + * @param game + */ + public void fireControlChangeEvents(Game game) { + for (Permanent perm: field.values()) { + if (perm.isPhasedIn()) + perm.checkControlChanged(game); + } + } } diff --git a/Mage/src/mage/game/permanent/Permanent.java b/Mage/src/mage/game/permanent/Permanent.java index 030c9c78c7..d450d1bf2c 100644 --- a/Mage/src/mage/game/permanent/Permanent.java +++ b/Mage/src/mage/game/permanent/Permanent.java @@ -40,143 +40,143 @@ import java.util.UUID; public interface Permanent extends Card { - public boolean isTapped(); - public boolean untap(Game game); - public boolean tap(Game game); - // use tap(game) - // setTapped doesn't trigger TAPPED event and should be used - // only if you want permanent to enter battlefield tapped - @Deprecated - public void setTapped(boolean tapped); - public boolean canTap(); - - public boolean isFlipped(); - public boolean unflip(Game game); - public boolean flip(Game game); + public boolean isTapped(); + public boolean untap(Game game); + public boolean tap(Game game); + // use tap(game) + // setTapped doesn't trigger TAPPED event and should be used + // only if you want permanent to enter battlefield tapped + @Deprecated + public void setTapped(boolean tapped); + public boolean canTap(); + + public boolean isFlipped(); + public boolean unflip(Game game); + public boolean flip(Game game); public boolean transform(Game game); public boolean isTransformed(); public void setTransformed(boolean value); - public boolean isPhasedIn(); - public boolean phaseIn(Game game); - public boolean phaseOut(Game game); + public boolean isPhasedIn(); + public boolean phaseIn(Game game); + public boolean phaseOut(Game game); - public boolean isFaceUp(); - public boolean turnFaceUp(Game game); - public boolean turnFaceDown(Game game); + public boolean isFaceUp(); + public boolean turnFaceUp(Game game); + public boolean turnFaceDown(Game game); - public List getAttachments(); - public UUID getAttachedTo(); - public void attachTo(UUID permanentId, Game game); - public boolean addAttachment(UUID permanentId, Game game); - public boolean removeAttachment(UUID permanentId, Game game); - - public UUID getControllerId(); - public boolean changeControllerId(UUID controllerId, Game game); - public boolean canBeTargetedBy(MageObject source, UUID controllerId, Game game); - public boolean hasProtectionFrom(MageObject source, Game game); - public boolean hasSummoningSickness(); - public int getDamage(); - public int damage(int damage, UUID sourceId, Game game, boolean preventable, boolean combat); + public List getAttachments(); + public UUID getAttachedTo(); + public void attachTo(UUID permanentId, Game game); + public boolean addAttachment(UUID permanentId, Game game); + public boolean removeAttachment(UUID permanentId, Game game); - // used in combat only to deal damage at the same time - public int markDamage(int damage, UUID sourceId, Game game, boolean preventable, boolean combat); - public int applyDamage(Game game); + public UUID getControllerId(); + public boolean changeControllerId(UUID controllerId, Game game); + public boolean canBeTargetedBy(MageObject source, UUID controllerId, Game game); + public boolean hasProtectionFrom(MageObject source, Game game); + public boolean hasSummoningSickness(); + public int getDamage(); + public int damage(int damage, UUID sourceId, Game game, boolean preventable, boolean combat); - public void removeAllDamage(Game game); - public Counters getCounters(); - public void addCounters(String name, int amount, Game game); - public void addCounters(Counter counter, Game game); - public void removeCounters(String name, int amount, Game game); - public void removeCounters(Counter counter, Game game); - public void reset(Game game); - public boolean destroy(UUID sourceId, Game game, boolean noRegen); - public boolean sacrifice(UUID sourceId, Game game); + // used in combat only to deal damage at the same time + public int markDamage(int damage, UUID sourceId, Game game, boolean preventable, boolean combat); + public int applyDamage(Game game); + + public void removeAllDamage(Game game); + public Counters getCounters(); + public void addCounters(String name, int amount, Game game); + public void addCounters(Counter counter, Game game); + public void removeCounters(String name, int amount, Game game); + public void removeCounters(Counter counter, Game game); + public void reset(Game game); + public boolean destroy(UUID sourceId, Game game, boolean noRegen); + public boolean sacrifice(UUID sourceId, Game game); public boolean regenerate(UUID sourceId, Game game); - public void entersBattlefield(UUID sourceId, Game game); - public String getValue(); + public void entersBattlefield(UUID sourceId, Game game); + public String getValue(); @Deprecated @Override public void addAbility(Ability ability); - public void addAbility(Ability ability, Game game); + public void addAbility(Ability ability, Game game); - public void setLoyaltyUsed(boolean used); - public boolean isLoyaltyUsed(); + public void setLoyaltyUsed(boolean used); + public boolean isLoyaltyUsed(); - public void beginningOfTurn(Game game); + public void beginningOfTurn(Game game); public void endOfTurn(Game game); - public void checkControlChanged(Game game); - public int getTurnsOnBattlefield(); + public void checkControlChanged(Game game); + public int getTurnsOnBattlefield(); - public void addPower(int power); - public void addToughness(int toughness); + public void addPower(int power); + public void addToughness(int toughness); - public boolean isAttacking(); - public int getBlocking(); - public void setAttacking(boolean attacking); - public void setBlocking(int blocking); - public int getMaxBlocks(); - public void setMaxBlocks(int maxBlocks); - public int getMinBlockedBy(); - public void setMinBlockedBy(int minBlockedBy); - public boolean canAttack(Game game); - public boolean canBlock(UUID attackerId, Game game); - public boolean removeFromCombat(Game game); - public boolean isDeathtouched(); + public boolean isAttacking(); + public int getBlocking(); + public void setAttacking(boolean attacking); + public void setBlocking(int blocking); + public int getMaxBlocks(); + public void setMaxBlocks(int maxBlocks); + public int getMinBlockedBy(); + public void setMinBlockedBy(int minBlockedBy); + public boolean canAttack(Game game); + public boolean canBlock(UUID attackerId, Game game); + public boolean removeFromCombat(Game game); + public boolean isDeathtouched(); - /** - * Returns the list of sources that dealt damage this turn to this permanent - * @return - */ - public List getDealtDamageByThisTurn(); + /** + * Returns the list of sources that dealt damage this turn to this permanent + * @return + */ + public List getDealtDamageByThisTurn(); - /** - * Imprint some other card to this one. - * - * @param imprintedCard Card to count as imprinted - * @param game - * @return true if card was imprinted - */ - public boolean imprint(UUID imprintedCard, Game game); + /** + * Imprint some other card to this one. + * + * @param imprintedCard Card to count as imprinted + * @param game + * @return true if card was imprinted + */ + public boolean imprint(UUID imprintedCard, Game game); - /** - * Removes all imprinted cards from permanent. - * - * @param game - * @return - */ - public boolean clearImprinted(Game game); + /** + * Removes all imprinted cards from permanent. + * + * @param game + * @return + */ + public boolean clearImprinted(Game game); - /** - * Get card that was imprinted on this one. - * - * Can be null if no card was imprinted. - * @return Imprinted card UUID. - */ - public List getImprinted(); + /** + * Get card that was imprinted on this one. + * + * Can be null if no card was imprinted. + * @return Imprinted card UUID. + */ + public List getImprinted(); - /** - * Allows to connect any card to permanent. - * Very similar to Imprint except that it is for internal use only. - * + /** + * Allows to connect any card to permanent. + * Very similar to Imprint except that it is for internal use only. + * * @param key - * @param connectedCard - */ - public void addConnectedCard(String key, UUID connectedCard); + * @param connectedCard + */ + public void addConnectedCard(String key, UUID connectedCard); - /** - * Returns connected cards. - * Very similar to Imprint except that it is for internal use only. - * @return - */ - public List getConnectedCards(String key); + /** + * Returns connected cards. + * Very similar to Imprint except that it is for internal use only. + * @return + */ + public List getConnectedCards(String key); - /** - * Clear all connected cards. - */ - public void clearConnectedCards(String key); + /** + * Clear all connected cards. + */ + public void clearConnectedCards(String key); /** * Sets paired card. @@ -197,7 +197,7 @@ public interface Permanent extends Card { */ public void clearPairedCard(); - @Override - public Permanent copy(); + @Override + public Permanent copy(); } diff --git a/Mage/src/mage/game/permanent/PermanentCard.java b/Mage/src/mage/game/permanent/PermanentCard.java index 3d0a3d8a22..dc552f78fb 100644 --- a/Mage/src/mage/game/permanent/PermanentCard.java +++ b/Mage/src/mage/game/permanent/PermanentCard.java @@ -81,7 +81,7 @@ public class PermanentCard extends PermanentImpl { copyFromCard(card, game); super.reset(game); } - + protected void copyFromCard(Card card) { this.name = card.getName(); this.abilities.clear(); @@ -164,7 +164,7 @@ public class PermanentCard extends PermanentImpl { public Card getCard() { return card; } - + @Override public boolean moveToZone(Zone toZone, UUID sourceId, Game game, boolean flag) { Zone fromZone = game.getState().getZone(objectId); diff --git a/Mage/src/mage/game/permanent/PermanentImpl.java b/Mage/src/mage/game/permanent/PermanentImpl.java index 05f1faedaf..e147036edc 100644 --- a/Mage/src/mage/game/permanent/PermanentImpl.java +++ b/Mage/src/mage/game/permanent/PermanentImpl.java @@ -646,7 +646,7 @@ public abstract class PermanentImpl> extends CardImpl } return 0; } - + private int checkProtectionAbilities(GameEvent event, UUID sourceId, Game game) { MageObject source = game.getObject(sourceId); if (source != null && hasProtectionFrom(source, game)) { diff --git a/Mage/src/mage/game/permanent/PermanentToken.java b/Mage/src/mage/game/permanent/PermanentToken.java index 78da3f68f5..900686cd70 100644 --- a/Mage/src/mage/game/permanent/PermanentToken.java +++ b/Mage/src/mage/game/permanent/PermanentToken.java @@ -42,71 +42,71 @@ import java.util.UUID; */ public class PermanentToken extends PermanentImpl { - protected Token token; - - public PermanentToken(Token token, UUID controllerId, String expansionSetCode) { - super(controllerId, controllerId, token.getName()); - this.token = token; - this.expansionSetCode = expansionSetCode; - } + protected Token token; - public PermanentToken(final PermanentToken permanent) { - super(permanent); - this.token = permanent.token.copy(); - this.expansionSetCode = permanent.expansionSetCode; - } + public PermanentToken(Token token, UUID controllerId, String expansionSetCode) { + super(controllerId, controllerId, token.getName()); + this.token = token; + this.expansionSetCode = expansionSetCode; + } - @Override - public void reset(Game game) { - Token copy = token.copy(); - copyFromToken(copy, game); - super.reset(game); - } + public PermanentToken(final PermanentToken permanent) { + super(permanent); + this.token = permanent.token.copy(); + this.expansionSetCode = permanent.expansionSetCode; + } - protected void copyFromToken(Token token, Game game) { - this.name = token.getName(); - this.abilities.clear(); - for (Ability ability: token.getAbilities()) { - this.addAbility(ability, game); - } - this.cardType = token.getCardType(); - this.color = token.getColor(); - this.power = token.getPower(); - this.toughness = token.getToughness(); - this.subtype = token.getSubtype(); - } + @Override + public void reset(Game game) { + Token copy = token.copy(); + copyFromToken(copy, game); + super.reset(game); + } - @Override - public boolean moveToZone(Zone zone, UUID sourceId, Game game, boolean flag) { - if (!game.replaceEvent(new ZoneChangeEvent(this, this.getControllerId(), Zone.BATTLEFIELD, zone))) { - game.rememberLKI(objectId, Zone.BATTLEFIELD, this); - if (game.getPlayer(controllerId).removeFromBattlefield(this, game)) { - game.fireEvent(new ZoneChangeEvent(this, this.getControllerId(), Zone.BATTLEFIELD, zone)); - return true; - } - } - return false; - } + protected void copyFromToken(Token token, Game game) { + this.name = token.getName(); + this.abilities.clear(); + for (Ability ability: token.getAbilities()) { + this.addAbility(ability, game); + } + this.cardType = token.getCardType(); + this.color = token.getColor(); + this.power = token.getPower(); + this.toughness = token.getToughness(); + this.subtype = token.getSubtype(); + } - @Override - public boolean moveToExile(UUID exileId, String name, UUID sourceId, Game game) { - if (!game.replaceEvent(new ZoneChangeEvent(this, sourceId, this.getControllerId(), Zone.BATTLEFIELD, Zone.EXILED))) { - game.rememberLKI(objectId, Zone.BATTLEFIELD, this); - if (game.getPlayer(controllerId).removeFromBattlefield(this, game)) { - game.fireEvent(new ZoneChangeEvent(this, sourceId, this.getControllerId(), Zone.BATTLEFIELD, Zone.EXILED)); - return true; - } - } - return false; - } + @Override + public boolean moveToZone(Zone zone, UUID sourceId, Game game, boolean flag) { + if (!game.replaceEvent(new ZoneChangeEvent(this, this.getControllerId(), Zone.BATTLEFIELD, zone))) { + game.rememberLKI(objectId, Zone.BATTLEFIELD, this); + if (game.getPlayer(controllerId).removeFromBattlefield(this, game)) { + game.fireEvent(new ZoneChangeEvent(this, this.getControllerId(), Zone.BATTLEFIELD, zone)); + return true; + } + } + return false; + } - public Token getToken() { - return token; - } + @Override + public boolean moveToExile(UUID exileId, String name, UUID sourceId, Game game) { + if (!game.replaceEvent(new ZoneChangeEvent(this, sourceId, this.getControllerId(), Zone.BATTLEFIELD, Zone.EXILED))) { + game.rememberLKI(objectId, Zone.BATTLEFIELD, this); + if (game.getPlayer(controllerId).removeFromBattlefield(this, game)) { + game.fireEvent(new ZoneChangeEvent(this, sourceId, this.getControllerId(), Zone.BATTLEFIELD, Zone.EXILED)); + return true; + } + } + return false; + } - @Override - public PermanentToken copy() { - return new PermanentToken(this); - } + public Token getToken() { + return token; + } + + @Override + public PermanentToken copy() { + return new PermanentToken(this); + } } diff --git a/Mage/src/mage/game/permanent/token/BeastToken.java b/Mage/src/mage/game/permanent/token/BeastToken.java index 8a196ad525..f83ef3dcd3 100644 --- a/Mage/src/mage/game/permanent/token/BeastToken.java +++ b/Mage/src/mage/game/permanent/token/BeastToken.java @@ -38,13 +38,13 @@ import mage.ObjectColor; */ public class BeastToken extends Token { - public BeastToken() { - super("Beast", "3/3 green Beast creature token"); - cardType.add(CardType.CREATURE); - color = ObjectColor.GREEN; - subtype.add("Beast"); - power = new MageInt(3); - toughness = new MageInt(3); - } + public BeastToken() { + super("Beast", "3/3 green Beast creature token"); + cardType.add(CardType.CREATURE); + color = ObjectColor.GREEN; + subtype.add("Beast"); + power = new MageInt(3); + toughness = new MageInt(3); + } } diff --git a/Mage/src/mage/game/permanent/token/DragonToken.java b/Mage/src/mage/game/permanent/token/DragonToken.java index 1c64cd2ed4..ee973efd4a 100644 --- a/Mage/src/mage/game/permanent/token/DragonToken.java +++ b/Mage/src/mage/game/permanent/token/DragonToken.java @@ -39,13 +39,13 @@ import mage.abilities.keyword.FlyingAbility; */ public class DragonToken extends Token { - public DragonToken() { - super("Dragon", "4/4 red Dragon creature token with flying"); - cardType.add(CardType.CREATURE); - color = ObjectColor.RED; - subtype.add("Dragon"); - power = new MageInt(4); - toughness = new MageInt(4); - addAbility(FlyingAbility.getInstance()); - } + public DragonToken() { + super("Dragon", "4/4 red Dragon creature token with flying"); + cardType.add(CardType.CREATURE); + color = ObjectColor.RED; + subtype.add("Dragon"); + power = new MageInt(4); + toughness = new MageInt(4); + addAbility(FlyingAbility.getInstance()); + } } diff --git a/Mage/src/mage/game/permanent/token/EldraziSpawnToken.java b/Mage/src/mage/game/permanent/token/EldraziSpawnToken.java index c23544b6c3..80ec93aba7 100644 --- a/Mage/src/mage/game/permanent/token/EldraziSpawnToken.java +++ b/Mage/src/mage/game/permanent/token/EldraziSpawnToken.java @@ -42,14 +42,14 @@ import mage.abilities.mana.SimpleManaAbility; */ public class EldraziSpawnToken extends Token { - public EldraziSpawnToken() { - super("Eldrazi Spawn", "0/1 colorless Eldrazi Spawn creature with \"Sacrifice this creature: Add {1} to your mana pool.\""); - cardType.add(CardType.CREATURE); - subtype.add("Eldrazi"); - subtype.add("Spawn"); - power = new MageInt(0); - toughness = new MageInt(1); - addAbility(new SimpleManaAbility(Zone.BATTLEFIELD, new BasicManaEffect(Mana.ColorlessMana), new SacrificeSourceCost())); - } + public EldraziSpawnToken() { + super("Eldrazi Spawn", "0/1 colorless Eldrazi Spawn creature with \"Sacrifice this creature: Add {1} to your mana pool.\""); + cardType.add(CardType.CREATURE); + subtype.add("Eldrazi"); + subtype.add("Spawn"); + power = new MageInt(0); + toughness = new MageInt(1); + addAbility(new SimpleManaAbility(Zone.BATTLEFIELD, new BasicManaEffect(Mana.ColorlessMana), new SacrificeSourceCost())); + } } diff --git a/Mage/src/mage/game/permanent/token/ElephantToken.java b/Mage/src/mage/game/permanent/token/ElephantToken.java index 21fd7661f2..057b8b5420 100644 --- a/Mage/src/mage/game/permanent/token/ElephantToken.java +++ b/Mage/src/mage/game/permanent/token/ElephantToken.java @@ -38,13 +38,13 @@ import mage.ObjectColor; */ public class ElephantToken extends Token { - public ElephantToken() { - super("Elephant", "3/3 green Elephant creature token"); - cardType.add(CardType.CREATURE); - color = ObjectColor.GREEN; - subtype.add("Elephant"); - power = new MageInt(3); - toughness = new MageInt(3); - } + public ElephantToken() { + super("Elephant", "3/3 green Elephant creature token"); + cardType.add(CardType.CREATURE); + color = ObjectColor.GREEN; + subtype.add("Elephant"); + power = new MageInt(3); + toughness = new MageInt(3); + } } \ No newline at end of file diff --git a/Mage/src/mage/game/permanent/token/ElfToken.java b/Mage/src/mage/game/permanent/token/ElfToken.java index 5a31593ea6..6d81c62efe 100644 --- a/Mage/src/mage/game/permanent/token/ElfToken.java +++ b/Mage/src/mage/game/permanent/token/ElfToken.java @@ -37,14 +37,14 @@ import mage.MageInt; */ public class ElfToken extends Token { - public ElfToken() { - super("", "1/1 green Elf Warrior creature token"); + public ElfToken() { + super("", "1/1 green Elf Warrior creature token"); cardType.add(Constants.CardType.CREATURE); color.setGreen(true); subtype.add("Elf"); subtype.add("Warrior"); power = new MageInt(1); toughness = new MageInt(1); - } + } } diff --git a/Mage/src/mage/game/permanent/token/FrogToken.java b/Mage/src/mage/game/permanent/token/FrogToken.java index 3ac33433e9..ae994d8e2a 100644 --- a/Mage/src/mage/game/permanent/token/FrogToken.java +++ b/Mage/src/mage/game/permanent/token/FrogToken.java @@ -38,13 +38,13 @@ import mage.ObjectColor; */ public class FrogToken extends Token { - public FrogToken() { - super("Frog", "1/1 blue Frog creature token"); - cardType.add(CardType.CREATURE); - color = ObjectColor.BLUE; - subtype.add("Frog"); - power = new MageInt(1); - toughness = new MageInt(1); - } + public FrogToken() { + super("Frog", "1/1 blue Frog creature token"); + cardType.add(CardType.CREATURE); + color = ObjectColor.BLUE; + subtype.add("Frog"); + power = new MageInt(1); + toughness = new MageInt(1); + } } diff --git a/Mage/src/mage/game/permanent/token/InsectInfectToken.java b/Mage/src/mage/game/permanent/token/InsectInfectToken.java index d35539cae4..e4f3dfcfdd 100644 --- a/Mage/src/mage/game/permanent/token/InsectInfectToken.java +++ b/Mage/src/mage/game/permanent/token/InsectInfectToken.java @@ -39,13 +39,13 @@ import mage.abilities.keyword.InfectAbility; */ public class InsectInfectToken extends Token { - public InsectInfectToken() { - super("Insect", "1/1 green Insect creature token with infect"); - cardType.add(CardType.CREATURE); - color = ObjectColor.GREEN; - subtype.add("Insect"); - power = new MageInt(1); - toughness = new MageInt(1); - addAbility(InfectAbility.getInstance()); - } + public InsectInfectToken() { + super("Insect", "1/1 green Insect creature token with infect"); + cardType.add(CardType.CREATURE); + color = ObjectColor.GREEN; + subtype.add("Insect"); + power = new MageInt(1); + toughness = new MageInt(1); + addAbility(InfectAbility.getInstance()); + } } \ No newline at end of file diff --git a/Mage/src/mage/game/permanent/token/InsectToken.java b/Mage/src/mage/game/permanent/token/InsectToken.java index 7f58e94b7d..8a476215e9 100644 --- a/Mage/src/mage/game/permanent/token/InsectToken.java +++ b/Mage/src/mage/game/permanent/token/InsectToken.java @@ -38,12 +38,12 @@ import mage.ObjectColor; */ public class InsectToken extends Token { - public InsectToken() { - super("Insect", "1/1 green Insect creature token"); - cardType.add(CardType.CREATURE); - color = ObjectColor.GREEN; - subtype.add("Insect"); - power = new MageInt(1); - toughness = new MageInt(1); - } + public InsectToken() { + super("Insect", "1/1 green Insect creature token"); + cardType.add(CardType.CREATURE); + color = ObjectColor.GREEN; + subtype.add("Insect"); + power = new MageInt(1); + toughness = new MageInt(1); + } } \ No newline at end of file diff --git a/Mage/src/mage/game/permanent/token/MyrToken.java b/Mage/src/mage/game/permanent/token/MyrToken.java index a652544715..7e6cba449c 100644 --- a/Mage/src/mage/game/permanent/token/MyrToken.java +++ b/Mage/src/mage/game/permanent/token/MyrToken.java @@ -4,12 +4,12 @@ import mage.Constants; import mage.MageInt; public class MyrToken extends Token { - public MyrToken() { - super("Myr", "1/1 colorless Myr artifact creature token"); - cardType.add(Constants.CardType.CREATURE); - cardType.add(Constants.CardType.ARTIFACT); - subtype.add("Myr"); - power = new MageInt(1); - toughness = new MageInt(1); - } + public MyrToken() { + super("Myr", "1/1 colorless Myr artifact creature token"); + cardType.add(Constants.CardType.CREATURE); + cardType.add(Constants.CardType.ARTIFACT); + subtype.add("Myr"); + power = new MageInt(1); + toughness = new MageInt(1); + } } \ No newline at end of file diff --git a/Mage/src/mage/game/permanent/token/SaprolingToken.java b/Mage/src/mage/game/permanent/token/SaprolingToken.java index 879e0a7632..6200b2e6b5 100644 --- a/Mage/src/mage/game/permanent/token/SaprolingToken.java +++ b/Mage/src/mage/game/permanent/token/SaprolingToken.java @@ -38,12 +38,12 @@ import mage.ObjectColor; */ public class SaprolingToken extends Token { - public SaprolingToken() { - super("Saproling", "1/1 green Saproling creature token"); - cardType.add(CardType.CREATURE); - color = ObjectColor.GREEN; - subtype.add("Saproling"); - power = new MageInt(1); - toughness = new MageInt(1); - } + public SaprolingToken() { + super("Saproling", "1/1 green Saproling creature token"); + cardType.add(CardType.CREATURE); + color = ObjectColor.GREEN; + subtype.add("Saproling"); + power = new MageInt(1); + toughness = new MageInt(1); + } } \ No newline at end of file diff --git a/Mage/src/mage/game/permanent/token/SnakeToken.java b/Mage/src/mage/game/permanent/token/SnakeToken.java index ad700b34ff..52660718dd 100644 --- a/Mage/src/mage/game/permanent/token/SnakeToken.java +++ b/Mage/src/mage/game/permanent/token/SnakeToken.java @@ -38,13 +38,13 @@ import mage.ObjectColor; */ public class SnakeToken extends Token { - public SnakeToken() { - super("Snake", "1/1 green Snake creature token"); - cardType.add(CardType.CREATURE); - color = ObjectColor.GREEN; - subtype.add("Snake"); - power = new MageInt(1); - toughness = new MageInt(1); - } + public SnakeToken() { + super("Snake", "1/1 green Snake creature token"); + cardType.add(CardType.CREATURE); + color = ObjectColor.GREEN; + subtype.add("Snake"); + power = new MageInt(1); + toughness = new MageInt(1); + } } diff --git a/Mage/src/mage/game/permanent/token/SoldierToken.java b/Mage/src/mage/game/permanent/token/SoldierToken.java index eeaa460a30..a4619990b7 100644 --- a/Mage/src/mage/game/permanent/token/SoldierToken.java +++ b/Mage/src/mage/game/permanent/token/SoldierToken.java @@ -38,13 +38,13 @@ import mage.ObjectColor; */ public class SoldierToken extends Token { - public SoldierToken() { - super("Soldier", "1/1 white Soldier creature token"); - cardType.add(CardType.CREATURE); - color = ObjectColor.WHITE; - subtype.add("Soldier"); - power = new MageInt(1); - toughness = new MageInt(1); - } + public SoldierToken() { + super("Soldier", "1/1 white Soldier creature token"); + cardType.add(CardType.CREATURE); + color = ObjectColor.WHITE; + subtype.add("Soldier"); + power = new MageInt(1); + toughness = new MageInt(1); + } } diff --git a/Mage/src/mage/game/permanent/token/Token.java b/Mage/src/mage/game/permanent/token/Token.java index 9525a69d0c..981214d919 100644 --- a/Mage/src/mage/game/permanent/token/Token.java +++ b/Mage/src/mage/game/permanent/token/Token.java @@ -46,55 +46,55 @@ import java.util.UUID; public class Token extends MageObjectImpl { - protected String description; + protected String description; private UUID lastAddedTokenId; private int tokenType; - public Token(String name, String description) { - this.name = name; - this.description = description; - } + public Token(String name, String description) { + this.name = name; + this.description = description; + } - public Token(String name, String description, ObjectColor color, List subtype, int power, int toughness, Abilities abilities) { - this(name, description); - this.cardType.add(CardType.CREATURE); - this.color = color.copy(); - this.subtype = subtype; - this.power.setValue(power); - this.toughness.setValue(toughness); - if (abilities != null) { - this.abilities = abilities.copy(); - } - } + public Token(String name, String description, ObjectColor color, List subtype, int power, int toughness, Abilities abilities) { + this(name, description); + this.cardType.add(CardType.CREATURE); + this.color = color.copy(); + this.subtype = subtype; + this.power.setValue(power); + this.toughness.setValue(toughness); + if (abilities != null) { + this.abilities = abilities.copy(); + } + } - public Token(final Token token) { - super(token); - this.description = token.description; + public Token(final Token token) { + super(token); + this.description = token.description; this.tokenType = token.tokenType; - } + } - public String getDescription() { - return description; - } + public String getDescription() { + return description; + } public UUID getLastAddedToken() { return lastAddedTokenId; } public void addAbility(Ability ability) { - ability.setSourceId(this.getId()); - abilities.add(ability); - } + ability.setSourceId(this.getId()); + abilities.add(ability); + } - @Override - public Token copy() { - return new Token(this); - } + @Override + public Token copy() { + return new Token(this); + } - public boolean putOntoBattlefield(int amount, Game game, UUID sourceId, UUID controllerId) { - Card source = game.getCard(sourceId); - String setCode = source != null ? source.getExpansionSetCode() : null; - GameEvent event = GameEvent.getEvent(EventType.CREATE_TOKEN, null, sourceId, controllerId, amount); + public boolean putOntoBattlefield(int amount, Game game, UUID sourceId, UUID controllerId) { + Card source = game.getCard(sourceId); + String setCode = source != null ? source.getExpansionSetCode() : null; + GameEvent event = GameEvent.getEvent(EventType.CREATE_TOKEN, null, sourceId, controllerId, amount); if (!game.replaceEvent(event)) { amount = event.getAmount(); for (int i = 0; i < amount; i++) { @@ -109,7 +109,7 @@ public class Token extends MageObjectImpl { return true; } return false; - } + } public int getTokenType() { return tokenType; diff --git a/Mage/src/mage/game/permanent/token/WolfToken.java b/Mage/src/mage/game/permanent/token/WolfToken.java index 2608630e72..bae444c9d5 100644 --- a/Mage/src/mage/game/permanent/token/WolfToken.java +++ b/Mage/src/mage/game/permanent/token/WolfToken.java @@ -38,13 +38,13 @@ import mage.ObjectColor; */ public class WolfToken extends Token { - public WolfToken() { - super("Wolf", "2/2 green Wolf creature token"); - cardType.add(CardType.CREATURE); - color = ObjectColor.GREEN; - subtype.add("Wolf"); - power = new MageInt(2); - toughness = new MageInt(2); - } + public WolfToken() { + super("Wolf", "2/2 green Wolf creature token"); + cardType.add(CardType.CREATURE); + color = ObjectColor.GREEN; + subtype.add("Wolf"); + power = new MageInt(2); + toughness = new MageInt(2); + } } diff --git a/Mage/src/mage/game/permanent/token/WolfTokenWithDeathtouch.java b/Mage/src/mage/game/permanent/token/WolfTokenWithDeathtouch.java index d8a023c49a..625f8b6a33 100644 --- a/Mage/src/mage/game/permanent/token/WolfTokenWithDeathtouch.java +++ b/Mage/src/mage/game/permanent/token/WolfTokenWithDeathtouch.java @@ -39,15 +39,15 @@ import mage.abilities.keyword.DeathtouchAbility; */ public class WolfTokenWithDeathtouch extends Token { - public WolfTokenWithDeathtouch() { - super("Wolf", "1/1 black Wolf creature token with deathtouch"); - cardType.add(CardType.CREATURE); - color = ObjectColor.BLACK; - subtype.add("Wolf"); - power = new MageInt(1); - toughness = new MageInt(1); + public WolfTokenWithDeathtouch() { + super("Wolf", "1/1 black Wolf creature token with deathtouch"); + cardType.add(CardType.CREATURE); + color = ObjectColor.BLACK; + subtype.add("Wolf"); + power = new MageInt(1); + toughness = new MageInt(1); addAbility(DeathtouchAbility.getInstance()); - } + } } diff --git a/Mage/src/mage/game/permanent/token/ZombieToken.java b/Mage/src/mage/game/permanent/token/ZombieToken.java index 782320ac15..95ec1db1e3 100644 --- a/Mage/src/mage/game/permanent/token/ZombieToken.java +++ b/Mage/src/mage/game/permanent/token/ZombieToken.java @@ -38,13 +38,13 @@ import mage.ObjectColor; */ public class ZombieToken extends Token { - public ZombieToken() { - super("Zombie", "2/2 black Zombie creature token"); - cardType.add(CardType.CREATURE); - color = ObjectColor.BLACK; - subtype.add("Zombie"); - power = new MageInt(2); - toughness = new MageInt(2); - } + public ZombieToken() { + super("Zombie", "2/2 black Zombie creature token"); + cardType.add(CardType.CREATURE); + color = ObjectColor.BLACK; + subtype.add("Zombie"); + power = new MageInt(2); + toughness = new MageInt(2); + } } \ No newline at end of file diff --git a/Mage/src/mage/game/stack/Spell.java b/Mage/src/mage/game/stack/Spell.java index a81f03e5c0..f787890ce6 100644 --- a/Mage/src/mage/game/stack/Spell.java +++ b/Mage/src/mage/game/stack/Spell.java @@ -60,27 +60,27 @@ import java.util.UUID; */ public class Spell> implements StackObject, Card { - private Card card; - private SpellAbility ability; - private UUID controllerId; - private boolean copiedSpell; + private Card card; + private SpellAbility ability; + private UUID controllerId; + private boolean copiedSpell; private Zone fromZone; - public Spell(Card card, SpellAbility ability, UUID controllerId, Zone fromZone) { - this.card = card; - this.ability = ability; + public Spell(Card card, SpellAbility ability, UUID controllerId, Zone fromZone) { + this.card = card; + this.ability = ability; this.ability.setControllerId(controllerId); - this.controllerId = controllerId; + this.controllerId = controllerId; this.fromZone = fromZone; - } + } - public Spell(final Spell spell) { - this.card = spell.card.copy(); - this.ability = spell.ability.copy(); - this.controllerId = spell.controllerId; + public Spell(final Spell spell) { + this.card = spell.card.copy(); + this.ability = spell.ability.copy(); + this.controllerId = spell.controllerId; this.fromZone = spell.fromZone; this.copiedSpell = spell.copiedSpell; - } + } @Override public boolean resolve(Game game) { @@ -154,192 +154,192 @@ public class Spell> implements StackObject, Card { } } - protected boolean resolveKicker(Game game) { - boolean replaced = false; - for (KickerAbility kicker: card.getAbilities().getKickerAbilities()) { - if (kicker.isKicked()) { - if (kicker.isReplaces()) { - replaced = true; - } - kicker.resolve(game); - } - } - return replaced; - } + protected boolean resolveKicker(Game game) { + boolean replaced = false; + for (KickerAbility kicker: card.getAbilities().getKickerAbilities()) { + if (kicker.isKicked()) { + if (kicker.isReplaces()) { + replaced = true; + } + kicker.resolve(game); + } + } + return replaced; + } - /** - * Choose new targets for the spell - * - * @param game - * @param playerId Player UUID who changes the targets. - * @return - */ - public boolean chooseNewTargets(Game game, UUID playerId) { - Player player = game.getPlayer(playerId); - if (player != null) { - for (Target target: ability.getTargets()) { - Target newTarget = target.copy(); - newTarget.clearChosen(); - for (UUID targetId: target.getTargets()) { - MageObject object = game.getObject(targetId); - String name = null; - if (object == null) { - Player targetPlayer = game.getPlayer(targetId); - if (targetPlayer != null) name = targetPlayer.getName(); - } else { - name = object.getName(); - } - if (name != null && player.chooseUse(ability.getEffects().get(0).getOutcome(), "Change target from " + name + "?", game)) { - if (!player.chooseTarget(ability.getEffects().get(0).getOutcome(), newTarget, ability, game)) - newTarget.addTarget(targetId, ability, game, false); - } - else { - newTarget.addTarget(targetId, ability, game, false); - } - } - target.clearChosen(); - for (UUID newTargetId: newTarget.getTargets()) { - target.addTarget(newTargetId, ability, game, false); - } - } - return true; - } - return false; - } - - @Override - public void counter(UUID sourceId, Game game) { - card.moveToZone(Zone.GRAVEYARD, sourceId, game, false); - } - - @Override - public UUID getSourceId() { - return card.getId(); - } - - @Override - public UUID getControllerId() { - return this.controllerId; - } - - @Override - public String getName() { - return card.getName(); - } - - @Override - public void setName(String name) {} - - @Override - public Rarity getRarity() { - return card.getRarity(); - } - - @Override - public void setRarity(Rarity rarity) {} - - @Override - public List getCardType() { - return card.getCardType(); - } - - @Override - public List getSubtype() { - return card.getSubtype(); - } - - @Override - public boolean hasSubtype(String subtype) { - return card.hasSubtype(subtype); - } - - @Override - public List getSupertype() { - return card.getSupertype(); - } - - @Override - public Abilities getAbilities() { - return card.getAbilities(); - } - - @Override - public ObjectColor getColor() { - return card.getColor(); - } - - @Override - public ManaCosts getManaCost() { - return card.getManaCost(); - } - - @Override - public MageInt getPower() { - return card.getPower(); - } - - @Override - public MageInt getToughness() { - return card.getToughness(); - } - - @Override - public UUID getId() { - return ability.getId(); - } - - @Override - public UUID getOwnerId() { - return card.getOwnerId(); - } - - @Override - public void addAbility(Ability ability) {} - - @Override - public void addWatcher(Watcher watcher) {} + /** + * Choose new targets for the spell + * + * @param game + * @param playerId Player UUID who changes the targets. + * @return + */ + public boolean chooseNewTargets(Game game, UUID playerId) { + Player player = game.getPlayer(playerId); + if (player != null) { + for (Target target: ability.getTargets()) { + Target newTarget = target.copy(); + newTarget.clearChosen(); + for (UUID targetId: target.getTargets()) { + MageObject object = game.getObject(targetId); + String name = null; + if (object == null) { + Player targetPlayer = game.getPlayer(targetId); + if (targetPlayer != null) name = targetPlayer.getName(); + } else { + name = object.getName(); + } + if (name != null && player.chooseUse(ability.getEffects().get(0).getOutcome(), "Change target from " + name + "?", game)) { + if (!player.chooseTarget(ability.getEffects().get(0).getOutcome(), newTarget, ability, game)) + newTarget.addTarget(targetId, ability, game, false); + } + else { + newTarget.addTarget(targetId, ability, game, false); + } + } + target.clearChosen(); + for (UUID newTargetId: newTarget.getTargets()) { + target.addTarget(newTargetId, ability, game, false); + } + } + return true; + } + return false; + } @Override - public SpellAbility getSpellAbility() { - return ability; - } + public void counter(UUID sourceId, Game game) { + card.moveToZone(Zone.GRAVEYARD, sourceId, game, false); + } - @Override - public void setControllerId(UUID controllerId) { + @Override + public UUID getSourceId() { + return card.getId(); + } + + @Override + public UUID getControllerId() { + return this.controllerId; + } + + @Override + public String getName() { + return card.getName(); + } + + @Override + public void setName(String name) {} + + @Override + public Rarity getRarity() { + return card.getRarity(); + } + + @Override + public void setRarity(Rarity rarity) {} + + @Override + public List getCardType() { + return card.getCardType(); + } + + @Override + public List getSubtype() { + return card.getSubtype(); + } + + @Override + public boolean hasSubtype(String subtype) { + return card.hasSubtype(subtype); + } + + @Override + public List getSupertype() { + return card.getSupertype(); + } + + @Override + public Abilities getAbilities() { + return card.getAbilities(); + } + + @Override + public ObjectColor getColor() { + return card.getColor(); + } + + @Override + public ManaCosts getManaCost() { + return card.getManaCost(); + } + + @Override + public MageInt getPower() { + return card.getPower(); + } + + @Override + public MageInt getToughness() { + return card.getToughness(); + } + + @Override + public UUID getId() { + return ability.getId(); + } + + @Override + public UUID getOwnerId() { + return card.getOwnerId(); + } + + @Override + public void addAbility(Ability ability) {} + + @Override + public void addWatcher(Watcher watcher) {} + + @Override + public SpellAbility getSpellAbility() { + return ability; + } + + @Override + public void setControllerId(UUID controllerId) { this.ability.setControllerId(controllerId); - this.controllerId = controllerId; - } - - @Override - public void setOwnerId(UUID controllerId) {} - - @Override - public List getRules() { - return card.getRules(); - } + this.controllerId = controllerId; + } @Override - public List getWatchers() { - return card.getWatchers(); - } + public void setOwnerId(UUID controllerId) {} - @Override - public String getExpansionSetCode() { - return card.getExpansionSetCode(); - } + @Override + public List getRules() { + return card.getRules(); + } - @Override - public void setExpansionSetCode(String expansionSetCode) {} + @Override + public List getWatchers() { + return card.getWatchers(); + } - @Override - public void setFaceDown(boolean value) { - throw new RuntimeException("Not implemented."); - } + @Override + public String getExpansionSetCode() { + return card.getExpansionSetCode(); + } - @Override - public boolean isFaceDown() { - return false; - } + @Override + public void setExpansionSetCode(String expansionSetCode) {} + + @Override + public void setFaceDown(boolean value) { + throw new RuntimeException("Not implemented."); + } + + @Override + public boolean isFaceDown() { + return false; + } @Override public boolean isFlipCard() { @@ -366,51 +366,51 @@ public class Spell> implements StackObject, Card { } @Override - public Spell copy() { - return new Spell(this); - } - - public Spell copySpell() { - return new Spell(this.card.copy(), this.ability.copySpell(), this.controllerId, this.fromZone); - } - - @Override - public void adjustCosts(Ability ability, Game game) {} - - @Override - public boolean moveToZone(Zone zone, UUID sourceId, Game game, boolean flag) { - throw new UnsupportedOperationException("Unsupported operation"); - } - - @Override - public boolean moveToExile(UUID exileId, String name, UUID sourceId, Game game) { - ZoneChangeEvent event = new ZoneChangeEvent(this.getId(), sourceId, this.getOwnerId(), Zone.STACK, Zone.EXILED); - if (!game.replaceEvent(event)) { - game.getStack().remove(this); - game.rememberLKI(this.getId(), event.getFromZone(), this); - - if (exileId == null) { - game.getExile().getPermanentExile().add(this.card); - } - else { - game.getExile().createZone(exileId, name).add(this.card); - } - game.setZone(this.card.getId(), event.getToZone()); - game.fireEvent(event); - return event.getToZone() == Zone.EXILED; - } - return false; + public Spell copy() { + return new Spell(this); } - @Override - public boolean putOntoBattlefield(Game game, Zone fromZone, UUID sourceId, UUID controllerId) { - throw new UnsupportedOperationException("Unsupported operation"); - } + public Spell copySpell() { + return new Spell(this.card.copy(), this.ability.copySpell(), this.controllerId, this.fromZone); + } - @Override - public int getCardNumber() { - return card.getCardNumber(); - } + @Override + public void adjustCosts(Ability ability, Game game) {} + + @Override + public boolean moveToZone(Zone zone, UUID sourceId, Game game, boolean flag) { + throw new UnsupportedOperationException("Unsupported operation"); + } + + @Override + public boolean moveToExile(UUID exileId, String name, UUID sourceId, Game game) { + ZoneChangeEvent event = new ZoneChangeEvent(this.getId(), sourceId, this.getOwnerId(), Zone.STACK, Zone.EXILED); + if (!game.replaceEvent(event)) { + game.getStack().remove(this); + game.rememberLKI(this.getId(), event.getFromZone(), this); + + if (exileId == null) { + game.getExile().getPermanentExile().add(this.card); + } + else { + game.getExile().createZone(exileId, name).add(this.card); + } + game.setZone(this.card.getId(), event.getToZone()); + game.fireEvent(event); + return event.getToZone() == Zone.EXILED; + } + return false; + } + + @Override + public boolean putOntoBattlefield(Game game, Zone fromZone, UUID sourceId, UUID controllerId) { + throw new UnsupportedOperationException("Unsupported operation"); + } + + @Override + public int getCardNumber() { + return card.getCardNumber(); + } @Override public void setCardNumber(int cid) { @@ -418,24 +418,24 @@ public class Spell> implements StackObject, Card { } @Override - public List getMana() { - return card.getMana(); - } + public List getMana() { + return card.getMana(); + } - @Override - public boolean cast(Game game, Zone fromZone, SpellAbility ability, UUID controllerId) { - throw new UnsupportedOperationException("Unsupported operation"); - } + @Override + public boolean cast(Game game, Zone fromZone, SpellAbility ability, UUID controllerId) { + throw new UnsupportedOperationException("Unsupported operation"); + } - @Override - public Ability getStackAbility() { - return this.ability; - } + @Override + public Ability getStackAbility() { + return this.ability; + } - @Override - public void assignNewId() { - throw new UnsupportedOperationException("Unsupported operation"); - } + @Override + public void assignNewId() { + throw new UnsupportedOperationException("Unsupported operation"); + } @Override public int getZoneChangeCounter() { @@ -448,12 +448,12 @@ public class Spell> implements StackObject, Card { } public void setCopiedSpell(boolean isCopied) { - this.copiedSpell = isCopied; - } + this.copiedSpell = isCopied; + } - public boolean isCopiedSpell() { - return this.copiedSpell; - } + public boolean isCopiedSpell() { + return this.copiedSpell; + } public Zone getFromZone() { return this.fromZone; diff --git a/Mage/src/mage/game/stack/SpellStack.java b/Mage/src/mage/game/stack/SpellStack.java index 359ba7c3cc..7af82de6b5 100644 --- a/Mage/src/mage/game/stack/SpellStack.java +++ b/Mage/src/mage/game/stack/SpellStack.java @@ -40,25 +40,25 @@ import mage.game.events.GameEvent; */ public class SpellStack extends ArrayDeque { - public SpellStack () {} + public SpellStack () {} - public SpellStack(final SpellStack stack) { - for (StackObject spell: stack) { - this.push(spell.copy()); - } - } + public SpellStack(final SpellStack stack) { + for (StackObject spell: stack) { + this.push(spell.copy()); + } + } - //resolve top StackObject - public void resolve(Game game) { - StackObject top = null; - try { - top = this.peek(); - top.resolve(game); - } finally { - if (top != null) - this.remove(top); - } - } + //resolve top StackObject + public void resolve(Game game) { + StackObject top = null; + try { + top = this.peek(); + top.resolve(game); + } finally { + if (top != null) + this.remove(top); + } + } public void remove(StackObject object) { for (StackObject spell: this) { @@ -68,49 +68,49 @@ public class SpellStack extends ArrayDeque { } } } - - public boolean counter(UUID objectId, UUID sourceId, Game game) { - StackObject stackObject = getStackObject(objectId); - if (stackObject != null) { - if (!game.replaceEvent(GameEvent.getEvent(GameEvent.EventType.COUNTER, objectId, sourceId, stackObject.getControllerId()))) { - if ( stackObject instanceof Spell ) { - game.rememberLKI(objectId, Zone.STACK, (Spell)stackObject); - } - this.remove(stackObject); - stackObject.counter(sourceId, game); - game.fireEvent(GameEvent.getEvent(GameEvent.EventType.COUNTERED, objectId, sourceId, stackObject.getControllerId())); - return true; - } - return false; - } - return false; - } - public StackObject getStackObject(UUID id) { - for (StackObject stackObject: this) { - UUID objectId = stackObject.getId(); - if (objectId.equals(id)) - return stackObject; - UUID sourceId = stackObject.getSourceId(); - if (sourceId.equals(id)) - return stackObject; - } - return null; - } + public boolean counter(UUID objectId, UUID sourceId, Game game) { + StackObject stackObject = getStackObject(objectId); + if (stackObject != null) { + if (!game.replaceEvent(GameEvent.getEvent(GameEvent.EventType.COUNTER, objectId, sourceId, stackObject.getControllerId()))) { + if ( stackObject instanceof Spell ) { + game.rememberLKI(objectId, Zone.STACK, (Spell)stackObject); + } + this.remove(stackObject); + stackObject.counter(sourceId, game); + game.fireEvent(GameEvent.getEvent(GameEvent.EventType.COUNTERED, objectId, sourceId, stackObject.getControllerId())); + return true; + } + return false; + } + return false; + } - public Spell getSpell(UUID id) { - for (StackObject stackObject: this) { - if (stackObject.getId().equals(id)) { - if (stackObject instanceof Spell) - return (Spell)stackObject; - else - return null; - } - } - return null; - } + public StackObject getStackObject(UUID id) { + for (StackObject stackObject: this) { + UUID objectId = stackObject.getId(); + if (objectId.equals(id)) + return stackObject; + UUID sourceId = stackObject.getSourceId(); + if (sourceId.equals(id)) + return stackObject; + } + return null; + } - public SpellStack copy() { - return new SpellStack(this); - } + public Spell getSpell(UUID id) { + for (StackObject stackObject: this) { + if (stackObject.getId().equals(id)) { + if (stackObject instanceof Spell) + return (Spell)stackObject; + else + return null; + } + } + return null; + } + + public SpellStack copy() { + return new SpellStack(this); + } } diff --git a/Mage/src/mage/game/stack/StackAbility.java b/Mage/src/mage/game/stack/StackAbility.java index a102dbc8e9..588e956667 100644 --- a/Mage/src/mage/game/stack/StackAbility.java +++ b/Mage/src/mage/game/stack/StackAbility.java @@ -60,279 +60,279 @@ import java.util.UUID; */ public class StackAbility implements StackObject, Ability { - private static List emptyList = new ArrayList(); - private static ObjectColor emptyColor = new ObjectColor(); - private static ManaCosts emptyCost = new ManaCostsImpl(); - private static Costs emptyCosts = new CostsImpl(); - private static Abilities emptyAbilites = new AbilitiesImpl(); + private static List emptyList = new ArrayList(); + private static ObjectColor emptyColor = new ObjectColor(); + private static ManaCosts emptyCost = new ManaCostsImpl(); + private static Costs emptyCosts = new CostsImpl(); + private static Abilities emptyAbilites = new AbilitiesImpl(); - private Ability ability; - private UUID controllerId; + private Ability ability; + private UUID controllerId; private String name = ""; private String expansionSetCode; - public StackAbility(Ability ability, UUID controllerId) { - this.ability = ability; - this.controllerId = controllerId; - } + public StackAbility(Ability ability, UUID controllerId) { + this.ability = ability; + this.controllerId = controllerId; + } - public StackAbility(final StackAbility spell) { - this.ability = spell.ability.copy(); - this.controllerId = spell.controllerId; + public StackAbility(final StackAbility spell) { + this.ability = spell.ability.copy(); + this.controllerId = spell.controllerId; this.name = spell.name; this.expansionSetCode = spell.expansionSetCode; - } + } - @Override - public boolean resolve(Game game) { - if (ability.getTargets().stillLegal(ability, game)) { - return ability.resolve(game); - } - counter(null, game); - return false; - } + @Override + public boolean resolve(Game game) { + if (ability.getTargets().stillLegal(ability, game)) { + return ability.resolve(game); + } + counter(null, game); + return false; + } - @Override - public void reset(Game game) { } - - @Override - public void counter(UUID sourceId, Game game) { - //20100716 - 603.8 - if (ability instanceof StateTriggeredAbility) { - ((StateTriggeredAbility)ability).counter(game); - } - } + @Override + public void reset(Game game) { } + + @Override + public void counter(UUID sourceId, Game game) { + //20100716 - 603.8 + if (ability instanceof StateTriggeredAbility) { + ((StateTriggeredAbility)ability).counter(game); + } + } + + @Override + public String getName() { + return name; + } - @Override - public String getName() { - return name; - } - public String getExpansionSetCode() { return expansionSetCode; } - @Override - public List getCardType() { - return emptyList; - } + @Override + public List getCardType() { + return emptyList; + } - @Override - public List getSubtype() { - return emptyList; - } + @Override + public List getSubtype() { + return emptyList; + } - @Override - public boolean hasSubtype(String subtype) { - return false; - } + @Override + public boolean hasSubtype(String subtype) { + return false; + } - @Override - public List getSupertype() { - return emptyList; - } + @Override + public List getSupertype() { + return emptyList; + } - @Override - public Abilities getAbilities() { - return emptyAbilites; - } + @Override + public Abilities getAbilities() { + return emptyAbilites; + } - @Override - public ObjectColor getColor() { - return emptyColor; - } + @Override + public ObjectColor getColor() { + return emptyColor; + } - @Override - public ManaCosts getManaCost() { - return emptyCost; - } + @Override + public ManaCosts getManaCost() { + return emptyCost; + } - @Override - public MageInt getPower() { - return MageInt.EmptyMageInt; - } + @Override + public MageInt getPower() { + return MageInt.EmptyMageInt; + } - @Override - public MageInt getToughness() { - return MageInt.EmptyMageInt; - } + @Override + public MageInt getToughness() { + return MageInt.EmptyMageInt; + } - @Override - public Zone getZone() { - return this.ability.getZone(); - } + @Override + public Zone getZone() { + return this.ability.getZone(); + } - @Override - public UUID getId() { - return this.ability.getId(); - } + @Override + public UUID getId() { + return this.ability.getId(); + } - @Override - public UUID getSourceId() { - return this.ability.getSourceId(); - } + @Override + public UUID getSourceId() { + return this.ability.getSourceId(); + } - @Override - public UUID getControllerId() { - return this.controllerId; - } + @Override + public UUID getControllerId() { + return this.controllerId; + } - @Override - public Costs getCosts() { - return emptyCosts; - } + @Override + public Costs getCosts() { + return emptyCosts; + } - @Override - public Effects getEffects() { - return ability.getEffects(); - } + @Override + public Effects getEffects() { + return ability.getEffects(); + } - @Override - public Effects getEffects(Game game, EffectType effectType) { - return ability.getEffects(game, effectType); - } + @Override + public Effects getEffects(Game game, EffectType effectType) { + return ability.getEffects(game, effectType); + } - @Override - public String getRule() { - return ability.getRule(); - } + @Override + public String getRule() { + return ability.getRule(); + } - @Override - public String getRule(boolean all) { - return ability.getRule(all); - } + @Override + public String getRule(boolean all) { + return ability.getRule(all); + } - @Override - public String getRule(String source) { - return ability.getRule(source); - } + @Override + public String getRule(String source) { + return ability.getRule(source); + } - @Override - public void setControllerId(UUID controllerId) { - this.controllerId = controllerId; - } + @Override + public void setControllerId(UUID controllerId) { + this.controllerId = controllerId; + } - @Override - public void setSourceId(UUID sourceID) {} + @Override + public void setSourceId(UUID sourceID) {} - @Override - public void addCost(Cost cost) {} + @Override + public void addCost(Cost cost) {} - @Override - public void addEffect(Effect effect) {} + @Override + public void addEffect(Effect effect) {} - @Override - public boolean activate(Game game, boolean noMana) { - return ability.activate(game, noMana); - } + @Override + public boolean activate(Game game, boolean noMana) { + return ability.activate(game, noMana); + } - @Override - public Targets getTargets() { - return ability.getTargets(); - } + @Override + public Targets getTargets() { + return ability.getTargets(); + } - @Override - public void addTarget(Target target) {} + @Override + public void addTarget(Target target) {} - @Override - public UUID getFirstTarget() { - return ability.getFirstTarget(); - } + @Override + public UUID getFirstTarget() { + return ability.getFirstTarget(); + } - @Override - public Choices getChoices() { - return ability.getChoices(); - } + @Override + public Choices getChoices() { + return ability.getChoices(); + } - @Override - public void addChoice(Choice choice) {} + @Override + public void addChoice(Choice choice) {} - @Override - public List getAlternativeCosts() { - return ability.getAlternativeCosts(); - } + @Override + public List getAlternativeCosts() { + return ability.getAlternativeCosts(); + } - @Override - public void addAlternativeCost(AlternativeCost cost) { } + @Override + public void addAlternativeCost(AlternativeCost cost) { } - @Override - public ManaCosts getManaCosts() { - return ability.getManaCosts(); - } + @Override + public ManaCosts getManaCosts() { + return ability.getManaCosts(); + } - @Override - public ManaCosts getManaCostsToPay ( ) { - return ability.getManaCostsToPay(); - } + @Override + public ManaCosts getManaCostsToPay ( ) { + return ability.getManaCostsToPay(); + } - @Override - public void addManaCost(ManaCost cost) { } + @Override + public void addManaCost(ManaCost cost) { } - @Override - public AbilityType getAbilityType() { - return ability.getAbilityType(); - } + @Override + public AbilityType getAbilityType() { + return ability.getAbilityType(); + } - @Override - public boolean isUsesStack() { - return true; - } + @Override + public boolean isUsesStack() { + return true; + } - @Override - public StackAbility copy() { - return new StackAbility(this); - } + @Override + public StackAbility copy() { + return new StackAbility(this); + } - @Override - public void setName(String name) { + @Override + public void setName(String name) { this.name = name; } - + public void setExpansionSetCode(String expansionSetCode) { this.expansionSetCode = expansionSetCode; } - @Override - public void adjustCosts(Ability ability, Game game) {} + @Override + public void adjustCosts(Ability ability, Game game) {} - @Override - public Costs getOptionalCosts() { - throw new UnsupportedOperationException("Not supported yet."); - } + @Override + public Costs getOptionalCosts() { + throw new UnsupportedOperationException("Not supported yet."); + } - @Override - public void addOptionalCost(Cost cost) {} + @Override + public void addOptionalCost(Cost cost) {} - @Override - public boolean checkIfClause(Game game) { - return true; - } + @Override + public boolean checkIfClause(Game game) { + return true; + } - @Override - public void newId() { + @Override + public void newId() { this.ability.newId(); } - @Override - public void newOriginalId() {} + @Override + public void newOriginalId() {} @Override - public Ability getStackAbility() { - return ability; - } + public Ability getStackAbility() { + return ability; + } - @Override - public boolean isModal() { - return ability.isModal(); - } + @Override + public boolean isModal() { + return ability.isModal(); + } - @Override - public void addMode(Mode mode) {} + @Override + public void addMode(Mode mode) {} - @Override - public Modes getModes() { - return ability.getModes(); - } + @Override + public Modes getModes() { + return ability.getModes(); + } @Override public boolean canChooseTarget(Game game) { diff --git a/Mage/src/mage/game/stack/StackObject.java b/Mage/src/mage/game/stack/StackObject.java index b3336545b0..f07e63092b 100644 --- a/Mage/src/mage/game/stack/StackObject.java +++ b/Mage/src/mage/game/stack/StackObject.java @@ -35,12 +35,12 @@ import mage.game.Game; public interface StackObject extends MageObject { -// public Card getCard(); - public boolean resolve(Game game); - public UUID getSourceId(); - public UUID getControllerId(); - public void counter(UUID sourceId, Game game); - public Ability getStackAbility(); - @Override - public StackObject copy(); +// public Card getCard(); + public boolean resolve(Game game); + public UUID getSourceId(); + public UUID getControllerId(); + public void counter(UUID sourceId, Game game); + public Ability getStackAbility(); + @Override + public StackObject copy(); } diff --git a/Mage/src/mage/game/tournament/LimitedOptions.java b/Mage/src/mage/game/tournament/LimitedOptions.java index 88f12f4a14..9983f3f2ed 100644 --- a/Mage/src/mage/game/tournament/LimitedOptions.java +++ b/Mage/src/mage/game/tournament/LimitedOptions.java @@ -38,10 +38,10 @@ import java.util.List; */ public class LimitedOptions implements Serializable { - protected List sets = new ArrayList(); + protected List sets = new ArrayList(); - public List getSetCodes() { - return sets; - } + public List getSetCodes() { + return sets; + } } diff --git a/Mage/src/mage/game/tournament/Round.java b/Mage/src/mage/game/tournament/Round.java index e75aefdc8a..7ea717cb83 100644 --- a/Mage/src/mage/game/tournament/Round.java +++ b/Mage/src/mage/game/tournament/Round.java @@ -38,40 +38,40 @@ import java.util.UUID; */ public class Round { - private int roundNum; - private List pairs = new ArrayList(); + private int roundNum; + private List pairs = new ArrayList(); - public Round(int roundNum) { - this.roundNum = roundNum; - } + public Round(int roundNum) { + this.roundNum = roundNum; + } - public void addPairing(TournamentPairing match) { - this.pairs.add(match); - } + public void addPairing(TournamentPairing match) { + this.pairs.add(match); + } - public TournamentPairing getPairing(UUID pairId) { - for (TournamentPairing pair: pairs) { - if (pair.getId().equals(pairId)) { - return pair; - } - } - return null; - } + public TournamentPairing getPairing(UUID pairId) { + for (TournamentPairing pair: pairs) { + if (pair.getId().equals(pairId)) { + return pair; + } + } + return null; + } - public List getPairs() { - return pairs; - } + public List getPairs() { + return pairs; + } - public int getRoundNumber() { - return this.roundNum; - } + public int getRoundNumber() { + return this.roundNum; + } - public boolean isRoundOver() { - for (TournamentPairing pair: pairs) { - if (!pair.getMatch().isMatchOver()) { - return false; - } - } - return true; - } + public boolean isRoundOver() { + for (TournamentPairing pair: pairs) { + if (!pair.getMatch().isMatchOver()) { + return false; + } + } + return true; + } } diff --git a/Mage/src/mage/game/tournament/Tournament.java b/Mage/src/mage/game/tournament/Tournament.java index 5a397e64e3..b9b36c396e 100644 --- a/Mage/src/mage/game/tournament/Tournament.java +++ b/Mage/src/mage/game/tournament/Tournament.java @@ -44,22 +44,22 @@ import mage.players.Player; */ public interface Tournament { - public UUID getId(); - public void addPlayer(Player player, String playerType); - public TournamentPlayer getPlayer(UUID playerId); - public Collection getPlayers(); - public Collection getRounds(); - public List getSets(); - public void submitDeck(UUID playerId, Deck deck); - public void updateDeck(UUID playerId, Deck deck); - public void autoSubmit(UUID playerId, Deck deck); - public boolean allJoined(); - public boolean isDoneConstructing(); - public void leave(UUID playerId); - public void nextStep(); + public UUID getId(); + public void addPlayer(Player player, String playerType); + public TournamentPlayer getPlayer(UUID playerId); + public Collection getPlayers(); + public Collection getRounds(); + public List getSets(); + public void submitDeck(UUID playerId, Deck deck); + public void updateDeck(UUID playerId, Deck deck); + public void autoSubmit(UUID playerId, Deck deck); + public boolean allJoined(); + public boolean isDoneConstructing(); + public void leave(UUID playerId); + public void nextStep(); + + public void addTableEventListener(Listener listener); + public void addPlayerQueryEventListener(Listener listener); + public void fireConstructEvent(UUID playerId); - public void addTableEventListener(Listener listener); - public void addPlayerQueryEventListener(Listener listener); - public void fireConstructEvent(UUID playerId); - } diff --git a/Mage/src/mage/game/tournament/TournamentImpl.java b/Mage/src/mage/game/tournament/TournamentImpl.java index 09f4de85dc..ad25b506a2 100644 --- a/Mage/src/mage/game/tournament/TournamentImpl.java +++ b/Mage/src/mage/game/tournament/TournamentImpl.java @@ -55,225 +55,225 @@ import org.apache.log4j.Logger; */ public abstract class TournamentImpl implements Tournament { - protected UUID id = UUID.randomUUID(); - protected List rounds = new CopyOnWriteArrayList(); - protected Map players = new HashMap(); + protected UUID id = UUID.randomUUID(); + protected List rounds = new CopyOnWriteArrayList(); + protected Map players = new HashMap(); protected static Random rnd = new Random(); - protected String matchName; - protected TournamentOptions options; - protected List sets = new ArrayList(); + protected String matchName; + protected TournamentOptions options; + protected List sets = new ArrayList(); - protected TableEventSource tableEventSource = new TableEventSource(); - protected PlayerQueryEventSource playerQueryEventSource = new PlayerQueryEventSource(); + protected TableEventSource tableEventSource = new TableEventSource(); + protected PlayerQueryEventSource playerQueryEventSource = new PlayerQueryEventSource(); - private static final int CONSTRUCT_TIME = 600; + private static final int CONSTRUCT_TIME = 600; - public TournamentImpl(TournamentOptions options) { - this.options = options; - } + public TournamentImpl(TournamentOptions options) { + this.options = options; + } - @Override - public UUID getId() { - return id; - } + @Override + public UUID getId() { + return id; + } - @Override - public void addPlayer(Player player, String playerType) { - players.put(player.getId(), new TournamentPlayer(player, playerType)); - } + @Override + public void addPlayer(Player player, String playerType) { + players.put(player.getId(), new TournamentPlayer(player, playerType)); + } - @Override - public TournamentPlayer getPlayer(UUID playerId) { - return players.get(playerId); - } + @Override + public TournamentPlayer getPlayer(UUID playerId) { + return players.get(playerId); + } - @Override - public void autoSubmit(UUID playerId, Deck deck) { - if (players.containsKey(playerId)) { - players.get(playerId).submitDeck(deck); - } - } + @Override + public void autoSubmit(UUID playerId, Deck deck) { + if (players.containsKey(playerId)) { + players.get(playerId).submitDeck(deck); + } + } - @Override - public Collection getPlayers() { - return players.values(); - } + @Override + public Collection getPlayers() { + return players.values(); + } - @Override - public Collection getRounds() { - return rounds; - } + @Override + public Collection getRounds() { + return rounds; + } - @Override - public List getSets() { - return sets; - } - - @Override - public void leave(UUID playerId) { - //TODO: implement this - } + @Override + public List getSets() { + return sets; + } - @Override - public void submitDeck(UUID playerId, Deck deck) { - if (players.containsKey(playerId)) { - players.get(playerId).submitDeck(deck); - } - synchronized (this) { - this.notifyAll(); - } - } + @Override + public void leave(UUID playerId) { + //TODO: implement this + } - @Override - public void updateDeck(UUID playerId, Deck deck) { - if (players.containsKey(playerId)) { - players.get(playerId).updateDeck(deck); - } - } + @Override + public void submitDeck(UUID playerId, Deck deck) { + if (players.containsKey(playerId)) { + players.get(playerId).submitDeck(deck); + } + synchronized (this) { + this.notifyAll(); + } + } + + @Override + public void updateDeck(UUID playerId, Deck deck) { + if (players.containsKey(playerId)) { + players.get(playerId).updateDeck(deck); + } + } protected Round createRoundRandom() { - Round round = new Round(rounds.size() + 1); - rounds.add(round); - List roundPlayers = getActivePlayers(); - while (roundPlayers.size() > 1) { - int i = rnd.nextInt(roundPlayers.size()); - TournamentPlayer player1 = roundPlayers.get(i); - roundPlayers.remove(i); - i = rnd.nextInt(roundPlayers.size()); - TournamentPlayer player2 = roundPlayers.get(i); - roundPlayers.remove(i); - round.addPairing(new TournamentPairing(player1, player2)); - } - return round; - } + Round round = new Round(rounds.size() + 1); + rounds.add(round); + List roundPlayers = getActivePlayers(); + while (roundPlayers.size() > 1) { + int i = rnd.nextInt(roundPlayers.size()); + TournamentPlayer player1 = roundPlayers.get(i); + roundPlayers.remove(i); + i = rnd.nextInt(roundPlayers.size()); + TournamentPlayer player2 = roundPlayers.get(i); + roundPlayers.remove(i); + round.addPairing(new TournamentPairing(player1, player2)); + } + return round; + } - protected void playRound(Round round) { - for (TournamentPairing pair: round.getPairs()) { - playMatch(pair); - } + protected void playRound(Round round) { + for (TournamentPairing pair: round.getPairs()) { + playMatch(pair); + } - while (!round.isRoundOver()) { - try { - //TODO: improve this - Thread.sleep(1000); - } catch (InterruptedException ex) { - Logger.getLogger(TournamentImpl.class).warn("TournamentImpl playRound error ", ex); - break; - } - } - updateResults(); - } + while (!round.isRoundOver()) { + try { + //TODO: improve this + Thread.sleep(1000); + } catch (InterruptedException ex) { + Logger.getLogger(TournamentImpl.class).warn("TournamentImpl playRound error ", ex); + break; + } + } + updateResults(); + } - protected List getActivePlayers() { - List activePlayers = new ArrayList(); - for (TournamentPlayer player: players.values()) { - if (!player.getEliminated()) { - activePlayers.add(player); - } - } - return activePlayers; - } + protected List getActivePlayers() { + List activePlayers = new ArrayList(); + for (TournamentPlayer player: players.values()) { + if (!player.getEliminated()) { + activePlayers.add(player); + } + } + return activePlayers; + } - protected void updateResults() { - for (TournamentPlayer player: players.values()) { - player.setResults(""); - } - for (Round round: rounds) { - for (TournamentPairing pair: round.getPairs()) { - UUID player1Id = pair.getPlayer1().getPlayer().getId(); - UUID player2Id = pair.getPlayer2().getPlayer().getId(); - Match match = pair.getMatch(); - StringBuilder sb1 = new StringBuilder(players.get(player1Id).getResults()); - StringBuilder sb2 = new StringBuilder(players.get(player2Id).getResults()); - sb1.append(pair.getPlayer2().getPlayer().getName()); - sb1.append(" (").append(match.getPlayer(player1Id).getWins()); - sb1.append("-").append(match.getPlayer(player2Id).getWins()).append(") "); - sb2.append(pair.getPlayer1().getPlayer().getName()); - sb2.append(" (").append(match.getPlayer(player2Id).getWins()); - sb2.append("-").append(match.getPlayer(player1Id).getWins()).append(") "); - players.get(player1Id).setResults(sb1.toString()); - players.get(player2Id).setResults(sb2.toString()); - } - } + protected void updateResults() { + for (TournamentPlayer player: players.values()) { + player.setResults(""); + } + for (Round round: rounds) { + for (TournamentPairing pair: round.getPairs()) { + UUID player1Id = pair.getPlayer1().getPlayer().getId(); + UUID player2Id = pair.getPlayer2().getPlayer().getId(); + Match match = pair.getMatch(); + StringBuilder sb1 = new StringBuilder(players.get(player1Id).getResults()); + StringBuilder sb2 = new StringBuilder(players.get(player2Id).getResults()); + sb1.append(pair.getPlayer2().getPlayer().getName()); + sb1.append(" (").append(match.getPlayer(player1Id).getWins()); + sb1.append("-").append(match.getPlayer(player2Id).getWins()).append(") "); + sb2.append(pair.getPlayer1().getPlayer().getName()); + sb2.append(" (").append(match.getPlayer(player2Id).getWins()); + sb2.append("-").append(match.getPlayer(player1Id).getWins()).append(") "); + players.get(player1Id).setResults(sb1.toString()); + players.get(player2Id).setResults(sb2.toString()); + } + } - } + } - @Override - public boolean isDoneConstructing() { - for (TournamentPlayer player: this.players.values()) { - if (!player.isDoneConstructing()) - return false; - } - return true; - } + @Override + public boolean isDoneConstructing() { + for (TournamentPlayer player: this.players.values()) { + if (!player.isDoneConstructing()) + return false; + } + return true; + } - @Override - public boolean allJoined() { - for (TournamentPlayer player: this.players.values()) { - if (!player.isJoined()) - return false; - } - return true; - } + @Override + public boolean allJoined() { + for (TournamentPlayer player: this.players.values()) { + if (!player.isJoined()) + return false; + } + return true; + } - @Override - public void addTableEventListener(Listener listener) { - tableEventSource.addListener(listener); - } + @Override + public void addTableEventListener(Listener listener) { + tableEventSource.addListener(listener); + } - @Override - public void addPlayerQueryEventListener(Listener listener) { - playerQueryEventSource.addListener(listener); - } + @Override + public void addPlayerQueryEventListener(Listener listener) { + playerQueryEventSource.addListener(listener); + } - @Override - public void fireConstructEvent(UUID playerId) { - TournamentPlayer player = players.get(playerId); - playerQueryEventSource.construct(playerId, "Construct", CONSTRUCT_TIME); - } + @Override + public void fireConstructEvent(UUID playerId) { + TournamentPlayer player = players.get(playerId); + playerQueryEventSource.construct(playerId, "Construct", CONSTRUCT_TIME); + } - public void construct() { - tableEventSource.fireTableEvent(EventType.CONSTRUCT); - for (final TournamentPlayer player: players.values()) { - player.setConstructing(); - new Thread( - new Runnable() { - public void run() { - player.getPlayer().construct(TournamentImpl.this, player.getDeck()); - } - } - ).start(); - } - synchronized(this) { - while (!isDoneConstructing()) { - try { - this.wait(); - } catch (InterruptedException ex) { } - } - } - nextStep(); - } + public void construct() { + tableEventSource.fireTableEvent(EventType.CONSTRUCT); + for (final TournamentPlayer player: players.values()) { + player.setConstructing(); + new Thread( + new Runnable() { + public void run() { + player.getPlayer().construct(TournamentImpl.this, player.getDeck()); + } + } + ).start(); + } + synchronized(this) { + while (!isDoneConstructing()) { + try { + this.wait(); + } catch (InterruptedException ex) { } + } + } + nextStep(); + } - protected void openBoosters() { - for (TournamentPlayer player: this.players.values()) { - player.setDeck(new Deck()); - for (ExpansionSet set: sets) { - List booster = set.createBooster(); - for (Card card: booster) { - player.getDeck().getSideboard().add(card); - } - } - } - nextStep(); - } + protected void openBoosters() { + for (TournamentPlayer player: this.players.values()) { + player.setDeck(new Deck()); + for (ExpansionSet set: sets) { + List booster = set.createBooster(); + for (Card card: booster) { + player.getDeck().getSideboard().add(card); + } + } + } + nextStep(); + } - public void playMatch(TournamentPairing pair) { - options.getMatchOptions().getPlayerTypes().clear(); - options.getMatchOptions().getPlayerTypes().add(pair.getPlayer1().getPlayerType()); - options.getMatchOptions().getPlayerTypes().add(pair.getPlayer2().getPlayerType()); - tableEventSource.fireTableEvent(EventType.START_MATCH, pair, options.getMatchOptions()); - } + public void playMatch(TournamentPairing pair) { + options.getMatchOptions().getPlayerTypes().clear(); + options.getMatchOptions().getPlayerTypes().add(pair.getPlayer1().getPlayerType()); + options.getMatchOptions().getPlayerTypes().add(pair.getPlayer2().getPlayerType()); + tableEventSource.fireTableEvent(EventType.START_MATCH, pair, options.getMatchOptions()); + } - protected abstract void runTournament(); + protected abstract void runTournament(); } diff --git a/Mage/src/mage/game/tournament/TournamentOptions.java b/Mage/src/mage/game/tournament/TournamentOptions.java index 141fc6e290..70a23ab7f1 100644 --- a/Mage/src/mage/game/tournament/TournamentOptions.java +++ b/Mage/src/mage/game/tournament/TournamentOptions.java @@ -39,42 +39,42 @@ import mage.game.match.MatchOptions; */ public class TournamentOptions implements Serializable { - protected String name; - protected String tournamentType; - protected List playerTypes = new ArrayList(); - protected MatchOptions matchOptions = new MatchOptions("", "Two Player Duel"); - protected LimitedOptions limitedOptions; + protected String name; + protected String tournamentType; + protected List playerTypes = new ArrayList(); + protected MatchOptions matchOptions = new MatchOptions("", "Two Player Duel"); + protected LimitedOptions limitedOptions; - public TournamentOptions(String name) { - this.name = name; - } + public TournamentOptions(String name) { + this.name = name; + } - public String getName() { - return name; - } + public String getName() { + return name; + } - public String getTournamentType() { - return tournamentType; - } + public String getTournamentType() { + return tournamentType; + } - public void setTournamentType(String tournamentType) { - this.tournamentType = tournamentType; - } + public void setTournamentType(String tournamentType) { + this.tournamentType = tournamentType; + } - public List getPlayerTypes() { - return playerTypes; - } + public List getPlayerTypes() { + return playerTypes; + } - public MatchOptions getMatchOptions() { - return matchOptions; - } + public MatchOptions getMatchOptions() { + return matchOptions; + } - public void setLimitedOptions(LimitedOptions limitedOptions) { - this.limitedOptions = limitedOptions; - } + public void setLimitedOptions(LimitedOptions limitedOptions) { + this.limitedOptions = limitedOptions; + } - public LimitedOptions getLimitedOptions() { - return limitedOptions; - } + public LimitedOptions getLimitedOptions() { + return limitedOptions; + } } diff --git a/Mage/src/mage/game/tournament/TournamentPairing.java b/Mage/src/mage/game/tournament/TournamentPairing.java index 818e2a5540..b1c76da2d0 100644 --- a/Mage/src/mage/game/tournament/TournamentPairing.java +++ b/Mage/src/mage/game/tournament/TournamentPairing.java @@ -37,42 +37,42 @@ import mage.game.match.Match; */ public class TournamentPairing { - UUID id = UUID.randomUUID(); - Match match; - TournamentPlayer player1; - TournamentPlayer player2; + UUID id = UUID.randomUUID(); + Match match; + TournamentPlayer player1; + TournamentPlayer player2; - public TournamentPairing(TournamentPlayer player1, TournamentPlayer player2) { - this.player1 = player1; - this.player2 = player2; - } + public TournamentPairing(TournamentPlayer player1, TournamentPlayer player2) { + this.player1 = player1; + this.player2 = player2; + } - public UUID getId() { - return id; - } + public UUID getId() { + return id; + } - public TournamentPlayer getPlayer1() { - return this.player1; - } + public TournamentPlayer getPlayer1() { + return this.player1; + } - public TournamentPlayer getPlayer2() { - return this.player2; - } + public TournamentPlayer getPlayer2() { + return this.player2; + } - public Match getMatch() { - return match; - } + public Match getMatch() { + return match; + } - public void setMatch(Match match) { - this.match = match; - } + public void setMatch(Match match) { + this.match = match; + } - public void eliminatePlayers() { - if (match.getPlayer(player1.getPlayer().getId()).getWins() < match.getWinsNeeded()) { - player1.setEliminated(); - } - if (match.getPlayer(player2.getPlayer().getId()).getWins() < match.getWinsNeeded()) { - player2.setEliminated(); - } - } + public void eliminatePlayers() { + if (match.getPlayer(player1.getPlayer().getId()).getWins() < match.getWinsNeeded()) { + player1.setEliminated(); + } + if (match.getPlayer(player2.getPlayer().getId()).getWins() < match.getWinsNeeded()) { + player2.setEliminated(); + } + } } diff --git a/Mage/src/mage/game/tournament/TournamentPlayer.java b/Mage/src/mage/game/tournament/TournamentPlayer.java index 0c361eb740..de9934590c 100644 --- a/Mage/src/mage/game/tournament/TournamentPlayer.java +++ b/Mage/src/mage/game/tournament/TournamentPlayer.java @@ -38,69 +38,69 @@ import mage.players.Player; */ public class TournamentPlayer { - protected int points; - protected String name; - protected String playerType; - protected Player player; - protected Deck deck; - protected String results = ""; - protected boolean eliminated = false; - protected boolean doneConstructing; - protected boolean joined = false; + protected int points; + protected String name; + protected String playerType; + protected Player player; + protected Deck deck; + protected String results = ""; + protected boolean eliminated = false; + protected boolean doneConstructing; + protected boolean joined = false; - public TournamentPlayer(Player player, String playerType) { - this.player = player; - this.playerType = playerType; - } + public TournamentPlayer(Player player, String playerType) { + this.player = player; + this.playerType = playerType; + } - public Player getPlayer() { - return player; - } + public Player getPlayer() { + return player; + } - public String getPlayerType() { - return playerType; - } + public String getPlayerType() { + return playerType; + } - public Deck getDeck() { - return deck; - } + public Deck getDeck() { + return deck; + } - public int getPoints() { - return points; - } + public int getPoints() { + return points; + } - public void setPoints(int points) { - this.points = points; - } + public void setPoints(int points) { + this.points = points; + } - public boolean getEliminated() { - return eliminated; - } + public boolean getEliminated() { + return eliminated; + } - public void setEliminated() { - this.eliminated = true; - } + public void setEliminated() { + this.eliminated = true; + } - public boolean isJoined() { - return joined; - } + public boolean isJoined() { + return joined; + } - public void setJoined() { - this.joined = true; - } + public void setJoined() { + this.joined = true; + } - public void setConstructing() { - this.doneConstructing = false; - } + public void setConstructing() { + this.doneConstructing = false; + } - public void submitDeck(Deck deck) { - this.deck = deck; - this.doneConstructing = true; - } + public void submitDeck(Deck deck) { + this.deck = deck; + this.doneConstructing = true; + } - public void updateDeck(Deck deck) { - this.deck = deck; - } + public void updateDeck(Deck deck) { + this.deck = deck; + } public Deck generateDeck() { //TODO: improve this @@ -111,20 +111,20 @@ public class TournamentPlayer { } return deck; } - - public boolean isDoneConstructing() { - return this.doneConstructing; - } - public void setDeck(Deck deck) { - this.deck = deck; - } + public boolean isDoneConstructing() { + return this.doneConstructing; + } - public String getResults() { - return this.results; - } + public void setDeck(Deck deck) { + this.deck = deck; + } - public void setResults(String results) { - this.results = results; - } + public String getResults() { + return this.results; + } + + public void setResults(String results) { + this.results = results; + } } diff --git a/Mage/src/mage/game/tournament/TournamentSealedOptions.java b/Mage/src/mage/game/tournament/TournamentSealedOptions.java index 4d9628ea69..586894a81c 100644 --- a/Mage/src/mage/game/tournament/TournamentSealedOptions.java +++ b/Mage/src/mage/game/tournament/TournamentSealedOptions.java @@ -34,8 +34,8 @@ package mage.game.tournament; */ public class TournamentSealedOptions extends TournamentOptions { - public TournamentSealedOptions(String name) { - super(name); - } + public TournamentSealedOptions(String name) { + super(name); + } } diff --git a/Mage/src/mage/game/tournament/TournamentSingleElimination.java b/Mage/src/mage/game/tournament/TournamentSingleElimination.java index ed018b7b5f..a2b35c3b7e 100644 --- a/Mage/src/mage/game/tournament/TournamentSingleElimination.java +++ b/Mage/src/mage/game/tournament/TournamentSingleElimination.java @@ -34,25 +34,25 @@ package mage.game.tournament; */ public abstract class TournamentSingleElimination extends TournamentImpl { - public TournamentSingleElimination(TournamentOptions options) { - super(options); - } + public TournamentSingleElimination(TournamentOptions options) { + super(options); + } - @Override - protected void runTournament() { - while (this.getActivePlayers().size() > 1) { - Round round = createRoundRandom(); - playRound(round); - eliminatePlayers(round); - } - nextStep(); - } + @Override + protected void runTournament() { + while (this.getActivePlayers().size() > 1) { + Round round = createRoundRandom(); + playRound(round); + eliminatePlayers(round); + } + nextStep(); + } - private void eliminatePlayers(Round round) { - for (TournamentPairing pair: round.getPairs()) { - pair.eliminatePlayers(); - } - } + private void eliminatePlayers(Round round) { + for (TournamentPairing pair: round.getPairs()) { + pair.eliminatePlayers(); + } + } } diff --git a/Mage/src/mage/game/tournament/TournamentSwiss.java b/Mage/src/mage/game/tournament/TournamentSwiss.java index 6b3c2a1407..a93a13c171 100644 --- a/Mage/src/mage/game/tournament/TournamentSwiss.java +++ b/Mage/src/mage/game/tournament/TournamentSwiss.java @@ -33,13 +33,13 @@ package mage.game.tournament; */ public abstract class TournamentSwiss extends TournamentImpl { - public TournamentSwiss(TournamentOptions options) { - super(options); - } + public TournamentSwiss(TournamentOptions options) { + super(options); + } - @Override - protected void runTournament() { - //TODO: implement this - } + @Override + protected void runTournament() { + //TODO: implement this + } } diff --git a/Mage/src/mage/game/tournament/TournamentType.java b/Mage/src/mage/game/tournament/TournamentType.java index 11a40c015e..d367c4957e 100644 --- a/Mage/src/mage/game/tournament/TournamentType.java +++ b/Mage/src/mage/game/tournament/TournamentType.java @@ -36,41 +36,41 @@ import java.io.Serializable; */ public class TournamentType > implements Serializable { - protected String name; - protected int minPlayers; - protected int maxPlayers; - protected int numBoosters; - protected boolean draft; - protected boolean limited; + protected String name; + protected int minPlayers; + protected int maxPlayers; + protected int numBoosters; + protected boolean draft; + protected boolean limited; - protected TournamentType() {} + protected TournamentType() {} - @Override - public String toString() { - return name; - } + @Override + public String toString() { + return name; + } - public String getName() { - return name; - } + public String getName() { + return name; + } - public int getMinPlayers() { - return minPlayers; - } + public int getMinPlayers() { + return minPlayers; + } - public int getMaxPlayers() { - return maxPlayers; - } + public int getMaxPlayers() { + return maxPlayers; + } - public int getNumBoosters() { - return numBoosters; - } + public int getNumBoosters() { + return numBoosters; + } - public boolean isDraft() { - return draft; - } + public boolean isDraft() { + return draft; + } - public boolean isLimited() { - return limited; - } + public boolean isLimited() { + return limited; + } } diff --git a/Mage/src/mage/game/turn/BeginCombatStep.java b/Mage/src/mage/game/turn/BeginCombatStep.java index 38aa32beca..eadc8594ec 100644 --- a/Mage/src/mage/game/turn/BeginCombatStep.java +++ b/Mage/src/mage/game/turn/BeginCombatStep.java @@ -39,29 +39,29 @@ import mage.game.events.GameEvent.EventType; */ public class BeginCombatStep extends Step { - public BeginCombatStep() { - super(PhaseStep.BEGIN_COMBAT, true); - this.stepEvent = EventType.BEGIN_COMBAT_STEP; - this.preStepEvent = EventType.BEGIN_COMBAT_STEP_PRE; - this.postStepEvent = EventType.BEGIN_COMBAT_STEP_POST; - } + public BeginCombatStep() { + super(PhaseStep.BEGIN_COMBAT, true); + this.stepEvent = EventType.BEGIN_COMBAT_STEP; + this.preStepEvent = EventType.BEGIN_COMBAT_STEP_PRE; + this.postStepEvent = EventType.BEGIN_COMBAT_STEP_POST; + } - public BeginCombatStep(final BeginCombatStep step) { - super(step); - } + public BeginCombatStep(final BeginCombatStep step) { + super(step); + } - @Override - public void beginStep(Game game, UUID activePlayerId) { - //20091005 - 507.1 - game.getCombat().clear(); - game.getCombat().setAttacker(activePlayerId); - game.getCombat().setDefenders(game); - super.beginStep(game, activePlayerId); - } + @Override + public void beginStep(Game game, UUID activePlayerId) { + //20091005 - 507.1 + game.getCombat().clear(); + game.getCombat().setAttacker(activePlayerId); + game.getCombat().setDefenders(game); + super.beginStep(game, activePlayerId); + } - @Override - public BeginCombatStep copy() { - return new BeginCombatStep(this); - } + @Override + public BeginCombatStep copy() { + return new BeginCombatStep(this); + } } diff --git a/Mage/src/mage/game/turn/BeginningPhase.java b/Mage/src/mage/game/turn/BeginningPhase.java index eb511cbbe0..8c1df77332 100644 --- a/Mage/src/mage/game/turn/BeginningPhase.java +++ b/Mage/src/mage/game/turn/BeginningPhase.java @@ -39,30 +39,30 @@ import mage.game.events.GameEvent.EventType; */ public class BeginningPhase extends Phase { - public BeginningPhase() { - this.type = TurnPhase.BEGINNING; - this.event = EventType.BEGINNING_PHASE; - this.preEvent = EventType.BEGINNING_PHASE_PRE; - this.postEvent = EventType.BEGINNING_PHASE_POST; - this.steps.add(new UntapStep()); - this.steps.add(new UpkeepStep()); - this.steps.add(new DrawStep()); - } + public BeginningPhase() { + this.type = TurnPhase.BEGINNING; + this.event = EventType.BEGINNING_PHASE; + this.preEvent = EventType.BEGINNING_PHASE_PRE; + this.postEvent = EventType.BEGINNING_PHASE_POST; + this.steps.add(new UntapStep()); + this.steps.add(new UpkeepStep()); + this.steps.add(new DrawStep()); + } @Override - public boolean beginPhase(Game game, UUID activePlayerId) { + public boolean beginPhase(Game game, UUID activePlayerId) { game.getBattlefield().beginningOfTurn(game); return super.beginPhase(game, activePlayerId); - } - - - public BeginningPhase(final BeginningPhase phase) { - super(phase); - } + } - @Override - public BeginningPhase copy() { - return new BeginningPhase(this); - } + + public BeginningPhase(final BeginningPhase phase) { + super(phase); + } + + @Override + public BeginningPhase copy() { + return new BeginningPhase(this); + } } diff --git a/Mage/src/mage/game/turn/CleanupStep.java b/Mage/src/mage/game/turn/CleanupStep.java index 6d3f60b738..a2545866a7 100644 --- a/Mage/src/mage/game/turn/CleanupStep.java +++ b/Mage/src/mage/game/turn/CleanupStep.java @@ -40,35 +40,35 @@ import mage.players.Player; */ public class CleanupStep extends Step { - public CleanupStep() { - super(PhaseStep.CLEANUP, true); - this.stepEvent = EventType.CLEANUP_STEP; - this.preStepEvent = EventType.CLEANUP_STEP_PRE; - this.postStepEvent = EventType.CLEANUP_STEP_POST; - } + public CleanupStep() { + super(PhaseStep.CLEANUP, true); + this.stepEvent = EventType.CLEANUP_STEP; + this.preStepEvent = EventType.CLEANUP_STEP_PRE; + this.postStepEvent = EventType.CLEANUP_STEP_POST; + } - public CleanupStep(final CleanupStep step) { - super(step); - } + public CleanupStep(final CleanupStep step) { + super(step); + } - @Override - public void beginStep(Game game, UUID activePlayerId) { - super.beginStep(game, activePlayerId); - Player activePlayer = game.getPlayer(activePlayerId); - game.getState().setPriorityPlayerId(activePlayer.getId()); - //20091005 - 514.1 - if (!activePlayer.hasLeft() && !activePlayer.hasLost()) { - activePlayer.discardToMax(game); - activePlayer.setGameUnderYourControl(true); - } - //20100423 - 514.2 - game.getBattlefield().endOfTurn(activePlayerId, game); - game.getState().removeEotEffects(game); - } + @Override + public void beginStep(Game game, UUID activePlayerId) { + super.beginStep(game, activePlayerId); + Player activePlayer = game.getPlayer(activePlayerId); + game.getState().setPriorityPlayerId(activePlayer.getId()); + //20091005 - 514.1 + if (!activePlayer.hasLeft() && !activePlayer.hasLost()) { + activePlayer.discardToMax(game); + activePlayer.setGameUnderYourControl(true); + } + //20100423 - 514.2 + game.getBattlefield().endOfTurn(activePlayerId, game); + game.getState().removeEotEffects(game); + } - @Override - public CleanupStep copy() { - return new CleanupStep(this); - } + @Override + public CleanupStep copy() { + return new CleanupStep(this); + } } diff --git a/Mage/src/mage/game/turn/CombatDamageStep.java b/Mage/src/mage/game/turn/CombatDamageStep.java index d8216f7891..3ee5faab92 100644 --- a/Mage/src/mage/game/turn/CombatDamageStep.java +++ b/Mage/src/mage/game/turn/CombatDamageStep.java @@ -40,50 +40,50 @@ import mage.game.events.GameEvent.EventType; */ public class CombatDamageStep extends Step { - public CombatDamageStep() { - super(PhaseStep.COMBAT_DAMAGE, true); - this.stepEvent = EventType.COMBAT_DAMAGE_STEP; - this.preStepEvent = EventType.COMBAT_DAMAGE_STEP_PRE; - this.postStepEvent = EventType.COMBAT_DAMAGE_STEP_POST; - } + public CombatDamageStep() { + super(PhaseStep.COMBAT_DAMAGE, true); + this.stepEvent = EventType.COMBAT_DAMAGE_STEP; + this.preStepEvent = EventType.COMBAT_DAMAGE_STEP_PRE; + this.postStepEvent = EventType.COMBAT_DAMAGE_STEP_POST; + } - public CombatDamageStep(final CombatDamageStep step) { - super(step); - } + public CombatDamageStep(final CombatDamageStep step) { + super(step); + } - @Override - public boolean skipStep(Game game, UUID activePlayerId) { - if (game.getCombat().noAttackers()) - return true; - return super.skipStep(game, activePlayerId); - } + @Override + public boolean skipStep(Game game, UUID activePlayerId) { + if (game.getCombat().noAttackers()) + return true; + return super.skipStep(game, activePlayerId); + } - @Override - public void beginStep(Game game, UUID activePlayerId) { - super.beginStep(game, activePlayerId); - for (CombatGroup group: game.getCombat().getGroups()) { - group.assignDamageToBlockers(false, game); - } - for (CombatGroup group : game.getCombat().getBlockingGroups()) { - group.assignDamageToAttackers(false, game); - } + @Override + public void beginStep(Game game, UUID activePlayerId) { + super.beginStep(game, activePlayerId); + for (CombatGroup group: game.getCombat().getGroups()) { + group.assignDamageToBlockers(false, game); + } + for (CombatGroup group : game.getCombat().getBlockingGroups()) { + group.assignDamageToAttackers(false, game); + } - for (CombatGroup group: game.getCombat().getGroups()) { - group.applyDamage(game); - } + for (CombatGroup group: game.getCombat().getGroups()) { + group.applyDamage(game); + } - for (CombatGroup group : game.getCombat().getBlockingGroups()) { - group.applyDamage(game); - } - } + for (CombatGroup group : game.getCombat().getBlockingGroups()) { + group.applyDamage(game); + } + } - public boolean getFirst() { - return false; - } + public boolean getFirst() { + return false; + } - @Override - public CombatDamageStep copy() { - return new CombatDamageStep(this); - } + @Override + public CombatDamageStep copy() { + return new CombatDamageStep(this); + } } diff --git a/Mage/src/mage/game/turn/CombatPhase.java b/Mage/src/mage/game/turn/CombatPhase.java index f0b0421648..3a954f93e8 100644 --- a/Mage/src/mage/game/turn/CombatPhase.java +++ b/Mage/src/mage/game/turn/CombatPhase.java @@ -37,26 +37,26 @@ import mage.game.events.GameEvent.EventType; */ public class CombatPhase extends Phase { - public CombatPhase() { - this.type = TurnPhase.COMBAT; - this.event = EventType.COMBAT_PHASE; - this.preEvent = EventType.COMBAT_PHASE_PRE; - this.postEvent = EventType.COMBAT_PHASE_POST; - this.steps.add(new BeginCombatStep()); - this.steps.add(new DeclareAttackersStep()); - this.steps.add(new DeclareBlockersStep()); - this.steps.add(new FirstCombatDamageStep()); - this.steps.add(new CombatDamageStep()); - this.steps.add(new EndOfCombatStep()); - } + public CombatPhase() { + this.type = TurnPhase.COMBAT; + this.event = EventType.COMBAT_PHASE; + this.preEvent = EventType.COMBAT_PHASE_PRE; + this.postEvent = EventType.COMBAT_PHASE_POST; + this.steps.add(new BeginCombatStep()); + this.steps.add(new DeclareAttackersStep()); + this.steps.add(new DeclareBlockersStep()); + this.steps.add(new FirstCombatDamageStep()); + this.steps.add(new CombatDamageStep()); + this.steps.add(new EndOfCombatStep()); + } - public CombatPhase(final CombatPhase phase) { - super(phase); - } + public CombatPhase(final CombatPhase phase) { + super(phase); + } - @Override - public CombatPhase copy() { - return new CombatPhase(this); - } + @Override + public CombatPhase copy() { + return new CombatPhase(this); + } } diff --git a/Mage/src/mage/game/turn/DeclareAttackersStep.java b/Mage/src/mage/game/turn/DeclareAttackersStep.java index 8b9f50914a..d15aba39b3 100644 --- a/Mage/src/mage/game/turn/DeclareAttackersStep.java +++ b/Mage/src/mage/game/turn/DeclareAttackersStep.java @@ -39,39 +39,39 @@ import mage.game.events.GameEvent.EventType; */ public class DeclareAttackersStep extends Step { - public DeclareAttackersStep() { - super(PhaseStep.DECLARE_ATTACKERS, true); - this.stepEvent = EventType.DECLARE_ATTACKERS_STEP; - this.preStepEvent = EventType.DECLARE_ATTACKERS_STEP_PRE; - this.postStepEvent = EventType.DECLARE_ATTACKERS_STEP_POST; - } + public DeclareAttackersStep() { + super(PhaseStep.DECLARE_ATTACKERS, true); + this.stepEvent = EventType.DECLARE_ATTACKERS_STEP; + this.preStepEvent = EventType.DECLARE_ATTACKERS_STEP_PRE; + this.postStepEvent = EventType.DECLARE_ATTACKERS_STEP_POST; + } - public DeclareAttackersStep(final DeclareAttackersStep step) { - super(step); - } + public DeclareAttackersStep(final DeclareAttackersStep step) { + super(step); + } - @Override - public boolean skipStep(Game game, UUID activePlayerId) { - if (game.getPlayer(activePlayerId).getAvailableAttackers(game).isEmpty()) - return true; - return super.skipStep(game, activePlayerId); - } + @Override + public boolean skipStep(Game game, UUID activePlayerId) { + if (game.getPlayer(activePlayerId).getAvailableAttackers(game).isEmpty()) + return true; + return super.skipStep(game, activePlayerId); + } - @Override - public void beginStep(Game game, UUID activePlayerId) { - super.beginStep(game, activePlayerId); - game.getCombat().selectAttackers(game); - } + @Override + public void beginStep(Game game, UUID activePlayerId) { + super.beginStep(game, activePlayerId); + game.getCombat().selectAttackers(game); + } @Override public void resumeBeginStep(Game game, UUID activePlayerId) { super.resumeBeginStep(game, activePlayerId); game.getCombat().resumeSelectAttackers(game); } - - @Override - public DeclareAttackersStep copy() { - return new DeclareAttackersStep(this); - } + + @Override + public DeclareAttackersStep copy() { + return new DeclareAttackersStep(this); + } } diff --git a/Mage/src/mage/game/turn/DeclareBlockersStep.java b/Mage/src/mage/game/turn/DeclareBlockersStep.java index 3dd0d8ccb9..22d28fb05a 100644 --- a/Mage/src/mage/game/turn/DeclareBlockersStep.java +++ b/Mage/src/mage/game/turn/DeclareBlockersStep.java @@ -39,33 +39,33 @@ import mage.game.events.GameEvent.EventType; */ public class DeclareBlockersStep extends Step { - public DeclareBlockersStep() { - super(PhaseStep.DECLARE_BLOCKERS, true); - this.stepEvent = EventType.DECLARE_BLOCKERS_STEP; - this.preStepEvent = EventType.DECLARE_BLOCKERS_STEP_PRE; - this.postStepEvent = EventType.DECLARE_BLOCKERS_STEP_POST; - } + public DeclareBlockersStep() { + super(PhaseStep.DECLARE_BLOCKERS, true); + this.stepEvent = EventType.DECLARE_BLOCKERS_STEP; + this.preStepEvent = EventType.DECLARE_BLOCKERS_STEP_PRE; + this.postStepEvent = EventType.DECLARE_BLOCKERS_STEP_POST; + } - public DeclareBlockersStep(final DeclareBlockersStep step) { - super(step); - } + public DeclareBlockersStep(final DeclareBlockersStep step) { + super(step); + } - @Override - public boolean skipStep(Game game, UUID activePlayerId) { - if (game.getCombat().noAttackers()) - return true; - return super.skipStep(game, activePlayerId); - } + @Override + public boolean skipStep(Game game, UUID activePlayerId) { + if (game.getCombat().noAttackers()) + return true; + return super.skipStep(game, activePlayerId); + } - @Override - public void beginStep(Game game, UUID activePlayerId) { - super.beginStep(game, activePlayerId); - game.getCombat().selectBlockers(game); + @Override + public void beginStep(Game game, UUID activePlayerId) { + super.beginStep(game, activePlayerId); + game.getCombat().selectBlockers(game); if (!game.isPaused()) { game.getCombat().checkBlockRestrictions(game); game.getCombat().damageAssignmentOrder(game); } - } + } @Override public void resumeBeginStep(Game game, UUID activePlayerId) { @@ -74,10 +74,10 @@ public class DeclareBlockersStep extends Step { game.getCombat().checkBlockRestrictions(game); game.getCombat().damageAssignmentOrder(game); } - - @Override - public DeclareBlockersStep copy() { - return new DeclareBlockersStep(this); - } + + @Override + public DeclareBlockersStep copy() { + return new DeclareBlockersStep(this); + } } diff --git a/Mage/src/mage/game/turn/DrawStep.java b/Mage/src/mage/game/turn/DrawStep.java index a451639322..ac36c4d2dc 100644 --- a/Mage/src/mage/game/turn/DrawStep.java +++ b/Mage/src/mage/game/turn/DrawStep.java @@ -40,31 +40,31 @@ import mage.players.Player; */ public class DrawStep extends Step { - public DrawStep() { - super(PhaseStep.DRAW, true); - this.stepEvent = EventType.DRAW_STEP; - this.preStepEvent = EventType.DRAW_STEP_PRE; - this.postStepEvent = EventType.DRAW_STEP_POST; - } + public DrawStep() { + super(PhaseStep.DRAW, true); + this.stepEvent = EventType.DRAW_STEP; + this.preStepEvent = EventType.DRAW_STEP_PRE; + this.postStepEvent = EventType.DRAW_STEP_POST; + } - public DrawStep(final DrawStep step) { - super(step); - } + public DrawStep(final DrawStep step) { + super(step); + } - @Override - public void beginStep(Game game, UUID activePlayerId) { - Player activePlayer = game.getPlayer(activePlayerId); - //20091005 - 504.1/703.4c - activePlayer.drawCards(1, game); -// game.saveState(); + @Override + public void beginStep(Game game, UUID activePlayerId) { + Player activePlayer = game.getPlayer(activePlayerId); + //20091005 - 504.1/703.4c + activePlayer.drawCards(1, game); +// game.saveState(); game.applyEffects(); - super.beginStep(game, activePlayerId); - } + super.beginStep(game, activePlayerId); + } - @Override - public DrawStep copy() { - return new DrawStep(this); - } + @Override + public DrawStep copy() { + return new DrawStep(this); + } } diff --git a/Mage/src/mage/game/turn/EndOfCombatStep.java b/Mage/src/mage/game/turn/EndOfCombatStep.java index 2fa6c4f1f0..70d6d3ee0d 100644 --- a/Mage/src/mage/game/turn/EndOfCombatStep.java +++ b/Mage/src/mage/game/turn/EndOfCombatStep.java @@ -39,28 +39,28 @@ import mage.game.events.GameEvent.EventType; */ public class EndOfCombatStep extends Step { - public EndOfCombatStep() { - super(PhaseStep.END_COMBAT, true); - this.stepEvent = EventType.END_COMBAT_STEP; - this.preStepEvent = EventType.END_COMBAT_STEP_PRE; - this.postStepEvent = EventType.END_COMBAT_STEP_POST; - } + public EndOfCombatStep() { + super(PhaseStep.END_COMBAT, true); + this.stepEvent = EventType.END_COMBAT_STEP; + this.preStepEvent = EventType.END_COMBAT_STEP_PRE; + this.postStepEvent = EventType.END_COMBAT_STEP_POST; + } - public EndOfCombatStep(final EndOfCombatStep step) { - super(step); - } + public EndOfCombatStep(final EndOfCombatStep step) { + super(step); + } - @Override - public void endStep(Game game, UUID activePlayerId) { - super.endStep(game, activePlayerId); - //20091005 - 511.3 - game.getCombat().endCombat(game); -// game.saveState(); - } + @Override + public void endStep(Game game, UUID activePlayerId) { + super.endStep(game, activePlayerId); + //20091005 - 511.3 + game.getCombat().endCombat(game); +// game.saveState(); + } - @Override - public EndOfCombatStep copy() { - return new EndOfCombatStep(this); - } + @Override + public EndOfCombatStep copy() { + return new EndOfCombatStep(this); + } } diff --git a/Mage/src/mage/game/turn/EndPhase.java b/Mage/src/mage/game/turn/EndPhase.java index 6db877e30b..f33905b347 100644 --- a/Mage/src/mage/game/turn/EndPhase.java +++ b/Mage/src/mage/game/turn/EndPhase.java @@ -39,35 +39,35 @@ import mage.game.events.GameEvent.EventType; */ public class EndPhase extends Phase { - public EndPhase() { - this.type = TurnPhase.END; - this.event = EventType.END_PHASE; - this.preEvent = EventType.END_PHASE_PRE; - this.postEvent = EventType.END_PHASE_POST; - this.steps.add(new EndStep()); - this.steps.add(new CleanupStep()); - } + public EndPhase() { + this.type = TurnPhase.END; + this.event = EventType.END_PHASE; + this.preEvent = EventType.END_PHASE_PRE; + this.postEvent = EventType.END_PHASE_POST; + this.steps.add(new EndStep()); + this.steps.add(new CleanupStep()); + } - public EndPhase(final EndPhase phase) { - super(phase); - } + public EndPhase(final EndPhase phase) { + super(phase); + } - @Override - protected void playStep(Game game) { - if (currentStep.getType() == PhaseStep.CLEANUP) { - currentStep.beginStep(game, activePlayerId); - if (game.checkStateAndTriggered()) { - playStep(game); - } - currentStep.endStep(game, activePlayerId); - } - else - super.playStep(game); - } + @Override + protected void playStep(Game game) { + if (currentStep.getType() == PhaseStep.CLEANUP) { + currentStep.beginStep(game, activePlayerId); + if (game.checkStateAndTriggered()) { + playStep(game); + } + currentStep.endStep(game, activePlayerId); + } + else + super.playStep(game); + } - @Override - public EndPhase copy() { - return new EndPhase(this); - } + @Override + public EndPhase copy() { + return new EndPhase(this); + } } diff --git a/Mage/src/mage/game/turn/EndStep.java b/Mage/src/mage/game/turn/EndStep.java index 93d02e532e..30c0adfb7e 100644 --- a/Mage/src/mage/game/turn/EndStep.java +++ b/Mage/src/mage/game/turn/EndStep.java @@ -37,20 +37,20 @@ import mage.game.events.GameEvent.EventType; */ public class EndStep extends Step { - public EndStep() { - super(PhaseStep.END_TURN, true); - this.stepEvent = EventType.END_TURN_STEP; - this.preStepEvent = EventType.END_TURN_STEP_PRE; - this.postStepEvent = EventType.END_TURN_STEP_POST; - } + public EndStep() { + super(PhaseStep.END_TURN, true); + this.stepEvent = EventType.END_TURN_STEP; + this.preStepEvent = EventType.END_TURN_STEP_PRE; + this.postStepEvent = EventType.END_TURN_STEP_POST; + } - public EndStep(final EndStep step) { - super(step); - } + public EndStep(final EndStep step) { + super(step); + } - @Override - public EndStep copy() { - return new EndStep(this); - } + @Override + public EndStep copy() { + return new EndStep(this); + } } diff --git a/Mage/src/mage/game/turn/FirstCombatDamageStep.java b/Mage/src/mage/game/turn/FirstCombatDamageStep.java index 4d47a3c578..3767453d73 100644 --- a/Mage/src/mage/game/turn/FirstCombatDamageStep.java +++ b/Mage/src/mage/game/turn/FirstCombatDamageStep.java @@ -40,52 +40,52 @@ import mage.game.events.GameEvent.EventType; */ public class FirstCombatDamageStep extends Step { - public FirstCombatDamageStep() { - super(PhaseStep.FIRST_COMBAT_DAMAGE, true); - this.stepEvent = EventType.COMBAT_DAMAGE_STEP; - this.preStepEvent = EventType.COMBAT_DAMAGE_STEP_PRE; - this.postStepEvent = EventType.COMBAT_DAMAGE_STEP_POST; - } + public FirstCombatDamageStep() { + super(PhaseStep.FIRST_COMBAT_DAMAGE, true); + this.stepEvent = EventType.COMBAT_DAMAGE_STEP; + this.preStepEvent = EventType.COMBAT_DAMAGE_STEP_PRE; + this.postStepEvent = EventType.COMBAT_DAMAGE_STEP_POST; + } - public FirstCombatDamageStep(final FirstCombatDamageStep step) { - super(step); - } + public FirstCombatDamageStep(final FirstCombatDamageStep step) { + super(step); + } - @Override - public boolean skipStep(Game game, UUID activePlayerId) { - if (game.getCombat().noAttackers()) - return true; - if (!game.getCombat().hasFirstOrDoubleStrike(game)) - return true; - return super.skipStep(game, activePlayerId); - } + @Override + public boolean skipStep(Game game, UUID activePlayerId) { + if (game.getCombat().noAttackers()) + return true; + if (!game.getCombat().hasFirstOrDoubleStrike(game)) + return true; + return super.skipStep(game, activePlayerId); + } - @Override - public void beginStep(Game game, UUID activePlayerId) { - super.beginStep(game, activePlayerId); - for (CombatGroup group: game.getCombat().getGroups()) { - group.assignDamageToBlockers(true, game); - } - for (CombatGroup group : game.getCombat().getBlockingGroups()) { - group.assignDamageToAttackers(true, game); - } + @Override + public void beginStep(Game game, UUID activePlayerId) { + super.beginStep(game, activePlayerId); + for (CombatGroup group: game.getCombat().getGroups()) { + group.assignDamageToBlockers(true, game); + } + for (CombatGroup group : game.getCombat().getBlockingGroups()) { + group.assignDamageToAttackers(true, game); + } - for (CombatGroup group: game.getCombat().getGroups()) { - group.applyDamage(game); - } + for (CombatGroup group: game.getCombat().getGroups()) { + group.applyDamage(game); + } - for (CombatGroup group : game.getCombat().getBlockingGroups()) { - group.applyDamage(game); - } - } + for (CombatGroup group : game.getCombat().getBlockingGroups()) { + group.applyDamage(game); + } + } - public boolean getFirst() { - return true; - } + public boolean getFirst() { + return true; + } - @Override - public FirstCombatDamageStep copy() { - return new FirstCombatDamageStep(this); - } + @Override + public FirstCombatDamageStep copy() { + return new FirstCombatDamageStep(this); + } } diff --git a/Mage/src/mage/game/turn/Phase.java b/Mage/src/mage/game/turn/Phase.java index b4c7bb0287..345ca4408f 100644 --- a/Mage/src/mage/game/turn/Phase.java +++ b/Mage/src/mage/game/turn/Phase.java @@ -45,95 +45,95 @@ import mage.game.events.GameEvent.EventType; */ public abstract class Phase> implements Serializable { - protected TurnPhase type; - protected List steps = new ArrayList(); - protected EventType event; - protected EventType preEvent; - protected EventType postEvent; + protected TurnPhase type; + protected List steps = new ArrayList(); + protected EventType event; + protected EventType preEvent; + protected EventType postEvent; - protected UUID activePlayerId; - protected Step currentStep; - protected int count; + protected UUID activePlayerId; + protected Step currentStep; + protected int count; - public abstract T copy(); + public abstract T copy(); - public Phase() {} + public Phase() {} - public Phase(final Phase phase) { - this.type = phase.type; - this.event = phase.event; - this.preEvent = phase.preEvent; - this.postEvent = phase.postEvent; - this.activePlayerId = phase.activePlayerId; - if (phase.currentStep != null) - this.currentStep = phase.currentStep.copy(); - this.count = phase.count; - for (Step step: phase.steps) { - this.steps.add(step.copy()); - } - } + public Phase(final Phase phase) { + this.type = phase.type; + this.event = phase.event; + this.preEvent = phase.preEvent; + this.postEvent = phase.postEvent; + this.activePlayerId = phase.activePlayerId; + if (phase.currentStep != null) + this.currentStep = phase.currentStep.copy(); + this.count = phase.count; + for (Step step: phase.steps) { + this.steps.add(step.copy()); + } + } - public TurnPhase getType() { - return type; - } + public TurnPhase getType() { + return type; + } - public Step getStep() { - return currentStep; - } + public Step getStep() { + return currentStep; + } - public void setStep(Step step) { - this.currentStep = step; - } + public void setStep(Step step) { + this.currentStep = step; + } - public void resetCount() { - count = 0; - } + public void resetCount() { + count = 0; + } - public int getCount() { - return count; - } + public int getCount() { + return count; + } - public boolean play(Game game, UUID activePlayerId) { - if (game.isPaused() || game.isGameOver()) - return false; + public boolean play(Game game, UUID activePlayerId) { + if (game.isPaused() || game.isGameOver()) + return false; - this.activePlayerId = activePlayerId; + this.activePlayerId = activePlayerId; - if (beginPhase(game, activePlayerId)) { + if (beginPhase(game, activePlayerId)) { - for (Step step: steps) { - if (game.isPaused() || game.isGameOver()) - return false; - currentStep = step; + for (Step step: steps) { + if (game.isPaused() || game.isGameOver()) + return false; + currentStep = step; if (!game.isSimulation() && checkStopOnStepOption(game)) return false; - if (!game.getState().getTurnMods().skipStep(activePlayerId, getStep().getType())) - playStep(game); - } + if (!game.getState().getTurnMods().skipStep(activePlayerId, getStep().getType())) + playStep(game); + } if (game.isPaused() || game.isGameOver()) return false; - count++; - endPhase(game, activePlayerId); - return true; - } - return false; - } + count++; + endPhase(game, activePlayerId); + return true; + } + return false; + } private boolean checkStopOnStepOption(Game game) { - if (game.getOptions().stopOnTurn != null && game.getOptions().stopAtStep == getStep().getType()) { - if (game.getOptions().stopOnTurn.equals(game.getState().getTurnNum())) { + if (game.getOptions().stopOnTurn != null && game.getOptions().stopAtStep == getStep().getType()) { + if (game.getOptions().stopOnTurn.equals(game.getState().getTurnNum())) { game.pause(); return true; - } - } + } + } return false; - } + } public boolean resumePlay(Game game, PhaseStep stepType, boolean wasPaused) { - if (game.isPaused() || game.isGameOver()) - return false; + if (game.isPaused() || game.isGameOver()) + return false; - this.activePlayerId = game.getActivePlayerId(); + this.activePlayerId = game.getActivePlayerId(); Iterator it = steps.iterator(); Step step; do { @@ -149,7 +149,7 @@ public abstract class Phase> implements Serializable { if (!game.getState().getTurnMods().skipStep(activePlayerId, currentStep.getType())) playStep(game); } - + if (game.isPaused() || game.isGameOver()) return false; count++; @@ -157,39 +157,39 @@ public abstract class Phase> implements Serializable { return true; } - public boolean beginPhase(Game game, UUID activePlayerId) { - if (!game.replaceEvent(new GameEvent(event, null, null, activePlayerId))) { - game.fireEvent(new GameEvent(preEvent, null, null, activePlayerId)); - return true; - } - return false; - } + public boolean beginPhase(Game game, UUID activePlayerId) { + if (!game.replaceEvent(new GameEvent(event, null, null, activePlayerId))) { + game.fireEvent(new GameEvent(preEvent, null, null, activePlayerId)); + return true; + } + return false; + } - public void endPhase(Game game, UUID activePlayerId) { - game.fireEvent(new GameEvent(postEvent, null, null, activePlayerId)); - } + public void endPhase(Game game, UUID activePlayerId) { + game.fireEvent(new GameEvent(postEvent, null, null, activePlayerId)); + } - public void prePriority(Game game, UUID activePlayerId) { - currentStep.beginStep(game, activePlayerId); - } + public void prePriority(Game game, UUID activePlayerId) { + currentStep.beginStep(game, activePlayerId); + } - public void postPriority(Game game, UUID activePlayerId) { - currentStep.endStep(game, activePlayerId); - //20091005 - 500.4/703.4n - game.emptyManaPools(); - //20091005 - 500.9 - playExtraSteps(game, currentStep.getType()); - } + public void postPriority(Game game, UUID activePlayerId) { + currentStep.endStep(game, activePlayerId); + //20091005 - 500.4/703.4n + game.emptyManaPools(); + //20091005 - 500.9 + playExtraSteps(game, currentStep.getType()); + } - protected void playStep(Game game) { - if (!currentStep.skipStep(game, activePlayerId)) { - prePriority(game, activePlayerId); + protected void playStep(Game game) { + if (!currentStep.skipStep(game, activePlayerId)) { + prePriority(game, activePlayerId); if (!game.isPaused() && !game.isGameOver()) currentStep.priority(game, activePlayerId, false); if (!game.isPaused() && !game.isGameOver()) postPriority(game, activePlayerId); - } - } + } + } protected void resumeStep(Game game, boolean wasPaused) { boolean resuming = true; @@ -211,16 +211,16 @@ public abstract class Phase> implements Serializable { if (!game.isPaused() && !game.isGameOver()) postPriority(game, activePlayerId); } - } + } - private void playExtraSteps(Game game, PhaseStep afterStep) { - while (true) { - Step extraStep = game.getState().getTurnMods().extraStep(activePlayerId, afterStep); - if (extraStep == null) - return; - currentStep = extraStep; - playStep(game); - } - } + private void playExtraSteps(Game game, PhaseStep afterStep) { + while (true) { + Step extraStep = game.getState().getTurnMods().extraStep(activePlayerId, afterStep); + if (extraStep == null) + return; + currentStep = extraStep; + playStep(game); + } + } } diff --git a/Mage/src/mage/game/turn/PostCombatMainPhase.java b/Mage/src/mage/game/turn/PostCombatMainPhase.java index bd55d43289..a0dfc8c80a 100644 --- a/Mage/src/mage/game/turn/PostCombatMainPhase.java +++ b/Mage/src/mage/game/turn/PostCombatMainPhase.java @@ -37,21 +37,21 @@ import mage.game.events.GameEvent.EventType; */ public class PostCombatMainPhase extends Phase { - public PostCombatMainPhase() { - this.type = TurnPhase.POSTCOMBAT_MAIN; - this.event = EventType.POSTCOMBAT_MAIN_PHASE; - this.preEvent = EventType.POSTCOMBAT_MAIN_PHASE_PRE; - this.postEvent = EventType.POSTCOMBAT_MAIN_STEP_POST; - this.steps.add(new PostCombatMainStep()); - } + public PostCombatMainPhase() { + this.type = TurnPhase.POSTCOMBAT_MAIN; + this.event = EventType.POSTCOMBAT_MAIN_PHASE; + this.preEvent = EventType.POSTCOMBAT_MAIN_PHASE_PRE; + this.postEvent = EventType.POSTCOMBAT_MAIN_STEP_POST; + this.steps.add(new PostCombatMainStep()); + } - public PostCombatMainPhase(final PostCombatMainPhase phase) { - super(phase); - } + public PostCombatMainPhase(final PostCombatMainPhase phase) { + super(phase); + } - @Override - public PostCombatMainPhase copy() { - return new PostCombatMainPhase(this); - } + @Override + public PostCombatMainPhase copy() { + return new PostCombatMainPhase(this); + } } diff --git a/Mage/src/mage/game/turn/PostCombatMainStep.java b/Mage/src/mage/game/turn/PostCombatMainStep.java index bd05d01fcb..88f8896327 100644 --- a/Mage/src/mage/game/turn/PostCombatMainStep.java +++ b/Mage/src/mage/game/turn/PostCombatMainStep.java @@ -37,20 +37,20 @@ import mage.game.events.GameEvent.EventType; */ public class PostCombatMainStep extends Step { - public PostCombatMainStep() { - super(PhaseStep.POSTCOMBAT_MAIN, true); - this.stepEvent = EventType.POSTCOMBAT_MAIN_STEP; - this.preStepEvent = EventType.POSTCOMBAT_MAIN_STEP_PRE; - this.postStepEvent = EventType.POSTCOMBAT_MAIN_STEP_POST; - } + public PostCombatMainStep() { + super(PhaseStep.POSTCOMBAT_MAIN, true); + this.stepEvent = EventType.POSTCOMBAT_MAIN_STEP; + this.preStepEvent = EventType.POSTCOMBAT_MAIN_STEP_PRE; + this.postStepEvent = EventType.POSTCOMBAT_MAIN_STEP_POST; + } - public PostCombatMainStep(final PostCombatMainStep step) { - super(step); - } + public PostCombatMainStep(final PostCombatMainStep step) { + super(step); + } - @Override - public PostCombatMainStep copy() { - return new PostCombatMainStep(this); - } + @Override + public PostCombatMainStep copy() { + return new PostCombatMainStep(this); + } } diff --git a/Mage/src/mage/game/turn/PreCombatMainPhase.java b/Mage/src/mage/game/turn/PreCombatMainPhase.java index 5d78c51e87..4851f44c20 100644 --- a/Mage/src/mage/game/turn/PreCombatMainPhase.java +++ b/Mage/src/mage/game/turn/PreCombatMainPhase.java @@ -37,21 +37,21 @@ import mage.game.events.GameEvent.EventType; */ public class PreCombatMainPhase extends Phase { - public PreCombatMainPhase() { - this.type = TurnPhase.PRECOMBAT_MAIN; - this.event = EventType.PRECOMBAT_MAIN_PHASE; - this.preEvent = EventType.PRECOMBAT_MAIN_PHASE_PRE; - this.postEvent = EventType.PRECOMBAT_MAIN_PHASE_POST; - this.steps.add(new PreCombatMainStep()); - } + public PreCombatMainPhase() { + this.type = TurnPhase.PRECOMBAT_MAIN; + this.event = EventType.PRECOMBAT_MAIN_PHASE; + this.preEvent = EventType.PRECOMBAT_MAIN_PHASE_PRE; + this.postEvent = EventType.PRECOMBAT_MAIN_PHASE_POST; + this.steps.add(new PreCombatMainStep()); + } - public PreCombatMainPhase(final PreCombatMainPhase phase) { - super(phase); - } + public PreCombatMainPhase(final PreCombatMainPhase phase) { + super(phase); + } - @Override - public PreCombatMainPhase copy() { - return new PreCombatMainPhase(this); - } + @Override + public PreCombatMainPhase copy() { + return new PreCombatMainPhase(this); + } } diff --git a/Mage/src/mage/game/turn/PreCombatMainStep.java b/Mage/src/mage/game/turn/PreCombatMainStep.java index 16ff28855f..7bfa9d843b 100644 --- a/Mage/src/mage/game/turn/PreCombatMainStep.java +++ b/Mage/src/mage/game/turn/PreCombatMainStep.java @@ -37,20 +37,20 @@ import mage.game.events.GameEvent.EventType; */ public class PreCombatMainStep extends Step { - public PreCombatMainStep() { - super(PhaseStep.PRECOMBAT_MAIN, true); - this.stepEvent = EventType.PRECOMBAT_MAIN_STEP; - this.preStepEvent = EventType.PRECOMBAT_MAIN_STEP_PRE; - this.postStepEvent = EventType.PRECOMBAT_MAIN_STEP_POST; - } + public PreCombatMainStep() { + super(PhaseStep.PRECOMBAT_MAIN, true); + this.stepEvent = EventType.PRECOMBAT_MAIN_STEP; + this.preStepEvent = EventType.PRECOMBAT_MAIN_STEP_PRE; + this.postStepEvent = EventType.PRECOMBAT_MAIN_STEP_POST; + } - public PreCombatMainStep(final PreCombatMainStep step) { - super(step); - } + public PreCombatMainStep(final PreCombatMainStep step) { + super(step); + } - @Override - public PreCombatMainStep copy() { - return new PreCombatMainStep(this); - } + @Override + public PreCombatMainStep copy() { + return new PreCombatMainStep(this); + } } diff --git a/Mage/src/mage/game/turn/Step.java b/Mage/src/mage/game/turn/Step.java index 67b23c16eb..1b2382e4e5 100644 --- a/Mage/src/mage/game/turn/Step.java +++ b/Mage/src/mage/game/turn/Step.java @@ -41,68 +41,68 @@ import mage.game.events.GameEvent.EventType; */ public abstract class Step> implements Serializable { - private PhaseStep type; - private boolean hasPriority; - protected EventType stepEvent; - protected EventType preStepEvent; - protected EventType postStepEvent; + private PhaseStep type; + private boolean hasPriority; + protected EventType stepEvent; + protected EventType preStepEvent; + protected EventType postStepEvent; protected StepPart stepPart; - + public enum StepPart { PRE, PRIORITY, POST; } - public abstract T copy(); + public abstract T copy(); - public Step(PhaseStep type, boolean hasPriority) { - this.type = type; - this.hasPriority = hasPriority; - } + public Step(PhaseStep type, boolean hasPriority) { + this.type = type; + this.hasPriority = hasPriority; + } - public Step(final Step step) { - this.type = step.type; - this.hasPriority = step.hasPriority; - this.stepEvent = step.stepEvent; - this.preStepEvent = step.preStepEvent; - this.postStepEvent = step.postStepEvent; + public Step(final Step step) { + this.type = step.type; + this.hasPriority = step.hasPriority; + this.stepEvent = step.stepEvent; + this.preStepEvent = step.preStepEvent; + this.postStepEvent = step.postStepEvent; this.stepPart = step.stepPart; - } + } - public PhaseStep getType() { - return type; - } + public PhaseStep getType() { + return type; + } - public void beginStep(Game game, UUID activePlayerId) { + public void beginStep(Game game, UUID activePlayerId) { stepPart = StepPart.PRE; - game.fireEvent(new GameEvent(preStepEvent, null, null, activePlayerId)); - } - + game.fireEvent(new GameEvent(preStepEvent, null, null, activePlayerId)); + } + public void resumeBeginStep(Game game, UUID activePlayerId) { stepPart = StepPart.PRE; } - public void priority(Game game, UUID activePlayerId, boolean resuming) { - if (hasPriority) { + public void priority(Game game, UUID activePlayerId, boolean resuming) { + if (hasPriority) { stepPart = StepPart.PRIORITY; - game.playPriority(activePlayerId, resuming); + game.playPriority(activePlayerId, resuming); } - } + } - public void endStep(Game game, UUID activePlayerId) { + public void endStep(Game game, UUID activePlayerId) { stepPart = StepPart.POST; - game.fireEvent(new GameEvent(postStepEvent, null, null, activePlayerId)); - } + game.fireEvent(new GameEvent(postStepEvent, null, null, activePlayerId)); + } - public boolean skipStep(Game game, UUID activePlayerId) { - return game.replaceEvent(new GameEvent(stepEvent, null, null, activePlayerId)); - } + public boolean skipStep(Game game, UUID activePlayerId) { + return game.replaceEvent(new GameEvent(stepEvent, null, null, activePlayerId)); + } - public boolean getHasPriority() { - return this.hasPriority; - } + public boolean getHasPriority() { + return this.hasPriority; + } public StepPart getStepPart() { return stepPart; } - + } diff --git a/Mage/src/mage/game/turn/Turn.java b/Mage/src/mage/game/turn/Turn.java index 12ef1da10e..bb9e7c4c29 100644 --- a/Mage/src/mage/game/turn/Turn.java +++ b/Mage/src/mage/game/turn/Turn.java @@ -45,96 +45,96 @@ import java.util.UUID; */ public class Turn implements Serializable { - private Phase currentPhase; - private UUID activePlayerId; - private List phases = new ArrayList(); + private Phase currentPhase; + private UUID activePlayerId; + private List phases = new ArrayList(); - public Turn() { - phases.add(new BeginningPhase()); - phases.add(new PreCombatMainPhase()); - phases.add(new CombatPhase()); - phases.add(new PostCombatMainPhase()); - phases.add(new EndPhase()); - } + public Turn() { + phases.add(new BeginningPhase()); + phases.add(new PreCombatMainPhase()); + phases.add(new CombatPhase()); + phases.add(new PostCombatMainPhase()); + phases.add(new EndPhase()); + } - public Turn(final Turn turn) { - if (turn.currentPhase != null) - this.currentPhase = turn.currentPhase.copy(); - this.activePlayerId = turn.activePlayerId; - for (Phase phase: turn.phases) { - this.phases.add(phase.copy()); - } - - } + public Turn(final Turn turn) { + if (turn.currentPhase != null) + this.currentPhase = turn.currentPhase.copy(); + this.activePlayerId = turn.activePlayerId; + for (Phase phase: turn.phases) { + this.phases.add(phase.copy()); + } - public TurnPhase getPhaseType() { - if (currentPhase != null) - return currentPhase.getType(); - return null; - } + } - public Phase getPhase() { - return currentPhase; - } + public TurnPhase getPhaseType() { + if (currentPhase != null) + return currentPhase.getType(); + return null; + } - public Phase getPhase(TurnPhase turnPhase) { - for (Phase phase: phases) { - if (phase.getType() == turnPhase) { - return phase; - } - } - return null; - } + public Phase getPhase() { + return currentPhase; + } - public void setPhase(Phase phase) { - this.currentPhase = phase; - } + public Phase getPhase(TurnPhase turnPhase) { + for (Phase phase: phases) { + if (phase.getType() == turnPhase) { + return phase; + } + } + return null; + } - public Step getStep() { - if (currentPhase != null) - return currentPhase.getStep(); - return null; - } + public void setPhase(Phase phase) { + this.currentPhase = phase; + } - public PhaseStep getStepType() { - if (currentPhase != null && currentPhase.getStep() != null) - return currentPhase.getStep().getType(); - return null; - } + public Step getStep() { + if (currentPhase != null) + return currentPhase.getStep(); + return null; + } + + public PhaseStep getStepType() { + if (currentPhase != null && currentPhase.getStep() != null) + return currentPhase.getStep().getType(); + return null; + } public void play(Game game, UUID activePlayerId) { - if (game.isPaused() || game.isGameOver()) - return; + if (game.isPaused() || game.isGameOver()) + return; - if (game.getState().getTurnMods().skipTurn(activePlayerId)) - return; + if (game.getState().getTurnMods().skipTurn(activePlayerId)) + return; - checkTurnIsControlledByOtherPlayer(game, activePlayerId); + checkTurnIsControlledByOtherPlayer(game, activePlayerId); - this.activePlayerId = activePlayerId; - resetCounts(); - game.getPlayer(activePlayerId).beginTurn(game); - for (Phase phase: phases) { - if (game.isPaused() || game.isGameOver()) - return; - currentPhase = phase; - if (!game.getState().getTurnMods().skipPhase(activePlayerId, currentPhase.getType())) { - if (phase.play(game, activePlayerId)) { - //20091005 - 500.4/703.4n - game.emptyManaPools(); + this.activePlayerId = activePlayerId; + resetCounts(); + game.getPlayer(activePlayerId).beginTurn(game); + for (Phase phase: phases) { + if (game.isPaused() || game.isGameOver()) + return; + currentPhase = phase; + if (!game.getState().getTurnMods().skipPhase(activePlayerId, currentPhase.getType())) { + if (phase.play(game, activePlayerId)) { + //20091005 - 500.4/703.4n + game.emptyManaPools(); - //game.saveState(); + //game.saveState(); - //20091005 - 500.8 - playExtraPhases(game, phase.getType()); - } - } - if (!currentPhase.equals(phase)) // phase was changed from the card - break; - } - //20091005 - 500.7 - playExtraTurns(game); - } + //20091005 - 500.8 + playExtraPhases(game, phase.getType()); + } + } + if (!currentPhase.equals(phase)) // phase was changed from the card + break; + } + //20091005 - 500.7 + playExtraTurns(game); + } public void resumePlay(Game game, boolean wasPaused) { activePlayerId = game.getActivePlayerId(); @@ -157,92 +157,92 @@ public class Turn implements Serializable { } while (it.hasNext()) { phase = it.next(); - if (game.isPaused() || game.isGameOver()) - return; - currentPhase = phase; - if (!game.getState().getTurnMods().skipPhase(activePlayerId, currentPhase.getType())) { - if (phase.play(game, activePlayerId)) { - //20091005 - 500.4/703.4n - game.emptyManaPools(); - game.saveState(); - //20091005 - 500.8 - playExtraPhases(game, phase.getType()); - } - } - if (!currentPhase.equals(phase)) // phase was changed from the card - break; + if (game.isPaused() || game.isGameOver()) + return; + currentPhase = phase; + if (!game.getState().getTurnMods().skipPhase(activePlayerId, currentPhase.getType())) { + if (phase.play(game, activePlayerId)) { + //20091005 - 500.4/703.4n + game.emptyManaPools(); + game.saveState(); + //20091005 - 500.8 + playExtraPhases(game, phase.getType()); + } + } + if (!currentPhase.equals(phase)) // phase was changed from the card + break; } } - private void checkTurnIsControlledByOtherPlayer(Game game, UUID activePlayerId) { - UUID newControllerId = game.getState().getTurnMods().controlsTurn(activePlayerId); - if (newControllerId != null && !newControllerId.equals(activePlayerId)) { - game.getPlayer(newControllerId).controlPlayersTurn(game, activePlayerId); - } - } + private void checkTurnIsControlledByOtherPlayer(Game game, UUID activePlayerId) { + UUID newControllerId = game.getState().getTurnMods().controlsTurn(activePlayerId); + if (newControllerId != null && !newControllerId.equals(activePlayerId)) { + game.getPlayer(newControllerId).controlPlayersTurn(game, activePlayerId); + } + } - private void resetCounts() { - for (Phase phase: phases) { - phase.resetCount(); - } - } + private void resetCounts() { + for (Phase phase: phases) { + phase.resetCount(); + } + } - private void playExtraPhases(Game game, TurnPhase afterPhase) { - TurnPhase extraPhase = game.getState().getTurnMods().extraPhase(activePlayerId, afterPhase); - if (extraPhase == null) - return; - Phase phase; - switch(extraPhase) { - case BEGINNING: - phase = new BeginningPhase(); - break; - case PRECOMBAT_MAIN: - phase = new PreCombatMainPhase(); - break; - case COMBAT: - phase = new CombatPhase(); - break; - case POSTCOMBAT_MAIN: - phase = new PostCombatMainPhase(); - break; - default: - phase = new EndPhase(); - } - currentPhase = phase; - phase.play(game, activePlayerId); - } + private void playExtraPhases(Game game, TurnPhase afterPhase) { + TurnPhase extraPhase = game.getState().getTurnMods().extraPhase(activePlayerId, afterPhase); + if (extraPhase == null) + return; + Phase phase; + switch(extraPhase) { + case BEGINNING: + phase = new BeginningPhase(); + break; + case PRECOMBAT_MAIN: + phase = new PreCombatMainPhase(); + break; + case COMBAT: + phase = new CombatPhase(); + break; + case POSTCOMBAT_MAIN: + phase = new PostCombatMainPhase(); + break; + default: + phase = new EndPhase(); + } + currentPhase = phase; + phase.play(game, activePlayerId); + } - private void playExtraTurns(Game game) { - while (game.getState().getTurnMods().extraTurn(activePlayerId)) { - this.play(game, activePlayerId); - } - } + private void playExtraTurns(Game game) { + while (game.getState().getTurnMods().extraTurn(activePlayerId)) { + this.play(game, activePlayerId); + } + } - public void endTurn(Game game, UUID activePlayerId) { - // Exile all spells and abilities on the stack - game.getStack().clear(); + public void endTurn(Game game, UUID activePlayerId) { + // Exile all spells and abilities on the stack + game.getStack().clear(); - // Discard down to your maximum hand size. - Player activePlayer = game.getPlayer(activePlayerId); - game.getState().setPriorityPlayerId(activePlayer.getId()); - //20091005 - 514.1 - if (!activePlayer.hasLeft() && !activePlayer.hasLost()) { - activePlayer.discardToMax(game); - activePlayer.setGameUnderYourControl(true); - } + // Discard down to your maximum hand size. + Player activePlayer = game.getPlayer(activePlayerId); + game.getState().setPriorityPlayerId(activePlayer.getId()); + //20091005 - 514.1 + if (!activePlayer.hasLeft() && !activePlayer.hasLost()) { + activePlayer.discardToMax(game); + activePlayer.setGameUnderYourControl(true); + } - // Damage wears off. - //20100423 - 514.2 - game.getBattlefield().endOfTurn(activePlayerId, game); - game.getState().removeEotEffects(game); + // Damage wears off. + //20100423 - 514.2 + game.getBattlefield().endOfTurn(activePlayerId, game); + game.getState().removeEotEffects(game); - Phase phase = new EndPhase(); - phase.setStep(new CleanupStep()); - currentPhase = phase; - //phase.play(game, activePlayerId); - } + Phase phase = new EndPhase(); + phase.setStep(new CleanupStep()); + currentPhase = phase; + //phase.play(game, activePlayerId); + } - public Turn copy() { - return new Turn(this); - } + public Turn copy() { + return new Turn(this); + } } diff --git a/Mage/src/mage/game/turn/TurnMod.java b/Mage/src/mage/game/turn/TurnMod.java index 0310ab4c1b..775258d972 100644 --- a/Mage/src/mage/game/turn/TurnMod.java +++ b/Mage/src/mage/game/turn/TurnMod.java @@ -40,117 +40,117 @@ import mage.Constants.TurnPhase; */ public class TurnMod implements Serializable { - private UUID playerId; - private UUID newControllerId; - private boolean extraTurn; - private boolean skipTurn; - private TurnPhase extraPhase; - private TurnPhase skipPhase; - private Step extraStep; - private PhaseStep skipStep; - private TurnPhase afterPhase; - private PhaseStep afterStep; + private UUID playerId; + private UUID newControllerId; + private boolean extraTurn; + private boolean skipTurn; + private TurnPhase extraPhase; + private TurnPhase skipPhase; + private Step extraStep; + private PhaseStep skipStep; + private TurnPhase afterPhase; + private PhaseStep afterStep; - public TurnMod(UUID playerId, boolean skip) { - this.playerId = playerId; - if (skip) - this.skipTurn = true; - else - this.extraTurn = true; - } + public TurnMod(UUID playerId, boolean skip) { + this.playerId = playerId; + if (skip) + this.skipTurn = true; + else + this.extraTurn = true; + } - public TurnMod(UUID playerId, UUID newControllerId) { - this.playerId = playerId; - this.newControllerId = newControllerId; - } + public TurnMod(UUID playerId, UUID newControllerId) { + this.playerId = playerId; + this.newControllerId = newControllerId; + } - public TurnMod(final TurnMod mod) { - this.playerId = mod.playerId; - this.newControllerId = mod.newControllerId; - this.extraTurn = mod.extraTurn; - this.skipTurn = mod.skipTurn; - this.extraPhase = mod.extraPhase; - this.skipPhase = mod.skipPhase; - if (mod.extraStep != null) - this.extraStep = mod.extraStep.copy(); - this.skipStep = mod.skipStep; - this.afterPhase = mod.afterPhase; - this.afterStep = mod.afterStep; - } + public TurnMod(final TurnMod mod) { + this.playerId = mod.playerId; + this.newControllerId = mod.newControllerId; + this.extraTurn = mod.extraTurn; + this.skipTurn = mod.skipTurn; + this.extraPhase = mod.extraPhase; + this.skipPhase = mod.skipPhase; + if (mod.extraStep != null) + this.extraStep = mod.extraStep.copy(); + this.skipStep = mod.skipStep; + this.afterPhase = mod.afterPhase; + this.afterStep = mod.afterStep; + } - /** - * - * @param playerId - * @param phase - * @param afterPhase - set to null if extraPhase is after the next phase - */ - public TurnMod(UUID playerId, TurnPhase phase, TurnPhase afterPhase, boolean skip) { - this.playerId = playerId; - if (skip) - this.skipPhase = phase; - else - this.extraPhase = phase; - this.afterPhase = afterPhase; - } + /** + * + * @param playerId + * @param phase + * @param afterPhase - set to null if extraPhase is after the next phase + */ + public TurnMod(UUID playerId, TurnPhase phase, TurnPhase afterPhase, boolean skip) { + this.playerId = playerId; + if (skip) + this.skipPhase = phase; + else + this.extraPhase = phase; + this.afterPhase = afterPhase; + } - /** - * - * @param playerId - * @param step - * @param afterStep - set to null if extraStep is after the next step - */ - public TurnMod(UUID playerId, Step step, PhaseStep afterStep) { - this.playerId = playerId; - this.extraStep = step; - this.afterStep = afterStep; - } + /** + * + * @param playerId + * @param step + * @param afterStep - set to null if extraStep is after the next step + */ + public TurnMod(UUID playerId, Step step, PhaseStep afterStep) { + this.playerId = playerId; + this.extraStep = step; + this.afterStep = afterStep; + } - public TurnMod(UUID playerId, PhaseStep step) { - this.playerId = playerId; - this.skipStep = step; - } + public TurnMod(UUID playerId, PhaseStep step) { + this.playerId = playerId; + this.skipStep = step; + } - public UUID getPlayerId() { - return playerId; - } + public UUID getPlayerId() { + return playerId; + } - public boolean isExtraTurn() { - return extraTurn; - } + public boolean isExtraTurn() { + return extraTurn; + } - public boolean isSkipTurn() { - return skipTurn; - } + public boolean isSkipTurn() { + return skipTurn; + } - public TurnPhase getExtraPhase() { - return extraPhase; - } + public TurnPhase getExtraPhase() { + return extraPhase; + } - public Step getExtraStep() { - return extraStep; - } + public Step getExtraStep() { + return extraStep; + } - public TurnPhase getSkipPhase() { - return skipPhase; - } + public TurnPhase getSkipPhase() { + return skipPhase; + } - public PhaseStep getSkipStep() { - return skipStep; - } + public PhaseStep getSkipStep() { + return skipStep; + } - public TurnPhase getAfterPhase() { - return afterPhase; - } + public TurnPhase getAfterPhase() { + return afterPhase; + } - public PhaseStep getAfterStep() { - return afterStep; - } + public PhaseStep getAfterStep() { + return afterStep; + } - public UUID getNewControllerId() { - return newControllerId; - } + public UUID getNewControllerId() { + return newControllerId; + } - public TurnMod copy() { - return new TurnMod(this); - } + public TurnMod copy() { + return new TurnMod(this); + } } diff --git a/Mage/src/mage/game/turn/TurnMods.java b/Mage/src/mage/game/turn/TurnMods.java index d0b10bf395..f71996da16 100644 --- a/Mage/src/mage/game/turn/TurnMods.java +++ b/Mage/src/mage/game/turn/TurnMods.java @@ -40,109 +40,109 @@ import mage.Constants.TurnPhase; */ public class TurnMods extends ArrayList { - public TurnMods() {} + public TurnMods() {} - public TurnMods(final TurnMods mods) { - for (TurnMod mod: mods) { - this.add(mod.copy()); - } - } + public TurnMods(final TurnMods mods) { + for (TurnMod mod: mods) { + this.add(mod.copy()); + } + } - public boolean extraTurn(UUID playerId) { - ListIterator it = this.listIterator(this.size()); - while (it.hasPrevious()) { - TurnMod turnMod = it.previous(); - if (turnMod.isExtraTurn() == true && turnMod.getPlayerId().equals(playerId)) { - it.remove(); - return true; - } - } - return false; - } + public boolean extraTurn(UUID playerId) { + ListIterator it = this.listIterator(this.size()); + while (it.hasPrevious()) { + TurnMod turnMod = it.previous(); + if (turnMod.isExtraTurn() == true && turnMod.getPlayerId().equals(playerId)) { + it.remove(); + return true; + } + } + return false; + } - public boolean skipTurn(UUID playerId) { - ListIterator it = this.listIterator(this.size()); - while (it.hasPrevious()) { - TurnMod turnMod = it.previous(); - if (turnMod.isSkipTurn() == true && turnMod.getPlayerId().equals(playerId)) { - it.remove(); - return true; - } - } - return false; - } + public boolean skipTurn(UUID playerId) { + ListIterator it = this.listIterator(this.size()); + while (it.hasPrevious()) { + TurnMod turnMod = it.previous(); + if (turnMod.isSkipTurn() == true && turnMod.getPlayerId().equals(playerId)) { + it.remove(); + return true; + } + } + return false; + } - public UUID controlsTurn(UUID playerId) { - ListIterator it = this.listIterator(this.size()); - UUID newControllerId = null; - while (it.hasPrevious()) { - TurnMod turnMod = it.previous(); - if (turnMod.getNewControllerId() != null && turnMod.getPlayerId().equals(playerId)) { - newControllerId = turnMod.getNewControllerId(); - it.remove(); - } - } - // now delete all other - control next turn effect is not cumulative - it = this.listIterator(this.size()); - while (it.hasPrevious()) { - TurnMod turnMod = it.previous(); - if (turnMod.getNewControllerId() != null && turnMod.getPlayerId().equals(playerId)) { - it.remove(); - } - } - return newControllerId; - } + public UUID controlsTurn(UUID playerId) { + ListIterator it = this.listIterator(this.size()); + UUID newControllerId = null; + while (it.hasPrevious()) { + TurnMod turnMod = it.previous(); + if (turnMod.getNewControllerId() != null && turnMod.getPlayerId().equals(playerId)) { + newControllerId = turnMod.getNewControllerId(); + it.remove(); + } + } + // now delete all other - control next turn effect is not cumulative + it = this.listIterator(this.size()); + while (it.hasPrevious()) { + TurnMod turnMod = it.previous(); + if (turnMod.getNewControllerId() != null && turnMod.getPlayerId().equals(playerId)) { + it.remove(); + } + } + return newControllerId; + } - public Step extraStep(UUID playerId, PhaseStep afterStep) { - ListIterator it = this.listIterator(this.size()); - while (it.hasPrevious()) { - TurnMod turnMod = it.previous(); - if (turnMod.getExtraStep() != null && turnMod.getPlayerId().equals(playerId) && (turnMod.getAfterStep() == null || turnMod.getAfterStep() == afterStep)) { - it.remove(); - return turnMod.getExtraStep(); - } - } - return null; - } + public Step extraStep(UUID playerId, PhaseStep afterStep) { + ListIterator it = this.listIterator(this.size()); + while (it.hasPrevious()) { + TurnMod turnMod = it.previous(); + if (turnMod.getExtraStep() != null && turnMod.getPlayerId().equals(playerId) && (turnMod.getAfterStep() == null || turnMod.getAfterStep() == afterStep)) { + it.remove(); + return turnMod.getExtraStep(); + } + } + return null; + } - public boolean skipStep(UUID playerId, PhaseStep step) { - ListIterator it = this.listIterator(this.size()); - while (it.hasPrevious()) { - TurnMod turnMod = it.previous(); - if (turnMod.getSkipStep() != null && turnMod.getPlayerId().equals(playerId) && turnMod.getSkipStep() == step) { - it.remove(); - return true; - } - } - return false; - } + public boolean skipStep(UUID playerId, PhaseStep step) { + ListIterator it = this.listIterator(this.size()); + while (it.hasPrevious()) { + TurnMod turnMod = it.previous(); + if (turnMod.getSkipStep() != null && turnMod.getPlayerId().equals(playerId) && turnMod.getSkipStep() == step) { + it.remove(); + return true; + } + } + return false; + } - public TurnPhase extraPhase(UUID playerId, TurnPhase afterPhase) { - ListIterator it = this.listIterator(this.size()); - while (it.hasPrevious()) { - TurnMod turnMod = it.previous(); - if (turnMod.getExtraPhase() != null && turnMod.getPlayerId().equals(playerId) && turnMod.getExtraPhase() != null && (turnMod.getAfterPhase() == null || turnMod.getAfterPhase() == afterPhase)) { - it.remove(); - return turnMod.getExtraPhase(); - } - } - return null; - } + public TurnPhase extraPhase(UUID playerId, TurnPhase afterPhase) { + ListIterator it = this.listIterator(this.size()); + while (it.hasPrevious()) { + TurnMod turnMod = it.previous(); + if (turnMod.getExtraPhase() != null && turnMod.getPlayerId().equals(playerId) && turnMod.getExtraPhase() != null && (turnMod.getAfterPhase() == null || turnMod.getAfterPhase() == afterPhase)) { + it.remove(); + return turnMod.getExtraPhase(); + } + } + return null; + } - public boolean skipPhase(UUID playerId, TurnPhase phase) { - ListIterator it = this.listIterator(this.size()); - while (it.hasPrevious()) { - TurnMod turnMod = it.previous(); - if (turnMod.getSkipPhase() != null && turnMod.getPlayerId().equals(playerId) && turnMod.getSkipPhase() == phase) { - it.remove(); - return true; - } - } - return false; - } + public boolean skipPhase(UUID playerId, TurnPhase phase) { + ListIterator it = this.listIterator(this.size()); + while (it.hasPrevious()) { + TurnMod turnMod = it.previous(); + if (turnMod.getSkipPhase() != null && turnMod.getPlayerId().equals(playerId) && turnMod.getSkipPhase() == phase) { + it.remove(); + return true; + } + } + return false; + } - public TurnMods copy() { - return new TurnMods(this); - } + public TurnMods copy() { + return new TurnMods(this); + } } diff --git a/Mage/src/mage/game/turn/UntapStep.java b/Mage/src/mage/game/turn/UntapStep.java index b5602bde52..3faf2d1900 100644 --- a/Mage/src/mage/game/turn/UntapStep.java +++ b/Mage/src/mage/game/turn/UntapStep.java @@ -40,31 +40,31 @@ import mage.players.Player; */ public class UntapStep extends Step { - public UntapStep() { - super(PhaseStep.UNTAP, false); - this.stepEvent = EventType.UNTAP_STEP; - this.preStepEvent = EventType.UNTAP_STEP_PRE; - this.postStepEvent = EventType.UNTAP_STEP_POST; - } + public UntapStep() { + super(PhaseStep.UNTAP, false); + this.stepEvent = EventType.UNTAP_STEP; + this.preStepEvent = EventType.UNTAP_STEP_PRE; + this.postStepEvent = EventType.UNTAP_STEP_POST; + } - public UntapStep(final UntapStep step) { - super(step); - } + public UntapStep(final UntapStep step) { + super(step); + } - @Override - public void beginStep(Game game, UUID activePlayerId) { - super.beginStep(game, activePlayerId); - Player activePlayer = game.getPlayer(activePlayerId); - //20091005 - 502.1/703.4a - activePlayer.phasing(game); - //20091005 - 502.2/703.4b - activePlayer.untap(game); + @Override + public void beginStep(Game game, UUID activePlayerId) { + super.beginStep(game, activePlayerId); + Player activePlayer = game.getPlayer(activePlayerId); + //20091005 - 502.1/703.4a + activePlayer.phasing(game); + //20091005 - 502.2/703.4b + activePlayer.untap(game); game.applyEffects(); - } + } - @Override - public UntapStep copy() { - return new UntapStep(this); - } + @Override + public UntapStep copy() { + return new UntapStep(this); + } } diff --git a/Mage/src/mage/game/turn/UpkeepStep.java b/Mage/src/mage/game/turn/UpkeepStep.java index ed812473a9..2f004a31e1 100644 --- a/Mage/src/mage/game/turn/UpkeepStep.java +++ b/Mage/src/mage/game/turn/UpkeepStep.java @@ -37,20 +37,20 @@ import mage.game.events.GameEvent.EventType; */ public class UpkeepStep extends Step { - public UpkeepStep() { - super(PhaseStep.UPKEEP, true); - this.stepEvent = EventType.UPKEEP_STEP; - this.preStepEvent = EventType.UPKEEP_STEP_PRE; - this.postStepEvent = EventType.UPKEEP_STEP_POST; - } + public UpkeepStep() { + super(PhaseStep.UPKEEP, true); + this.stepEvent = EventType.UPKEEP_STEP; + this.preStepEvent = EventType.UPKEEP_STEP_PRE; + this.postStepEvent = EventType.UPKEEP_STEP_POST; + } - public UpkeepStep(final UpkeepStep step) { - super(step); - } + public UpkeepStep(final UpkeepStep step) { + super(step); + } - @Override - public UpkeepStep copy() { - return new UpkeepStep(this); - } + @Override + public UpkeepStep copy() { + return new UpkeepStep(this); + } } diff --git a/Mage/src/mage/players/Library.java b/Mage/src/mage/players/Library.java index a0e0cceb34..6c098e6b89 100644 --- a/Mage/src/mage/players/Library.java +++ b/Mage/src/mage/players/Library.java @@ -42,183 +42,183 @@ import java.util.*; */ public class Library implements Serializable { - private static Random rnd = new Random(); + private static Random rnd = new Random(); - private boolean emptyDraw; - private Deque library = new ArrayDeque(); - private UUID playerId; + private boolean emptyDraw; + private Deque library = new ArrayDeque(); + private UUID playerId; - public Library(UUID playerId) { - this.playerId = playerId; - } + public Library(UUID playerId) { + this.playerId = playerId; + } - public Library(final Library lib) { - this.emptyDraw = lib.emptyDraw; - this.playerId = lib.playerId; - for (UUID id: lib.library) { - this.library.addLast(id); - } - } + public Library(final Library lib) { + this.emptyDraw = lib.emptyDraw; + this.playerId = lib.playerId; + for (UUID id: lib.library) { + this.library.addLast(id); + } + } - public void shuffle() { - UUID[] shuffled = library.toArray(new UUID[0]); - for (int n = shuffled.length - 1; n > 0; n--) { - int r = rnd.nextInt(n); - UUID temp = shuffled[n]; - shuffled[n] = shuffled[r]; - shuffled[r] = temp; - } - library.clear(); + public void shuffle() { + UUID[] shuffled = library.toArray(new UUID[0]); + for (int n = shuffled.length - 1; n > 0; n--) { + int r = rnd.nextInt(n); + UUID temp = shuffled[n]; + shuffled[n] = shuffled[r]; + shuffled[r] = temp; + } + library.clear(); library.addAll(Arrays.asList(shuffled)); - } + } - /** - * Removes the top card of the Library and returns it - * - * @param game - * @return Card - * @see Card - */ - public Card removeFromTop(Game game) { - UUID cardId = library.pollFirst(); - Card card = game.getCard(cardId); - if (card == null) { - emptyDraw = true; - } - return card; - } + /** + * Removes the top card of the Library and returns it + * + * @param game + * @return Card + * @see Card + */ + public Card removeFromTop(Game game) { + UUID cardId = library.pollFirst(); + Card card = game.getCard(cardId); + if (card == null) { + emptyDraw = true; + } + return card; + } - /** - * Removes the bottom card of the Library and returns it - * - * @param game - * @return Card - * @see Card - */ - public Card removeFromBottom(Game game) { - UUID cardId = library.pollLast(); - Card card = game.getCard(cardId); - if (card == null) { - emptyDraw = true; - } - return card; - } + /** + * Removes the bottom card of the Library and returns it + * + * @param game + * @return Card + * @see Card + */ + public Card removeFromBottom(Game game) { + UUID cardId = library.pollLast(); + Card card = game.getCard(cardId); + if (card == null) { + emptyDraw = true; + } + return card; + } - /** - * Returns the top card of the Library without removing it - * - * @param game - * @return Card - * @see Card - */ - public Card getFromTop(Game game) { - return game.getCard(library.peekFirst()); - } + /** + * Returns the top card of the Library without removing it + * + * @param game + * @return Card + * @see Card + */ + public Card getFromTop(Game game) { + return game.getCard(library.peekFirst()); + } - public void putOnTop(Card card, Game game) { - if (card.getOwnerId().equals(playerId)) { - game.setZone(card.getId(), Zone.LIBRARY); - library.addFirst(card.getId()); - } - else { - game.getPlayer(card.getOwnerId()).getLibrary().putOnTop(card, game); - } - } + public void putOnTop(Card card, Game game) { + if (card.getOwnerId().equals(playerId)) { + game.setZone(card.getId(), Zone.LIBRARY); + library.addFirst(card.getId()); + } + else { + game.getPlayer(card.getOwnerId()).getLibrary().putOnTop(card, game); + } + } - public void putOnBottom(Card card, Game game) { - if (card.getOwnerId().equals(playerId)) { - game.setZone(card.getId(), Zone.LIBRARY); + public void putOnBottom(Card card, Game game) { + if (card.getOwnerId().equals(playerId)) { + game.setZone(card.getId(), Zone.LIBRARY); if (library.contains(card.getId())) { library.remove(card.getId()); } - library.add(card.getId()); - } - else { - game.getPlayer(card.getOwnerId()).getLibrary().putOnBottom(card, game); - } - } + library.add(card.getId()); + } + else { + game.getPlayer(card.getOwnerId()).getLibrary().putOnBottom(card, game); + } + } - public Library copy() { - return new Library(this); - } + public Library copy() { + return new Library(this); + } - public void clear() { - library.clear(); - } + public void clear() { + library.clear(); + } - public int size() { - return library.size(); - } - - public void set(Library newLibrary) { - library.clear(); - for (UUID card: newLibrary.getCardList()) { - library.add(card); - } - } + public int size() { + return library.size(); + } - public List getCardList() { - return new ArrayList(library); - } + public void set(Library newLibrary) { + library.clear(); + for (UUID card: newLibrary.getCardList()) { + library.add(card); + } + } - public List getCards(Game game) { - List cards = new ArrayList(); - for (UUID cardId: library) { - cards.add(game.getCard(cardId)); - } - return cards; - } + public List getCardList() { + return new ArrayList(library); + } - public Collection getUniqueCards(Game game) { - Map cards = new HashMap(); - for (UUID cardId: library) { - Card card = game.getCard(cardId); - if (!cards.containsKey(card.getName())) { - cards.put(card.getName(), card); - } - } - return cards.values(); - } + public List getCards(Game game) { + List cards = new ArrayList(); + for (UUID cardId: library) { + cards.add(game.getCard(cardId)); + } + return cards; + } - public int count(FilterCard filter, Game game) { - int result = 0; - for (UUID card: library) { - if (filter.match(game.getCard(card), game)) - result++; - } - return result; - } + public Collection getUniqueCards(Game game) { + Map cards = new HashMap(); + for (UUID cardId: library) { + Card card = game.getCard(cardId); + if (!cards.containsKey(card.getName())) { + cards.put(card.getName(), card); + } + } + return cards.values(); + } + + public int count(FilterCard filter, Game game) { + int result = 0; + for (UUID card: library) { + if (filter.match(game.getCard(card), game)) + result++; + } + return result; + } - public boolean isEmptyDraw() { - return emptyDraw; - } + public boolean isEmptyDraw() { + return emptyDraw; + } - public void addAll(Set cards, Game game) { - for (Card card: cards) { - game.setZone(card.getId(), Zone.LIBRARY); - library.add(card.getId()); - } - } + public void addAll(Set cards, Game game) { + for (Card card: cards) { + game.setZone(card.getId(), Zone.LIBRARY); + library.add(card.getId()); + } + } - public Card getCard(UUID cardId, Game game) { - for (UUID card: library) { - if (card.equals(cardId)) - return game.getCard(card); - } - return null; - } + public Card getCard(UUID cardId, Game game) { + for (UUID card: library) { + if (card.equals(cardId)) + return game.getCard(card); + } + return null; + } - public Card remove(UUID cardId, Game game) { - Iterator it = library.iterator(); - while(it.hasNext()) { - UUID card = it.next(); - if (card.equals(cardId)) { - it.remove(); - return game.getCard(card); - } - } - return null; - } + public Card remove(UUID cardId, Game game) { + Iterator it = library.iterator(); + while(it.hasNext()) { + UUID card = it.next(); + if (card.equals(cardId)) { + it.remove(); + return game.getCard(card); + } + } + return null; + } } diff --git a/Mage/src/mage/players/ManaPool.java b/Mage/src/mage/players/ManaPool.java index f59cec9092..f038a4996a 100644 --- a/Mage/src/mage/players/ManaPool.java +++ b/Mage/src/mage/players/ManaPool.java @@ -50,33 +50,33 @@ public class ManaPool implements Serializable { private List manaItems = new ArrayList(); - public ManaPool() {} + public ManaPool() {} - public ManaPool(final ManaPool pool) { + public ManaPool(final ManaPool pool) { for (ManaPoolItem item: pool.manaItems) { manaItems.add(item.copy()); } - } - - public int getRed() { - return get(ManaType.RED); - } + } - public int getGreen() { - return get(ManaType.GREEN); - } + public int getRed() { + return get(ManaType.RED); + } + + public int getGreen() { + return get(ManaType.GREEN); + } public int getBlue() { - return get(ManaType.BLUE); - } + return get(ManaType.BLUE); + } public int getWhite() { - return get(ManaType.WHITE); - } + return get(ManaType.WHITE); + } public int getBlack() { - return get(ManaType.BLACK); - } + return get(ManaType.BLACK); + } public boolean pay(ManaType manaType, Ability ability, Filter filter, Game game) { if (getConditional(manaType, ability, filter, game) > 0) { @@ -95,47 +95,47 @@ public class ManaPool implements Serializable { return false; } - public int get(ManaType manaType) { - return getMana().get(manaType); - } - - private int getConditional(ManaType manaType, Ability ability, Filter filter, Game game) { - if (ability == null || getConditionalMana().isEmpty()) { - return 0; - } - for (ManaPoolItem mana : manaItems) { - if (mana.isConditional() && mana.getConditionalMana().get(manaType) > 0 && mana.getConditionalMana().apply(ability, game, mana.getSourceId())) { + public int get(ManaType manaType) { + return getMana().get(manaType); + } + + private int getConditional(ManaType manaType, Ability ability, Filter filter, Game game) { + if (ability == null || getConditionalMana().isEmpty()) { + return 0; + } + for (ManaPoolItem mana : manaItems) { + if (mana.isConditional() && mana.getConditionalMana().get(manaType) > 0 && mana.getConditionalMana().apply(ability, game, mana.getSourceId())) { if (filter == null || filter.match(game.getObject(mana.getSourceId()), game)) return mana.getConditionalMana().get(manaType); - } - } - return 0; - } + } + } + return 0; + } - public int getConditionalCount(Ability ability, Game game, FilterMana filter) { - if (ability == null || getConditionalMana().isEmpty()) { - return 0; - } - int count = 0; - for (ConditionalMana mana : getConditionalMana()) { - if (mana.apply(ability, game, mana.getManaProducerId())) { - count += mana.count(filter); - } - } - return count; - } + public int getConditionalCount(Ability ability, Game game, FilterMana filter) { + if (ability == null || getConditionalMana().isEmpty()) { + return 0; + } + int count = 0; + for (ConditionalMana mana : getConditionalMana()) { + if (mana.apply(ability, game, mana.getManaProducerId())) { + count += mana.count(filter); + } + } + return count; + } public int getColorless() { - return get(ManaType.COLORLESS); - } + return get(ManaType.COLORLESS); + } - public int emptyPool() { - int total = count(); + public int emptyPool() { + int total = count(); manaItems.clear(); - return total; - } + return total; + } - private int payX(Ability ability, Game game) { + private int payX(Ability ability, Game game) { int total = 0; Iterator it = manaItems.iterator(); while (it.hasNext()) { @@ -153,7 +153,7 @@ public class ManaPool implements Serializable { } } return total; - } + } /** * remove all mana from pool that applies and that matches filter @@ -162,10 +162,10 @@ public class ManaPool implements Serializable { * @param filter * @return */ - public int payX(Ability ability, Game game, FilterMana filter) { - if (filter == null) { - return payX(ability, game); - } + public int payX(Ability ability, Game game, FilterMana filter) { + if (filter == null) { + return payX(ability, game); + } int total = 0; Iterator it = manaItems.iterator(); while (it.hasNext()) { @@ -212,77 +212,77 @@ public class ManaPool implements Serializable { } } return total; - } + } - public Mana getMana() { - Mana m = new Mana(); + public Mana getMana() { + Mana m = new Mana(); for (ManaPoolItem item: manaItems) { m.add(item.getMana()); } - return m; - } + return m; + } - public Mana getMana(FilterMana filter) { - if (filter == null) { - return getMana(); - } - Mana test = getMana(); + public Mana getMana(FilterMana filter) { + if (filter == null) { + return getMana(); + } + Mana test = getMana(); Mana m = new Mana(); - if (filter.isBlack()) m.setBlack(test.getBlack()); - if (filter.isBlue()) m.setBlue(test.getBlue()); - if (filter.isColorless()) m.setColorless(test.getColorless()); - if (filter.isGreen()) m.setGreen(test.getGreen()); - if (filter.isRed()) m.setRed(test.getRed()); - if (filter.isWhite()) m.setWhite(test.getWhite()); - return m; - } + if (filter.isBlack()) m.setBlack(test.getBlack()); + if (filter.isBlue()) m.setBlue(test.getBlue()); + if (filter.isColorless()) m.setColorless(test.getColorless()); + if (filter.isGreen()) m.setGreen(test.getGreen()); + if (filter.isRed()) m.setRed(test.getRed()); + if (filter.isWhite()) m.setWhite(test.getWhite()); + return m; + } - public Mana getAllConditionalMana(Ability ability, Game game, FilterMana filter) { - Mana m = new Mana(); - m.setColorless(getConditionalCount(ability, game, filter)); - return m; - } + public Mana getAllConditionalMana(Ability ability, Game game, FilterMana filter) { + Mana m = new Mana(); + m.setColorless(getConditionalCount(ability, game, filter)); + return m; + } - public void addMana(Mana mana, Game game, Ability source) { - if (mana instanceof ConditionalMana) { + public void addMana(Mana mana, Game game, Ability source) { + if (mana instanceof ConditionalMana) { this.manaItems.add(new ManaPoolItem((ConditionalMana)mana, source.getSourceId())); - } else { + } else { this.manaItems.add(new ManaPoolItem(mana.getRed(), mana.getGreen(), mana.getBlue(), mana.getWhite(), mana.getBlack(), mana.getColorless(), source.getSourceId())); - } + } GameEvent event = GameEvent.getEvent(GameEvent.EventType.MANA_ADDED, source.getSourceId(), source.getId(), source.getControllerId()); event.setData(mana.toString()); game.fireEvent(event); - } + } - public List getConditionalMana() { + public List getConditionalMana() { List conditionalMana = new ArrayList(); for (ManaPoolItem item: manaItems) { if (item.isConditional()) { conditionalMana.add(item.getConditionalMana()); } } - return conditionalMana; - } + return conditionalMana; + } - public int count() { + public int count() { int x = 0; for (ManaPoolItem item: manaItems) { x += item.count(); } return x; - } + } - public ManaPool copy() { - return new ManaPool(this); - } + public ManaPool copy() { + return new ManaPool(this); + } - private void removeConditional(ManaType manaType, Ability ability, Game game) { - for (ConditionalMana mana : getConditionalMana()) { - if (mana.get(manaType) > 0 && mana.apply(ability, game, mana.getManaProducerId())) { - mana.set(manaType, mana.get(manaType) - 1); + private void removeConditional(ManaType manaType, Ability ability, Game game) { + for (ConditionalMana mana : getConditionalMana()) { + if (mana.get(manaType) > 0 && mana.apply(ability, game, mana.getManaProducerId())) { + mana.set(manaType, mana.get(manaType) - 1); game.fireEvent(new GameEvent(GameEvent.EventType.MANA_PAYED, ability.getId(), mana.getManaProducerId(), ability.getControllerId())); break; - } - } - } + } + } + } } diff --git a/Mage/src/mage/players/ManaPoolItem.java b/Mage/src/mage/players/ManaPoolItem.java index 02eb38dc06..738d3b2d20 100644 --- a/Mage/src/mage/players/ManaPoolItem.java +++ b/Mage/src/mage/players/ManaPoolItem.java @@ -39,18 +39,18 @@ import java.util.UUID; * @author BetaSteward_at_googlemail.com */ public class ManaPoolItem implements Serializable { - - private int red = 0; - private int green = 0; - private int blue = 0; - private int white = 0; - private int black = 0; - private int colorless = 0; + + private int red = 0; + private int green = 0; + private int blue = 0; + private int white = 0; + private int black = 0; + private int colorless = 0; private ConditionalMana conditionalMana; private UUID sourceId; - + public ManaPoolItem() {} - + public ManaPoolItem(int red, int green, int blue, int white, int black, int colorless, UUID sourceId) { this.red = red; this.green = green; @@ -60,33 +60,33 @@ public class ManaPoolItem implements Serializable { this.colorless = colorless; this.sourceId = sourceId; } - + public ManaPoolItem(ConditionalMana conditionalMana, UUID sourceId) { this.conditionalMana = conditionalMana; this.sourceId = sourceId; this.conditionalMana.setManaProducerId(sourceId); } - + public ManaPoolItem(final ManaPoolItem item) { - this.red = item.red; - this.green = item.green; - this.blue = item.blue; - this.white = item.white; - this.black = item.black; - this.colorless = item.colorless; + this.red = item.red; + this.green = item.green; + this.blue = item.blue; + this.white = item.white; + this.black = item.black; + this.colorless = item.colorless; if (item.conditionalMana != null) this.conditionalMana = item.conditionalMana.copy(); this.sourceId = item.sourceId; } - + public ManaPoolItem copy() { return new ManaPoolItem(this); } - + public UUID getSourceId() { return sourceId; } - + public int getRed() { return red; } @@ -144,7 +144,7 @@ public class ManaPoolItem implements Serializable { public boolean isConditional() { return conditionalMana != null; } - + public ConditionalMana getConditionalMana() { return conditionalMana; } diff --git a/Mage/src/mage/players/Player.java b/Mage/src/mage/players/Player.java index d5855f8213..4151d2f0f0 100644 --- a/Mage/src/mage/players/Player.java +++ b/Mage/src/mage/players/Player.java @@ -67,192 +67,192 @@ import java.util.UUID; */ public interface Player extends MageItem, Copyable { - public boolean isHuman(); - public String getName(); - public RangeOfInfluence getRange(); - public Library getLibrary(); - public Cards getGraveyard(); - public Abilities getAbilities(); - public void addAbility(Ability ability); - public Counters getCounters(); - public int getLife(); - public void setLife(int life, Game game); - public int loseLife(int amount, Game game); - public boolean isCanLoseLife(); - public void setCanLoseLife(boolean canLoseLife); - public int gainLife(int amount, Game game); - public boolean isCanGainLife(); - public void setCanGainLife(boolean canGainLife); - public boolean isLifeTotalCanChange(); + public boolean isHuman(); + public String getName(); + public RangeOfInfluence getRange(); + public Library getLibrary(); + public Cards getGraveyard(); + public Abilities getAbilities(); + public void addAbility(Ability ability); + public Counters getCounters(); + public int getLife(); + public void setLife(int life, Game game); + public int loseLife(int amount, Game game); + public boolean isCanLoseLife(); + public void setCanLoseLife(boolean canLoseLife); + public int gainLife(int amount, Game game); + public boolean isCanGainLife(); + public void setCanGainLife(boolean canGainLife); + public boolean isLifeTotalCanChange(); public void setCanPayLifeCost(boolean canPayLifeCost); public boolean canPayLifeCost(); public void setCanPaySacrificeCost(boolean canPaySacrificeCost); public boolean canPaySacrificeCost(); - public void setLifeTotalCanChange(boolean lifeTotalCanChange); - public int damage(int damage, UUID sourceId, Game game, boolean combatDamage, boolean preventable); - public Cards getHand(); - public int getLandsPlayed(); - public int getLandsPerTurn(); - public void setLandsPerTurn(int landsPerTurn); - public int getMaxHandSize(); - public void setMaxHandSize(int maxHandSize); - public boolean isPassed(); - public boolean isEmptyDraw(); - public void pass(); - public void resetPassed(); - public boolean hasLost(); - public boolean hasWon(); - public boolean hasLeft(); - public ManaPool getManaPool(); - public Set getInRange(); - public boolean isTopCardRevealed(); - public void setTopCardRevealed(boolean topCardRevealed); - public UserData getUserData(); - public void setUserData(UserData userData); - public boolean canLose(Game game); + public void setLifeTotalCanChange(boolean lifeTotalCanChange); + public int damage(int damage, UUID sourceId, Game game, boolean combatDamage, boolean preventable); + public Cards getHand(); + public int getLandsPlayed(); + public int getLandsPerTurn(); + public void setLandsPerTurn(int landsPerTurn); + public int getMaxHandSize(); + public void setMaxHandSize(int maxHandSize); + public boolean isPassed(); + public boolean isEmptyDraw(); + public void pass(); + public void resetPassed(); + public boolean hasLost(); + public boolean hasWon(); + public boolean hasLeft(); + public ManaPool getManaPool(); + public Set getInRange(); + public boolean isTopCardRevealed(); + public void setTopCardRevealed(boolean topCardRevealed); + public UserData getUserData(); + public void setUserData(UserData userData); + public boolean canLose(Game game); - /** - * Returns a set of players which turns under you control. - * Doesn't include yourself. - * - * @return - */ - public Set getPlayersUnderYourControl(); + /** + * Returns a set of players which turns under you control. + * Doesn't include yourself. + * + * @return + */ + public Set getPlayersUnderYourControl(); - /** - * Defines player whose turn this player controls at the moment. - * @param playerId - */ - public void controlPlayersTurn(Game game, UUID playerId); + /** + * Defines player whose turn this player controls at the moment. + * @param playerId + */ + public void controlPlayersTurn(Game game, UUID playerId); - /** - * Sets player {@link UUID} who controls this player's turn. - * - * @param playerId - */ - public void setTurnControlledBy(UUID playerId); + /** + * Sets player {@link UUID} who controls this player's turn. + * + * @param playerId + */ + public void setTurnControlledBy(UUID playerId); - public UUID getTurnControlledBy(); + public UUID getTurnControlledBy(); - /** - * Resets players whose turns you control at the moment. - */ - public void resetOtherTurnsControlled(); + /** + * Resets players whose turns you control at the moment. + */ + public void resetOtherTurnsControlled(); - /** - * Returns false in case player don't control the game. - * - * Note: For effects like "You control target player during that player's next turn". - * - * @return - */ - public boolean isGameUnderControl(); + /** + * Returns false in case player don't control the game. + * + * Note: For effects like "You control target player during that player's next turn". + * + * @return + */ + public boolean isGameUnderControl(); - /** - * Returns false in case you don't control the game. - * - * Note: For effects like "You control target player during that player's next turn". - * - * @param value - */ - public void setGameUnderYourControl(boolean value); + /** + * Returns false in case you don't control the game. + * + * Note: For effects like "You control target player during that player's next turn". + * + * @param value + */ + public void setGameUnderYourControl(boolean value); - public boolean isTestMode(); - public void setTestMode(boolean value); - public void addAction(String action); - public void setAllowBadMoves(boolean allowBadMoves); - - public void init(Game game); - public void init(Game game, boolean testMode); - public void useDeck(Deck deck, Game game); - public void reset(); - public void shuffleLibrary(Game game); - public int drawCards(int num, Game game); - public boolean cast(SpellAbility ability, Game game, boolean noMana); - public boolean putInHand(Card card, Game game); - public boolean removeFromHand(Card card, Game game); - public boolean removeFromBattlefield(Permanent permanent, Game game); - public boolean putInGraveyard(Card card, Game game, boolean fromBattlefield); - public boolean removeFromGraveyard(Card card, Game game); - public boolean removeFromLibrary(Card card, Game game); - public boolean searchLibrary(TargetCardInLibrary target, Game game); - /** - * - * @param target - * @param game - * @param targetPlayerId player whose library will be searched - * @return true if search was successful - */ - public boolean searchLibrary(TargetCardInLibrary target, Game game, UUID targetPlayerId); - public boolean canPlayLand(); - public boolean playLand(Card card, Game game); - public boolean activateAbility(ActivatedAbility ability, Game game); - public boolean triggerAbility(TriggeredAbility ability, Game game); - public boolean canBeTargetedBy(MageObject source, Game game); - public boolean hasProtectionFrom(MageObject source, Game game); - public boolean flipCoin(Game game); - public void discard(int amount, Ability source, Game game); - public void discardToMax(Game game); - public boolean discard(Card card, Ability source, Game game); - public void lost(Game game); - public void won(Game game); - public void leave(); - public void concede(Game game); - public void abort(); - - public void revealCards(String name, Cards cards, Game game); - public void lookAtCards(String name, Cards cards, Game game); - - @Override - public Player copy(); - public void restore(Player player); + public boolean isTestMode(); + public void setTestMode(boolean value); + public void addAction(String action); + public void setAllowBadMoves(boolean allowBadMoves); - public void setResponseString(String responseString); - public void setResponseUUID(UUID responseUUID); - public void setResponseBoolean(Boolean responseBoolean); - public void setResponseInteger(Integer data); + public void init(Game game); + public void init(Game game, boolean testMode); + public void useDeck(Deck deck, Game game); + public void reset(); + public void shuffleLibrary(Game game); + public int drawCards(int num, Game game); + public boolean cast(SpellAbility ability, Game game, boolean noMana); + public boolean putInHand(Card card, Game game); + public boolean removeFromHand(Card card, Game game); + public boolean removeFromBattlefield(Permanent permanent, Game game); + public boolean putInGraveyard(Card card, Game game, boolean fromBattlefield); + public boolean removeFromGraveyard(Card card, Game game); + public boolean removeFromLibrary(Card card, Game game); + public boolean searchLibrary(TargetCardInLibrary target, Game game); + /** + * + * @param target + * @param game + * @param targetPlayerId player whose library will be searched + * @return true if search was successful + */ + public boolean searchLibrary(TargetCardInLibrary target, Game game, UUID targetPlayerId); + public boolean canPlayLand(); + public boolean playLand(Card card, Game game); + public boolean activateAbility(ActivatedAbility ability, Game game); + public boolean triggerAbility(TriggeredAbility ability, Game game); + public boolean canBeTargetedBy(MageObject source, Game game); + public boolean hasProtectionFrom(MageObject source, Game game); + public boolean flipCoin(Game game); + public void discard(int amount, Ability source, Game game); + public void discardToMax(Game game); + public boolean discard(Card card, Ability source, Game game); + public void lost(Game game); + public void won(Game game); + public void leave(); + public void concede(Game game); + public void abort(); - public abstract boolean priority(Game game); - public abstract boolean choose(Outcome outcome, Target target, UUID sourceId, Game game); - public abstract boolean choose(Outcome outcome, Target target, UUID sourceId, Game game, Map options); - public abstract boolean choose(Outcome outcome, Cards cards, TargetCard target, Game game); - public abstract boolean chooseTarget(Outcome outcome, Target target, Ability source, Game game); - public abstract boolean chooseTarget(Outcome outcome, Cards cards, TargetCard target, Ability source, Game game); - public abstract boolean chooseTargetAmount(Outcome outcome, TargetAmount target, Ability source, Game game); - public abstract boolean chooseMulligan(Game game); - public abstract boolean chooseUse(Outcome outcome, String message, Game game); - public abstract boolean choose(Outcome outcome, Choice choice, Game game); - public abstract boolean choosePile(Outcome outcome, String message, List pile1, List pile2, Game game); - public abstract boolean playMana(ManaCost unpaid, Game game); - public abstract boolean playXMana(VariableManaCost cost, ManaCosts costs, Game game); - public abstract int chooseEffect(List rEffects, Game game); - public abstract TriggeredAbility chooseTriggeredAbility(List abilities, Game game); - public abstract Mode chooseMode(Modes modes, Ability source, Game game); - public abstract void selectAttackers(Game game); - public abstract void selectBlockers(Game game); - public abstract UUID chooseAttackerOrder(List attacker, Game game); - public abstract UUID chooseBlockerOrder(List blockers, Game game); - public abstract void assignDamage(int damage, List targets, String singleTargetName, UUID sourceId, Game game); - public abstract int getAmount(int min, int max, String message, Game game); - public abstract void sideboard(Match match, Deck deck); - public abstract void construct(Tournament tournament, Deck deck); - public abstract void pickCard(List cards, Deck deck, Draft draft); - - public void declareAttacker(UUID attackerId, UUID defenderId, Game game); - public void declareBlocker(UUID blockerId, UUID attackerId, Game game); - public List getAvailableAttackers(Game game); - public List getAvailableBlockers(Game game); - - public void beginTurn(Game game); - public void endOfTurn(Game game); - public void phasing(Game game); - public void untap(Game game); + public void revealCards(String name, Cards cards, Game game); + public void lookAtCards(String name, Cards cards, Game game); - public List getPlayable(Game game, boolean hidden); - public List getPlayableOptions(Ability ability, Game game); - - public void addCounters(Counter counter, Game game); - public List getAttachments(); - public boolean addAttachment(UUID permanentId, Game game); - public boolean removeAttachment(UUID permanentId, Game game); + @Override + public Player copy(); + public void restore(Player player); + + public void setResponseString(String responseString); + public void setResponseUUID(UUID responseUUID); + public void setResponseBoolean(Boolean responseBoolean); + public void setResponseInteger(Integer data); + + public abstract boolean priority(Game game); + public abstract boolean choose(Outcome outcome, Target target, UUID sourceId, Game game); + public abstract boolean choose(Outcome outcome, Target target, UUID sourceId, Game game, Map options); + public abstract boolean choose(Outcome outcome, Cards cards, TargetCard target, Game game); + public abstract boolean chooseTarget(Outcome outcome, Target target, Ability source, Game game); + public abstract boolean chooseTarget(Outcome outcome, Cards cards, TargetCard target, Ability source, Game game); + public abstract boolean chooseTargetAmount(Outcome outcome, TargetAmount target, Ability source, Game game); + public abstract boolean chooseMulligan(Game game); + public abstract boolean chooseUse(Outcome outcome, String message, Game game); + public abstract boolean choose(Outcome outcome, Choice choice, Game game); + public abstract boolean choosePile(Outcome outcome, String message, List pile1, List pile2, Game game); + public abstract boolean playMana(ManaCost unpaid, Game game); + public abstract boolean playXMana(VariableManaCost cost, ManaCosts costs, Game game); + public abstract int chooseEffect(List rEffects, Game game); + public abstract TriggeredAbility chooseTriggeredAbility(List abilities, Game game); + public abstract Mode chooseMode(Modes modes, Ability source, Game game); + public abstract void selectAttackers(Game game); + public abstract void selectBlockers(Game game); + public abstract UUID chooseAttackerOrder(List attacker, Game game); + public abstract UUID chooseBlockerOrder(List blockers, Game game); + public abstract void assignDamage(int damage, List targets, String singleTargetName, UUID sourceId, Game game); + public abstract int getAmount(int min, int max, String message, Game game); + public abstract void sideboard(Match match, Deck deck); + public abstract void construct(Tournament tournament, Deck deck); + public abstract void pickCard(List cards, Deck deck, Draft draft); + + public void declareAttacker(UUID attackerId, UUID defenderId, Game game); + public void declareBlocker(UUID blockerId, UUID attackerId, Game game); + public List getAvailableAttackers(Game game); + public List getAvailableBlockers(Game game); + + public void beginTurn(Game game); + public void endOfTurn(Game game); + public void phasing(Game game); + public void untap(Game game); + + public List getPlayable(Game game, boolean hidden); + public List getPlayableOptions(Ability ability, Game game); + + public void addCounters(Counter counter, Game game); + public List getAttachments(); + public boolean addAttachment(UUID permanentId, Game game); + public boolean removeAttachment(UUID permanentId, Game game); } diff --git a/Mage/src/mage/players/PlayerImpl.java b/Mage/src/mage/players/PlayerImpl.java index cf2f487f4c..2970d64016 100644 --- a/Mage/src/mage/players/PlayerImpl.java +++ b/Mage/src/mage/players/PlayerImpl.java @@ -78,330 +78,330 @@ public abstract class PlayerImpl> implements Player, Ser private static final transient Logger log = Logger.getLogger(PlayerImpl.class); private static Random rnd = new Random(); - - protected boolean abort; - protected final UUID playerId; - protected String name; - protected boolean human; - protected int life; - protected boolean wins; - protected boolean loses; - protected Library library; - protected Cards hand; - protected Cards graveyard; - protected Abilities abilities; - protected Counters counters; - protected int landsPlayed; - protected int landsPerTurn = 1; - protected int maxHandSize = 7; - protected ManaPool manaPool; - protected boolean passed; - protected boolean passedTurn; - protected boolean left; - protected RangeOfInfluence range; - protected Set inRange = new HashSet(); - protected boolean isTestMode = false; - protected boolean canGainLife = true; - protected boolean canLoseLife = true; + + protected boolean abort; + protected final UUID playerId; + protected String name; + protected boolean human; + protected int life; + protected boolean wins; + protected boolean loses; + protected Library library; + protected Cards hand; + protected Cards graveyard; + protected Abilities abilities; + protected Counters counters; + protected int landsPlayed; + protected int landsPerTurn = 1; + protected int maxHandSize = 7; + protected ManaPool manaPool; + protected boolean passed; + protected boolean passedTurn; + protected boolean left; + protected RangeOfInfluence range; + protected Set inRange = new HashSet(); + protected boolean isTestMode = false; + protected boolean canGainLife = true; + protected boolean canLoseLife = true; protected boolean canPayLifeCost = true; protected boolean canPaySacrificeCost = true; - protected boolean isGameUnderControl = true; - protected UUID turnController; - protected Set playersUnderYourControl = new HashSet(); + protected boolean isGameUnderControl = true; + protected UUID turnController; + protected Set playersUnderYourControl = new HashSet(); protected List attachments = new ArrayList(); - protected boolean topCardRevealed = false; + protected boolean topCardRevealed = false; - protected UserData userData; + protected UserData userData; - @Override - public abstract T copy(); + @Override + public abstract T copy(); - public PlayerImpl(String name, RangeOfInfluence range) { - this(UUID.randomUUID()); - this.name = name; - this.range = range; - hand = new CardsImpl(Zone.HAND); - graveyard = new CardsImpl(Zone.GRAVEYARD); - abilities = new AbilitiesImpl(); - counters = new Counters(); - manaPool = new ManaPool(); - library = new Library(playerId); - } + public PlayerImpl(String name, RangeOfInfluence range) { + this(UUID.randomUUID()); + this.name = name; + this.range = range; + hand = new CardsImpl(Zone.HAND); + graveyard = new CardsImpl(Zone.GRAVEYARD); + abilities = new AbilitiesImpl(); + counters = new Counters(); + manaPool = new ManaPool(); + library = new Library(playerId); + } - protected PlayerImpl(UUID id) { - this.playerId = id; - } + protected PlayerImpl(UUID id) { + this.playerId = id; + } - public PlayerImpl(final PlayerImpl player) { - this.abort = player.abort; - this.playerId = player.playerId; - this.name = player.name; - this.human = player.human; - this.life = player.life; - this.wins = player.wins; - this.loses = player.loses; - this.library = player.library.copy(); - this.hand = player.hand.copy(); - this.graveyard = player.graveyard.copy(); - this.abilities = player.abilities.copy(); - this.counters = player.counters.copy(); - this.landsPlayed = player.landsPlayed; - this.landsPerTurn = player.landsPerTurn; - this.maxHandSize = player.maxHandSize; - this.manaPool = player.manaPool.copy(); - this.passed = player.passed; - this.passedTurn = player.passedTurn; - this.left = player.left; - this.range = player.range; + public PlayerImpl(final PlayerImpl player) { + this.abort = player.abort; + this.playerId = player.playerId; + this.name = player.name; + this.human = player.human; + this.life = player.life; + this.wins = player.wins; + this.loses = player.loses; + this.library = player.library.copy(); + this.hand = player.hand.copy(); + this.graveyard = player.graveyard.copy(); + this.abilities = player.abilities.copy(); + this.counters = player.counters.copy(); + this.landsPlayed = player.landsPlayed; + this.landsPerTurn = player.landsPerTurn; + this.maxHandSize = player.maxHandSize; + this.manaPool = player.manaPool.copy(); + this.passed = player.passed; + this.passedTurn = player.passedTurn; + this.left = player.left; + this.range = player.range; this.canGainLife = player.canGainLife; this.canLoseLife = player.canLoseLife; this.attachments.addAll(player.attachments); this.inRange.addAll(player.inRange); - this.userData = player.userData; + this.userData = player.userData; this.canPayLifeCost = player.canPayLifeCost; this.canPaySacrificeCost = player.canPaySacrificeCost; - } + } - @Override - public void useDeck(Deck deck, Game game) { - library.clear(); - library.addAll(deck.getCards(), game); - } + @Override + public void useDeck(Deck deck, Game game) { + library.clear(); + library.addAll(deck.getCards(), game); + } - @Override - public void init(Game game) { - init(game, false); - } + @Override + public void init(Game game) { + init(game, false); + } - @Override - public void init(Game game, boolean testMode) { - this.abort = false; - if (!testMode) { - this.hand.clear(); - this.graveyard.clear(); - } - this.abilities.clear(); - this.counters.clear(); - this.wins = false; - this.loses = false; - this.left = false; - this.passed = false; - this.passedTurn = false; + @Override + public void init(Game game, boolean testMode) { + this.abort = false; + if (!testMode) { + this.hand.clear(); + this.graveyard.clear(); + } + this.abilities.clear(); + this.counters.clear(); + this.wins = false; + this.loses = false; + this.left = false; + this.passed = false; + this.passedTurn = false; this.canGainLife = true; this.canLoseLife = true; game.getState().getWatchers().add(new BloodthirstWatcher(playerId)); - } + } - @Override - public void reset() { - this.abilities.clear(); - this.landsPerTurn = 1; - this.maxHandSize = 7; + @Override + public void reset() { + this.abilities.clear(); + this.landsPerTurn = 1; + this.maxHandSize = 7; this.canGainLife = true; this.canLoseLife = true; this.canPayLifeCost = true; this.canPaySacrificeCost = true; - this.topCardRevealed = false; - } + this.topCardRevealed = false; + } - @Override - public Counters getCounters() { - return counters; - } + @Override + public Counters getCounters() { + return counters; + } - @Override - public void beginTurn(Game game) { - this.landsPlayed = 0; - findRange(game); - } + @Override + public void beginTurn(Game game) { + this.landsPlayed = 0; + findRange(game); + } @Override public RangeOfInfluence getRange() { return range; } - - protected void findRange(Game game) { - //20100423 - 801.2c - inRange.clear(); - if (range == RangeOfInfluence.ALL) { - for (Player player: game.getPlayers().values()) { - if (!player.hasLeft()) - inRange.add(player.getId()); - } - } - else { - if ((range.getRange() * 2) + 1 >= game.getPlayers().size()) { - for (Player player: game.getPlayers().values()) { - if (!player.hasLeft()) - inRange.add(player.getId()); - } - } - else { - inRange.add(playerId); - PlayerList players = game.getState().getPlayerList(playerId); - for (int i = 0; i < range.getRange(); i++) { - Player player = players.getNext(game); - while (player.hasLeft()) - player = players.getNext(game); - inRange.add(player.getId()); - } - players = game.getState().getPlayerList(playerId); - for (int i = 0; i < range.getRange(); i++) { - Player player = players.getPrevious(game); - while (player.hasLeft()) - player = players.getPrevious(game); - inRange.add(player.getId()); - } - } - } - } - @Override - public Set getInRange() { - return inRange; - } - - @Override - public Set getPlayersUnderYourControl() { - return this.playersUnderYourControl; - } - - @Override - public void controlPlayersTurn(Game game, UUID playerId) { - if (!playerId.equals(this.getId())) { - this.playersUnderYourControl.add(playerId); - Player player = game.getPlayer(playerId); - if (!player.hasLeft() && !player.hasLost()) { - player.setGameUnderYourControl(false); - player.setTurnControlledBy(this.getId()); - } - DelayedTriggeredAbility ability = new AtTheEndOfTurnStepPostDelayedTriggeredAbility(new LoseControlOnOtherPlayersControllerEffect()); - ability.setSourceId(getId()); - ability.setControllerId(getId()); - game.addDelayedTriggeredAbility(ability); - } - } + protected void findRange(Game game) { + //20100423 - 801.2c + inRange.clear(); + if (range == RangeOfInfluence.ALL) { + for (Player player: game.getPlayers().values()) { + if (!player.hasLeft()) + inRange.add(player.getId()); + } + } + else { + if ((range.getRange() * 2) + 1 >= game.getPlayers().size()) { + for (Player player: game.getPlayers().values()) { + if (!player.hasLeft()) + inRange.add(player.getId()); + } + } + else { + inRange.add(playerId); + PlayerList players = game.getState().getPlayerList(playerId); + for (int i = 0; i < range.getRange(); i++) { + Player player = players.getNext(game); + while (player.hasLeft()) + player = players.getNext(game); + inRange.add(player.getId()); + } + players = game.getState().getPlayerList(playerId); + for (int i = 0; i < range.getRange(); i++) { + Player player = players.getPrevious(game); + while (player.hasLeft()) + player = players.getPrevious(game); + inRange.add(player.getId()); + } + } + } + } @Override - public void setTurnControlledBy(UUID playerId) { - this.turnController = playerId; - } + public Set getInRange() { + return inRange; + } @Override - public UUID getTurnControlledBy() { - return this.turnController; - } + public Set getPlayersUnderYourControl() { + return this.playersUnderYourControl; + } - @Override - public void resetOtherTurnsControlled() { - playersUnderYourControl.clear(); - } + @Override + public void controlPlayersTurn(Game game, UUID playerId) { + if (!playerId.equals(this.getId())) { + this.playersUnderYourControl.add(playerId); + Player player = game.getPlayer(playerId); + if (!player.hasLeft() && !player.hasLost()) { + player.setGameUnderYourControl(false); + player.setTurnControlledBy(this.getId()); + } + DelayedTriggeredAbility ability = new AtTheEndOfTurnStepPostDelayedTriggeredAbility(new LoseControlOnOtherPlayersControllerEffect()); + ability.setSourceId(getId()); + ability.setControllerId(getId()); + game.addDelayedTriggeredAbility(ability); + } + } - @Override - public boolean isGameUnderControl() { - return isGameUnderControl; - } + @Override + public void setTurnControlledBy(UUID playerId) { + this.turnController = playerId; + } - @Override - public void setGameUnderYourControl(boolean value) { - this.isGameUnderControl = value; - } + @Override + public UUID getTurnControlledBy() { + return this.turnController; + } - @Override - public void endOfTurn(Game game) { - this.passedTurn = false; - } + @Override + public void resetOtherTurnsControlled() { + playersUnderYourControl.clear(); + } - @Override - public boolean canBeTargetedBy(MageObject source, Game game) { - if (this.hasLost() || this.hasLeft()) - return false; - if (source != null) { - if (abilities.containsKey(ShroudAbility.getInstance().getId())) - return false; + @Override + public boolean isGameUnderControl() { + return isGameUnderControl; + } - if (hasProtectionFrom(source, game)) - return false; - } + @Override + public void setGameUnderYourControl(boolean value) { + this.isGameUnderControl = value; + } - return true; - } + @Override + public void endOfTurn(Game game) { + this.passedTurn = false; + } - @Override - public boolean hasProtectionFrom(MageObject source, Game game) { - for (ProtectionAbility ability: abilities.getProtectionAbilities()) { - if (!ability.canTarget(source, game)) - return true; - } - return false; - } + @Override + public boolean canBeTargetedBy(MageObject source, Game game) { + if (this.hasLost() || this.hasLeft()) + return false; + if (source != null) { + if (abilities.containsKey(ShroudAbility.getInstance().getId())) + return false; - @Override - public int drawCards(int num, Game game) { + if (hasProtectionFrom(source, game)) + return false; + } + + return true; + } + + @Override + public boolean hasProtectionFrom(MageObject source, Game game) { + for (ProtectionAbility ability: abilities.getProtectionAbilities()) { + if (!ability.canTarget(source, game)) + return true; + } + return false; + } + + @Override + public int drawCards(int num, Game game) { return game.doAction(new MageDrawAction(this, num)); - } + } - @Override - public void discardToMax(Game game) { - while (hand.size() > this.maxHandSize) { - TargetDiscard target = new TargetDiscard(playerId); - choose(Outcome.Discard, target, null, game); - discard(hand.get(target.getFirstTarget(), game), null, game); - } - } + @Override + public void discardToMax(Game game) { + while (hand.size() > this.maxHandSize) { + TargetDiscard target = new TargetDiscard(playerId); + choose(Outcome.Discard, target, null, game); + discard(hand.get(target.getFirstTarget(), game), null, game); + } + } - @Override - public boolean putInHand(Card card, Game game) { - if (card.getOwnerId().equals(playerId)) { - this.hand.add(card); + @Override + public boolean putInHand(Card card, Game game) { + if (card.getOwnerId().equals(playerId)) { + this.hand.add(card); game.setZone(card.getId(), Zone.HAND); - } else { - return game.getPlayer(card.getOwnerId()).putInHand(card, game); - } - return true; - } + } else { + return game.getPlayer(card.getOwnerId()).putInHand(card, game); + } + return true; + } - @Override - public boolean removeFromHand(Card card, Game game) { - hand.remove(card); - return true; - } - - @Override - public boolean removeFromLibrary(Card card, Game game) { - if (card == null) return false; - library.remove(card.getId(), game); - return true; - } + @Override + public boolean removeFromHand(Card card, Game game) { + hand.remove(card); + return true; + } - @Override - public void discard(int amount, Ability source, Game game) { - if (amount >= hand.size()) { - int discardAmount = hand.size(); - while (hand.size() > 0) { - discard(hand.get(hand.iterator().next(), game), source, game); - } - game.fireInformEvent(name + " discards " + Integer.toString(discardAmount) + " card" + (discardAmount > 1?"s":"")); - return; - } + @Override + public boolean removeFromLibrary(Card card, Game game) { + if (card == null) return false; + library.remove(card.getId(), game); + return true; + } + + @Override + public void discard(int amount, Ability source, Game game) { + if (amount >= hand.size()) { + int discardAmount = hand.size(); + while (hand.size() > 0) { + discard(hand.get(hand.iterator().next(), game), source, game); + } + game.fireInformEvent(name + " discards " + Integer.toString(discardAmount) + " card" + (discardAmount > 1?"s":"")); + return; + } int numDiscarded = 0; - while (numDiscarded < amount) { + while (numDiscarded < amount) { if (hand.size() == 0) break; - TargetDiscard target = new TargetDiscard(playerId); - choose(Outcome.Discard, target, source.getSourceId(), game); + TargetDiscard target = new TargetDiscard(playerId); + choose(Outcome.Discard, target, source.getSourceId(), game); Card card = hand.get(target.getFirstTarget(), game); if (card != null && discard(card, source, game)) { numDiscarded++; } - } - game.fireInformEvent(name + " discards " + Integer.toString(numDiscarded) + " card" + (numDiscarded > 1?"s":"")); - } + } + game.fireInformEvent(name + " discards " + Integer.toString(numDiscarded) + " card" + (numDiscarded > 1?"s":"")); + } - @Override - public boolean discard(Card card, Ability source, Game game) { - //20100716 - 701.7 + @Override + public boolean discard(Card card, Ability source, Game game) { + //20100716 - 701.7 if (card != null) { removeFromHand(card, game); card.moveToZone(Zone.GRAVEYARD, source==null?null:source.getId(), game, false); @@ -410,122 +410,122 @@ public abstract class PlayerImpl> implements Player, Ser return true; } return false; - } + } - @Override - public List getAttachments() { - return attachments; - } + @Override + public List getAttachments() { + return attachments; + } - @Override - public boolean addAttachment(UUID permanentId, Game game) { - if (!this.attachments.contains(permanentId)) { + @Override + public boolean addAttachment(UUID permanentId, Game game) { + if (!this.attachments.contains(permanentId)) { Permanent aura = game.getPermanent(permanentId); - if (aura != null) { + if (aura != null) { if (!game.replaceEvent(new GameEvent(GameEvent.EventType.ENCHANT_PLAYER, playerId, permanentId, aura.getControllerId()))) { this.attachments.add(permanentId); - aura.attachTo(playerId, game); - game.fireEvent(new GameEvent(GameEvent.EventType.ENCHANTED_PLAYER, playerId, permanentId, aura.getControllerId())); - return true; - } - } - } - return false; - } + aura.attachTo(playerId, game); + game.fireEvent(new GameEvent(GameEvent.EventType.ENCHANTED_PLAYER, playerId, permanentId, aura.getControllerId())); + return true; + } + } + } + return false; + } - @Override - public boolean removeAttachment(UUID permanentId, Game game) { - if (this.attachments.contains(permanentId)) { - Permanent aura = game.getPermanent(permanentId); - if (aura != null) { - if (!game.replaceEvent(new GameEvent(GameEvent.EventType.UNATTACH, playerId, permanentId, aura.getControllerId()))) { - this.attachments.remove(permanentId); - aura.attachTo(null, game); - } - game.fireEvent(new GameEvent(GameEvent.EventType.UNATTACHED, playerId, permanentId, aura.getControllerId())); - return true; - } - } - return false; - } - @Override - public boolean removeFromBattlefield(Permanent permanent, Game game) { - permanent.removeFromCombat(game); - game.getBattlefield().removePermanent(permanent.getId()); - if (permanent.getAttachedTo() != null) { - Permanent attachedTo = game.getPermanent(permanent.getAttachedTo()); - if (attachedTo != null) - attachedTo.removeAttachment(permanent.getId(), game); - } - return true; - } + public boolean removeAttachment(UUID permanentId, Game game) { + if (this.attachments.contains(permanentId)) { + Permanent aura = game.getPermanent(permanentId); + if (aura != null) { + if (!game.replaceEvent(new GameEvent(GameEvent.EventType.UNATTACH, playerId, permanentId, aura.getControllerId()))) { + this.attachments.remove(permanentId); + aura.attachTo(null, game); + } + game.fireEvent(new GameEvent(GameEvent.EventType.UNATTACHED, playerId, permanentId, aura.getControllerId())); + return true; + } + } + return false; + } - @Override - public boolean putInGraveyard(Card card, Game game, boolean fromBattlefield) { - if (card.getOwnerId().equals(playerId)) { - this.graveyard.add(card); - } else { - return game.getPlayer(card.getOwnerId()).putInGraveyard(card, game, fromBattlefield); - } - return true; - } + @Override + public boolean removeFromBattlefield(Permanent permanent, Game game) { + permanent.removeFromCombat(game); + game.getBattlefield().removePermanent(permanent.getId()); + if (permanent.getAttachedTo() != null) { + Permanent attachedTo = game.getPermanent(permanent.getAttachedTo()); + if (attachedTo != null) + attachedTo.removeAttachment(permanent.getId(), game); + } + return true; + } - @Override - public boolean removeFromGraveyard(Card card, Game game) { - this.graveyard.remove(card); - return true; - } + @Override + public boolean putInGraveyard(Card card, Game game, boolean fromBattlefield) { + if (card.getOwnerId().equals(playerId)) { + this.graveyard.add(card); + } else { + return game.getPlayer(card.getOwnerId()).putInGraveyard(card, game, fromBattlefield); + } + return true; + } - @Override - public boolean cast(SpellAbility ability, Game game, boolean noMana) { - //20091005 - 601.2a - Card card = game.getCard(ability.getSourceId()); - if (card != null) { - if (!game.replaceEvent(GameEvent.getEvent(GameEvent.EventType.CAST_SPELL, ability.getId(), ability.getSourceId(), playerId))) { - int bookmark = game.bookmarkState(); + @Override + public boolean removeFromGraveyard(Card card, Game game) { + this.graveyard.remove(card); + return true; + } + + @Override + public boolean cast(SpellAbility ability, Game game, boolean noMana) { + //20091005 - 601.2a + Card card = game.getCard(ability.getSourceId()); + if (card != null) { + if (!game.replaceEvent(GameEvent.getEvent(GameEvent.EventType.CAST_SPELL, ability.getId(), ability.getSourceId(), playerId))) { + int bookmark = game.bookmarkState(); Zone fromZone = game.getState().getZone(card.getId()); - card.cast(game, fromZone, ability, playerId); + card.cast(game, fromZone, ability, playerId); - Ability spellAbility = game.getStack().getSpell(ability.getId()).getSpellAbility(); - if (spellAbility.activate(game, noMana)) { - for (KickerAbility kicker: card.getAbilities().getKickerAbilities()) { + Ability spellAbility = game.getStack().getSpell(ability.getId()).getSpellAbility(); + if (spellAbility.activate(game, noMana)) { + for (KickerAbility kicker: card.getAbilities().getKickerAbilities()) { if (kicker.getCosts().canPay(ability.getSourceId(), playerId, game) && kicker.canChooseTarget(game)) kicker.activate(game, false); - } + } GameEvent event = GameEvent.getEvent(GameEvent.EventType.SPELL_CAST, spellAbility.getId(), spellAbility.getSourceId(), playerId); event.setZone(fromZone); - game.fireEvent(event); - game.fireInformEvent(name + " casts " + card.getName()); - game.removeBookmark(bookmark); - return true; - } - game.restoreState(bookmark); - } - } - return false; - } + game.fireEvent(event); + game.fireInformEvent(name + " casts " + card.getName()); + game.removeBookmark(bookmark); + return true; + } + game.restoreState(bookmark); + } + } + return false; + } - @Override - public boolean playLand(Card card, Game game) { - //20091005 - 305.1 - if (!game.replaceEvent(GameEvent.getEvent(GameEvent.EventType.PLAY_LAND, card.getId(), playerId))) { - int bookmark = game.bookmarkState(); - Zone zone = game.getState().getZone(card.getId()); - if (card.putOntoBattlefield(game, zone, null, playerId)) { - landsPlayed++; - game.fireEvent(GameEvent.getEvent(GameEvent.EventType.LAND_PLAYED, card.getId(), playerId)); - game.fireInformEvent(name + " plays " + card.getName()); - game.removeBookmark(bookmark); - return true; - } - game.restoreState(bookmark); - } - return false; - } + @Override + public boolean playLand(Card card, Game game) { + //20091005 - 305.1 + if (!game.replaceEvent(GameEvent.getEvent(GameEvent.EventType.PLAY_LAND, card.getId(), playerId))) { + int bookmark = game.bookmarkState(); + Zone zone = game.getState().getZone(card.getId()); + if (card.putOntoBattlefield(game, zone, null, playerId)) { + landsPlayed++; + game.fireEvent(GameEvent.getEvent(GameEvent.EventType.LAND_PLAYED, card.getId(), playerId)); + game.fireInformEvent(name + " plays " + card.getName()); + game.removeBookmark(bookmark); + return true; + } + game.restoreState(bookmark); + } + return false; + } - protected boolean playManaAbility(ManaAbility ability, Game game) { - if (!game.replaceEvent(GameEvent.getEvent(GameEvent.EventType.ACTIVATE_ABILITY, ability.getId(), ability.getSourceId(), playerId))) { + protected boolean playManaAbility(ManaAbility ability, Game game) { + if (!game.replaceEvent(GameEvent.getEvent(GameEvent.EventType.ACTIVATE_ABILITY, ability.getId(), ability.getSourceId(), playerId))) { int bookmark = game.bookmarkState(); if (ability.activate(game, false)) { ability.resolve(game); @@ -534,10 +534,10 @@ public abstract class PlayerImpl> implements Player, Ser } game.restoreState(bookmark); } - return false; - } + return false; + } - protected boolean playAbility(ActivatedAbility ability, Game game) { + protected boolean playAbility(ActivatedAbility ability, Game game) { //20091005 - 602.2a if (ability.isUsesStack()) { if (!game.replaceEvent(GameEvent.getEvent(GameEvent.EventType.ACTIVATE_ABILITY, ability.getId(), ability.getSourceId(), playerId))) { @@ -561,105 +561,105 @@ public abstract class PlayerImpl> implements Player, Ser } game.restoreState(bookmark); } - return false; - } + return false; + } - protected boolean specialAction(SpecialAction action, Game game) { - //20091005 - 114 - if (!game.replaceEvent(GameEvent.getEvent(GameEvent.EventType.ACTIVATE_ABILITY, action.getSourceId(), action.getId(), playerId))) { - int bookmark = game.bookmarkState(); - if (action.activate(game, false)) { - game.fireEvent(GameEvent.getEvent(GameEvent.EventType.ACTIVATED_ABILITY, action.getSourceId(), action.getId(), playerId)); - game.fireInformEvent(name + action.getActivatedMessage(game)); - if (action.resolve(game)) { - game.removeBookmark(bookmark); - return true; - } - } - game.restoreState(bookmark); - } - return false; - } + protected boolean specialAction(SpecialAction action, Game game) { + //20091005 - 114 + if (!game.replaceEvent(GameEvent.getEvent(GameEvent.EventType.ACTIVATE_ABILITY, action.getSourceId(), action.getId(), playerId))) { + int bookmark = game.bookmarkState(); + if (action.activate(game, false)) { + game.fireEvent(GameEvent.getEvent(GameEvent.EventType.ACTIVATED_ABILITY, action.getSourceId(), action.getId(), playerId)); + game.fireInformEvent(name + action.getActivatedMessage(game)); + if (action.resolve(game)) { + game.removeBookmark(bookmark); + return true; + } + } + game.restoreState(bookmark); + } + return false; + } - @Override - public boolean activateAbility(ActivatedAbility ability, Game game) { - boolean result; - if (!ability.canActivate(this.playerId, game)) - return false; + @Override + public boolean activateAbility(ActivatedAbility ability, Game game) { + boolean result; + if (!ability.canActivate(this.playerId, game)) + return false; - if (ability instanceof PassAbility) { + if (ability instanceof PassAbility) { pass(); - return true; - } - else if (ability instanceof PlayLandAbility) { - Card card = hand.get(ability.getSourceId(), game); - if (card == null) { - card = game.getCard(ability.getSourceId()); - } - result = playLand(card, game); - } - else if (ability instanceof SpecialAction) { - result = specialAction((SpecialAction)ability.copy(), game); - } - else if (ability instanceof ManaAbility) { - result = playManaAbility((ManaAbility)ability.copy(), game); - } - else if (ability instanceof SpellAbility) { - result = cast((SpellAbility)ability, game, false); - } - else { - result = playAbility((ActivatedAbility)ability.copy(), game); - } + return true; + } + else if (ability instanceof PlayLandAbility) { + Card card = hand.get(ability.getSourceId(), game); + if (card == null) { + card = game.getCard(ability.getSourceId()); + } + result = playLand(card, game); + } + else if (ability instanceof SpecialAction) { + result = specialAction((SpecialAction)ability.copy(), game); + } + else if (ability instanceof ManaAbility) { + result = playManaAbility((ManaAbility)ability.copy(), game); + } + else if (ability instanceof SpellAbility) { + result = cast((SpellAbility)ability, game, false); + } + else { + result = playAbility((ActivatedAbility)ability.copy(), game); + } - //if player has taken an action then reset all player passed flags - if (result) - game.getPlayers().resetPassed(); - return result; - } + //if player has taken an action then reset all player passed flags + if (result) + game.getPlayers().resetPassed(); + return result; + } - @Override - public boolean triggerAbility(TriggeredAbility source, Game game) { + @Override + public boolean triggerAbility(TriggeredAbility source, Game game) { if (source == null) { log.warn("Null source in triggerAbility method"); return false; } - //20091005 - 603.3c, 603.3d - int bookmark = game.bookmarkState(); + //20091005 - 603.3c, 603.3d + int bookmark = game.bookmarkState(); //FIXME: remove try\catch once we find out the reason for NPE on server TriggeredAbility ability = null; try { - ability = source.copy(); + ability = source.copy(); } catch (NullPointerException npe) { log.fatal("NPE for source=" + source); log.fatal("NPE for source=" + source.getRule()); throw npe; } - if (ability != null && ability.canChooseTarget(game)) { - if (ability.isUsesStack()) { - game.getStack().push(new StackAbility(ability, playerId)); - if (ability.activate(game, false)) { - game.removeBookmark(bookmark); - return true; - } - } else { - if (ability.activate(game, false)) { - ability.resolve(game); - game.removeBookmark(bookmark); - return true; - } - } - } - game.restoreState(bookmark); - return false; - } + if (ability != null && ability.canChooseTarget(game)) { + if (ability.isUsesStack()) { + game.getStack().push(new StackAbility(ability, playerId)); + if (ability.activate(game, false)) { + game.removeBookmark(bookmark); + return true; + } + } else { + if (ability.activate(game, false)) { + ability.resolve(game); + game.removeBookmark(bookmark); + return true; + } + } + } + game.restoreState(bookmark); + return false; + } - protected Map getUseableActivatedAbilities(MageObject object, Zone zone, Game game) { - Map useable = new HashMap(); - for (ActivatedAbility ability: object.getAbilities().getActivatedAbilities(zone)) { - if (ability.canActivate(playerId, game)) - useable.put(ability.getId(), ability); - } - if (zone != Zone.HAND) { + protected Map getUseableActivatedAbilities(MageObject object, Zone zone, Game game) { + Map useable = new HashMap(); + for (ActivatedAbility ability: object.getAbilities().getActivatedAbilities(zone)) { + if (ability.canActivate(playerId, game)) + useable.put(ability.getId(), ability); + } + if (zone != Zone.HAND) { if (game.getContinuousEffects().asThough(object.getId(), AsThoughEffectType.CAST, game)) { for (ActivatedAbility ability: object.getAbilities().getActivatedAbilities(Zone.HAND)) { useable.put(ability.getId(), ability); @@ -674,166 +674,166 @@ public abstract class PlayerImpl> implements Player, Ser } } } - } + } Abilities otherAbilities = game.getState().getOtherAbilities(object.getId(), zone); if (otherAbilities != null) { for (ActivatedAbility ability: otherAbilities) { useable.put(ability.getId(), ability); } } - return useable; - } + return useable; + } - protected Map getUseableManaAbilities(MageObject object, Zone zone, Game game) { - Map useable = new HashMap(); - for (ManaAbility ability: object.getAbilities().getManaAbilities(zone)) { - if (ability.canActivate(playerId, game)) - useable.put(ability.getId(), ability); - } - return useable; - } - - @Override - public int getLandsPlayed() { - return landsPlayed; - } + protected Map getUseableManaAbilities(MageObject object, Zone zone, Game game) { + Map useable = new HashMap(); + for (ManaAbility ability: object.getAbilities().getManaAbilities(zone)) { + if (ability.canActivate(playerId, game)) + useable.put(ability.getId(), ability); + } + return useable; + } - @Override - public boolean canPlayLand() { - //20091005 - 114.2a - return landsPlayed < landsPerTurn; - } + @Override + public int getLandsPlayed() { + return landsPlayed; + } - protected boolean isActivePlayer(Game game) { - return game.getActivePlayerId().equals(this.playerId); - } + @Override + public boolean canPlayLand() { + //20091005 - 114.2a + return landsPlayed < landsPerTurn; + } - @Override - public void shuffleLibrary(Game game) { + protected boolean isActivePlayer(Game game) { + return game.getActivePlayerId().equals(this.playerId); + } + + @Override + public void shuffleLibrary(Game game) { if (!game.replaceEvent(GameEvent.getEvent(GameEvent.EventType.SHUFFLE_LIBRARY, playerId, playerId))) { this.library.shuffle(); game.fireEvent(GameEvent.getEvent(GameEvent.EventType.LIBRARY_SHUFFLED, playerId, playerId)); } - } + } - @Override - public void revealCards(String name, Cards cards, Game game) { - game.getState().getRevealed().add(name, cards); -// game.fireRevealCardsEvent(this.name + " revealed", cards); - } + @Override + public void revealCards(String name, Cards cards, Game game) { + game.getState().getRevealed().add(name, cards); +// game.fireRevealCardsEvent(this.name + " revealed", cards); + } - @Override - public void lookAtCards(String name, Cards cards, Game game) { - game.getState().getLookedAt(this.playerId).add(name, cards); - game.fireLookAtCardsEvent(playerId, this.name + " looking at", cards); - } + @Override + public void lookAtCards(String name, Cards cards, Game game) { + game.getState().getLookedAt(this.playerId).add(name, cards); + game.fireLookAtCardsEvent(playerId, this.name + " looking at", cards); + } - @Override - public void phasing(Game game) { - //20091005 - 502.1 - for (Permanent permanent: game.getBattlefield().getPhasedIn(playerId)) { - permanent.phaseOut(game); - } - for (Permanent permanent: game.getBattlefield().getPhasedOut(playerId)) { - permanent.phaseIn(game); - } - } + @Override + public void phasing(Game game) { + //20091005 - 502.1 + for (Permanent permanent: game.getBattlefield().getPhasedIn(playerId)) { + permanent.phaseOut(game); + } + for (Permanent permanent: game.getBattlefield().getPhasedOut(playerId)) { + permanent.phaseIn(game); + } + } - @Override - public void untap(Game game) { - //20091005 - 502.2 - for (Permanent permanent: game.getBattlefield().getAllActivePermanents(playerId)) { - boolean untap = true; - for (RestrictionEffect effect : game.getContinuousEffects().getApplicableRestrictionEffects(permanent, game)) { - untap &= effect.canBeUntapped(permanent, game); - } - if (untap) permanent.untap(game); - } - } + @Override + public void untap(Game game) { + //20091005 - 502.2 + for (Permanent permanent: game.getBattlefield().getAllActivePermanents(playerId)) { + boolean untap = true; + for (RestrictionEffect effect : game.getContinuousEffects().getApplicableRestrictionEffects(permanent, game)) { + untap &= effect.canBeUntapped(permanent, game); + } + if (untap) permanent.untap(game); + } + } - @Override - public UUID getId() { - return playerId; - } + @Override + public UUID getId() { + return playerId; + } - @Override - public Cards getHand() { - return hand; - } + @Override + public Cards getHand() { + return hand; + } - @Override - public Cards getGraveyard() { - return graveyard; - } + @Override + public Cards getGraveyard() { + return graveyard; + } - @Override - public ManaPool getManaPool() { - return this.manaPool; - } + @Override + public ManaPool getManaPool() { + return this.manaPool; + } - @Override - public String getName() { - return name; - } + @Override + public String getName() { + return name; + } - @Override - public boolean isHuman() { - return human; - } + @Override + public boolean isHuman() { + return human; + } - @Override - public Library getLibrary() { - return library; - } + @Override + public Library getLibrary() { + return library; + } - @Override - public int getLife() { - return life; - } + @Override + public int getLife() { + return life; + } - @Override - public void setLife(int life, Game game) { - // rule 118.5 - if (life > this.life) { - gainLife(life - this.life, game); - } else if (life < this.life) { - loseLife(this.life - life, game); - } - } + @Override + public void setLife(int life, Game game) { + // rule 118.5 + if (life > this.life) { + gainLife(life - this.life, game); + } else if (life < this.life) { + loseLife(this.life - life, game); + } + } - @Override - public void setLifeTotalCanChange(boolean lifeTotalCanChange) { - this.canGainLife = lifeTotalCanChange; + @Override + public void setLifeTotalCanChange(boolean lifeTotalCanChange) { + this.canGainLife = lifeTotalCanChange; this.canLoseLife = lifeTotalCanChange; - } + } - @Override - public boolean isLifeTotalCanChange() { - return canGainLife | canLoseLife; - } + @Override + public boolean isLifeTotalCanChange() { + return canGainLife | canLoseLife; + } @Override public boolean isCanLoseLife() { return canLoseLife; } - + @Override public void setCanLoseLife(boolean canLoseLife) { this.canLoseLife = canLoseLife; } - - @Override - public int loseLife(int amount, Game game) { - if (!canLoseLife) return 0; - GameEvent event = new GameEvent(GameEvent.EventType.LOSE_LIFE, playerId, playerId, playerId, amount, false); - if (!game.replaceEvent(event)) { - this.life -= amount; - game.fireEvent(GameEvent.getEvent(GameEvent.EventType.LOST_LIFE, playerId, playerId, playerId, amount)); - return amount; - } - return 0; - } - + + @Override + public int loseLife(int amount, Game game) { + if (!canLoseLife) return 0; + GameEvent event = new GameEvent(GameEvent.EventType.LOSE_LIFE, playerId, playerId, playerId, amount, false); + if (!game.replaceEvent(event)) { + this.life -= amount; + game.fireEvent(GameEvent.getEvent(GameEvent.EventType.LOST_LIFE, playerId, playerId, playerId, amount)); + return amount; + } + return 0; + } + @Override public boolean isCanGainLife() { return canGainLife; @@ -843,360 +843,360 @@ public abstract class PlayerImpl> implements Player, Ser public void setCanGainLife(boolean canGainLife) { this.canGainLife = canGainLife; } - - @Override - public int gainLife(int amount, Game game) { - if (!canGainLife) return 0; - GameEvent event = new GameEvent(GameEvent.EventType.GAIN_LIFE, playerId, playerId, playerId, amount, false); - if (!game.replaceEvent(event)) { - this.life += amount; - game.fireEvent(GameEvent.getEvent(GameEvent.EventType.GAINED_LIFE, playerId, playerId, playerId, amount)); + + @Override + public int gainLife(int amount, Game game) { + if (!canGainLife) return 0; + GameEvent event = new GameEvent(GameEvent.EventType.GAIN_LIFE, playerId, playerId, playerId, amount, false); + if (!game.replaceEvent(event)) { + this.life += amount; + game.fireEvent(GameEvent.getEvent(GameEvent.EventType.GAINED_LIFE, playerId, playerId, playerId, amount)); return amount; - } + } return 0; - } + } - @Override - public int damage(int damage, UUID sourceId, Game game, boolean combatDamage, boolean preventable) { - if (damage > 0 && canDamage(game.getObject(sourceId), game)) { - GameEvent event = new DamagePlayerEvent(playerId, sourceId, playerId, damage, preventable, combatDamage); - if (!game.replaceEvent(event)) { - int actualDamage = event.getAmount(); - if (actualDamage > 0) { - Permanent source = game.getPermanent(sourceId); - if(source == null){ - MageObject lastKnownInformation = game.getLastKnownInformation(sourceId, Zone.BATTLEFIELD); - if(lastKnownInformation instanceof Permanent){ - source = (Permanent) lastKnownInformation; - } - } - if (source != null && (source.getAbilities().containsKey(InfectAbility.getInstance().getId()))) { - addCounters(CounterType.POISON.createInstance(actualDamage), game); - } else { - // fixed: damage dealt should not be equal to life lost - // actualDamage = this.loseLife(actualDamage, game); - this.loseLife(actualDamage, game); - } - if (source != null && source.getAbilities().containsKey(LifelinkAbility.getInstance().getId())) { - Player player = game.getPlayer(source.getControllerId()); - player.gainLife(damage, game); - } - game.fireEvent(new DamagedPlayerEvent(playerId, sourceId, playerId, actualDamage, combatDamage)); - return actualDamage; - } - } - } - return 0; - } + @Override + public int damage(int damage, UUID sourceId, Game game, boolean combatDamage, boolean preventable) { + if (damage > 0 && canDamage(game.getObject(sourceId), game)) { + GameEvent event = new DamagePlayerEvent(playerId, sourceId, playerId, damage, preventable, combatDamage); + if (!game.replaceEvent(event)) { + int actualDamage = event.getAmount(); + if (actualDamage > 0) { + Permanent source = game.getPermanent(sourceId); + if(source == null){ + MageObject lastKnownInformation = game.getLastKnownInformation(sourceId, Zone.BATTLEFIELD); + if(lastKnownInformation instanceof Permanent){ + source = (Permanent) lastKnownInformation; + } + } + if (source != null && (source.getAbilities().containsKey(InfectAbility.getInstance().getId()))) { + addCounters(CounterType.POISON.createInstance(actualDamage), game); + } else { + // fixed: damage dealt should not be equal to life lost + // actualDamage = this.loseLife(actualDamage, game); + this.loseLife(actualDamage, game); + } + if (source != null && source.getAbilities().containsKey(LifelinkAbility.getInstance().getId())) { + Player player = game.getPlayer(source.getControllerId()); + player.gainLife(damage, game); + } + game.fireEvent(new DamagedPlayerEvent(playerId, sourceId, playerId, actualDamage, combatDamage)); + return actualDamage; + } + } + } + return 0; + } - @Override - public void addCounters(Counter counter, Game game) { - if (!game.replaceEvent(GameEvent.getEvent(GameEvent.EventType.ADD_COUNTER, playerId, playerId, counter.getName(), counter.getCount()))) { - counters.addCounter(counter); + @Override + public void addCounters(Counter counter, Game game) { + if (!game.replaceEvent(GameEvent.getEvent(GameEvent.EventType.ADD_COUNTER, playerId, playerId, counter.getName(), counter.getCount()))) { + counters.addCounter(counter); game.fireEvent(GameEvent.getEvent(EventType.COUNTER_ADDED, playerId, playerId, counter.getName(), counter.getCount())); } - } + } protected boolean canDamage(MageObject source, Game game) { - for (ProtectionAbility ability: abilities.getProtectionAbilities()) { - if (!ability.canTarget(source, game)) - return false; - } - return true; - } + for (ProtectionAbility ability: abilities.getProtectionAbilities()) { + if (!ability.canTarget(source, game)) + return false; + } + return true; + } + + @Override + public Abilities getAbilities() { + return this.abilities; + } - @Override - public Abilities getAbilities() { - return this.abilities; - } - @Override public void addAbility(Ability ability) { ability.setSourceId(playerId); this.abilities.add(ability); } - @Override - public int getLandsPerTurn() { - return this.landsPerTurn; - } + @Override + public int getLandsPerTurn() { + return this.landsPerTurn; + } - @Override - public void setLandsPerTurn(int landsPerTurn) { - this.landsPerTurn = landsPerTurn; - } + @Override + public void setLandsPerTurn(int landsPerTurn) { + this.landsPerTurn = landsPerTurn; + } - @Override - public int getMaxHandSize() { - return maxHandSize; - } + @Override + public int getMaxHandSize() { + return maxHandSize; + } - @Override - public void setMaxHandSize(int maxHandSize) { - this.maxHandSize = maxHandSize; - } + @Override + public void setMaxHandSize(int maxHandSize) { + this.maxHandSize = maxHandSize; + } - @Override - public void setResponseString(String responseString) {} + @Override + public void setResponseString(String responseString) {} - @Override - public void setResponseUUID(UUID responseUUID) {} + @Override + public void setResponseUUID(UUID responseUUID) {} - @Override - public void setResponseBoolean(Boolean responseBoolean) {} + @Override + public void setResponseBoolean(Boolean responseBoolean) {} - @Override - public void setResponseInteger(Integer responseInteger) {} + @Override + public void setResponseInteger(Integer responseInteger) {} - @Override - public void restore(Player player) { - this.library = player.getLibrary().copy(); - this.hand = player.getHand().copy(); - this.graveyard = player.getGraveyard().copy(); - this.abilities = player.getAbilities().copy(); - this.manaPool = player.getManaPool().copy(); - this.life = player.getLife(); - this.counters = player.getCounters().copy(); + @Override + public void restore(Player player) { + this.library = player.getLibrary().copy(); + this.hand = player.getHand().copy(); + this.graveyard = player.getGraveyard().copy(); + this.abilities = player.getAbilities().copy(); + this.manaPool = player.getManaPool().copy(); + this.life = player.getLife(); + this.counters = player.getCounters().copy(); this.inRange.clear(); - this.inRange.addAll(player.getInRange()); - this.landsPlayed = player.getLandsPlayed(); - this.name = player.getName(); + this.inRange.addAll(player.getInRange()); + this.landsPlayed = player.getLandsPlayed(); + this.name = player.getName(); this.range = player.getRange(); this.passed = player.isPassed(); - this.human = player.isHuman(); - this.wins = player.hasWon(); - this.loses = player.hasLost(); - this.landsPerTurn = player.getLandsPerTurn(); + this.human = player.isHuman(); + this.wins = player.hasWon(); + this.loses = player.hasLost(); + this.landsPerTurn = player.getLandsPerTurn(); this.maxHandSize = player.getMaxHandSize(); - this.left = player.hasLeft(); + this.left = player.hasLeft(); this.canGainLife = player.isCanGainLife(); this.canLoseLife = player.isCanLoseLife(); this.attachments.clear(); this.attachments.addAll(player.getAttachments()); - this.userData = player.getUserData(); + this.userData = player.getUserData(); } - @Override - public boolean isPassed() { - return passed; - } + @Override + public boolean isPassed() { + return passed; + } - @Override - public void pass() { - this.passed = true; - } + @Override + public void pass() { + this.passed = true; + } - @Override - public boolean isEmptyDraw() { - return library.isEmptyDraw(); - } + @Override + public boolean isEmptyDraw() { + return library.isEmptyDraw(); + } - @Override - public void resetPassed() { - if (!this.loses && !this.left) - this.passed = false; - else - this.passed = true; - } + @Override + public void resetPassed() { + if (!this.loses && !this.left) + this.passed = false; + else + this.passed = true; + } - @Override - public void concede(Game game) { - this.loses = true; - this.abort(); - game.leave(playerId); - } + @Override + public void concede(Game game) { + this.loses = true; + this.abort(); + game.leave(playerId); + } - @Override - public void leave() { - this.passed = true; - this.abort(); - this.loses = true; - this.left = true; - //20100423 - 800.4a - this.hand.clear(); - this.graveyard.clear(); - this.library.clear(); - } + @Override + public void leave() { + this.passed = true; + this.abort(); + this.loses = true; + this.left = true; + //20100423 - 800.4a + this.hand.clear(); + this.graveyard.clear(); + this.library.clear(); + } - @Override - public boolean hasLeft() { - return this.left; - } + @Override + public boolean hasLeft() { + return this.left; + } - @Override - public void lost(Game game) { + @Override + public void lost(Game game) { if (canLose(game)) { - this.loses = true; - //20100423 - 603.9 - if (!this.wins) - game.fireEvent(GameEvent.getEvent(GameEvent.EventType.LOST, null, null, playerId)); - game.leave(playerId); - } - } + this.loses = true; + //20100423 - 603.9 + if (!this.wins) + game.fireEvent(GameEvent.getEvent(GameEvent.EventType.LOST, null, null, playerId)); + game.leave(playerId); + } + } @Override public boolean canLose(Game game) { return !game.replaceEvent(new GameEvent(GameEvent.EventType.LOSES, null, null, playerId)); } - @Override - public void won(Game game) { - if (!game.replaceEvent(new GameEvent(GameEvent.EventType.WINS, null, null, playerId))) { - if (!this.loses) { - //20100423 - 800.6, 801.16 - if (game.getPlayers().size() > 2) { - for (UUID opponentId: game.getOpponents(playerId)) { - game.getPlayer(opponentId).lost(game); - } - } - else { - this.wins = true; - game.end(); - } - } - } - } + @Override + public void won(Game game) { + if (!game.replaceEvent(new GameEvent(GameEvent.EventType.WINS, null, null, playerId))) { + if (!this.loses) { + //20100423 - 800.6, 801.16 + if (game.getPlayers().size() > 2) { + for (UUID opponentId: game.getOpponents(playerId)) { + game.getPlayer(opponentId).lost(game); + } + } + else { + this.wins = true; + game.end(); + } + } + } + } - @Override - public boolean hasLost() { - return this.loses; - } + @Override + public boolean hasLost() { + return this.loses; + } - @Override - public boolean hasWon() { - if (!this.loses) - return this.wins; - else - return false; - } + @Override + public boolean hasWon() { + if (!this.loses) + return this.wins; + else + return false; + } - @Override - public void declareAttacker(UUID attackerId, UUID defenderId, Game game) { - Permanent attacker = game.getPermanent(attackerId); - if (attacker != null && attacker.canAttack(game)) { - if (!game.replaceEvent(GameEvent.getEvent(GameEvent.EventType.DECLARE_ATTACKER, defenderId, attackerId, playerId))) { - game.getCombat().declareAttacker(attackerId, defenderId, game); - } - } - } + @Override + public void declareAttacker(UUID attackerId, UUID defenderId, Game game) { + Permanent attacker = game.getPermanent(attackerId); + if (attacker != null && attacker.canAttack(game)) { + if (!game.replaceEvent(GameEvent.getEvent(GameEvent.EventType.DECLARE_ATTACKER, defenderId, attackerId, playerId))) { + game.getCombat().declareAttacker(attackerId, defenderId, game); + } + } + } - @Override - public void declareBlocker(UUID blockerId, UUID attackerId, Game game) { - Permanent blocker = game.getPermanent(blockerId); - CombatGroup group = game.getCombat().findGroup(attackerId); - if (blocker != null && group != null && group.canBlock(blocker, game)) { - group.addBlocker(blockerId, playerId, game); - game.getCombat().addBlockingGroup(blockerId, attackerId, playerId, game); - } - } + @Override + public void declareBlocker(UUID blockerId, UUID attackerId, Game game) { + Permanent blocker = game.getPermanent(blockerId); + CombatGroup group = game.getCombat().findGroup(attackerId); + if (blocker != null && group != null && group.canBlock(blocker, game)) { + group.addBlocker(blockerId, playerId, game); + game.getCombat().addBlockingGroup(blockerId, attackerId, playerId, game); + } + } - @Override - public boolean searchLibrary(TargetCardInLibrary target, Game game) { - return searchLibrary(target, game, playerId); - } + @Override + public boolean searchLibrary(TargetCardInLibrary target, Game game) { + return searchLibrary(target, game, playerId); + } - @Override - public boolean searchLibrary(TargetCardInLibrary target, Game game, UUID targetPlayerId) { - //20091005 - 701.14c - if (!game.replaceEvent(GameEvent.getEvent(GameEvent.EventType.SEARCH_LIBRARY, targetPlayerId, playerId))) { - TargetCardInLibrary newTarget = target.copy(); - int count = library.count(target.getFilter(), game); - if (count < target.getNumberOfTargets()) { - newTarget.setMinNumberOfTargets(count); - } - if (newTarget.choose(Outcome.Neutral, playerId, targetPlayerId, game)) { - target.getTargets().clear(); - for(UUID targetId: newTarget.getTargets()){ - target.add(targetId, game); - } - game.fireEvent(GameEvent.getEvent(GameEvent.EventType.LIBRARY_SEARCHED, targetPlayerId, playerId)); - } - return true; - } - return false; - } + @Override + public boolean searchLibrary(TargetCardInLibrary target, Game game, UUID targetPlayerId) { + //20091005 - 701.14c + if (!game.replaceEvent(GameEvent.getEvent(GameEvent.EventType.SEARCH_LIBRARY, targetPlayerId, playerId))) { + TargetCardInLibrary newTarget = target.copy(); + int count = library.count(target.getFilter(), game); + if (count < target.getNumberOfTargets()) { + newTarget.setMinNumberOfTargets(count); + } + if (newTarget.choose(Outcome.Neutral, playerId, targetPlayerId, game)) { + target.getTargets().clear(); + for(UUID targetId: newTarget.getTargets()){ + target.add(targetId, game); + } + game.fireEvent(GameEvent.getEvent(GameEvent.EventType.LIBRARY_SEARCHED, targetPlayerId, playerId)); + } + return true; + } + return false; + } - /** - * - * @return true if player won the toss - */ - @Override - public boolean flipCoin(Game game) { - boolean result = rnd.nextBoolean(); - game.informPlayers("[Flip a coin] " + getName() + (result ? " won." : " lost.")); - return result; - } + /** + * + * @return true if player won the toss + */ + @Override + public boolean flipCoin(Game game) { + boolean result = rnd.nextBoolean(); + game.informPlayers("[Flip a coin] " + getName() + (result ? " won." : " lost.")); + return result; + } - @Override - public List getAvailableAttackers(Game game) { - FilterCreatureForCombat filter = new FilterCreatureForCombat(); - List attackers = game.getBattlefield().getAllActivePermanents(filter, playerId, game); - for (Iterator i = attackers.iterator(); i.hasNext();) { - Permanent entry = i.next(); - if (!entry.canAttack(game)) - i.remove(); - } - return attackers; - } + @Override + public List getAvailableAttackers(Game game) { + FilterCreatureForCombat filter = new FilterCreatureForCombat(); + List attackers = game.getBattlefield().getAllActivePermanents(filter, playerId, game); + for (Iterator i = attackers.iterator(); i.hasNext();) { + Permanent entry = i.next(); + if (!entry.canAttack(game)) + i.remove(); + } + return attackers; + } - @Override - public List getAvailableBlockers(Game game) { - FilterCreatureForCombat blockFilter = new FilterCreatureForCombat(); - List blockers = game.getBattlefield().getAllActivePermanents(blockFilter, playerId, game); - return blockers; - } + @Override + public List getAvailableBlockers(Game game) { + FilterCreatureForCombat blockFilter = new FilterCreatureForCombat(); + List blockers = game.getBattlefield().getAllActivePermanents(blockFilter, playerId, game); + return blockers; + } - protected ManaOptions getManaAvailable(Game game) { - ManaOptions available = new ManaOptions(); + protected ManaOptions getManaAvailable(Game game) { + ManaOptions available = new ManaOptions(); List manaPerms = this.getAvailableManaProducers(game); - for (Permanent perm: manaPerms) { - available.addMana(perm.getAbilities().getAvailableManaAbilities(Zone.BATTLEFIELD, game), game); - } + for (Permanent perm: manaPerms) { + available.addMana(perm.getAbilities().getAvailableManaAbilities(Zone.BATTLEFIELD, game), game); + } List manaPermsWithCost = this.getAvailableManaProducersWithCost(game); - for (Permanent perm: manaPermsWithCost) { - available.addManaWithCost(perm.getAbilities().getAvailableManaAbilities(Zone.BATTLEFIELD, game), game); - } - return available; - } + for (Permanent perm: manaPermsWithCost) { + available.addManaWithCost(perm.getAbilities().getAvailableManaAbilities(Zone.BATTLEFIELD, game), game); + } + return available; + } // returns only mana producers that don't require mana payment - protected List getAvailableManaProducers(Game game) { - List result = new ArrayList(); - for (Permanent permanent: game.getBattlefield().getAllActivePermanents(playerId)) { + protected List getAvailableManaProducers(Game game) { + List result = new ArrayList(); + for (Permanent permanent: game.getBattlefield().getAllActivePermanents(playerId)) { boolean canAdd = false; - for (ManaAbility ability: permanent.getAbilities().getManaAbilities(Zone.BATTLEFIELD)) { - if (ability.canActivate(playerId, game)) { - canAdd = true; - } + for (ManaAbility ability: permanent.getAbilities().getManaAbilities(Zone.BATTLEFIELD)) { + if (ability.canActivate(playerId, game)) { + canAdd = true; + } if (!ability.getManaCosts().isEmpty()) { canAdd = false; break; } - } + } if (canAdd) result.add(permanent); - } - return result; - } + } + return result; + } // returns only mana producers that require mana payment - protected List getAvailableManaProducersWithCost(Game game) { - List result = new ArrayList(); - for (Permanent permanent: game.getBattlefield().getAllActivePermanents(playerId)) { - for (ManaAbility ability: permanent.getAbilities().getManaAbilities(Zone.BATTLEFIELD)) { - if (ability.canActivate(playerId, game) && !ability.getManaCosts().isEmpty()) { - result.add(permanent); - break; - } - } - } - return result; - } - - protected boolean canPlay(ActivatedAbility ability, ManaOptions available, Game game) { - if (!(ability instanceof ManaAbility) && ability.canActivate(playerId, game)) { + protected List getAvailableManaProducersWithCost(Game game) { + List result = new ArrayList(); + for (Permanent permanent: game.getBattlefield().getAllActivePermanents(playerId)) { + for (ManaAbility ability: permanent.getAbilities().getManaAbilities(Zone.BATTLEFIELD)) { + if (ability.canActivate(playerId, game) && !ability.getManaCosts().isEmpty()) { + result.add(permanent); + break; + } + } + } + return result; + } + + protected boolean canPlay(ActivatedAbility ability, ManaOptions available, Game game) { + if (!(ability instanceof ManaAbility) && ability.canActivate(playerId, game)) { Ability copy = ability.copy(); game.getContinuousEffects().costModification(copy, game); @@ -1209,55 +1209,55 @@ public abstract class PlayerImpl> implements Player, Ser } } - ManaOptions abilityOptions = copy.getManaCostsToPay().getOptions(); - if (abilityOptions.size() == 0) { - return true; - } - else { - for (Mana mana: abilityOptions) { - for (Mana avail: available) { - if (mana.enough(avail)) { - return true; - } - } - } - } + ManaOptions abilityOptions = copy.getManaCostsToPay().getOptions(); + if (abilityOptions.size() == 0) { + return true; + } + else { + for (Mana mana: abilityOptions) { + for (Mana avail: available) { + if (mana.enough(avail)) { + return true; + } + } + } + } for (AlternativeCost cost: ability.getAlternativeCosts()) { if (cost.isAvailable(game, ability) && cost.canPay(ability.getSourceId(), playerId, game)) return true; } - } - return false; - } + } + return false; + } - @Override - public List getPlayable(Game game, boolean hidden) { - List playable = new ArrayList(); + @Override + public List getPlayable(Game game, boolean hidden) { + List playable = new ArrayList(); - ManaOptions available = getManaAvailable(game); - available.addMana(manaPool.getMana()); + ManaOptions available = getManaAvailable(game); + available.addMana(manaPool.getMana()); - if (hidden) { - for (Card card: hand.getUniqueCards(game)) { - for (ActivatedAbility ability: card.getAbilities().getActivatedAbilities(Zone.HAND)) { - if (canPlay(ability, available, game)) - playable.add(ability); - } - } - } - for (Card card: graveyard.getUniqueCards(game)) { - for (ActivatedAbility ability: card.getAbilities().getActivatedAbilities(Zone.GRAVEYARD)) { - if (canPlay(ability, available, game)) - playable.add(ability); - } + if (hidden) { + for (Card card: hand.getUniqueCards(game)) { + for (ActivatedAbility ability: card.getAbilities().getActivatedAbilities(Zone.HAND)) { + if (canPlay(ability, available, game)) + playable.add(ability); + } + } + } + for (Card card: graveyard.getUniqueCards(game)) { + for (ActivatedAbility ability: card.getAbilities().getActivatedAbilities(Zone.GRAVEYARD)) { + if (canPlay(ability, available, game)) + playable.add(ability); + } if (game.getContinuousEffects().asThough(card.getId(), AsThoughEffectType.CAST, game)) { for (ActivatedAbility ability: card.getAbilities().getActivatedAbilities(Zone.HAND)) { if (ability instanceof SpellAbility || ability instanceof PlayLandAbility) playable.add(ability); } } - } + } for (ExileZone exile: game.getExile().getExileZones()) { for (Card card: exile.getCards(game)) { if (game.getContinuousEffects().asThough(card.getId(), AsThoughEffectType.CAST, game)) { @@ -1280,49 +1280,49 @@ public abstract class PlayerImpl> implements Player, Ser } // eliminate duplicate activated abilities Map playableActivated = new HashMap(); - for (Permanent permanent: game.getBattlefield().getAllActivePermanents(playerId)) { - for (ActivatedAbility ability: permanent.getAbilities().getActivatedAbilities(Zone.BATTLEFIELD)) { + for (Permanent permanent: game.getBattlefield().getAllActivePermanents(playerId)) { + for (ActivatedAbility ability: permanent.getAbilities().getActivatedAbilities(Zone.BATTLEFIELD)) { if (!playableActivated.containsKey(ability.toString())) if (canPlay(ability, available, game)) playableActivated.put(ability.toString(), ability); - } - } + } + } playable.addAll(playableActivated.values()); - return playable; - } + return playable; + } - @Override - public List getPlayableOptions(Ability ability, Game game) { - List options = new ArrayList(); - - if (ability.isModal()) - addModeOptions(options, ability, game); - else if (ability.getTargets().getUnchosen().size() > 0) - addTargetOptions(options, ability, 0, game); - else if (ability.getChoices().getUnchosen().size() > 0) - addChoiceOptions(options, ability, 0, game); - else if (ability.getCosts().getTargets().getUnchosen().size() > 0) - addCostTargetOptions(options, ability, 0, game); + @Override + public List getPlayableOptions(Ability ability, Game game) { + List options = new ArrayList(); - return options; - } + if (ability.isModal()) + addModeOptions(options, ability, game); + else if (ability.getTargets().getUnchosen().size() > 0) + addTargetOptions(options, ability, 0, game); + else if (ability.getChoices().getUnchosen().size() > 0) + addChoiceOptions(options, ability, 0, game); + else if (ability.getCosts().getTargets().getUnchosen().size() > 0) + addCostTargetOptions(options, ability, 0, game); - private void addModeOptions(List options, Ability option, Game game) { - for (Mode mode: option.getModes().values()) { - Ability newOption = option.copy(); - newOption.getModes().setMode(mode); - if (option.getTargets().getUnchosen().size() > 0) - addTargetOptions(options, option, 0, game); - else if (option.getChoices().getUnchosen().size() > 0) - addChoiceOptions(options, option, 0, game); - else if (option.getCosts().getTargets().getUnchosen().size() > 0) - addCostTargetOptions(options, option, 0, game); - else - options.add(newOption); - } - } - - private void addTargetOptions(List options, Ability option, int targetNum, Game game) { + return options; + } + + private void addModeOptions(List options, Ability option, Game game) { + for (Mode mode: option.getModes().values()) { + Ability newOption = option.copy(); + newOption.getModes().setMode(mode); + if (option.getTargets().getUnchosen().size() > 0) + addTargetOptions(options, option, 0, game); + else if (option.getChoices().getUnchosen().size() > 0) + addChoiceOptions(options, option, 0, game); + else if (option.getCosts().getTargets().getUnchosen().size() > 0) + addCostTargetOptions(options, option, 0, game); + else + options.add(newOption); + } + } + + private void addTargetOptions(List options, Ability option, int targetNum, Game game) { for (Target target: option.getTargets().getUnchosen().get(targetNum).getTargetOptions(option, game)) { Ability newOption = option.copy(); if (target instanceof TargetAmount) { @@ -1337,79 +1337,79 @@ public abstract class PlayerImpl> implements Player, Ser } } if (targetNum < option.getTargets().size() - 2) { - //addTargetOptions(options, newOption, targetNum + 1, game); - // ayrat: bug fix - addTargetOptions(options, newOption, targetNum + 1, game); - } + //addTargetOptions(options, newOption, targetNum + 1, game); + // ayrat: bug fix + addTargetOptions(options, newOption, targetNum + 1, game); + } else { - if (option.getChoices().size() > 0) - addChoiceOptions(options, newOption, 0, game); - else if (option.getCosts().getTargets().size() > 0) - addCostTargetOptions(options, newOption, 0, game); - else - options.add(newOption); - } - } - } + if (option.getChoices().size() > 0) + addChoiceOptions(options, newOption, 0, game); + else if (option.getCosts().getTargets().size() > 0) + addCostTargetOptions(options, newOption, 0, game); + else + options.add(newOption); + } + } + } - private void addChoiceOptions(List options, Ability option, int choiceNum, Game game) { - for (String choice: option.getChoices().get(choiceNum).getChoices()) { - Ability newOption = option.copy(); - newOption.getChoices().get(choiceNum).setChoice(choice); - if (choiceNum < option.getChoices().size() - 1) { - addChoiceOptions(options, newOption, choiceNum + 1, game); - } - else { - if (option.getCosts().getTargets().size() > 0) - addCostTargetOptions(options, newOption, 0, game); - else - options.add(newOption); - } - } - } + private void addChoiceOptions(List options, Ability option, int choiceNum, Game game) { + for (String choice: option.getChoices().get(choiceNum).getChoices()) { + Ability newOption = option.copy(); + newOption.getChoices().get(choiceNum).setChoice(choice); + if (choiceNum < option.getChoices().size() - 1) { + addChoiceOptions(options, newOption, choiceNum + 1, game); + } + else { + if (option.getCosts().getTargets().size() > 0) + addCostTargetOptions(options, newOption, 0, game); + else + options.add(newOption); + } + } + } - private void addCostTargetOptions(List options, Ability option, int targetNum, Game game) { - for (UUID targetId: option.getCosts().getTargets().get(targetNum).possibleTargets(option.getSourceId(), playerId, game)) { - Ability newOption = option.copy(); - newOption.getCosts().getTargets().get(targetNum).addTarget(targetId, option, game, true); - if (targetNum < option.getCosts().getTargets().size() - 1) { - addCostTargetOptions(options, newOption, targetNum + 1, game); - } - else { - options.add(newOption); - } - } - } + private void addCostTargetOptions(List options, Ability option, int targetNum, Game game) { + for (UUID targetId: option.getCosts().getTargets().get(targetNum).possibleTargets(option.getSourceId(), playerId, game)) { + Ability newOption = option.copy(); + newOption.getCosts().getTargets().get(targetNum).addTarget(targetId, option, game, true); + if (targetNum < option.getCosts().getTargets().size() - 1) { + addCostTargetOptions(options, newOption, targetNum + 1, game); + } + else { + options.add(newOption); + } + } + } - @Override - public boolean isTestMode() { - return isTestMode; - } + @Override + public boolean isTestMode() { + return isTestMode; + } - @Override - public void setTestMode(boolean value) { - this.isTestMode = value; - } + @Override + public void setTestMode(boolean value) { + this.isTestMode = value; + } - @Override - public boolean isTopCardRevealed() { - return topCardRevealed; - } + @Override + public boolean isTopCardRevealed() { + return topCardRevealed; + } - @Override - public void setTopCardRevealed(boolean topCardRevealed) { - this.topCardRevealed = topCardRevealed; - } + @Override + public void setTopCardRevealed(boolean topCardRevealed) { + this.topCardRevealed = topCardRevealed; + } - @Override - public UserData getUserData() { - return this.userData; - } + @Override + public UserData getUserData() { + return this.userData; + } - @Override - public void setUserData(UserData userData) { - this.userData = userData; - } + @Override + public void setUserData(UserData userData) { + this.userData = userData; + } @Override public void addAction(String action) { diff --git a/Mage/src/mage/players/PlayerList.java b/Mage/src/mage/players/PlayerList.java index 8650113a23..efc2711a7d 100644 --- a/Mage/src/mage/players/PlayerList.java +++ b/Mage/src/mage/players/PlayerList.java @@ -38,41 +38,41 @@ import mage.util.CircularList; */ public class PlayerList extends CircularList { - public PlayerList() {} + public PlayerList() {} - public PlayerList(final PlayerList list) { - super(list); - } + public PlayerList(final PlayerList list) { + super(list); + } - public Player getNext(Game game) { - Player player; - UUID start = this.get(); - while (true) { - player = game.getPlayer(super.getNext()); - if (!player.hasLeft() && !player.hasLost()) - break; - if (player.getId().equals(start)) - return null; - } - return player; - } + public Player getNext(Game game) { + Player player; + UUID start = this.get(); + while (true) { + player = game.getPlayer(super.getNext()); + if (!player.hasLeft() && !player.hasLost()) + break; + if (player.getId().equals(start)) + return null; + } + return player; + } - public Player getPrevious(Game game) { - Player player; - UUID start = this.get(); - while (true) { - player = game.getPlayer(super.getPrevious()); - if (!player.hasLeft() && !player.hasLost()) - break; - if (player.getId().equals(start)) - return null; - } - return player; - } + public Player getPrevious(Game game) { + Player player; + UUID start = this.get(); + while (true) { + player = game.getPlayer(super.getPrevious()); + if (!player.hasLeft() && !player.hasLost()) + break; + if (player.getId().equals(start)) + return null; + } + return player; + } - @Override - public PlayerList copy() { - return new PlayerList(this); - } + @Override + public PlayerList copy() { + return new PlayerList(this); + } } diff --git a/Mage/src/mage/players/Players.java b/Mage/src/mage/players/Players.java index f5f7a24260..19e2057947 100644 --- a/Mage/src/mage/players/Players.java +++ b/Mage/src/mage/players/Players.java @@ -38,26 +38,26 @@ import java.util.UUID; */ public class Players extends LinkedHashMap { - public Players() {} + public Players() {} - public Players(final Players players) { - for (Entry entry: players.entrySet()) { - this.put(entry.getKey(), entry.getValue().copy()); - } - } + public Players(final Players players) { + for (Entry entry: players.entrySet()) { + this.put(entry.getKey(), entry.getValue().copy()); + } + } - public void addPlayer(Player player) { - this.put(player.getId(), player); - } + public void addPlayer(Player player) { + this.put(player.getId(), player); + } - public void resetPassed() { - for (Player player: this.values()) { - player.resetPassed(); - } - } + public void resetPassed() { + for (Player player: this.values()) { + player.resetPassed(); + } + } - public Players copy() { - return new Players(this); - } + public Players copy() { + return new Players(this); + } } diff --git a/Mage/src/mage/players/net/UserData.java b/Mage/src/mage/players/net/UserData.java index 47dedda358..e22d9aa6de 100644 --- a/Mage/src/mage/players/net/UserData.java +++ b/Mage/src/mage/players/net/UserData.java @@ -9,28 +9,28 @@ import java.io.Serializable; */ public class UserData implements Serializable { - protected int groupId; - protected int avatarId; - protected String privateKey; + protected int groupId; + protected int avatarId; + protected String privateKey; - public UserData(UserGroup userGroup, int avatarId) { - this.groupId = userGroup.getGroupId(); - this.avatarId = avatarId; - } + public UserData(UserGroup userGroup, int avatarId) { + this.groupId = userGroup.getGroupId(); + this.avatarId = avatarId; + } - public void setGroupId(int groupId) { - this.groupId = groupId; - } + public void setGroupId(int groupId) { + this.groupId = groupId; + } - public int getGroupId() { - return groupId; - } + public int getGroupId() { + return groupId; + } - public int getAvatarId() { - return avatarId; - } + public int getAvatarId() { + return avatarId; + } - public void setAvatarId(int avatarId) { - this.avatarId = avatarId; - } + public void setAvatarId(int avatarId) { + this.avatarId = avatarId; + } } diff --git a/Mage/src/mage/players/net/UserGroup.java b/Mage/src/mage/players/net/UserGroup.java index 75589dee32..97a39da151 100644 --- a/Mage/src/mage/players/net/UserGroup.java +++ b/Mage/src/mage/players/net/UserGroup.java @@ -5,19 +5,19 @@ package mage.players.net; */ public enum UserGroup { - COMPUTER(0), - PLAYER(1), - MAGE(3), - ADMIN(7), - OWNER(15); + COMPUTER(0), + PLAYER(1), + MAGE(3), + ADMIN(7), + OWNER(15); - private int groupId; + private int groupId; - UserGroup(int groupId) { - this.groupId = groupId; - } + UserGroup(int groupId) { + this.groupId = groupId; + } - public int getGroupId() { - return this.groupId; - } + public int getGroupId() { + return this.groupId; + } } diff --git a/Mage/src/mage/target/Target.java b/Mage/src/mage/target/Target.java index 073ee3f3d5..2540a6c2ff 100644 --- a/Mage/src/mage/target/Target.java +++ b/Mage/src/mage/target/Target.java @@ -44,49 +44,49 @@ import mage.game.Game; */ public interface Target extends Serializable { - public boolean isChosen(); - public boolean doneChosing(); - public void clearChosen(); - public boolean isNotTarget(); - public void setNotTarget(boolean notTarget); - - // methods for targets - public boolean canChoose(UUID sourceId, UUID sourceControllerId, Game game); - public Set possibleTargets(UUID sourceId, UUID sourceControllerId, Game game); - public boolean chooseTarget(Outcome outcome, UUID playerId, Ability source, Game game); - public void addTarget(UUID id, Ability source, Game game); - public void addTarget(UUID id, int amount, Ability source, Game game); - public void addTarget(UUID id, Ability source, Game game, boolean skipEvent); - public void addTarget(UUID id, int amount, Ability source, Game game, boolean skipEvent); - public boolean canTarget(UUID id, Game game); - public boolean canTarget(UUID id, Ability source, Game game); - public boolean isLegal(Ability source, Game game); + public boolean isChosen(); + public boolean doneChosing(); + public void clearChosen(); + public boolean isNotTarget(); + public void setNotTarget(boolean notTarget); + + // methods for targets + public boolean canChoose(UUID sourceId, UUID sourceControllerId, Game game); + public Set possibleTargets(UUID sourceId, UUID sourceControllerId, Game game); + public boolean chooseTarget(Outcome outcome, UUID playerId, Ability source, Game game); + public void addTarget(UUID id, Ability source, Game game); + public void addTarget(UUID id, int amount, Ability source, Game game); + public void addTarget(UUID id, Ability source, Game game, boolean skipEvent); + public void addTarget(UUID id, int amount, Ability source, Game game, boolean skipEvent); + public boolean canTarget(UUID id, Game game); + public boolean canTarget(UUID id, Ability source, Game game); + public boolean isLegal(Ability source, Game game); public List getTargetOptions(Ability source, Game game); - //methods for non-targets - public boolean canChoose(UUID sourceControllerId, Game game); - public Set possibleTargets(UUID sourceControllerId, Game game); - public boolean choose(Outcome outcome, UUID playerId, UUID sourceId, Game game); - public void add(UUID id, Game game); + //methods for non-targets + public boolean canChoose(UUID sourceControllerId, Game game); + public Set possibleTargets(UUID sourceControllerId, Game game); + public boolean choose(Outcome outcome, UUID playerId, UUID sourceId, Game game); + public void add(UUID id, Game game); public void remove(UUID targetId); - public String getMessage(); - public String getTargetName(); - public void setTargetName(String name); - public String getTargetedName(Game game); - public Zone getZone(); + public String getMessage(); + public String getTargetName(); + public void setTargetName(String name); + public String getTargetedName(Game game); + public Zone getZone(); - public int getTargetAmount(UUID targetId); - public int getNumberOfTargets(); - public int getMaxNumberOfTargets(); - public List getTargets(); - public Filter getFilter(); - - public boolean isRequired(); - public void setRequired(boolean required); + public int getTargetAmount(UUID targetId); + public int getNumberOfTargets(); + public int getMaxNumberOfTargets(); + public List getTargets(); + public Filter getFilter(); -// public UUID getLastTarget(); - public UUID getFirstTarget(); + public boolean isRequired(); + public void setRequired(boolean required); - public Target copy(); +// public UUID getLastTarget(); + public UUID getFirstTarget(); + + public Target copy(); } diff --git a/Mage/src/mage/target/TargetAmount.java b/Mage/src/mage/target/TargetAmount.java index c260dcccb6..56612569f7 100644 --- a/Mage/src/mage/target/TargetAmount.java +++ b/Mage/src/mage/target/TargetAmount.java @@ -40,69 +40,69 @@ import mage.players.Player; */ public abstract class TargetAmount> extends TargetImpl { - int amount; - int remainingAmount; + int amount; + int remainingAmount; - public TargetAmount(int amount) { - this.amount = amount; - this.remainingAmount = amount; - this.required = true; - } + public TargetAmount(int amount) { + this.amount = amount; + this.remainingAmount = amount; + this.required = true; + } - public TargetAmount(final TargetAmount target) { - super(target); - this.amount = target.amount; - this.remainingAmount = target.remainingAmount; - } + public TargetAmount(final TargetAmount target) { + super(target); + this.amount = target.amount; + this.remainingAmount = target.remainingAmount; + } - public int getAmountRemaining() { - return remainingAmount; - } + public int getAmountRemaining() { + return remainingAmount; + } - @Override - public boolean isChosen() { - return doneChosing(); - } + @Override + public boolean isChosen() { + return doneChosing(); + } - @Override - public boolean doneChosing() { - return remainingAmount == 0; - } + @Override + public boolean doneChosing() { + return remainingAmount == 0; + } - @Override - public void clearChosen() { - super.clearChosen(); - remainingAmount = amount; - } + @Override + public void clearChosen() { + super.clearChosen(); + remainingAmount = amount; + } - @Override - public void addTarget(UUID id, int amount, Ability source, Game game, boolean skipEvent) { - if (amount <= remainingAmount) { - super.addTarget(id, amount, source, game, skipEvent); - remainingAmount -= amount; - } - } + @Override + public void addTarget(UUID id, int amount, Ability source, Game game, boolean skipEvent) { + if (amount <= remainingAmount) { + super.addTarget(id, amount, source, game, skipEvent); + remainingAmount -= amount; + } + } + + @Override + public boolean chooseTarget(Outcome outcome, UUID playerId, Ability source, Game game) { + Player player = game.getPlayer(playerId); + chosen = remainingAmount == 0; + while (remainingAmount > 0) { + if (!player.chooseTargetAmount(outcome, this, source, game)) { + return chosen; + } + chosen = remainingAmount == 0; + } + return chosen = true; + } - @Override - public boolean chooseTarget(Outcome outcome, UUID playerId, Ability source, Game game) { - Player player = game.getPlayer(playerId); - chosen = remainingAmount == 0; - while (remainingAmount > 0) { - if (!player.chooseTargetAmount(outcome, this, source, game)) { - return chosen; - } - chosen = remainingAmount == 0; - } - return chosen = true; - } - @Override public List getTargetOptions(Ability source, Game game) { List options = new ArrayList(); Set possibleTargets = possibleTargets(source.getSourceId(), source.getControllerId(), game); - + addTargets(this, possibleTargets, options, source, game); - + return options; } diff --git a/Mage/src/mage/target/TargetCard.java b/Mage/src/mage/target/TargetCard.java index 902511e760..240255ffe5 100644 --- a/Mage/src/mage/target/TargetCard.java +++ b/Mage/src/mage/target/TargetCard.java @@ -45,92 +45,92 @@ import java.util.UUID; */ public class TargetCard> extends TargetObject> { - protected FilterCard filter; + protected FilterCard filter; - protected TargetCard(Zone zone) { - this(1, 1, zone, new FilterCard()); - } - - public TargetCard(Zone zone, FilterCard filter) { - this(1, 1, zone, filter); - } + protected TargetCard(Zone zone) { + this(1, 1, zone, new FilterCard()); + } - public TargetCard(int numTargets, Zone zone, FilterCard filter) { - this(numTargets, numTargets, zone, filter); - } + public TargetCard(Zone zone, FilterCard filter) { + this(1, 1, zone, filter); + } - public TargetCard(int minNumTargets, int maxNumTargets, Zone zone, FilterCard filter) { - this.minNumberOfTargets = minNumTargets; - this.maxNumberOfTargets = maxNumTargets; - this.zone = zone; - this.filter = filter; - this.targetName = filter.getMessage(); - } + public TargetCard(int numTargets, Zone zone, FilterCard filter) { + this(numTargets, numTargets, zone, filter); + } - public TargetCard(final TargetCard target) { - super(target); - this.filter = target.filter.copy(); - } + public TargetCard(int minNumTargets, int maxNumTargets, Zone zone, FilterCard filter) { + this.minNumberOfTargets = minNumTargets; + this.maxNumberOfTargets = maxNumTargets; + this.zone = zone; + this.filter = filter; + this.targetName = filter.getMessage(); + } - @Override - public FilterCard getFilter() { - return this.filter; - } + public TargetCard(final TargetCard target) { + super(target); + this.filter = target.filter.copy(); + } - /** - * Checks if there are enough {@link Card} that can be chosen. - * - * @param sourceId - the target event source - * @param sourceControllerId - controller of the target event source - * @param game - * @return - true if enough valid {@link Card} exist - */ - @Override - public boolean canChoose(UUID sourceId, UUID sourceControllerId, Game game) { - return canChoose(sourceControllerId, game); - } + @Override + public FilterCard getFilter() { + return this.filter; + } - /** - * Checks if there are enough {@link Card} that can be selected. - * - * @param sourceControllerId - controller of the select event - * @param game - * @return - true if enough valid {@link Card} exist - */ - @Override - public boolean canChoose(UUID sourceControllerId, Game game) { - for (UUID playerId: game.getPlayer(sourceControllerId).getInRange()) { - if (filter.matchOwner(playerId)) { - Player player = game.getPlayer(playerId); - if (player != null) { - switch (zone) { - case HAND: - if (player.getHand().count(filter, player.getId(), game) >= this.minNumberOfTargets) - return true; - break; - case GRAVEYARD: - if (player.getGraveyard().count(filter, player.getId(), game) >= this.minNumberOfTargets) - return true; - break; - case LIBRARY: - if (player.getLibrary().count(filter, game) >= this.minNumberOfTargets) - return true; - break; + /** + * Checks if there are enough {@link Card} that can be chosen. + * + * @param sourceId - the target event source + * @param sourceControllerId - controller of the target event source + * @param game + * @return - true if enough valid {@link Card} exist + */ + @Override + public boolean canChoose(UUID sourceId, UUID sourceControllerId, Game game) { + return canChoose(sourceControllerId, game); + } + + /** + * Checks if there are enough {@link Card} that can be selected. + * + * @param sourceControllerId - controller of the select event + * @param game + * @return - true if enough valid {@link Card} exist + */ + @Override + public boolean canChoose(UUID sourceControllerId, Game game) { + for (UUID playerId: game.getPlayer(sourceControllerId).getInRange()) { + if (filter.matchOwner(playerId)) { + Player player = game.getPlayer(playerId); + if (player != null) { + switch (zone) { + case HAND: + if (player.getHand().count(filter, player.getId(), game) >= this.minNumberOfTargets) + return true; + break; + case GRAVEYARD: + if (player.getGraveyard().count(filter, player.getId(), game) >= this.minNumberOfTargets) + return true; + break; + case LIBRARY: + if (player.getLibrary().count(filter, game) >= this.minNumberOfTargets) + return true; + break; case EXILED: if (game.getExile().getPermanentExile().count(filter, player.getId(), game) >= this.minNumberOfTargets) return true; break; - } - } - } - } - return false; - } + } + } + } + } + return false; + } - @Override - public Set possibleTargets(UUID sourceId, UUID sourceControllerId, Game game) { - return possibleTargets(sourceControllerId, game); - } + @Override + public Set possibleTargets(UUID sourceId, UUID sourceControllerId, Game game) { + return possibleTargets(sourceControllerId, game); + } public Set possibleTargets(UUID sourceControllerId, Cards cards, Game game) { Set possibleTargets = new HashSet(); @@ -139,54 +139,54 @@ public class TargetCard> extends TargetObject possibleTargets(UUID sourceControllerId, Game game) { - Set possibleTargets = new HashSet(); - for (UUID playerId: game.getPlayer(sourceControllerId).getInRange()) { - if (filter.matchOwner(playerId)) { - Player player = game.getPlayer(playerId); - if (player != null) { - switch (zone) { - case HAND: - for (Card card: player.getHand().getCards(filter, game)) { - possibleTargets.add(card.getId()); - } - break; - case GRAVEYARD: - for (Card card: player.getGraveyard().getCards(filter, game)) { - possibleTargets.add(card.getId()); - } - break; - case LIBRARY: - for (Card card: player.getLibrary().getUniqueCards(game)) { - if (filter.match(card, game)) - possibleTargets.add(card.getId()); - } - break; - case EXILED: - for (Card card: game.getExile().getPermanentExile().getUniqueCards(game)) { - if (filter.match(card, player.getId(), game)) - possibleTargets.add(card.getId()); - } - break; - } - } - } - } - return possibleTargets; - } - public boolean canTarget(UUID id, Cards cards, Game game) { - Card card = cards.get(id, game); - if (card != null) - return filter.match(card, game); - return false; - } + @Override + public Set possibleTargets(UUID sourceControllerId, Game game) { + Set possibleTargets = new HashSet(); + for (UUID playerId: game.getPlayer(sourceControllerId).getInRange()) { + if (filter.matchOwner(playerId)) { + Player player = game.getPlayer(playerId); + if (player != null) { + switch (zone) { + case HAND: + for (Card card: player.getHand().getCards(filter, game)) { + possibleTargets.add(card.getId()); + } + break; + case GRAVEYARD: + for (Card card: player.getGraveyard().getCards(filter, game)) { + possibleTargets.add(card.getId()); + } + break; + case LIBRARY: + for (Card card: player.getLibrary().getUniqueCards(game)) { + if (filter.match(card, game)) + possibleTargets.add(card.getId()); + } + break; + case EXILED: + for (Card card: game.getExile().getPermanentExile().getUniqueCards(game)) { + if (filter.match(card, player.getId(), game)) + possibleTargets.add(card.getId()); + } + break; + } + } + } + } + return possibleTargets; + } - @Override - public TargetCard copy() { - return new TargetCard(this); - } + public boolean canTarget(UUID id, Cards cards, Game game) { + Card card = cards.get(id, game); + if (card != null) + return filter.match(card, game); + return false; + } + + @Override + public TargetCard copy() { + return new TargetCard(this); + } } diff --git a/Mage/src/mage/target/TargetImpl.java b/Mage/src/mage/target/TargetImpl.java index b86b59d97a..ba5b201f13 100644 --- a/Mage/src/mage/target/TargetImpl.java +++ b/Mage/src/mage/target/TargetImpl.java @@ -45,130 +45,130 @@ import java.util.*; */ public abstract class TargetImpl> implements Target { - protected Map targets = new LinkedHashMap(); + protected Map targets = new LinkedHashMap(); protected Map zoneChangeCounters = new HashMap(); - - protected String targetName; - protected Zone zone; - protected int maxNumberOfTargets; - protected int minNumberOfTargets; - protected boolean required = false; - protected boolean chosen = false; - protected boolean notTarget = false; - @Override - public abstract T copy(); + protected String targetName; + protected Zone zone; + protected int maxNumberOfTargets; + protected int minNumberOfTargets; + protected boolean required = false; + protected boolean chosen = false; + protected boolean notTarget = false; - public TargetImpl() { - this(false); - } + @Override + public abstract T copy(); - public TargetImpl(boolean notTarget) { - this.notTarget = notTarget; - } + public TargetImpl() { + this(false); + } - public TargetImpl(final TargetImpl target) { - this.targetName = target.targetName; - this.zone = target.zone; - this.maxNumberOfTargets = target.maxNumberOfTargets; - this.minNumberOfTargets = target.minNumberOfTargets; - this.required = target.required; - this.chosen = target.chosen; + public TargetImpl(boolean notTarget) { + this.notTarget = notTarget; + } + + public TargetImpl(final TargetImpl target) { + this.targetName = target.targetName; + this.zone = target.zone; + this.maxNumberOfTargets = target.maxNumberOfTargets; + this.minNumberOfTargets = target.minNumberOfTargets; + this.required = target.required; + this.chosen = target.chosen; this.targets.putAll(target.targets); this.zoneChangeCounters.putAll(target.zoneChangeCounters); - } + } - @Override - public int getNumberOfTargets() { - return this.minNumberOfTargets; - } + @Override + public int getNumberOfTargets() { + return this.minNumberOfTargets; + } - @Override - public int getMaxNumberOfTargets() { - return this.maxNumberOfTargets; - } + @Override + public int getMaxNumberOfTargets() { + return this.maxNumberOfTargets; + } - @Override - public String getMessage() { - if (maxNumberOfTargets != 1) { - StringBuilder sb = new StringBuilder(); - sb.append("Select ").append(targetName); - if (maxNumberOfTargets > 0 && maxNumberOfTargets != Integer.MAX_VALUE) { - sb.append(" (").append(targets.size()).append("/").append(maxNumberOfTargets).append(")"); - } else { - sb.append(" (").append(targets.size()).append(")"); - } - return sb.toString(); - } - if (targetName.startsWith("another")) { - return "Select " + targetName; - } - return "Select a " + targetName; - } + @Override + public String getMessage() { + if (maxNumberOfTargets != 1) { + StringBuilder sb = new StringBuilder(); + sb.append("Select ").append(targetName); + if (maxNumberOfTargets > 0 && maxNumberOfTargets != Integer.MAX_VALUE) { + sb.append(" (").append(targets.size()).append("/").append(maxNumberOfTargets).append(")"); + } else { + sb.append(" (").append(targets.size()).append(")"); + } + return sb.toString(); + } + if (targetName.startsWith("another")) { + return "Select " + targetName; + } + return "Select a " + targetName; + } - @Override - public boolean isNotTarget() { - return notTarget; - } + @Override + public boolean isNotTarget() { + return notTarget; + } - @Override - public String getTargetName() { - return targetName; - } + @Override + public String getTargetName() { + return targetName; + } - @Override - public void setTargetName(String name) { - this.targetName = name; - } + @Override + public void setTargetName(String name) { + this.targetName = name; + } - @Override - public Zone getZone() { - return zone; - } + @Override + public Zone getZone() { + return zone; + } - @Override - public boolean isRequired() { - return required; - } + @Override + public boolean isRequired() { + return required; + } - @Override - public void setRequired(boolean required) { - this.required = required; - } + @Override + public void setRequired(boolean required) { + this.required = required; + } - @Override - public boolean isChosen() { + @Override + public boolean isChosen() { if (maxNumberOfTargets == 0 && minNumberOfTargets == 0) return true; - if (maxNumberOfTargets != 0 && targets.size() == maxNumberOfTargets) - return true; - return chosen; - } + if (maxNumberOfTargets != 0 && targets.size() == maxNumberOfTargets) + return true; + return chosen; + } - @Override - public boolean doneChosing() { - if (maxNumberOfTargets == 0) - return false; - return targets.size() == maxNumberOfTargets; - } + @Override + public boolean doneChosing() { + if (maxNumberOfTargets == 0) + return false; + return targets.size() == maxNumberOfTargets; + } - @Override - public void clearChosen() { - targets.clear(); + @Override + public void clearChosen() { + targets.clear(); zoneChangeCounters.clear(); - chosen = false; - } + chosen = false; + } - @Override - public void add(UUID id, Game game) { - if (maxNumberOfTargets == 0 || targets.size() < maxNumberOfTargets) { - if (!targets.containsKey(id)) { - targets.put(id, 0); + @Override + public void add(UUID id, Game game) { + if (maxNumberOfTargets == 0 || targets.size() < maxNumberOfTargets) { + if (!targets.containsKey(id)) { + targets.put(id, 0); rememberZoneChangeCounter(id, game); - } - } - } - + } + } + } + @Override public void remove(UUID id) { if (targets.containsKey(id)) { @@ -177,31 +177,31 @@ public abstract class TargetImpl> implements Target { } } - @Override - public void addTarget(UUID id, Ability source, Game game) { + @Override + public void addTarget(UUID id, Ability source, Game game) { addTarget(id, source, game, false); - } + } - @Override - public void addTarget(UUID id, Ability source, Game game, boolean skipEvent) { - //20100423 - 113.3 - if (maxNumberOfTargets == 0 || targets.size() < maxNumberOfTargets) { - if (!targets.containsKey(id)) { - if (source != null) { - if (!game.replaceEvent(GameEvent.getEvent(EventType.TARGET, id, source.getId(), source.getControllerId()))) { - targets.put(id, 0); + @Override + public void addTarget(UUID id, Ability source, Game game, boolean skipEvent) { + //20100423 - 113.3 + if (maxNumberOfTargets == 0 || targets.size() < maxNumberOfTargets) { + if (!targets.containsKey(id)) { + if (source != null) { + if (!game.replaceEvent(GameEvent.getEvent(EventType.TARGET, id, source.getId(), source.getControllerId()))) { + targets.put(id, 0); rememberZoneChangeCounter(id, game); - chosen = targets.size() >= minNumberOfTargets; + chosen = targets.size() >= minNumberOfTargets; if (!skipEvent) game.fireEvent(GameEvent.getEvent(EventType.TARGETED, id, source.getId(), source.getControllerId())); - } - } - else { - targets.put(id, 0); - } - } - } - } + } + } + else { + targets.put(id, 0); + } + } + } + } private void rememberZoneChangeCounter(UUID id, Game game) { Card card = game.getCard(id); @@ -211,59 +211,59 @@ public abstract class TargetImpl> implements Target { } @Override - public void addTarget(UUID id, int amount, Ability source, Game game) { + public void addTarget(UUID id, int amount, Ability source, Game game) { addTarget(id, amount, source, game, false); - } + } @Override - public void addTarget(UUID id, int amount, Ability source, Game game, boolean skipEvent) { - if (targets.containsKey(id)) { - amount += targets.get(id); - } - if (source != null) { - if (!game.replaceEvent(GameEvent.getEvent(EventType.TARGET, id, source.getId(), source.getControllerId()))) { - targets.put(id, amount); + public void addTarget(UUID id, int amount, Ability source, Game game, boolean skipEvent) { + if (targets.containsKey(id)) { + amount += targets.get(id); + } + if (source != null) { + if (!game.replaceEvent(GameEvent.getEvent(EventType.TARGET, id, source.getId(), source.getControllerId()))) { + targets.put(id, amount); rememberZoneChangeCounter(id, game); - chosen = targets.size() >= minNumberOfTargets; + chosen = targets.size() >= minNumberOfTargets; if (!skipEvent) game.fireEvent(GameEvent.getEvent(EventType.TARGETED, id, source.getId(), source.getControllerId())); - } - } - else { - targets.put(id, amount); + } + } + else { + targets.put(id, amount); rememberZoneChangeCounter(id, game); - } - } - - @Override - public boolean choose(Outcome outcome, UUID playerId, UUID sourceId, Game game) { - Player player = game.getPlayer(playerId); - while (!isChosen() && !doneChosing()) { - chosen = targets.size() >= minNumberOfTargets; - if (!player.choose(outcome, this, sourceId, game)) { - return chosen; - } - chosen = targets.size() >= minNumberOfTargets; - } - return chosen = true; - } + } + } - @Override - public boolean chooseTarget(Outcome outcome, UUID playerId, Ability source, Game game) { - Player player = game.getPlayer(playerId); - while (!isChosen() && !doneChosing()) { - chosen = targets.size() >= minNumberOfTargets; - if (!player.chooseTarget(outcome, this, source, game)) { - return chosen; - } - chosen = targets.size() >= minNumberOfTargets; - } - return chosen = true; - } + @Override + public boolean choose(Outcome outcome, UUID playerId, UUID sourceId, Game game) { + Player player = game.getPlayer(playerId); + while (!isChosen() && !doneChosing()) { + chosen = targets.size() >= minNumberOfTargets; + if (!player.choose(outcome, this, sourceId, game)) { + return chosen; + } + chosen = targets.size() >= minNumberOfTargets; + } + return chosen = true; + } - @Override - public boolean isLegal(Ability source, Game game) { - //20101001 - 608.2b + @Override + public boolean chooseTarget(Outcome outcome, UUID playerId, Ability source, Game game) { + Player player = game.getPlayer(playerId); + while (!isChosen() && !doneChosing()) { + chosen = targets.size() >= minNumberOfTargets; + if (!player.chooseTarget(outcome, this, source, game)) { + return chosen; + } + chosen = targets.size() >= minNumberOfTargets; + } + return chosen = true; + } + + @Override + public boolean isLegal(Ability source, Game game) { + //20101001 - 608.2b for (UUID targetId: targets.keySet()) { Card card = game.getCard(targetId); if (card != null) { @@ -271,13 +271,13 @@ public abstract class TargetImpl> implements Target { continue; // it's not legal so continue to have a look at other targeted cards } } - if (game.replaceEvent(GameEvent.getEvent(EventType.TARGET, targetId, source.getId(), source.getControllerId()))) - continue; - if (canTarget(targetId, source, game)) - return true; - } + if (game.replaceEvent(GameEvent.getEvent(EventType.TARGET, targetId, source.getId(), source.getControllerId()))) + continue; + if (canTarget(targetId, source, game)) + return true; + } return false; - } + } @Override public List getTargetOptions(Ability source, Game game) { @@ -302,35 +302,35 @@ public abstract class TargetImpl> implements Target { } return options; } - - @Override - public List getTargets() { - return new ArrayList(targets.keySet()); - } - @Override - public int getTargetAmount(UUID targetId) { - if (targets.containsKey(targetId)) - return targets.get(targetId); - return 0; - } + @Override + public List getTargets() { + return new ArrayList(targets.keySet()); + } -// @Override -// public UUID getLastTarget() { -// if (targets.size() > 0) -// return targets.keySet().iterator().next(); -// return null; -// } + @Override + public int getTargetAmount(UUID targetId) { + if (targets.containsKey(targetId)) + return targets.get(targetId); + return 0; + } - @Override - public UUID getFirstTarget() { - if (targets.size() > 0) - return targets.keySet().iterator().next(); - return null; - } +// @Override +// public UUID getLastTarget() { +// if (targets.size() > 0) +// return targets.keySet().iterator().next(); +// return null; +// } - @Override - public void setNotTarget(boolean notTarget) { - this.notTarget = notTarget; - } + @Override + public UUID getFirstTarget() { + if (targets.size() > 0) + return targets.keySet().iterator().next(); + return null; + } + + @Override + public void setNotTarget(boolean notTarget) { + this.notTarget = notTarget; + } } diff --git a/Mage/src/mage/target/TargetObject.java b/Mage/src/mage/target/TargetObject.java index caf618d5a6..30c947abe3 100644 --- a/Mage/src/mage/target/TargetObject.java +++ b/Mage/src/mage/target/TargetObject.java @@ -41,50 +41,50 @@ import java.util.UUID; */ public abstract class TargetObject> extends TargetImpl { - protected TargetObject() {} - - public TargetObject(Zone zone) { - this(1, 1, zone, false); - } + protected TargetObject() {} - public TargetObject(int numTargets, Zone zone) { - this(numTargets, numTargets, zone, false); - } + public TargetObject(Zone zone) { + this(1, 1, zone, false); + } - public TargetObject(final TargetObject target) { - super(target); - } + public TargetObject(int numTargets, Zone zone) { + this(numTargets, numTargets, zone, false); + } - public TargetObject(int minNumTargets, int maxNumTargets, Zone zone, boolean notTarget) { - this.minNumberOfTargets = minNumTargets; - this.maxNumberOfTargets = maxNumTargets; - this.zone = zone; - this.targetName = "card"; - this.notTarget = notTarget; - } - - @Override - public String getTargetedName(Game game) { - StringBuilder sb = new StringBuilder(); - for (UUID targetId: getTargets()) { + public TargetObject(final TargetObject target) { + super(target); + } + + public TargetObject(int minNumTargets, int maxNumTargets, Zone zone, boolean notTarget) { + this.minNumberOfTargets = minNumTargets; + this.maxNumberOfTargets = maxNumTargets; + this.zone = zone; + this.targetName = "card"; + this.notTarget = notTarget; + } + + @Override + public String getTargetedName(Game game) { + StringBuilder sb = new StringBuilder(); + for (UUID targetId: getTargets()) { MageObject object = game.getObject(targetId); if (object != null) sb.append(object.getName()).append(" "); - } - return sb.toString(); - } + } + return sb.toString(); + } - @Override - public boolean canTarget(UUID id, Game game) { - MageObject object = game.getObject(id); - if (object != null && game.getState().getZone(id).match(zone)) - return getFilter().match(object, game); - return false; - } + @Override + public boolean canTarget(UUID id, Game game) { + MageObject object = game.getObject(id); + if (object != null && game.getState().getZone(id).match(zone)) + return getFilter().match(object, game); + return false; + } - @Override - public boolean canTarget(UUID id, Ability source, Game game) { - return canTarget(id, game); - } + @Override + public boolean canTarget(UUID id, Ability source, Game game) { + return canTarget(id, game); + } } diff --git a/Mage/src/mage/target/TargetPermanent.java b/Mage/src/mage/target/TargetPermanent.java index 7577106938..b0a73f6ed0 100644 --- a/Mage/src/mage/target/TargetPermanent.java +++ b/Mage/src/mage/target/TargetPermanent.java @@ -45,152 +45,152 @@ import java.util.UUID; */ public class TargetPermanent> extends TargetObject> { - protected FilterPermanent filter; + protected FilterPermanent filter; - public TargetPermanent() { - this(1, 1, new FilterPermanent(), false); - } + public TargetPermanent() { + this(1, 1, new FilterPermanent(), false); + } - public TargetPermanent(FilterPermanent filter) { - this(1, 1, filter, false); - } + public TargetPermanent(FilterPermanent filter) { + this(1, 1, filter, false); + } - public TargetPermanent(int numTargets, FilterPermanent filter) { - this(numTargets, numTargets, filter, false); - } + public TargetPermanent(int numTargets, FilterPermanent filter) { + this(numTargets, numTargets, filter, false); + } - public TargetPermanent(int minNumTargets, int maxNumTargets, FilterPermanent filter, boolean notTarget) { - this.minNumberOfTargets = minNumTargets; - this.maxNumberOfTargets = maxNumTargets; - this.zone = Zone.BATTLEFIELD; - this.filter = filter; - this.targetName = filter.getMessage(); - this.notTarget = notTarget; - } + public TargetPermanent(int minNumTargets, int maxNumTargets, FilterPermanent filter, boolean notTarget) { + this.minNumberOfTargets = minNumTargets; + this.maxNumberOfTargets = maxNumTargets; + this.zone = Zone.BATTLEFIELD; + this.filter = filter; + this.targetName = filter.getMessage(); + this.notTarget = notTarget; + } - public TargetPermanent(final TargetPermanent target) { - super(target); - this.filter = target.filter.copy(); - } + public TargetPermanent(final TargetPermanent target) { + super(target); + this.filter = target.filter.copy(); + } - @Override - public boolean canTarget(UUID id, Ability source, Game game) { - return canTarget(null, id, source, game); - } + @Override + public boolean canTarget(UUID id, Ability source, Game game) { + return canTarget(null, id, source, game); + } - public boolean canTarget(UUID controllerId, UUID id, Ability source, Game game) { - Permanent permanent = game.getPermanent(id); - if (permanent != null) { - if (source != null) - //1. TODO: check for replacement effects - //2. We need to check both source.getId() and source.getSourceId() - // first for protection from spells or abilities (e.g. protection from colored spells, r1753) - // second for protection from sources (e.g. protection from artifacts + equip ability) - return permanent.canBeTargetedBy(game.getObject(source.getId()), controllerId, game) - && permanent.canBeTargetedBy(game.getObject(source.getSourceId()), controllerId, game) - && filter.match(permanent, source.getSourceId(), controllerId, game); - else - return filter.match(permanent, null, controllerId, game); - } - return false; - } + public boolean canTarget(UUID controllerId, UUID id, Ability source, Game game) { + Permanent permanent = game.getPermanent(id); + if (permanent != null) { + if (source != null) + //1. TODO: check for replacement effects + //2. We need to check both source.getId() and source.getSourceId() + // first for protection from spells or abilities (e.g. protection from colored spells, r1753) + // second for protection from sources (e.g. protection from artifacts + equip ability) + return permanent.canBeTargetedBy(game.getObject(source.getId()), controllerId, game) + && permanent.canBeTargetedBy(game.getObject(source.getSourceId()), controllerId, game) + && filter.match(permanent, source.getSourceId(), controllerId, game); + else + return filter.match(permanent, null, controllerId, game); + } + return false; + } public boolean canTarget(UUID controllerId, UUID id, UUID sourceId, Game game, boolean flag) { - Permanent permanent = game.getPermanent(id); - if (permanent != null) { - return filter.match(permanent, sourceId, controllerId, game); - } - return false; - } + Permanent permanent = game.getPermanent(id); + if (permanent != null) { + return filter.match(permanent, sourceId, controllerId, game); + } + return false; + } - @Override - public FilterPermanent getFilter() { - return this.filter; - } + @Override + public FilterPermanent getFilter() { + return this.filter; + } - /** - * Checks if there are enough {@link Permanent} that can be chosen. + /** + * Checks if there are enough {@link Permanent} that can be chosen. * * Takes into account notTarget parameter, it case it's true doesn't check for protection, shroud etc. - * - * @param sourceId - the target event source - * @param sourceControllerId - controller of the target event source - * @param game - * @return - true if enough valid {@link Permanent} exist - */ - @Override - public boolean canChoose(UUID sourceId, UUID sourceControllerId, Game game) { - int remainingTargets = this.minNumberOfTargets - targets.size(); - if (remainingTargets == 0) - return true; - int count = 0; - MageObject targetSource = game.getObject(sourceId); - for (Permanent permanent: game.getBattlefield().getActivePermanents(filter, sourceControllerId, sourceId, game)) { - if (!targets.containsKey(permanent.getId())) { + * + * @param sourceId - the target event source + * @param sourceControllerId - controller of the target event source + * @param game + * @return - true if enough valid {@link Permanent} exist + */ + @Override + public boolean canChoose(UUID sourceId, UUID sourceControllerId, Game game) { + int remainingTargets = this.minNumberOfTargets - targets.size(); + if (remainingTargets == 0) + return true; + int count = 0; + MageObject targetSource = game.getObject(sourceId); + for (Permanent permanent: game.getBattlefield().getActivePermanents(filter, sourceControllerId, sourceId, game)) { + if (!targets.containsKey(permanent.getId())) { if (!notTarget || permanent.canBeTargetedBy(targetSource, sourceControllerId, game)) { count++; if (count >= remainingTargets) { return true; } } - } - } - return false; - } + } + } + return false; + } - /** - * Checks if there are enough {@link Permanent} that can be selected. Should not be used - * for Ability targets since this does not check for protection, shroud etc. - * - * @param sourceControllerId - controller of the select event - * @param game - * @return - true if enough valid {@link Permanent} exist - */ - @Override - public boolean canChoose(UUID sourceControllerId, Game game) { - int remainingTargets = this.minNumberOfTargets - targets.size(); - if (remainingTargets == 0) { - // if we return true, then AnowonTheRuinSage will hang for AI when no targets in play + /** + * Checks if there are enough {@link Permanent} that can be selected. Should not be used + * for Ability targets since this does not check for protection, shroud etc. + * + * @param sourceControllerId - controller of the select event + * @param game + * @return - true if enough valid {@link Permanent} exist + */ + @Override + public boolean canChoose(UUID sourceControllerId, Game game) { + int remainingTargets = this.minNumberOfTargets - targets.size(); + if (remainingTargets == 0) { + // if we return true, then AnowonTheRuinSage will hang for AI when no targets in play // TODO: retest Anowon the Ruin Sage return true; } - int count = 0; - for (Permanent permanent: game.getBattlefield().getActivePermanents(filter, sourceControllerId, game)) { - if (!targets.containsKey(permanent.getId())) { - count++; - if (count >= remainingTargets) - return true; - } - } - return false; - } + int count = 0; + for (Permanent permanent: game.getBattlefield().getActivePermanents(filter, sourceControllerId, game)) { + if (!targets.containsKey(permanent.getId())) { + count++; + if (count >= remainingTargets) + return true; + } + } + return false; + } - @Override - public Set possibleTargets(UUID sourceId, UUID sourceControllerId, Game game) { - Set possibleTargets = new HashSet(); - MageObject targetSource = game.getObject(sourceId); - for (Permanent permanent: game.getBattlefield().getActivePermanents(filter, sourceControllerId, sourceId, game)) { - if (!targets.containsKey(permanent.getId()) && permanent.canBeTargetedBy(targetSource, sourceControllerId, game)) { - possibleTargets.add(permanent.getId()); - } - } - return possibleTargets; - } + @Override + public Set possibleTargets(UUID sourceId, UUID sourceControllerId, Game game) { + Set possibleTargets = new HashSet(); + MageObject targetSource = game.getObject(sourceId); + for (Permanent permanent: game.getBattlefield().getActivePermanents(filter, sourceControllerId, sourceId, game)) { + if (!targets.containsKey(permanent.getId()) && permanent.canBeTargetedBy(targetSource, sourceControllerId, game)) { + possibleTargets.add(permanent.getId()); + } + } + return possibleTargets; + } - @Override - public Set possibleTargets(UUID sourceControllerId, Game game) { - Set possibleTargets = new HashSet(); - for (Permanent permanent: game.getBattlefield().getActivePermanents(filter, sourceControllerId, game)) { - if (!targets.containsKey(permanent.getId())) { - possibleTargets.add(permanent.getId()); - } - } - return possibleTargets; - } + @Override + public Set possibleTargets(UUID sourceControllerId, Game game) { + Set possibleTargets = new HashSet(); + for (Permanent permanent: game.getBattlefield().getActivePermanents(filter, sourceControllerId, game)) { + if (!targets.containsKey(permanent.getId())) { + possibleTargets.add(permanent.getId()); + } + } + return possibleTargets; + } - @Override - public TargetPermanent copy() { - return new TargetPermanent(this); - } + @Override + public TargetPermanent copy() { + return new TargetPermanent(this); + } } diff --git a/Mage/src/mage/target/TargetPlayer.java b/Mage/src/mage/target/TargetPlayer.java index 64731c267b..555a01eeba 100644 --- a/Mage/src/mage/target/TargetPlayer.java +++ b/Mage/src/mage/target/TargetPlayer.java @@ -44,155 +44,155 @@ import java.util.UUID; */ public class TargetPlayer> extends TargetImpl> { - protected FilterPlayer filter = new FilterPlayer(); + protected FilterPlayer filter = new FilterPlayer(); public TargetPlayer(boolean required) { this(); setRequired(required); } - public TargetPlayer() { - this(1, 1, false); - } + public TargetPlayer() { + this(1, 1, false); + } - public TargetPlayer(int numTargets) { - this(numTargets, numTargets, false); - } + public TargetPlayer(int numTargets) { + this(numTargets, numTargets, false); + } - public TargetPlayer(int minNumTargets, int maxNumTargets, boolean notTarget) { - this.minNumberOfTargets = minNumTargets; - this.maxNumberOfTargets = maxNumTargets; - this.targetName = "player"; - this.notTarget = notTarget; - } + public TargetPlayer(int minNumTargets, int maxNumTargets, boolean notTarget) { + this.minNumberOfTargets = minNumTargets; + this.maxNumberOfTargets = maxNumTargets; + this.targetName = "player"; + this.notTarget = notTarget; + } - public TargetPlayer(final TargetPlayer target) { - super(target); - this.filter = target.filter.copy(); - } + public TargetPlayer(final TargetPlayer target) { + super(target); + this.filter = target.filter.copy(); + } - @Override - public FilterPlayer getFilter() { - return filter; - } + @Override + public FilterPlayer getFilter() { + return filter; + } - /** - * Checks if there are enough {@link Player} that can be chosen. Should only be used - * for Ability targets since this checks for protection, shroud etc. - * - * @param sourceId - the target event source - * @param sourceControllerId - controller of the target event source - * @param game - * @return - true if enough valid {@link Player} exist - */ - @Override - public boolean canChoose(UUID sourceId, UUID sourceControllerId, Game game) { - int count = 0; - MageObject targetSource = game.getObject(sourceId); - for (UUID playerId: game.getPlayer(sourceControllerId).getInRange()) { - Player player = game.getPlayer(playerId); - if (player != null && !player.hasLeft() && filter.match(player, game)) { - if (player.canBeTargetedBy(targetSource, game)) { - count++; - if (count >= this.minNumberOfTargets) - return true; - } - } - } - return false; - } + /** + * Checks if there are enough {@link Player} that can be chosen. Should only be used + * for Ability targets since this checks for protection, shroud etc. + * + * @param sourceId - the target event source + * @param sourceControllerId - controller of the target event source + * @param game + * @return - true if enough valid {@link Player} exist + */ + @Override + public boolean canChoose(UUID sourceId, UUID sourceControllerId, Game game) { + int count = 0; + MageObject targetSource = game.getObject(sourceId); + for (UUID playerId: game.getPlayer(sourceControllerId).getInRange()) { + Player player = game.getPlayer(playerId); + if (player != null && !player.hasLeft() && filter.match(player, game)) { + if (player.canBeTargetedBy(targetSource, game)) { + count++; + if (count >= this.minNumberOfTargets) + return true; + } + } + } + return false; + } - /** - * Checks if there are enough {@link Player} that can be selected. Should not be used - * for Ability targets since this does not check for protection, shroud etc. - * - * @param sourceControllerId - controller of the select event - * @param game - * @return - true if enough valid {@link Player} exist - */ - @Override - public boolean canChoose(UUID sourceControllerId, Game game) { - int count = 0; - for (UUID playerId: game.getPlayer(sourceControllerId).getInRange()) { - Player player = game.getPlayer(playerId); - if (player != null && !player.hasLeft() && filter.match(player, game)) { - count++; - if (count >= this.minNumberOfTargets) - return true; - } - } - return false; - } + /** + * Checks if there are enough {@link Player} that can be selected. Should not be used + * for Ability targets since this does not check for protection, shroud etc. + * + * @param sourceControllerId - controller of the select event + * @param game + * @return - true if enough valid {@link Player} exist + */ + @Override + public boolean canChoose(UUID sourceControllerId, Game game) { + int count = 0; + for (UUID playerId: game.getPlayer(sourceControllerId).getInRange()) { + Player player = game.getPlayer(playerId); + if (player != null && !player.hasLeft() && filter.match(player, game)) { + count++; + if (count >= this.minNumberOfTargets) + return true; + } + } + return false; + } - @Override - public Set possibleTargets(UUID sourceId, UUID sourceControllerId, Game game) { - Set possibleTargets = new HashSet(); - MageObject targetSource = game.getObject(sourceId); - for (UUID playerId: game.getPlayer(sourceControllerId).getInRange()) { - Player player = game.getPlayer(playerId); - if (player != null && !player.hasLeft() && filter.match(player, game)) { - if (player.canBeTargetedBy(targetSource, game)) - possibleTargets.add(playerId); - } - } - return possibleTargets; - } + @Override + public Set possibleTargets(UUID sourceId, UUID sourceControllerId, Game game) { + Set possibleTargets = new HashSet(); + MageObject targetSource = game.getObject(sourceId); + for (UUID playerId: game.getPlayer(sourceControllerId).getInRange()) { + Player player = game.getPlayer(playerId); + if (player != null && !player.hasLeft() && filter.match(player, game)) { + if (player.canBeTargetedBy(targetSource, game)) + possibleTargets.add(playerId); + } + } + return possibleTargets; + } - @Override - public Set possibleTargets(UUID sourceControllerId, Game game) { - Set possibleTargets = new HashSet(); - for (UUID playerId: game.getPlayer(sourceControllerId).getInRange()) { - Player player = game.getPlayer(playerId); - if (player != null && !player.hasLeft() && filter.match(player, game)) { - possibleTargets.add(playerId); - } - } - return possibleTargets; - } + @Override + public Set possibleTargets(UUID sourceControllerId, Game game) { + Set possibleTargets = new HashSet(); + for (UUID playerId: game.getPlayer(sourceControllerId).getInRange()) { + Player player = game.getPlayer(playerId); + if (player != null && !player.hasLeft() && filter.match(player, game)) { + possibleTargets.add(playerId); + } + } + return possibleTargets; + } - @Override - public boolean isLegal(Ability source, Game game) { - //20101001 - 608.2b - for (UUID playerId: targets.keySet()) { - if (canTarget(playerId, source, game)) - return true; - } - return false; - } + @Override + public boolean isLegal(Ability source, Game game) { + //20101001 - 608.2b + for (UUID playerId: targets.keySet()) { + if (canTarget(playerId, source, game)) + return true; + } + return false; + } - @Override - public boolean canTarget(UUID id, Game game) { - Player player = game.getPlayer(id); - if (player != null) { - return filter.match(player, game); - } - return false; - } + @Override + public boolean canTarget(UUID id, Game game) { + Player player = game.getPlayer(id); + if (player != null) { + return filter.match(player, game); + } + return false; + } - @Override - public boolean canTarget(UUID id, Ability source, Game game) { - Player player = game.getPlayer(id); - if (player != null) { - if (source != null) - return player.canBeTargetedBy(game.getObject(source.getSourceId()), game) && filter.match(player, game); - else - return filter.match(player, game); - } - return false; - } + @Override + public boolean canTarget(UUID id, Ability source, Game game) { + Player player = game.getPlayer(id); + if (player != null) { + if (source != null) + return player.canBeTargetedBy(game.getObject(source.getSourceId()), game) && filter.match(player, game); + else + return filter.match(player, game); + } + return false; + } - @Override - public String getTargetedName(Game game) { - StringBuilder sb = new StringBuilder(); - for (UUID targetId: getTargets()) { - sb.append(game.getPlayer(targetId).getName()).append(" "); - } - return sb.toString(); - } + @Override + public String getTargetedName(Game game) { + StringBuilder sb = new StringBuilder(); + for (UUID targetId: getTargets()) { + sb.append(game.getPlayer(targetId).getName()).append(" "); + } + return sb.toString(); + } - @Override - public TargetPlayer copy() { - return new TargetPlayer(this); - } + @Override + public TargetPlayer copy() { + return new TargetPlayer(this); + } } diff --git a/Mage/src/mage/target/TargetSource.java b/Mage/src/mage/target/TargetSource.java index 61d5fdc7a8..5a5bd9b5b0 100644 --- a/Mage/src/mage/target/TargetSource.java +++ b/Mage/src/mage/target/TargetSource.java @@ -48,81 +48,81 @@ import java.util.UUID; */ public class TargetSource extends TargetObject { - protected FilterObject filter; + protected FilterObject filter; - public TargetSource() { - this(1, 1, new FilterObject("source of your choice")); - } + public TargetSource() { + this(1, 1, new FilterObject("source of your choice")); + } - public TargetSource(FilterObject filter) { - this(1, 1, filter); - } + public TargetSource(FilterObject filter) { + this(1, 1, filter); + } - public TargetSource(int numTargets, FilterObject filter) { - this(numTargets, numTargets, filter); - } + public TargetSource(int numTargets, FilterObject filter) { + this(numTargets, numTargets, filter); + } - public TargetSource(int minNumTargets, int maxNumTargets, FilterObject filter) { - this.minNumberOfTargets = minNumTargets; - this.maxNumberOfTargets = maxNumTargets; - this.zone = Zone.ALL; - this.filter = filter; - this.targetName = filter.getMessage(); - } + public TargetSource(int minNumTargets, int maxNumTargets, FilterObject filter) { + this.minNumberOfTargets = minNumTargets; + this.maxNumberOfTargets = maxNumTargets; + this.zone = Zone.ALL; + this.filter = filter; + this.targetName = filter.getMessage(); + } - public TargetSource(final TargetSource target) { - super(target); - this.filter = target.filter.copy(); + public TargetSource(final TargetSource target) { + super(target); + this.filter = target.filter.copy(); setNotTarget(true); - } + } - @Override - public FilterObject getFilter() { - return filter; - } + @Override + public FilterObject getFilter() { + return filter; + } - @Override - public void add(UUID id, Game game) { - if (targets.size() < maxNumberOfTargets) { - if (!targets.containsKey(id)) { - MageObject object = game.getObject(id); - if (object != null && object instanceof StackObject) { - targets.put(((StackObject) object).getSourceId(), 0); - } - else { - targets.put(id, 0); - } - } - } - } + @Override + public void add(UUID id, Game game) { + if (targets.size() < maxNumberOfTargets) { + if (!targets.containsKey(id)) { + MageObject object = game.getObject(id); + if (object != null && object instanceof StackObject) { + targets.put(((StackObject) object).getSourceId(), 0); + } + else { + targets.put(id, 0); + } + } + } + } - @Override - public boolean canTarget(UUID id, Ability source, Game game) { - return true; - } + @Override + public boolean canTarget(UUID id, Ability source, Game game) { + return true; + } - @Override - public boolean canChoose(UUID sourceId, UUID sourceControllerId, Game game) { - return canChoose(sourceControllerId, game); - } + @Override + public boolean canChoose(UUID sourceId, UUID sourceControllerId, Game game) { + return canChoose(sourceControllerId, game); + } - @Override - public boolean canChoose(UUID sourceControllerId, Game game) { - int count = 0; - for (StackObject stackObject: game.getStack()) { - if (game.getPlayer(sourceControllerId).getInRange().contains(stackObject.getControllerId()) && filter.match(stackObject, game)) { - count++; - if (count >= this.minNumberOfTargets) - return true; - } - } - for (Permanent permanent: game.getBattlefield().getActivePermanents(sourceControllerId, game)) { - if (filter.match(permanent, game)) { - count++; - if (count >= this.minNumberOfTargets) - return true; - } - } + @Override + public boolean canChoose(UUID sourceControllerId, Game game) { + int count = 0; + for (StackObject stackObject: game.getStack()) { + if (game.getPlayer(sourceControllerId).getInRange().contains(stackObject.getControllerId()) && filter.match(stackObject, game)) { + count++; + if (count >= this.minNumberOfTargets) + return true; + } + } + for (Permanent permanent: game.getBattlefield().getActivePermanents(sourceControllerId, game)) { + if (filter.match(permanent, game)) { + count++; + if (count >= this.minNumberOfTargets) + return true; + } + } for (Player player : game.getPlayers().values()) { for (Card card : player.getGraveyard().getCards(game)) { if (filter.match(card, game)) { @@ -139,27 +139,27 @@ public class TargetSource extends TargetObject { return true; } } - return false; - } + return false; + } - @Override - public Set possibleTargets(UUID sourceId, UUID sourceControllerId, Game game) { - return possibleTargets(sourceControllerId, game); - } + @Override + public Set possibleTargets(UUID sourceId, UUID sourceControllerId, Game game) { + return possibleTargets(sourceControllerId, game); + } - @Override - public Set possibleTargets(UUID sourceControllerId, Game game) { - Set possibleTargets = new HashSet(); - for (StackObject stackObject: game.getStack()) { - if (game.getPlayer(sourceControllerId).getInRange().contains(stackObject.getControllerId()) && filter.match(stackObject, game)) { - possibleTargets.add(stackObject.getId()); - } - } - for (Permanent permanent: game.getBattlefield().getActivePermanents(sourceControllerId, game)) { - if (filter.match(permanent, game)) { - possibleTargets.add(permanent.getId()); - } - } + @Override + public Set possibleTargets(UUID sourceControllerId, Game game) { + Set possibleTargets = new HashSet(); + for (StackObject stackObject: game.getStack()) { + if (game.getPlayer(sourceControllerId).getInRange().contains(stackObject.getControllerId()) && filter.match(stackObject, game)) { + possibleTargets.add(stackObject.getId()); + } + } + for (Permanent permanent: game.getBattlefield().getActivePermanents(sourceControllerId, game)) { + if (filter.match(permanent, game)) { + possibleTargets.add(permanent.getId()); + } + } for (Player player : game.getPlayers().values()) { for (Card card : player.getGraveyard().getCards(game)) { if (filter.match(card, game)) { @@ -172,12 +172,12 @@ public class TargetSource extends TargetObject { possibleTargets.add(card.getId()); } } - return possibleTargets; - } + return possibleTargets; + } - @Override - public TargetSource copy() { - return new TargetSource(this); - } + @Override + public TargetSource copy() { + return new TargetSource(this); + } } diff --git a/Mage/src/mage/target/TargetSpell.java b/Mage/src/mage/target/TargetSpell.java index 46c9625b85..0db3d1d029 100644 --- a/Mage/src/mage/target/TargetSpell.java +++ b/Mage/src/mage/target/TargetSpell.java @@ -45,37 +45,37 @@ import java.util.UUID; */ public class TargetSpell extends TargetObject { - protected FilterSpell filter; + protected FilterSpell filter; - public TargetSpell() { - this(1, 1, new FilterSpell()); - } + public TargetSpell() { + this(1, 1, new FilterSpell()); + } - public TargetSpell(FilterSpell filter) { - this(1, 1, filter); - } + public TargetSpell(FilterSpell filter) { + this(1, 1, filter); + } - public TargetSpell(int numTargets, FilterSpell filter) { - this(numTargets, numTargets, filter); - } + public TargetSpell(int numTargets, FilterSpell filter) { + this(numTargets, numTargets, filter); + } - public TargetSpell(int minNumTargets, int maxNumTargets, FilterSpell filter) { - this.minNumberOfTargets = minNumTargets; - this.maxNumberOfTargets = maxNumTargets; - this.zone = Zone.STACK; - this.filter = filter; - this.targetName = filter.getMessage(); - } + public TargetSpell(int minNumTargets, int maxNumTargets, FilterSpell filter) { + this.minNumberOfTargets = minNumTargets; + this.maxNumberOfTargets = maxNumTargets; + this.zone = Zone.STACK; + this.filter = filter; + this.targetName = filter.getMessage(); + } - public TargetSpell(final TargetSpell target) { - super(target); - this.filter = target.filter.copy(); - } + public TargetSpell(final TargetSpell target) { + super(target); + this.filter = target.filter.copy(); + } - @Override - public FilterSpell getFilter() { - return filter; - } + @Override + public FilterSpell getFilter() { + return filter; + } @Override public boolean canTarget(UUID id, Ability source, Game game) { @@ -90,43 +90,43 @@ public class TargetSpell extends TargetObject { return false; } - @Override - public boolean canChoose(UUID sourceId, UUID sourceControllerId, Game game) { - return canChoose(sourceControllerId, game); - } + @Override + public boolean canChoose(UUID sourceId, UUID sourceControllerId, Game game) { + return canChoose(sourceControllerId, game); + } - @Override - public boolean canChoose(UUID sourceControllerId, Game game) { - int count = 0; - for (StackObject stackObject: game.getStack()) { - if (stackObject instanceof Spell && game.getPlayer(sourceControllerId).getInRange().contains(stackObject.getControllerId()) && filter.match((Spell)stackObject, game)) { - count++; - if (count >= this.minNumberOfTargets) - return true; - } - } - return false; - } + @Override + public boolean canChoose(UUID sourceControllerId, Game game) { + int count = 0; + for (StackObject stackObject: game.getStack()) { + if (stackObject instanceof Spell && game.getPlayer(sourceControllerId).getInRange().contains(stackObject.getControllerId()) && filter.match((Spell)stackObject, game)) { + count++; + if (count >= this.minNumberOfTargets) + return true; + } + } + return false; + } - @Override - public Set possibleTargets(UUID sourceId, UUID sourceControllerId, Game game) { - return possibleTargets(sourceControllerId, game); - } + @Override + public Set possibleTargets(UUID sourceId, UUID sourceControllerId, Game game) { + return possibleTargets(sourceControllerId, game); + } - @Override - public Set possibleTargets(UUID sourceControllerId, Game game) { - Set possibleTargets = new HashSet(); - for (StackObject stackObject: game.getStack()) { - if (stackObject instanceof Spell && game.getPlayer(sourceControllerId).getInRange().contains(stackObject.getControllerId()) && filter.match((Spell)stackObject, game)) { - possibleTargets.add(stackObject.getId()); - } - } - return possibleTargets; - } + @Override + public Set possibleTargets(UUID sourceControllerId, Game game) { + Set possibleTargets = new HashSet(); + for (StackObject stackObject: game.getStack()) { + if (stackObject instanceof Spell && game.getPlayer(sourceControllerId).getInRange().contains(stackObject.getControllerId()) && filter.match((Spell)stackObject, game)) { + possibleTargets.add(stackObject.getId()); + } + } + return possibleTargets; + } - @Override - public TargetSpell copy() { - return new TargetSpell(this); - } + @Override + public TargetSpell copy() { + return new TargetSpell(this); + } } diff --git a/Mage/src/mage/target/TargetStackObject.java b/Mage/src/mage/target/TargetStackObject.java index 52ffd2a723..d2b4583a51 100644 --- a/Mage/src/mage/target/TargetStackObject.java +++ b/Mage/src/mage/target/TargetStackObject.java @@ -44,84 +44,84 @@ import java.util.UUID; */ public class TargetStackObject extends TargetObject { - protected FilterStackObject filter; + protected FilterStackObject filter; - public TargetStackObject() { - this(1, 1, new FilterStackObject()); - } + public TargetStackObject() { + this(1, 1, new FilterStackObject()); + } - public TargetStackObject(FilterStackObject filter) { - this(1, 1, filter); - } + public TargetStackObject(FilterStackObject filter) { + this(1, 1, filter); + } - public TargetStackObject(int numTargets, FilterStackObject filter) { - this(numTargets, numTargets, filter); - } + public TargetStackObject(int numTargets, FilterStackObject filter) { + this(numTargets, numTargets, filter); + } - public TargetStackObject(int minNumTargets, int maxNumTargets, FilterStackObject filter) { - this.minNumberOfTargets = minNumTargets; - this.maxNumberOfTargets = maxNumTargets; - this.zone = Zone.STACK; - this.filter = filter; - this.targetName = filter.getMessage(); - } + public TargetStackObject(int minNumTargets, int maxNumTargets, FilterStackObject filter) { + this.minNumberOfTargets = minNumTargets; + this.maxNumberOfTargets = maxNumTargets; + this.zone = Zone.STACK; + this.filter = filter; + this.targetName = filter.getMessage(); + } - public TargetStackObject(final TargetStackObject target) { - super(target); - this.filter = target.filter.copy(); - } + public TargetStackObject(final TargetStackObject target) { + super(target); + this.filter = target.filter.copy(); + } - @Override - public FilterStackObject getFilter() { - return filter; - } + @Override + public FilterStackObject getFilter() { + return filter; + } - @Override - public boolean canTarget(UUID id, Ability source, Game game) { - StackObject stackObject = game.getStack().getStackObject(id); - if (stackObject != null) { - return filter.match(stackObject, game); - } - return false; - } + @Override + public boolean canTarget(UUID id, Ability source, Game game) { + StackObject stackObject = game.getStack().getStackObject(id); + if (stackObject != null) { + return filter.match(stackObject, game); + } + return false; + } - @Override - public boolean canChoose(UUID sourceId, UUID sourceControllerId, Game game) { - return canChoose(sourceControllerId, game); - } + @Override + public boolean canChoose(UUID sourceId, UUID sourceControllerId, Game game) { + return canChoose(sourceControllerId, game); + } - @Override - public boolean canChoose(UUID sourceControllerId, Game game) { - int count = 0; - for (StackObject stackObject: game.getStack()) { - if (game.getPlayer(sourceControllerId).getInRange().contains(stackObject.getControllerId()) && filter.match(stackObject, game)) { - count++; - if (count >= this.minNumberOfTargets) - return true; - } - } - return false; - } + @Override + public boolean canChoose(UUID sourceControllerId, Game game) { + int count = 0; + for (StackObject stackObject: game.getStack()) { + if (game.getPlayer(sourceControllerId).getInRange().contains(stackObject.getControllerId()) && filter.match(stackObject, game)) { + count++; + if (count >= this.minNumberOfTargets) + return true; + } + } + return false; + } - @Override - public Set possibleTargets(UUID sourceId, UUID sourceControllerId, Game game) { - return possibleTargets(sourceControllerId, game); - } + @Override + public Set possibleTargets(UUID sourceId, UUID sourceControllerId, Game game) { + return possibleTargets(sourceControllerId, game); + } - @Override - public Set possibleTargets(UUID sourceControllerId, Game game) { - Set possibleTargets = new HashSet(); - for (StackObject stackObject: game.getStack()) { - if (game.getPlayer(sourceControllerId).getInRange().contains(stackObject.getControllerId()) && filter.match(stackObject, game)) { - possibleTargets.add(stackObject.getId()); - } - } - return possibleTargets; - } + @Override + public Set possibleTargets(UUID sourceControllerId, Game game) { + Set possibleTargets = new HashSet(); + for (StackObject stackObject: game.getStack()) { + if (game.getPlayer(sourceControllerId).getInRange().contains(stackObject.getControllerId()) && filter.match(stackObject, game)) { + possibleTargets.add(stackObject.getId()); + } + } + return possibleTargets; + } - @Override - public TargetStackObject copy() { - return new TargetStackObject(this); - } + @Override + public TargetStackObject copy() { + return new TargetStackObject(this); + } } diff --git a/Mage/src/mage/target/Targets.java b/Mage/src/mage/target/Targets.java index 72e98e2ce5..8dcb37cc03 100644 --- a/Mage/src/mage/target/Targets.java +++ b/Mage/src/mage/target/Targets.java @@ -41,116 +41,116 @@ import mage.game.Game; */ public class Targets extends ArrayList { - public Targets() {} + public Targets() {} - public Targets(final Targets targets) { - for (Target target: targets) { - this.add(target.copy()); - } - } + public Targets(final Targets targets) { + for (Target target: targets) { + this.add(target.copy()); + } + } - public List getUnchosen() { - List unchosen = new ArrayList(); - for (Target target: this) { - if (!target.isChosen()) - unchosen.add(target); - } - return unchosen; - } + public List getUnchosen() { + List unchosen = new ArrayList(); + for (Target target: this) { + if (!target.isChosen()) + unchosen.add(target); + } + return unchosen; + } - public void clearChosen() { - for (Target target: this) { - target.clearChosen(); - } - } + public void clearChosen() { + for (Target target: this) { + target.clearChosen(); + } + } - public boolean isChosen() { - for (Target target: this) { - if (!target.isChosen()) - return false; - } - return true; - } + public boolean isChosen() { + for (Target target: this) { + if (!target.isChosen()) + return false; + } + return true; + } - public boolean choose(Outcome outcome, UUID playerId, UUID sourceId, Game game) { - if (this.size() > 0) { - if (!canChoose(playerId, game)) - return false; - while (!isChosen()) { - Target target = this.getUnchosen().get(0); - if (!target.choose(outcome, playerId, sourceId, game)) - return false; - } - } - return true; - } + public boolean choose(Outcome outcome, UUID playerId, UUID sourceId, Game game) { + if (this.size() > 0) { + if (!canChoose(playerId, game)) + return false; + while (!isChosen()) { + Target target = this.getUnchosen().get(0); + if (!target.choose(outcome, playerId, sourceId, game)) + return false; + } + } + return true; + } - public boolean chooseTargets(Outcome outcome, UUID playerId, Ability source, Game game) { - if (this.size() > 0) { - if (!canChoose(source.getId(), playerId, game)) - return false; - while (!isChosen()) { - Target target = this.getUnchosen().get(0); - if (!target.chooseTarget(outcome, playerId, source, game)) - return false; - } - } - return true; - } + public boolean chooseTargets(Outcome outcome, UUID playerId, Ability source, Game game) { + if (this.size() > 0) { + if (!canChoose(source.getId(), playerId, game)) + return false; + while (!isChosen()) { + Target target = this.getUnchosen().get(0); + if (!target.chooseTarget(outcome, playerId, source, game)) + return false; + } + } + return true; + } - public boolean stillLegal(Ability source, Game game) { - // 608.2 - // The spell or ability is countered if all its targets, for every instance of the word "target," are now illegal - int illegalCount = 0; - for (Target target: this) { - if (target.isLegal(source, game)) { - illegalCount++; - } - } - // check all are illegal - return this.size() == illegalCount; - } + public boolean stillLegal(Ability source, Game game) { + // 608.2 + // The spell or ability is countered if all its targets, for every instance of the word "target," are now illegal + int illegalCount = 0; + for (Target target: this) { + if (target.isLegal(source, game)) { + illegalCount++; + } + } + // check all are illegal + return this.size() == illegalCount; + } - /** - * Checks if there are enough targets that can be chosen. Should only be used - * for Ability targets since this checks for protection, shroud etc. - * - * @param sourceId - the target event source - * @param sourceControllerId - controller of the target event source - * @param game - * @return - true if enough valid targets exist - */ - public boolean canChoose(UUID sourceId, UUID sourceControllerId, Game game) { - for (Target target: this) { - if (!target.canChoose(sourceId, sourceControllerId, game)) - return false; - } - return true; - } + /** + * Checks if there are enough targets that can be chosen. Should only be used + * for Ability targets since this checks for protection, shroud etc. + * + * @param sourceId - the target event source + * @param sourceControllerId - controller of the target event source + * @param game + * @return - true if enough valid targets exist + */ + public boolean canChoose(UUID sourceId, UUID sourceControllerId, Game game) { + for (Target target: this) { + if (!target.canChoose(sourceId, sourceControllerId, game)) + return false; + } + return true; + } - /** - * Checks if there are enough objects that can be selected. Should not be used - * for Ability targets since this does not check for protection, shroud etc. - * - * @param sourceControllerId - controller of the select event - * @param game - * @return - true if enough valid objects exist - */ - public boolean canChoose(UUID sourceControllerId, Game game) { - for (Target target: this) { - if (!target.canChoose(sourceControllerId, game)) - return false; - } - return true; - } + /** + * Checks if there are enough objects that can be selected. Should not be used + * for Ability targets since this does not check for protection, shroud etc. + * + * @param sourceControllerId - controller of the select event + * @param game + * @return - true if enough valid objects exist + */ + public boolean canChoose(UUID sourceControllerId, Game game) { + for (Target target: this) { + if (!target.canChoose(sourceControllerId, game)) + return false; + } + return true; + } - public UUID getFirstTarget() { - if (this.size() > 0) - return this.get(0).getFirstTarget(); - return null; - } + public UUID getFirstTarget() { + if (this.size() > 0) + return this.get(0).getFirstTarget(); + return null; + } - public Targets copy() { - return new Targets(this); - } + public Targets copy() { + return new Targets(this); + } } diff --git a/Mage/src/mage/target/common/TargetArtifactPermanent.java b/Mage/src/mage/target/common/TargetArtifactPermanent.java index 2efb20e6d3..50dd3a3172 100644 --- a/Mage/src/mage/target/common/TargetArtifactPermanent.java +++ b/Mage/src/mage/target/common/TargetArtifactPermanent.java @@ -36,34 +36,34 @@ import mage.target.TargetPermanent; */ public class TargetArtifactPermanent> extends TargetPermanent> { - public TargetArtifactPermanent() { - this(1, 1, new FilterArtifactPermanent(), false); - } + public TargetArtifactPermanent() { + this(1, 1, new FilterArtifactPermanent(), false); + } - public TargetArtifactPermanent(FilterArtifactPermanent filter) { - this(1, 1, filter, false); - } + public TargetArtifactPermanent(FilterArtifactPermanent filter) { + this(1, 1, filter, false); + } - public TargetArtifactPermanent(int numTargets) { - this(numTargets, numTargets, new FilterArtifactPermanent(), false); - } + public TargetArtifactPermanent(int numTargets) { + this(numTargets, numTargets, new FilterArtifactPermanent(), false); + } - public TargetArtifactPermanent(int minNumTargets, int maxNumTargets) { - this(minNumTargets, maxNumTargets, new FilterArtifactPermanent(), false); - } + public TargetArtifactPermanent(int minNumTargets, int maxNumTargets) { + this(minNumTargets, maxNumTargets, new FilterArtifactPermanent(), false); + } - public TargetArtifactPermanent(int minNumTargets, int maxNumTargets, FilterArtifactPermanent filter, boolean notTarget) { - super(minNumTargets, maxNumTargets, filter, notTarget); - this.targetName = filter.getMessage(); - } + public TargetArtifactPermanent(int minNumTargets, int maxNumTargets, FilterArtifactPermanent filter, boolean notTarget) { + super(minNumTargets, maxNumTargets, filter, notTarget); + this.targetName = filter.getMessage(); + } - public TargetArtifactPermanent(final TargetArtifactPermanent target) { - super(target); - } + public TargetArtifactPermanent(final TargetArtifactPermanent target) { + super(target); + } - @Override - public TargetArtifactPermanent copy() { - return new TargetArtifactPermanent(this); - } + @Override + public TargetArtifactPermanent copy() { + return new TargetArtifactPermanent(this); + } } diff --git a/Mage/src/mage/target/common/TargetAttackingCreature.java b/Mage/src/mage/target/common/TargetAttackingCreature.java index 65272109fc..8f822bfe98 100644 --- a/Mage/src/mage/target/common/TargetAttackingCreature.java +++ b/Mage/src/mage/target/common/TargetAttackingCreature.java @@ -36,26 +36,26 @@ import mage.filter.common.FilterAttackingCreature; */ public class TargetAttackingCreature extends TargetCreaturePermanent { - public TargetAttackingCreature() { - this(1, 1, new FilterAttackingCreature(), false); - } + public TargetAttackingCreature() { + this(1, 1, new FilterAttackingCreature(), false); + } - public TargetAttackingCreature(int numTargets) { - this(numTargets, numTargets, new FilterAttackingCreature(), false); - } + public TargetAttackingCreature(int numTargets) { + this(numTargets, numTargets, new FilterAttackingCreature(), false); + } - public TargetAttackingCreature(int minNumTargets, int maxNumTargets, FilterAttackingCreature filter, boolean notTarget) { - super(minNumTargets, maxNumTargets, filter, notTarget); - this.targetName = filter.getMessage(); - } + public TargetAttackingCreature(int minNumTargets, int maxNumTargets, FilterAttackingCreature filter, boolean notTarget) { + super(minNumTargets, maxNumTargets, filter, notTarget); + this.targetName = filter.getMessage(); + } - public TargetAttackingCreature(final TargetAttackingCreature target) { - super(target); - } + public TargetAttackingCreature(final TargetAttackingCreature target) { + super(target); + } - @Override - public TargetAttackingCreature copy() { - return new TargetAttackingCreature(this); - } + @Override + public TargetAttackingCreature copy() { + return new TargetAttackingCreature(this); + } } diff --git a/Mage/src/mage/target/common/TargetAttackingOrBlockingCreature.java b/Mage/src/mage/target/common/TargetAttackingOrBlockingCreature.java index 4ce49f4f76..c8c2939da9 100644 --- a/Mage/src/mage/target/common/TargetAttackingOrBlockingCreature.java +++ b/Mage/src/mage/target/common/TargetAttackingOrBlockingCreature.java @@ -36,26 +36,26 @@ import mage.filter.common.FilterAttackingOrBlockingCreature; */ public class TargetAttackingOrBlockingCreature extends TargetCreaturePermanent { - public TargetAttackingOrBlockingCreature() { - this(1, 1, new FilterAttackingOrBlockingCreature(), false); - } + public TargetAttackingOrBlockingCreature() { + this(1, 1, new FilterAttackingOrBlockingCreature(), false); + } - public TargetAttackingOrBlockingCreature(int numTargets) { - this(numTargets, numTargets, new FilterAttackingOrBlockingCreature(), false); - } + public TargetAttackingOrBlockingCreature(int numTargets) { + this(numTargets, numTargets, new FilterAttackingOrBlockingCreature(), false); + } - public TargetAttackingOrBlockingCreature(int minNumTargets, int maxNumTargets, FilterAttackingOrBlockingCreature filter, boolean notTarget) { - super(minNumTargets, maxNumTargets, filter, notTarget); - this.targetName = filter.getMessage(); - } + public TargetAttackingOrBlockingCreature(int minNumTargets, int maxNumTargets, FilterAttackingOrBlockingCreature filter, boolean notTarget) { + super(minNumTargets, maxNumTargets, filter, notTarget); + this.targetName = filter.getMessage(); + } - public TargetAttackingOrBlockingCreature(final TargetAttackingOrBlockingCreature target) { - super(target); - } + public TargetAttackingOrBlockingCreature(final TargetAttackingOrBlockingCreature target) { + super(target); + } - @Override - public TargetAttackingOrBlockingCreature copy() { - return new TargetAttackingOrBlockingCreature(this); - } + @Override + public TargetAttackingOrBlockingCreature copy() { + return new TargetAttackingOrBlockingCreature(this); + } } diff --git a/Mage/src/mage/target/common/TargetBasicLandCard.java b/Mage/src/mage/target/common/TargetBasicLandCard.java index 33a37febcc..a03fffa742 100644 --- a/Mage/src/mage/target/common/TargetBasicLandCard.java +++ b/Mage/src/mage/target/common/TargetBasicLandCard.java @@ -39,20 +39,20 @@ import mage.target.TargetCard; */ public class TargetBasicLandCard extends TargetCard { - public TargetBasicLandCard(Zone zone) { - super(zone); - filter.getSupertype().add("Basic"); - filter.setScopeSupertype(ComparisonScope.Any); - filter.getCardType().add(CardType.LAND); - filter.setScopeCardType(ComparisonScope.Any); - } + public TargetBasicLandCard(Zone zone) { + super(zone); + filter.getSupertype().add("Basic"); + filter.setScopeSupertype(ComparisonScope.Any); + filter.getCardType().add(CardType.LAND); + filter.setScopeCardType(ComparisonScope.Any); + } - public TargetBasicLandCard(final TargetBasicLandCard target) { - super(target); - } + public TargetBasicLandCard(final TargetBasicLandCard target) { + super(target); + } - @Override - public TargetBasicLandCard copy() { - return new TargetBasicLandCard(this); - } + @Override + public TargetBasicLandCard copy() { + return new TargetBasicLandCard(this); + } } diff --git a/Mage/src/mage/target/common/TargetBlockingCreature.java b/Mage/src/mage/target/common/TargetBlockingCreature.java index 5a38c16619..d502576207 100644 --- a/Mage/src/mage/target/common/TargetBlockingCreature.java +++ b/Mage/src/mage/target/common/TargetBlockingCreature.java @@ -36,26 +36,26 @@ import mage.filter.common.FilterBlockingCreature; public class TargetBlockingCreature extends TargetCreaturePermanent { - public TargetBlockingCreature() { - this(1, 1, new FilterBlockingCreature(), false); - } + public TargetBlockingCreature() { + this(1, 1, new FilterBlockingCreature(), false); + } - public TargetBlockingCreature(int numTargets) { - this(numTargets, numTargets, new FilterBlockingCreature(), false); - } + public TargetBlockingCreature(int numTargets) { + this(numTargets, numTargets, new FilterBlockingCreature(), false); + } - public TargetBlockingCreature(int minNumTargets, int maxNumTargets, FilterBlockingCreature filter, boolean notTarget) { - super(minNumTargets, maxNumTargets, filter, notTarget); - this.targetName = filter.getMessage(); - } + public TargetBlockingCreature(int minNumTargets, int maxNumTargets, FilterBlockingCreature filter, boolean notTarget) { + super(minNumTargets, maxNumTargets, filter, notTarget); + this.targetName = filter.getMessage(); + } - public TargetBlockingCreature(final TargetBlockingCreature target) { - super(target); - } + public TargetBlockingCreature(final TargetBlockingCreature target) { + super(target); + } - @Override - public TargetBlockingCreature copy() { - return new TargetBlockingCreature(this); - } + @Override + public TargetBlockingCreature copy() { + return new TargetBlockingCreature(this); + } } diff --git a/Mage/src/mage/target/common/TargetCardInExile.java b/Mage/src/mage/target/common/TargetCardInExile.java index da3f5131d6..a1947f3f18 100644 --- a/Mage/src/mage/target/common/TargetCardInExile.java +++ b/Mage/src/mage/target/common/TargetCardInExile.java @@ -44,26 +44,26 @@ import java.util.UUID; public class TargetCardInExile extends TargetCard { private UUID zoneId; - + public TargetCardInExile(FilterCard filter, UUID zoneId) { this(1, 1, filter, zoneId); } - public TargetCardInExile(int minNumTargets, int maxNumTargets, FilterCard filter, UUID zoneId) { - super(minNumTargets, maxNumTargets, Zone.EXILED, filter); + public TargetCardInExile(int minNumTargets, int maxNumTargets, FilterCard filter, UUID zoneId) { + super(minNumTargets, maxNumTargets, Zone.EXILED, filter); this.zoneId = zoneId; - this.targetName = filter.getMessage(); - } + this.targetName = filter.getMessage(); + } public TargetCardInExile(final TargetCardInExile target) { super(target); this.zoneId = target.zoneId; } - @Override - public boolean canTarget(UUID id, Ability source, Game game) { - Card card = game.getCard(id); - if (card != null && game.getState().getZone(card.getId()) == Zone.EXILED) { + @Override + public boolean canTarget(UUID id, Ability source, Game game) { + Card card = game.getCard(id); + if (card != null && game.getState().getZone(card.getId()) == Zone.EXILED) { ExileZone exile; if (zoneId != null) { exile = game.getExile().getExileZone(zoneId); @@ -71,11 +71,11 @@ public class TargetCardInExile extends TargetCard { exile = game.getExile().getPermanentExile(); } if (exile != null && exile.contains(id)) { - return filter.match(card, game); + return filter.match(card, game); } } - return false; - } + return false; + } @Override public TargetCardInExile copy() { diff --git a/Mage/src/mage/target/common/TargetCardInGraveyard.java b/Mage/src/mage/target/common/TargetCardInGraveyard.java index bb6aa02e4a..a795458a9e 100644 --- a/Mage/src/mage/target/common/TargetCardInGraveyard.java +++ b/Mage/src/mage/target/common/TargetCardInGraveyard.java @@ -43,38 +43,38 @@ import java.util.UUID; */ public class TargetCardInGraveyard extends TargetCard { - public TargetCardInGraveyard() { - this(1, 1, new FilterCard("card from a graveyard")); - } + public TargetCardInGraveyard() { + this(1, 1, new FilterCard("card from a graveyard")); + } - public TargetCardInGraveyard(FilterCard filter) { - this(1, 1, filter); - } + public TargetCardInGraveyard(FilterCard filter) { + this(1, 1, filter); + } - public TargetCardInGraveyard(int numTargets, FilterCard filter) { - this(numTargets, numTargets, filter); - } + public TargetCardInGraveyard(int numTargets, FilterCard filter) { + this(numTargets, numTargets, filter); + } - public TargetCardInGraveyard(int minNumTargets, int maxNumTargets, FilterCard filter) { - super(minNumTargets, maxNumTargets, Zone.GRAVEYARD, filter); - this.targetName = filter.getMessage(); - } + public TargetCardInGraveyard(int minNumTargets, int maxNumTargets, FilterCard filter) { + super(minNumTargets, maxNumTargets, Zone.GRAVEYARD, filter); + this.targetName = filter.getMessage(); + } - public TargetCardInGraveyard(final TargetCardInGraveyard target) { - super(target); - } + public TargetCardInGraveyard(final TargetCardInGraveyard target) { + super(target); + } - @Override - public boolean canTarget(UUID id, Ability source, Game game) { - Card card = game.getCard(id); - if (card != null && game.getState().getZone(card.getId()) == Zone.GRAVEYARD) - return filter.match(card, game); - return false; - } + @Override + public boolean canTarget(UUID id, Ability source, Game game) { + Card card = game.getCard(id); + if (card != null && game.getState().getZone(card.getId()) == Zone.GRAVEYARD) + return filter.match(card, game); + return false; + } - @Override - public TargetCardInGraveyard copy() { - return new TargetCardInGraveyard(this); - } + @Override + public TargetCardInGraveyard copy() { + return new TargetCardInGraveyard(this); + } } diff --git a/Mage/src/mage/target/common/TargetCardInHand.java b/Mage/src/mage/target/common/TargetCardInHand.java index c06baa7657..21b5fb9e05 100644 --- a/Mage/src/mage/target/common/TargetCardInHand.java +++ b/Mage/src/mage/target/common/TargetCardInHand.java @@ -42,39 +42,39 @@ import mage.target.TargetCard; */ public class TargetCardInHand extends TargetCard { - public TargetCardInHand() { - this(1, 1, new FilterCard()); - } + public TargetCardInHand() { + this(1, 1, new FilterCard()); + } - public TargetCardInHand(FilterCard filter) { - this(1, 1, filter); - } + public TargetCardInHand(FilterCard filter) { + this(1, 1, filter); + } - public TargetCardInHand(int numTargets, FilterCard filter) { - this(numTargets, numTargets, filter); - } + public TargetCardInHand(int numTargets, FilterCard filter) { + this(numTargets, numTargets, filter); + } - public TargetCardInHand(int minNumTargets, int maxNumTargets, FilterCard filter) { - super(minNumTargets, maxNumTargets, Zone.HAND, filter); - this.targetName = filter.getMessage(); - } + public TargetCardInHand(int minNumTargets, int maxNumTargets, FilterCard filter) { + super(minNumTargets, maxNumTargets, Zone.HAND, filter); + this.targetName = filter.getMessage(); + } - public TargetCardInHand(final TargetCardInHand target) { - super(target); - } + public TargetCardInHand(final TargetCardInHand target) { + super(target); + } - @Override - public boolean canTarget(UUID id, Ability source, Game game) { - Card card = game.getPlayer(source.getControllerId()).getHand().get(id, game); - if (card != null) - return filter.match(card, game); - return false; - } + @Override + public boolean canTarget(UUID id, Ability source, Game game) { + Card card = game.getPlayer(source.getControllerId()).getHand().get(id, game); + if (card != null) + return filter.match(card, game); + return false; + } - @Override - public TargetCardInHand copy() { - return new TargetCardInHand(this); - } + @Override + public TargetCardInHand copy() { + return new TargetCardInHand(this); + } @Override public String getTargetedName(Game game) { diff --git a/Mage/src/mage/target/common/TargetCardInLibrary.java b/Mage/src/mage/target/common/TargetCardInLibrary.java index ab72fbcb64..7a3017033a 100644 --- a/Mage/src/mage/target/common/TargetCardInLibrary.java +++ b/Mage/src/mage/target/common/TargetCardInLibrary.java @@ -46,64 +46,64 @@ import java.util.UUID; */ public class TargetCardInLibrary extends TargetCard { - public TargetCardInLibrary() { - this(1, 1, new FilterCard()); - } + public TargetCardInLibrary() { + this(1, 1, new FilterCard()); + } - public TargetCardInLibrary(FilterCard filter) { - this(1, 1, filter); - } + public TargetCardInLibrary(FilterCard filter) { + this(1, 1, filter); + } - public TargetCardInLibrary(int numTargets, FilterCard filter) { - this(numTargets, numTargets, filter); - } + public TargetCardInLibrary(int numTargets, FilterCard filter) { + this(numTargets, numTargets, filter); + } - public TargetCardInLibrary(int minNumTargets, int maxNumTargets, FilterCard filter) { - super(minNumTargets, maxNumTargets, Zone.LIBRARY, filter); - } + public TargetCardInLibrary(int minNumTargets, int maxNumTargets, FilterCard filter) { + super(minNumTargets, maxNumTargets, Zone.LIBRARY, filter); + } - public TargetCardInLibrary(final TargetCardInLibrary target) { - super(target); - } + public TargetCardInLibrary(final TargetCardInLibrary target) { + super(target); + } - @Override - public boolean choose(Outcome outcome, UUID playerId, UUID targetPlayerId, Game game) { - Player player = game.getPlayer(playerId); - Player targetPlayer = game.getPlayer(targetPlayerId); - if (targetPlayer == null) { - targetPlayer = player; - } - while (!isChosen() && !doneChosing()) { - chosen = targets.size() >= minNumberOfTargets; - if (!player.choose(outcome, new CardsImpl(Zone.LIBRARY, targetPlayer.getLibrary().getCards(game)), this, game)) { - return chosen; - } - chosen = targets.size() >= minNumberOfTargets; - } - // Issue 231 - /*while (!doneChosing()) { - if (!player.choose(outcome, new CardsImpl(Zone.LIBRARY, player.getLibrary().getCards(game)), this, game)) { - break; - } - }*/ - return chosen = true; - } + @Override + public boolean choose(Outcome outcome, UUID playerId, UUID targetPlayerId, Game game) { + Player player = game.getPlayer(playerId); + Player targetPlayer = game.getPlayer(targetPlayerId); + if (targetPlayer == null) { + targetPlayer = player; + } + while (!isChosen() && !doneChosing()) { + chosen = targets.size() >= minNumberOfTargets; + if (!player.choose(outcome, new CardsImpl(Zone.LIBRARY, targetPlayer.getLibrary().getCards(game)), this, game)) { + return chosen; + } + chosen = targets.size() >= minNumberOfTargets; + } + // Issue 231 + /*while (!doneChosing()) { + if (!player.choose(outcome, new CardsImpl(Zone.LIBRARY, player.getLibrary().getCards(game)), this, game)) { + break; + } + }*/ + return chosen = true; + } - @Override - public boolean canTarget(UUID id, Ability source, Game game) { - Card card = game.getPlayer(source.getControllerId()).getLibrary().getCard(id, game); - if (card != null) - return filter.match(card, game); - return false; - } + @Override + public boolean canTarget(UUID id, Ability source, Game game) { + Card card = game.getPlayer(source.getControllerId()).getLibrary().getCard(id, game); + if (card != null) + return filter.match(card, game); + return false; + } - @Override - public TargetCardInLibrary copy() { - return new TargetCardInLibrary(this); - } + @Override + public TargetCardInLibrary copy() { + return new TargetCardInLibrary(this); + } - public void setMinNumberOfTargets(int minNumberOfTargets) { - this.minNumberOfTargets = minNumberOfTargets; - } + public void setMinNumberOfTargets(int minNumberOfTargets) { + this.minNumberOfTargets = minNumberOfTargets; + } } diff --git a/Mage/src/mage/target/common/TargetCardInYourGraveyard.java b/Mage/src/mage/target/common/TargetCardInYourGraveyard.java index a2600ef053..1c235241c1 100644 --- a/Mage/src/mage/target/common/TargetCardInYourGraveyard.java +++ b/Mage/src/mage/target/common/TargetCardInYourGraveyard.java @@ -42,53 +42,53 @@ import mage.target.TargetCard; */ public class TargetCardInYourGraveyard extends TargetCard { - public TargetCardInYourGraveyard() { - this(1, 1, new FilterCard("card from your graveyard")); - } + public TargetCardInYourGraveyard() { + this(1, 1, new FilterCard("card from your graveyard")); + } - public TargetCardInYourGraveyard(FilterCard filter) { - this(1, 1, filter); - } + public TargetCardInYourGraveyard(FilterCard filter) { + this(1, 1, filter); + } - public TargetCardInYourGraveyard(int numTargets, FilterCard filter) { - this(numTargets, numTargets, filter); - } + public TargetCardInYourGraveyard(int numTargets, FilterCard filter) { + this(numTargets, numTargets, filter); + } - public TargetCardInYourGraveyard(int minNumTargets, int maxNumTargets, FilterCard filter) { - super(minNumTargets, maxNumTargets, Zone.GRAVEYARD, filter); - this.targetName = filter.getMessage(); - } + public TargetCardInYourGraveyard(int minNumTargets, int maxNumTargets, FilterCard filter) { + super(minNumTargets, maxNumTargets, Zone.GRAVEYARD, filter); + this.targetName = filter.getMessage(); + } - public TargetCardInYourGraveyard(final TargetCardInYourGraveyard target) { - super(target); - } + public TargetCardInYourGraveyard(final TargetCardInYourGraveyard target) { + super(target); + } - @Override - public boolean canTarget(UUID id, Ability source, Game game) { - Card card = game.getCard(id); - if (card != null && game.getState().getZone(card.getId()) == Zone.GRAVEYARD) - if (game.getPlayer(source.getControllerId()).getGraveyard().contains(id)) - return filter.match(card, game); - return false; - } + @Override + public boolean canTarget(UUID id, Ability source, Game game) { + Card card = game.getCard(id); + if (card != null && game.getState().getZone(card.getId()) == Zone.GRAVEYARD) + if (game.getPlayer(source.getControllerId()).getGraveyard().contains(id)) + return filter.match(card, game); + return false; + } - /** - * Checks if there are enough {@link Card} that can be selected. - * - * @param sourceControllerId - controller of the select event - * @param game - * @return - true if enough valid {@link Card} exist - */ - @Override - public boolean canChoose(UUID sourceControllerId, Game game) { - if (game.getPlayer(sourceControllerId).getGraveyard().count(filter, game) >= this.minNumberOfTargets) - return true; - return false; - } + /** + * Checks if there are enough {@link Card} that can be selected. + * + * @param sourceControllerId - controller of the select event + * @param game + * @return - true if enough valid {@link Card} exist + */ + @Override + public boolean canChoose(UUID sourceControllerId, Game game) { + if (game.getPlayer(sourceControllerId).getGraveyard().count(filter, game) >= this.minNumberOfTargets) + return true; + return false; + } - @Override - public TargetCardInYourGraveyard copy() { - return new TargetCardInYourGraveyard(this); - } + @Override + public TargetCardInYourGraveyard copy() { + return new TargetCardInYourGraveyard(this); + } } diff --git a/Mage/src/mage/target/common/TargetControlledCreaturePermanent.java b/Mage/src/mage/target/common/TargetControlledCreaturePermanent.java index 83ccb6215c..a010851e8b 100644 --- a/Mage/src/mage/target/common/TargetControlledCreaturePermanent.java +++ b/Mage/src/mage/target/common/TargetControlledCreaturePermanent.java @@ -36,35 +36,35 @@ import mage.filter.common.FilterControlledCreaturePermanent; */ public class TargetControlledCreaturePermanent extends TargetControlledPermanent { - public TargetControlledCreaturePermanent() { - this(1, 1, new FilterControlledCreaturePermanent(), false); - } + public TargetControlledCreaturePermanent() { + this(1, 1, new FilterControlledCreaturePermanent(), false); + } - public TargetControlledCreaturePermanent(boolean required) { - this(1, 1, new FilterControlledCreaturePermanent(), false); - this.required = required; - } + public TargetControlledCreaturePermanent(boolean required) { + this(1, 1, new FilterControlledCreaturePermanent(), false); + this.required = required; + } - public TargetControlledCreaturePermanent(int numTargets) { - this(numTargets, numTargets, new FilterControlledCreaturePermanent(), false); - } + public TargetControlledCreaturePermanent(int numTargets) { + this(numTargets, numTargets, new FilterControlledCreaturePermanent(), false); + } - public TargetControlledCreaturePermanent(int minNumTargets, int maxNumTargets, FilterControlledCreaturePermanent filter, boolean notTarget) { - super(minNumTargets, maxNumTargets, filter, notTarget); - this.targetName = filter.getMessage(); - } + public TargetControlledCreaturePermanent(int minNumTargets, int maxNumTargets, FilterControlledCreaturePermanent filter, boolean notTarget) { + super(minNumTargets, maxNumTargets, filter, notTarget); + this.targetName = filter.getMessage(); + } public TargetControlledCreaturePermanent(int minNumTargets, int maxNumTargets, FilterControlledCreaturePermanent filter, boolean notTarget, boolean required) { - this(minNumTargets, maxNumTargets, filter, notTarget); + this(minNumTargets, maxNumTargets, filter, notTarget); this.required = required; - } + } - public TargetControlledCreaturePermanent(final TargetControlledCreaturePermanent target) { - super(target); - } + public TargetControlledCreaturePermanent(final TargetControlledCreaturePermanent target) { + super(target); + } - @Override - public TargetControlledCreaturePermanent copy() { - return new TargetControlledCreaturePermanent(this); - } + @Override + public TargetControlledCreaturePermanent copy() { + return new TargetControlledCreaturePermanent(this); + } } diff --git a/Mage/src/mage/target/common/TargetControlledPermanent.java b/Mage/src/mage/target/common/TargetControlledPermanent.java index b68099ac4d..8596a38c0e 100644 --- a/Mage/src/mage/target/common/TargetControlledPermanent.java +++ b/Mage/src/mage/target/common/TargetControlledPermanent.java @@ -38,29 +38,29 @@ import mage.target.TargetPermanent; */ public class TargetControlledPermanent> extends TargetPermanent> { - public TargetControlledPermanent() { - this(1, 1, new FilterControlledPermanent(), false); - } + public TargetControlledPermanent() { + this(1, 1, new FilterControlledPermanent(), false); + } - public TargetControlledPermanent(int numTargets) { - this(numTargets, numTargets, new FilterControlledPermanent(), false); - } + public TargetControlledPermanent(int numTargets) { + this(numTargets, numTargets, new FilterControlledPermanent(), false); + } - public TargetControlledPermanent(FilterControlledPermanent filter) { - this(1, 1, filter, false); - } + public TargetControlledPermanent(FilterControlledPermanent filter) { + this(1, 1, filter, false); + } - public TargetControlledPermanent(int minNumTargets, int maxNumTargets, FilterPermanent filter, boolean notTarget) { - super(minNumTargets, maxNumTargets, filter, notTarget); - this.targetName = filter.getMessage(); - } + public TargetControlledPermanent(int minNumTargets, int maxNumTargets, FilterPermanent filter, boolean notTarget) { + super(minNumTargets, maxNumTargets, filter, notTarget); + this.targetName = filter.getMessage(); + } - public TargetControlledPermanent(final TargetControlledPermanent target) { - super(target); - } + public TargetControlledPermanent(final TargetControlledPermanent target) { + super(target); + } - @Override - public TargetControlledPermanent copy() { - return new TargetControlledPermanent(this); - } + @Override + public TargetControlledPermanent copy() { + return new TargetControlledPermanent(this); + } } diff --git a/Mage/src/mage/target/common/TargetCreatureOrPlayer.java b/Mage/src/mage/target/common/TargetCreatureOrPlayer.java index 7c30d31700..bcb516c297 100644 --- a/Mage/src/mage/target/common/TargetCreatureOrPlayer.java +++ b/Mage/src/mage/target/common/TargetCreatureOrPlayer.java @@ -49,191 +49,191 @@ import java.util.UUID; */ public class TargetCreatureOrPlayer extends TargetImpl { - protected FilterCreatureOrPlayer filter; + protected FilterCreatureOrPlayer filter; public TargetCreatureOrPlayer(boolean required) { this(); setRequired(required); } - public TargetCreatureOrPlayer() { - this(1, 1); - } + public TargetCreatureOrPlayer() { + this(1, 1); + } - public TargetCreatureOrPlayer(int numTargets) { - this(numTargets, numTargets); - } + public TargetCreatureOrPlayer(int numTargets) { + this(numTargets, numTargets); + } - public TargetCreatureOrPlayer(int minNumTargets, int maxNumTargets) { - this.minNumberOfTargets = minNumTargets; - this.maxNumberOfTargets = maxNumTargets; - this.zone = Zone.ALL; - this.filter = new FilterCreatureOrPlayer(); - this.targetName = filter.getMessage(); - } + public TargetCreatureOrPlayer(int minNumTargets, int maxNumTargets) { + this.minNumberOfTargets = minNumTargets; + this.maxNumberOfTargets = maxNumTargets; + this.zone = Zone.ALL; + this.filter = new FilterCreatureOrPlayer(); + this.targetName = filter.getMessage(); + } - public TargetCreatureOrPlayer(final TargetCreatureOrPlayer target) { - super(target); - this.filter = target.filter.copy(); - } + public TargetCreatureOrPlayer(final TargetCreatureOrPlayer target) { + super(target); + this.filter = target.filter.copy(); + } - @Override - public Filter getFilter() { - return this.filter; - } + @Override + public Filter getFilter() { + return this.filter; + } - @Override - public boolean canTarget(UUID id, Game game) { - Permanent permanent = game.getPermanent(id); - if (permanent != null) { - return filter.match(permanent, game); - } - Player player = game.getPlayer(id); - if (player != null) - return filter.match(player, game); - return false; - } + @Override + public boolean canTarget(UUID id, Game game) { + Permanent permanent = game.getPermanent(id); + if (permanent != null) { + return filter.match(permanent, game); + } + Player player = game.getPlayer(id); + if (player != null) + return filter.match(player, game); + return false; + } - @Override - public boolean canTarget(UUID id, Ability source, Game game) { - return canTarget(null, id, source, game); - } + @Override + public boolean canTarget(UUID id, Ability source, Game game) { + return canTarget(null, id, source, game); + } - public boolean canTarget(UUID controllerId, UUID id, Ability source, Game game) { - Permanent permanent = game.getPermanent(id); - MageObject targetSource = game.getObject(source.getSourceId()); - if (permanent != null) { - if (source != null) - //TODO: check for replacement effects - return permanent.canBeTargetedBy(game.getObject(source.getSourceId()), controllerId, game) && filter.match(permanent, source.getSourceId(), controllerId, game); - else - return filter.match(permanent, source.getSourceId(), controllerId, game); - } - Player player = game.getPlayer(id); - if (player != null) - if (source != null) - return player.canBeTargetedBy(targetSource, game) && filter.match(player, game); - else - return filter.match(player, game); - return false; - } + public boolean canTarget(UUID controllerId, UUID id, Ability source, Game game) { + Permanent permanent = game.getPermanent(id); + MageObject targetSource = game.getObject(source.getSourceId()); + if (permanent != null) { + if (source != null) + //TODO: check for replacement effects + return permanent.canBeTargetedBy(game.getObject(source.getSourceId()), controllerId, game) && filter.match(permanent, source.getSourceId(), controllerId, game); + else + return filter.match(permanent, source.getSourceId(), controllerId, game); + } + Player player = game.getPlayer(id); + if (player != null) + if (source != null) + return player.canBeTargetedBy(targetSource, game) && filter.match(player, game); + else + return filter.match(player, game); + return false; + } - /** - * Checks if there are enough {@link Permanent} or {@link Player} that can be chosen. Should only be used - * for Ability targets since this checks for protection, shroud etc. - * - * @param sourceId - the target event source - * @param sourceControllerId - controller of the target event source - * @param game - * @return - true if enough valid {@link Permanent} or {@link Player} exist - */ - @Override - public boolean canChoose(UUID sourceId, UUID sourceControllerId, Game game) { - int count = 0; - MageObject targetSource = game.getObject(sourceId); - for (UUID playerId: game.getPlayer(sourceControllerId).getInRange()) { - Player player = game.getPlayer(playerId); - if (player != null && player.canBeTargetedBy(targetSource, game) && filter.match(player, game)) { - count++; - if (count >= this.minNumberOfTargets) - return true; - } - } - for (Permanent permanent: game.getBattlefield().getActivePermanents(new FilterCreaturePermanent(), sourceControllerId, game)) { - if (permanent.canBeTargetedBy(targetSource, sourceControllerId, game) && filter.match(permanent, sourceId, sourceControllerId, game)) { - count++; - if (count >= this.minNumberOfTargets) - return true; - } - } - return false; - } + /** + * Checks if there are enough {@link Permanent} or {@link Player} that can be chosen. Should only be used + * for Ability targets since this checks for protection, shroud etc. + * + * @param sourceId - the target event source + * @param sourceControllerId - controller of the target event source + * @param game + * @return - true if enough valid {@link Permanent} or {@link Player} exist + */ + @Override + public boolean canChoose(UUID sourceId, UUID sourceControllerId, Game game) { + int count = 0; + MageObject targetSource = game.getObject(sourceId); + for (UUID playerId: game.getPlayer(sourceControllerId).getInRange()) { + Player player = game.getPlayer(playerId); + if (player != null && player.canBeTargetedBy(targetSource, game) && filter.match(player, game)) { + count++; + if (count >= this.minNumberOfTargets) + return true; + } + } + for (Permanent permanent: game.getBattlefield().getActivePermanents(new FilterCreaturePermanent(), sourceControllerId, game)) { + if (permanent.canBeTargetedBy(targetSource, sourceControllerId, game) && filter.match(permanent, sourceId, sourceControllerId, game)) { + count++; + if (count >= this.minNumberOfTargets) + return true; + } + } + return false; + } - /** - * Checks if there are enough {@link Permanent} or {@link Player} that can be selected. Should not be used - * for Ability targets since this does not check for protection, shroud etc. - * - * @param sourceControllerId - controller of the select event - * @param game - * @return - true if enough valid {@link Permanent} or {@link Player} exist - */ - @Override - public boolean canChoose(UUID sourceControllerId, Game game) { - int count = 0; - for (UUID playerId: game.getPlayer(sourceControllerId).getInRange()) { - Player player = game.getPlayer(playerId); - if (player != null && filter.match(player, game)) { - count++; - if (count >= this.minNumberOfTargets) - return true; - } - } - for (Permanent permanent: game.getBattlefield().getActivePermanents(new FilterCreaturePermanent(), sourceControllerId, game)) { - if (filter.match(permanent, null, sourceControllerId, game)) { - count++; - if (count >= this.minNumberOfTargets) - return true; - } - } - return false; - } + /** + * Checks if there are enough {@link Permanent} or {@link Player} that can be selected. Should not be used + * for Ability targets since this does not check for protection, shroud etc. + * + * @param sourceControllerId - controller of the select event + * @param game + * @return - true if enough valid {@link Permanent} or {@link Player} exist + */ + @Override + public boolean canChoose(UUID sourceControllerId, Game game) { + int count = 0; + for (UUID playerId: game.getPlayer(sourceControllerId).getInRange()) { + Player player = game.getPlayer(playerId); + if (player != null && filter.match(player, game)) { + count++; + if (count >= this.minNumberOfTargets) + return true; + } + } + for (Permanent permanent: game.getBattlefield().getActivePermanents(new FilterCreaturePermanent(), sourceControllerId, game)) { + if (filter.match(permanent, null, sourceControllerId, game)) { + count++; + if (count >= this.minNumberOfTargets) + return true; + } + } + return false; + } - @Override - public Set possibleTargets(UUID sourceId, UUID sourceControllerId, Game game) { - Set possibleTargets = new HashSet(); - MageObject targetSource = game.getObject(sourceId); - for (UUID playerId: game.getPlayer(sourceControllerId).getInRange()) { - Player player = game.getPlayer(playerId); - if (player != null && player.canBeTargetedBy(targetSource, game) && filter.match(player, game)) { - possibleTargets.add(playerId); - } - } - for (Permanent permanent: game.getBattlefield().getActivePermanents(new FilterCreaturePermanent(), sourceControllerId, game)) { - if (permanent.canBeTargetedBy(targetSource, sourceControllerId, game) && filter.match(permanent, sourceId, sourceControllerId, game)) { - possibleTargets.add(permanent.getId()); - } - } - return possibleTargets; - } + @Override + public Set possibleTargets(UUID sourceId, UUID sourceControllerId, Game game) { + Set possibleTargets = new HashSet(); + MageObject targetSource = game.getObject(sourceId); + for (UUID playerId: game.getPlayer(sourceControllerId).getInRange()) { + Player player = game.getPlayer(playerId); + if (player != null && player.canBeTargetedBy(targetSource, game) && filter.match(player, game)) { + possibleTargets.add(playerId); + } + } + for (Permanent permanent: game.getBattlefield().getActivePermanents(new FilterCreaturePermanent(), sourceControllerId, game)) { + if (permanent.canBeTargetedBy(targetSource, sourceControllerId, game) && filter.match(permanent, sourceId, sourceControllerId, game)) { + possibleTargets.add(permanent.getId()); + } + } + return possibleTargets; + } - @Override - public Set possibleTargets(UUID sourceControllerId, Game game) { - Set possibleTargets = new HashSet(); - for (UUID playerId: game.getPlayer(sourceControllerId).getInRange()) { - Player player = game.getPlayer(playerId); - if (player != null && filter.match(player, game)) { - possibleTargets.add(playerId); - } - } - for (Permanent permanent: game.getBattlefield().getActivePermanents(new FilterCreaturePermanent(), sourceControllerId, game)) { - if (filter.match(permanent, null, sourceControllerId, game)) { - possibleTargets.add(permanent.getId()); - } - } - return possibleTargets; - } + @Override + public Set possibleTargets(UUID sourceControllerId, Game game) { + Set possibleTargets = new HashSet(); + for (UUID playerId: game.getPlayer(sourceControllerId).getInRange()) { + Player player = game.getPlayer(playerId); + if (player != null && filter.match(player, game)) { + possibleTargets.add(playerId); + } + } + for (Permanent permanent: game.getBattlefield().getActivePermanents(new FilterCreaturePermanent(), sourceControllerId, game)) { + if (filter.match(permanent, null, sourceControllerId, game)) { + possibleTargets.add(permanent.getId()); + } + } + return possibleTargets; + } - @Override - public String getTargetedName(Game game) { - StringBuilder sb = new StringBuilder(); - for (UUID targetId: getTargets()) { - Permanent permanent = game.getPermanent(targetId); - if (permanent != null) { - sb.append(permanent.getName()).append(" "); - } - else { - Player player = game.getPlayer(targetId); + @Override + public String getTargetedName(Game game) { + StringBuilder sb = new StringBuilder(); + for (UUID targetId: getTargets()) { + Permanent permanent = game.getPermanent(targetId); + if (permanent != null) { + sb.append(permanent.getName()).append(" "); + } + else { + Player player = game.getPlayer(targetId); if (player != null) { - sb.append(player.getName()).append(" "); + sb.append(player.getName()).append(" "); } - } - } - return sb.toString(); - } + } + } + return sb.toString(); + } - @Override - public TargetCreatureOrPlayer copy() { - return new TargetCreatureOrPlayer(this); - } + @Override + public TargetCreatureOrPlayer copy() { + return new TargetCreatureOrPlayer(this); + } } diff --git a/Mage/src/mage/target/common/TargetCreatureOrPlayerAmount.java b/Mage/src/mage/target/common/TargetCreatureOrPlayerAmount.java index 3f4afe33cd..bce52eee5c 100644 --- a/Mage/src/mage/target/common/TargetCreatureOrPlayerAmount.java +++ b/Mage/src/mage/target/common/TargetCreatureOrPlayerAmount.java @@ -49,153 +49,153 @@ import java.util.UUID; */ public class TargetCreatureOrPlayerAmount extends TargetAmount { - protected FilterCreatureOrPlayer filter; + protected FilterCreatureOrPlayer filter; - public TargetCreatureOrPlayerAmount(int amount) { - super(amount); - this.zone = Zone.ALL; - this.filter = new FilterCreatureOrPlayer(); - this.targetName = filter.getMessage(); - } + public TargetCreatureOrPlayerAmount(int amount) { + super(amount); + this.zone = Zone.ALL; + this.filter = new FilterCreatureOrPlayer(); + this.targetName = filter.getMessage(); + } - public TargetCreatureOrPlayerAmount(final TargetCreatureOrPlayerAmount target) { - super(target); - this.filter = target.filter.copy(); - } + public TargetCreatureOrPlayerAmount(final TargetCreatureOrPlayerAmount target) { + super(target); + this.filter = target.filter.copy(); + } - @Override - public Filter getFilter() { - return this.filter; - } + @Override + public Filter getFilter() { + return this.filter; + } - @Override - public boolean canTarget(UUID id, Game game) { - Permanent permanent = game.getPermanent(id); - if (permanent != null) { - return filter.match(permanent, game); - } - Player player = game.getPlayer(id); - if (player != null) - return filter.match(player, game); - return false; - } + @Override + public boolean canTarget(UUID id, Game game) { + Permanent permanent = game.getPermanent(id); + if (permanent != null) { + return filter.match(permanent, game); + } + Player player = game.getPlayer(id); + if (player != null) + return filter.match(player, game); + return false; + } - @Override - public boolean canTarget(UUID id, Ability source, Game game) { - Permanent permanent = game.getPermanent(id); - MageObject targetSource = game.getObject(source.getSourceId()); - if (permanent != null) { - if (source != null) - return permanent.canBeTargetedBy(targetSource, source.getControllerId(), game) && filter.match(permanent, source.getSourceId(), source.getControllerId(), game); - else - return filter.match(permanent, game); - } - Player player = game.getPlayer(id); - if (player != null) - if (source != null) - return player.canBeTargetedBy(targetSource, game) && filter.match(player, game); - else - return filter.match(player, game); - return false; - } + @Override + public boolean canTarget(UUID id, Ability source, Game game) { + Permanent permanent = game.getPermanent(id); + MageObject targetSource = game.getObject(source.getSourceId()); + if (permanent != null) { + if (source != null) + return permanent.canBeTargetedBy(targetSource, source.getControllerId(), game) && filter.match(permanent, source.getSourceId(), source.getControllerId(), game); + else + return filter.match(permanent, game); + } + Player player = game.getPlayer(id); + if (player != null) + if (source != null) + return player.canBeTargetedBy(targetSource, game) && filter.match(player, game); + else + return filter.match(player, game); + return false; + } - @Override - public boolean canChoose(UUID sourceId, UUID sourceControllerId, Game game) { - int count = 0; - MageObject targetSource = game.getObject(sourceId); - for (UUID playerId: game.getPlayer(sourceControllerId).getInRange()) { - Player player = game.getPlayer(playerId); - if (player != null && player.canBeTargetedBy(targetSource, game) && filter.match(player, game)) { - count++; - if (count >= this.minNumberOfTargets) - return true; - } - } - for (Permanent permanent: game.getBattlefield().getActivePermanents(new FilterCreaturePermanent(), sourceControllerId, game)) { - if (permanent.canBeTargetedBy(targetSource, sourceControllerId, game) && filter.match(permanent, sourceId, sourceControllerId, game)) { - count++; - if (count >= this.minNumberOfTargets) - return true; - } - } - return false; - } + @Override + public boolean canChoose(UUID sourceId, UUID sourceControllerId, Game game) { + int count = 0; + MageObject targetSource = game.getObject(sourceId); + for (UUID playerId: game.getPlayer(sourceControllerId).getInRange()) { + Player player = game.getPlayer(playerId); + if (player != null && player.canBeTargetedBy(targetSource, game) && filter.match(player, game)) { + count++; + if (count >= this.minNumberOfTargets) + return true; + } + } + for (Permanent permanent: game.getBattlefield().getActivePermanents(new FilterCreaturePermanent(), sourceControllerId, game)) { + if (permanent.canBeTargetedBy(targetSource, sourceControllerId, game) && filter.match(permanent, sourceId, sourceControllerId, game)) { + count++; + if (count >= this.minNumberOfTargets) + return true; + } + } + return false; + } - @Override - public boolean canChoose(UUID sourceControllerId, Game game) { - int count = 0; - for (UUID playerId: game.getPlayer(sourceControllerId).getInRange()) { - Player player = game.getPlayer(playerId); - if (player != null && filter.match(player, game)) { - count++; - if (count >= this.minNumberOfTargets) - return true; - } - } - for (Permanent permanent: game.getBattlefield().getActivePermanents(new FilterCreaturePermanent(), sourceControllerId, game)) { - if (filter.match(permanent, null, sourceControllerId, game)) { - count++; - if (count >= this.minNumberOfTargets) - return true; - } - } - return false; - } + @Override + public boolean canChoose(UUID sourceControllerId, Game game) { + int count = 0; + for (UUID playerId: game.getPlayer(sourceControllerId).getInRange()) { + Player player = game.getPlayer(playerId); + if (player != null && filter.match(player, game)) { + count++; + if (count >= this.minNumberOfTargets) + return true; + } + } + for (Permanent permanent: game.getBattlefield().getActivePermanents(new FilterCreaturePermanent(), sourceControllerId, game)) { + if (filter.match(permanent, null, sourceControllerId, game)) { + count++; + if (count >= this.minNumberOfTargets) + return true; + } + } + return false; + } - @Override - public Set possibleTargets(UUID sourceId, UUID sourceControllerId, Game game) { - Set possibleTargets = new HashSet(); - MageObject targetSource = game.getObject(sourceId); - for (UUID playerId: game.getPlayer(sourceControllerId).getInRange()) { - Player player = game.getPlayer(playerId); - if (player != null && player.canBeTargetedBy(targetSource, game) && filter.match(player, game)) { - possibleTargets.add(playerId); - } - } - for (Permanent permanent: game.getBattlefield().getActivePermanents(new FilterCreaturePermanent(), sourceControllerId, game)) { - if (permanent.canBeTargetedBy(targetSource, sourceControllerId, game) && filter.match(permanent, sourceId, sourceControllerId, game)) { - possibleTargets.add(permanent.getId()); - } - } - return possibleTargets; - } + @Override + public Set possibleTargets(UUID sourceId, UUID sourceControllerId, Game game) { + Set possibleTargets = new HashSet(); + MageObject targetSource = game.getObject(sourceId); + for (UUID playerId: game.getPlayer(sourceControllerId).getInRange()) { + Player player = game.getPlayer(playerId); + if (player != null && player.canBeTargetedBy(targetSource, game) && filter.match(player, game)) { + possibleTargets.add(playerId); + } + } + for (Permanent permanent: game.getBattlefield().getActivePermanents(new FilterCreaturePermanent(), sourceControllerId, game)) { + if (permanent.canBeTargetedBy(targetSource, sourceControllerId, game) && filter.match(permanent, sourceId, sourceControllerId, game)) { + possibleTargets.add(permanent.getId()); + } + } + return possibleTargets; + } - @Override - public Set possibleTargets(UUID sourceControllerId, Game game) { - Set possibleTargets = new HashSet(); - for (UUID playerId: game.getPlayer(sourceControllerId).getInRange()) { - Player player = game.getPlayer(playerId); - if (player != null && filter.match(player, game)) { - possibleTargets.add(playerId); - } - } - for (Permanent permanent: game.getBattlefield().getActivePermanents(new FilterCreaturePermanent(), sourceControllerId, game)) { - if (filter.match(permanent, null, sourceControllerId, game)) { - possibleTargets.add(permanent.getId()); - } - } - return possibleTargets; - } + @Override + public Set possibleTargets(UUID sourceControllerId, Game game) { + Set possibleTargets = new HashSet(); + for (UUID playerId: game.getPlayer(sourceControllerId).getInRange()) { + Player player = game.getPlayer(playerId); + if (player != null && filter.match(player, game)) { + possibleTargets.add(playerId); + } + } + for (Permanent permanent: game.getBattlefield().getActivePermanents(new FilterCreaturePermanent(), sourceControllerId, game)) { + if (filter.match(permanent, null, sourceControllerId, game)) { + possibleTargets.add(permanent.getId()); + } + } + return possibleTargets; + } - @Override - public String getTargetedName(Game game) { - StringBuilder sb = new StringBuilder(); - for (UUID targetId: getTargets()) { - Permanent permanent = game.getPermanent(targetId); - if (permanent != null) { - sb.append(permanent.getName()).append(" "); - } - else { - Player player = game.getPlayer(targetId); - sb.append(player.getName()).append(" "); - } - } - return sb.toString(); - } + @Override + public String getTargetedName(Game game) { + StringBuilder sb = new StringBuilder(); + for (UUID targetId: getTargets()) { + Permanent permanent = game.getPermanent(targetId); + if (permanent != null) { + sb.append(permanent.getName()).append(" "); + } + else { + Player player = game.getPlayer(targetId); + sb.append(player.getName()).append(" "); + } + } + return sb.toString(); + } - @Override - public TargetCreatureOrPlayerAmount copy() { - return new TargetCreatureOrPlayerAmount(this); - } + @Override + public TargetCreatureOrPlayerAmount copy() { + return new TargetCreatureOrPlayerAmount(this); + } } diff --git a/Mage/src/mage/target/common/TargetCreaturePermanent.java b/Mage/src/mage/target/common/TargetCreaturePermanent.java index da816f4fc0..41957cc69d 100644 --- a/Mage/src/mage/target/common/TargetCreaturePermanent.java +++ b/Mage/src/mage/target/common/TargetCreaturePermanent.java @@ -37,44 +37,44 @@ import mage.target.TargetPermanent; */ public class TargetCreaturePermanent> extends TargetPermanent> { - public TargetCreaturePermanent() { - this(1, 1, new FilterCreaturePermanent(), false); - } + public TargetCreaturePermanent() { + this(1, 1, new FilterCreaturePermanent(), false); + } public TargetCreaturePermanent(boolean required) { this(); setRequired(required); } - public TargetCreaturePermanent(FilterCreaturePermanent filter) { - this(1, 1, filter, false); - } + public TargetCreaturePermanent(FilterCreaturePermanent filter) { + this(1, 1, filter, false); + } - public TargetCreaturePermanent(int numTargets) { - this(numTargets, numTargets, new FilterCreaturePermanent(), false); - } + public TargetCreaturePermanent(int numTargets) { + this(numTargets, numTargets, new FilterCreaturePermanent(), false); + } public TargetCreaturePermanent(int numTargets, boolean required) { - this(numTargets); + this(numTargets); setRequired(required); - } + } - public TargetCreaturePermanent(int minNumTargets, int maxNumTargets) { - this(minNumTargets, maxNumTargets, new FilterCreaturePermanent(), false); - } + public TargetCreaturePermanent(int minNumTargets, int maxNumTargets) { + this(minNumTargets, maxNumTargets, new FilterCreaturePermanent(), false); + } - public TargetCreaturePermanent(int minNumTargets, int maxNumTargets, FilterCreaturePermanent filter, boolean notTarget) { - super(minNumTargets, maxNumTargets, filter, notTarget); - this.targetName = filter.getMessage(); - } + public TargetCreaturePermanent(int minNumTargets, int maxNumTargets, FilterCreaturePermanent filter, boolean notTarget) { + super(minNumTargets, maxNumTargets, filter, notTarget); + this.targetName = filter.getMessage(); + } - public TargetCreaturePermanent(final TargetCreaturePermanent target) { - super(target); - } + public TargetCreaturePermanent(final TargetCreaturePermanent target) { + super(target); + } - @Override - public TargetCreaturePermanent copy() { - return new TargetCreaturePermanent(this); - } + @Override + public TargetCreaturePermanent copy() { + return new TargetCreaturePermanent(this); + } } diff --git a/Mage/src/mage/target/common/TargetDefender.java b/Mage/src/mage/target/common/TargetDefender.java index aa6d4fee75..425aca9c7d 100644 --- a/Mage/src/mage/target/common/TargetDefender.java +++ b/Mage/src/mage/target/common/TargetDefender.java @@ -49,167 +49,167 @@ import java.util.UUID; */ public class TargetDefender extends TargetImpl { - protected FilterPlaneswalkerOrPlayer filter; - protected UUID attackerId; + protected FilterPlaneswalkerOrPlayer filter; + protected UUID attackerId; - public TargetDefender(Set defenders, UUID attackerId) { - this(1, 1, defenders, attackerId); - } + public TargetDefender(Set defenders, UUID attackerId) { + this(1, 1, defenders, attackerId); + } - public TargetDefender(int numTargets, Set defenders, UUID attackerId) { - this(numTargets, numTargets, defenders, attackerId); - } + public TargetDefender(int numTargets, Set defenders, UUID attackerId) { + this(numTargets, numTargets, defenders, attackerId); + } - public TargetDefender(int minNumTargets, int maxNumTargets, Set defenders, UUID attackerId) { - this.minNumberOfTargets = minNumTargets; - this.maxNumberOfTargets = maxNumTargets; - this.zone = Zone.ALL; - this.filter = new FilterPlaneswalkerOrPlayer(defenders); - this.targetName = filter.getMessage(); - this.attackerId = attackerId; - } + public TargetDefender(int minNumTargets, int maxNumTargets, Set defenders, UUID attackerId) { + this.minNumberOfTargets = minNumTargets; + this.maxNumberOfTargets = maxNumTargets; + this.zone = Zone.ALL; + this.filter = new FilterPlaneswalkerOrPlayer(defenders); + this.targetName = filter.getMessage(); + this.attackerId = attackerId; + } - public TargetDefender(final TargetDefender target) { - super(target); - this.filter = target.filter.copy(); - this.attackerId = target.attackerId; - } + public TargetDefender(final TargetDefender target) { + super(target); + this.filter = target.filter.copy(); + this.attackerId = target.attackerId; + } - @Override - public Filter getFilter() { - return this.filter; - } + @Override + public Filter getFilter() { + return this.filter; + } - @Override - public boolean canChoose(UUID sourceId, UUID sourceControllerId, Game game) { - int count = 0; - MageObject targetSource = game.getObject(sourceId); - for (UUID playerId: game.getPlayer(sourceControllerId).getInRange()) { - Player player = game.getPlayer(playerId); - if (player != null && player.canBeTargetedBy(targetSource, game) && filter.match(player, game)) { - count++; - if (count >= this.minNumberOfTargets) - return true; - } - } - for (Permanent permanent: game.getBattlefield().getActivePermanents(new FilterPlaneswalkerPermanent(), sourceControllerId, game)) { - if (permanent.canBeTargetedBy(targetSource, sourceControllerId, game) && filter.match(permanent, game)) { - count++; - if (count >= this.minNumberOfTargets) - return true; - } - } - return false; - } + @Override + public boolean canChoose(UUID sourceId, UUID sourceControllerId, Game game) { + int count = 0; + MageObject targetSource = game.getObject(sourceId); + for (UUID playerId: game.getPlayer(sourceControllerId).getInRange()) { + Player player = game.getPlayer(playerId); + if (player != null && player.canBeTargetedBy(targetSource, game) && filter.match(player, game)) { + count++; + if (count >= this.minNumberOfTargets) + return true; + } + } + for (Permanent permanent: game.getBattlefield().getActivePermanents(new FilterPlaneswalkerPermanent(), sourceControllerId, game)) { + if (permanent.canBeTargetedBy(targetSource, sourceControllerId, game) && filter.match(permanent, game)) { + count++; + if (count >= this.minNumberOfTargets) + return true; + } + } + return false; + } - @Override - public boolean canChoose(UUID sourceControllerId, Game game) { - int count = 0; - for (UUID playerId: game.getPlayer(sourceControllerId).getInRange()) { - Player player = game.getPlayer(playerId); - if (player != null && filter.match(player, game)) { - count++; - if (count >= this.minNumberOfTargets) - return true; - } - } - for (Permanent permanent: game.getBattlefield().getActivePermanents(new FilterPlaneswalkerPermanent(), sourceControllerId, game)) { - if (filter.match(permanent, game)) { - count++; - if (count >= this.minNumberOfTargets) - return true; - } - } - return false; - } + @Override + public boolean canChoose(UUID sourceControllerId, Game game) { + int count = 0; + for (UUID playerId: game.getPlayer(sourceControllerId).getInRange()) { + Player player = game.getPlayer(playerId); + if (player != null && filter.match(player, game)) { + count++; + if (count >= this.minNumberOfTargets) + return true; + } + } + for (Permanent permanent: game.getBattlefield().getActivePermanents(new FilterPlaneswalkerPermanent(), sourceControllerId, game)) { + if (filter.match(permanent, game)) { + count++; + if (count >= this.minNumberOfTargets) + return true; + } + } + return false; + } - @Override - public Set possibleTargets(UUID sourceId, UUID sourceControllerId, Game game) { - Set possibleTargets = new HashSet(); - MageObject targetSource = game.getObject(sourceId); - for (UUID playerId: game.getPlayer(sourceControllerId).getInRange()) { - Player player = game.getPlayer(playerId); - if (player != null && player.canBeTargetedBy(targetSource, game) && filter.match(player, game)) { - possibleTargets.add(playerId); - } - } - for (Permanent permanent: game.getBattlefield().getActivePermanents(new FilterPlaneswalkerPermanent(), sourceControllerId, game)) { - if (permanent.canBeTargetedBy(targetSource, sourceControllerId, game) && filter.match(permanent, game)) { - possibleTargets.add(permanent.getId()); - } - } - return possibleTargets; - } + @Override + public Set possibleTargets(UUID sourceId, UUID sourceControllerId, Game game) { + Set possibleTargets = new HashSet(); + MageObject targetSource = game.getObject(sourceId); + for (UUID playerId: game.getPlayer(sourceControllerId).getInRange()) { + Player player = game.getPlayer(playerId); + if (player != null && player.canBeTargetedBy(targetSource, game) && filter.match(player, game)) { + possibleTargets.add(playerId); + } + } + for (Permanent permanent: game.getBattlefield().getActivePermanents(new FilterPlaneswalkerPermanent(), sourceControllerId, game)) { + if (permanent.canBeTargetedBy(targetSource, sourceControllerId, game) && filter.match(permanent, game)) { + possibleTargets.add(permanent.getId()); + } + } + return possibleTargets; + } - @Override - public Set possibleTargets(UUID sourceControllerId, Game game) { - Set possibleTargets = new HashSet(); - for (UUID playerId: game.getPlayer(sourceControllerId).getInRange()) { - Player player = game.getPlayer(playerId); - if (player != null && filter.match(player, game)) { - possibleTargets.add(playerId); - } - } - for (Permanent permanent: game.getBattlefield().getActivePermanents(new FilterPlaneswalkerPermanent(), sourceControllerId, game)) { - if (filter.match(permanent, game)) { - possibleTargets.add(permanent.getId()); - } - } - return possibleTargets; - } + @Override + public Set possibleTargets(UUID sourceControllerId, Game game) { + Set possibleTargets = new HashSet(); + for (UUID playerId: game.getPlayer(sourceControllerId).getInRange()) { + Player player = game.getPlayer(playerId); + if (player != null && filter.match(player, game)) { + possibleTargets.add(playerId); + } + } + for (Permanent permanent: game.getBattlefield().getActivePermanents(new FilterPlaneswalkerPermanent(), sourceControllerId, game)) { + if (filter.match(permanent, game)) { + possibleTargets.add(permanent.getId()); + } + } + return possibleTargets; + } - @Override - public String getTargetedName(Game game) { - StringBuilder sb = new StringBuilder(); - for (UUID targetId: getTargets()) { - Permanent permanent = game.getPermanent(targetId); - if (permanent != null) { - sb.append(permanent.getName()).append(" "); - } - else { - Player player = game.getPlayer(targetId); - sb.append(player.getName()).append(" "); - } - } - return sb.toString(); - } + @Override + public String getTargetedName(Game game) { + StringBuilder sb = new StringBuilder(); + for (UUID targetId: getTargets()) { + Permanent permanent = game.getPermanent(targetId); + if (permanent != null) { + sb.append(permanent.getName()).append(" "); + } + else { + Player player = game.getPlayer(targetId); + sb.append(player.getName()).append(" "); + } + } + return sb.toString(); + } - @Override - public boolean canTarget(UUID id, Game game) { - Player player = game.getPlayer(id); - if (player != null) { - return filter.match(player, game); - } - Permanent permanent = game.getPermanent(id); - if (permanent != null) { - return filter.match(permanent, game); - } - return false; - } + @Override + public boolean canTarget(UUID id, Game game) { + Player player = game.getPlayer(id); + if (player != null) { + return filter.match(player, game); + } + Permanent permanent = game.getPermanent(id); + if (permanent != null) { + return filter.match(permanent, game); + } + return false; + } - @Override - public boolean canTarget(UUID id, Ability source, Game game) { - Player player = game.getPlayer(id); - MageObject targetSource = game.getObject(attackerId); - if (player != null) { - return player.canBeTargetedBy(targetSource, game) && filter.match(player, game); - } - Permanent permanent = game.getPermanent(id); - if (permanent != null) { - //Could be targeting due to combat decision to attack a player or planeswalker. - UUID controllerId = null; - if ( source != null ) { - controllerId = source.getControllerId(); - } - return permanent.canBeTargetedBy(targetSource, controllerId, game) && filter.match(permanent, game); - } - return false; - } + @Override + public boolean canTarget(UUID id, Ability source, Game game) { + Player player = game.getPlayer(id); + MageObject targetSource = game.getObject(attackerId); + if (player != null) { + return player.canBeTargetedBy(targetSource, game) && filter.match(player, game); + } + Permanent permanent = game.getPermanent(id); + if (permanent != null) { + //Could be targeting due to combat decision to attack a player or planeswalker. + UUID controllerId = null; + if ( source != null ) { + controllerId = source.getControllerId(); + } + return permanent.canBeTargetedBy(targetSource, controllerId, game) && filter.match(permanent, game); + } + return false; + } - @Override - public TargetDefender copy() { - return new TargetDefender(this); - } + @Override + public TargetDefender copy() { + return new TargetDefender(this); + } } diff --git a/Mage/src/mage/target/common/TargetDiscard.java b/Mage/src/mage/target/common/TargetDiscard.java index bf69290303..fa08d1ace1 100644 --- a/Mage/src/mage/target/common/TargetDiscard.java +++ b/Mage/src/mage/target/common/TargetDiscard.java @@ -43,44 +43,44 @@ import java.util.UUID; */ public class TargetDiscard extends TargetCard { - private UUID playerId; + private UUID playerId; - public TargetDiscard(UUID playerId) { - this(1, 1, new FilterCard(), playerId); - } + public TargetDiscard(UUID playerId) { + this(1, 1, new FilterCard(), playerId); + } - public TargetDiscard(FilterCard filter, UUID playerId) { - this(1, 1, filter, playerId); - } + public TargetDiscard(FilterCard filter, UUID playerId) { + this(1, 1, filter, playerId); + } - public TargetDiscard(int numTargets, FilterCard filter, UUID playerId) { - this(numTargets, numTargets, filter, playerId); - } + public TargetDiscard(int numTargets, FilterCard filter, UUID playerId) { + this(numTargets, numTargets, filter, playerId); + } - public TargetDiscard(int minNumTargets, int maxNumTargets, FilterCard filter, UUID playerId) { - super(minNumTargets, maxNumTargets, Zone.HAND, filter); - this.filter.getOwnerId().add(playerId); - this.playerId = playerId; - this.required = true; - this.targetName = "card to discard"; - } + public TargetDiscard(int minNumTargets, int maxNumTargets, FilterCard filter, UUID playerId) { + super(minNumTargets, maxNumTargets, Zone.HAND, filter); + this.filter.getOwnerId().add(playerId); + this.playerId = playerId; + this.required = true; + this.targetName = "card to discard"; + } - public TargetDiscard(final TargetDiscard target) { - super(target); - this.playerId = target.playerId; - } + public TargetDiscard(final TargetDiscard target) { + super(target); + this.playerId = target.playerId; + } - @Override - public boolean canTarget(UUID id, Ability source, Game game) { - Card card = game.getPlayer(playerId).getHand().get(id, game); - if (card != null) - return filter.match(card, game); - return false; - } + @Override + public boolean canTarget(UUID id, Ability source, Game game) { + Card card = game.getPlayer(playerId).getHand().get(id, game); + if (card != null) + return filter.match(card, game); + return false; + } - @Override - public TargetDiscard copy() { - return new TargetDiscard(this); - } + @Override + public TargetDiscard copy() { + return new TargetDiscard(this); + } } diff --git a/Mage/src/mage/target/common/TargetLandPermanent.java b/Mage/src/mage/target/common/TargetLandPermanent.java index 63f2f04996..fc1937917c 100644 --- a/Mage/src/mage/target/common/TargetLandPermanent.java +++ b/Mage/src/mage/target/common/TargetLandPermanent.java @@ -37,29 +37,29 @@ import mage.target.TargetPermanent; */ public class TargetLandPermanent> extends TargetPermanent> { - public TargetLandPermanent() { - this(1, 1, new FilterLandPermanent(), false); - } + public TargetLandPermanent() { + this(1, 1, new FilterLandPermanent(), false); + } - public TargetLandPermanent(FilterLandPermanent filter) { - this(1, 1, filter, false); - } + public TargetLandPermanent(FilterLandPermanent filter) { + this(1, 1, filter, false); + } - public TargetLandPermanent(int numTargets) { - this(numTargets, numTargets, new FilterLandPermanent(), false); - } + public TargetLandPermanent(int numTargets) { + this(numTargets, numTargets, new FilterLandPermanent(), false); + } - public TargetLandPermanent(int minNumTargets, int maxNumTargets, FilterLandPermanent filter, boolean notTarget) { - super(minNumTargets, maxNumTargets, filter, notTarget); - this.targetName = filter.getMessage(); - } + public TargetLandPermanent(int minNumTargets, int maxNumTargets, FilterLandPermanent filter, boolean notTarget) { + super(minNumTargets, maxNumTargets, filter, notTarget); + this.targetName = filter.getMessage(); + } - public TargetLandPermanent(final TargetLandPermanent target) { - super(target); - } + public TargetLandPermanent(final TargetLandPermanent target) { + super(target); + } - @Override - public TargetLandPermanent copy() { - return new TargetLandPermanent(this); - } + @Override + public TargetLandPermanent copy() { + return new TargetLandPermanent(this); + } } diff --git a/Mage/src/mage/target/common/TargetNonBasicLandPermanent.java b/Mage/src/mage/target/common/TargetNonBasicLandPermanent.java index 32b14b31a2..582f40204c 100644 --- a/Mage/src/mage/target/common/TargetNonBasicLandPermanent.java +++ b/Mage/src/mage/target/common/TargetNonBasicLandPermanent.java @@ -34,22 +34,22 @@ package mage.target.common; */ public class TargetNonBasicLandPermanent extends TargetLandPermanent { - public TargetNonBasicLandPermanent() { - filter.setNotName(true); - filter.getName().add("Island"); - filter.getName().add("Forest"); - filter.getName().add("Mountain"); - filter.getName().add("Swamp"); - filter.getName().add("Plains"); - this.targetName = "nonbasic land"; - } + public TargetNonBasicLandPermanent() { + filter.setNotName(true); + filter.getName().add("Island"); + filter.getName().add("Forest"); + filter.getName().add("Mountain"); + filter.getName().add("Swamp"); + filter.getName().add("Plains"); + this.targetName = "nonbasic land"; + } - public TargetNonBasicLandPermanent(final TargetNonBasicLandPermanent target) { - super(target); - } + public TargetNonBasicLandPermanent(final TargetNonBasicLandPermanent target) { + super(target); + } - @Override - public TargetNonBasicLandPermanent copy() { - return new TargetNonBasicLandPermanent(this); - } + @Override + public TargetNonBasicLandPermanent copy() { + return new TargetNonBasicLandPermanent(this); + } } diff --git a/Mage/src/mage/target/common/TargetNonlandPermanent.java b/Mage/src/mage/target/common/TargetNonlandPermanent.java index 317fb8f468..6386726ae4 100644 --- a/Mage/src/mage/target/common/TargetNonlandPermanent.java +++ b/Mage/src/mage/target/common/TargetNonlandPermanent.java @@ -37,25 +37,25 @@ import mage.target.TargetPermanent; */ public class TargetNonlandPermanent extends TargetPermanent { - public TargetNonlandPermanent() { - this(1, 1, false); - } + public TargetNonlandPermanent() { + this(1, 1, false); + } - public TargetNonlandPermanent(int numTargets) { - this(numTargets, numTargets, false); - } + public TargetNonlandPermanent(int numTargets) { + this(numTargets, numTargets, false); + } - public TargetNonlandPermanent(int minNumTargets, int maxNumTargets, boolean notTarget) { - super(minNumTargets, maxNumTargets, new FilterNonlandPermanent(), notTarget); - this.targetName = filter.getMessage(); - } + public TargetNonlandPermanent(int minNumTargets, int maxNumTargets, boolean notTarget) { + super(minNumTargets, maxNumTargets, new FilterNonlandPermanent(), notTarget); + this.targetName = filter.getMessage(); + } - public TargetNonlandPermanent(final TargetNonlandPermanent target) { - super(target); - } + public TargetNonlandPermanent(final TargetNonlandPermanent target) { + super(target); + } - @Override - public TargetNonlandPermanent copy() { - return new TargetNonlandPermanent(this); - } + @Override + public TargetNonlandPermanent copy() { + return new TargetNonlandPermanent(this); + } } diff --git a/Mage/src/mage/target/common/TargetOpponent.java b/Mage/src/mage/target/common/TargetOpponent.java index 010f0d5bb5..fecf38eb98 100644 --- a/Mage/src/mage/target/common/TargetOpponent.java +++ b/Mage/src/mage/target/common/TargetOpponent.java @@ -40,9 +40,9 @@ import java.util.UUID; */ public class TargetOpponent extends TargetPlayer { - public TargetOpponent() { - this(false); - } + public TargetOpponent() { + this(false); + } public TargetOpponent(boolean required) { super(); @@ -50,27 +50,27 @@ public class TargetOpponent extends TargetPlayer { setRequired(required); } - public TargetOpponent(final TargetOpponent target) { - super(target); - } - - @Override - public boolean canChoose(UUID sourceId, UUID sourceControllerId, Game game) { - filter.getPlayerId().clear(); - filter.getPlayerId().addAll(game.getOpponents(sourceControllerId)); - return super.canChoose(sourceId, sourceControllerId, game); - } - - @Override - public boolean canTarget(UUID id, Ability source, Game game) { - filter.getPlayerId().clear(); - filter.getPlayerId().addAll(game.getOpponents(source.getControllerId())); - return super.canTarget(id, source, game); - } + public TargetOpponent(final TargetOpponent target) { + super(target); + } - @Override - public TargetOpponent copy() { - return new TargetOpponent(this); - } + @Override + public boolean canChoose(UUID sourceId, UUID sourceControllerId, Game game) { + filter.getPlayerId().clear(); + filter.getPlayerId().addAll(game.getOpponents(sourceControllerId)); + return super.canChoose(sourceId, sourceControllerId, game); + } + + @Override + public boolean canTarget(UUID id, Ability source, Game game) { + filter.getPlayerId().clear(); + filter.getPlayerId().addAll(game.getOpponents(source.getControllerId())); + return super.canTarget(id, source, game); + } + + @Override + public TargetOpponent copy() { + return new TargetOpponent(this); + } } diff --git a/Mage/src/mage/target/common/TargetPermanentOrPlayer.java b/Mage/src/mage/target/common/TargetPermanentOrPlayer.java index 219799d35a..9d0977f5f5 100644 --- a/Mage/src/mage/target/common/TargetPermanentOrPlayer.java +++ b/Mage/src/mage/target/common/TargetPermanentOrPlayer.java @@ -50,190 +50,190 @@ import java.util.UUID; */ public class TargetPermanentOrPlayer extends TargetImpl { - protected FilterPermanentOrPlayer filter; - protected FilterPermanent filterPermanent; + protected FilterPermanentOrPlayer filter; + protected FilterPermanent filterPermanent; - public TargetPermanentOrPlayer() { - this(1, 1); - } + public TargetPermanentOrPlayer() { + this(1, 1); + } - public TargetPermanentOrPlayer(int numTargets) { - this(numTargets, numTargets); - } + public TargetPermanentOrPlayer(int numTargets) { + this(numTargets, numTargets); + } - public TargetPermanentOrPlayer(int minNumTargets, int maxNumTargets) { - this.minNumberOfTargets = minNumTargets; - this.maxNumberOfTargets = maxNumTargets; - this.zone = Zone.ALL; - this.filter = new FilterPermanentOrPlayer(); - this.targetName = filter.getMessage(); - this.filterPermanent = new FilterPermanent(); - } + public TargetPermanentOrPlayer(int minNumTargets, int maxNumTargets) { + this.minNumberOfTargets = minNumTargets; + this.maxNumberOfTargets = maxNumTargets; + this.zone = Zone.ALL; + this.filter = new FilterPermanentOrPlayer(); + this.targetName = filter.getMessage(); + this.filterPermanent = new FilterPermanent(); + } - public TargetPermanentOrPlayer(int minNumTargets, int maxNumTargets, boolean notTarget) { - this(minNumTargets, maxNumTargets); - this.notTarget = notTarget; - } + public TargetPermanentOrPlayer(int minNumTargets, int maxNumTargets, boolean notTarget) { + this(minNumTargets, maxNumTargets); + this.notTarget = notTarget; + } - public TargetPermanentOrPlayer(final TargetPermanentOrPlayer target) { - super(target); - this.filter = target.filter.copy(); - } + public TargetPermanentOrPlayer(final TargetPermanentOrPlayer target) { + super(target); + this.filter = target.filter.copy(); + } - @Override - public Filter getFilter() { - return this.filter; - } + @Override + public Filter getFilter() { + return this.filter; + } - public void setFilter(FilterPermanentOrPlayer filter) { - this.filter = filter; - } + public void setFilter(FilterPermanentOrPlayer filter) { + this.filter = filter; + } - @Override - public boolean canTarget(UUID id, Game game) { - Permanent permanent = game.getPermanent(id); - if (permanent != null) { - return filter.match(permanent, game); - } - Player player = game.getPlayer(id); - if (player != null) - return filter.match(player, game); - return false; - } + @Override + public boolean canTarget(UUID id, Game game) { + Permanent permanent = game.getPermanent(id); + if (permanent != null) { + return filter.match(permanent, game); + } + Player player = game.getPlayer(id); + if (player != null) + return filter.match(player, game); + return false; + } - @Override - public boolean canTarget(UUID id, Ability source, Game game) { - Permanent permanent = game.getPermanent(id); - MageObject targetSource = game.getObject(source.getSourceId()); - if (permanent != null) { - if (source != null) - return permanent.canBeTargetedBy(targetSource, source.getControllerId(), game) && filter.match(permanent, source.getSourceId(), source.getControllerId(), game); - else - return filter.match(permanent, game); - } - Player player = game.getPlayer(id); - if (player != null) - if (source != null) - return player.canBeTargetedBy(targetSource, game) && filter.match(player, game); - else - return filter.match(player, game); - return false; - } + @Override + public boolean canTarget(UUID id, Ability source, Game game) { + Permanent permanent = game.getPermanent(id); + MageObject targetSource = game.getObject(source.getSourceId()); + if (permanent != null) { + if (source != null) + return permanent.canBeTargetedBy(targetSource, source.getControllerId(), game) && filter.match(permanent, source.getSourceId(), source.getControllerId(), game); + else + return filter.match(permanent, game); + } + Player player = game.getPlayer(id); + if (player != null) + if (source != null) + return player.canBeTargetedBy(targetSource, game) && filter.match(player, game); + else + return filter.match(player, game); + return false; + } - /** - * Checks if there are enough {@link mage.game.permanent.Permanent} or {@link mage.players.Player} that can be chosen. Should only be used - * for Ability targets since this checks for protection, shroud etc. - * - * @param sourceId - the target event source - * @param sourceControllerId - controller of the target event source - * @param game - * @return - true if enough valid {@link mage.game.permanent.Permanent} or {@link mage.players.Player} exist - */ - @Override - public boolean canChoose(UUID sourceId, UUID sourceControllerId, Game game) { - int count = 0; - MageObject targetSource = game.getObject(sourceId); - for (UUID playerId: game.getPlayer(sourceControllerId).getInRange()) { - Player player = game.getPlayer(playerId); - if (player != null && player.canBeTargetedBy(targetSource, game) && filter.match(player, game)) { - count++; - if (count >= this.minNumberOfTargets) - return true; - } - } - for (Permanent permanent: game.getBattlefield().getActivePermanents(new FilterCreaturePermanent(), sourceControllerId, game)) { - if (permanent.canBeTargetedBy(targetSource, sourceControllerId, game) && filter.match(permanent, sourceId, sourceControllerId, game)) { - count++; - if (count >= this.minNumberOfTargets) - return true; - } - } - return false; - } + /** + * Checks if there are enough {@link mage.game.permanent.Permanent} or {@link mage.players.Player} that can be chosen. Should only be used + * for Ability targets since this checks for protection, shroud etc. + * + * @param sourceId - the target event source + * @param sourceControllerId - controller of the target event source + * @param game + * @return - true if enough valid {@link mage.game.permanent.Permanent} or {@link mage.players.Player} exist + */ + @Override + public boolean canChoose(UUID sourceId, UUID sourceControllerId, Game game) { + int count = 0; + MageObject targetSource = game.getObject(sourceId); + for (UUID playerId: game.getPlayer(sourceControllerId).getInRange()) { + Player player = game.getPlayer(playerId); + if (player != null && player.canBeTargetedBy(targetSource, game) && filter.match(player, game)) { + count++; + if (count >= this.minNumberOfTargets) + return true; + } + } + for (Permanent permanent: game.getBattlefield().getActivePermanents(new FilterCreaturePermanent(), sourceControllerId, game)) { + if (permanent.canBeTargetedBy(targetSource, sourceControllerId, game) && filter.match(permanent, sourceId, sourceControllerId, game)) { + count++; + if (count >= this.minNumberOfTargets) + return true; + } + } + return false; + } - /** - * Checks if there are enough {@link mage.game.permanent.Permanent} or {@link mage.players.Player} that can be selected. Should not be used - * for Ability targets since this does not check for protection, shroud etc. - * - * @param sourceControllerId - controller of the select event - * @param game - * @return - true if enough valid {@link mage.game.permanent.Permanent} or {@link mage.players.Player} exist - */ - @Override - public boolean canChoose(UUID sourceControllerId, Game game) { - int count = 0; - for (UUID playerId: game.getPlayer(sourceControllerId).getInRange()) { - Player player = game.getPlayer(playerId); - if (player != null && filter.match(player, game)) { - count++; - if (count >= this.minNumberOfTargets) - return true; - } - } - for (Permanent permanent: game.getBattlefield().getActivePermanents(filterPermanent, sourceControllerId, game)) { - if (filter.match(permanent, null, sourceControllerId, game) && filter.match(permanent, game)) { - count++; - if (count >= this.minNumberOfTargets) - return true; - } - } - return false; - } + /** + * Checks if there are enough {@link mage.game.permanent.Permanent} or {@link mage.players.Player} that can be selected. Should not be used + * for Ability targets since this does not check for protection, shroud etc. + * + * @param sourceControllerId - controller of the select event + * @param game + * @return - true if enough valid {@link mage.game.permanent.Permanent} or {@link mage.players.Player} exist + */ + @Override + public boolean canChoose(UUID sourceControllerId, Game game) { + int count = 0; + for (UUID playerId: game.getPlayer(sourceControllerId).getInRange()) { + Player player = game.getPlayer(playerId); + if (player != null && filter.match(player, game)) { + count++; + if (count >= this.minNumberOfTargets) + return true; + } + } + for (Permanent permanent: game.getBattlefield().getActivePermanents(filterPermanent, sourceControllerId, game)) { + if (filter.match(permanent, null, sourceControllerId, game) && filter.match(permanent, game)) { + count++; + if (count >= this.minNumberOfTargets) + return true; + } + } + return false; + } - @Override - public Set possibleTargets(UUID sourceId, UUID sourceControllerId, Game game) { - Set possibleTargets = new HashSet(); - MageObject targetSource = game.getObject(sourceId); - for (UUID playerId: game.getPlayer(sourceControllerId).getInRange()) { - Player player = game.getPlayer(playerId); - if (player != null && player.canBeTargetedBy(targetSource, game) && filter.match(player, game)) { - possibleTargets.add(playerId); - } - } - for (Permanent permanent: game.getBattlefield().getActivePermanents(new FilterCreaturePermanent(), sourceControllerId, game)) { - if (permanent.canBeTargetedBy(targetSource, sourceControllerId, game) && filter.match(permanent, sourceId, sourceControllerId, game)) { - possibleTargets.add(permanent.getId()); - } - } - return possibleTargets; - } + @Override + public Set possibleTargets(UUID sourceId, UUID sourceControllerId, Game game) { + Set possibleTargets = new HashSet(); + MageObject targetSource = game.getObject(sourceId); + for (UUID playerId: game.getPlayer(sourceControllerId).getInRange()) { + Player player = game.getPlayer(playerId); + if (player != null && player.canBeTargetedBy(targetSource, game) && filter.match(player, game)) { + possibleTargets.add(playerId); + } + } + for (Permanent permanent: game.getBattlefield().getActivePermanents(new FilterCreaturePermanent(), sourceControllerId, game)) { + if (permanent.canBeTargetedBy(targetSource, sourceControllerId, game) && filter.match(permanent, sourceId, sourceControllerId, game)) { + possibleTargets.add(permanent.getId()); + } + } + return possibleTargets; + } - @Override - public Set possibleTargets(UUID sourceControllerId, Game game) { - Set possibleTargets = new HashSet(); - for (UUID playerId: game.getPlayer(sourceControllerId).getInRange()) { - Player player = game.getPlayer(playerId); - if (player != null && filter.match(player, game)) { - possibleTargets.add(playerId); - } - } - for (Permanent permanent: game.getBattlefield().getActivePermanents(new FilterCreaturePermanent(), sourceControllerId, game)) { - if (filter.match(permanent, null, sourceControllerId, game)) { - possibleTargets.add(permanent.getId()); - } - } - return possibleTargets; - } + @Override + public Set possibleTargets(UUID sourceControllerId, Game game) { + Set possibleTargets = new HashSet(); + for (UUID playerId: game.getPlayer(sourceControllerId).getInRange()) { + Player player = game.getPlayer(playerId); + if (player != null && filter.match(player, game)) { + possibleTargets.add(playerId); + } + } + for (Permanent permanent: game.getBattlefield().getActivePermanents(new FilterCreaturePermanent(), sourceControllerId, game)) { + if (filter.match(permanent, null, sourceControllerId, game)) { + possibleTargets.add(permanent.getId()); + } + } + return possibleTargets; + } - @Override - public String getTargetedName(Game game) { - StringBuilder sb = new StringBuilder(); - for (UUID targetId: getTargets()) { - Permanent permanent = game.getPermanent(targetId); - if (permanent != null) { - sb.append(permanent.getName()).append(" "); - } - else { - Player player = game.getPlayer(targetId); - sb.append(player.getName()).append(" "); - } - } - return sb.toString(); - } + @Override + public String getTargetedName(Game game) { + StringBuilder sb = new StringBuilder(); + for (UUID targetId: getTargets()) { + Permanent permanent = game.getPermanent(targetId); + if (permanent != null) { + sb.append(permanent.getName()).append(" "); + } + else { + Player player = game.getPlayer(targetId); + sb.append(player.getName()).append(" "); + } + } + return sb.toString(); + } - @Override - public TargetPermanentOrPlayer copy() { - return new TargetPermanentOrPlayer(this); - } + @Override + public TargetPermanentOrPlayer copy() { + return new TargetPermanentOrPlayer(this); + } } diff --git a/Mage/src/mage/target/common/TargetPermanentOrPlayerWithCounter.java b/Mage/src/mage/target/common/TargetPermanentOrPlayerWithCounter.java index c9a64446d0..3032018625 100644 --- a/Mage/src/mage/target/common/TargetPermanentOrPlayerWithCounter.java +++ b/Mage/src/mage/target/common/TargetPermanentOrPlayerWithCounter.java @@ -41,71 +41,71 @@ import java.util.UUID; */ public class TargetPermanentOrPlayerWithCounter extends TargetPermanentOrPlayer { - protected FilterPermanentOrPlayerWithCounter filter; + protected FilterPermanentOrPlayerWithCounter filter; - public TargetPermanentOrPlayerWithCounter() { - this(1, 1); - } + public TargetPermanentOrPlayerWithCounter() { + this(1, 1); + } - public TargetPermanentOrPlayerWithCounter(int numTargets) { - this(numTargets, numTargets); - } + public TargetPermanentOrPlayerWithCounter(int numTargets) { + this(numTargets, numTargets); + } - public TargetPermanentOrPlayerWithCounter(int minNumTargets, int maxNumTargets) { - super(minNumTargets, maxNumTargets); - this.filter = new FilterPermanentOrPlayerWithCounter(); - this.targetName = filter.getMessage(); - super.setFilter(this.filter); - } + public TargetPermanentOrPlayerWithCounter(int minNumTargets, int maxNumTargets) { + super(minNumTargets, maxNumTargets); + this.filter = new FilterPermanentOrPlayerWithCounter(); + this.targetName = filter.getMessage(); + super.setFilter(this.filter); + } - public TargetPermanentOrPlayerWithCounter(int minNumTargets, int maxNumTargets, boolean notTarget) { - this(minNumTargets, maxNumTargets); - this.notTarget = notTarget; - } + public TargetPermanentOrPlayerWithCounter(int minNumTargets, int maxNumTargets, boolean notTarget) { + this(minNumTargets, maxNumTargets); + this.notTarget = notTarget; + } - public TargetPermanentOrPlayerWithCounter(final TargetPermanentOrPlayerWithCounter target) { - super(target); - this.filter = target.filter.copy(); - super.setFilter(this.filter); - } + public TargetPermanentOrPlayerWithCounter(final TargetPermanentOrPlayerWithCounter target) { + super(target); + this.filter = target.filter.copy(); + super.setFilter(this.filter); + } - @Override - public TargetPermanentOrPlayerWithCounter copy() { - return new TargetPermanentOrPlayerWithCounter(this); - } + @Override + public TargetPermanentOrPlayerWithCounter copy() { + return new TargetPermanentOrPlayerWithCounter(this); + } - @Override - public boolean canTarget(UUID id, Game game) { - Permanent permanent = game.getPermanent(id); - if (permanent != null) { - if (permanent.getCounters().size() == 0) { - return false; - } - } - Player player = game.getPlayer(id); - if (player != null) { - if (player.getCounters().size() == 0) { - return false; - } - } - return super.canTarget(id, game); - } + @Override + public boolean canTarget(UUID id, Game game) { + Permanent permanent = game.getPermanent(id); + if (permanent != null) { + if (permanent.getCounters().size() == 0) { + return false; + } + } + Player player = game.getPlayer(id); + if (player != null) { + if (player.getCounters().size() == 0) { + return false; + } + } + return super.canTarget(id, game); + } - @Override - public boolean canTarget(UUID id, Ability source, Game game) { - Permanent permanent = game.getPermanent(id); - if (permanent != null) { - if (permanent.getCounters().size() == 0) { - return false; - } - } - Player player = game.getPlayer(id); - if (player != null) { - if (player.getCounters().size() == 0) { - return false; - } - } - return super.canTarget(id, source, game); - } + @Override + public boolean canTarget(UUID id, Ability source, Game game) { + Permanent permanent = game.getPermanent(id); + if (permanent != null) { + if (permanent.getCounters().size() == 0) { + return false; + } + } + Player player = game.getPlayer(id); + if (player != null) { + if (player.getCounters().size() == 0) { + return false; + } + } + return super.canTarget(id, source, game); + } } diff --git a/Mage/src/mage/target/common/TargetSpellOrPermanent.java b/Mage/src/mage/target/common/TargetSpellOrPermanent.java index 62aa48d2b9..8a85927e92 100644 --- a/Mage/src/mage/target/common/TargetSpellOrPermanent.java +++ b/Mage/src/mage/target/common/TargetSpellOrPermanent.java @@ -52,192 +52,192 @@ import java.util.UUID; */ public class TargetSpellOrPermanent extends TargetImpl { - protected FilterSpellOrPermanent filter; - protected FilterPermanent filterPermanent; + protected FilterSpellOrPermanent filter; + protected FilterPermanent filterPermanent; - public TargetSpellOrPermanent() { - this(1, 1); - } + public TargetSpellOrPermanent() { + this(1, 1); + } - public TargetSpellOrPermanent(int numTargets) { - this(numTargets, numTargets); - } + public TargetSpellOrPermanent(int numTargets) { + this(numTargets, numTargets); + } - public TargetSpellOrPermanent(int minNumTargets, int maxNumTargets) { - this.minNumberOfTargets = minNumTargets; - this.maxNumberOfTargets = maxNumTargets; - this.zone = Zone.ALL; - this.filter = new FilterSpellOrPermanent(); - this.targetName = filter.getMessage(); - this.filterPermanent = new FilterPermanent(); - } + public TargetSpellOrPermanent(int minNumTargets, int maxNumTargets) { + this.minNumberOfTargets = minNumTargets; + this.maxNumberOfTargets = maxNumTargets; + this.zone = Zone.ALL; + this.filter = new FilterSpellOrPermanent(); + this.targetName = filter.getMessage(); + this.filterPermanent = new FilterPermanent(); + } + + public TargetSpellOrPermanent(int minNumTargets, int maxNumTargets, boolean notTarget) { + this(minNumTargets, maxNumTargets); + this.notTarget = notTarget; + } - public TargetSpellOrPermanent(int minNumTargets, int maxNumTargets, boolean notTarget) { - this(minNumTargets, maxNumTargets); - this.notTarget = notTarget; - } - public TargetSpellOrPermanent(int minNumTargets, int maxNumTargets, FilterSpellOrPermanent filter,boolean notTarget) { - this(minNumTargets, maxNumTargets); - this.notTarget = notTarget; + this(minNumTargets, maxNumTargets); + this.notTarget = notTarget; this.filter = filter; - } - public TargetSpellOrPermanent(final TargetSpellOrPermanent target) { - super(target); - this.filter = target.filter.copy(); - } + } + public TargetSpellOrPermanent(final TargetSpellOrPermanent target) { + super(target); + this.filter = target.filter.copy(); + } - @Override - public Filter getFilter() { - return this.filter; - } + @Override + public Filter getFilter() { + return this.filter; + } - public void setFilter(FilterSpellOrPermanent filter) { - this.filter = filter; - } + public void setFilter(FilterSpellOrPermanent filter) { + this.filter = filter; + } - @Override - public boolean canTarget(UUID id, Game game) { - Permanent permanent = game.getPermanent(id); - if (permanent != null) { - return filter.match(permanent, game); - } - Spell spell = game.getStack().getSpell(id); - if (spell != null) - return filter.match(spell, game); - return false; - } + @Override + public boolean canTarget(UUID id, Game game) { + Permanent permanent = game.getPermanent(id); + if (permanent != null) { + return filter.match(permanent, game); + } + Spell spell = game.getStack().getSpell(id); + if (spell != null) + return filter.match(spell, game); + return false; + } - @Override - public boolean canTarget(UUID id, Ability source, Game game) { - Permanent permanent = game.getPermanent(id); - MageObject targetSource = game.getObject(source.getSourceId()); - if (permanent != null) { - if (source != null) - return permanent.canBeTargetedBy(targetSource, source.getControllerId(), game) && filter.match(permanent, source.getSourceId(), source.getControllerId(), game); - else - return filter.match(permanent, game); - } - Spell spell = game.getStack().getSpell(id); - if (spell != null) - return filter.match(spell, game); - return false; - } + @Override + public boolean canTarget(UUID id, Ability source, Game game) { + Permanent permanent = game.getPermanent(id); + MageObject targetSource = game.getObject(source.getSourceId()); + if (permanent != null) { + if (source != null) + return permanent.canBeTargetedBy(targetSource, source.getControllerId(), game) && filter.match(permanent, source.getSourceId(), source.getControllerId(), game); + else + return filter.match(permanent, game); + } + Spell spell = game.getStack().getSpell(id); + if (spell != null) + return filter.match(spell, game); + return false; + } - /** - * Checks if there are enough {@link mage.game.permanent.Permanent} or {@link mage.game.stack.Spell} that can be chosen. Should only be used - * for Ability targets since this checks for protection, shroud etc. - * - * @param sourceId - the target event source - * @param sourceControllerId - controller of the target event source - * @param game - * @return - true if enough valid {@link mage.game.permanent.Permanent} or {@link mage.game.stack.Spell} exist - */ - @Override - public boolean canChoose(UUID sourceId, UUID sourceControllerId, Game game) { - int count = 0; - MageObject targetSource = game.getObject(sourceId); - for (StackObject stackObject: game.getStack()) { - Spell spell = game.getStack().getSpell(stackObject.getId()); - if (spell != null && filter.match(spell, sourceId, sourceControllerId, game)) { - count++; - if (count >= this.minNumberOfTargets) - return true; - } - } - for (Permanent permanent: game.getBattlefield().getActivePermanents(new FilterCreaturePermanent(), sourceControllerId, game)) { - if (permanent.canBeTargetedBy(targetSource, sourceControllerId, game) && filter.match(permanent, sourceId, sourceControllerId, game)) { - count++; - if (count >= this.minNumberOfTargets) - return true; - } - } - return false; - } + /** + * Checks if there are enough {@link mage.game.permanent.Permanent} or {@link mage.game.stack.Spell} that can be chosen. Should only be used + * for Ability targets since this checks for protection, shroud etc. + * + * @param sourceId - the target event source + * @param sourceControllerId - controller of the target event source + * @param game + * @return - true if enough valid {@link mage.game.permanent.Permanent} or {@link mage.game.stack.Spell} exist + */ + @Override + public boolean canChoose(UUID sourceId, UUID sourceControllerId, Game game) { + int count = 0; + MageObject targetSource = game.getObject(sourceId); + for (StackObject stackObject: game.getStack()) { + Spell spell = game.getStack().getSpell(stackObject.getId()); + if (spell != null && filter.match(spell, sourceId, sourceControllerId, game)) { + count++; + if (count >= this.minNumberOfTargets) + return true; + } + } + for (Permanent permanent: game.getBattlefield().getActivePermanents(new FilterCreaturePermanent(), sourceControllerId, game)) { + if (permanent.canBeTargetedBy(targetSource, sourceControllerId, game) && filter.match(permanent, sourceId, sourceControllerId, game)) { + count++; + if (count >= this.minNumberOfTargets) + return true; + } + } + return false; + } - /** - * Checks if there are enough {@link mage.game.permanent.Permanent} or {@link mage.game.stack.Spell} that can be selected. Should not be used - * for Ability targets since this does not check for protection, shroud etc. - * - * @param sourceControllerId - controller of the select event - * @param game - * @return - true if enough valid {@link mage.game.permanent.Permanent} or {@link mage.game.stack.Spell} exist - */ - @Override - public boolean canChoose(UUID sourceControllerId, Game game) { - int count = 0; + /** + * Checks if there are enough {@link mage.game.permanent.Permanent} or {@link mage.game.stack.Spell} that can be selected. Should not be used + * for Ability targets since this does not check for protection, shroud etc. + * + * @param sourceControllerId - controller of the select event + * @param game + * @return - true if enough valid {@link mage.game.permanent.Permanent} or {@link mage.game.stack.Spell} exist + */ + @Override + public boolean canChoose(UUID sourceControllerId, Game game) { + int count = 0; for (StackObject stackObject: game.getStack()) { - Spell spell = game.getStack().getSpell(stackObject.getId()); - if (spell != null && filter.match(spell, null, sourceControllerId, game) && filter.match(spell, game)) { - count++; - if (count >= this.minNumberOfTargets) - return true; - } - } - for (Permanent permanent: game.getBattlefield().getActivePermanents(filterPermanent, sourceControllerId, game)) { - if (filter.match(permanent, null, sourceControllerId, game) && filter.match(permanent, game)) { - count++; - if (count >= this.minNumberOfTargets) - return true; - } - } - return false; - } + Spell spell = game.getStack().getSpell(stackObject.getId()); + if (spell != null && filter.match(spell, null, sourceControllerId, game) && filter.match(spell, game)) { + count++; + if (count >= this.minNumberOfTargets) + return true; + } + } + for (Permanent permanent: game.getBattlefield().getActivePermanents(filterPermanent, sourceControllerId, game)) { + if (filter.match(permanent, null, sourceControllerId, game) && filter.match(permanent, game)) { + count++; + if (count >= this.minNumberOfTargets) + return true; + } + } + return false; + } - @Override - public Set possibleTargets(UUID sourceId, UUID sourceControllerId, Game game) { - Set possibleTargets = new HashSet(); - MageObject targetSource = game.getObject(sourceId); + @Override + public Set possibleTargets(UUID sourceId, UUID sourceControllerId, Game game) { + Set possibleTargets = new HashSet(); + MageObject targetSource = game.getObject(sourceId); for (StackObject stackObject: game.getStack()) { - Spell spell = game.getStack().getSpell(stackObject.getId()); - if (spell != null && filter.match(spell, null, sourceControllerId, game) && filter.match(spell, game)) { - possibleTargets.add(spell.getId()); - } - } + Spell spell = game.getStack().getSpell(stackObject.getId()); + if (spell != null && filter.match(spell, null, sourceControllerId, game) && filter.match(spell, game)) { + possibleTargets.add(spell.getId()); + } + } for (Permanent permanent: game.getBattlefield().getActivePermanents(new FilterCreaturePermanent(), sourceControllerId, game)) { - if (permanent.canBeTargetedBy(targetSource, sourceControllerId, game) && filter.match(permanent, sourceId, sourceControllerId, game)) { - possibleTargets.add(permanent.getId()); - } - } - return possibleTargets; - } + if (permanent.canBeTargetedBy(targetSource, sourceControllerId, game) && filter.match(permanent, sourceId, sourceControllerId, game)) { + possibleTargets.add(permanent.getId()); + } + } + return possibleTargets; + } - @Override - public Set possibleTargets(UUID sourceControllerId, Game game) { - Set possibleTargets = new HashSet(); + @Override + public Set possibleTargets(UUID sourceControllerId, Game game) { + Set possibleTargets = new HashSet(); for (StackObject stackObject: game.getStack()) { - Spell spell = game.getStack().getSpell(stackObject.getId()); - if (spell != null && filter.match(spell, null, sourceControllerId, game) && filter.match(spell, game)) { - possibleTargets.add(spell.getId()); - } - } - for (Permanent permanent: game.getBattlefield().getActivePermanents(new FilterCreaturePermanent(), sourceControllerId, game)) { - if (filter.match(permanent, null, sourceControllerId, game)) { - possibleTargets.add(permanent.getId()); - } - } - return possibleTargets; - } + Spell spell = game.getStack().getSpell(stackObject.getId()); + if (spell != null && filter.match(spell, null, sourceControllerId, game) && filter.match(spell, game)) { + possibleTargets.add(spell.getId()); + } + } + for (Permanent permanent: game.getBattlefield().getActivePermanents(new FilterCreaturePermanent(), sourceControllerId, game)) { + if (filter.match(permanent, null, sourceControllerId, game)) { + possibleTargets.add(permanent.getId()); + } + } + return possibleTargets; + } - @Override - public String getTargetedName(Game game) { - StringBuilder sb = new StringBuilder(); - for (UUID targetId: getTargets()) { - Permanent permanent = game.getPermanent(targetId); - if (permanent != null) { - sb.append(permanent.getName()).append(" "); - } - else { - Spell spell = game.getStack().getSpell(targetId); - sb.append(spell.getName()).append(" "); - } - } - return sb.toString(); - } + @Override + public String getTargetedName(Game game) { + StringBuilder sb = new StringBuilder(); + for (UUID targetId: getTargets()) { + Permanent permanent = game.getPermanent(targetId); + if (permanent != null) { + sb.append(permanent.getName()).append(" "); + } + else { + Spell spell = game.getStack().getSpell(targetId); + sb.append(spell.getName()).append(" "); + } + } + return sb.toString(); + } - @Override - public TargetSpellOrPermanent copy() { - return new TargetSpellOrPermanent(this); - } + @Override + public TargetSpellOrPermanent copy() { + return new TargetSpellOrPermanent(this); + } } diff --git a/Mage/src/mage/util/CardUtil.java b/Mage/src/mage/util/CardUtil.java index 557b411ca0..b7375e80ff 100644 --- a/Mage/src/mage/util/CardUtil.java +++ b/Mage/src/mage/util/CardUtil.java @@ -45,101 +45,101 @@ import mage.util.functions.CopyTokenFunction; */ public class CardUtil { - /** - * Checks whether two cards share card types. - * - * @param card1 - * @param card2 - * @return - */ - public static boolean shareTypes(Card card1, Card card2) { + /** + * Checks whether two cards share card types. + * + * @param card1 + * @param card2 + * @return + */ + public static boolean shareTypes(Card card1, Card card2) { - if (card1 == null || card2 == null) - throw new IllegalArgumentException("Params can't be null"); + if (card1 == null || card2 == null) + throw new IllegalArgumentException("Params can't be null"); - for (Constants.CardType type : card1.getCardType()) { - if (card2.getCardType().contains(type)) { - return true; - } - } + for (Constants.CardType type : card1.getCardType()) { + if (card2.getCardType().contains(type)) { + return true; + } + } - return false; - } - /** - * Checks whether two cards share card subtypes. - * - * @param card1 - * @param card2 - * @return - */ - public static boolean shareSubtypes(Card card1, Card card2) { + return false; + } + /** + * Checks whether two cards share card subtypes. + * + * @param card1 + * @param card2 + * @return + */ + public static boolean shareSubtypes(Card card1, Card card2) { - if (card1 == null || card2 == null) - throw new IllegalArgumentException("Params can't be null"); + if (card1 == null || card2 == null) + throw new IllegalArgumentException("Params can't be null"); - for (String subtype : card1.getSubtype()) { - if (card2.getSubtype().contains(subtype)) { - return true; - } - } + for (String subtype : card1.getSubtype()) { + if (card2.getSubtype().contains(subtype)) { + return true; + } + } - return false; - } - - /** - * Adjusts spell or ability cost to be paid. - * - * @param spellAbility - * @param reduceCount - */ - public static void adjustCost(SpellAbility spellAbility, int reduceCount) { - ManaCosts previousCost = spellAbility.getManaCostsToPay(); - ManaCosts adjustedCost = new ManaCostsImpl(); - boolean reduced = false; - for (ManaCost manaCost : previousCost) { - Mana mana = manaCost.getOptions().get(0); - int colorless = mana.getColorless(); - if (!reduced && mana != null && colorless > 0) { - if ((colorless - reduceCount) > 0) { - int newColorless = colorless - reduceCount; - adjustedCost.add(new GenericManaCost(newColorless)); - } - reduced = true; - } else { - adjustedCost.add(manaCost); - } - } - spellAbility.getManaCostsToPay().clear(); - spellAbility.getManaCostsToPay().addAll(adjustedCost); - } + return false; + } - /** - * Returns function that copies params\abilities from one card to another. - * - * @param target - */ - public static CopyFunction copyTo(Card target) { - return new CopyFunction(target); - } + /** + * Adjusts spell or ability cost to be paid. + * + * @param spellAbility + * @param reduceCount + */ + public static void adjustCost(SpellAbility spellAbility, int reduceCount) { + ManaCosts previousCost = spellAbility.getManaCostsToPay(); + ManaCosts adjustedCost = new ManaCostsImpl(); + boolean reduced = false; + for (ManaCost manaCost : previousCost) { + Mana mana = manaCost.getOptions().get(0); + int colorless = mana.getColorless(); + if (!reduced && mana != null && colorless > 0) { + if ((colorless - reduceCount) > 0) { + int newColorless = colorless - reduceCount; + adjustedCost.add(new GenericManaCost(newColorless)); + } + reduced = true; + } else { + adjustedCost.add(manaCost); + } + } + spellAbility.getManaCostsToPay().clear(); + spellAbility.getManaCostsToPay().addAll(adjustedCost); + } - /** - * Returns function that copies params\abilities from one card to {@link Token}. - * - * @param target - */ - public static CopyTokenFunction copyTo(Token target) { - return new CopyTokenFunction(target); - } + /** + * Returns function that copies params\abilities from one card to another. + * + * @param target + */ + public static CopyFunction copyTo(Card target) { + return new CopyFunction(target); + } - public static boolean isPermanentCard ( Card card ) { - boolean permanent = false; - - permanent |= card.getCardType().contains(Constants.CardType.ARTIFACT); - permanent |= card.getCardType().contains(Constants.CardType.CREATURE); - permanent |= card.getCardType().contains(Constants.CardType.ENCHANTMENT); - permanent |= card.getCardType().contains(Constants.CardType.LAND); - permanent |= card.getCardType().contains(Constants.CardType.PLANESWALKER); - - return permanent; - } + /** + * Returns function that copies params\abilities from one card to {@link Token}. + * + * @param target + */ + public static CopyTokenFunction copyTo(Token target) { + return new CopyTokenFunction(target); + } + + public static boolean isPermanentCard ( Card card ) { + boolean permanent = false; + + permanent |= card.getCardType().contains(Constants.CardType.ARTIFACT); + permanent |= card.getCardType().contains(Constants.CardType.CREATURE); + permanent |= card.getCardType().contains(Constants.CardType.ENCHANTMENT); + permanent |= card.getCardType().contains(Constants.CardType.LAND); + permanent |= card.getCardType().contains(Constants.CardType.PLANESWALKER); + + return permanent; + } } diff --git a/Mage/src/mage/util/CircularList.java b/Mage/src/mage/util/CircularList.java index 61fc7f25e6..25cfb0d82d 100644 --- a/Mage/src/mage/util/CircularList.java +++ b/Mage/src/mage/util/CircularList.java @@ -43,433 +43,433 @@ import java.util.concurrent.locks.ReentrantLock; * @author BetaSteward_at_googlemail.com */ public class CircularList implements List, Iterable, Serializable { - //TODO: might have to make E extend Copyable + //TODO: might have to make E extend Copyable - protected List list = new ArrayList(); + protected List list = new ArrayList(); - protected final ReentrantLock lock = new ReentrantLock(); + protected final ReentrantLock lock = new ReentrantLock(); - protected int modCount; - protected int index; + protected int modCount; + protected int index; - public CircularList() {} + public CircularList() {} - public CircularList(final CircularList cList) { - this.modCount = cList.modCount; - for (E entry: cList.list) { - this.list.add((E)entry); - } - this.index = cList.index; - } + public CircularList(final CircularList cList) { + this.modCount = cList.modCount; + for (E entry: cList.list) { + this.list.add((E)entry); + } + this.index = cList.index; + } - public CircularList copy() { - return new CircularList(this); - } - - /** - * Inserts an element into the current position - */ - @Override - public boolean add(E e) { - list.add(this.index, e); - return true; - } + public CircularList copy() { + return new CircularList(this); + } - @Override - public void add(int index, E element) { - lock.lock(); - try { - list.add(index, element); - modCount++; - } - finally { - lock.unlock(); - } - } + /** + * Inserts an element into the current position + */ + @Override + public boolean add(E e) { + list.add(this.index, e); + return true; + } - /** - * - * @param e the element to set as current - * @return true if element e exists and index was set - */ - public boolean setCurrent(E e) { - if (list.contains(e)) { - this.index = list.indexOf(e); - return true; - } - return false; - } + @Override + public void add(int index, E element) { + lock.lock(); + try { + list.add(index, element); + modCount++; + } + finally { + lock.unlock(); + } + } - /** - * Retrieves the element at the current position - */ - public E get() { - return list.get(this.index); - } + /** + * + * @param e the element to set as current + * @return true if element e exists and index was set + */ + public boolean setCurrent(E e) { + if (list.contains(e)) { + this.index = list.indexOf(e); + return true; + } + return false; + } - @Override - public E get(int index) { - return list.get(index); - } + /** + * Retrieves the element at the current position + */ + public E get() { + return list.get(this.index); + } - /** - * Returns the next element in the list. Will loop around to the beginning - * of the list if the current element is the last. - * - * @return the next element in the list - */ - public E getNext() { - return list.get(incrementPointer()); - } + @Override + public E get(int index) { + return list.get(index); + } - /** - * Returns the previous element in the list. Will loop around to the end - * of the list if the current element is the first. - * - * @return the previous element in the list - */ - public E getPrevious() { - return list.get(decrementPointer()); - } + /** + * Returns the next element in the list. Will loop around to the beginning + * of the list if the current element is the last. + * + * @return the next element in the list + */ + public E getNext() { + return list.get(incrementPointer()); + } - /** - * Removes the current element from the list - * - * @return true is the item was successfully removed - */ - public boolean remove() { - return this.remove(get()); - } + /** + * Returns the previous element in the list. Will loop around to the end + * of the list if the current element is the first. + * + * @return the previous element in the list + */ + public E getPrevious() { + return list.get(decrementPointer()); + } - @Override - public E remove(int index) { - lock.lock(); - try { - E ret = list.remove(index); - checkPointer(); - modCount++; - return ret; - } - finally { - lock.unlock(); - } - } + /** + * Removes the current element from the list + * + * @return true is the item was successfully removed + */ + public boolean remove() { + return this.remove(get()); + } - @Override - public boolean remove(Object o) { - lock.lock(); - try { - boolean ret = list.remove(o); - checkPointer(); - modCount++; - return ret; - } - finally { - lock.unlock(); - } - } + @Override + public E remove(int index) { + lock.lock(); + try { + E ret = list.remove(index); + checkPointer(); + modCount++; + return ret; + } + finally { + lock.unlock(); + } + } - private int incrementPointer() { - lock.lock(); - try { - index = incrementListPointer(index); - return index; - } - finally { - lock.unlock(); - } - } + @Override + public boolean remove(Object o) { + lock.lock(); + try { + boolean ret = list.remove(o); + checkPointer(); + modCount++; + return ret; + } + finally { + lock.unlock(); + } + } - private int incrementListPointer(int index) { - index++; - if (index >= list.size()) - index = 0; - return index; - } + private int incrementPointer() { + lock.lock(); + try { + index = incrementListPointer(index); + return index; + } + finally { + lock.unlock(); + } + } - private int decrementPointer() { - lock.lock(); - try { - index = decrementListPointer(index); - return index; - } - finally { - lock.unlock(); - } - } + private int incrementListPointer(int index) { + index++; + if (index >= list.size()) + index = 0; + return index; + } - private int decrementListPointer(int index) { - index--; - if (index < 0) - index = list.size() - 1; - return index; - } + private int decrementPointer() { + lock.lock(); + try { + index = decrementListPointer(index); + return index; + } + finally { + lock.unlock(); + } + } - /** - * This method should only be called from a locked method - * thus it is not necessary to lock from this method - */ - private int checkPointer() { - if (index > list.size()) { - index = list.size() - 1; - } - else if (index < 0) - index = 0; - return index; - } + private int decrementListPointer(int index) { + index--; + if (index < 0) + index = list.size() - 1; + return index; + } - @Override - public int size() { - return list.size(); - } + /** + * This method should only be called from a locked method + * thus it is not necessary to lock from this method + */ + private int checkPointer() { + if (index > list.size()) { + index = list.size() - 1; + } + else if (index < 0) + index = 0; + return index; + } - @Override - public boolean isEmpty() { - return list.isEmpty(); - } + @Override + public int size() { + return list.size(); + } - @Override - public boolean contains(Object o) { - return list.contains(o); - } + @Override + public boolean isEmpty() { + return list.isEmpty(); + } - @Override - public Object[] toArray() { - return list.toArray(); - } + @Override + public boolean contains(Object o) { + return list.contains(o); + } - @Override - public T[] toArray(T[] a) { - return list.toArray(a); - } + @Override + public Object[] toArray() { + return list.toArray(); + } - public List toList() { - return list; - } + @Override + public T[] toArray(T[] a) { + return list.toArray(a); + } - @Override - public boolean containsAll(Collection c) { - return list.containsAll(c); - } + public List toList() { + return list; + } - @Override - public boolean addAll(Collection c) { - return this.addAll(this.index, c); - } + @Override + public boolean containsAll(Collection c) { + return list.containsAll(c); + } - @Override - public boolean addAll(int index, Collection c) { - lock.lock(); - try { - modCount++; - return list.addAll(index, c); - } - finally { - lock.unlock(); - } - } + @Override + public boolean addAll(Collection c) { + return this.addAll(this.index, c); + } - @Override - public boolean removeAll(Collection c) { - lock.lock(); - try { - boolean ret = list.removeAll(c); - modCount++; - checkPointer(); - return ret; - } - finally { - lock.unlock(); - } - } + @Override + public boolean addAll(int index, Collection c) { + lock.lock(); + try { + modCount++; + return list.addAll(index, c); + } + finally { + lock.unlock(); + } + } - @Override - public boolean retainAll(Collection c) { - lock.lock(); - try { - boolean ret = list.retainAll(c); - modCount++; - checkPointer(); - return ret; - } - finally { - lock.unlock(); - } - } + @Override + public boolean removeAll(Collection c) { + lock.lock(); + try { + boolean ret = list.removeAll(c); + modCount++; + checkPointer(); + return ret; + } + finally { + lock.unlock(); + } + } - @Override - public void clear() { - lock.lock(); - try { - list.clear(); - modCount++; - index = 0; - } - finally { - lock.unlock(); - } - } + @Override + public boolean retainAll(Collection c) { + lock.lock(); + try { + boolean ret = list.retainAll(c); + modCount++; + checkPointer(); + return ret; + } + finally { + lock.unlock(); + } + } - @Override - public E set(int index, E element) { - lock.lock(); - try { - modCount++; - return list.set(index, element); - } - finally { - lock.unlock(); - } - } + @Override + public void clear() { + lock.lock(); + try { + list.clear(); + modCount++; + index = 0; + } + finally { + lock.unlock(); + } + } - public E set(E element) { - return this.set(this.index, element); - } + @Override + public E set(int index, E element) { + lock.lock(); + try { + modCount++; + return list.set(index, element); + } + finally { + lock.unlock(); + } + } - @Override - public int indexOf(Object o) { - return list.indexOf(o); - } + public E set(E element) { + return this.set(this.index, element); + } - @Override - public int lastIndexOf(Object o) { - return list.lastIndexOf(o); - } + @Override + public int indexOf(Object o) { + return list.indexOf(o); + } - @Override - public List subList(int fromIndex, int toIndex) { - return list.subList(fromIndex, toIndex); - } + @Override + public int lastIndexOf(Object o) { + return list.lastIndexOf(o); + } - @Override - public Iterator iterator() { - return new CircularIterator(); - } + @Override + public List subList(int fromIndex, int toIndex) { + return list.subList(fromIndex, toIndex); + } - @Override - public ListIterator listIterator() { - return new CircularListIterator(); - } + @Override + public Iterator iterator() { + return new CircularIterator(); + } - @Override - public ListIterator listIterator(int index) { - return new CircularListIterator(index); - } + @Override + public ListIterator listIterator() { + return new CircularListIterator(); + } - private class CircularIterator implements Iterator { + @Override + public ListIterator listIterator(int index) { + return new CircularListIterator(index); + } - int cursor; - int lastIndex; - int curModCount; - boolean hasMoved = false; - - private CircularIterator() { - curModCount = modCount; - cursor = index; - lastIndex = cursor; - } + private class CircularIterator implements Iterator { - @Override - public boolean hasNext() { - if (!hasMoved && size() > 0) - return true; - return cursor != lastIndex; - } + int cursor; + int lastIndex; + int curModCount; + boolean hasMoved = false; - @Override - public E next() { - if (!this.hasNext()) - throw new IllegalStateException(); - if (curModCount != modCount) - throw new ConcurrentModificationException(); - E data = (E) list.get(cursor); - cursor = incrementListPointer(cursor); - hasMoved = true; - return data; - } + private CircularIterator() { + curModCount = modCount; + cursor = index; + lastIndex = cursor; + } - public void remove() { - throw new UnsupportedOperationException("Not supported yet."); - } - - } + @Override + public boolean hasNext() { + if (!hasMoved && size() > 0) + return true; + return cursor != lastIndex; + } - private class CircularListIterator implements ListIterator { - int cursor; - int lastIndex; - int firstIndex; - int curModCount; - boolean hasMoved = false; + @Override + public E next() { + if (!this.hasNext()) + throw new IllegalStateException(); + if (curModCount != modCount) + throw new ConcurrentModificationException(); + E data = (E) list.get(cursor); + cursor = incrementListPointer(cursor); + hasMoved = true; + return data; + } - private CircularListIterator() { - this(index); - } + public void remove() { + throw new UnsupportedOperationException("Not supported yet."); + } - private CircularListIterator(int index) { - curModCount = modCount; - cursor = index; - firstIndex = index; - lastIndex = index; - } + } - public boolean hasNext() { - if (!hasMoved && size() > 0) - return true; - return cursor != lastIndex; - } + private class CircularListIterator implements ListIterator { + int cursor; + int lastIndex; + int firstIndex; + int curModCount; + boolean hasMoved = false; - public E next() { - if (!this.hasNext()) - throw new IllegalStateException(); - if (curModCount != modCount) - throw new ConcurrentModificationException(); - E data = (E) list.get(cursor); - cursor = incrementListPointer(cursor); - hasMoved = true; - return data; - } + private CircularListIterator() { + this(index); + } - public boolean hasPrevious() { - if (!hasMoved && size() > 0) - return true; - return cursor != firstIndex; - } + private CircularListIterator(int index) { + curModCount = modCount; + cursor = index; + firstIndex = index; + lastIndex = index; + } - public E previous() { - if (!this.hasPrevious()) - throw new IllegalStateException(); - if (curModCount != modCount) - throw new ConcurrentModificationException(); - cursor = decrementListPointer(cursor); - hasMoved = true; - return (E) list.get(cursor); - } + public boolean hasNext() { + if (!hasMoved && size() > 0) + return true; + return cursor != lastIndex; + } - public int nextIndex() { - if (this.hasNext()) - return incrementListPointer(cursor); - return list.size(); - } + public E next() { + if (!this.hasNext()) + throw new IllegalStateException(); + if (curModCount != modCount) + throw new ConcurrentModificationException(); + E data = (E) list.get(cursor); + cursor = incrementListPointer(cursor); + hasMoved = true; + return data; + } - public int previousIndex() { - if (this.hasPrevious()) - return decrementListPointer(cursor); - return -1; - } + public boolean hasPrevious() { + if (!hasMoved && size() > 0) + return true; + return cursor != firstIndex; + } - public void remove() { - throw new UnsupportedOperationException("Not supported yet."); - } + public E previous() { + if (!this.hasPrevious()) + throw new IllegalStateException(); + if (curModCount != modCount) + throw new ConcurrentModificationException(); + cursor = decrementListPointer(cursor); + hasMoved = true; + return (E) list.get(cursor); + } - public void set(E arg0) { - throw new UnsupportedOperationException("Not supported yet."); - } + public int nextIndex() { + if (this.hasNext()) + return incrementListPointer(cursor); + return list.size(); + } - public void add(E arg0) { - throw new UnsupportedOperationException("Not supported yet."); - } + public int previousIndex() { + if (this.hasPrevious()) + return decrementListPointer(cursor); + return -1; + } - } + public void remove() { + throw new UnsupportedOperationException("Not supported yet."); + } + + public void set(E arg0) { + throw new UnsupportedOperationException("Not supported yet."); + } + + public void add(E arg0) { + throw new UnsupportedOperationException("Not supported yet."); + } + + } } diff --git a/Mage/src/mage/util/Copier.java b/Mage/src/mage/util/Copier.java index 6b023ec7b2..613723ce17 100644 --- a/Mage/src/mage/util/Copier.java +++ b/Mage/src/mage/util/Copier.java @@ -41,13 +41,13 @@ import java.util.zip.GZIPOutputStream; */ public class Copier { - private static ClassLoader loader; + private static ClassLoader loader; - public static void setLoader(ClassLoader loader) { - Copier.loader = loader; - } + public static void setLoader(ClassLoader loader) { + Copier.loader = loader; + } - public T copy(T obj) { + public T copy(T obj) { T copy = null; try { FastByteArrayOutputStream fbos = new FastByteArrayOutputStream(); @@ -71,9 +71,9 @@ public class Copier { } return copy; - } + } - public byte[] copyCompressed(T obj) { + public byte[] copyCompressed(T obj) { try { FastByteArrayOutputStream fbos = new FastByteArrayOutputStream(); ObjectOutputStream out= new ObjectOutputStream(new GZIPOutputStream(fbos)); @@ -83,21 +83,21 @@ public class Copier { out.flush(); out.close(); - byte[] copy = new byte[fbos.getSize()]; + byte[] copy = new byte[fbos.getSize()]; System.arraycopy(fbos.getByteArray(), 0, copy, 0, fbos.getSize()); - return copy; + return copy; } catch(IOException e) { e.printStackTrace(); } return null; - } + } - public T uncompressCopy(byte[] buffer) { + public T uncompressCopy(byte[] buffer) { T copy = null; try { - ObjectInputStream in = new CopierObjectInputStream(loader, new GZIPInputStream(new ByteArrayInputStream(buffer))); - copy = (T) in.readObject(); + ObjectInputStream in = new CopierObjectInputStream(loader, new GZIPInputStream(new ByteArrayInputStream(buffer))); + copy = (T) in.readObject(); } catch(IOException e) { e.printStackTrace(); @@ -105,6 +105,6 @@ public class Copier { catch(ClassNotFoundException cnfe) { cnfe.printStackTrace(); } - return copy; - } + return copy; + } } diff --git a/Mage/src/mage/util/CopierObjectInputStream.java b/Mage/src/mage/util/CopierObjectInputStream.java index 0948247496..cb906e4f5c 100644 --- a/Mage/src/mage/util/CopierObjectInputStream.java +++ b/Mage/src/mage/util/CopierObjectInputStream.java @@ -46,12 +46,12 @@ public class CopierObjectInputStream extends ObjectInputStream { myLoader = newLoader; } - @Override + @Override protected Class resolveClass(ObjectStreamClass osc) throws IOException, ClassNotFoundException { Class theClass = null; - try { + try { theClass = Class.forName(osc.getName(), true, myLoader); } catch (Exception e) { diff --git a/Mage/src/mage/util/Copyable.java b/Mage/src/mage/util/Copyable.java index bb80fd01c7..eaa7bf9661 100644 --- a/Mage/src/mage/util/Copyable.java +++ b/Mage/src/mage/util/Copyable.java @@ -34,5 +34,5 @@ package mage.util; */ public interface Copyable { - public abstract T copy(); + public abstract T copy(); } diff --git a/Mage/src/mage/util/FastByteArrayInputStream.java b/Mage/src/mage/util/FastByteArrayInputStream.java index 6e540f3040..f2cc268174 100644 --- a/Mage/src/mage/util/FastByteArrayInputStream.java +++ b/Mage/src/mage/util/FastByteArrayInputStream.java @@ -54,17 +54,17 @@ public class FastByteArrayInputStream extends InputStream { this.count = count; } - @Override + @Override public final int available() { return count - pos; } - @Override + @Override public final int read() { return (pos < count) ? (buf[pos++] & 0xff) : -1; } - @Override + @Override public final int read(byte[] b, int off, int len) { if (pos >= count) return -1; @@ -77,7 +77,7 @@ public class FastByteArrayInputStream extends InputStream { return len; } - @Override + @Override public final long skip(long n) { if ((pos + n) > count) n = count - pos; diff --git a/Mage/src/mage/util/FastByteArrayOutputStream.java b/Mage/src/mage/util/FastByteArrayOutputStream.java index 98a33e185e..b0b695df10 100644 --- a/Mage/src/mage/util/FastByteArrayOutputStream.java +++ b/Mage/src/mage/util/FastByteArrayOutputStream.java @@ -82,21 +82,21 @@ public class FastByteArrayOutputStream extends OutputStream { return buf; } - @Override + @Override public final void write(byte b[]) { verifyBufferSize(size + b.length); System.arraycopy(b, 0, buf, size, b.length); size += b.length; } - @Override + @Override public final void write(byte b[], int off, int len) { verifyBufferSize(size + len); System.arraycopy(b, off, buf, size, len); size += len; } - @Override + @Override public final void write(int b) { verifyBufferSize(size + 1); buf[size++] = (byte) b; diff --git a/Mage/src/mage/util/Logging.java b/Mage/src/mage/util/Logging.java index 7b6b915c50..96441fce6e 100644 --- a/Mage/src/mage/util/Logging.java +++ b/Mage/src/mage/util/Logging.java @@ -46,57 +46,57 @@ import java.util.logging.Logger; */ public class Logging { - public static Logger getLogger(String name) { - Logger logger = Logger.getLogger(name); - ConsoleHandler handler = new ConsoleHandler(); - handler.setFormatter(new LogFormatter()); - logger.addHandler(handler); - logger.setUseParentHandlers(false); - return logger; - } + public static Logger getLogger(String name) { + Logger logger = Logger.getLogger(name); + ConsoleHandler handler = new ConsoleHandler(); + handler.setFormatter(new LogFormatter()); + logger.addHandler(handler); + logger.setUseParentHandlers(false); + return logger; + } - public static Level getLevel(Logger logger) { - Level level = logger.getLevel(); - while (level == null && logger.getParent() != null) { - logger = logger.getParent(); - level = logger.getLevel(); - } - return level; - } + public static Level getLevel(Logger logger) { + Level level = logger.getLevel(); + while (level == null && logger.getParent() != null) { + logger = logger.getParent(); + level = logger.getLevel(); + } + return level; + } } class LogFormatter extends Formatter { - private static final DateFormat df = new SimpleDateFormat("dd/MM/yyyy hh:mm:ss.SSS"); + private static final DateFormat df = new SimpleDateFormat("dd/MM/yyyy hh:mm:ss.SSS"); - @Override - public String format(LogRecord record) { + @Override + public String format(LogRecord record) { StringBuilder builder = new StringBuilder(1000); builder.append(df.format(new Date(record.getMillis()))).append(" - "); builder.append("[").append(record.getSourceClassName()).append("."); builder.append(record.getSourceMethodName()).append("] - "); builder.append("[").append(record.getLevel()).append("] - "); builder.append(formatMessage(record)); - if (record.getThrown() != null) { - try { - StringWriter sw = new StringWriter(); - PrintWriter pw = new PrintWriter(sw); - record.getThrown().printStackTrace(pw); - pw.close(); - builder.append(sw.toString()); - } catch (Exception ex) { - } - } + if (record.getThrown() != null) { + try { + StringWriter sw = new StringWriter(); + PrintWriter pw = new PrintWriter(sw); + record.getThrown().printStackTrace(pw); + pw.close(); + builder.append(sw.toString()); + } catch (Exception ex) { + } + } builder.append("\n"); return builder.toString(); } - @Override + @Override public String getHead(Handler h) { return super.getHead(h); } - @Override + @Override public String getTail(Handler h) { return super.getTail(h); } diff --git a/Mage/src/mage/util/TreeNode.java b/Mage/src/mage/util/TreeNode.java index d548c6fd73..7463b7addc 100644 --- a/Mage/src/mage/util/TreeNode.java +++ b/Mage/src/mage/util/TreeNode.java @@ -69,9 +69,9 @@ public class TreeNode { children.add(child); } - public void addChild(T child) { - children.add(new TreeNode(child)); - } + public void addChild(T child) { + children.add(new TreeNode(child)); + } public void addChildAt(int index, TreeNode child) throws IndexOutOfBoundsException { children.add(index, child); @@ -98,28 +98,28 @@ public class TreeNode { } @Override - public String toString() { + public String toString() { return getData().toString(); } @Override - public int hashCode() { + public int hashCode() { return getData().hashCode(); } - @Override - public boolean equals(Object obj) { - if (obj == null) { - return false; - } - if (getClass() != obj.getClass()) { - return false; - } - final TreeNode other = (TreeNode) obj; - if (this.data != other.data && (this.data == null || !this.data.equals(other.data))) { - return false; - } - return true; - } + @Override + public boolean equals(Object obj) { + if (obj == null) { + return false; + } + if (getClass() != obj.getClass()) { + return false; + } + final TreeNode other = (TreeNode) obj; + if (this.data != other.data && (this.data == null || !this.data.equals(other.data))) { + return false; + } + return true; + } } diff --git a/Mage/src/mage/util/functions/CopyFunction.java b/Mage/src/mage/util/functions/CopyFunction.java index f3567c5876..7e7b84bdac 100644 --- a/Mage/src/mage/util/functions/CopyFunction.java +++ b/Mage/src/mage/util/functions/CopyFunction.java @@ -38,58 +38,58 @@ import mage.game.permanent.Permanent; */ public class CopyFunction implements Function { - protected Card target; - protected Game game; + protected Card target; + protected Game game; - public CopyFunction(Card target) { - if (target == null) - throw new IllegalArgumentException("Target can't be null"); - this.target = target; - } + public CopyFunction(Card target) { + if (target == null) + throw new IllegalArgumentException("Target can't be null"); + this.target = target; + } - @Override - public Card apply(Card source) { - if (target == null) - throw new IllegalArgumentException("Target can't be null"); + @Override + public Card apply(Card source) { + if (target == null) + throw new IllegalArgumentException("Target can't be null"); - target.setName(source.getName()); - target.getColor().setColor(source.getColor()); - target.getManaCost().clear(); - target.getManaCost().add(source.getManaCost()); - target.getCardType().clear(); - for (Constants.CardType type : source.getCardType()) { - target.getCardType().add(type); - } - target.getSubtype().clear(); - for (String type : source.getSubtype()) { - target.getSubtype().add(type); - } - target.getSupertype().clear(); - for (String type : source.getSupertype()) { - target.getSupertype().add(type); - } - target.setExpansionSetCode(source.getExpansionSetCode()); - target.getAbilities().clear(); + target.setName(source.getName()); + target.getColor().setColor(source.getColor()); + target.getManaCost().clear(); + target.getManaCost().add(source.getManaCost()); + target.getCardType().clear(); + for (Constants.CardType type : source.getCardType()) { + target.getCardType().add(type); + } + target.getSubtype().clear(); + for (String type : source.getSubtype()) { + target.getSubtype().add(type); + } + target.getSupertype().clear(); + for (String type : source.getSupertype()) { + target.getSupertype().add(type); + } + target.setExpansionSetCode(source.getExpansionSetCode()); + target.getAbilities().clear(); - for (Ability ability0 : source.getAbilities()) { - Ability ability = ability0.copy(); - ability.newId(); - ability.setSourceId(target.getId()); - if(target instanceof Permanent) { - ((Permanent)target).addAbility(ability, game); - } else { - target.addAbility(ability); - } - } + for (Ability ability0 : source.getAbilities()) { + Ability ability = ability0.copy(); + ability.newId(); + ability.setSourceId(target.getId()); + if(target instanceof Permanent) { + ((Permanent)target).addAbility(ability, game); + } else { + target.addAbility(ability); + } + } - target.getPower().setValue(source.getPower().getValue()); - target.getToughness().setValue(source.getToughness().getValue()); + target.getPower().setValue(source.getPower().getValue()); + target.getToughness().setValue(source.getToughness().getValue()); - return target; - } + return target; + } - public Card from(Card source, Game game) { + public Card from(Card source, Game game) { this.game = game; - return apply(source); - } + return apply(source); + } } diff --git a/Mage/src/mage/util/functions/CopyTokenFunction.java b/Mage/src/mage/util/functions/CopyTokenFunction.java index f65345c75a..423f246731 100644 --- a/Mage/src/mage/util/functions/CopyTokenFunction.java +++ b/Mage/src/mage/util/functions/CopyTokenFunction.java @@ -37,52 +37,52 @@ import mage.game.permanent.token.Token; */ public class CopyTokenFunction implements Function { - protected Token target; + protected Token target; - public CopyTokenFunction(Token target) { - if (target == null) - throw new IllegalArgumentException("Target can't be null"); - this.target = target; - } + public CopyTokenFunction(Token target) { + if (target == null) + throw new IllegalArgumentException("Target can't be null"); + this.target = target; + } - @Override - public Token apply(Card source) { - if (target == null) - throw new IllegalArgumentException("Target can't be null"); + @Override + public Token apply(Card source) { + if (target == null) + throw new IllegalArgumentException("Target can't be null"); - target.setName(source.getName()); - target.getColor().setColor(source.getColor()); - target.getManaCost().clear(); - target.getManaCost().add(source.getManaCost()); - target.getCardType().clear(); - for (Constants.CardType type : source.getCardType()) { - target.getCardType().add(type); - } - target.getSubtype().clear(); - for (String type : source.getSubtype()) { - target.getSubtype().add(type); - } - target.getSupertype().clear(); - for (String type : source.getSupertype()) { - target.getSupertype().add(type); - } - //target.setExpansionSetCode(source.getExpansionSetCode()); - target.getAbilities().clear(); + target.setName(source.getName()); + target.getColor().setColor(source.getColor()); + target.getManaCost().clear(); + target.getManaCost().add(source.getManaCost()); + target.getCardType().clear(); + for (Constants.CardType type : source.getCardType()) { + target.getCardType().add(type); + } + target.getSubtype().clear(); + for (String type : source.getSubtype()) { + target.getSubtype().add(type); + } + target.getSupertype().clear(); + for (String type : source.getSupertype()) { + target.getSupertype().add(type); + } + //target.setExpansionSetCode(source.getExpansionSetCode()); + target.getAbilities().clear(); - for (Ability ability0 : source.getAbilities()) { - Ability ability = ability0.copy(); - ability.newId(); - ability.setSourceId(target.getId()); - target.addAbility(ability); - } + for (Ability ability0 : source.getAbilities()) { + Ability ability = ability0.copy(); + ability.newId(); + ability.setSourceId(target.getId()); + target.addAbility(ability); + } - target.getPower().setValue(source.getPower().getValue()); - target.getToughness().setValue(source.getToughness().getValue()); + target.getPower().setValue(source.getPower().getValue()); + target.getToughness().setValue(source.getToughness().getValue()); - return target; - } + return target; + } - public Token from(Card source) { - return apply(source); - } + public Token from(Card source) { + return apply(source); + } } diff --git a/Mage/src/mage/util/functions/Function.java b/Mage/src/mage/util/functions/Function.java index 88aa88e5eb..ec6886734e 100644 --- a/Mage/src/mage/util/functions/Function.java +++ b/Mage/src/mage/util/functions/Function.java @@ -31,5 +31,5 @@ package mage.util.functions; * @author nantuko */ public interface Function { - public X apply(Y in); + public X apply(Y in); } diff --git a/Mage/src/mage/watchers/Watcher.java b/Mage/src/mage/watchers/Watcher.java index 2a9afb6bf4..61cb902ef0 100644 --- a/Mage/src/mage/watchers/Watcher.java +++ b/Mage/src/mage/watchers/Watcher.java @@ -39,14 +39,14 @@ import mage.game.events.GameEvent; */ public interface Watcher> extends Serializable { - public UUID getControllerId(); - public void setControllerId(UUID controllerId); + public UUID getControllerId(); + public void setControllerId(UUID controllerId); public UUID getSourceId(); public void setSourceId(UUID sourceId); - public String getKey(); - public void watch(GameEvent event, Game game); - public boolean conditionMet(); - public void reset(); - - public abstract T copy(); + public String getKey(); + public void watch(GameEvent event, Game game); + public boolean conditionMet(); + public void reset(); + + public abstract T copy(); } diff --git a/Mage/src/mage/watchers/WatcherImpl.java b/Mage/src/mage/watchers/WatcherImpl.java index 814a7ac840..16f9db0f1f 100644 --- a/Mage/src/mage/watchers/WatcherImpl.java +++ b/Mage/src/mage/watchers/WatcherImpl.java @@ -39,47 +39,47 @@ import mage.Constants.WatcherScope; */ public abstract class WatcherImpl> implements Watcher { - protected UUID controllerId; + protected UUID controllerId; protected UUID sourceId; - protected String key; - protected boolean condition; + protected String key; + protected boolean condition; protected WatcherScope scope; public WatcherImpl(String key, WatcherScope scope) { - this.key = key; + this.key = key; this.scope = scope; - } + } - public WatcherImpl(final WatcherImpl watcher) { - this.condition = watcher.condition; - this.key = watcher.key; - this.controllerId = watcher.controllerId; + public WatcherImpl(final WatcherImpl watcher) { + this.condition = watcher.condition; + this.key = watcher.key; + this.controllerId = watcher.controllerId; this.sourceId = watcher.sourceId; this.scope = watcher.scope; - } + } - @Override - public UUID getControllerId() { - return controllerId; - } + @Override + public UUID getControllerId() { + return controllerId; + } - @Override - public void setControllerId(UUID controllerId) { - this.controllerId = controllerId; - } + @Override + public void setControllerId(UUID controllerId) { + this.controllerId = controllerId; + } @Override public UUID getSourceId() { return sourceId; } - + @Override public void setSourceId(UUID sourceId) { this.sourceId = sourceId; } - - @Override - public String getKey() { + + @Override + public String getKey() { switch (scope) { case GAME: return key; @@ -88,17 +88,17 @@ public abstract class WatcherImpl> implements Watcher { - + public Watchers() {} - + public Watchers(final Watchers watchers) { - for (Map.Entry entry: watchers.entrySet()) { - this.put(entry.getKey(), entry.getValue().copy()); - } + for (Map.Entry entry: watchers.entrySet()) { + this.put(entry.getKey(), entry.getValue().copy()); + } } - - public Watchers copy() { - return new Watchers(this); - } - + + public Watchers copy() { + return new Watchers(this); + } + public void add(Watcher watcher) { if (!this.containsKey(watcher.getKey())) this.put(watcher.getKey(), watcher); } - - public void watch(GameEvent event, Game game) { - for (Watcher watcher: this.values()) { - watcher.watch(event, game); - } - } - public void reset() { - for (Watcher watcher: this.values()) { - watcher.reset(); - } - } + public void watch(GameEvent event, Game game) { + for (Watcher watcher: this.values()) { + watcher.watch(event, game); + } + } + + public void reset() { + for (Watcher watcher: this.values()) { + watcher.reset(); + } + } // public void setSourceId(UUID sourceId) { -// for (Watcher watcher: this.values()) { -// watcher.setSourceId(sourceId); -// } +// for (Watcher watcher: this.values()) { +// watcher.setSourceId(sourceId); +// } // } // // public void setControllerId(UUID controllerId) { -// for (Watcher watcher: this.values()) { -// watcher.setControllerId(controllerId); -// } +// for (Watcher watcher: this.values()) { +// watcher.setControllerId(controllerId); +// } // } - + public Watcher get(String key, UUID id) { return this.get(id + key); } - -// public Watcher get(UUID controllerId, UUID sourceId, String key) { -// for (Watcher watcher: this) { -// if ((watcher.getControllerId() == null || watcher.getControllerId().equals(controllerId)) && watcher.getKey().equals(key) && watcher.getSourceId().equals(sourceId)) -// return watcher; -// } -// return null; -// } + +// public Watcher get(UUID controllerId, UUID sourceId, String key) { +// for (Watcher watcher: this) { +// if ((watcher.getControllerId() == null || watcher.getControllerId().equals(controllerId)) && watcher.getKey().equals(key) && watcher.getSourceId().equals(sourceId)) +// return watcher; +// } +// return null; +// } } diff --git a/Mage/src/mage/watchers/common/CastSpellLastTurnWatcher.java b/Mage/src/mage/watchers/common/CastSpellLastTurnWatcher.java index 94baa8e15b..b724d6d92c 100644 --- a/Mage/src/mage/watchers/common/CastSpellLastTurnWatcher.java +++ b/Mage/src/mage/watchers/common/CastSpellLastTurnWatcher.java @@ -60,7 +60,7 @@ public class CastSpellLastTurnWatcher extends WatcherImpl getAmountOfSpellsCastOnPrevTurn() { return amountOfSpellsCastOnPrevTurn; @@ -95,7 +95,7 @@ public class CastSpellLastTurnWatcher extends WatcherImpl getAmountOfSpellsCastOnCurrentTurn() { return amountOfSpellsCastOnCurrentTurn; } - + public int getSpellOrder(Spell spell) { int index = 0; for (UUID uuid : spellsCastThisTurnInOrder) { @@ -111,5 +111,5 @@ public class CastSpellLastTurnWatcher extends WatcherImpl { public List damagedCreatures = new ArrayList(); - + public DamagedByWatcher() { - super("DamagedByWatcher", WatcherScope.CARD); - } + super("DamagedByWatcher", WatcherScope.CARD); + } - public DamagedByWatcher(final DamagedByWatcher watcher) { - super(watcher); + public DamagedByWatcher(final DamagedByWatcher watcher) { + super(watcher); this.damagedCreatures = watcher.damagedCreatures; - } + } - @Override - public DamagedByWatcher copy() { - return new DamagedByWatcher(this); - } + @Override + public DamagedByWatcher copy() { + return new DamagedByWatcher(this); + } - @Override - public void watch(GameEvent event, Game game) { - if (event.getType() == EventType.DAMAGED_CREATURE) { + @Override + public void watch(GameEvent event, Game game) { + if (event.getType() == EventType.DAMAGED_CREATURE) { if (sourceId.equals(event.getSourceId()) && !damagedCreatures.contains(event.getTargetId())) { damagedCreatures.add(event.getTargetId()); } } - } - - @Override - public void reset() { - super.reset(); - damagedCreatures.clear(); - } + } + + @Override + public void reset() { + super.reset(); + damagedCreatures.clear(); + } } diff --git a/Mage/src/mage/watchers/common/LandfallWatcher.java b/Mage/src/mage/watchers/common/LandfallWatcher.java index 79b3900c2f..ed9e0a979f 100644 --- a/Mage/src/mage/watchers/common/LandfallWatcher.java +++ b/Mage/src/mage/watchers/common/LandfallWatcher.java @@ -13,29 +13,29 @@ import mage.watchers.WatcherImpl; */ public class LandfallWatcher extends WatcherImpl { - public LandfallWatcher() { - super("LandPlayed", Constants.WatcherScope.PLAYER); - } + public LandfallWatcher() { + super("LandPlayed", Constants.WatcherScope.PLAYER); + } - public LandfallWatcher(final LandfallWatcher watcher) { - super(watcher); - } + public LandfallWatcher(final LandfallWatcher watcher) { + super(watcher); + } - @Override - public LandfallWatcher copy() { - return new LandfallWatcher(this); - } + @Override + public LandfallWatcher copy() { + return new LandfallWatcher(this); + } - @Override - public void watch(GameEvent event, Game game) { + @Override + public void watch(GameEvent event, Game game) { if (condition == true) //no need to check - condition has already occured return; - if (event.getType() == GameEvent.EventType.ZONE_CHANGE && ((ZoneChangeEvent)event).getToZone() == Constants.Zone.BATTLEFIELD) { - Permanent permanent = game.getPermanent(event.getTargetId()); - if (permanent.getCardType().contains(Constants.CardType.LAND) && permanent.getControllerId().equals(this.controllerId)) { - condition = true; - } - } - } + if (event.getType() == GameEvent.EventType.ZONE_CHANGE && ((ZoneChangeEvent)event).getToZone() == Constants.Zone.BATTLEFIELD) { + Permanent permanent = game.getPermanent(event.getTargetId()); + if (permanent.getCardType().contains(Constants.CardType.LAND) && permanent.getControllerId().equals(this.controllerId)) { + condition = true; + } + } + } } diff --git a/Mage/src/mage/watchers/common/MorbidWatcher.java b/Mage/src/mage/watchers/common/MorbidWatcher.java index dfb2449abd..d1cf2e0137 100644 --- a/Mage/src/mage/watchers/common/MorbidWatcher.java +++ b/Mage/src/mage/watchers/common/MorbidWatcher.java @@ -50,7 +50,7 @@ public class MorbidWatcher extends WatcherImpl { public MorbidWatcher(final MorbidWatcher watcher) { super(watcher); } - + @Override public void watch(GameEvent event, Game game) { if (condition == true) //no need to check - condition has already occured @@ -67,5 +67,5 @@ public class MorbidWatcher extends WatcherImpl { public MorbidWatcher copy() { return new MorbidWatcher(this); } - + } diff --git a/Mage/src/mage/watchers/common/PlayerDamagedBySourceWatcher.java b/Mage/src/mage/watchers/common/PlayerDamagedBySourceWatcher.java index 90df3010ef..ec6bed5569 100644 --- a/Mage/src/mage/watchers/common/PlayerDamagedBySourceWatcher.java +++ b/Mage/src/mage/watchers/common/PlayerDamagedBySourceWatcher.java @@ -44,34 +44,34 @@ import mage.watchers.WatcherImpl; public class PlayerDamagedBySourceWatcher extends WatcherImpl { public List damageSources = new ArrayList(); - + public PlayerDamagedBySourceWatcher(UUID playerId) { - super("PlayerDamagedBySource", WatcherScope.PLAYER); + super("PlayerDamagedBySource", WatcherScope.PLAYER); setControllerId(playerId); - } + } - public PlayerDamagedBySourceWatcher(final PlayerDamagedBySourceWatcher watcher) { - super(watcher); + public PlayerDamagedBySourceWatcher(final PlayerDamagedBySourceWatcher watcher) { + super(watcher); this.damageSources = watcher.damageSources; - } + } - @Override - public PlayerDamagedBySourceWatcher copy() { - return new PlayerDamagedBySourceWatcher(this); - } + @Override + public PlayerDamagedBySourceWatcher copy() { + return new PlayerDamagedBySourceWatcher(this); + } - @Override - public void watch(GameEvent event, Game game) { - if (event.getType() == EventType.DAMAGED_PLAYER) { + @Override + public void watch(GameEvent event, Game game) { + if (event.getType() == EventType.DAMAGED_PLAYER) { if (event.getTargetId().equals(controllerId) && !damageSources.contains(event.getSourceId())) { damageSources.add(event.getSourceId()); } } - } - - @Override - public void reset() { - super.reset(); - damageSources.clear(); - } + } + + @Override + public void reset() { + super.reset(); + damageSources.clear(); + } } diff --git a/Utils/GathererCrawler/src/main/java/north/gatherercrawler/Main.java b/Utils/GathererCrawler/src/main/java/north/gatherercrawler/Main.java index 8d785e612a..5f7b516558 100644 --- a/Utils/GathererCrawler/src/main/java/north/gatherercrawler/Main.java +++ b/Utils/GathererCrawler/src/main/java/north/gatherercrawler/Main.java @@ -56,7 +56,7 @@ public class Main { } } } - + readCardsFromFile(); StringBuilder sb = new StringBuilder(); diff --git a/Utils/extract_in_wiki_format.pl b/Utils/extract_in_wiki_format.pl index af796182ac..93eced4fc6 100644 --- a/Utils/extract_in_wiki_format.pl +++ b/Utils/extract_in_wiki_format.pl @@ -44,45 +44,45 @@ close(DATA); open CARDS, "< added_cards.txt" or die; while () { - my $line = $_; - if ( $line =~/A Mage.Sets\\src\\mage\\sets\\(\w.*)\\(\w.*)\.java/ ) { - $cards_count++; - my $set = $1; - my $card = $2; - if (!exists($cards{$set})) { - $cards{$set} = []; - } - - push @{$cards{$set}}, $card; - } + my $line = $_; + if ( $line =~/A Mage.Sets\\src\\mage\\sets\\(\w.*)\\(\w.*)\.java/ ) { + $cards_count++; + my $set = $1; + my $card = $2; + if (!exists($cards{$set})) { + $cards{$set} = []; + } + + push @{$cards{$set}}, $card; + } } open REPORT, "> added_cards_in_wiki_format.txt"; print REPORT " * Added cards ($cards_count):\n"; foreach my $set (keys(%cards)) { if ($set ne "tokens") { - if (exists $knownSets{$set}) { - print REPORT " * $sets{$knownSets{$set}}: "; - } else { - print REPORT " $set: "; - } - my $first = 1; - foreach my $card (@{$cards{$set}}) { - if ($first == 0) { - print REPORT "; "; - } else { - $first = 0; - } - if ($cardsBySet{$knownSets{$set}}{$card}) { - print REPORT $cardsBySet{$knownSets{$set}}{$card}[0]; - } else { - #$card =~ s/([A-Z]{1}[a-z]+)/ $1/g; - #$card =~ s/A Ether/ AEther/g; - print "not processed: $sets{$knownSets{$set}} $card\n"; - } - } - print REPORT "\n"; - } + if (exists $knownSets{$set}) { + print REPORT " * $sets{$knownSets{$set}}: "; + } else { + print REPORT " $set: "; + } + my $first = 1; + foreach my $card (@{$cards{$set}}) { + if ($first == 0) { + print REPORT "; "; + } else { + $first = 0; + } + if ($cardsBySet{$knownSets{$set}}{$card}) { + print REPORT $cardsBySet{$knownSets{$set}}{$card}[0]; + } else { + #$card =~ s/([A-Z]{1}[a-z]+)/ $1/g; + #$card =~ s/A Ether/ AEther/g; + print "not processed: $sets{$knownSets{$set}} $card\n"; + } + } + print REPORT "\n"; + } } close REPORT; \ No newline at end of file diff --git a/Utils/gen-card.pl b/Utils/gen-card.pl index 01308fd7ac..ee60b4e705 100755 --- a/Utils/gen-card.pl +++ b/Utils/gen-card.pl @@ -105,7 +105,7 @@ if (!exists $cards{$cardName}) { # Check if card is already implemented foreach my $setName (keys %{$cards{$cardName}}) { - if (exists $knownSets{$setName}) { + if (exists $knownSets{$setName}) { my $fileName = "../Mage.Sets/src/mage/sets/" . $knownSets{$setName} . "/" . toCamelCase($cardName) . ".java"; if(-e $fileName) { die "$cardName is already implemented (set found in: $setName).\n"; @@ -128,7 +128,7 @@ if ($simpleOnly ne 'true') { } my $baseRarity = ''; foreach my $setName (keys %{$cards{$cardName}}) { - if (exists $knownSets{$setName}) { + if (exists $knownSets{$setName}) { my $fileName = "../Mage.Sets/src/mage/sets/" . $knownSets{$setName} . "/" . toCamelCase($cardName) . ".java"; my $result; @@ -144,26 +144,26 @@ foreach my $setName (keys %{$cards{$cardName}}) { $vars{'power'} = $cards{$cardName}{$setName}[6]; $vars{'toughness'} = $cards{$cardName}{$setName}[7]; - my @types; + my @types; $vars{'subType'} = ''; - my $type = $cards{$cardName}{$setName}[5]; - while ($type =~ m/([a-zA-Z]+)( )*/g) { + my $type = $cards{$cardName}{$setName}[5]; + while ($type =~ m/([a-zA-Z]+)( )*/g) { if (exists($cardTypes{$1})) { push(@types, $cardTypes{$1}); - } else { + } else { if (@types) { $vars{'subType'} .= "\n this.subtype.add(\"$1\");"; } else { $vars{'subType'} .= "\n this.supertype.add(\"$1\");"; } - } - } + } + } $vars{'type'} = join(', ', @types); my %colors; while ($vars{'manaCost'} =~ m/([BUGRW])/g) { $colors{$manaToColor{$1}} = 1; - } + } $vars{'colors'} = ''; foreach my $color (keys %colors) { @@ -246,5 +246,5 @@ foreach my $setName (keys %{$cards{$cardName}}) { close CARD; print "$vars{'set'}.$vars{'className'}\n"; - } + } } diff --git a/Utils/pick-convertor.pl b/Utils/pick-convertor.pl index 89a135ae75..7ccc4867cf 100644 --- a/Utils/pick-convertor.pl +++ b/Utils/pick-convertor.pl @@ -22,65 +22,65 @@ my $max; my $med; my $min; - + while () { - my $s = $_; - chomp $s; - if ($state == 0) { - if ($s eq "

") { - $state = 1; - next; - } - } elsif ($state == 1) { - if ($s =~//) { - $state = 2; - next; - } - } elsif ($state == 2) { - if ($s =~/>([\w ',]+)<\/a>/) { - $name = $1; - $state = 3; - next; - } - } elsif ($state == 3) { - if ($s =~//) { + $state = 2; + next; + } + } elsif ($state == 2) { + if ($s =~/>([\w ',]+)<\/a>/) { + $name = $1; + $state = 3; + next; + } + } elsif ($state == 3) { + if ($s =~/
") { + $state = 1; + next; + } + } elsif ($state == 1) { + if ($s =~/
$oldListFile"); diff --git a/pom.xml b/pom.xml index 01ed5357f5..544d7a5e25 100644 --- a/pom.xml +++ b/pom.xml @@ -1,8 +1,8 @@ - + 4.0.0 - + org.mage mage-root 0.8.6 @@ -30,7 +30,7 @@ Mage.Client Mage.Plugins Mage.Server.Plugins - Mage.Server.Console + Mage.Server.Console Mage.Tests Mage.Updater @@ -48,7 +48,7 @@ daily - + jboss-deprecated-repository-group JBoss Deprecated Maven Repository Group