mirror of
https://github.com/correl/mage.git
synced 2025-01-12 19:25:44 +00:00
Merge remote-tracking branch 'upstream/master'
This commit is contained in:
commit
1cb8e695f7
46 changed files with 2563 additions and 38 deletions
|
@ -190,10 +190,7 @@ public class MageFrame extends javax.swing.JFrame implements MageClient {
|
|||
initComponents();
|
||||
setSize(1024, 768);
|
||||
SettingsManager.getInstance().setScreenWidthAndHeight(1024, 768);
|
||||
DialogManager.getManager().setScreenWidth(1024);
|
||||
DialogManager.getManager().setScreenHeight(768);
|
||||
DialogManager.getManager().setBounds(0, 0, 1024, 768);
|
||||
DialogManager.getManager().setVisible(false);
|
||||
DialogManager.updateParams(768, 1024, false);
|
||||
this.setExtendedState(JFrame.MAXIMIZED_BOTH);
|
||||
|
||||
session = new SessionImpl(this);
|
||||
|
|
|
@ -10,6 +10,8 @@ import java.awt.event.MouseEvent;
|
|||
import java.awt.event.MouseListener;
|
||||
import java.awt.event.MouseMotionListener;
|
||||
import java.awt.event.MouseWheelEvent;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
|
@ -18,15 +20,23 @@ import java.util.UUID;
|
|||
public class DialogManager extends JComponent implements MouseListener,
|
||||
MouseMotionListener {
|
||||
|
||||
private static DialogManager dialogManager = null;
|
||||
private static Map<UUID, DialogManager> dialogManagers = new HashMap<UUID, DialogManager>();
|
||||
//private static final Logger log = Logger.getLogger(DialogManager.class);
|
||||
|
||||
public static DialogManager getManager() {
|
||||
if (dialogManager == null) {
|
||||
dialogManager = new DialogManager();
|
||||
dialogManager.setVisible(true);
|
||||
public static DialogManager getManager(UUID gameId) {
|
||||
if (!dialogManagers.containsKey(gameId)) {
|
||||
synchronized (dialogManagers) {
|
||||
if (!dialogManagers.containsKey(gameId)) {
|
||||
DialogManager dialogManager = new DialogManager();
|
||||
dialogManager.setScreenWidth(768);
|
||||
dialogManager.setScreenHeight(1024);
|
||||
dialogManager.setBounds(0, 0, 768, 1024);
|
||||
dialogManager.setVisible(false);
|
||||
dialogManagers.put(gameId, dialogManager);
|
||||
}
|
||||
}
|
||||
}
|
||||
return dialogManager;
|
||||
return dialogManagers.get(gameId);
|
||||
}
|
||||
|
||||
public enum MTGDialogs {
|
||||
|
@ -59,6 +69,16 @@ public class DialogManager extends JComponent implements MouseListener,
|
|||
this.screen_width = screen_width;
|
||||
}
|
||||
|
||||
public static void updateParams(int width, int height, boolean isVisible) {
|
||||
synchronized (dialogManagers) {
|
||||
for (DialogManager dialogManager : dialogManagers.values()) {
|
||||
dialogManager.setScreenWidth(width);
|
||||
dialogManager.setScreenHeight(height);
|
||||
dialogManager.setBounds(0, 0, width, height);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void setScreenHeight(int screen_height) {
|
||||
this.screen_height = screen_height;
|
||||
}
|
||||
|
|
|
@ -37,6 +37,7 @@ public class ChoiceDialog extends IDialogPanel {
|
|||
private JButton jButtonSort = null;
|
||||
|
||||
private CardsView cards;
|
||||
private UUID gameId;
|
||||
|
||||
private int page = 1;
|
||||
private int maxPages;
|
||||
|
@ -57,6 +58,7 @@ public class ChoiceDialog extends IDialogPanel {
|
|||
public ChoiceDialog(DlgParams params) {
|
||||
super(params);
|
||||
this.params = params;
|
||||
this.gameId = params.gameId;
|
||||
|
||||
cards = params.getCards();
|
||||
isOptional = params.isOptional();
|
||||
|
@ -171,7 +173,7 @@ public class ChoiceDialog extends IDialogPanel {
|
|||
|
||||
jButtonOK.setObserver(new Command() {
|
||||
public void execute() {
|
||||
DialogManager.getManager().fadeOut((DialogContainer) getParent());
|
||||
DialogManager.getManager(gameId).fadeOut((DialogContainer) getParent());
|
||||
}
|
||||
});
|
||||
}
|
||||
|
@ -328,7 +330,7 @@ public class ChoiceDialog extends IDialogPanel {
|
|||
private static final long serialVersionUID = -567322540616089486L;
|
||||
|
||||
public void execute() {
|
||||
DialogManager.getManager().fadeOut((DialogContainer) getParent());
|
||||
DialogManager.getManager(gameId).fadeOut((DialogContainer) getParent());
|
||||
/*
|
||||
try {
|
||||
ConnectionManager.sendAddChosenCard(null);
|
||||
|
|
|
@ -33,6 +33,8 @@ public class StackDialog extends IDialogPanel {
|
|||
|
||||
private JLayeredPane jLayeredPane;
|
||||
private FeedbackPanel feedbackPanel;
|
||||
|
||||
private UUID gameId;
|
||||
|
||||
private class CustomLabel extends JLabel {
|
||||
|
||||
|
@ -57,6 +59,7 @@ public class StackDialog extends IDialogPanel {
|
|||
public StackDialog(DlgParams params) {
|
||||
super(params);
|
||||
this.feedbackPanel = params.feedbackPanel;
|
||||
this.gameId = params.gameId;
|
||||
initialize();
|
||||
displayStack(params.getCards(), params.gameId, params.bigCard);
|
||||
}
|
||||
|
@ -145,7 +148,7 @@ public class StackDialog extends IDialogPanel {
|
|||
jButtonAccept.setObserver(new Command() {
|
||||
@Override
|
||||
public void execute() {
|
||||
DialogManager.getManager().fadeOut((DialogContainer)getParent());
|
||||
DialogManager.getManager(gameId).fadeOut((DialogContainer)getParent());
|
||||
//GameManager.getInputControl().getInput().selectButtonOK();
|
||||
StackDialog.this.feedbackPanel.doClick();
|
||||
}
|
||||
|
@ -168,7 +171,7 @@ public class StackDialog extends IDialogPanel {
|
|||
jButtonResponse.setObserver(new Command() {
|
||||
@Override
|
||||
public void execute() {
|
||||
DialogManager.getManager().fadeOut((DialogContainer)getParent());
|
||||
DialogManager.getManager(gameId).fadeOut((DialogContainer)getParent());
|
||||
}
|
||||
private static final long serialVersionUID = 1L;
|
||||
});
|
||||
|
|
|
@ -225,9 +225,9 @@ public class GamePanel extends javax.swing.JPanel {
|
|||
int height = pnlBattlefield.getHeight();
|
||||
phasesContainer.setPreferredSize(new Dimension(X_PHASE_WIDTH, height));
|
||||
|
||||
DialogManager.getManager().setScreenWidth(rect.width);
|
||||
DialogManager.getManager().setScreenHeight(rect.height);
|
||||
DialogManager.getManager().setBounds(0, 0, rect.width, rect.height);
|
||||
DialogManager.getManager(gameId).setScreenWidth(rect.width);
|
||||
DialogManager.getManager(gameId).setScreenHeight(rect.height);
|
||||
DialogManager.getManager(gameId).setBounds(0, 0, rect.width, rect.height);
|
||||
}
|
||||
|
||||
public synchronized void showGame(UUID gameId, UUID playerId) {
|
||||
|
@ -597,13 +597,13 @@ public class GamePanel extends javax.swing.JPanel {
|
|||
|
||||
public void playMana(String message, GameView gameView) {
|
||||
updateGame(gameView);
|
||||
DialogManager.getManager().fadeOut();
|
||||
DialogManager.getManager(gameId).fadeOut();
|
||||
this.feedbackPanel.getFeedback(FeedbackMode.CANCEL, message, gameView.getSpecial(), null);
|
||||
}
|
||||
|
||||
public void playXMana(String message, GameView gameView) {
|
||||
updateGame(gameView);
|
||||
DialogManager.getManager().fadeOut();
|
||||
DialogManager.getManager(gameId).fadeOut();
|
||||
this.feedbackPanel.getFeedback(FeedbackMode.CONFIRM, message, gameView.getSpecial(), null);
|
||||
}
|
||||
|
||||
|
@ -612,7 +612,7 @@ public class GamePanel extends javax.swing.JPanel {
|
|||
}
|
||||
|
||||
public void pickAbility(AbilityPickerView choices) {
|
||||
DialogManager.getManager().fadeOut();
|
||||
DialogManager.getManager(gameId).fadeOut();
|
||||
this.abilityPicker.show(choices, MageFrame.getDesktop().getMousePosition());
|
||||
}
|
||||
|
||||
|
@ -1143,7 +1143,7 @@ public class GamePanel extends javax.swing.JPanel {
|
|||
public void installComponents() {
|
||||
jLayeredPane.setOpaque(false);
|
||||
jLayeredPane.add(abilityPicker);
|
||||
jLayeredPane.add(DialogManager.getManager(), JLayeredPane.MODAL_LAYER, 0);
|
||||
jLayeredPane.add(DialogManager.getManager(gameId), JLayeredPane.MODAL_LAYER, 0);
|
||||
abilityPicker.setVisible(false);
|
||||
}
|
||||
|
||||
|
|
|
@ -42,7 +42,6 @@ import mage.client.cards.BigCard;
|
|||
import mage.client.components.HoverButton;
|
||||
import mage.client.components.MageRoundPane;
|
||||
import mage.client.components.ext.dlg.DialogManager;
|
||||
import mage.client.dialog.ShowCardsDialog;
|
||||
import mage.client.plugins.adapters.MageActionCallback;
|
||||
import mage.client.plugins.impl.Plugins;
|
||||
import mage.client.util.CardsViewUtil;
|
||||
|
@ -82,7 +81,7 @@ public class PlayerPanelExt extends javax.swing.JPanel {
|
|||
private Session session;
|
||||
private PlayerView player;
|
||||
|
||||
private ShowCardsDialog graveyard;
|
||||
//private ShowCardsDialog graveyard;
|
||||
private BigCard bigCard;
|
||||
|
||||
private static final int AVATAR_COUNT = 77;
|
||||
|
@ -512,11 +511,11 @@ public class PlayerPanelExt extends javax.swing.JPanel {
|
|||
}
|
||||
|
||||
private void btnGraveActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnGraveActionPerformed
|
||||
if (graveyard == null) {
|
||||
/*if (graveyard == null) {
|
||||
graveyard = new ShowCardsDialog();
|
||||
}
|
||||
}*/
|
||||
//graveyard.loadCards(player.getName() + " graveyard", player.getGraveyard(), bigCard, Config.dimensions, gameId, false);
|
||||
DialogManager.getManager().showChoiceDialog(CardsViewUtil.convertSimple(player.getGraveyard()), bigCard, gameId);
|
||||
DialogManager.getManager(gameId).showChoiceDialog(CardsViewUtil.convertSimple(player.getGraveyard()), bigCard, gameId);
|
||||
}
|
||||
|
||||
private void btnCheatActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnCheatActionPerformed
|
||||
|
|
70
Mage.Sets/src/mage/sets/alarareborn/DemonicDread.java
Normal file
70
Mage.Sets/src/mage/sets/alarareborn/DemonicDread.java
Normal file
|
@ -0,0 +1,70 @@
|
|||
/*
|
||||
* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without modification, are
|
||||
* permitted provided that the following conditions are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright notice, this list of
|
||||
* conditions and the following disclaimer.
|
||||
*
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
|
||||
* of conditions and the following disclaimer in the documentation and/or other materials
|
||||
* provided with the distribution.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED
|
||||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
|
||||
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR
|
||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
|
||||
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
|
||||
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
* The views and conclusions contained in the software and documentation are those of the
|
||||
* authors and should not be interpreted as representing official policies, either expressed
|
||||
* or implied, of BetaSteward_at_googlemail.com.
|
||||
*/
|
||||
package mage.sets.alarareborn;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.Constants;
|
||||
import mage.Constants.CardType;
|
||||
import mage.Constants.Rarity;
|
||||
import mage.abilities.effects.common.CantBlockTargetEffect;
|
||||
import mage.abilities.keyword.CascadeAbility;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.target.common.TargetCreaturePermanent;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author jeffwadsworth
|
||||
*
|
||||
*/
|
||||
public class DemonicDread extends CardImpl<DemonicDread> {
|
||||
|
||||
public DemonicDread(UUID ownerId) {
|
||||
super(ownerId, 38, "Demonic Dread", Rarity.COMMON, new CardType[]{CardType.SORCERY}, "{1}{B}{R}");
|
||||
this.expansionSetCode = "ARB";
|
||||
|
||||
this.color.setRed(true);
|
||||
this.color.setBlack(true);
|
||||
|
||||
// Cascade
|
||||
this.addAbility(new CascadeAbility());
|
||||
|
||||
// Target creature can't block this turn.
|
||||
this.getSpellAbility().addTarget(new TargetCreaturePermanent());
|
||||
this.getSpellAbility().addEffect(new CantBlockTargetEffect(Constants.Duration.EndOfTurn));
|
||||
|
||||
}
|
||||
|
||||
public DemonicDread(final DemonicDread card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public DemonicDread copy() {
|
||||
return new DemonicDread(this);
|
||||
}
|
||||
}
|
79
Mage.Sets/src/mage/sets/conflux/ExtractorDemon.java
Normal file
79
Mage.Sets/src/mage/sets/conflux/ExtractorDemon.java
Normal file
|
@ -0,0 +1,79 @@
|
|||
/*
|
||||
* 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.conflux;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.Constants.CardType;
|
||||
import mage.Constants.Rarity;
|
||||
import mage.MageInt;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.DiesCreatureTriggeredAbility;
|
||||
import mage.abilities.keyword.FlyingAbility;
|
||||
import mage.abilities.costs.mana.ManaCostsImpl;
|
||||
import mage.abilities.effects.common.PutLibraryIntoGraveTargetEffect;
|
||||
import mage.abilities.keyword.UnearthAbility;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.target.TargetPlayer;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author jeffwadsworth
|
||||
|
||||
*/
|
||||
public class ExtractorDemon extends CardImpl<ExtractorDemon> {
|
||||
|
||||
public ExtractorDemon(UUID ownerId) {
|
||||
super(ownerId, 44, "Extractor Demon", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{4}{B}{B}");
|
||||
this.expansionSetCode = "CON";
|
||||
this.subtype.add("Demon");
|
||||
|
||||
this.color.setBlack(true);
|
||||
this.power = new MageInt(5);
|
||||
this.toughness = new MageInt(5);
|
||||
|
||||
// Flying
|
||||
this.addAbility(FlyingAbility.getInstance());
|
||||
|
||||
// Whenever another creature leaves the battlefield, you may have target player put the top two cards of his or her library into his or her graveyard.
|
||||
Ability ability = new DiesCreatureTriggeredAbility(new PutLibraryIntoGraveTargetEffect(2), true, true, false);
|
||||
ability.addTarget(new TargetPlayer());
|
||||
this.addAbility(ability);
|
||||
|
||||
// Unearth {2}{B}
|
||||
this.addAbility(new UnearthAbility(new ManaCostsImpl("{2}{B}")));
|
||||
}
|
||||
|
||||
public ExtractorDemon(final ExtractorDemon card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ExtractorDemon copy() {
|
||||
return new ExtractorDemon(this);
|
||||
}
|
||||
}
|
81
Mage.Sets/src/mage/sets/dissension/WalkingArchive.java
Normal file
81
Mage.Sets/src/mage/sets/dissension/WalkingArchive.java
Normal file
|
@ -0,0 +1,81 @@
|
|||
/*
|
||||
* 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.dissension;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.Constants;
|
||||
import mage.Constants.CardType;
|
||||
import mage.Constants.Rarity;
|
||||
import mage.MageInt;
|
||||
import mage.abilities.common.BeginningOfUpkeepTriggeredAbility;
|
||||
import mage.abilities.common.EntersBattlefieldAbility;
|
||||
import mage.abilities.common.SimpleActivatedAbility;
|
||||
import mage.abilities.costs.mana.ManaCostsImpl;
|
||||
import mage.abilities.dynamicvalue.common.CountersCount;
|
||||
import mage.abilities.effects.common.DrawCardTargetEffect;
|
||||
import mage.abilities.effects.common.counter.AddCountersSourceEffect;
|
||||
import mage.abilities.keyword.DefenderAbility;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.counters.CounterType;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author jeffwadsworth
|
||||
*/
|
||||
public class WalkingArchive extends CardImpl<WalkingArchive> {
|
||||
|
||||
public WalkingArchive(UUID ownerId) {
|
||||
super(ownerId, 169, "Walking Archive", Rarity.RARE, new CardType[]{CardType.ARTIFACT, CardType.CREATURE}, "{3}");
|
||||
this.expansionSetCode = "DIS";
|
||||
this.subtype.add("Golem");
|
||||
|
||||
this.power = new MageInt(1);
|
||||
this.toughness = new MageInt(1);
|
||||
|
||||
// Defender
|
||||
this.addAbility(DefenderAbility.getInstance());
|
||||
|
||||
// Walking Archive enters the battlefield with a +1/+1 counter on it.
|
||||
this.addAbility(new EntersBattlefieldAbility(new AddCountersSourceEffect(CounterType.P1P1.createInstance()), "Walking Archive enters the battlefield with a +1/+1 counter on it"));
|
||||
|
||||
// At the beginning of each player's upkeep, that player draws a card for each +1/+1 counter on Walking Archive.
|
||||
this.addAbility(new BeginningOfUpkeepTriggeredAbility(new DrawCardTargetEffect(new CountersCount(CounterType.P1P1)), Constants.TargetController.ANY, false));
|
||||
|
||||
// {2}{W}{U}: Put a +1/+1 counter on Walking Archive.
|
||||
this.addAbility(new SimpleActivatedAbility(Constants.Zone.BATTLEFIELD, new AddCountersSourceEffect(CounterType.P1P1.createInstance()), new ManaCostsImpl("{2}{W}{U}")));
|
||||
}
|
||||
|
||||
public WalkingArchive(final WalkingArchive card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public WalkingArchive copy() {
|
||||
return new WalkingArchive(this);
|
||||
}
|
||||
}
|
53
Mage.Sets/src/mage/sets/eighthedition/Nekrataal.java
Normal file
53
Mage.Sets/src/mage/sets/eighthedition/Nekrataal.java
Normal file
|
@ -0,0 +1,53 @@
|
|||
/*
|
||||
* 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.eighthedition;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author jeffwadsworth
|
||||
|
||||
*/
|
||||
public class Nekrataal extends mage.sets.ninthedition.Nekrataal {
|
||||
|
||||
public Nekrataal(UUID ownerId) {
|
||||
super(ownerId);
|
||||
this.cardNumber = 149;
|
||||
this.expansionSetCode = "8ED";
|
||||
}
|
||||
|
||||
public Nekrataal(final Nekrataal card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Nekrataal copy() {
|
||||
return new Nekrataal(this);
|
||||
}
|
||||
}
|
53
Mage.Sets/src/mage/sets/exodus/Shackles.java
Normal file
53
Mage.Sets/src/mage/sets/exodus/Shackles.java
Normal file
|
@ -0,0 +1,53 @@
|
|||
/*
|
||||
* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without modification, are
|
||||
* permitted provided that the following conditions are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright notice, this list of
|
||||
* conditions and the following disclaimer.
|
||||
*
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
|
||||
* of conditions and the following disclaimer in the documentation and/or other materials
|
||||
* provided with the distribution.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED
|
||||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
|
||||
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR
|
||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
|
||||
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
|
||||
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
* The views and conclusions contained in the software and documentation are those of the
|
||||
* authors and should not be interpreted as representing official policies, either expressed
|
||||
* or implied, of BetaSteward_at_googlemail.com.
|
||||
*/
|
||||
package mage.sets.exodus;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author jeffwadsworth
|
||||
|
||||
*/
|
||||
public class Shackles extends mage.sets.invasion.Shackles {
|
||||
|
||||
public Shackles(UUID ownerId) {
|
||||
super(ownerId);
|
||||
this.cardNumber = 18;
|
||||
this.expansionSetCode = "EXO";
|
||||
}
|
||||
|
||||
public Shackles(final Shackles card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Shackles copy() {
|
||||
return new Shackles(this);
|
||||
}
|
||||
}
|
55
Mage.Sets/src/mage/sets/exodus/ThrullSurgeon.java
Normal file
55
Mage.Sets/src/mage/sets/exodus/ThrullSurgeon.java
Normal file
|
@ -0,0 +1,55 @@
|
|||
/*
|
||||
* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without modification, are
|
||||
* permitted provided that the following conditions are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright notice, this list of
|
||||
* conditions and the following disclaimer.
|
||||
*
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
|
||||
* of conditions and the following disclaimer in the documentation and/or other materials
|
||||
* provided with the distribution.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED
|
||||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
|
||||
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR
|
||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
|
||||
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
|
||||
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
* The views and conclusions contained in the software and documentation are those of the
|
||||
* authors and should not be interpreted as representing official policies, either expressed
|
||||
* or implied, of BetaSteward_at_googlemail.com.
|
||||
*/
|
||||
package mage.sets.exodus;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.Constants.Rarity;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author jeffwadsworth
|
||||
|
||||
*/
|
||||
public class ThrullSurgeon extends mage.sets.tenth.ThrullSurgeon {
|
||||
|
||||
public ThrullSurgeon(UUID ownerId) {
|
||||
super(ownerId);
|
||||
this.cardNumber = 76;
|
||||
this.expansionSetCode = "EXO";
|
||||
this.rarity = Rarity.COMMON;
|
||||
}
|
||||
|
||||
public ThrullSurgeon(final ThrullSurgeon card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ThrullSurgeon copy() {
|
||||
return new ThrullSurgeon(this);
|
||||
}
|
||||
}
|
82
Mage.Sets/src/mage/sets/invasion/Shackles.java
Normal file
82
Mage.Sets/src/mage/sets/invasion/Shackles.java
Normal file
|
@ -0,0 +1,82 @@
|
|||
/*
|
||||
* 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.invasion;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.Constants;
|
||||
import mage.Constants.CardType;
|
||||
import mage.Constants.Rarity;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.SimpleActivatedAbility;
|
||||
import mage.abilities.common.SimpleStaticAbility;
|
||||
import mage.abilities.costs.mana.ManaCostsImpl;
|
||||
import mage.abilities.effects.common.AttachEffect;
|
||||
import mage.abilities.effects.common.ReturnToHandSourceEffect;
|
||||
import mage.abilities.effects.common.SkipEnchantedUntapEffect;
|
||||
import mage.abilities.keyword.EnchantAbility;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.target.TargetPermanent;
|
||||
import mage.target.common.TargetCreaturePermanent;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author jeffwadsworth
|
||||
*
|
||||
*/
|
||||
public class Shackles extends CardImpl<Shackles> {
|
||||
|
||||
public Shackles(UUID ownerId) {
|
||||
super(ownerId, 37, "Shackles", Rarity.COMMON, new CardType[]{CardType.ENCHANTMENT}, "{2}{W}");
|
||||
this.expansionSetCode = "INV";
|
||||
this.subtype.add("Aura");
|
||||
|
||||
this.color.setWhite(true);
|
||||
|
||||
// Enchant creature
|
||||
TargetPermanent auraTarget = new TargetCreaturePermanent();
|
||||
this.getSpellAbility().addTarget(auraTarget);
|
||||
this.getSpellAbility().addEffect(new AttachEffect(Constants.Outcome.Detriment));
|
||||
|
||||
// Enchanted creature doesn't untap during its controller's untap step.
|
||||
Ability ability = new EnchantAbility(auraTarget.getTargetName());
|
||||
this.addAbility(ability);
|
||||
this.addAbility(new SimpleStaticAbility(Constants.Zone.BATTLEFIELD, new SkipEnchantedUntapEffect()));
|
||||
|
||||
// {W}: Return Shackles to its owner's hand.
|
||||
this.addAbility(new SimpleActivatedAbility(Constants.Zone.BATTLEFIELD, new ReturnToHandSourceEffect(), new ManaCostsImpl("{W}")));
|
||||
}
|
||||
|
||||
public Shackles(final Shackles card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Shackles copy() {
|
||||
return new Shackles(this);
|
||||
}
|
||||
}
|
156
Mage.Sets/src/mage/sets/legions/DarkSupplicant.java
Normal file
156
Mage.Sets/src/mage/sets/legions/DarkSupplicant.java
Normal file
|
@ -0,0 +1,156 @@
|
|||
/*
|
||||
* 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.List;
|
||||
import java.util.UUID;
|
||||
import mage.Constants;
|
||||
import mage.Constants.CardType;
|
||||
import mage.Constants.Rarity;
|
||||
import mage.MageInt;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.SimpleActivatedAbility;
|
||||
import mage.abilities.costs.common.SacrificeTargetCost;
|
||||
import mage.abilities.costs.common.TapSourceCost;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.cards.Card;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.Cards;
|
||||
import mage.filter.FilterCard;
|
||||
import mage.filter.common.FilterControlledPermanent;
|
||||
import mage.filter.predicate.mageobject.NamePredicate;
|
||||
import mage.filter.predicate.mageobject.SubtypePredicate;
|
||||
import mage.game.Game;
|
||||
import mage.players.Player;
|
||||
import mage.target.common.TargetCardInLibrary;
|
||||
import mage.target.common.TargetControlledPermanent;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author jeffwadsworth
|
||||
*/
|
||||
public class DarkSupplicant extends CardImpl<DarkSupplicant> {
|
||||
|
||||
final static private FilterControlledPermanent filter = new FilterControlledPermanent("three Clerics you control");
|
||||
|
||||
static {
|
||||
filter.add(new SubtypePredicate("Cleric"));
|
||||
}
|
||||
|
||||
public DarkSupplicant(UUID ownerId) {
|
||||
super(ownerId, 64, "Dark Supplicant", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{B}");
|
||||
this.expansionSetCode = "LGN";
|
||||
this.subtype.add("Human");
|
||||
this.subtype.add("Cleric");
|
||||
|
||||
this.color.setBlack(true);
|
||||
this.power = new MageInt(1);
|
||||
this.toughness = new MageInt(1);
|
||||
|
||||
// {tap}, Sacrifice three Clerics: Search your graveyard, hand, and/or library for a card named Scion of Darkness and put it onto the battlefield. If you search your library this way, shuffle it.
|
||||
Ability ability = new SimpleActivatedAbility(Constants.Zone.BATTLEFIELD, new DarkSupplicantEffect(), new TapSourceCost());
|
||||
ability.addCost(new SacrificeTargetCost(new TargetControlledPermanent(3, 3, filter, true)));
|
||||
this.addAbility(ability);
|
||||
}
|
||||
|
||||
public DarkSupplicant(final DarkSupplicant card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public DarkSupplicant copy() {
|
||||
return new DarkSupplicant(this);
|
||||
}
|
||||
}
|
||||
|
||||
class DarkSupplicantEffect extends OneShotEffect<DarkSupplicantEffect> {
|
||||
|
||||
public DarkSupplicantEffect() {
|
||||
super(Constants.Outcome.Benefit);
|
||||
this.staticText = "Search your graveyard, hand, and/or library for a card named Scion of Darkness and put it onto the battlefield. If you search your library this way, shuffle it";
|
||||
}
|
||||
|
||||
public DarkSupplicantEffect(final DarkSupplicantEffect effect) {
|
||||
super(effect);
|
||||
}
|
||||
|
||||
@Override
|
||||
public DarkSupplicantEffect copy() {
|
||||
return new DarkSupplicantEffect(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Player player = game.getPlayer(source.getControllerId());
|
||||
FilterCard filter = new FilterCard("card named Scion of Darkness");
|
||||
filter.add(new NamePredicate("Scion of Darkness"));
|
||||
TargetCardInLibrary target = new TargetCardInLibrary(filter);
|
||||
if (player == null) {
|
||||
return false;
|
||||
}
|
||||
// Library check
|
||||
if (player.chooseUse(Constants.Outcome.Benefit, "Do you want to search your library for Scion of Darkness?", game)) {
|
||||
if (player.searchLibrary(target, game)) {
|
||||
if (target.getTargets().size() > 0) {
|
||||
for (UUID cardId : (List<UUID>) target.getTargets()) {
|
||||
Card card = player.getLibrary().getCard(cardId, game);
|
||||
if (card != null) {
|
||||
if (card.putOntoBattlefield(game, Constants.Zone.LIBRARY, source.getId(), source.getControllerId())) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
player.shuffleLibrary(game);
|
||||
}
|
||||
// Graveyard check
|
||||
if (player.chooseUse(Constants.Outcome.Benefit, "Do you want to search your graveyard for Scion of Darkness?", game)) {
|
||||
Cards graveyard = player.getGraveyard().copy();
|
||||
for (UUID card : graveyard) {
|
||||
Card checkCard = game.getCard(card);
|
||||
if (checkCard.getName().equals("Scion of Darkness")) {
|
||||
checkCard.putOntoBattlefield(game, Constants.Zone.GRAVEYARD, source.getId(), source.getControllerId());
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
// Hand check
|
||||
if (player.chooseUse(Constants.Outcome.Benefit, "Do you want to search your hand for Scion of Darkness?", game)) {
|
||||
Cards hand = player.getHand().copy();
|
||||
for (UUID card : hand) {
|
||||
Card checkCard = game.getCard(card);
|
||||
if (checkCard.getName().equals("Scion of Darkness")) {
|
||||
checkCard.putOntoBattlefield(game, Constants.Zone.HAND, source.getId(), source.getControllerId());
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
122
Mage.Sets/src/mage/sets/legions/ScionOfDarkness.java
Normal file
122
Mage.Sets/src/mage/sets/legions/ScionOfDarkness.java
Normal file
|
@ -0,0 +1,122 @@
|
|||
/*
|
||||
* 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;
|
||||
import mage.Constants;
|
||||
import mage.Constants.CardType;
|
||||
import mage.Constants.Outcome;
|
||||
import mage.Constants.Rarity;
|
||||
import mage.MageInt;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.DealsCombatDamageToAPlayerTriggeredAbility;
|
||||
import mage.abilities.keyword.TrampleAbility;
|
||||
import mage.abilities.costs.mana.ManaCostsImpl;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.abilities.keyword.CyclingAbility;
|
||||
import mage.cards.Card;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.filter.FilterCard;
|
||||
import mage.filter.predicate.mageobject.CardTypePredicate;
|
||||
import mage.filter.predicate.other.OwnerIdPredicate;
|
||||
import mage.game.Game;
|
||||
import mage.players.Player;
|
||||
import mage.target.common.TargetCardInGraveyard;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author jeffwadsworth
|
||||
*/
|
||||
public class ScionOfDarkness extends CardImpl<ScionOfDarkness> {
|
||||
|
||||
public ScionOfDarkness(UUID ownerId) {
|
||||
super(ownerId, 79, "Scion of Darkness", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{5}{B}{B}{B}");
|
||||
this.expansionSetCode = "LGN";
|
||||
this.subtype.add("Avatar");
|
||||
|
||||
this.color.setBlack(true);
|
||||
this.power = new MageInt(6);
|
||||
this.toughness = new MageInt(6);
|
||||
|
||||
// Trample
|
||||
this.addAbility(TrampleAbility.getInstance());
|
||||
|
||||
// Whenever Scion of Darkness deals combat damage to a player, you may put target creature card from that player's graveyard onto the battlefield under your control.
|
||||
Ability ability = new DealsCombatDamageToAPlayerTriggeredAbility(new ScionOfDarknessEffect(), true, true);
|
||||
this.addAbility(ability);
|
||||
|
||||
// Cycling {3}
|
||||
this.addAbility(new CyclingAbility(new ManaCostsImpl("{3}")));
|
||||
}
|
||||
|
||||
public ScionOfDarkness(final ScionOfDarkness card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ScionOfDarkness copy() {
|
||||
return new ScionOfDarkness(this);
|
||||
}
|
||||
}
|
||||
|
||||
class ScionOfDarknessEffect extends OneShotEffect<ScionOfDarknessEffect> {
|
||||
|
||||
public ScionOfDarknessEffect() {
|
||||
super(Constants.Outcome.PutCreatureInPlay);
|
||||
this.staticText = "you may put target creature card from that player's graveyard onto the battlefield under your control";
|
||||
}
|
||||
|
||||
public ScionOfDarknessEffect(final ScionOfDarknessEffect effect) {
|
||||
super(effect);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ScionOfDarknessEffect copy() {
|
||||
return new ScionOfDarknessEffect(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Player damagedPlayer = game.getPlayer(targetPointer.getFirst(game, source));
|
||||
Player you = game.getPlayer(source.getControllerId());
|
||||
FilterCard filter = new FilterCard("creature in that player's graveyard");
|
||||
filter.add(new CardTypePredicate(CardType.CREATURE));
|
||||
filter.add(new OwnerIdPredicate(damagedPlayer.getId()));
|
||||
TargetCardInGraveyard target = new TargetCardInGraveyard(filter);
|
||||
if (target.canChoose(source.getSourceId(), you.getId(), game)) {
|
||||
if (you.chooseTarget(Outcome.PutCreatureInPlay, target, source, game)) {
|
||||
Card card = game.getCard(target.getFirstTarget());
|
||||
if (card != null) {
|
||||
card.putOntoBattlefield(game, Constants.Zone.GRAVEYARD, id, you.getId());
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
|
@ -27,24 +27,28 @@
|
|||
*/
|
||||
package mage.sets.magic2013;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.Constants;
|
||||
import mage.Constants.CardType;
|
||||
import mage.Constants.Duration;
|
||||
import mage.Constants.Rarity;
|
||||
import mage.abilities.dynamicvalue.common.PermanentsOnBattlefieldCount;
|
||||
import mage.abilities.effects.ContinuousEffect;
|
||||
import mage.abilities.effects.common.continious.BoostAllEffect;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.filter.common.FilterLandPermanent;
|
||||
import mage.filter.predicate.mageobject.SubtypePredicate;
|
||||
import mage.filter.predicate.permanent.ControllerPredicate;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author North
|
||||
*/
|
||||
public class Mutilate extends CardImpl<Mutilate> {
|
||||
|
||||
private static final String ruleText = "All creatures get -1/-1 until end of turn for each Swamp you control";
|
||||
|
||||
private static final FilterLandPermanent filter = new FilterLandPermanent("Swamp you control");
|
||||
|
||||
static {
|
||||
|
@ -60,7 +64,9 @@ public class Mutilate extends CardImpl<Mutilate> {
|
|||
|
||||
// All creatures get -1/-1 until end of turn for each Swamp you control.
|
||||
PermanentsOnBattlefieldCount count = new PermanentsOnBattlefieldCount(filter, -1);
|
||||
this.getSpellAbility().addEffect(new BoostAllEffect(count, count, Duration.EndOfTurn));
|
||||
ContinuousEffect effect = new BoostAllEffect(count, count, Duration.EndOfTurn);
|
||||
effect.overrideRuleText(ruleText);
|
||||
this.getSpellAbility().addEffect(effect);
|
||||
}
|
||||
|
||||
public Mutilate(final Mutilate card) {
|
||||
|
|
98
Mage.Sets/src/mage/sets/mirage/SpiritOfTheNight.java
Normal file
98
Mage.Sets/src/mage/sets/mirage/SpiritOfTheNight.java
Normal file
|
@ -0,0 +1,98 @@
|
|||
/*
|
||||
* 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.mirage;
|
||||
|
||||
import mage.Constants;
|
||||
import mage.Constants.CardType;
|
||||
import mage.Constants.Rarity;
|
||||
import mage.MageInt;
|
||||
import mage.ObjectColor;
|
||||
import mage.abilities.common.SimpleStaticAbility;
|
||||
import mage.abilities.condition.common.SourceMatchesFilterCondition;
|
||||
import mage.abilities.decorator.ConditionalContinousEffect;
|
||||
import mage.abilities.effects.common.continious.GainAbilitySourceEffect;
|
||||
import mage.abilities.keyword.*;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.filter.FilterCard;
|
||||
import mage.filter.common.FilterAttackingCreature;
|
||||
import mage.filter.predicate.mageobject.ColorPredicate;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author jeffwadsworth
|
||||
|
||||
*/
|
||||
public class SpiritOfTheNight extends CardImpl<SpiritOfTheNight> {
|
||||
|
||||
private static final FilterCard filter = new FilterCard("Black");
|
||||
|
||||
static {
|
||||
filter.add(new ColorPredicate(ObjectColor.BLACK));
|
||||
}
|
||||
|
||||
String rule = "Spirit of the Night has first strike as long as it's attacking";
|
||||
|
||||
public SpiritOfTheNight(UUID ownerId) {
|
||||
super(ownerId, 44, "Spirit of the Night", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{6}{B}{B}{B}");
|
||||
this.expansionSetCode = "MIR";
|
||||
this.supertype.add("Legendary");
|
||||
this.subtype.add("Demon");
|
||||
this.subtype.add("Spirit");
|
||||
|
||||
this.color.setBlack(true);
|
||||
this.power = new MageInt(6);
|
||||
this.toughness = new MageInt(5);
|
||||
|
||||
// Flying
|
||||
this.addAbility(FlyingAbility.getInstance());
|
||||
|
||||
// Trample
|
||||
this.addAbility(TrampleAbility.getInstance());
|
||||
|
||||
// Haste
|
||||
this.addAbility(HasteAbility.getInstance());
|
||||
|
||||
// protection from black
|
||||
this.addAbility(new ProtectionAbility(filter));
|
||||
|
||||
// Spirit of the Night has first strike as long as it's attacking.
|
||||
ConditionalContinousEffect effect = new ConditionalContinousEffect(new GainAbilitySourceEffect(FirstStrikeAbility.getInstance()), new SourceMatchesFilterCondition(new FilterAttackingCreature()), rule);
|
||||
this.addAbility(new SimpleStaticAbility(Constants.Zone.BATTLEFIELD, effect));
|
||||
}
|
||||
|
||||
public SpiritOfTheNight(final SpiritOfTheNight card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public SpiritOfTheNight copy() {
|
||||
return new SpiritOfTheNight(this);
|
||||
}
|
||||
}
|
|
@ -38,7 +38,7 @@ public class AscendantEvincar extends mage.sets.planechase.AscendantEvincar {
|
|||
public AscendantEvincar(UUID ownerId) {
|
||||
super(ownerId);
|
||||
this.cardNumber = 51;
|
||||
this.expansionSetCode = "NEM";
|
||||
this.expansionSetCode = "NMS";
|
||||
}
|
||||
|
||||
public AscendantEvincar(final AscendantEvincar card) {
|
||||
|
|
|
@ -38,7 +38,7 @@ public class Rhox extends mage.sets.tenth.Rhox {
|
|||
public Rhox(UUID ownerId) {
|
||||
super(ownerId);
|
||||
this.cardNumber = 112;
|
||||
this.expansionSetCode = "NEM";
|
||||
this.expansionSetCode = "NMS";
|
||||
}
|
||||
|
||||
public Rhox(final Rhox card) {
|
||||
|
|
|
@ -38,7 +38,7 @@ public class RootwaterCommando extends mage.sets.tenth.RootwaterCommando {
|
|||
public RootwaterCommando(UUID ownerId) {
|
||||
super(ownerId);
|
||||
this.cardNumber = 39;
|
||||
this.expansionSetCode = "NEM";
|
||||
this.expansionSetCode = "NMS";
|
||||
}
|
||||
|
||||
public RootwaterCommando(final RootwaterCommando card) {
|
||||
|
|
|
@ -38,7 +38,7 @@ public class SealOfDoom extends mage.sets.dissension.SealOfDoom {
|
|||
public SealOfDoom(UUID ownerId) {
|
||||
super(ownerId);
|
||||
this.cardNumber = 70;
|
||||
this.expansionSetCode = "NEM";
|
||||
this.expansionSetCode = "NMS";
|
||||
}
|
||||
|
||||
public SealOfDoom(final SealOfDoom card) {
|
||||
|
|
|
@ -38,7 +38,7 @@ public class SpinelessThug extends mage.sets.tenth.SpinelessThug {
|
|||
public SpinelessThug(UUID ownerId) {
|
||||
super(ownerId);
|
||||
this.cardNumber = 71;
|
||||
this.expansionSetCode = "NEM";
|
||||
this.expansionSetCode = "NMS";
|
||||
}
|
||||
|
||||
public SpinelessThug(final SpinelessThug card) {
|
||||
|
|
88
Mage.Sets/src/mage/sets/ninthedition/Nekrataal.java
Normal file
88
Mage.Sets/src/mage/sets/ninthedition/Nekrataal.java
Normal file
|
@ -0,0 +1,88 @@
|
|||
/*
|
||||
* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without modification, are
|
||||
* permitted provided that the following conditions are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright notice, this list of
|
||||
* conditions and the following disclaimer.
|
||||
*
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
|
||||
* of conditions and the following disclaimer in the documentation and/or other materials
|
||||
* provided with the distribution.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED
|
||||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
|
||||
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR
|
||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
|
||||
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
|
||||
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
* The views and conclusions contained in the software and documentation are those of the
|
||||
* authors and should not be interpreted as representing official policies, either expressed
|
||||
* or implied, of BetaSteward_at_googlemail.com.
|
||||
*/
|
||||
package mage.sets.ninthedition;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.Constants.CardType;
|
||||
import mage.Constants.Rarity;
|
||||
import mage.MageInt;
|
||||
import mage.ObjectColor;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
|
||||
import mage.abilities.effects.common.DestroyTargetEffect;
|
||||
import mage.abilities.keyword.FirstStrikeAbility;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.filter.common.FilterCreaturePermanent;
|
||||
import mage.filter.predicate.Predicates;
|
||||
import mage.filter.predicate.mageobject.CardTypePredicate;
|
||||
import mage.filter.predicate.mageobject.ColorPredicate;
|
||||
import mage.target.common.TargetCreaturePermanent;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author jeffwadsworth
|
||||
*
|
||||
*/
|
||||
public class Nekrataal extends CardImpl<Nekrataal> {
|
||||
|
||||
private final static FilterCreaturePermanent filter = new FilterCreaturePermanent("nonartifact, nonblack creature");
|
||||
|
||||
static {
|
||||
filter.add(Predicates.not(new CardTypePredicate(CardType.ARTIFACT)));
|
||||
filter.add(Predicates.not(new ColorPredicate(ObjectColor.BLACK)));
|
||||
}
|
||||
|
||||
public Nekrataal(UUID ownerId) {
|
||||
super(ownerId, 149, "Nekrataal", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{2}{B}{B}");
|
||||
this.expansionSetCode = "9ED";
|
||||
this.subtype.add("Human");
|
||||
this.subtype.add("Assassin");
|
||||
|
||||
this.color.setBlack(true);
|
||||
this.power = new MageInt(2);
|
||||
this.toughness = new MageInt(1);
|
||||
|
||||
// First strike
|
||||
this.addAbility(FirstStrikeAbility.getInstance());
|
||||
|
||||
// When Nekrataal enters the battlefield, destroy target nonartifact, nonblack creature. That creature can't be regenerated.
|
||||
Ability ability = new EntersBattlefieldTriggeredAbility(new DestroyTargetEffect(true));
|
||||
ability.addTarget(new TargetCreaturePermanent(filter));
|
||||
this.addAbility(ability);
|
||||
|
||||
}
|
||||
|
||||
public Nekrataal(final Nekrataal card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Nekrataal copy() {
|
||||
return new Nekrataal(this);
|
||||
}
|
||||
}
|
114
Mage.Sets/src/mage/sets/prophecy/InfernalGenesis.java
Normal file
114
Mage.Sets/src/mage/sets/prophecy/InfernalGenesis.java
Normal file
|
@ -0,0 +1,114 @@
|
|||
/*
|
||||
* 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.prophecy;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.Constants;
|
||||
import mage.Constants.CardType;
|
||||
import mage.Constants.Rarity;
|
||||
import mage.MageInt;
|
||||
import mage.ObjectColor;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.BeginningOfUpkeepTriggeredAbility;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.cards.Card;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.game.Game;
|
||||
import mage.game.permanent.token.Token;
|
||||
import mage.players.Player;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author jeffwadsworth
|
||||
*/
|
||||
public class InfernalGenesis extends CardImpl<InfernalGenesis> {
|
||||
|
||||
public InfernalGenesis(UUID ownerId) {
|
||||
super(ownerId, 68, "Infernal Genesis", Rarity.RARE, new CardType[]{CardType.ENCHANTMENT}, "{4}{B}{B}");
|
||||
this.expansionSetCode = "PCY";
|
||||
|
||||
this.color.setBlack(true);
|
||||
|
||||
// At the beginning of each player's upkeep, that player puts the top card of his or her library into his or her graveyard. Then he or she puts X 1/1 black Minion creature tokens onto the battlefield, where X is that card's converted mana cost.
|
||||
this.addAbility(new BeginningOfUpkeepTriggeredAbility(new InfernalGenesisEffect(), Constants.TargetController.ANY, false));
|
||||
}
|
||||
|
||||
public InfernalGenesis(final InfernalGenesis card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public InfernalGenesis copy() {
|
||||
return new InfernalGenesis(this);
|
||||
}
|
||||
}
|
||||
|
||||
class InfernalGenesisEffect extends OneShotEffect<InfernalGenesisEffect> {
|
||||
|
||||
InfernalGenesisEffect() {
|
||||
super(Constants.Outcome.BoostCreature);
|
||||
staticText = "that player puts the top card of his or her library into his or her graveyard. Then he or she puts X 1/1 black Minion creature tokens onto the battlefield, where X is that card's converted mana cost";
|
||||
}
|
||||
|
||||
InfernalGenesisEffect(final InfernalGenesisEffect effect) {
|
||||
super(effect);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Player player = game.getPlayer(targetPointer.getFirst(game, source));
|
||||
if (player != null) {
|
||||
Card card = player.getLibrary().removeFromTop(game);
|
||||
if (card != null) {
|
||||
if (card.moveToZone(Constants.Zone.GRAVEYARD, source.getId(), game, false)) {
|
||||
int cmc = card.getManaCost().convertedManaCost();
|
||||
MinionToken token = new MinionToken();
|
||||
token.putOntoBattlefield(cmc, game, id, player.getId());
|
||||
}
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public InfernalGenesisEffect copy() {
|
||||
return new InfernalGenesisEffect(this);
|
||||
}
|
||||
}
|
||||
|
||||
class MinionToken extends Token {
|
||||
|
||||
public MinionToken() {
|
||||
super("Minion", "1/1 black Minion creature token");
|
||||
color = ObjectColor.BLACK;
|
||||
cardType.add(CardType.CREATURE);
|
||||
this.subtype.add("Minion");
|
||||
power = new MageInt(1);
|
||||
toughness = new MageInt(1);
|
||||
}
|
||||
}
|
104
Mage.Sets/src/mage/sets/shadowmoor/BoonReflection.java
Normal file
104
Mage.Sets/src/mage/sets/shadowmoor/BoonReflection.java
Normal file
|
@ -0,0 +1,104 @@
|
|||
/*
|
||||
* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without modification, are
|
||||
* permitted provided that the following conditions are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright notice, this list of
|
||||
* conditions and the following disclaimer.
|
||||
*
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
|
||||
* of conditions and the following disclaimer in the documentation and/or other materials
|
||||
* provided with the distribution.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED
|
||||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
|
||||
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR
|
||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
|
||||
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
|
||||
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
* The views and conclusions contained in the software and documentation are those of the
|
||||
* authors and should not be interpreted as representing official policies, either expressed
|
||||
* or implied, of BetaSteward_at_googlemail.com.
|
||||
*/
|
||||
package mage.sets.shadowmoor;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.Constants;
|
||||
import mage.Constants.CardType;
|
||||
import mage.Constants.Rarity;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.SimpleStaticAbility;
|
||||
import mage.abilities.effects.ReplacementEffectImpl;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.game.Game;
|
||||
import mage.game.events.GameEvent;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author jeffwadsworth
|
||||
*
|
||||
*/
|
||||
public class BoonReflection extends CardImpl<BoonReflection> {
|
||||
|
||||
public BoonReflection(UUID ownerId) {
|
||||
super(ownerId, 5, "Boon Reflection", Rarity.RARE, new CardType[]{CardType.ENCHANTMENT}, "{4}{W}");
|
||||
this.expansionSetCode = "SHM";
|
||||
|
||||
this.color.setWhite(true);
|
||||
|
||||
// If you would gain life, you gain twice that much life instead.
|
||||
this.addAbility(new SimpleStaticAbility(Constants.Zone.BATTLEFIELD, new BoonReflectionEffect()));
|
||||
}
|
||||
|
||||
public BoonReflection(final BoonReflection card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public BoonReflection copy() {
|
||||
return new BoonReflection(this);
|
||||
}
|
||||
}
|
||||
|
||||
class BoonReflectionEffect extends ReplacementEffectImpl<BoonReflectionEffect> {
|
||||
|
||||
public BoonReflectionEffect() {
|
||||
super(Constants.Duration.WhileOnBattlefield, Constants.Outcome.Benefit);
|
||||
staticText = "If you would gain life, you gain twice that much life instead";
|
||||
}
|
||||
|
||||
public BoonReflectionEffect(final BoonReflectionEffect effect) {
|
||||
super(effect);
|
||||
}
|
||||
|
||||
@Override
|
||||
public BoonReflectionEffect copy() {
|
||||
return new BoonReflectionEffect(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean replaceEvent(GameEvent event, Ability source, Game game) {
|
||||
return apply(game, source);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean applies(GameEvent event, Ability source, Game game) {
|
||||
switch (event.getType()) {
|
||||
case GAIN_LIFE:
|
||||
if (event.getPlayerId().equals(source.getControllerId()) && (source.getControllerId() != null)) {
|
||||
event.setAmount(event.getAmount() * 2);
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
65
Mage.Sets/src/mage/sets/shadowmoor/RageReflection.java
Normal file
65
Mage.Sets/src/mage/sets/shadowmoor/RageReflection.java
Normal file
|
@ -0,0 +1,65 @@
|
|||
/*
|
||||
* 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.shadowmoor;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.Constants;
|
||||
import mage.Constants.CardType;
|
||||
import mage.Constants.Rarity;
|
||||
import mage.abilities.common.SimpleStaticAbility;
|
||||
import mage.abilities.effects.common.continious.GainAbilityControlledEffect;
|
||||
import mage.abilities.keyword.DoubleStrikeAbility;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.filter.common.FilterCreaturePermanent;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author jeffwadsworth
|
||||
|
||||
*/
|
||||
public class RageReflection extends CardImpl<RageReflection> {
|
||||
|
||||
public RageReflection(UUID ownerId) {
|
||||
super(ownerId, 104, "Rage Reflection", Rarity.RARE, new CardType[]{CardType.ENCHANTMENT}, "{4}{R}{R}");
|
||||
this.expansionSetCode = "SHM";
|
||||
|
||||
this.color.setRed(true);
|
||||
|
||||
// Creatures you control have double strike.
|
||||
this.addAbility(new SimpleStaticAbility(Constants.Zone.BATTLEFIELD, new GainAbilityControlledEffect(DoubleStrikeAbility.getInstance(), Constants.Duration.WhileOnBattlefield, new FilterCreaturePermanent(), false)));
|
||||
}
|
||||
|
||||
public RageReflection(final RageReflection card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public RageReflection copy() {
|
||||
return new RageReflection(this);
|
||||
}
|
||||
}
|
106
Mage.Sets/src/mage/sets/shadowmoor/SpitefulVisions.java
Normal file
106
Mage.Sets/src/mage/sets/shadowmoor/SpitefulVisions.java
Normal file
|
@ -0,0 +1,106 @@
|
|||
/*
|
||||
* 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.shadowmoor;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.Constants;
|
||||
import mage.Constants.CardType;
|
||||
import mage.Constants.Rarity;
|
||||
import mage.abilities.TriggeredAbility;
|
||||
import mage.abilities.TriggeredAbilityImpl;
|
||||
import mage.abilities.common.BeginningOfDrawTriggeredAbility;
|
||||
import mage.abilities.effects.Effect;
|
||||
import mage.abilities.effects.common.DamageTargetEffect;
|
||||
import mage.abilities.effects.common.DrawCardTargetEffect;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.game.Game;
|
||||
import mage.game.events.GameEvent;
|
||||
import mage.target.targetpointer.FixedTarget;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author jeffwadsworth
|
||||
*/
|
||||
public class SpitefulVisions extends CardImpl<SpitefulVisions> {
|
||||
|
||||
public SpitefulVisions(UUID ownerId) {
|
||||
super(ownerId, 198, "Spiteful Visions", Rarity.RARE, new CardType[]{CardType.ENCHANTMENT}, "{2}{B/R}{B/R}");
|
||||
this.expansionSetCode = "SHM";
|
||||
|
||||
this.color.setRed(true);
|
||||
this.color.setBlack(true);
|
||||
|
||||
// At the beginning of each player's draw step, that player draws an additional card.
|
||||
this.addAbility(new BeginningOfDrawTriggeredAbility(new DrawCardTargetEffect(1), Constants.TargetController.ANY, false));
|
||||
|
||||
// Whenever a player draws a card, Spiteful Visions deals 1 damage to that player.
|
||||
TriggeredAbility triggeredAbility = new SpitefulVisionsTriggeredAbility(new DamageTargetEffect(1), false);
|
||||
this.addAbility(triggeredAbility);
|
||||
}
|
||||
|
||||
public SpitefulVisions(final SpitefulVisions card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public SpitefulVisions copy() {
|
||||
return new SpitefulVisions(this);
|
||||
}
|
||||
}
|
||||
|
||||
class SpitefulVisionsTriggeredAbility extends TriggeredAbilityImpl<SpitefulVisionsTriggeredAbility> {
|
||||
|
||||
public SpitefulVisionsTriggeredAbility(Effect effect, boolean optional) {
|
||||
super(Constants.Zone.BATTLEFIELD, effect, optional);
|
||||
}
|
||||
|
||||
public SpitefulVisionsTriggeredAbility(final SpitefulVisionsTriggeredAbility ability) {
|
||||
super(ability);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean checkTrigger(GameEvent event, Game game) {
|
||||
if (event.getType() == GameEvent.EventType.DREW_CARD && event.getPlayerId() != null) {
|
||||
for (Effect effect : this.getEffects()) {
|
||||
effect.setTargetPointer(new FixedTarget(event.getPlayerId()));
|
||||
}
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getRule() {
|
||||
return "Whenever a player draws a card, Spiteful Visions deals 1 damage to that player.";
|
||||
}
|
||||
|
||||
@Override
|
||||
public SpitefulVisionsTriggeredAbility copy() {
|
||||
return new SpitefulVisionsTriggeredAbility(this);
|
||||
}
|
||||
}
|
104
Mage.Sets/src/mage/sets/shardsofalara/KreshTheBloodbraided.java
Normal file
104
Mage.Sets/src/mage/sets/shardsofalara/KreshTheBloodbraided.java
Normal file
|
@ -0,0 +1,104 @@
|
|||
/*
|
||||
* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without modification, are
|
||||
* permitted provided that the following conditions are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright notice, this list of
|
||||
* conditions and the following disclaimer.
|
||||
*
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
|
||||
* of conditions and the following disclaimer in the documentation and/or other materials
|
||||
* provided with the distribution.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED
|
||||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
|
||||
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR
|
||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
|
||||
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
|
||||
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
* The views and conclusions contained in the software and documentation are those of the
|
||||
* authors and should not be interpreted as representing official policies, either expressed
|
||||
* or implied, of BetaSteward_at_googlemail.com.
|
||||
*/
|
||||
package mage.sets.shardsofalara;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.Constants;
|
||||
import mage.Constants.CardType;
|
||||
import mage.Constants.Rarity;
|
||||
import mage.MageInt;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.DiesCreatureTriggeredAbility;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.cards.Card;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.counters.CounterType;
|
||||
import mage.game.Game;
|
||||
import mage.game.permanent.Permanent;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author jeffwadsworth
|
||||
*/
|
||||
public class KreshTheBloodbraided extends CardImpl<KreshTheBloodbraided> {
|
||||
|
||||
public KreshTheBloodbraided(UUID ownerId) {
|
||||
super(ownerId, 178, "Kresh the Bloodbraided", Rarity.MYTHIC, new CardType[]{CardType.CREATURE}, "{2}{B}{R}{G}");
|
||||
this.expansionSetCode = "ALA";
|
||||
this.supertype.add("Legendary");
|
||||
this.subtype.add("Human");
|
||||
this.subtype.add("Warrior");
|
||||
|
||||
this.color.setRed(true);
|
||||
this.color.setGreen(true);
|
||||
this.color.setBlack(true);
|
||||
this.power = new MageInt(3);
|
||||
this.toughness = new MageInt(3);
|
||||
|
||||
// Whenever another creature dies, you may put X +1/+1 counters on Kresh the Bloodbraided, where X is that creature's power.
|
||||
this.addAbility(new DiesCreatureTriggeredAbility(new KreshTheBloodbraidedEffect(), true, true));
|
||||
}
|
||||
|
||||
public KreshTheBloodbraided(final KreshTheBloodbraided card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public KreshTheBloodbraided copy() {
|
||||
return new KreshTheBloodbraided(this);
|
||||
}
|
||||
}
|
||||
|
||||
class KreshTheBloodbraidedEffect extends OneShotEffect<KreshTheBloodbraidedEffect> {
|
||||
|
||||
KreshTheBloodbraidedEffect() {
|
||||
super(Constants.Outcome.BoostCreature);
|
||||
staticText = "you may put X +1/+1 counters on Kresh the Bloodbraided, where X is that creature's power";
|
||||
}
|
||||
|
||||
KreshTheBloodbraidedEffect(final KreshTheBloodbraidedEffect effect) {
|
||||
super(effect);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Card creature = game.getCard(targetPointer.getFirst(game, source));
|
||||
Permanent KreshTheBloodbraided = game.getPermanent(source.getSourceId());
|
||||
|
||||
if (creature != null && KreshTheBloodbraided != null) {
|
||||
KreshTheBloodbraided.addCounters(CounterType.P1P1.createInstance(creature.getPower().getValue()), game);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public KreshTheBloodbraidedEffect copy() {
|
||||
return new KreshTheBloodbraidedEffect(this);
|
||||
}
|
||||
}
|
155
Mage.Sets/src/mage/sets/shardsofalara/PrinceOfThralls.java
Normal file
155
Mage.Sets/src/mage/sets/shardsofalara/PrinceOfThralls.java
Normal file
|
@ -0,0 +1,155 @@
|
|||
/*
|
||||
* 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.shardsofalara;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.Constants;
|
||||
import mage.Constants.CardType;
|
||||
import mage.Constants.Rarity;
|
||||
import mage.Constants.Zone;
|
||||
import mage.MageInt;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.TriggeredAbilityImpl;
|
||||
import mage.abilities.costs.common.PayLifeCost;
|
||||
import mage.abilities.effects.Effect;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.cards.Card;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.game.Game;
|
||||
import mage.game.events.GameEvent;
|
||||
import mage.game.events.ZoneChangeEvent;
|
||||
import mage.game.permanent.Permanent;
|
||||
import mage.players.Player;
|
||||
import mage.target.targetpointer.FixedTarget;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author jeffwadsworth
|
||||
*/
|
||||
public class PrinceOfThralls extends CardImpl<PrinceOfThralls> {
|
||||
|
||||
public PrinceOfThralls(UUID ownerId) {
|
||||
super(ownerId, 182, "Prince of Thralls", Rarity.MYTHIC, new CardType[]{CardType.CREATURE}, "{4}{U}{B}{B}{R}");
|
||||
this.expansionSetCode = "ALA";
|
||||
this.subtype.add("Demon");
|
||||
|
||||
this.color.setRed(true);
|
||||
this.color.setBlue(true);
|
||||
this.color.setBlack(true);
|
||||
this.power = new MageInt(7);
|
||||
this.toughness = new MageInt(7);
|
||||
|
||||
// Whenever a permanent an opponent controls is put into a graveyard, put that card onto the battlefield under your control unless that opponent pays 3 life.
|
||||
this.addAbility(new PrinceOfThrallsTriggeredAbility(new PrinceOfThrallsEffect()));
|
||||
}
|
||||
|
||||
public PrinceOfThralls(final PrinceOfThralls card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PrinceOfThralls copy() {
|
||||
return new PrinceOfThralls(this);
|
||||
}
|
||||
}
|
||||
|
||||
class PrinceOfThrallsTriggeredAbility extends TriggeredAbilityImpl<PrinceOfThrallsTriggeredAbility> {
|
||||
|
||||
PrinceOfThrallsTriggeredAbility(Effect effect) {
|
||||
super(Constants.Zone.BATTLEFIELD, effect, false);
|
||||
}
|
||||
|
||||
PrinceOfThrallsTriggeredAbility(final PrinceOfThrallsTriggeredAbility ability) {
|
||||
super(ability);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PrinceOfThrallsTriggeredAbility copy() {
|
||||
return new PrinceOfThrallsTriggeredAbility(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean checkTrigger(GameEvent event, Game game) {
|
||||
if (event.getType() == GameEvent.EventType.ZONE_CHANGE) {
|
||||
ZoneChangeEvent zEvent = (ZoneChangeEvent) event;
|
||||
if (zEvent.getToZone() == Zone.GRAVEYARD) {
|
||||
if (zEvent.getFromZone() == Zone.BATTLEFIELD) {
|
||||
Permanent permanent = (Permanent) game.getLastKnownInformation(event.getTargetId(), Constants.Zone.BATTLEFIELD);
|
||||
if (game.getOpponents(this.getControllerId()).contains(permanent.getControllerId())) {
|
||||
for (Effect effect : getEffects()) {
|
||||
effect.setTargetPointer(new FixedTarget(event.getTargetId()));
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getRule() {
|
||||
return "Whenever a permanent an opponent controls is put into a graveyard, " + super.getRule();
|
||||
}
|
||||
}
|
||||
|
||||
class PrinceOfThrallsEffect extends OneShotEffect<PrinceOfThrallsEffect> {
|
||||
|
||||
public PrinceOfThrallsEffect() {
|
||||
super(Constants.Outcome.Neutral);
|
||||
this.staticText = "put that card onto the battlefield under your control unless that opponent pays 3 life";
|
||||
}
|
||||
|
||||
public PrinceOfThrallsEffect(final PrinceOfThrallsEffect effect) {
|
||||
super(effect);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PrinceOfThrallsEffect copy() {
|
||||
return new PrinceOfThrallsEffect(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Card card = game.getCard(targetPointer.getFirst(game, source));
|
||||
Permanent permanent = (Permanent) game.getLastKnownInformation(card.getId(), Constants.Zone.BATTLEFIELD);
|
||||
Player opponent = game.getPlayer(permanent.getControllerId());
|
||||
if (opponent != null && card != null && permanent != null && source.getControllerId() != null) {
|
||||
PayLifeCost cost = new PayLifeCost(3);
|
||||
if (opponent.chooseUse(Constants.Outcome.Neutral, cost.getText() + " or " + permanent.getName() + " comes back into the battlefield under opponents control", game)) {
|
||||
cost.clearPaid();
|
||||
if (cost.pay(source, game, source.getId(), opponent.getId(), true)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
card.putOntoBattlefield(game, Zone.GRAVEYARD, id, source.getControllerId());
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
106
Mage.Sets/src/mage/sets/tempest/FurnaceOfRath.java
Normal file
106
Mage.Sets/src/mage/sets/tempest/FurnaceOfRath.java
Normal file
|
@ -0,0 +1,106 @@
|
|||
/*
|
||||
* 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.tempest;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.Constants;
|
||||
import mage.Constants.CardType;
|
||||
import mage.Constants.Rarity;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.SimpleStaticAbility;
|
||||
import mage.abilities.effects.ReplacementEffectImpl;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.game.Game;
|
||||
import mage.game.events.GameEvent;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author jeffwadsworth
|
||||
*
|
||||
*/
|
||||
public class FurnaceOfRath extends CardImpl<FurnaceOfRath> {
|
||||
|
||||
public FurnaceOfRath(UUID ownerId) {
|
||||
super(ownerId, 177, "Furnace of Rath", Rarity.RARE, new CardType[]{CardType.ENCHANTMENT}, "{1}{R}{R}{R}");
|
||||
this.expansionSetCode = "TMP";
|
||||
|
||||
this.color.setRed(true);
|
||||
|
||||
// If a source would deal damage to a creature or player, it deals double that damage to that creature or player instead.
|
||||
this.addAbility(new SimpleStaticAbility(Constants.Zone.BATTLEFIELD, new FurnaceOfRathEffect()));
|
||||
}
|
||||
|
||||
public FurnaceOfRath(final FurnaceOfRath card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public FurnaceOfRath copy() {
|
||||
return new FurnaceOfRath(this);
|
||||
}
|
||||
}
|
||||
|
||||
class FurnaceOfRathEffect extends ReplacementEffectImpl<FurnaceOfRathEffect> {
|
||||
|
||||
public FurnaceOfRathEffect() {
|
||||
super(Constants.Duration.WhileOnBattlefield, Constants.Outcome.Damage);
|
||||
staticText = "If a source would deal damage to a creature or player, that source deals double that damage to that creature or player instead";
|
||||
}
|
||||
|
||||
public FurnaceOfRathEffect(final FurnaceOfRathEffect effect) {
|
||||
super(effect);
|
||||
}
|
||||
|
||||
@Override
|
||||
public FurnaceOfRathEffect copy() {
|
||||
return new FurnaceOfRathEffect(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean applies(GameEvent event, Ability source, Game game) {
|
||||
switch (event.getType()) {
|
||||
case DAMAGE_PLAYER:
|
||||
event.setAmount(event.getAmount() * 2);
|
||||
return true;
|
||||
case DAMAGE_CREATURE:
|
||||
event.setAmount(event.getAmount() * 2);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean replaceEvent(GameEvent event, Ability source, Game game) {
|
||||
return apply(game, source);
|
||||
}
|
||||
}
|
53
Mage.Sets/src/mage/sets/tenth/Nekrataal.java
Normal file
53
Mage.Sets/src/mage/sets/tenth/Nekrataal.java
Normal file
|
@ -0,0 +1,53 @@
|
|||
/*
|
||||
* 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.tenth;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author jeffwadsworth
|
||||
|
||||
*/
|
||||
public class Nekrataal extends mage.sets.ninthedition.Nekrataal {
|
||||
|
||||
public Nekrataal(UUID ownerId) {
|
||||
super(ownerId);
|
||||
this.cardNumber = 163;
|
||||
this.expansionSetCode = "10E";
|
||||
}
|
||||
|
||||
public Nekrataal(final Nekrataal card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Nekrataal copy() {
|
||||
return new Nekrataal(this);
|
||||
}
|
||||
}
|
116
Mage.Sets/src/mage/sets/tenth/ThrullSurgeon.java
Normal file
116
Mage.Sets/src/mage/sets/tenth/ThrullSurgeon.java
Normal file
|
@ -0,0 +1,116 @@
|
|||
/*
|
||||
* 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.tenth;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.Constants;
|
||||
import mage.Constants.CardType;
|
||||
import mage.Constants.Rarity;
|
||||
import mage.MageInt;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.ActivateAsSorceryActivatedAbility;
|
||||
import mage.abilities.costs.common.SacrificeSourceCost;
|
||||
import mage.abilities.costs.mana.ManaCostsImpl;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.cards.Card;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.filter.FilterCard;
|
||||
import mage.game.Game;
|
||||
import mage.players.Player;
|
||||
import mage.target.TargetCard;
|
||||
import mage.target.TargetPlayer;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author jeffwadsworth
|
||||
*
|
||||
*/
|
||||
public class ThrullSurgeon extends CardImpl<ThrullSurgeon> {
|
||||
|
||||
public ThrullSurgeon(UUID ownerId) {
|
||||
super(ownerId, 183, "Thrull Surgeon", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{1}{B}");
|
||||
this.expansionSetCode = "10E";
|
||||
this.subtype.add("Thrull");
|
||||
|
||||
this.color.setBlack(true);
|
||||
this.power = new MageInt(1);
|
||||
this.toughness = new MageInt(1);
|
||||
|
||||
// {1}{B}, Sacrifice Thrull Surgeon: Look at target player's hand and choose a card from it. That player discards that card. Activate this ability only any time you could cast a sorcery.
|
||||
Ability ability = new ActivateAsSorceryActivatedAbility(Constants.Zone.BATTLEFIELD, new ThrullSurgeonEffect(), new ManaCostsImpl("{1}{B}"));
|
||||
ability.addCost(new SacrificeSourceCost());
|
||||
ability.addTarget(new TargetPlayer());
|
||||
this.addAbility(ability);
|
||||
}
|
||||
|
||||
public ThrullSurgeon(final ThrullSurgeon card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ThrullSurgeon copy() {
|
||||
return new ThrullSurgeon(this);
|
||||
}
|
||||
}
|
||||
|
||||
class ThrullSurgeonEffect extends OneShotEffect<ThrullSurgeonEffect> {
|
||||
|
||||
public ThrullSurgeonEffect() {
|
||||
super(Constants.Outcome.Discard);
|
||||
staticText = "Look at target player's hand and choose a card from it. That player discards that card.";
|
||||
}
|
||||
|
||||
public ThrullSurgeonEffect(final ThrullSurgeonEffect effect) {
|
||||
super(effect);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Player targetPlayer = game.getPlayer(source.getFirstTarget());
|
||||
Player you = game.getPlayer(source.getControllerId());
|
||||
if (targetPlayer != null && you != null) {
|
||||
you.lookAtCards("Discard", targetPlayer.getHand(), game);
|
||||
TargetCard target = new TargetCard(Constants.Zone.PICK, new FilterCard());
|
||||
target.setRequired(true);
|
||||
target.setNotTarget(true);
|
||||
if (you.choose(Constants.Outcome.Benefit, targetPlayer.getHand(), target, game)) {
|
||||
Card card = targetPlayer.getHand().get(target.getFirstTarget(), game);
|
||||
if (card != null) {
|
||||
return targetPlayer.discard(card, source, game);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ThrullSurgeonEffect copy() {
|
||||
return new ThrullSurgeonEffect(this);
|
||||
}
|
||||
}
|
53
Mage.Sets/src/mage/sets/visions/Nekrataal.java
Normal file
53
Mage.Sets/src/mage/sets/visions/Nekrataal.java
Normal file
|
@ -0,0 +1,53 @@
|
|||
/*
|
||||
* 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.visions;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author jeffwadsworth
|
||||
|
||||
*/
|
||||
public class Nekrataal extends mage.sets.ninthedition.Nekrataal {
|
||||
|
||||
public Nekrataal(UUID ownerId) {
|
||||
super(ownerId);
|
||||
this.cardNumber = 16;
|
||||
this.expansionSetCode = "VIS";
|
||||
}
|
||||
|
||||
public Nekrataal(final Nekrataal card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Nekrataal copy() {
|
||||
return new Nekrataal(this);
|
||||
}
|
||||
}
|
120
Mage.Sets/src/mage/sets/weatherlight/OrcishSettlers.java
Normal file
120
Mage.Sets/src/mage/sets/weatherlight/OrcishSettlers.java
Normal file
|
@ -0,0 +1,120 @@
|
|||
/*
|
||||
* 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.weatherlight;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
import mage.Constants;
|
||||
import mage.Constants.CardType;
|
||||
import mage.Constants.Rarity;
|
||||
import mage.MageInt;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.SimpleActivatedAbility;
|
||||
import mage.abilities.costs.common.SacrificeSourceCost;
|
||||
import mage.abilities.costs.common.TapSourceCost;
|
||||
import mage.abilities.costs.mana.ManaCostsImpl;
|
||||
import mage.abilities.dynamicvalue.common.ManacostVariableValue;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.game.Game;
|
||||
import mage.game.permanent.Permanent;
|
||||
import mage.players.Player;
|
||||
import mage.target.common.TargetLandPermanent;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author jeffwadsworth
|
||||
*
|
||||
*/
|
||||
public class OrcishSettlers extends CardImpl<OrcishSettlers> {
|
||||
|
||||
public OrcishSettlers(UUID ownerId) {
|
||||
super(ownerId, 112, "Orcish Settlers", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{1}{R}");
|
||||
this.expansionSetCode = "WTH";
|
||||
this.subtype.add("Orc");
|
||||
|
||||
this.color.setRed(true);
|
||||
this.power = new MageInt(1);
|
||||
this.toughness = new MageInt(1);
|
||||
|
||||
// {X}{X}{R}, {tap}, Sacrifice Orcish Settlers: Destroy X target lands.
|
||||
Ability ability = new SimpleActivatedAbility(Constants.Zone.BATTLEFIELD, new OrcishSettlersEffect(), new ManaCostsImpl("{X}{X}{R}"));
|
||||
ability.addCost(new TapSourceCost());
|
||||
ability.addCost(new SacrificeSourceCost());
|
||||
this.addAbility(ability);
|
||||
}
|
||||
|
||||
public OrcishSettlers(final OrcishSettlers card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public OrcishSettlers copy() {
|
||||
return new OrcishSettlers(this);
|
||||
}
|
||||
}
|
||||
|
||||
class OrcishSettlersEffect extends OneShotEffect<OrcishSettlersEffect> {
|
||||
|
||||
public OrcishSettlersEffect() {
|
||||
super(Constants.Outcome.DestroyPermanent);
|
||||
this.staticText = "Destroy X target lands";
|
||||
}
|
||||
|
||||
public OrcishSettlersEffect(final OrcishSettlersEffect effect) {
|
||||
super(effect);
|
||||
}
|
||||
|
||||
@Override
|
||||
public OrcishSettlersEffect copy() {
|
||||
return new OrcishSettlersEffect(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
int amount = new ManacostVariableValue().calculate(game, source);
|
||||
TargetLandPermanent target = new TargetLandPermanent(amount);
|
||||
|
||||
Player player = game.getPlayer(source.getControllerId());
|
||||
if (player == null) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (player.choose(Constants.Outcome.DestroyPermanent, target, id, game)) {
|
||||
List<UUID> targets = target.getTargets();
|
||||
for (UUID landId : targets) {
|
||||
Permanent land = game.getPermanent(landId);
|
||||
if (land != null) {
|
||||
land.destroy(landId, game, false);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
142
Mage.Sets/src/mage/sets/worldwake/MarshalsAnthem.java
Normal file
142
Mage.Sets/src/mage/sets/worldwake/MarshalsAnthem.java
Normal file
|
@ -0,0 +1,142 @@
|
|||
/*
|
||||
* 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.worldwake;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
import mage.Constants;
|
||||
import mage.Constants.CardType;
|
||||
import mage.Constants.Rarity;
|
||||
import mage.Constants.TargetController;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
|
||||
import mage.abilities.common.SimpleStaticAbility;
|
||||
import mage.abilities.costs.mana.ManaCostsImpl;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.abilities.effects.common.continious.BoostAllEffect;
|
||||
import mage.abilities.keyword.MultikickerAbility;
|
||||
import mage.cards.Card;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.filter.FilterCard;
|
||||
import mage.filter.common.FilterCreaturePermanent;
|
||||
import mage.filter.predicate.mageobject.CardTypePredicate;
|
||||
import mage.filter.predicate.permanent.ControllerPredicate;
|
||||
import mage.game.Game;
|
||||
import mage.game.permanent.Permanent;
|
||||
import mage.players.Player;
|
||||
import mage.target.common.TargetCardInYourGraveyard;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author jeffwadsworth
|
||||
*
|
||||
*/
|
||||
public class MarshalsAnthem extends CardImpl<MarshalsAnthem> {
|
||||
|
||||
private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("Creatures you control");
|
||||
|
||||
static {
|
||||
filter.add(new ControllerPredicate(TargetController.YOU));
|
||||
}
|
||||
protected static final String rule = "return up to X target creature cards from your graveyard to the battlefield, where X is the number of times Marshal's Anthem was kicked";
|
||||
|
||||
public MarshalsAnthem(UUID ownerId) {
|
||||
super(ownerId, 15, "Marshal's Anthem", Rarity.RARE, new CardType[]{CardType.ENCHANTMENT}, "{2}{W}{W}");
|
||||
this.expansionSetCode = "WWK";
|
||||
|
||||
this.color.setWhite(true);
|
||||
|
||||
// Multikicker {1}{W}
|
||||
MultikickerAbility ability = new MultikickerAbility(new EmptyEffect(rule), false);
|
||||
ability.addManaCost(new ManaCostsImpl("{1}{W}"));
|
||||
this.addAbility(ability);
|
||||
|
||||
// Creatures you control get +1/+1.
|
||||
this.addAbility(new SimpleStaticAbility(Constants.Zone.BATTLEFIELD, new BoostAllEffect(1, 1, Constants.Duration.WhileOnBattlefield, filter, false)));
|
||||
|
||||
// When Marshal's Anthem enters the battlefield, return up to X target creature cards from your graveyard to the battlefield, where X is the number of times Marshal's Anthem was kicked.
|
||||
this.addAbility(new EntersBattlefieldTriggeredAbility(new MarshalsAnthemEffect()));
|
||||
}
|
||||
|
||||
public MarshalsAnthem(final MarshalsAnthem card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public MarshalsAnthem copy() {
|
||||
return new MarshalsAnthem(this);
|
||||
}
|
||||
}
|
||||
|
||||
class MarshalsAnthemEffect extends OneShotEffect<MarshalsAnthemEffect> {
|
||||
|
||||
public MarshalsAnthemEffect() {
|
||||
super(Constants.Outcome.PutCreatureInPlay);
|
||||
this.staticText = "return up to X target creature cards from your graveyard to the battlefield, where X is the number of times {this} was kicked";
|
||||
}
|
||||
|
||||
public MarshalsAnthemEffect(final MarshalsAnthemEffect effect) {
|
||||
super(effect);
|
||||
}
|
||||
|
||||
@Override
|
||||
public MarshalsAnthemEffect copy() {
|
||||
return new MarshalsAnthemEffect(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
FilterCard filter = new FilterCard("creature card in your graveyard");
|
||||
filter.add(new CardTypePredicate(CardType.CREATURE));
|
||||
Player you = game.getPlayer(source.getControllerId());
|
||||
Permanent permanent = game.getPermanent(source.getSourceId());
|
||||
if (permanent != null) {
|
||||
for (Ability ability : permanent.getAbilities()) {
|
||||
if (ability instanceof MultikickerAbility) {
|
||||
int count = Math.min(you.getGraveyard().size(), ((MultikickerAbility) ability).getActivateCount());
|
||||
TargetCardInYourGraveyard target = new TargetCardInYourGraveyard(0, count, filter);
|
||||
if (you != null) {
|
||||
if (target.canChoose(source.getControllerId(), game) && target.choose(Constants.Outcome.Neutral, source.getControllerId(), source.getId(), game)) {
|
||||
if (!target.getTargets().isEmpty()) {
|
||||
List<UUID> targets = target.getTargets();
|
||||
for (UUID targetId : targets) {
|
||||
Card card = game.getCard(targetId);
|
||||
if (card != null) {
|
||||
card.putOntoBattlefield(game, Constants.Zone.GRAVEYARD, source.getId(), you.getId());
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
|
@ -48,7 +48,7 @@ import mage.target.TargetPermanent;
|
|||
public class DevoutLightcaster extends CardImpl<DevoutLightcaster> {
|
||||
|
||||
private static final FilterCard filterProtection = new FilterCard("Black");
|
||||
private static final FilterPermanent filterTarget = new FilterPermanent("Black");
|
||||
private static final FilterPermanent filterTarget = new FilterPermanent("black permanent");
|
||||
|
||||
static {
|
||||
filterProtection.add(new ColorPredicate(ObjectColor.BLACK));
|
||||
|
|
|
@ -0,0 +1,114 @@
|
|||
package org.mage.test.cards.continuous;
|
||||
|
||||
import mage.Constants;
|
||||
import mage.abilities.keyword.IslandwalkAbility;
|
||||
import org.junit.Test;
|
||||
import org.mage.test.serverside.base.CardTestPlayerBase;
|
||||
|
||||
/**
|
||||
* @author magenoxx_at_gmail.com
|
||||
*/
|
||||
public class MasterOfThePearlTridentTest extends CardTestPlayerBase {
|
||||
|
||||
@Test
|
||||
public void testLordAbility() {
|
||||
addCard(Constants.Zone.BATTLEFIELD, playerA, "Island", 2);
|
||||
addCard(Constants.Zone.HAND, playerA, "Master of the Pearl Trident");
|
||||
addCard(Constants.Zone.BATTLEFIELD, playerA, "Merfolk of the Pearl Trident");
|
||||
|
||||
addCard(Constants.Zone.BATTLEFIELD, playerB, "Llanowar Elves");
|
||||
addCard(Constants.Zone.BATTLEFIELD, playerB, "Island");
|
||||
|
||||
castSpell(1, Constants.PhaseStep.PRECOMBAT_MAIN, playerA, "Master of the Pearl Trident");
|
||||
|
||||
attack(3, playerA, "Merfolk of the Pearl Trident");
|
||||
block(3, playerB, "Llanowar Elves", "Merfolk of the Pearl Trident");
|
||||
|
||||
setStopAt(3, Constants.PhaseStep.END_TURN);
|
||||
execute();
|
||||
|
||||
|
||||
assertPermanentCount(playerA, "Master of the Pearl Trident", 1);
|
||||
assertLife(playerB, 18);
|
||||
assertPowerToughness(playerA, "Merfolk of the Pearl Trident", 2, 2);
|
||||
assertAbility(playerA, "Merfolk of the Pearl Trident", new IslandwalkAbility(), true);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testLordAbilityGone() {
|
||||
addCard(Constants.Zone.BATTLEFIELD, playerA, "Island", 2);
|
||||
addCard(Constants.Zone.HAND, playerA, "Master of the Pearl Trident");
|
||||
addCard(Constants.Zone.BATTLEFIELD, playerA, "Merfolk of the Pearl Trident");
|
||||
|
||||
addCard(Constants.Zone.BATTLEFIELD, playerB, "Swamp", 3);
|
||||
addCard(Constants.Zone.BATTLEFIELD, playerB, "Llanowar Elves");
|
||||
addCard(Constants.Zone.BATTLEFIELD, playerB, "Island");
|
||||
addCard(Constants.Zone.HAND, playerB, "Murder");
|
||||
|
||||
castSpell(1, Constants.PhaseStep.PRECOMBAT_MAIN, playerA, "Master of the Pearl Trident");
|
||||
castSpell(3, Constants.PhaseStep.DECLARE_ATTACKERS, playerB, "Murder", "Master of the Pearl Trident");
|
||||
|
||||
attack(3, playerA, "Merfolk of the Pearl Trident");
|
||||
block(3, playerB, "Llanowar Elves", "Merfolk of the Pearl Trident");
|
||||
|
||||
setStopAt(3, Constants.PhaseStep.END_TURN);
|
||||
execute();
|
||||
|
||||
assertLife(playerB, 20);
|
||||
assertPermanentCount(playerA, "Merfolk of the Pearl Trident", 0);
|
||||
assertPermanentCount(playerB, "Llanowar Elves", 0);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testTurnToFrog() {
|
||||
addCard(Constants.Zone.BATTLEFIELD, playerA, "Island", 2);
|
||||
addCard(Constants.Zone.HAND, playerA, "Master of the Pearl Trident");
|
||||
addCard(Constants.Zone.BATTLEFIELD, playerA, "Merfolk of the Pearl Trident");
|
||||
|
||||
addCard(Constants.Zone.BATTLEFIELD, playerB, "Island", 2);
|
||||
addCard(Constants.Zone.BATTLEFIELD, playerB, "Llanowar Elves");
|
||||
addCard(Constants.Zone.HAND, playerB, "Turn to Frog");
|
||||
|
||||
castSpell(1, Constants.PhaseStep.PRECOMBAT_MAIN, playerA, "Master of the Pearl Trident");
|
||||
castSpell(3, Constants.PhaseStep.DECLARE_ATTACKERS, playerB, "Turn to Frog", "Master of the Pearl Trident");
|
||||
|
||||
attack(3, playerA, "Merfolk of the Pearl Trident");
|
||||
block(3, playerB, "Llanowar Elves", "Merfolk of the Pearl Trident");
|
||||
|
||||
setStopAt(3, Constants.PhaseStep.END_TURN);
|
||||
execute();
|
||||
|
||||
assertLife(playerB, 20);
|
||||
assertPermanentCount(playerA, "Merfolk of the Pearl Trident", 0);
|
||||
assertPermanentCount(playerB, "Llanowar Elves", 0);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testTurnToFrogAndMurder() {
|
||||
addCard(Constants.Zone.BATTLEFIELD, playerA, "Island", 2);
|
||||
addCard(Constants.Zone.HAND, playerA, "Master of the Pearl Trident");
|
||||
addCard(Constants.Zone.BATTLEFIELD, playerA, "Merfolk of the Pearl Trident");
|
||||
|
||||
addCard(Constants.Zone.BATTLEFIELD, playerB, "Island", 2);
|
||||
addCard(Constants.Zone.BATTLEFIELD, playerB, "Swamp", 3);
|
||||
addCard(Constants.Zone.BATTLEFIELD, playerB, "Llanowar Elves");
|
||||
addCard(Constants.Zone.HAND, playerB, "Turn to Frog");
|
||||
addCard(Constants.Zone.HAND, playerB, "Murder");
|
||||
|
||||
castSpell(1, Constants.PhaseStep.PRECOMBAT_MAIN, playerA, "Master of the Pearl Trident");
|
||||
castSpell(3, Constants.PhaseStep.BEGIN_COMBAT, playerB, "Turn to Frog", "Master of the Pearl Trident");
|
||||
castSpell(3, Constants.PhaseStep.DECLARE_ATTACKERS, playerB, "Murder", "Master of the Pearl Trident");
|
||||
|
||||
attack(3, playerA, "Merfolk of the Pearl Trident");
|
||||
block(3, playerB, "Llanowar Elves", "Merfolk of the Pearl Trident");
|
||||
|
||||
setStopAt(3, Constants.PhaseStep.END_TURN);
|
||||
execute();
|
||||
|
||||
assertGraveyardCount(playerB, "Turn to Frog", 1);
|
||||
assertGraveyardCount(playerB, "Murder", 1);
|
||||
assertLife(playerB, 20);
|
||||
assertPermanentCount(playerA, "Merfolk of the Pearl Trident", 0);
|
||||
assertPermanentCount(playerB, "Llanowar Elves", 0);
|
||||
}
|
||||
}
|
|
@ -105,11 +105,14 @@ public class AttackBlockRestrictionsTest extends CardTestPlayerBase {
|
|||
addCard(Constants.Zone.BATTLEFIELD, playerB, "Elite Vanguard");
|
||||
addCard(Constants.Zone.BATTLEFIELD, playerB, "Arbor Elf");
|
||||
addCard(Constants.Zone.BATTLEFIELD, playerB, "Assault Griffin");
|
||||
addCard(Constants.Zone.BATTLEFIELD, playerB, "Sky Ruin Drake");
|
||||
|
||||
addCard(Constants.Zone.BATTLEFIELD, playerA, "Angelic Wall");
|
||||
addCard(Constants.Zone.BATTLEFIELD, playerA, "Air Elemental");
|
||||
addCard(Constants.Zone.BATTLEFIELD, playerA, "Llanowar Elves");
|
||||
addCard(Constants.Zone.BATTLEFIELD, playerA, "Sentinel Spider");
|
||||
|
||||
// attacker vs. blocker:
|
||||
// non flying vs. flying
|
||||
attack(2, playerB, "Elite Vanguard");
|
||||
block(2, playerA, "Angelic Wall", "Elite Vanguard");
|
||||
|
@ -119,6 +122,9 @@ public class AttackBlockRestrictionsTest extends CardTestPlayerBase {
|
|||
// flying vs. flying
|
||||
attack(2, playerB, "Assault Griffin");
|
||||
block(2, playerA, "Air Elemental", "Assault Griffin");
|
||||
// flying vs. reach
|
||||
attack(2, playerB, "Sky Ruin Drake");
|
||||
block(2, playerA, "Sentinel Spider", "Sky Ruin Drake");
|
||||
|
||||
setStopAt(2, Constants.PhaseStep.END_TURN);
|
||||
execute();
|
||||
|
@ -145,6 +151,7 @@ public class AttackBlockRestrictionsTest extends CardTestPlayerBase {
|
|||
addCard(Constants.Zone.BATTLEFIELD, playerA, "Forest", 2);
|
||||
addCard(Constants.Zone.HAND, playerA, "Naturalize");
|
||||
|
||||
// attacker vs. blocker:
|
||||
// non flying vs. flying
|
||||
attack(2, playerB, "Elite Vanguard");
|
||||
block(2, playerA, "Angelic Wall", "Elite Vanguard");
|
||||
|
@ -167,7 +174,7 @@ public class AttackBlockRestrictionsTest extends CardTestPlayerBase {
|
|||
}
|
||||
|
||||
/**
|
||||
* Tests "Creatures with flying can't block creatures you control"
|
||||
* Tests "Creatures with power less than Champion of Lambholt's power can't block creatures you control."
|
||||
*/
|
||||
@Test
|
||||
public void testChampionOfLambholt() {
|
||||
|
|
|
@ -362,7 +362,7 @@ public abstract class CardTestPlayerAPIImpl extends MageTestPlayerBase implement
|
|||
* @param player
|
||||
* @param cardName
|
||||
* @param ability
|
||||
* @param flag true if creature should contain ability, false otherwise
|
||||
* @param flag true if creature should contain ability, false if it should NOT contain it instead
|
||||
* @throws AssertionError
|
||||
*/
|
||||
public void assertAbility(Player player, String cardName, Ability ability, boolean flag) throws AssertionError {
|
||||
|
|
|
@ -50,7 +50,7 @@ public class CantBlockAbility extends SimpleStaticAbility implements MageSinglet
|
|||
class CantBlockEffect extends RestrictionEffect<CantBlockEffect> implements MageSingleton {
|
||||
|
||||
public CantBlockEffect() {
|
||||
super(Duration.WhileOnBattlefield);
|
||||
super(Duration.EndOfGame);
|
||||
}
|
||||
|
||||
public CantBlockEffect(final CantBlockEffect effect) {
|
||||
|
|
|
@ -9,6 +9,7 @@ import mage.game.Game;
|
|||
import mage.game.events.GameEvent;
|
||||
import mage.game.events.ZoneChangeEvent;
|
||||
import mage.game.permanent.Permanent;
|
||||
import mage.target.targetpointer.FixedTarget;
|
||||
|
||||
/**
|
||||
* @author North
|
||||
|
@ -16,6 +17,7 @@ import mage.game.permanent.Permanent;
|
|||
public class DiesCreatureTriggeredAbility extends TriggeredAbilityImpl<DiesCreatureTriggeredAbility> {
|
||||
|
||||
protected FilterCreaturePermanent filter;
|
||||
private boolean setTargetPointer;
|
||||
|
||||
public DiesCreatureTriggeredAbility(Effect effect, boolean optional) {
|
||||
this(effect, optional, new FilterCreaturePermanent("a creature"));
|
||||
|
@ -25,6 +27,12 @@ public class DiesCreatureTriggeredAbility extends TriggeredAbilityImpl<DiesCreat
|
|||
this(effect, optional, new FilterCreaturePermanent("another creature"));
|
||||
filter.add(new AnotherPredicate());
|
||||
}
|
||||
|
||||
public DiesCreatureTriggeredAbility(Effect effect, boolean optional, boolean another, boolean setTargetPointer) {
|
||||
this(effect, optional, new FilterCreaturePermanent("another creature"));
|
||||
filter.add(new AnotherPredicate());
|
||||
this.setTargetPointer = setTargetPointer;
|
||||
}
|
||||
|
||||
public DiesCreatureTriggeredAbility(Effect effect, boolean optional, FilterCreaturePermanent filter) {
|
||||
super(Zone.BATTLEFIELD, effect, optional);
|
||||
|
@ -55,6 +63,11 @@ public class DiesCreatureTriggeredAbility extends TriggeredAbilityImpl<DiesCreat
|
|||
if (zEvent.getFromZone() == Zone.BATTLEFIELD && zEvent.getToZone() == Zone.GRAVEYARD) {
|
||||
Permanent permanent = (Permanent) game.getLastKnownInformation(event.getTargetId(), Zone.BATTLEFIELD);
|
||||
if (permanent != null && filter.match(permanent, sourceId, controllerId, game)) {
|
||||
if (setTargetPointer) {
|
||||
for (Effect effect : this.getEffects()) {
|
||||
effect.setTargetPointer(new FixedTarget(event.getTargetId()));
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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.abilities.condition.common;
|
||||
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.condition.Condition;
|
||||
import mage.filter.common.FilterCreaturePermanent;
|
||||
import mage.game.Game;
|
||||
import mage.game.permanent.Permanent;
|
||||
|
||||
|
||||
/**
|
||||
* Describes condition when source matches specified filter
|
||||
*
|
||||
* @author magenoxx_at_gmail.com
|
||||
*/
|
||||
public class SourceMatchesFilterCondition implements Condition {
|
||||
|
||||
private FilterCreaturePermanent filter;
|
||||
|
||||
public SourceMatchesFilterCondition(FilterCreaturePermanent filter) {
|
||||
this.filter = filter;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Permanent permanent = game.getBattlefield().getPermanent(source.getSourceId());
|
||||
if (permanent != null) {
|
||||
if (filter.match(permanent, permanent.getId(), permanent.getControllerId(), game)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
|
@ -40,6 +40,7 @@ import mage.game.Game;
|
|||
import mage.game.events.GameEvent;
|
||||
import mage.game.events.ZoneChangeEvent;
|
||||
import mage.players.Player;
|
||||
import mage.target.Target;
|
||||
|
||||
/**
|
||||
*
|
||||
|
@ -106,6 +107,9 @@ class FlashbackEffect extends OneShotEffect<FlashbackEffect> {
|
|||
card.getSpellAbility().clear();
|
||||
int amount = source.getManaCostsToPay().getX();
|
||||
card.getSpellAbility().getManaCostsToPay().setX(amount);
|
||||
for (Target target : card.getSpellAbility().getTargets()) {
|
||||
target.setRequired(true);
|
||||
}
|
||||
return controller.cast(card.getSpellAbility(), game, true);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -42,6 +42,7 @@ import mage.players.Player;
|
|||
import mage.players.PlayerList;
|
||||
import mage.target.common.TargetDefender;
|
||||
import mage.util.Copyable;
|
||||
import mage.util.trace.TraceUtil;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.*;
|
||||
|
@ -210,6 +211,7 @@ public class Combat implements Serializable, Copyable<Combat> {
|
|||
}
|
||||
game.fireEvent(GameEvent.getEvent(GameEvent.EventType.DECLARED_BLOCKERS, defenderId, defenderId));
|
||||
}
|
||||
TraceUtil.traceCombatIfNeeded(game, this);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
123
Mage/src/mage/util/trace/TraceUtil.java
Normal file
123
Mage/src/mage/util/trace/TraceUtil.java
Normal file
|
@ -0,0 +1,123 @@
|
|||
package mage.util.trace;
|
||||
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.effects.RestrictionEffect;
|
||||
import mage.abilities.keyword.FlyingAbility;
|
||||
import mage.abilities.keyword.ReachAbility;
|
||||
import mage.abilities.keyword.UnblockableAbility;
|
||||
import mage.game.Game;
|
||||
import mage.game.combat.Combat;
|
||||
import mage.game.combat.CombatGroup;
|
||||
import mage.game.permanent.Permanent;
|
||||
import org.apache.log4j.Logger;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
* @author magenoxx_at_gmail.com
|
||||
*/
|
||||
public class TraceUtil {
|
||||
|
||||
private static final Logger log = Logger.getLogger(TraceUtil.class);
|
||||
|
||||
/**
|
||||
* This method is intended to catch various bugs with combat.
|
||||
*
|
||||
* One of them (possibly the most annoying) is when creature without flying or reach blocks creature with flying.
|
||||
* No test managed to reproduce it, but it happens in the games time to time and was reported by different players.
|
||||
*
|
||||
* The idea: is to catch such cases manually and print out as much information from game state that may help as possible.
|
||||
*/
|
||||
public static void traceCombatIfNeeded(Game game, Combat combat) {
|
||||
// trace non-flying vs flying
|
||||
for (CombatGroup group : combat.getGroups()) {
|
||||
for (UUID attackerId : group.getAttackers()) {
|
||||
Permanent attacker = game.getPermanent(attackerId);
|
||||
if (attacker != null) {
|
||||
if (hasFlying(attacker)) {
|
||||
for (UUID blockerId : group.getBlockers()) {
|
||||
Permanent blocker = game.getPermanent(blockerId);
|
||||
//if (blocker != null && !hasFlying(blocker) && !hasReach(blocker)) {
|
||||
log.warn("Found non-flying non-reach creature blocking creature with flying");
|
||||
traceCombat(game, attacker, blocker);
|
||||
//}
|
||||
}
|
||||
}
|
||||
if (hasUnblockable(attacker)) {
|
||||
if (group.getBlockers().size() > 0) {
|
||||
Permanent blocker = game.getPermanent(group.getBlockers().get(0));
|
||||
if (blocker != null) {
|
||||
log.warn("Found unblockable creature blocked by some other creature");
|
||||
traceCombat(game, attacker, blocker);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* We need this to check Flying existence in not-common way: by instanceof.
|
||||
* @return
|
||||
*/
|
||||
private static boolean hasFlying(Permanent permanent) {
|
||||
for (Ability ability : permanent.getAbilities()) {
|
||||
if (ability instanceof FlyingAbility) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
private static boolean hasReach(Permanent permanent) {
|
||||
for (Ability ability : permanent.getAbilities()) {
|
||||
if (ability instanceof ReachAbility) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
private static boolean hasUnblockable(Permanent permanent) {
|
||||
for (Ability ability : permanent.getAbilities()) {
|
||||
if (ability instanceof UnblockableAbility) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
private static void traceCombat(Game game, Permanent attacker, Permanent blocker) {
|
||||
String uuid = "[" + UUID.randomUUID() + "] ";
|
||||
log.error(uuid+"Tracing game state...");
|
||||
log.error(uuid+blocker.getName() + " could block " + attacker.getName());
|
||||
|
||||
log.error(uuid);
|
||||
log.error(uuid+"Attacker abilities: ");
|
||||
for (Ability ability : attacker.getAbilities()) {
|
||||
log.error(uuid+" " + ability.toString() + ", id=" + ability.getId());
|
||||
}
|
||||
|
||||
log.error(uuid+"Blocker abilities: ");
|
||||
for (Ability ability : blocker.getAbilities()) {
|
||||
log.error(uuid+" " + ability.toString() + ", id=" + ability.getId());
|
||||
}
|
||||
|
||||
log.error(uuid);
|
||||
log.error(uuid+"Flying ability id: " + FlyingAbility.getInstance().getId());
|
||||
log.error(uuid+"Reach ability id: " + ReachAbility.getInstance().getId());
|
||||
log.error(uuid+"Unblockable ability id: " + UnblockableAbility.getInstance().getId());
|
||||
log.error(uuid);
|
||||
|
||||
log.error(uuid+"Restriction effects:");
|
||||
Ability ability = attacker.getAbilities().size() > 0 ? attacker.getAbilities().get(0) : null;
|
||||
for (RestrictionEffect effect : game.getState().getContinuousEffects().getRestrictionEffects()) {
|
||||
log.error(uuid+" " + effect);
|
||||
log.error(uuid+" id=" + effect.getId());
|
||||
log.error(uuid+" applies to attacker=" + effect.applies(attacker, ability, game));
|
||||
log.error(uuid+" applies to blocker=" + effect.applies(blocker, ability, game));
|
||||
}
|
||||
log.error(uuid);
|
||||
}
|
||||
}
|
|
@ -69,7 +69,7 @@ Mirrodin Besieged|MBS|
|
|||
MTGO Vanguard|VGO|
|
||||
New Phyrexia|NPH|
|
||||
Ninth Edition|9ED|
|
||||
Nemesis|NEM|
|
||||
Nemesis|NMS|
|
||||
Odyssey|ODY|
|
||||
Onslaught|ONS|
|
||||
Portal Second Age|PO2|
|
||||
|
|
Loading…
Reference in a new issue