Merge pull request #1 from magefree/master

Merge master into fork
This commit is contained in:
Cameron Miller 2015-06-22 12:27:19 +01:00
commit 938a0b085b
84 changed files with 1883 additions and 144 deletions

View file

@ -27,42 +27,140 @@
*/
/*
* ExileZoneDialog.java
* CardInfoWindowDialog.java
*
* Created on Feb 1, 2010, 3:00:35 PM
*/
package mage.client.dialog;
import java.awt.Point;
import java.beans.PropertyVetoException;
import java.util.UUID;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.swing.ImageIcon;
import javax.swing.SwingUtilities;
import static javax.swing.WindowConstants.DISPOSE_ON_CLOSE;
import mage.client.cards.BigCard;
import mage.client.util.Config;
import mage.client.util.SettingsManager;
import mage.client.util.gui.GuiDisplayUtil;
import mage.view.CardsView;
import mage.view.ExileView;
import mage.view.SimpleCardsView;
import org.mage.plugins.card.utils.impl.ImageManagerImpl;
/**
*
* @author BetaSteward_at_googlemail.com
*/
public class ExileZoneDialog extends MageDialog {
public class CardInfoWindowDialog extends MageDialog {
/** Creates new form ExileZoneDialog */
public ExileZoneDialog() {
public static enum ShowType { REVEAL, LOOKED_AT, EXILE, OTHER };
private ShowType showType;
private boolean positioned;
public CardInfoWindowDialog(ShowType showType, String name) {
this.title = name;
this.showType = showType;
this.positioned = false;
this.setDefaultCloseOperation(DISPOSE_ON_CLOSE);
initComponents();
this.setModal(false);
switch(this.showType) {
case LOOKED_AT:
this.setFrameIcon(new ImageIcon(ImageManagerImpl.getInstance().getLookedAtImage()));
this.setClosable(true);
break;
case REVEAL:
this.setFrameIcon(new ImageIcon(ImageManagerImpl.getInstance().getRevealedImage()));
this.setClosable(true);
break;
case EXILE:
this.setFrameIcon(new ImageIcon(ImageManagerImpl.getInstance().getExileImage()));
break;
default:
// no icon yet
}
this.setTitelBarToolTip(name);
}
public void cleanUp() {
cards.cleanUp();
}
public void loadCards(SimpleCardsView showCards, BigCard bigCard, UUID gameId) {
boolean changed = cards.loadCards(showCards, bigCard, gameId);
if (showCards.size() > 0) {
show();
if (changed) {
try {
if (!positioned) {
this.setIcon(false);
firstWindowPosition();
}
} catch (PropertyVetoException ex) {
Logger.getLogger(CardInfoWindowDialog.class.getName()).log(Level.SEVERE, null, ex);
}
}
}
else {
this.hideDialog();
}
}
public void loadCards(CardsView showCards, BigCard bigCard, UUID gameId) {
boolean changed = cards.loadCards(showCards, bigCard, gameId, null);
if (showCards.size() > 0) {
show();
if (changed) {
try {
if (!positioned) {
this.setIcon(false);
firstWindowPosition();
} else {
}
} catch (PropertyVetoException ex) {
Logger.getLogger(CardInfoWindowDialog.class.getName()).log(Level.SEVERE, null, ex);
}
}
}
else {
this.hideDialog();
}
}
private void firstWindowPosition() {
SwingUtilities.invokeLater(new Runnable() {
@Override
public void run() {
if (!positioned) {
int width = CardInfoWindowDialog.this.getWidth();
int height = CardInfoWindowDialog.this.getHeight();
if (width > 0 && height > 0) {
positioned = true;
Point centered = SettingsManager.getInstance().getComponentPosition(width, height);
int xPos = centered.x / 2;
int yPos = centered.y / 2;
CardInfoWindowDialog.this.setLocation(xPos, yPos);
GuiDisplayUtil.keepComponentInsideScreen(centered.x, centered.y, CardInfoWindowDialog.this);
CardInfoWindowDialog.this.show();
}
}
// ShowCardsDialog.this.setVisible(true);
}
});
}
public void loadCards(ExileView exile, BigCard bigCard, UUID gameId) {
this.title = exile.getName();
this.setTitelBarToolTip(exile.getName());
boolean changed = cards.loadCards(exile, bigCard, gameId, null);
if (exile.size() > 0) {
show();
@ -70,7 +168,7 @@ public class ExileZoneDialog extends MageDialog {
try {
this.setIcon(false);
} catch (PropertyVetoException ex) {
Logger.getLogger(ExileZoneDialog.class.getName()).log(Level.SEVERE, null, ex);
Logger.getLogger(CardInfoWindowDialog.class.getName()).log(Level.SEVERE, null, ex);
}
}
}

View file

@ -34,6 +34,16 @@
package mage.client.dialog;
import java.awt.Component;
import java.awt.Point;
import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;
import java.io.Serializable;
import java.util.Map;
import java.util.UUID;
import javax.swing.ImageIcon;
import javax.swing.JLayeredPane;
import javax.swing.SwingUtilities;
import mage.cards.CardDimensions;
import mage.client.MageFrame;
import mage.client.cards.BigCard;
@ -44,29 +54,29 @@ import mage.client.util.gui.GuiDisplayUtil;
import mage.view.CardsView;
import mage.view.SimpleCardsView;
import org.mage.card.arcane.CardPanel;
import javax.swing.*;
import java.awt.*;
import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;
import java.io.Serializable;
import java.util.Map;
import java.util.UUID;
import org.mage.plugins.card.utils.impl.ImageManagerImpl;
/**
* @author BetaSteward_at_googlemail.com
*/
public class ShowCardsDialog extends MageDialog implements MouseListener {
private boolean reloaded = false;
// remember if this dialog was already auto positioned, so don't do it after the first time
private boolean positioned;
/**
* Creates new form ShowCardsDialog
*/
public ShowCardsDialog() {
this.positioned = false;
this.setDefaultCloseOperation(DISPOSE_ON_CLOSE);
initComponents();
this.setModal(false);
}
public void cleanUp() {
@ -88,7 +98,6 @@ public class ShowCardsDialog extends MageDialog implements MouseListener {
}
public void loadCards(String name, CardsView showCards, BigCard bigCard, CardDimensions dimension, UUID gameId, boolean modal, Map<String, Serializable> options) {
this.reloaded = true;
this.title = name;
this.setTitelBarToolTip(name);
cardArea.loadCards(showCards, bigCard, dimension, gameId, this);
@ -106,7 +115,7 @@ public class ShowCardsDialog extends MageDialog implements MouseListener {
if (getParent() != MageFrame.getDesktop() /*|| this.isClosed*/) {
MageFrame.getDesktop().add(this, JLayeredPane.DEFAULT_LAYER);
}
pack();
pack();
this.revalidate();
this.repaint();
@ -115,26 +124,21 @@ public class ShowCardsDialog extends MageDialog implements MouseListener {
SwingUtilities.invokeLater(new Runnable() {
@Override
public void run() {
int width = ShowCardsDialog.this.getWidth();
int height = ShowCardsDialog.this.getWidth();
if (width > 0 && height > 0) {
Point centered = SettingsManager.getInstance().getComponentPosition(width, height);
ShowCardsDialog.this.setLocation(centered.x, centered.y);
GuiDisplayUtil.keepComponentInsideScreen(centered.x, centered.y, ShowCardsDialog.this);
if (!positioned) {
int width = ShowCardsDialog.this.getWidth();
int height = ShowCardsDialog.this.getHeight();
if (width > 0 && height > 0) {
Point centered = SettingsManager.getInstance().getComponentPosition(width, height);
ShowCardsDialog.this.setLocation(centered.x, centered.y);
positioned = true;
GuiDisplayUtil.keepComponentInsideScreen(centered.x, centered.y, ShowCardsDialog.this);
}
}
ShowCardsDialog.this.setVisible(true);
}
});
}
public boolean isReloaded() {
return this.reloaded;
}
public void clearReloaded() {
this.reloaded = false;
}
private void initComponents() {
cardArea = new CardArea();

View file

@ -50,6 +50,7 @@ import java.io.Serializable;
import java.util.ArrayList;
import java.util.Collection;
import java.util.HashMap;
import java.util.Iterator;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
@ -85,7 +86,8 @@ import mage.client.components.HoverButton;
import mage.client.components.MageComponents;
import mage.client.components.ext.dlg.DialogManager;
import mage.client.components.layout.RelativeLayout;
import mage.client.dialog.ExileZoneDialog;
import mage.client.dialog.CardInfoWindowDialog;
import mage.client.dialog.CardInfoWindowDialog.ShowType;
import mage.client.dialog.PickChoiceDialog;
import mage.client.dialog.PickNumberDialog;
import mage.client.dialog.PickPileDialog;
@ -143,9 +145,9 @@ public final class GamePanel extends javax.swing.JPanel {
private static final int X_PHASE_WIDTH = 55;
private static final int STACK_MIN_CARDS_OFFSET_Y = 7;
private final Map<UUID, PlayAreaPanel> players = new HashMap<>();
private final Map<UUID, ExileZoneDialog> exiles = new HashMap<>();
private final Map<String, ShowCardsDialog> revealed = new HashMap<>();
private final Map<String, ShowCardsDialog> lookedAt = new HashMap<>();
private final Map<UUID, CardInfoWindowDialog> exiles = new HashMap<>();
private final Map<String, CardInfoWindowDialog> revealed = new HashMap<>();
private final Map<String, CardInfoWindowDialog> lookedAt = new HashMap<>();
private final ArrayList<ShowCardsDialog> pickTarget = new ArrayList<>();
private UUID gameId;
private UUID playerId; // playerId of the player
@ -255,15 +257,15 @@ public final class GamePanel extends javax.swing.JPanel {
if (pickNumber != null) {
pickNumber.removeDialog();
}
for (ExileZoneDialog exileDialog: exiles.values()) {
for (CardInfoWindowDialog exileDialog: exiles.values()) {
exileDialog.cleanUp();
exileDialog.removeDialog();
}
for (ShowCardsDialog revealDialog: revealed.values()) {
for (CardInfoWindowDialog revealDialog: revealed.values()) {
revealDialog.cleanUp();
revealDialog.removeDialog();
}
for (ShowCardsDialog lookedAtDialog: lookedAt.values()) {
for (CardInfoWindowDialog lookedAtDialog: lookedAt.values()) {
lookedAtDialog.cleanUp();
lookedAtDialog.removeDialog();
}
@ -682,7 +684,7 @@ public final class GamePanel extends javax.swing.JPanel {
for (ExileView exile: game.getExile()) {
if (!exiles.containsKey(exile.getId())) {
ExileZoneDialog newExile = new ExileZoneDialog();
CardInfoWindowDialog newExile = new CardInfoWindowDialog(ShowType.EXILE, exile.getName());
exiles.put(exile.getId(), newExile);
MageFrame.getDesktop().add(newExile, JLayeredPane.MODAL_LAYER);
newExile.show();
@ -805,30 +807,53 @@ public final class GamePanel extends javax.swing.JPanel {
currentStep.setLocation(prevPoint.x - 15, prevPoint.y);
}
}
private void showRevealed(GameView game) {
for (RevealedView reveal: game.getRevealed()) {
if (!revealed.containsKey(reveal.getName())) {
ShowCardsDialog newReveal = new ShowCardsDialog();
revealed.put(reveal.getName(), newReveal);
}
revealed.get(reveal.getName()).loadCards("Revealed " + reveal.getName(), reveal.getCards(), bigCard, Config.dimensions, gameId, false);
for (RevealedView revealView: game.getRevealed()) {
handleGameInfoWindow(revealed, ShowType.REVEAL, revealView.getName(), revealView.getCards());
}
removeClosedCardInfoWindows(revealed);
}
private void showLookedAt(GameView game) {
for (ShowCardsDialog looked: lookedAt.values()) {
looked.clearReloaded();
for (LookedAtView lookedAtView: game.getLookedAt()) {
handleGameInfoWindow(lookedAt, ShowType.LOOKED_AT, lookedAtView.getName(), lookedAtView.getCards());
}
for (LookedAtView looked: game.getLookedAt()) {
if (!lookedAt.containsKey(looked.getName())) {
ShowCardsDialog newLookedAt = new ShowCardsDialog();
lookedAt.put(looked.getName(), newLookedAt);
removeClosedCardInfoWindows(lookedAt);
}
private void handleGameInfoWindow(Map<String, CardInfoWindowDialog> windowMap, ShowType showType, String name, LinkedHashMap cardsView) {
CardInfoWindowDialog cardInfoWindowDialog;
if (!windowMap.containsKey(name)) {
cardInfoWindowDialog = new CardInfoWindowDialog(showType, name);
windowMap.put(name, cardInfoWindowDialog);
MageFrame.getDesktop().add(cardInfoWindowDialog, JLayeredPane.MODAL_LAYER);
} else {
cardInfoWindowDialog = windowMap.get(name);
}
if (cardInfoWindowDialog != null && !cardInfoWindowDialog.isClosed()) {
switch(showType) {
case REVEAL:
cardInfoWindowDialog.loadCards((CardsView) cardsView, bigCard, gameId);
break;
case LOOKED_AT:
cardInfoWindowDialog.loadCards((SimpleCardsView) cardsView, bigCard, gameId);
break;
}
lookedAt.get(looked.getName()).loadCards("Looked at by " + looked.getName(), looked.getCards(), bigCard, Config.dimensions, gameId, false);
}
}
private void removeClosedCardInfoWindows(Map<String, CardInfoWindowDialog> windowMap) {
// Remove closed window objects from the maps
for (Iterator<Map.Entry<String, CardInfoWindowDialog>> iterator = windowMap.entrySet().iterator(); iterator.hasNext();) {
Map.Entry<String, CardInfoWindowDialog> entry = iterator.next();
if (entry.getValue().isClosed()) {
iterator.remove();
}
}
}
public void ask(String question, GameView gameView, int messageId) {
updateGame(gameView);
this.feedbackPanel.getFeedback(FeedbackMode.QUESTION, question, false, null, messageId);

View file

@ -75,21 +75,26 @@ public class GuiDisplayUtil {
Dimension screenDim = c.getToolkit().getScreenSize();
GraphicsConfiguration g = c.getGraphicsConfiguration();
if (g != null) {
Insets insets = c.getToolkit().getScreenInsets(g);
Insets insets = c.getToolkit().getScreenInsets(g);
boolean setLocation = false;
if (x + c.getWidth() > screenDim.width - insets.right) {
x = (screenDim.width - insets.right) - c.getWidth();
setLocation = true;
} else if (x < insets.left) {
x = insets.left;
setLocation = true;
}
if (y + c.getHeight() > screenDim.height - insets.bottom) {
y = (screenDim.height - insets.bottom) - c.getHeight();
setLocation = true;
} else if (y < insets.top) {
y = insets.top;
setLocation = true;
}
if (setLocation) {
c.setLocation(x, y);
}
c.setLocation(x, y);
} else {
System.out.println("GuiDisplayUtil::keepComponentInsideScreen -> no GraphicsConfiguration");
}

View file

@ -15,6 +15,9 @@ public interface ImageManager {
Image getTokenIconImage();
Image getTriggeredAbilityImage();
Image getActivatedAbilityImage();
Image getLookedAtImage();
Image getRevealedImage();
Image getExileImage();
Image getCopyInformIconImage();
Image getCounterImageViolet();
Image getCounterImageRed();

View file

@ -110,6 +110,33 @@ public class ImageManagerImpl implements ImageManager {
return imageTokenIcon;
}
@Override
public Image getLookedAtImage() {
if (lookedAtIcon == null) {
Image image = getImageFromResourceTransparent("/game/looked_at.png", Color.WHITE, new Rectangle(20, 20));
lookedAtIcon = BufferedImageBuilder.bufferImage(image, BufferedImage.TYPE_INT_ARGB);
}
return lookedAtIcon;
}
@Override
public Image getRevealedImage() {
if (revealedIcon == null) {
Image image = getImageFromResourceTransparent("/game/revealed.png", Color.WHITE, new Rectangle(20, 20));
revealedIcon = BufferedImageBuilder.bufferImage(image, BufferedImage.TYPE_INT_ARGB);
}
return revealedIcon;
}
@Override
public Image getExileImage() {
if (exileIcon == null) {
Image image = getImageFromResourceTransparent("/info/exile.png", Color.WHITE, new Rectangle(20, 20));
exileIcon = BufferedImageBuilder.bufferImage(image, BufferedImage.TYPE_INT_ARGB);
}
return exileIcon;
}
@Override
public BufferedImage getTriggeredAbilityImage() {
if (triggeredAbilityIcon == null) {
@ -374,6 +401,9 @@ public class ImageManagerImpl implements ImageManager {
private static BufferedImage imageTokenIcon;
private static BufferedImage triggeredAbilityIcon;
private static BufferedImage activatedAbilityIcon;
private static BufferedImage lookedAtIcon;
private static BufferedImage revealedIcon;
private static BufferedImage exileIcon;
private static BufferedImage imageCopyIcon;
private static BufferedImage imageCounterGreen;
private static BufferedImage imageCounterGrey;

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 KiB

View file

@ -255,7 +255,6 @@ public class GameSessionPlayer extends GameSessionWatcher {
list.add(new LookedAtView(entry.getKey(), entry.getValue(), game));
}
gameView.setLookedAt(list);
game.getState().clearLookedAt(playerId);
return gameView;
}

View file

@ -43,7 +43,7 @@ import mage.filter.predicate.permanent.ControllerPredicate;
/**
*
* @author anonymous
* @author ilcartographer
*/
public class CitanulDruid extends CardImpl {
private static final FilterArtifactSpell filter = new FilterArtifactSpell();

View file

@ -32,7 +32,7 @@ import mage.constants.Rarity;
/**
*
* @author anonymous
* @author ilcartographer
*/
public class Onulet extends mage.sets.mastersedition.Onulet {

View file

@ -31,7 +31,7 @@ import java.util.UUID;
/**
*
* @author anonymous
* @author ilcartographer
*/
public class StaffOfZegon extends mage.sets.masterseditioniv.StaffOfZegon {

View file

@ -40,7 +40,9 @@ import mage.constants.CardType;
import mage.constants.Rarity;
import mage.constants.SetTargetPointer;
import mage.constants.TargetController;
import mage.filter.FilterPermanent;
import mage.filter.common.FilterCreaturePermanent;
import mage.filter.common.FilterNonlandPermanent;
import mage.filter.predicate.mageobject.SubtypePredicate;
import mage.filter.predicate.permanent.ControllerPredicate;
import mage.target.TargetPermanent;
@ -51,13 +53,13 @@ import mage.target.TargetPermanent;
*/
public class OjutaiSoulOfWinter extends CardImpl {
private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("Dragon you control");
private static final FilterCreaturePermanent filterPermanent = new FilterCreaturePermanent("permanent an opponent controls");
private static final FilterCreaturePermanent filterDragon = new FilterCreaturePermanent("Dragon you control");
private static final FilterPermanent filterNonlandPermanent = new FilterNonlandPermanent("nonland permanent an opponent controls");
static {
filter.add(new SubtypePredicate("Dragon"));
filter.add(new ControllerPredicate(TargetController.YOU));
filterPermanent.add(new ControllerPredicate(TargetController.OPPONENT));
filterDragon.add(new SubtypePredicate("Dragon"));
filterDragon.add(new ControllerPredicate(TargetController.YOU));
filterNonlandPermanent.add(new ControllerPredicate(TargetController.OPPONENT));
}
public OjutaiSoulOfWinter(UUID ownerId) {
@ -75,9 +77,9 @@ public class OjutaiSoulOfWinter extends CardImpl {
// Whenever a Dragon you control attacks, tap target nonland permanent an opponent controls. That permanent doesn't untap during its controller's next untap step.
Ability ability = new AttacksAllTriggeredAbility(
new TapTargetEffect(),
false, filter, SetTargetPointer.NONE, false);
false, filterDragon, SetTargetPointer.NONE, false);
ability.addEffect(new DontUntapInControllersNextUntapStepTargetEffect("That permanent"));
ability.addTarget(new TargetPermanent(filterPermanent));
ability.addTarget(new TargetPermanent(filterNonlandPermanent));
this.addAbility(ability);
}

View file

@ -31,7 +31,7 @@ import java.util.UUID;
/**
*
* @author anonymous
* @author ilcartographer
*/
public class PhantasmalForces extends mage.sets.fourthedition.PhantasmalForces {

View file

@ -32,7 +32,7 @@ import mage.constants.Rarity;
/**
*
* @author anonymous
* @author ilcartographer
*/
public class Onulet extends mage.sets.mastersedition.Onulet {

View file

@ -40,7 +40,7 @@ import mage.constants.TargetController;
/**
*
* @author anonymous
* @author ilcartographer
*/
public class PhantasmalForces extends CardImpl {

View file

@ -0,0 +1,52 @@
/*
* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* The views and conclusions contained in the software and documentation are those of the
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of BetaSteward_at_googlemail.com.
*/
package mage.sets.guildpact;
import java.util.UUID;
/**
*
* @author ilcartographer
*/
public class RevenantPatriarch extends mage.sets.sorinvstibalt.RevenantPatriarch {
public RevenantPatriarch(UUID ownerId) {
super(ownerId);
this.cardNumber = 59;
this.expansionSetCode = "GPT";
}
public RevenantPatriarch(final RevenantPatriarch card) {
super(card);
}
@Override
public RevenantPatriarch copy() {
return new RevenantPatriarch(this);
}
}

View file

@ -41,7 +41,7 @@ import mage.filter.predicate.mageobject.AbilityPredicate;
/**
*
* @author anonymous
* @author ilcartographer
*/
public class SerraAviary extends CardImpl {

View file

@ -31,18 +31,20 @@ import java.util.UUID;
import mage.MageObject;
import mage.abilities.Ability;
import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.effects.ContinuousEffectImpl;
import mage.abilities.effects.ReplacementEffectImpl;
import mage.cards.Card;
import mage.cards.CardImpl;
import mage.cards.CardsImpl;
import mage.constants.CardType;
import mage.constants.Duration;
import mage.constants.Layer;
import mage.constants.Outcome;
import mage.constants.Rarity;
import mage.constants.SubLayer;
import mage.constants.Zone;
import mage.game.Game;
import mage.game.events.GameEvent;
import mage.game.events.GameEvent.EventType;
import mage.players.Player;
import mage.players.PlayerList;
@ -56,8 +58,8 @@ public class ZursWeirding extends CardImpl {
super(ownerId, 112, "Zur's Weirding", Rarity.RARE, new CardType[]{CardType.ENCHANTMENT}, "{3}{U}");
this.expansionSetCode = "ICE";
// Players play with their hands revealed.
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new PlayerRevealHandCardsEffect()));
// If a player would draw a card, he or she reveals it instead. Then any other player may pay 2 life. If a player does, put that card into its owner's graveyard. Otherwise, that player draws a card.
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new ZursWeirdingReplacementEffect()));
@ -97,32 +99,32 @@ class ZursWeirdingReplacementEffect extends ReplacementEffectImpl {
@Override
public boolean replaceEvent(GameEvent event, Ability source, Game game) {
Player player = game.getPlayer(event.getTargetId());
MageObject sourceObject = game.getObject(source.getSourceId());
if (player != null) {
MageObject sourceObject = source.getSourceObject(game);
if (player != null && sourceObject != null) {
Card card = player.getLibrary().getFromTop(game);
if (card != null) {
// reveals it instead
player.revealCards(sourceObject != null ? sourceObject.getName() : null, new CardsImpl(card), game);
player.revealCards(sourceObject.getIdName() + " next draw of " + player.getName() + " (" + game.getTurnNum()+"|"+game.getPhase().getType() +")", new CardsImpl(card), game);
// Then any other player may pay 2 life. If a player does, put that card into its owner's graveyard
PlayerList playerList = game.getPlayerList().copy();
playerList.setCurrent(player.getId());
Player currentPlayer = playerList.getNext(game);
String message = new StringBuilder("Pay 2 life to put ").append(card.getName()).append(" into graveyard?").toString();
String message = new StringBuilder("Pay 2 life to put ").append(card.getLogName()).append(" into graveyard?").toString();
while (!currentPlayer.getId().equals(player.getId())) {
if (currentPlayer.canPayLifeCost() &&
currentPlayer.getLife() >= 2 &&
currentPlayer.chooseUse(Outcome.Benefit, message, game)) {
currentPlayer.loseLife(2, game);
player.moveCards(card, Zone.LIBRARY, Zone.GRAVEYARD, source, game);
game.getState().getRevealed().reset();
// game.getState().getRevealed().reset();
return true;
}
currentPlayer = playerList.getNext(game);
}
game.getState().getRevealed().reset();
// game.getState().getRevealed().reset();
}
}
return false;
@ -138,3 +140,35 @@ class ZursWeirdingReplacementEffect extends ReplacementEffectImpl {
}
}
class PlayerRevealHandCardsEffect extends ContinuousEffectImpl {
public PlayerRevealHandCardsEffect() {
super(Duration.WhileOnBattlefield, Layer.PlayerEffects, SubLayer.NA, Outcome.Detriment);
staticText = "Players play with their hands revealed";
}
public PlayerRevealHandCardsEffect(final PlayerRevealHandCardsEffect effect) {
super(effect);
}
@Override
public boolean apply(Game game, Ability source) {
Player controller = game.getPlayer(source.getControllerId());
if (controller != null) {
for (UUID playerID : controller.getInRange()) {
Player player = game.getPlayer(playerID);
if (player != null) {
player.revealCards(player.getName() + "'s hand cards", player.getHand(), game, false);
}
}
return true;
}
return false;
}
@Override
public PlayerRevealHandCardsEffect copy() {
return new PlayerRevealHandCardsEffect(this);
}
}

View file

@ -0,0 +1,111 @@
/*
* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* The views and conclusions contained in the software and documentation are those of the
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of BetaSteward_at_googlemail.com.
*/
package mage.sets.judgment;
import java.util.UUID;
import mage.abilities.Ability;
import mage.abilities.effects.OneShotEffect;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Outcome;
import mage.constants.Rarity;
import mage.filter.common.FilterCreaturePermanent;
import mage.game.Game;
import mage.game.permanent.Permanent;
import mage.game.stack.Spell;
import mage.game.stack.StackObject;
import mage.players.Player;
/**
*
* @author ilcartographer
*/
public class BreakingPoint extends CardImpl {
public BreakingPoint(UUID ownerId) {
super(ownerId, 81, "Breaking Point", Rarity.RARE, new CardType[]{CardType.SORCERY}, "{1}{R}{R}");
this.expansionSetCode = "JUD";
// Any player may have Breaking Point deal 6 damage to him or her. If no one does, destroy all creatures. Creatures destroyed this way can't be regenerated.
this.getSpellAbility().addEffect(new BreakingPointDestroyEffect());
}
public BreakingPoint(final BreakingPoint card) {
super(card);
}
@Override
public BreakingPoint copy() {
return new BreakingPoint(this);
}
}
class BreakingPointDestroyEffect extends OneShotEffect {
public BreakingPointDestroyEffect() {
super(Outcome.Benefit);
this.staticText = "Any player may have Breaking Point deal 6 damage to him or her. If no one does, destroy all creatures. Creatures destroyed this way can't be regenerated.";
}
public BreakingPointDestroyEffect(final BreakingPointDestroyEffect effect) {
super(effect);
}
@Override
public BreakingPointDestroyEffect copy() {
return new BreakingPointDestroyEffect(this);
}
@Override
public boolean apply(Game game, Ability source) {
StackObject spell = null;
for(StackObject object : game.getStack()){
if(object instanceof Spell && object.getSourceId().equals(source.getSourceId())){
spell = object;
}
}
if(spell != null){
boolean destroyCreatures = true;
for(UUID uuid : game.getPlayerList()){
Player player = game.getPlayer(uuid);
if(player != null && player.chooseUse(Outcome.Detriment, "Have " + spell.getName() + " deal 6 damage to you?", game)){
destroyCreatures = false;
player.damage(6, source.getSourceId(), game, false, true);
game.informPlayers(player.getLogName() + " has " + spell.getName() + " deal 6 to him or her");
}
}
if (destroyCreatures) {
for (Permanent permanent : game.getBattlefield().getActivePermanents(new FilterCreaturePermanent("creatures"), source.getControllerId(), source.getSourceId(), game)) {
permanent.destroy(source.getSourceId(), game, true);
}
}
return destroyCreatures;
}
return false;
}
}

View file

@ -37,7 +37,7 @@ import mage.filter.predicate.mageobject.SubtypePredicate;
/**
*
* @author anonymous
* @author ilcartographer
*/
public class AcidRain extends CardImpl {

View file

@ -44,7 +44,7 @@ import mage.target.common.TargetCreaturePermanent;
/**
*
* @author anonymous
* @author ilcartographer
*/
public class HornOfDeafening extends CardImpl {

View file

@ -0,0 +1,52 @@
/*
* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* The views and conclusions contained in the software and documentation are those of the
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of BetaSteward_at_googlemail.com.
*/
package mage.sets.legions;
import java.util.UUID;
/**
*
* @author ilcartographer
*/
public class LavabornMuse extends mage.sets.sorinvstibalt.LavabornMuse {
public LavabornMuse(UUID ownerId) {
super(ownerId);
this.cardNumber = 105;
this.expansionSetCode = "LGN";
}
public LavabornMuse(final LavabornMuse card) {
super(card);
}
@Override
public LavabornMuse copy() {
return new LavabornMuse(this);
}
}

View file

@ -31,7 +31,7 @@ import java.util.UUID;
/**
*
* @author anonymous
* @author ilcartographer
*/
public class PhantasmalForces extends mage.sets.fourthedition.PhantasmalForces {

View file

@ -31,7 +31,7 @@ import java.util.UUID;
/**
*
* @author anonymous
* @author ilcartographer
*/
public class SedgeTroll extends mage.sets.masterseditioniv.SedgeTroll {

View file

@ -31,7 +31,7 @@ import java.util.UUID;
/**
*
* @author anonymous
* @author ilcartographer
*/
public class PhantasmalForces extends mage.sets.fourthedition.PhantasmalForces {

View file

@ -31,7 +31,7 @@ import java.util.UUID;
/**
*
* @author anonymous
* @author ilcartographer
*/
public class SedgeTroll extends mage.sets.masterseditioniv.SedgeTroll {

View file

@ -0,0 +1,115 @@
/*
* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* The views and conclusions contained in the software and documentation are those of the
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of BetaSteward_at_googlemail.com.
*/
package mage.sets.lorwyn;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.SimpleActivatedAbility;
import mage.abilities.costs.mana.ManaCostsImpl;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.keyword.ChangelingAbility;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Duration;
import mage.constants.Outcome;
import mage.constants.Rarity;
import mage.constants.Zone;
import mage.filter.FilterPermanent;
import mage.filter.predicate.mageobject.SubtypePredicate;
import mage.game.Game;
import mage.game.permanent.Permanent;
import mage.target.TargetPermanent;
import mage.target.common.TargetCreaturePermanent;
import mage.util.functions.EmptyApplyToPermanent;
/**
* @author duncant
*/
public class Shapesharer extends CardImpl {
private static final FilterPermanent filterShapeshifter = new FilterPermanent("Shapeshifter");
static {
filterShapeshifter.add(new SubtypePredicate("Shapeshifter"));
}
public Shapesharer(UUID ownerId) {
super(ownerId, 85, "Shapesharer", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{1}{U}");
this.expansionSetCode = "LRW";
this.subtype.add("Shapeshifter");
this.power = new MageInt(1);
this.toughness = new MageInt(1);
this.addAbility(ChangelingAbility.getInstance());
// {2}{U}: Target Shapeshifter becomes a copy of target creature until your next turn.
Ability copyAbility = new SimpleActivatedAbility(Zone.BATTLEFIELD,
new ShapesharerEffect(),
new ManaCostsImpl("{2}{U}"));
copyAbility.addTarget(new TargetPermanent(filterShapeshifter));
copyAbility.addTarget(new TargetCreaturePermanent());
this.addAbility(copyAbility);
}
public Shapesharer(final Shapesharer card) {
super(card);
}
@Override
public Shapesharer copy() {
return new Shapesharer(this);
}
}
class ShapesharerEffect extends OneShotEffect {
public ShapesharerEffect() {
super(Outcome.Copy);
this.staticText = "Target Shapeshifter becomes a copy of target creature until your next turn.";
}
public ShapesharerEffect(final ShapesharerEffect effect) {
super(effect);
}
@Override
public ShapesharerEffect copy() {
return new ShapesharerEffect(this);
}
@Override
public boolean apply(Game game, Ability ability) {
Permanent copyTo = game.getPermanent(ability.getFirstTarget());
if (copyTo != null) {
Permanent copyFrom = game.getPermanentOrLKIBattlefield(ability.getTargets().get(1).getFirstTarget());
game.copyPermanent(Duration.EndOfTurn, copyFrom, copyTo, ability, new EmptyApplyToPermanent());
}
return true;
}
}

View file

@ -30,7 +30,7 @@ package mage.sets.magic2014;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.EntersBattlefieldAllTriggeredAbility;
import mage.abilities.common.EntersBattlefieldControlledTriggeredAbility;
import mage.abilities.common.SimpleActivatedAbility;
import mage.abilities.costs.mana.ManaCostsImpl;
import mage.abilities.dynamicvalue.DynamicValue;
@ -78,7 +78,7 @@ public class ScourgeOfValkas extends CardImpl {
// Whenever Scourge of Valkas or another Dragon enters the battlefield under your control, it deals X damage to target creature or player, where X is the number of Dragons you control.
DynamicValue dragons = new PermanentsOnBattlefieldCount(filter2);
Ability ability = new EntersBattlefieldAllTriggeredAbility(Zone.BATTLEFIELD, new DamageTargetEffect(dragons), filter, false, rule);
Ability ability = new EntersBattlefieldControlledTriggeredAbility(Zone.BATTLEFIELD, new DamageTargetEffect(dragons), filter, false, rule);
ability.addTarget(new TargetCreatureOrPlayer());
this.addAbility(ability);

View file

@ -37,7 +37,7 @@ import mage.constants.Rarity;
/**
*
* @author anonymous
* @author ilcartographer
*/
public class Onulet extends CardImpl {

View file

@ -31,7 +31,7 @@ import java.util.UUID;
/**
*
* @author anonymous
* @author ilcartographer
*/
public class AcidRain extends mage.sets.legends.AcidRain {

View file

@ -32,7 +32,7 @@ import mage.constants.Rarity;
/**
*
* @author anonymous
* @author ilcartographer
*/
public class AlluringScent extends mage.sets.portal.AlluringScent {

View file

@ -31,7 +31,7 @@ import java.util.UUID;
/**
*
* @author anonymous
* @author ilcartographer
*/
public class BeeSting extends mage.sets.portal.BeeSting {

View file

@ -32,7 +32,7 @@ import mage.constants.Rarity;
/**
*
* @author anonymous
* @author ilcartographer
*/
public class CitanulDruid extends mage.sets.antiquities.CitanulDruid {

View file

@ -37,7 +37,7 @@ import mage.constants.Rarity;
/**
*
* @author anonymous
* @author ilcartographer
*/
public class CloudDragon extends CardImpl {

View file

@ -31,7 +31,7 @@ import java.util.UUID;
/**
*
* @author anonymous
* @author ilcartographer
*/
public class FireTempest extends mage.sets.portal.FireTempest {

View file

@ -32,7 +32,7 @@ import mage.constants.Rarity;
/**
*
* @author anonymous
* @author ilcartographer
*/
public class HornOfDeafening extends mage.sets.legends.HornOfDeafening {

View file

@ -32,7 +32,7 @@ import mage.constants.Rarity;
/**
*
* @author anonymous
* @author ilcartographer
*/
public class IronhoofOx extends mage.sets.portalsecondage.IronhoofOx {

View file

@ -32,7 +32,7 @@ import mage.constants.Rarity;
/**
*
* @author anonymous
* @author ilcartographer
*/
public class LavaFlow extends mage.sets.portal.LavaFlow {

View file

@ -31,7 +31,7 @@ import java.util.UUID;
/**
*
* @author anonymous
* @author ilcartographer
*/
public class Onulet extends mage.sets.mastersedition.Onulet {

View file

@ -32,7 +32,7 @@ import mage.constants.Rarity;
/**
*
* @author anonymous
* @author ilcartographer
*/
public class PhantasmalForces extends mage.sets.fourthedition.PhantasmalForces {

View file

@ -43,7 +43,7 @@ import mage.filter.predicate.mageobject.SubtypePredicate;
/**
*
* @author anonymous
* @author ilcartographer
*/
public class SedgeTroll extends CardImpl {

View file

@ -32,7 +32,7 @@ import mage.constants.Rarity;
/**
*
* @author anonymous
* @author ilcartographer
*/
public class SerraAviary extends mage.sets.homelands.SerraAviary {

View file

@ -42,7 +42,7 @@ import mage.target.common.TargetCreaturePermanent;
/**
*
* @author anonymous
* @author ilcartographer
*/
public class StaffOfZegon extends CardImpl {

View file

@ -0,0 +1,61 @@
/*
* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* The views and conclusions contained in the software and documentation are those of the
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of BetaSteward_at_googlemail.com.
*/
package mage.sets.odyssey;
import java.util.UUID;
import mage.abilities.effects.common.ExileTargetEffect;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Rarity;
import mage.filter.FilterCard;
import mage.target.common.TargetCardInASingleGraveyard;
/**
*
* @author ilcartographer
*/
public class Decompose extends CardImpl {
public Decompose(UUID ownerId) {
super(ownerId, 128, "Decompose", Rarity.UNCOMMON, new CardType[]{CardType.SORCERY}, "{1}{B}");
this.expansionSetCode = "ODY";
// Exile up to three target cards from a single graveyard.
this.getSpellAbility().addEffect(new ExileTargetEffect());
this.getSpellAbility().addTarget(new TargetCardInASingleGraveyard(0, 3, new FilterCard("cards")));
}
public Decompose(final Decompose card) {
super(card);
}
@Override
public Decompose copy() {
return new Decompose(this);
}
}

View file

@ -0,0 +1,135 @@
/*
* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* The views and conclusions contained in the software and documentation are those of the
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of BetaSteward_at_googlemail.com.
*/
package mage.sets.onslaught;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
import java.util.UUID;
import mage.MageObject;
import mage.abilities.Ability;
import mage.abilities.effects.OneShotEffect;
import mage.cards.Card;
import mage.cards.CardImpl;
import mage.cards.repository.CardRepository;
import mage.choices.Choice;
import mage.choices.ChoiceImpl;
import mage.constants.CardType;
import mage.constants.Outcome;
import mage.constants.Rarity;
import mage.constants.Zone;
import mage.filter.FilterCard;
import mage.filter.common.FilterCreatureCard;
import mage.filter.predicate.Predicates;
import mage.filter.predicate.mageobject.SubtypePredicate;
import mage.game.Game;
import mage.players.Player;
/**
* @author duncant
*/
public class PatriarchsBidding extends CardImpl {
public PatriarchsBidding(UUID ownerId) {
super(ownerId, 161, "Patriarch's Bidding", Rarity.RARE, new CardType[]{CardType.SORCERY}, "{3}{B}{B}");
this.expansionSetCode = "ONS";
// Each player chooses a creature type. Each player returns all creature cards of a type chosen this way from his or her graveyard to the battlefield.
this.getSpellAbility().addEffect(new PatriarchsBiddingEffect());
}
public PatriarchsBidding(final PatriarchsBidding card) {
super(card);
}
@Override
public PatriarchsBidding copy() {
return new PatriarchsBidding(this);
}
}
class PatriarchsBiddingEffect extends OneShotEffect {
public PatriarchsBiddingEffect() {
super(Outcome.PutCreatureInPlay);
this.staticText = "Each player chooses a creature type. Each player returns all creature cards of a type chosen this way from his or her graveyard to the battlefield.";
}
public PatriarchsBiddingEffect(final PatriarchsBiddingEffect effect) {
super(effect);
}
@Override
public PatriarchsBiddingEffect copy() {
return new PatriarchsBiddingEffect(this);
}
@Override
public boolean apply(Game game, Ability ability) {
Player controller = game.getPlayer(ability.getControllerId());
MageObject sourceObject = game.getObject(ability.getSourceId());
if (controller != null) {
Set<String> chosenTypes = new HashSet<>();
for (UUID playerId : controller.getInRange()) {
Player player = game.getPlayer(playerId);
Choice typeChoice = new ChoiceImpl(true);
typeChoice.setMessage("Choose a creature type");
typeChoice.setChoices(CardRepository.instance.getCreatureTypes());
while (!player.choose(Outcome.PutCreatureInPlay, typeChoice, game)) {
if (!player.isInGame()) {
break;
}
}
String chosenType = typeChoice.getChoice();
if (chosenType != null) {
game.informPlayers(sourceObject.getName() + ": " + player.getLogName() + " has chosen " + chosenType);
chosenTypes.add(chosenType);
}
}
List<SubtypePredicate> predicates = new ArrayList<>();
for (String type : chosenTypes) {
predicates.add(new SubtypePredicate(type));
}
FilterCard filter = new FilterCreatureCard();
filter.add(Predicates.or(predicates));
for (UUID playerId : controller.getInRange()) {
Player player = game.getPlayer(playerId);
if (player != null) {
for (Card card : player.getGraveyard().getCards(filter, game)) {
player.putOntoBattlefieldWithInfo(card, game, Zone.GRAVEYARD, ability.getSourceId());
}
}
}
return true;
}
return false;
}
}

View file

@ -37,7 +37,7 @@ import mage.target.common.TargetCreaturePermanent;
/**
*
* @author anonymous
* @author ilcartographer
*/
public class AlluringScent extends CardImpl {

View file

@ -36,7 +36,7 @@ import mage.target.common.TargetCreatureOrPlayer;
/**
*
* @author anonymous
* @author ilcartographer
*/
public class BeeSting extends CardImpl {

View file

@ -31,7 +31,7 @@ import java.util.UUID;
/**
*
* @author anonymous
* @author ilcartographer
*/
public class CloudDragon extends mage.sets.masterseditioniv.CloudDragon {

View file

@ -35,7 +35,7 @@ import mage.constants.Rarity;
/**
*
* @author anonymous
* @author ilcartographer
*/
public class FireTempest extends CardImpl {

View file

@ -40,7 +40,7 @@ import mage.target.TargetPermanent;
/**
*
* @author anonymous
* @author ilcartographer
*/
public class LavaFlow extends CardImpl {
private static final FilterPermanent filter = new FilterPermanent("creature or land");

View file

@ -31,7 +31,7 @@ import java.util.UUID;
/**
*
* @author anonymous
* @author ilcartographer
*/
public class AlluringScent extends mage.sets.portal.AlluringScent {

View file

@ -0,0 +1,52 @@
/*
* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* The views and conclusions contained in the software and documentation are those of the
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of BetaSteward_at_googlemail.com.
*/
package mage.sets.portalsecondage;
import java.util.UUID;
/**
*
* @author ilcartographer
*/
public class AncientCraving extends mage.sets.starter1999.AncientCraving {
public AncientCraving(UUID ownerId) {
super(ownerId);
this.cardNumber = 2;
this.expansionSetCode = "PO2";
}
public AncientCraving(final AncientCraving card) {
super(card);
}
@Override
public AncientCraving copy() {
return new AncientCraving(this);
}
}

View file

@ -31,7 +31,7 @@ import java.util.UUID;
/**
*
* @author anonymous
* @author ilcartographer
*/
public class BeeSting extends mage.sets.portal.BeeSting {

View file

@ -38,7 +38,7 @@ import mage.constants.Zone;
/**
*
* @author anonymous
* @author ilcartographer
*/
public class IronhoofOx extends CardImpl {

View file

@ -32,7 +32,7 @@ import mage.constants.Rarity;
/**
*
* @author anonymous
* @author ilcartographer
*/
public class Onulet extends mage.sets.mastersedition.Onulet {

View file

@ -31,7 +31,7 @@ import java.util.UUID;
/**
*
* @author anonymous
* @author ilcartographer
*/
public class PhantasmalForces extends mage.sets.fourthedition.PhantasmalForces {

View file

@ -31,7 +31,7 @@ import java.util.UUID;
/**
*
* @author anonymous
* @author ilcartographer
*/
public class SedgeTroll extends mage.sets.masterseditioniv.SedgeTroll {

View file

@ -29,11 +29,13 @@
package mage.sets.scarsofmirrodin;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.effects.common.CreateTokenEffect;
import mage.abilities.keyword.InfectAbility;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Rarity;
import mage.game.permanent.token.InsectToken;
import mage.game.permanent.token.Token;
/**
*
@ -45,7 +47,8 @@ public class CarrionCall extends CardImpl {
super(ownerId, 115, "Carrion Call", Rarity.UNCOMMON, new CardType[]{CardType.INSTANT}, "{3}{G}");
this.expansionSetCode = "SOM";
this.getSpellAbility().addEffect(new CreateTokenEffect(new InsectToken("SOM"), 2));
// Put two 1/1 green Insect creature tokens with infect onto the battlefield. (They deal damage to creatures in the form of -1/-1 counters and to players in the form of poison counters.)
this.getSpellAbility().addEffect(new CreateTokenEffect(new CarrionCallInsectToken(), 2));
}
public CarrionCall (final CarrionCall card) {
@ -57,3 +60,19 @@ public class CarrionCall extends CardImpl {
return new CarrionCall(this);
}
}
class CarrionCallInsectToken extends Token {
public CarrionCallInsectToken() {
super("Insect", "1/1 green Insect creature tokens with infect");
setOriginalExpansionSetCode("SOM");
cardType.add(CardType.CREATURE);
color.setGreen(true);
subtype.add("Insect");
power = new MageInt(1);
toughness = new MageInt(1);
addAbility(InfectAbility.getInstance());
}
}

View file

@ -0,0 +1,52 @@
/*
* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* The views and conclusions contained in the software and documentation are those of the
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of BetaSteward_at_googlemail.com.
*/
package mage.sets.sorinvstibalt;
import java.util.UUID;
/**
*
* @author ilcartographer
*/
public class AncientCraving extends mage.sets.starter1999.AncientCraving {
public AncientCraving(UUID ownerId) {
super(ownerId);
this.cardNumber = 28;
this.expansionSetCode = "DDK";
}
public AncientCraving(final AncientCraving card) {
super(card);
}
@Override
public AncientCraving copy() {
return new AncientCraving(this);
}
}

View file

@ -0,0 +1,52 @@
/*
* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* The views and conclusions contained in the software and documentation are those of the
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of BetaSteward_at_googlemail.com.
*/
package mage.sets.sorinvstibalt;
import java.util.UUID;
/**
*
* @author ilcartographer
*/
public class BreakingPoint extends mage.sets.judgment.BreakingPoint {
public BreakingPoint(UUID ownerId) {
super(ownerId);
this.cardNumber = 67;
this.expansionSetCode = "DDK";
}
public BreakingPoint(final BreakingPoint card) {
super(card);
}
@Override
public BreakingPoint copy() {
return new BreakingPoint(this);
}
}

View file

@ -0,0 +1,73 @@
/*
* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* The views and conclusions contained in the software and documentation are those of the
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of BetaSteward_at_googlemail.com.
*/
package mage.sets.sorinvstibalt;
import java.util.UUID;
import mage.MageInt;
import mage.Mana;
import mage.abilities.Ability;
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
import mage.abilities.condition.common.CastFromHandCondition;
import mage.abilities.decorator.ConditionalOneShotEffect;
import mage.abilities.effects.common.BasicManaEffect;
import mage.abilities.effects.common.ExileAllEffect;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Rarity;
import mage.filter.common.FilterAttackingCreature;
import mage.watchers.common.CastFromHandWatcher;
/**
*
* @author ilcartographer
*/
public class CoalStoker extends CardImpl {
public CoalStoker(UUID ownerId) {
super(ownerId, 49, "Coal Stoker", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{3}{R}");
this.expansionSetCode = "DDK";
this.subtype.add("Elemental");
this.power = new MageInt(3);
this.toughness = new MageInt(3);
// When Coal Stoker enters the battlefield, if you cast it from your hand, add {R}{R}{R} to your mana pool.
Ability ability = new EntersBattlefieldTriggeredAbility(
new ConditionalOneShotEffect(new BasicManaEffect(new Mana(3, 0, 0, 0, 0, 0, 0)), new CastFromHandCondition(),
" if you cast it from your hand, add {R}{R}{R} to your mana pool."));
this.addAbility(ability, new CastFromHandWatcher());
}
public CoalStoker(final CoalStoker card) {
super(card);
}
@Override
public CoalStoker copy() {
return new CoalStoker(this);
}
}

View file

@ -0,0 +1,52 @@
/*
* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* The views and conclusions contained in the software and documentation are those of the
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of BetaSteward_at_googlemail.com.
*/
package mage.sets.sorinvstibalt;
import java.util.UUID;
/**
*
* @author ilcartographer
*/
public class Decompose extends mage.sets.odyssey.Decompose {
public Decompose(UUID ownerId) {
super(ownerId);
this.cardNumber = 20;
this.expansionSetCode = "DDK";
}
public Decompose(final Decompose card) {
super(card);
}
@Override
public Decompose copy() {
return new Decompose(this);
}
}

View file

@ -0,0 +1,86 @@
/*
* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* The views and conclusions contained in the software and documentation are those of the
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of BetaSteward_at_googlemail.com.
*/
package mage.sets.sorinvstibalt;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.BeginningOfUpkeepTriggeredAbility;
import mage.abilities.condition.Condition;
import mage.abilities.decorator.ConditionalTriggeredAbility;
import mage.abilities.effects.common.DamageTargetEffect;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Rarity;
import mage.constants.TargetController;
import mage.constants.Zone;
import mage.game.Game;
import mage.players.Player;
/**
*
* @author ilcartographer
*/
public class LavabornMuse extends CardImpl {
public LavabornMuse(UUID ownerId) {
super(ownerId, 50, "Lavaborn Muse", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{3}{R}");
this.expansionSetCode = "DDK";
this.subtype.add("Spirit");
this.power = new MageInt(3);
this.toughness = new MageInt(3);
// At the beginning of each opponent's upkeep, if that player has two or fewer cards in hand, Lavaborn Muse deals 3 damage to him or her.
this.addAbility(new ConditionalTriggeredAbility(
new BeginningOfUpkeepTriggeredAbility(Zone.BATTLEFIELD, new DamageTargetEffect(3), TargetController.OPPONENT, false, true),
new CardsInActivePlayersHandCondition(),
"At the beginning of each opponent's upkeep, if that player has two or fewer cards in hand, {this} deals 3 damage to him or her.",
false));
}
public LavabornMuse(final LavabornMuse card) {
super(card);
}
@Override
public LavabornMuse copy() {
return new LavabornMuse(this);
}
}
// TODO: Figure out CardsInHandCondition parameters and use that instead of rewriting this
// TODO: Update HellfireMongrel, ShriekingAffliction to use the CardsInHandCondition?
class CardsInActivePlayersHandCondition implements Condition {
@Override
public boolean apply(Game game, Ability source) {
Player player = game.getPlayer(game.getActivePlayerId());
return player != null && player.getHand().size() <= 2;
}
}

View file

@ -0,0 +1,109 @@
/*
* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* The views and conclusions contained in the software and documentation are those of the
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of BetaSteward_at_googlemail.com.
*/
package mage.sets.sorinvstibalt;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.TriggeredAbility;
import mage.abilities.common.CantBlockAbility;
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
import mage.abilities.condition.common.ManaWasSpentCondition;
import mage.abilities.decorator.ConditionalTriggeredAbility;
import mage.abilities.effects.OneShotEffect;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.ColoredManaSymbol;
import mage.constants.Outcome;
import mage.constants.Rarity;
import mage.constants.TurnPhase;
import mage.game.Game;
import mage.game.turn.TurnMod;
import mage.players.Player;
import mage.target.TargetPlayer;
import mage.watchers.common.ManaSpentToCastWatcher;
/**
*
* @author ilcartographer
*/
public class RevenantPatriarch extends CardImpl {
public RevenantPatriarch(UUID ownerId) {
super(ownerId, 16, "Revenant Patriarch", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{4}{B}");
this.expansionSetCode = "DDK";
this.subtype.add("Spirit");
this.power = new MageInt(4);
this.toughness = new MageInt(3);
// When Revenant Patriarch enters the battlefield, if {W} was spent to cast it, target player skips his or her next combat phase.
TriggeredAbility ability = new EntersBattlefieldTriggeredAbility(new TargetPlayerSkipNextCombatEffect(), false);
ability.addTarget(new TargetPlayer());
this.addAbility(new ConditionalTriggeredAbility(ability, new ManaWasSpentCondition(ColoredManaSymbol.W),
"if {W} was spent to cast it, target player skips his or her next combat phase."), new ManaSpentToCastWatcher());
// Revenant Patriarch can't block.
this.addAbility(new CantBlockAbility());
}
public RevenantPatriarch(final RevenantPatriarch card) {
super(card);
}
@Override
public RevenantPatriarch copy() {
return new RevenantPatriarch(this);
}
}
class TargetPlayerSkipNextCombatEffect extends OneShotEffect {
public TargetPlayerSkipNextCombatEffect() {
super(Outcome.Detriment);
}
public TargetPlayerSkipNextCombatEffect(final TargetPlayerSkipNextCombatEffect effect) {
super(effect);
}
@Override
public boolean apply(Game game, Ability source) {
Player player = game.getPlayer(getTargetPointer().getFirst(game, source));
if (player != null) {
game.getState().getTurnMods().add(new TurnMod(player.getId(), TurnPhase.COMBAT, null, true));
return true;
}
return false;
}
@Override
public TargetPlayerSkipNextCombatEffect copy() {
return new TargetPlayerSkipNextCombatEffect(this);
}
}

View file

@ -0,0 +1,74 @@
/*
* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* The views and conclusions contained in the software and documentation are those of the
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of BetaSteward_at_googlemail.com.
*/
package mage.sets.sorinvstibalt;
import java.util.UUID;
import mage.abilities.costs.mana.ManaCostsImpl;
import mage.abilities.effects.common.DestroyTargetEffect;
import mage.abilities.keyword.FlashbackAbility;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Rarity;
import mage.constants.TimingRule;
import mage.filter.Filter;
import mage.filter.common.FilterCreaturePermanent;
import mage.filter.predicate.mageobject.ToughnessPredicate;
import mage.target.common.TargetCreaturePermanent;
/**
*
* @author ilcartographer
*/
public class StranglingSoot extends CardImpl {
private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("creature with toughess 3 or less");
static {
filter.add(new ToughnessPredicate(Filter.ComparisonType.LessThan, 4));
}
public StranglingSoot(UUID ownerId) {
super(ownerId, 65, "Strangling Soot", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{2}{B}");
this.expansionSetCode = "DDK";
// Destroy target creature with toughness 3 or less.
this.getSpellAbility().addTarget(new TargetCreaturePermanent(filter));
this.getSpellAbility().addEffect(new DestroyTargetEffect());
// Flashback {5}{R}
this.addAbility(new FlashbackAbility(new ManaCostsImpl("{5}{R}"), TimingRule.INSTANT));
}
public StranglingSoot(final StranglingSoot card) {
super(card);
}
@Override
public StranglingSoot copy() {
return new StranglingSoot(this);
}
}

View file

@ -31,7 +31,7 @@ import java.util.UUID;
/**
*
* @author anonymous
* @author ilcartographer
*/
public class AlluringScent extends mage.sets.portal.AlluringScent {

View file

@ -0,0 +1,60 @@
/*
* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* The views and conclusions contained in the software and documentation are those of the
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of BetaSteward_at_googlemail.com.
*/
package mage.sets.starter1999;
import java.util.UUID;
import mage.abilities.effects.common.DrawCardSourceControllerEffect;
import mage.abilities.effects.common.LoseLifeSourceControllerEffect;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Rarity;
/**
*
* @author ilcartographer
*/
public class AncientCraving extends CardImpl {
public AncientCraving(UUID ownerId) {
super(ownerId, 64, "Ancient Craving", Rarity.RARE, new CardType[]{CardType.SORCERY}, "{3}{B}");
this.expansionSetCode = "S99";
// You draw three cards and you lose 3 life.
this.getSpellAbility().addEffect(new DrawCardSourceControllerEffect(3));
this.getSpellAbility().addEffect(new LoseLifeSourceControllerEffect(3));
}
public AncientCraving(final AncientCraving card) {
super(card);
}
@Override
public AncientCraving copy() {
return new AncientCraving(this);
}
}

View file

@ -31,7 +31,7 @@ import java.util.UUID;
/**
*
* @author anonymous
* @author ilcartographer
*/
public class FireTempest extends mage.sets.portal.FireTempest {

View file

@ -0,0 +1,95 @@
/*
* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* The views and conclusions contained in the software and documentation are those of the
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of BetaSteward_at_googlemail.com.
*/
package mage.sets.stronghold;
import java.util.UUID;
import mage.abilities.TriggeredAbilityImpl;
import mage.abilities.effects.common.PutLandFromHandOntoBattlefieldEffect;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Rarity;
import mage.constants.Zone;
import mage.game.Game;
import mage.game.events.GameEvent;
import mage.game.events.GameEvent.EventType;
import mage.game.permanent.Permanent;
/**
* @author duncant
*/
public class Burgeoning extends CardImpl {
public Burgeoning(UUID ownerId) {
super(ownerId, 52, "Burgeoning", Rarity.RARE, new CardType[]{CardType.ENCHANTMENT}, "{G}");
this.expansionSetCode = "STH";
// Whenever an opponent plays a land, you may put a land card from your hand onto the battlefield.
this.addAbility(new BurgeoningTriggeredAbility());
}
public Burgeoning(final Burgeoning card) {
super(card);
}
@Override
public Burgeoning copy() {
return new Burgeoning(this);
}
}
class BurgeoningTriggeredAbility extends TriggeredAbilityImpl {
BurgeoningTriggeredAbility() {
super(Zone.BATTLEFIELD, new PutLandFromHandOntoBattlefieldEffect());
}
BurgeoningTriggeredAbility(BurgeoningTriggeredAbility ability) {
super(ability);
}
@Override
public boolean checkEventType(GameEvent event, Game game) {
return event.getType() == EventType.LAND_PLAYED;
}
@Override
public boolean checkTrigger(GameEvent event, Game game) {
Permanent land = game.getPermanent(event.getTargetId());
return game.getOpponents(controllerId).contains(land.getControllerId());
}
@Override
public BurgeoningTriggeredAbility copy() {
return new BurgeoningTriggeredAbility(this);
}
@Override
public String getRule() {
return "Whenever an opponent plays a land, you may put a land card from your hand onto the battlefield.";
}
}

View file

@ -0,0 +1,52 @@
/*
* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* The views and conclusions contained in the software and documentation are those of the
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of BetaSteward_at_googlemail.com.
*/
package mage.sets.tenthedition;
import java.util.UUID;
/**
*
* @author ilcartographer
*/
public class LavabornMuse extends mage.sets.sorinvstibalt.LavabornMuse {
public LavabornMuse(UUID ownerId) {
super(ownerId);
this.cardNumber = 216;
this.expansionSetCode = "10E";
}
public LavabornMuse(final LavabornMuse card) {
super(card);
}
@Override
public LavabornMuse copy() {
return new LavabornMuse(this);
}
}

View file

@ -85,7 +85,7 @@ class PeekEffect extends OneShotEffect {
Player player = game.getPlayer(targetPointer.getFirst(game, source));
MageObject sourceObject = source.getSourceObject(game);
if (player != null && controller != null && sourceObject != null) {
controller.lookAtCards(sourceObject.getIdName(), player.getHand(), game);
controller.lookAtCards(sourceObject.getIdName() + " " + player.getName() + " (" + game.getTurnNum()+"|"+game.getPhase().getType() +")", player.getHand(), game);
}
return true;
}

View file

@ -0,0 +1,52 @@
/*
* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* The views and conclusions contained in the software and documentation are those of the
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of BetaSteward_at_googlemail.com.
*/
package mage.sets.timespiral;
import java.util.UUID;
/**
*
* @author ilcartographer
*/
public class CoalStoker extends mage.sets.sorinvstibalt.CoalStoker {
public CoalStoker(UUID ownerId) {
super(ownerId);
this.cardNumber = 150;
this.expansionSetCode = "TSP";
}
public CoalStoker(final CoalStoker card) {
super(card);
}
@Override
public CoalStoker copy() {
return new CoalStoker(this);
}
}

View file

@ -0,0 +1,127 @@
/*
* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* The views and conclusions contained in the software and documentation are those of the
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of BetaSteward_at_googlemail.com.
*/
package mage.sets.timespiral;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.SimpleActivatedAbility;
import mage.abilities.costs.mana.ManaCostsImpl;
import mage.abilities.effects.SearchEffect;
import mage.abilities.effects.common.CopyEffect;
import mage.abilities.keyword.FlyingAbility;
import mage.cards.Card;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Duration;
import mage.constants.Outcome;
import mage.constants.Rarity;
import mage.constants.Zone;
import mage.filter.FilterCard;
import mage.filter.common.FilterPermanentCard;
import mage.filter.predicate.mageobject.SubtypePredicate;
import mage.game.Game;
import mage.game.permanent.Permanent;
import mage.players.Player;
import mage.target.common.TargetCardInLibrary;
/**
* @author duncant
*/
public class ScionOfTheUrDragon extends CardImpl {
public ScionOfTheUrDragon(UUID ownerId) {
super(ownerId, 246, "Scion of the Ur-Dragon", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{W}{U}{B}{R}{G}");
this.expansionSetCode = "TSP";
this.supertype.add("Legendary");
this.subtype.add("Dragon");
this.subtype.add("Avatar");
this.power = new MageInt(4);
this.toughness = new MageInt(4);
this.addAbility(FlyingAbility.getInstance());
// {2}: Search your library for a Dragon permanent card and put it into your graveyard. If you do, Scion of the Ur-Dragon becomes a copy of that card until end of turn. Then shuffle your library.
this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD,
new ScionOfTheUrDragonEffect(),
new ManaCostsImpl("{2}")));
}
public ScionOfTheUrDragon(final ScionOfTheUrDragon card) {
super(card);
}
@Override
public ScionOfTheUrDragon copy() {
return new ScionOfTheUrDragon(this);
}
}
class ScionOfTheUrDragonEffect extends SearchEffect {
private static final FilterCard filter = new FilterPermanentCard("Dragon permanent card");
static {
filter.add(new SubtypePredicate("Dragon"));
}
public ScionOfTheUrDragonEffect() {
super(new TargetCardInLibrary(filter), Outcome.Copy);
staticText = "Search your library for a Dragon permanent card and put it into your graveyard. If you do, Scion of the Ur-Dragon becomes a copy of that card until end of turn. Then shuffle your library.";
}
ScionOfTheUrDragonEffect(final ScionOfTheUrDragonEffect effect) {
super(effect);
}
@Override
public ScionOfTheUrDragonEffect copy() {
return new ScionOfTheUrDragonEffect(this);
}
@Override
public boolean apply(Game game, Ability ability) {
Player player = game.getPlayer(ability.getControllerId());
Permanent sourcePermanent = game.getPermanent(ability.getSourceId());
if (player != null && sourcePermanent != null) {
if (player.searchLibrary(target, game)) {
for (UUID cardId : target.getTargets()) {
Card card = player.getLibrary().getCard(cardId, game);
if (card != null) {
player.moveCards(card, Zone.LIBRARY, Zone.GRAVEYARD, ability, game);
CopyEffect copyEffect = new CopyEffect(Duration.EndOfTurn, card, ability.getSourceId());
game.addEffect(copyEffect, ability);
}
}
}
player.shuffleLibrary(game);
return true;
}
return false;
}
}

View file

@ -0,0 +1,52 @@
/*
* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* The views and conclusions contained in the software and documentation are those of the
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of BetaSteward_at_googlemail.com.
*/
package mage.sets.timespiral;
import java.util.UUID;
/**
*
* @author ilcartographer
*/
public class StranglingSoot extends mage.sets.sorinvstibalt.StranglingSoot {
public StranglingSoot(UUID ownerId) {
super(ownerId);
this.cardNumber = 132;
this.expansionSetCode = "TSP";
}
public StranglingSoot(final StranglingSoot card) {
super(card);
}
@Override
public StranglingSoot copy() {
return new StranglingSoot(this);
}
}

View file

@ -31,7 +31,7 @@ import java.util.UUID;
/**
*
* @author anonymous
* @author ilcartographer
*/
public class PhantasmalForces extends mage.sets.fourthedition.PhantasmalForces {

View file

@ -31,7 +31,7 @@ import java.util.UUID;
/**
*
* @author anonymous
* @author ilcartographer
*/
public class SedgeTroll extends mage.sets.masterseditioniv.SedgeTroll {

View file

@ -48,7 +48,6 @@ public class Telepathy extends CardImpl {
super(ownerId, 102, "Telepathy", Rarity.UNCOMMON, new CardType[]{CardType.ENCHANTMENT}, "{U}");
this.expansionSetCode = "USG";
// Your opponents play with their hands revealed.
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new OpponentsPlayWithTheTopCardRevealedEffect()));
}
@ -82,7 +81,7 @@ class OpponentsPlayWithTheTopCardRevealedEffect extends ContinuousEffectImpl {
for (UUID opponentId : game.getOpponents(controller.getId())) {
Player opponent = game.getPlayer(opponentId);
if (opponent != null) {
controller.revealCards(sourceObject.getName() + " " + opponent.getName(), opponent.getHand(), game, false);
controller.revealCards(sourceObject.getIdName() + " " + opponent.getName(), opponent.getHand(), game, false);
}
}
return true;

View file

@ -28,6 +28,7 @@
package mage.sets.zendikar;
import java.util.UUID;
import mage.MageObject;
import mage.constants.CardType;
import mage.constants.Outcome;
import mage.constants.Rarity;
@ -42,7 +43,6 @@ import mage.cards.CardImpl;
import mage.cards.Cards;
import mage.cards.CardsImpl;
import mage.game.Game;
import mage.game.permanent.Permanent;
import mage.players.Player;
/**
@ -56,7 +56,10 @@ public class ExplorersScope extends CardImpl {
this.expansionSetCode = "ZEN";
this.subtype.add("Equipment");
// Whenever equipped creature attacks, look at the top card of your library. If it's a land card, you may put it onto the battlefield tapped.
this.addAbility(new AttacksAttachedTriggeredAbility(new ExplorersScopeEffect()));
// Equip ({1}: Attach to target creature you control. Equip only as a sorcery.)
this.addAbility(new EquipAbility(Outcome.AddAbility, new GenericManaCost(1)));
}
@ -88,28 +91,24 @@ class ExplorersScopeEffect extends OneShotEffect {
@Override
public boolean apply(Game game, Ability source) {
Player player = game.getPlayer(source.getControllerId());
if (player == null) {
Player controller = game.getPlayer(source.getControllerId());
MageObject sourceObject = source.getSourceObject(game);
if (controller == null || sourceObject == null) {
return false;
}
Card card = player.getLibrary().getFromTop(game);
Card card = controller.getLibrary().getFromTop(game);
if (card != null) {
Cards cards = new CardsImpl();
cards.add(card);
player.lookAtCards("Explorer's Scope", cards, game);
controller.lookAtCards(sourceObject.getIdName(), cards, game);
if (card.getCardType().contains(CardType.LAND)) {
String message = "Put " + card.getName() + " onto the battlefield tapped?";
if (player.chooseUse(Outcome.PutLandInPlay, message, game)) {
if (card.putOntoBattlefield(game, Zone.LIBRARY, source.getSourceId(), source.getControllerId())) {
Permanent permanent = game.getPermanent(card.getId());
if (permanent != null) {
permanent.setTapped(true);
}
}
String message = "Put " + card.getLogName() + " onto the battlefield tapped?";
if (controller.chooseUse(Outcome.PutLandInPlay, message, game)) {
card.putOntoBattlefield(game, Zone.LIBRARY, source.getSourceId(), source.getControllerId(), true);
}
}
}
return true;
}
}
}

View file

@ -29,6 +29,9 @@ package org.mage.test.cards.abilities.keywords;
import mage.constants.PhaseStep;
import mage.constants.Zone;
import mage.game.permanent.Permanent;
import mage.game.permanent.PermanentToken;
import org.junit.Assert;
import org.junit.Test;
import org.mage.test.serverside.base.CardTestPlayerBase;
@ -89,5 +92,5 @@ public class ProvokeTest extends CardTestPlayerBase{
assertLife(playerA, 18); // one attack from Imp
assertLife(playerB, 15); // Not blocked
}
}
}

View file

@ -1201,7 +1201,6 @@ public abstract class GameImpl implements Game, Serializable {
applyEffects();
state.getPlayers().resetPassed();
fireUpdatePlayersEvent();
state.getRevealed().reset();
resetShortLivingLKI();
break;
} else {
@ -1980,6 +1979,8 @@ public abstract class GameImpl implements Game, Serializable {
}
logger.trace("fireUpdatePlayersEvent");
tableEventSource.fireTableEvent(EventType.UPDATE, null, this);
getState().clearLookedAt();
getState().clearRevealed();
}
@Override

View file

@ -445,8 +445,12 @@ public class GameState implements Serializable, Copyable<GameState> {
return lookedAt.get(playerId);
}
public void clearLookedAt(UUID playerId) {
lookedAt.remove(playerId);
public void clearRevealed() {
revealed.clear();
}
public void clearLookedAt() {
lookedAt.clear();
}
public Turn getTurn() {

View file

@ -99,7 +99,7 @@ public class MiracleWatcher extends Watcher {
Cards cards = new CardsImpl();
cards.add(card);
controller.lookAtCards("Miracle", cards, game);
if (controller.chooseUse(Outcome.Benefit, "Reveal " + card.getName() + " to be able to use Miracle?", game)) {
if (controller.chooseUse(Outcome.Benefit, "Reveal " + card.getLogName() + " to be able to use Miracle?", game)) {
controller.revealCards("Miracle", cards, game);
game.fireEvent(GameEvent.getEvent(GameEvent.EventType.MIRACLE_CARD_REVEALED, card.getId(), card.getId(),controller.getId()));
break;