mirror of
https://github.com/correl/mage.git
synced 2024-11-16 03:00:12 +00:00
Merge remote-tracking branch 'upstream/master'
This commit is contained in:
commit
92e21073e1
343 changed files with 6350 additions and 1156 deletions
4
.gitignore
vendored
4
.gitignore
vendored
|
@ -18,6 +18,7 @@ Mage.Server.Plugins/Mage.Deck.Limited/target
|
|||
Mage.Server.Plugins/Mage.Game.CommanderDuel/target
|
||||
Mage.Server.Plugins/Mage.Game.FreeForAll/target
|
||||
Mage.Server.Plugins/Mage.Game.TwoPlayerDuel/target
|
||||
Mage.Server.Plugins/Mage.Game.TinyLeadersDuel/target
|
||||
Mage.Server.Plugins/Mage.Player.AI/target
|
||||
Mage.Server.Plugins/Mage.Player.AIMinimax/target
|
||||
Mage.Server.Plugins/Mage.Player.AI.MA/target
|
||||
|
@ -83,3 +84,6 @@ Mage.Server.Plugins/Mage.Draft.8PlayerBooster/target
|
|||
/Mage.Server/config/ai.please.cast.this.txt
|
||||
/Mage.Stats/target/
|
||||
/Utils/*_unimplemented.txt
|
||||
*.netbeans_automatic_build
|
||||
*.txt
|
||||
Mage.Client/serverlist.txt
|
|
@ -27,6 +27,7 @@
|
|||
*/
|
||||
package mage.client.game;
|
||||
|
||||
import com.sun.java.swing.plaf.windows.WindowsBorders;
|
||||
import java.awt.BorderLayout;
|
||||
import java.awt.Color;
|
||||
import java.awt.Component;
|
||||
|
@ -606,7 +607,14 @@ public final class GamePanel extends javax.swing.JPanel {
|
|||
else {
|
||||
this.txtStep.setText("");
|
||||
}
|
||||
this.txtPhasesBottomInfo.setText(" " + (game.getSpellsCastCurrentTurn() > 0 ? Integer.toString(game.getSpellsCastCurrentTurn()):""));
|
||||
if (game.getSpellsCastCurrentTurn() > 0) {
|
||||
this.phasesBottomPanel.setVisible(true);
|
||||
this.txtPhasesBottomInfo.setText(Integer.toString(game.getSpellsCastCurrentTurn()));
|
||||
} else {
|
||||
this.phasesBottomPanel.setVisible(false);
|
||||
this.txtPhasesBottomInfo.setText("");
|
||||
}
|
||||
|
||||
this.txtActivePlayer.setText(game.getActivePlayerName());
|
||||
this.txtPriority.setText(game.getPriorityPlayerName());
|
||||
this.txtTurn.setText(Integer.toString(game.getTurn()));
|
||||
|
@ -1508,8 +1516,9 @@ public final class GamePanel extends javax.swing.JPanel {
|
|||
phasesContainer.add(empty1, ratio);
|
||||
phasesContainer.add(jPhases);
|
||||
|
||||
JPanel phasesBottomPanel = new JPanel();
|
||||
phasesBottomPanel.setBackground(new Color(0, 0, 0, 0));
|
||||
phasesBottomPanel = new JPanel();
|
||||
phasesBottomPanel.setBackground(Color.LIGHT_GRAY);
|
||||
phasesBottomPanel.setBorder(new LineBorder(Color.DARK_GRAY, 2));
|
||||
phasesBottomPanel.add(txtPhasesBottomInfo);
|
||||
phasesContainer.add(phasesBottomPanel);
|
||||
|
||||
|
@ -1862,6 +1871,7 @@ public final class GamePanel extends javax.swing.JPanel {
|
|||
private javax.swing.JSplitPane jSplitPane2;
|
||||
private JPanel jPhases;
|
||||
private JPanel phasesContainer;
|
||||
private JPanel phasesBottomPanel;
|
||||
private javax.swing.JLabel txtPhasesBottomInfo;
|
||||
|
||||
private HoverButton currentStep;
|
||||
|
|
|
@ -27,7 +27,7 @@ public class ConstructedFormats {
|
|||
|
||||
private static final String[] constructedFormats = {
|
||||
ALL, STANDARD, EXTENDED, MODERN,
|
||||
"* Khans of Tarkir Block", "Khans of Tarkir", "Fate Reforged", /*"Dragons of Tarkir"*/
|
||||
"* Khans of Tarkir Block", "Khans of Tarkir", "Fate Reforged", "Dragons of Tarkir",
|
||||
"* Theros Block", "Journey into Nyx", "Born of the Gods", "Theros",
|
||||
"* Return to Ravnica Block", "Dragon's Maze", "Gatecrash", "Return to Ravnica",
|
||||
"* Innistrad Block", "Avacyn Restored", "Dark Ascension", "Innistrad",
|
||||
|
@ -113,7 +113,10 @@ public class ConstructedFormats {
|
|||
|
||||
public static List<String> getSetsByFormat(String format) {
|
||||
if (format.equals("* Khans of Tarkir Block")) {
|
||||
return Arrays.asList("KTK", "FRF");
|
||||
return Arrays.asList("KTK", "FRF","DTK");
|
||||
}
|
||||
if (format.equals("Dragons of Tarkir")) {
|
||||
return Arrays.asList("DTK");
|
||||
}
|
||||
if (format.equals("Fate Reforged")) {
|
||||
return Arrays.asList("FRF");
|
||||
|
|
|
@ -44,8 +44,7 @@ public class GathererSets implements Iterable<DownloadJob> {
|
|||
"MMA",
|
||||
"THS", "BNG", "JOU",
|
||||
"CNS", "VMA",
|
||||
"KTK", "FRF"
|
||||
};
|
||||
"KTK", "FRF", "DTK"};
|
||||
private static final HashMap<String, String> symbolsReplacements = new HashMap<>();
|
||||
|
||||
static {
|
||||
|
|
|
@ -16,6 +16,7 @@ public class MagicCardsImageSource implements CardImageSource {
|
|||
|
||||
private static final Map<String, String> setNameTokenReplacement = new HashMap<String, String>() {
|
||||
{
|
||||
put("DTK", "dragons-of-tarkir");
|
||||
put("GRC","wpngateway");
|
||||
put("MBP","media-inserts");
|
||||
put("MLP", "launch-party");
|
||||
|
|
|
@ -28,8 +28,6 @@
|
|||
|
||||
package org.mage.plugins.card.dl.sources;
|
||||
|
||||
import java.net.URLEncoder;
|
||||
import mage.cards.SplitCard;
|
||||
import org.mage.plugins.card.images.CardDownloadData;
|
||||
|
||||
/**
|
||||
|
|
|
@ -29,6 +29,7 @@ public class WizardCardsImageSource implements CardImageSource {
|
|||
public WizardCardsImageSource() {
|
||||
sets = new HashMap<>();
|
||||
setsAliases = new HashMap<>();
|
||||
setsAliases.put("DTK", "dragonsoftarkir/cig");
|
||||
setsAliases.put("FRF", "fatereforged/cig");
|
||||
setsAliases.put("C14", "commander2014/cig");
|
||||
setsAliases.put("KTK", "khansoftarkir/cig");
|
||||
|
|
|
@ -65,6 +65,6 @@ ddd=gvl
|
|||
unh=uh
|
||||
dde=pvc
|
||||
# Remove setname as soon as the images can be downloaded
|
||||
ignore.urls=TOK
|
||||
ignore.urls=TOK,DTK
|
||||
# sets ordered by release time (newest goes first)
|
||||
token.lookup.order=FRF,KTK,M15,VMA,CNS,JOU,BNG,THS,DDL,M14,MMA,DGM,GTC,RTR,M13,AVR,DDI,DKA,ISD,M12,NPH,MBS,SOM,M11,ROE,DDE,WWK,ZEN,M10,GVL,ARB,DVD,CFX,JVC,ALA,EVE,SHM,EVG,MOR,LRW,10E,CLS,CHK,GRC
|
||||
token.lookup.order=DTK,FRF,KTK,M15,VMA,CNS,JOU,BNG,THS,DDL,M14,MMA,DGM,GTC,RTR,M13,AVR,DDI,DKA,ISD,M12,NPH,MBS,SOM,M11,ROE,DDE,WWK,ZEN,M10,GVL,ARB,DVD,CFX,JVC,ALA,EVE,SHM,EVG,MOR,LRW,10E,CLS,CHK,GRC
|
|
@ -50,6 +50,7 @@ import mage.target.Targets;
|
|||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
import mage.game.Game;
|
||||
|
||||
/**
|
||||
* @author BetaSteward_at_googlemail.com
|
||||
|
@ -116,21 +117,27 @@ public class CardView extends SimpleCardView {
|
|||
protected boolean canAttack;
|
||||
|
||||
public CardView(Card card) {
|
||||
this(card, null, false);
|
||||
this(card, null, null, false);
|
||||
}
|
||||
|
||||
public CardView(Card card, UUID cardId) {
|
||||
this(card, null, false);
|
||||
this(card, null, null, false);
|
||||
this.id = cardId;
|
||||
}
|
||||
|
||||
public CardView(Card card, Game game, UUID cardId) {
|
||||
this(card, game, null, false);
|
||||
this.id = cardId;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param card
|
||||
* @param game
|
||||
* @param cardId
|
||||
* @param controlled is the card view created for the card controller - used for morph / face down cards to know which player may see information for the card
|
||||
*/
|
||||
public CardView(Card card, UUID cardId, boolean controlled) {
|
||||
public CardView(Card card, Game game, UUID cardId, boolean controlled) {
|
||||
super(card.getId(), card.getExpansionSetCode(), card.getCardNumber(), card.isFaceDown(), card.getUsesVariousArt(), card.getTokenSetCode());
|
||||
this.morphCard = card.isMorphCard();
|
||||
// no information available for face down cards as long it's not a controlled face down morph card
|
||||
|
@ -241,9 +248,9 @@ public class CardView extends SimpleCardView {
|
|||
this.rarity = card.getRarity();
|
||||
this.isToken = false;
|
||||
}
|
||||
if (card.getCounters() != null && !card.getCounters().isEmpty()) {
|
||||
if (game != null && card.getCounters(game) != null && !card.getCounters(game).isEmpty()) {
|
||||
counters = new ArrayList<>();
|
||||
for (Counter counter: card.getCounters().values()) {
|
||||
for (Counter counter: card.getCounters(game).values()) {
|
||||
counters.add(new CounterView(counter));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -136,7 +136,7 @@ public class GameView implements Serializable {
|
|||
}
|
||||
else {
|
||||
// Spell
|
||||
stack.put(stackObject.getId(), new CardView((Spell)stackObject, null, stackObject.getControllerId().equals(createdForPlayerId)));
|
||||
stack.put(stackObject.getId(), new CardView((Spell)stackObject, game, null, stackObject.getControllerId().equals(createdForPlayerId)));
|
||||
checkPaid(stackObject.getId(), (Spell)stackObject);
|
||||
}
|
||||
//stackOrder.add(stackObject.getId());
|
||||
|
|
|
@ -62,7 +62,7 @@ public class PermanentView extends CardView {
|
|||
private final boolean attachedToPermanent;
|
||||
|
||||
public PermanentView(Permanent permanent, Card card, UUID createdForPlayerId, Game game) {
|
||||
super(permanent, null, permanent.getControllerId().equals(createdForPlayerId));
|
||||
super(permanent, game, null, permanent.getControllerId().equals(createdForPlayerId));
|
||||
this.controlled = permanent.getControllerId().equals(createdForPlayerId);
|
||||
this.rules = permanent.getRules();
|
||||
this.tapped = permanent.isTapped();
|
||||
|
|
|
@ -0,0 +1,213 @@
|
|||
/*
|
||||
* Copyright 2011 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.deck;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import mage.abilities.common.CanBeYourCommanderAbility;
|
||||
import mage.cards.Card;
|
||||
import mage.cards.decks.Deck;
|
||||
import mage.cards.decks.DeckValidator;
|
||||
import mage.constants.CardType;
|
||||
import mage.filter.FilterMana;
|
||||
import mage.util.CardUtil;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author JRHerlehy
|
||||
*/
|
||||
public class TinyLeaders extends DeckValidator {
|
||||
|
||||
protected List<String> banned = new ArrayList<>();
|
||||
protected List<String> bannedCommander = new ArrayList<>();
|
||||
|
||||
public TinyLeaders() {
|
||||
this("Tiny Leaders");
|
||||
//Banned list from tinyleaders.blodspot.ca/p/ban-list.html
|
||||
//Ban list updated as of 11/08/14
|
||||
banned.add("Ancestral Recall");
|
||||
banned.add("Balance");
|
||||
banned.add("Black Lotus");
|
||||
banned.add("Channel");
|
||||
banned.add("Counterbalance");
|
||||
banned.add("Demonic Tutor");
|
||||
banned.add("Earthcraft");
|
||||
banned.add("Edric, Spymaster of Trest");
|
||||
banned.add("Fastbond");
|
||||
banned.add("Goblin Recruiter");
|
||||
banned.add("Hermit Druid");
|
||||
banned.add("Imperial Seal");
|
||||
banned.add("Library of Alexandria");
|
||||
banned.add("Karakas");
|
||||
banned.add("Mana Crypt");
|
||||
banned.add("Mana Drain");
|
||||
banned.add("Mana Vault");
|
||||
banned.add("metalworker");
|
||||
banned.add("Mind Twist");
|
||||
banned.add("Mishra's Workshop");
|
||||
banned.add("Mox Emerald");
|
||||
banned.add("Mox Jet");
|
||||
banned.add("Mox Pearl");
|
||||
banned.add("Mox Ruby");
|
||||
banned.add("Mox Sapphire");
|
||||
banned.add("Necropotence");
|
||||
banned.add("Painter's Servant");
|
||||
banned.add("Shahrazad");
|
||||
banned.add("Skullclamp");
|
||||
banned.add("Sol Ring");
|
||||
banned.add("Strip Mine");
|
||||
banned.add("Survival of the Fittest");
|
||||
banned.add("Sword of Body and Mind");
|
||||
banned.add("Time Vault");
|
||||
banned.add("Time Walk");
|
||||
banned.add("Timetwister");
|
||||
banned.add("Tolarian Academy");
|
||||
banned.add("Umezawa's Jitte");
|
||||
banned.add("Vampiric Tutor");
|
||||
banned.add("Yawgmoth's Will");
|
||||
|
||||
//Additionally, these Legendary creatures cannot be used as Commanders
|
||||
bannedCommander.add("Erayo, Soratami Ascendant");
|
||||
bannedCommander.add("Rofellos, Llanowar Emissary");
|
||||
bannedCommander.add("Derevi, Empyrical Tactician");
|
||||
}
|
||||
|
||||
public TinyLeaders(String name) {
|
||||
super(name);
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param deck
|
||||
* @return - True if deck is valid
|
||||
*/
|
||||
@Override
|
||||
public boolean validate(Deck deck) {
|
||||
boolean valid = true;
|
||||
|
||||
if (deck.getCards().size() != 49) {
|
||||
invalid.put("Deck", "Must contain 49 cards: has " + deck.getCards().size() + " cards");
|
||||
valid = false;
|
||||
}
|
||||
|
||||
List<String> basicLandNames = new ArrayList<>(Arrays.asList("Forest", "Island", "Mountain", "Swamp", "Plains",
|
||||
"Snow-Covered Forest", "Snow-Covered Island", "Snow-Covered Mountain", "Snow-Covered Swamp", "Snow-Covered Plains"));
|
||||
Map<String, Integer> counts = new HashMap<>();
|
||||
countCards(counts, deck.getCards());
|
||||
countCards(counts, deck.getSideboard());
|
||||
for (Map.Entry<String, Integer> entry : counts.entrySet()) {
|
||||
if (entry.getValue() > 1) {
|
||||
if (!basicLandNames.contains(entry.getKey()) && !entry.getKey().equals("Relentless Rats") && !entry.getKey().equals("Shadowborn Apostle")) {
|
||||
invalid.put(entry.getKey(), "Too many: " + entry.getValue());
|
||||
valid = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for (String bannedCard : banned) {
|
||||
if (counts.containsKey(bannedCard)) {
|
||||
invalid.put(bannedCard, "Banned");
|
||||
valid = false;
|
||||
}
|
||||
}
|
||||
|
||||
if (deck.getSideboard().size() <= 11) {
|
||||
Card commander = null;
|
||||
|
||||
for (Card card : deck.getSideboard()) {
|
||||
if (card.getName().equalsIgnoreCase(deck.getName())) {
|
||||
commander = card;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 905.5b - Each card must have a converted mana cost of three of less.
|
||||
* Cards with {X} in their mana cost count X as zero.
|
||||
* Split and double-face cards are legal only if both of their halves would be legal independently.
|
||||
*/
|
||||
|
||||
if (commander == null || commander.getManaCost().convertedManaCost() > 3) {
|
||||
if (commander == null) {
|
||||
invalid.put("Leader", "Please be sure to set your leader in the NAME field in the DECK EDITOR");
|
||||
}
|
||||
if (commander != null && commander.getManaCost().convertedManaCost() > 3) {
|
||||
invalid.put("Leader", "Commander CMC is Greater than 3");
|
||||
}
|
||||
return false;
|
||||
}
|
||||
if ((commander.getCardType().contains(CardType.CREATURE) && commander.getSupertype().contains("Legendary"))
|
||||
|| (commander.getCardType().contains(CardType.PLANESWALKER) && commander.getAbilities().contains(CanBeYourCommanderAbility.getInstance()))) {
|
||||
if (!bannedCommander.contains(commander.getName())) {
|
||||
FilterMana color = CardUtil.getColorIdentity(commander);
|
||||
for (Card card : deck.getCards()) {
|
||||
if (!cardHasValideColor(color, card)) {
|
||||
invalid.put(card.getName(), "Invalid color (" + commander.getName() + ")");
|
||||
valid = false;
|
||||
}
|
||||
|
||||
//905.5b - Converted mana cost must be 3 or less
|
||||
if (card.getManaCost().convertedManaCost() > 3) {
|
||||
invalid.put(card.getName(), "Invalid cost (" + card.getManaCost().convertedManaCost() + ")");
|
||||
valid = false;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
invalid.put("Commander", "Commander banned (" + commander.getName() + ")");
|
||||
valid = false;
|
||||
}
|
||||
} else {
|
||||
invalid.put("Commander", "Commander invalide (" + commander.getName() + ")");
|
||||
valid = false;
|
||||
}
|
||||
} else {
|
||||
invalid.put("Commander", "Sideboard must contain only the commander and a maximum of 10 sideboard cards");
|
||||
valid = false;
|
||||
}
|
||||
|
||||
return valid;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param commander FilterMana object with Color Identity of Commander set
|
||||
* @param card Card to validate
|
||||
* @return True if card has a valid color identity
|
||||
*/
|
||||
public boolean cardHasValideColor(FilterMana commander, Card card) {
|
||||
FilterMana cardColor = CardUtil.getColorIdentity(card);
|
||||
return !(cardColor.isBlack() && !commander.isBlack()
|
||||
|| cardColor.isBlue() && !commander.isBlue()
|
||||
|| cardColor.isGreen() && !commander.isGreen()
|
||||
|| cardColor.isRed() && !commander.isRed()
|
||||
|| cardColor.isWhite() && !commander.isWhite());
|
||||
}
|
||||
|
||||
}
|
50
Mage.Server.Plugins/Mage.Game.TinyLeadersDuel/pom.xml
Normal file
50
Mage.Server.Plugins/Mage.Game.TinyLeadersDuel/pom.xml
Normal file
|
@ -0,0 +1,50 @@
|
|||
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-4.0.0.xsd">
|
||||
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<parent>
|
||||
<groupId>org.mage</groupId>
|
||||
<artifactId>mage-server-plugins</artifactId>
|
||||
<version>1.3.0</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>mage-game-tinyleadersduel</artifactId>
|
||||
<packaging>jar</packaging>
|
||||
<name>Mage Game Tiny Leaders Two Player</name>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>${project.groupId}</groupId>
|
||||
<artifactId>mage</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
<sourceDirectory>src</sourceDirectory>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-compiler-plugin</artifactId>
|
||||
<configuration>
|
||||
<source>1.7</source>
|
||||
<target>1.7</target>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<artifactId>maven-resources-plugin</artifactId>
|
||||
<configuration>
|
||||
<encoding>UTF-8</encoding>
|
||||
</configuration>
|
||||
</plugin>
|
||||
|
||||
</plugins>
|
||||
|
||||
<finalName>mage-game-tinyleadersduel</finalName>
|
||||
</build>
|
||||
|
||||
<properties/>
|
||||
|
||||
</project>
|
|
@ -0,0 +1,64 @@
|
|||
/*
|
||||
* 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.game;
|
||||
|
||||
import mage.constants.MultiplayerAttackOption;
|
||||
import mage.constants.RangeOfInfluence;
|
||||
import mage.game.match.MatchType;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author JRHerlehy
|
||||
*/
|
||||
public class TinyLeadersDuel extends GameTinyLeadersImpl {
|
||||
|
||||
public TinyLeadersDuel(MultiplayerAttackOption attackOption, RangeOfInfluence range, int freeMulligans, int startLife) {
|
||||
super(attackOption, range, freeMulligans, startLife);
|
||||
}
|
||||
|
||||
public TinyLeadersDuel(final TinyLeadersDuel game) {
|
||||
super(game);
|
||||
}
|
||||
|
||||
@Override
|
||||
public MatchType getGameType() {
|
||||
return new TinyLeadersDuelType();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getNumPlayers() {
|
||||
return 2;
|
||||
}
|
||||
|
||||
@Override
|
||||
public TinyLeadersDuel copy() {
|
||||
return new TinyLeadersDuel(this);
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,58 @@
|
|||
/*
|
||||
* 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.game;
|
||||
|
||||
import mage.game.match.MatchImpl;
|
||||
import mage.game.match.MatchOptions;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author JRHerlehy
|
||||
*/
|
||||
public class TinyLeadersDuelMatch extends MatchImpl {
|
||||
|
||||
public TinyLeadersDuelMatch(MatchOptions options) {
|
||||
super(options);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void startGame() throws GameException {
|
||||
//Tiny Leaders Play Rule 13: Players begin the game with 25 life.
|
||||
int startLife = 25;
|
||||
|
||||
TinyLeadersDuel game = new TinyLeadersDuel(options.getAttackOption(), options.getRange(), options.getFreeMulligans(), startLife);
|
||||
game.setStartMessage(this.createGameStartMessage());
|
||||
|
||||
//Tucking a Tiny Leader is legal
|
||||
game.setAlsoLibrary(false);
|
||||
this.initGame(game);
|
||||
games.add(game);
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,58 @@
|
|||
/*
|
||||
* 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.game;
|
||||
|
||||
import mage.game.match.MatchType;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author JRHerlehy
|
||||
*/
|
||||
public class TinyLeadersDuelType extends MatchType {
|
||||
|
||||
public TinyLeadersDuelType() {
|
||||
this.name = "Tiny Leaders Two Player Duel";
|
||||
this.maxPlayers = 2;
|
||||
this.minPlayers = 2;
|
||||
this.numTeams = 0;
|
||||
this.useAttackOption = false;
|
||||
this.useRange = false;
|
||||
this.sideboardingAllowed = true;
|
||||
}
|
||||
|
||||
protected TinyLeadersDuelType(final TinyLeadersDuelType matchType){
|
||||
super(matchType);
|
||||
}
|
||||
|
||||
@Override
|
||||
public TinyLeadersDuelType copy() {
|
||||
return new TinyLeadersDuelType(this);
|
||||
}
|
||||
|
||||
}
|
|
@ -75,6 +75,9 @@ import java.io.IOException;
|
|||
import java.io.Serializable;
|
||||
import java.util.*;
|
||||
import java.util.Map.Entry;
|
||||
import mage.filter.Filter;
|
||||
import mage.filter.predicate.other.PlayerIdPredicate;
|
||||
import mage.filter.predicate.permanent.ControllerIdPredicate;
|
||||
|
||||
|
||||
/**
|
||||
|
@ -1011,7 +1014,7 @@ public class ComputerPlayer extends PlayerImpl implements Player {
|
|||
}
|
||||
|
||||
@Override
|
||||
public boolean playMana(ManaCost unpaid, Game game) {
|
||||
public boolean playMana(ManaCost unpaid, String promptText, Game game) {
|
||||
payManaMode = true;
|
||||
boolean result = playManaHandling(unpaid, game);
|
||||
payManaMode = false;
|
||||
|
@ -1283,6 +1286,9 @@ public class ComputerPlayer extends PlayerImpl implements Player {
|
|||
if (card != null) {
|
||||
target.addTarget(card.getId(), source, game);
|
||||
cardChoices.remove(card);
|
||||
} else {
|
||||
// We don't have any valid target to choose so stop choosing
|
||||
return target.getTargets().size() < target.getNumberOfTargets();
|
||||
}
|
||||
if (outcome.equals(Outcome.Neutral) && target.getTargets().size() > target.getNumberOfTargets() + (target.getMaxNumberOfTargets() - target.getNumberOfTargets()) / 2) {
|
||||
return true;
|
||||
|
@ -1947,10 +1953,14 @@ public class ComputerPlayer extends PlayerImpl implements Player {
|
|||
}
|
||||
|
||||
protected List<Permanent> threats(UUID playerId, UUID sourceId, FilterPermanent filter, Game game, List<UUID> targets) {
|
||||
List<Permanent> threats = (playerId == null || sourceId ==null) ?
|
||||
game.getBattlefield().getActivePermanents(filter, this.getId(), sourceId, game) : // all permanents within the range of the player
|
||||
game.getBattlefield().getActivePermanents(filter, playerId, sourceId, game);
|
||||
|
||||
List<Permanent> threats;
|
||||
if (playerId == null) {
|
||||
threats = game.getBattlefield().getActivePermanents(filter, this.getId(), sourceId, game); // all permanents within the range of the player
|
||||
} else {
|
||||
FilterPermanent filterCopy = filter.copy();
|
||||
filterCopy.add(new ControllerIdPredicate(playerId));
|
||||
threats = game.getBattlefield().getActivePermanents(filter, this.getId(), sourceId, game);
|
||||
}
|
||||
Iterator<Permanent> it = threats.iterator();
|
||||
while (it.hasNext()) { // remove permanents already targeted
|
||||
Permanent test = it.next();
|
||||
|
|
|
@ -432,15 +432,31 @@ public class HumanPlayer extends PlayerImpl {
|
|||
if (target.getTargets().size() >= target.getNumberOfTargets()) {
|
||||
required = false;
|
||||
}
|
||||
game.fireSelectTargetEvent(playerId, target.getMessage(), cards, required, getOptions(target, null));
|
||||
Map<String, Serializable> options = getOptions(target, null);
|
||||
List<UUID> chosen = target.getTargets();
|
||||
options.put("chosen", (Serializable)chosen);
|
||||
List<UUID> choosable = new ArrayList<>();
|
||||
for (UUID cardId : cards) {
|
||||
if (target.canTarget(cardId, cards, game)) {
|
||||
choosable.add(cardId);
|
||||
}
|
||||
}
|
||||
if (!choosable.isEmpty()) {
|
||||
options.put("choosable", (Serializable) choosable);
|
||||
}
|
||||
game.fireSelectTargetEvent(playerId, target.getMessage(), cards, required, options);
|
||||
waitForResponse(game);
|
||||
if (response.getUUID() != null) {
|
||||
if (target.getTargets().contains(response.getUUID())) { // if already included remove it
|
||||
target.remove(response.getUUID());
|
||||
} else {
|
||||
if (target.canTarget(response.getUUID(), cards, game)) {
|
||||
target.addTarget(response.getUUID(), source, game);
|
||||
if(target.doneChosing()){
|
||||
if (target.doneChosing()) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (target.getTargets().size() >= target.getNumberOfTargets()) {
|
||||
return true;
|
||||
|
@ -606,17 +622,17 @@ public class HumanPlayer extends PlayerImpl {
|
|||
|
||||
|
||||
@Override
|
||||
public boolean playMana(ManaCost unpaid, Game game) {
|
||||
public boolean playMana(ManaCost unpaid, String promptText, Game game) {
|
||||
payManaMode = true;
|
||||
boolean result = playManaHandling(unpaid, game);
|
||||
boolean result = playManaHandling(unpaid, promptText, game);
|
||||
payManaMode = false;
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
protected boolean playManaHandling(ManaCost unpaid, Game game) {
|
||||
protected boolean playManaHandling(ManaCost unpaid, String promptText, Game game) {
|
||||
updateGameStatePriority("playMana", game);
|
||||
game.firePlayManaEvent(playerId, "Pay " + unpaid.getText());
|
||||
game.firePlayManaEvent(playerId, "Pay " + promptText);
|
||||
waitForResponse(game);
|
||||
if (!this.isInGame()) {
|
||||
return false;
|
||||
|
|
|
@ -21,15 +21,8 @@
|
|||
<module>Mage.Game.CommanderFreeForAll</module>
|
||||
<module>Mage.Game.FreeForAll</module>
|
||||
<module>Mage.Game.TwoPlayerDuel</module>
|
||||
<module>Mage.Player.AI</module>
|
||||
<module>Mage.Player.AIMinimax</module>
|
||||
<module>Mage.Player.AI.MA</module>
|
||||
<module>Mage.Player.AIMCTS</module>
|
||||
<module>Mage.Player.AI.DraftBot</module>
|
||||
<module>Mage.Player.Human</module>
|
||||
<module>Mage.Tournament.BoosterDraft</module>
|
||||
<module>Mage.Tournament.Constructed</module>
|
||||
<module>Mage.Tournament.Sealed</module>
|
||||
<module>Mage.Game.TinyLeadersDuel</module>
|
||||
</modules>
|
||||
|
||||
</project>
|
|
@ -48,6 +48,7 @@
|
|||
<gameType name="Free For All" jar="mage-game-freeforall.jar" className="mage.game.FreeForAllMatch" typeName="mage.game.FreeForAllType"/>
|
||||
<gameType name="Commander Two Player Duel" jar="mage-game-commanderduel.jar" className="mage.game.CommanderDuelMatch" typeName="mage.game.CommanderDuelType"/>
|
||||
<gameType name="Commander Free For All" jar="mage-game-commanderfreeforall.jar" className="mage.game.CommanderFreeForAllMatch" typeName="mage.game.CommanderFreeForAllType"/>
|
||||
<gameType name="Tiny Leaders Two Player Duel" jar="mage-game-tinyleadersduel.jar" className="mage.game.TinyLeadersDuelMatch" typeName="mage.game.TinyLeadersDuelType"/>
|
||||
</gameTypes>
|
||||
<tournamentTypes>
|
||||
<tournamentType name="Constructed Elimination" jar="mage-tournament-constructed.jar" className="mage.tournament.ConstructedEliminationTournament" typeName="mage.tournament.ConstructedEliminationTournamentType"/>
|
||||
|
@ -91,6 +92,7 @@
|
|||
<deckType name="Block Constructed - Zendikar" jar="mage-deck-constructed.jar" className="mage.deck.ZendikarBlock"/>
|
||||
<deckType name="Variant Magic - Commander" jar="mage-deck-constructed.jar" className="mage.deck.Commander"/>
|
||||
<deckType name="Variant Magic - Duel Commander" jar="mage-deck-constructed.jar" className="mage.deck.DuelCommander"/>
|
||||
<deckType name="Variant Magic - Tiny Leaders" jar="mage-deck-constructed.jar" className="mage.deck.TinyLeaders"/>
|
||||
<deckType name="Limited" jar="mage-deck-limited.jar" className="mage.deck.Limited"/>
|
||||
</deckTypes>
|
||||
</config>
|
||||
|
|
|
@ -133,6 +133,12 @@
|
|||
<version>${project.version}</version>
|
||||
<scope>runtime</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>${project.groupId}</groupId>
|
||||
<artifactId>mage-game-tinyleadersduel</artifactId>
|
||||
<version>${project.version}</version>
|
||||
<scope>runtime</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
|
|
|
@ -924,7 +924,9 @@ public class TableController {
|
|||
}
|
||||
if (matchPlayer.getPlayer().isHuman()) {
|
||||
humanPlayers++;
|
||||
if ((table.getState().equals(TableState.WAITING) || table.getState().equals(TableState.STARTING) || table.getState().equals(TableState.READY_TO_START)) ||
|
||||
if ((table.getState().equals(TableState.WAITING) ||
|
||||
table.getState().equals(TableState.STARTING) ||
|
||||
table.getState().equals(TableState.READY_TO_START)) ||
|
||||
!match.isDoneSideboarding() ||
|
||||
(!matchPlayer.hasQuit() && match.getGame() != null && matchPlayer.getPlayer().isInGame())) {
|
||||
User user = UserManager.getInstance().getUser(userPlayerEntry.getKey());
|
||||
|
|
|
@ -395,8 +395,6 @@ public class TableManager {
|
|||
debugServerState();
|
||||
}
|
||||
logger.debug("TABLE HEALTH CHECK");
|
||||
List<UUID> toRemove = new ArrayList<>();
|
||||
|
||||
ArrayList<Table> tableCopy = new ArrayList<>();
|
||||
tableCopy.addAll(tables.values());
|
||||
for (Table table : tableCopy) {
|
||||
|
@ -406,13 +404,13 @@ public class TableManager {
|
|||
logger.debug(table.getId() + " [" + table.getName()+ "] " + formatter.format(table.getStartTime() == null ? table.getCreateTime() : table.getCreateTime()) +" (" + table.getState().toString() + ") " + (table.isTournament() ? "- Tournament":""));
|
||||
TableController tableController = getController(table.getId());
|
||||
if (tableController != null) {
|
||||
if (table.isTournament()) {
|
||||
if (!tableController.isTournamentStillValid()) {
|
||||
toRemove.add(table.getId());
|
||||
}
|
||||
} else {
|
||||
if (!tableController.isMatchTableStillValid()) {
|
||||
toRemove.add(table.getId());
|
||||
if ((table.isTournament() && !tableController.isTournamentStillValid()) ||
|
||||
(!table.isTournament() && !tableController.isMatchTableStillValid())) {
|
||||
try {
|
||||
logger.warn("Removing unhealthy tableId " + table.getId());
|
||||
removeTable(table.getId());
|
||||
} catch (Exception e) {
|
||||
logger.error(e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -422,14 +420,6 @@ public class TableManager {
|
|||
logger.debug(Arrays.toString(ex.getStackTrace()));
|
||||
}
|
||||
}
|
||||
for (UUID tableId : toRemove) {
|
||||
try {
|
||||
logger.warn("Removing unhealthy tableId " + tableId);
|
||||
removeTable(tableId);
|
||||
} catch (Exception e) {
|
||||
logger.error(e);
|
||||
}
|
||||
}
|
||||
logger.debug("TABLE HEALTH CHECK - END");
|
||||
|
||||
}
|
||||
|
|
|
@ -62,7 +62,7 @@ public class GameWorker<T> implements Callable {
|
|||
gameController.gameResult(game.getWinner());
|
||||
game.cleanUp();
|
||||
} catch (MageException ex) {
|
||||
logger.fatal("GameWorker mage error [" + game.getId() + "]" +ex, ex);
|
||||
logger.fatal("GameWorker mage error [" + game.getId() + "]" + ex, ex);
|
||||
ex.printStackTrace();
|
||||
} catch (Exception e) {
|
||||
logger.fatal("GameWorker general exception [" + game.getId() + "]" + e.getMessage(), e);
|
||||
|
|
60
Mage.Sets/src/mage/sets/DragonsOfTarkir.java
Normal file
60
Mage.Sets/src/mage/sets/DragonsOfTarkir.java
Normal file
|
@ -0,0 +1,60 @@
|
|||
/*
|
||||
* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without modification, are
|
||||
* permitted provided that the following conditions are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright notice, this list of
|
||||
* conditions and the following disclaimer.
|
||||
*
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
|
||||
* of conditions and the following disclaimer in the documentation and/or other materials
|
||||
* provided with the distribution.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED
|
||||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
|
||||
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR
|
||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
|
||||
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
|
||||
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
* The views and conclusions contained in the software and documentation are those of the
|
||||
* authors and should not be interpreted as representing official policies, either expressed
|
||||
* or implied, of BetaSteward_at_googlemail.com.
|
||||
*/
|
||||
|
||||
package mage.sets;
|
||||
|
||||
import java.util.GregorianCalendar;
|
||||
import mage.cards.ExpansionSet;
|
||||
import mage.constants.SetType;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author fireshoes
|
||||
*/
|
||||
|
||||
public class DragonsOfTarkir extends ExpansionSet {
|
||||
|
||||
private static final DragonsOfTarkir fINSTANCE = new DragonsOfTarkir();
|
||||
|
||||
public static DragonsOfTarkir getInstance() {
|
||||
return fINSTANCE;
|
||||
}
|
||||
|
||||
private DragonsOfTarkir() {
|
||||
super("Dragons of Tarkir", "DTK", "mage.sets.dragonsoftarkir", new GregorianCalendar(2015, 3, 27).getTime(), SetType.EXPANSION);
|
||||
this.blockName = "Dragons of Tarkir";
|
||||
this.hasBoosters = true;
|
||||
this.hasBasicLands = true;
|
||||
this.numBoosterLands = 1;
|
||||
this.numBoosterCommon = 10;
|
||||
this.numBoosterUncommon = 3;
|
||||
this.numBoosterRare = 1;
|
||||
this.ratioBoosterMythic = 8;
|
||||
}
|
||||
|
||||
}
|
52
Mage.Sets/src/mage/sets/ajanivsnicolbolas/SapseepForest.java
Normal file
52
Mage.Sets/src/mage/sets/ajanivsnicolbolas/SapseepForest.java
Normal file
|
@ -0,0 +1,52 @@
|
|||
/*
|
||||
* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without modification, are
|
||||
* permitted provided that the following conditions are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright notice, this list of
|
||||
* conditions and the following disclaimer.
|
||||
*
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
|
||||
* of conditions and the following disclaimer in the documentation and/or other materials
|
||||
* provided with the distribution.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED
|
||||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
|
||||
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR
|
||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
|
||||
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
|
||||
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
* The views and conclusions contained in the software and documentation are those of the
|
||||
* authors and should not be interpreted as representing official policies, either expressed
|
||||
* or implied, of BetaSteward_at_googlemail.com.
|
||||
*/
|
||||
package mage.sets.ajanivsnicolbolas;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author jeffwadsworth
|
||||
*/
|
||||
public class SapseepForest extends mage.sets.shadowmoor.SapseepForest {
|
||||
|
||||
public SapseepForest(UUID ownerId) {
|
||||
super(ownerId);
|
||||
this.cardNumber = 36;
|
||||
this.expansionSetCode = "DDH";
|
||||
}
|
||||
|
||||
public SapseepForest(final SapseepForest card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public SapseepForest copy() {
|
||||
return new SapseepForest(this);
|
||||
}
|
||||
}
|
|
@ -36,9 +36,8 @@ import mage.abilities.common.BeginningOfUpkeepTriggeredAbility;
|
|||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.abilities.keyword.FlyingAbility;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.filter.common.FilterCreaturePermanent;
|
||||
import mage.filter.common.FilterControlledCreaturePermanent;
|
||||
import mage.filter.predicate.mageobject.MonocoloredPredicate;
|
||||
import mage.filter.predicate.permanent.ControllerPredicate;
|
||||
import mage.game.Game;
|
||||
import mage.game.permanent.Permanent;
|
||||
import mage.players.Player;
|
||||
|
@ -91,12 +90,11 @@ class DefilerOfSoulsEffect extends OneShotEffect {
|
|||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
FilterCreaturePermanent filter = new FilterCreaturePermanent("monocolored creature");
|
||||
FilterControlledCreaturePermanent filter = new FilterControlledCreaturePermanent("monocolored creature");
|
||||
Player player = game.getPlayer(targetPointer.getFirst(game, source));
|
||||
if (player == null) {
|
||||
return false;
|
||||
}
|
||||
filter.add(new ControllerPredicate(TargetController.YOU));
|
||||
filter.add(new MonocoloredPredicate());
|
||||
|
||||
int amount;
|
||||
|
|
|
@ -63,8 +63,7 @@ public class MaelstromNexus extends CardImpl {
|
|||
|
||||
|
||||
// The first spell you cast each turn has cascade.
|
||||
this.addAbility(new MaelstromNexusTriggeredAbility());
|
||||
this.addWatcher(new FirstSpellCastThisTurnWatcher());
|
||||
this.addAbility(new MaelstromNexusTriggeredAbility(), new FirstSpellCastThisTurnWatcher());
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -61,8 +61,7 @@ public class PredatoryAdvantage extends CardImpl {
|
|||
|
||||
|
||||
// At the beginning of each opponent's end step, if that player didn't cast a creature spell this turn, put a 2/2 green Lizard creature token onto the battlefield.
|
||||
this.addWatcher(new CastCreatureWatcher());
|
||||
this.addAbility(new BeginningOfEndStepTriggeredAbility(Zone.BATTLEFIELD, new CreateTokenEffect(new LizardToken()), TargetController.OPPONENT, new DidNotCastCreatureCondition(), false));
|
||||
this.addAbility(new BeginningOfEndStepTriggeredAbility(Zone.BATTLEFIELD, new CreateTokenEffect(new LizardToken()), TargetController.OPPONENT, new DidNotCastCreatureCondition(), false), new CastCreatureWatcher());
|
||||
}
|
||||
|
||||
public PredatoryAdvantage(final PredatoryAdvantage card) {
|
||||
|
|
|
@ -37,7 +37,7 @@ import mage.cards.CardImpl;
|
|||
import mage.constants.CardType;
|
||||
import mage.constants.Rarity;
|
||||
import mage.constants.Zone;
|
||||
import mage.filter.common.FilterArtifactPermanent;
|
||||
import mage.filter.common.FilterControlledArtifactPermanent;
|
||||
import mage.target.common.TargetControlledPermanent;
|
||||
|
||||
/**
|
||||
|
@ -50,12 +50,9 @@ public class TimeSieve extends CardImpl {
|
|||
super(ownerId, 31, "Time Sieve", Rarity.RARE, new CardType[]{CardType.ARTIFACT}, "{U}{B}");
|
||||
this.expansionSetCode = "ARB";
|
||||
|
||||
|
||||
|
||||
|
||||
// {tap}, Sacrifice five artifacts: Take an extra turn after this one.
|
||||
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new AddExtraTurnControllerEffect(), new TapSourceCost());
|
||||
ability.addCost(new SacrificeTargetCost(new TargetControlledPermanent(5, 5, new FilterArtifactPermanent("five artifacts"), true)));
|
||||
ability.addCost(new SacrificeTargetCost(new TargetControlledPermanent(5, 5, new FilterControlledArtifactPermanent("five artifacts"), true)));
|
||||
this.addAbility(ability);
|
||||
|
||||
}
|
||||
|
|
|
@ -79,8 +79,7 @@ public class UnscytheKillerOfKings extends CardImpl {
|
|||
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityAttachedEffect(FirstStrikeAbility.getInstance(), AttachmentType.EQUIPMENT)));
|
||||
|
||||
// Whenever a creature dealt damage by equipped creature this turn dies, you may exile that card. If you do, put a 2/2 black Zombie creature token onto the battlefield.
|
||||
this.addAbility(new UnscytheKillerOfKingsTriggeredAbility(new UnscytheEffect()));
|
||||
this.addWatcher(new EquippedDidDamageWatcher());
|
||||
this.addAbility(new UnscytheKillerOfKingsTriggeredAbility(new UnscytheEffect()), new EquippedDidDamageWatcher());
|
||||
|
||||
// Equip {2}
|
||||
this.addAbility(new EquipAbility(Outcome.AddAbility, new GenericManaCost(2), new TargetControlledCreaturePermanent()));
|
||||
|
|
|
@ -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.antiquities;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Plopman
|
||||
*/
|
||||
public class CircleOfProtectionArtifacts extends mage.sets.fifthdawn.CircleOfProtectionArtifacts {
|
||||
|
||||
public CircleOfProtectionArtifacts(UUID ownerId) {
|
||||
super(ownerId);
|
||||
this.cardNumber = 97;
|
||||
this.expansionSetCode = "ATQ";
|
||||
}
|
||||
|
||||
public CircleOfProtectionArtifacts(final CircleOfProtectionArtifacts card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public CircleOfProtectionArtifacts copy() {
|
||||
return new CircleOfProtectionArtifacts(this);
|
||||
}
|
||||
}
|
52
Mage.Sets/src/mage/sets/archenemy/TorrentOfSouls.java
Normal file
52
Mage.Sets/src/mage/sets/archenemy/TorrentOfSouls.java
Normal file
|
@ -0,0 +1,52 @@
|
|||
/*
|
||||
* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without modification, are
|
||||
* permitted provided that the following conditions are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright notice, this list of
|
||||
* conditions and the following disclaimer.
|
||||
*
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
|
||||
* of conditions and the following disclaimer in the documentation and/or other materials
|
||||
* provided with the distribution.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED
|
||||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
|
||||
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR
|
||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
|
||||
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
|
||||
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
* The views and conclusions contained in the software and documentation are those of the
|
||||
* authors and should not be interpreted as representing official policies, either expressed
|
||||
* or implied, of BetaSteward_at_googlemail.com.
|
||||
*/
|
||||
package mage.sets.archenemy;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author jeffwadsworth
|
||||
*/
|
||||
public class TorrentOfSouls extends mage.sets.shadowmoor.TorrentOfSouls {
|
||||
|
||||
public TorrentOfSouls(UUID ownerId) {
|
||||
super(ownerId);
|
||||
this.cardNumber = 96;
|
||||
this.expansionSetCode = "ARC";
|
||||
}
|
||||
|
||||
public TorrentOfSouls(final TorrentOfSouls card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public TorrentOfSouls copy() {
|
||||
return new TorrentOfSouls(this);
|
||||
}
|
||||
}
|
|
@ -62,7 +62,7 @@ public class Aggravate extends CardImpl {
|
|||
this.getSpellAbility().addTarget(new TargetPlayer());
|
||||
// Each creature dealt damage this way attacks this turn if able.
|
||||
this.getSpellAbility().addEffect(new AggravateRequirementEffect());
|
||||
this.addWatcher(new DamagedByWatcher());
|
||||
this.getSpellAbility().addWatcher(new DamagedByWatcher());
|
||||
}
|
||||
|
||||
public Aggravate(final Aggravate card) {
|
||||
|
|
|
@ -36,6 +36,7 @@ import mage.Mana;
|
|||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.AsEntersBattlefieldAbility;
|
||||
import mage.abilities.common.SimpleStaticAbility;
|
||||
import mage.abilities.costs.common.TapSourceCost;
|
||||
import mage.abilities.effects.ContinuousRuleModifiyingEffectImpl;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.abilities.mana.ColorlessManaAbility;
|
||||
|
@ -79,8 +80,7 @@ public class CavernOfSouls extends CardImpl {
|
|||
this.addAbility(new ColorlessManaAbility());
|
||||
|
||||
// {T}: Add one mana of any color to your mana pool. Spend this mana only to cast a creature spell of the chosen type, and that spell can't be countered.
|
||||
this.addAbility(new ConditionalAnyColorManaAbility(1, new CavernOfSoulsManaBuilder()));
|
||||
this.addWatcher(new CavernOfSoulsWatcher());
|
||||
this.addAbility(new ConditionalAnyColorManaAbility(new TapSourceCost(), 1, new CavernOfSoulsManaBuilder(), true), new CavernOfSoulsWatcher());
|
||||
this.addAbility(new SimpleStaticAbility(Zone.ALL, new CavernOfSoulsCantCounterEffect()));
|
||||
}
|
||||
|
||||
|
|
|
@ -62,6 +62,7 @@ public class PillarOfFlame extends CardImpl {
|
|||
this.getSpellAbility().addTarget(new TargetCreatureOrPlayer());
|
||||
// If a creature dealt damage this way would die this turn, exile it instead.
|
||||
this.getSpellAbility().addEffect(new DealtDamageToCreatureBySourceDies(this, Duration.EndOfTurn));
|
||||
this.getSpellAbility().addWatcher(new DamagedByWatcher());
|
||||
}
|
||||
|
||||
public PillarOfFlame(final PillarOfFlame card) {
|
||||
|
|
|
@ -63,8 +63,7 @@ public class GoblinCohort extends CardImpl {
|
|||
this.toughness = new MageInt(2);
|
||||
|
||||
// Goblin Cohort can't attack unless you've cast a creature spell this turn.
|
||||
this.addWatcher(new PlayerCastCreatureWatcher());
|
||||
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GoblinCohortEffect()));
|
||||
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GoblinCohortEffect()), new PlayerCastCreatureWatcher());
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -77,8 +77,8 @@ public class KumanosBlessing extends CardImpl {
|
|||
this.addAbility(ability);
|
||||
|
||||
// If a creature dealt damage by enchanted creature this turn would die, exile it instead.
|
||||
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new KumanosBlessingEffect()));
|
||||
this.addWatcher(new DamagedByEnchantedWatcher());
|
||||
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new KumanosBlessingEffect()), new DamagedByEnchantedWatcher());
|
||||
|
||||
}
|
||||
|
||||
public KumanosBlessing(final KumanosBlessing card) {
|
||||
|
|
|
@ -37,7 +37,7 @@ import mage.cards.CardImpl;
|
|||
import mage.constants.CardType;
|
||||
import mage.constants.Rarity;
|
||||
import mage.constants.Zone;
|
||||
import mage.filter.common.FilterCreaturePermanent;
|
||||
import mage.filter.common.FilterControlledCreaturePermanent;
|
||||
import mage.filter.common.FilterPermanentCard;
|
||||
import mage.filter.predicate.mageobject.SubtypePredicate;
|
||||
import mage.filter.predicate.mageobject.SupertypePredicate;
|
||||
|
@ -70,7 +70,7 @@ public class Lifespinner extends CardImpl {
|
|||
SimpleActivatedAbility ability = new SimpleActivatedAbility(Zone.BATTLEFIELD,
|
||||
new SearchLibraryPutInPlayEffect(new TargetCardInLibrary(filter)),
|
||||
new TapSourceCost());
|
||||
ability.addCost(new SacrificeTargetCost(new TargetControlledPermanent(3, 3, new FilterCreaturePermanent("Spirit", "three Spirits"), false)));
|
||||
ability.addCost(new SacrificeTargetCost(new TargetControlledPermanent(3, 3, new FilterControlledCreaturePermanent("Spirit", "three Spirits"), false)));
|
||||
this.addAbility(ability);
|
||||
}
|
||||
|
||||
|
|
|
@ -34,7 +34,7 @@ import mage.abilities.keyword.SpliceOntoArcaneAbility;
|
|||
import mage.cards.CardImpl;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Rarity;
|
||||
import mage.filter.common.FilterLandPermanent;
|
||||
import mage.filter.common.FilterControlledLandPermanent;
|
||||
import mage.filter.predicate.mageobject.SubtypePredicate;
|
||||
import mage.target.common.TargetControlledPermanent;
|
||||
import mage.target.common.TargetCreaturePermanent;
|
||||
|
@ -44,7 +44,7 @@ import mage.target.common.TargetCreaturePermanent;
|
|||
* @author LevelX2
|
||||
*/
|
||||
public class TorrentOfStone extends CardImpl {
|
||||
private static final FilterLandPermanent filterSacrifice = new FilterLandPermanent("two Mountains");
|
||||
private static final FilterControlledLandPermanent filterSacrifice = new FilterControlledLandPermanent("two Mountains");
|
||||
|
||||
static {
|
||||
filterSacrifice.add(new SubtypePredicate("Mountain"));
|
||||
|
|
|
@ -78,8 +78,8 @@ public class EpharaGodOfThePolis extends CardImpl {
|
|||
this.addAbility(new ConditionalTriggeredAbility(
|
||||
new BeginningOfUpkeepTriggeredAbility(Zone.BATTLEFIELD, new DrawCardSourceControllerEffect(1), TargetController.ANY, false),
|
||||
HadAnotherCreatureEnterTheBattlefieldCondition.getInstance(),
|
||||
"At the beginning of each upkeep, if you had another creature enter the battlefield under your control last turn, draw a card."));
|
||||
this.addWatcher(new CreatureEnteredBattlefieldLastTurnWatcher());
|
||||
"At the beginning of each upkeep, if you had another creature enter the battlefield under your control last turn, draw a card."),
|
||||
new CreatureEnteredBattlefieldLastTurnWatcher());
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -28,6 +28,7 @@
|
|||
package mage.sets.bornofthegods;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.MageObject;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.DelayedTriggeredAbility;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
|
@ -162,6 +163,7 @@ class SearingBloodDelayedEffect extends OneShotEffect {
|
|||
if (permanent != null) {
|
||||
Player player = game.getPlayer(permanent.getControllerId());
|
||||
if (player != null) {
|
||||
MageObject sourceObject = source.getSourceObject(game);
|
||||
player.damage(3, source.getSourceId(), game, false, true);
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -60,8 +60,7 @@ public class SpiritOfTheLabyrinth extends CardImpl {
|
|||
this.toughness = new MageInt(1);
|
||||
|
||||
// Each player can't draw more than one card each turn.
|
||||
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new SpiritOfTheLabyrinthEffect()));
|
||||
this.addWatcher(new SpiritOfTheLabyrinthWatcher());
|
||||
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new SpiritOfTheLabyrinthEffect()), new SpiritOfTheLabyrinthWatcher());
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -54,8 +54,7 @@ public class AshenSkinZubera extends CardImpl {
|
|||
this.toughness = new MageInt(2);
|
||||
Ability ability = new DiesTriggeredAbility(new DiscardTargetEffect(new ZuberasDiedDynamicValue()));
|
||||
ability.addTarget(new TargetOpponent());
|
||||
this.addAbility(ability);
|
||||
this.addWatcher(new ZuberasDiedWatcher());
|
||||
this.addAbility(ability, new ZuberasDiedWatcher());
|
||||
}
|
||||
|
||||
public AshenSkinZubera(final AshenSkinZubera card) {
|
||||
|
|
|
@ -75,8 +75,7 @@ public class BoseijuWhoSheltersAll extends CardImpl {
|
|||
ability.getEffects().get(0).setText("Add {1} to your mana pool. If that mana is spent on an instant or sorcery spell, that spell can't be countered by spells or abilities");
|
||||
this.addAbility(ability);
|
||||
|
||||
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoseijuWhoSheltersAllCantCounterEffect()));
|
||||
this.addWatcher(new BoseijuWhoSheltersAllWatcher());
|
||||
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoseijuWhoSheltersAllCantCounterEffect()), new BoseijuWhoSheltersAllWatcher());
|
||||
}
|
||||
|
||||
public BoseijuWhoSheltersAll(final BoseijuWhoSheltersAll card) {
|
||||
|
|
|
@ -51,8 +51,7 @@ public class DrippingTongueZubera extends CardImpl {
|
|||
this.color.setGreen(true);
|
||||
this.power = new MageInt(1);
|
||||
this.toughness = new MageInt(2);
|
||||
this.addAbility(new DiesTriggeredAbility(new CreateTokenEffect(new SpiritToken(), new ZuberasDiedDynamicValue()), false));
|
||||
this.addWatcher(new ZuberasDiedWatcher());
|
||||
this.addAbility(new DiesTriggeredAbility(new CreateTokenEffect(new SpiritToken(), new ZuberasDiedDynamicValue()), false), new ZuberasDiedWatcher());
|
||||
}
|
||||
|
||||
public DrippingTongueZubera (final DrippingTongueZubera card) {
|
||||
|
|
|
@ -55,8 +55,7 @@ public class EmberFistZubera extends CardImpl {
|
|||
this.toughness = new MageInt(2);
|
||||
Ability ability = new DiesTriggeredAbility(new DamageTargetEffect(new ZuberasDiedDynamicValue()));
|
||||
ability.addTarget(new TargetCreatureOrPlayer());
|
||||
this.addAbility(ability);
|
||||
this.addWatcher(new ZuberasDiedWatcher());
|
||||
this.addAbility(ability, new ZuberasDiedWatcher());
|
||||
}
|
||||
|
||||
public EmberFistZubera (final EmberFistZubera card) {
|
||||
|
|
|
@ -32,13 +32,12 @@ import java.util.UUID;
|
|||
import mage.constants.CardType;
|
||||
import mage.constants.Outcome;
|
||||
import mage.constants.Rarity;
|
||||
import mage.constants.Zone;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.abilities.effects.common.DestroyTargetEffect;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.filter.FilterPermanent;
|
||||
import mage.filter.common.FilterLandPermanent;
|
||||
import mage.filter.common.FilterControlledLandPermanent;
|
||||
import mage.filter.common.FilterControlledPermanent;
|
||||
import mage.filter.predicate.permanent.ControllerIdPredicate;
|
||||
import mage.game.Game;
|
||||
import mage.game.permanent.Permanent;
|
||||
|
@ -93,23 +92,25 @@ class FeastOfWormsEffect extends OneShotEffect {
|
|||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Permanent permanent = (Permanent) game.getLastKnownInformation(source.getFirstTarget(), Zone.BATTLEFIELD);
|
||||
Player targetPlayer = game.getPlayer(permanent.getControllerId());
|
||||
if (targetPlayer != null && permanent != null && (permanent.getSupertype().get(0).toString().equals("Legendary"))) {
|
||||
FilterPermanent filter = new FilterLandPermanent("land to sacrifice");
|
||||
Permanent permanent = game.getPermanentOrLKIBattlefield(id);
|
||||
Player targetPlayer = null;
|
||||
if (permanent != null) {
|
||||
targetPlayer = game.getPlayer(permanent.getControllerId());
|
||||
}
|
||||
if (targetPlayer != null && permanent != null && (permanent.getSupertype().get(0).equals("Legendary"))) {
|
||||
FilterControlledPermanent filter = new FilterControlledLandPermanent("land to sacrifice");
|
||||
filter.add(new ControllerIdPredicate(targetPlayer.getId()));
|
||||
TargetControlledPermanent target = new TargetControlledPermanent(1, 1, filter, false);
|
||||
|
||||
if (target.canChoose(targetPlayer.getId(), game)) {
|
||||
targetPlayer.choose(Outcome.Sacrifice, target, source.getSourceId(), game);
|
||||
|
||||
targetPlayer.chooseTarget(Outcome.Sacrifice, target, source, game);
|
||||
Permanent land = game.getPermanent(target.getFirstTarget());
|
||||
if (land != null) {
|
||||
return land.sacrifice(source.getSourceId(), game);
|
||||
land.sacrifice(source.getSourceId(), game);
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -60,8 +60,7 @@ public class FloatingDreamZubera extends CardImpl {
|
|||
this.color.setBlue(true);
|
||||
this.power = new MageInt(1);
|
||||
this.toughness = new MageInt(2);
|
||||
this.addAbility(new DiesTriggeredAbility(new DrawCardSourceControllerEffect(new ZuberasDiedDynamicValue())));
|
||||
this.addWatcher(new ZuberasDiedWatcher());
|
||||
this.addAbility(new DiesTriggeredAbility(new DrawCardSourceControllerEffect(new ZuberasDiedDynamicValue())), new ZuberasDiedWatcher());
|
||||
}
|
||||
|
||||
public FloatingDreamZubera(final FloatingDreamZubera card) {
|
||||
|
|
|
@ -42,6 +42,7 @@ import mage.constants.Duration;
|
|||
import mage.constants.Rarity;
|
||||
import mage.constants.Zone;
|
||||
import mage.target.common.TargetCreatureOrPlayer;
|
||||
import mage.watchers.common.DamagedByWatcher;
|
||||
|
||||
/**
|
||||
* @author LevelX
|
||||
|
@ -62,7 +63,7 @@ public class Frostwielder extends CardImpl {
|
|||
ability.addTarget(new TargetCreatureOrPlayer());
|
||||
this.addAbility(ability);
|
||||
// If a creature dealt damage by Frostwielder this turn would die, exile it instead.
|
||||
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new DealtDamageToCreatureBySourceDies(this, Duration.WhileOnBattlefield)));
|
||||
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new DealtDamageToCreatureBySourceDies(this, Duration.WhileOnBattlefield)), new DamagedByWatcher());
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -77,9 +77,7 @@ public class HallOfTheBanditLord extends CardImpl {
|
|||
effect.setText("Add {1} to your mana pool. If that mana is spent on a creature spell, it gains haste");
|
||||
Ability ability = new SimpleManaAbility(Zone.BATTLEFIELD, effect, new TapSourceCost());
|
||||
ability.addCost(new PayLifeCost(3));
|
||||
this.addAbility(ability);
|
||||
|
||||
this.addWatcher(new HallOfTheBanditLordWatcher(ability));
|
||||
this.addAbility(ability, new HallOfTheBanditLordWatcher(ability));
|
||||
}
|
||||
|
||||
public HallOfTheBanditLord(final HallOfTheBanditLord card) {
|
||||
|
|
|
@ -44,6 +44,7 @@ import mage.constants.Duration;
|
|||
import mage.constants.Rarity;
|
||||
import mage.constants.Zone;
|
||||
import mage.target.common.TargetCreatureOrPlayer;
|
||||
import mage.watchers.common.DamagedByWatcher;
|
||||
|
||||
/**
|
||||
* @author LevelX
|
||||
|
@ -65,7 +66,7 @@ public class KumanoMasterYamabushi extends CardImpl {
|
|||
ability.addTarget(new TargetCreatureOrPlayer());
|
||||
this.addAbility(ability);
|
||||
// If a creature dealt damage by Kumano this turn would die, exile it instead.
|
||||
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new DealtDamageToCreatureBySourceDies(this, Duration.WhileOnBattlefield)));
|
||||
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new DealtDamageToCreatureBySourceDies(this, Duration.WhileOnBattlefield)), new DamagedByWatcher());
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -37,6 +37,7 @@ import mage.constants.CardType;
|
|||
import mage.constants.Duration;
|
||||
import mage.constants.Rarity;
|
||||
import mage.constants.Zone;
|
||||
import mage.watchers.common.DamagedByWatcher;
|
||||
|
||||
/**
|
||||
* @author LevelX
|
||||
|
@ -53,7 +54,7 @@ public class KumanosPupils extends CardImpl {
|
|||
this.toughness = new MageInt(3);
|
||||
|
||||
// If a creature dealt damage by Kumano's Pupils this turn would die, exile it instead.
|
||||
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new DealtDamageToCreatureBySourceDies(this, Duration.WhileOnBattlefield)));
|
||||
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new DealtDamageToCreatureBySourceDies(this, Duration.WhileOnBattlefield)), new DamagedByWatcher());
|
||||
}
|
||||
|
||||
public KumanosPupils(final KumanosPupils card) {
|
||||
|
|
|
@ -72,7 +72,7 @@ public class MyojinOfCleansingFire extends CardImpl {
|
|||
this.power = new MageInt(4);
|
||||
this.toughness = new MageInt(6);
|
||||
|
||||
this.addWatcher(new CastFromHandWatcher());
|
||||
this.getSpellAbility().addWatcher(new CastFromHandWatcher());
|
||||
|
||||
// Myojin of Cleansing Fire enters the battlefield with a divinity counter on it if you cast it from your hand.
|
||||
this.addAbility(new EntersBattlefieldAbility(new ConditionalOneShotEffect(new AddCountersSourceEffect(CounterType.DIVINITY.createInstance()), new CastFromHandCondition(), ""), "{this} enters the battlefield with a divinity counter on it if you cast it from your hand"));
|
||||
|
|
|
@ -68,7 +68,7 @@ public class MyojinOfInfiniteRage extends CardImpl {
|
|||
this.power = new MageInt(7);
|
||||
this.toughness = new MageInt(4);
|
||||
|
||||
this.addWatcher(new CastFromHandWatcher());
|
||||
this.getSpellAbility().addWatcher(new CastFromHandWatcher());
|
||||
|
||||
// Myojin of Infinite Rage enters the battlefield with a divinity counter on it if you cast it from your hand.
|
||||
this.addAbility(new EntersBattlefieldAbility(new ConditionalOneShotEffect(new AddCountersSourceEffect(CounterType.DIVINITY.createInstance()), new CastFromHandCondition(), ""), "{this} enters the battlefield with a divinity counter on it if you cast it from your hand"));
|
||||
|
|
|
@ -73,7 +73,7 @@ public class MyojinOfLifesWeb extends CardImpl {
|
|||
this.power = new MageInt(8);
|
||||
this.toughness = new MageInt(8);
|
||||
|
||||
this.addWatcher(new CastFromHandWatcher());
|
||||
this.getSpellAbility().addWatcher(new CastFromHandWatcher());
|
||||
|
||||
// Myojin of Life's Web enters the battlefield with a divinity counter on it if you cast it from your hand.
|
||||
this.addAbility(new EntersBattlefieldAbility(new ConditionalOneShotEffect(new AddCountersSourceEffect(CounterType.DIVINITY.createInstance()), new CastFromHandCondition(), ""), "{this} enters the battlefield with a divinity counter on it if you cast it from your hand"));
|
||||
|
|
|
@ -66,7 +66,7 @@ public class MyojinOfNightsReach extends CardImpl {
|
|||
this.power = new MageInt(5);
|
||||
this.toughness = new MageInt(2);
|
||||
|
||||
this.addWatcher(new CastFromHandWatcher());
|
||||
this.getSpellAbility().addWatcher(new CastFromHandWatcher());
|
||||
|
||||
// Myojin of Night's Reach enters the battlefield with a divinity counter on it if you cast it from your hand.
|
||||
this.addAbility(new EntersBattlefieldAbility(new ConditionalOneShotEffect(new AddCountersSourceEffect(CounterType.DIVINITY.createInstance()), new CastFromHandCondition(), ""), "{this} enters the battlefield with a divinity counter on it if you cast it from your hand"));
|
||||
|
|
|
@ -71,7 +71,7 @@ public class MyojinOfSeeingWinds extends CardImpl {
|
|||
this.power = new MageInt(3);
|
||||
this.toughness = new MageInt(3);
|
||||
|
||||
this.addWatcher(new CastFromHandWatcher());
|
||||
this.getSpellAbility().addWatcher(new CastFromHandWatcher());
|
||||
|
||||
// Myojin of Seeing Winds enters the battlefield with a divinity counter on it if you cast it from your hand.
|
||||
this.addAbility(new EntersBattlefieldAbility(new ConditionalOneShotEffect(new AddCountersSourceEffect(CounterType.DIVINITY.createInstance()), new CastFromHandCondition(), ""), "{this} enters the battlefield with a divinity counter on it if you cast it from your hand"));
|
||||
|
|
|
@ -36,7 +36,7 @@ import mage.abilities.common.SimpleStaticAbility;
|
|||
import mage.abilities.effects.ReplacementEffectImpl;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.counters.CounterType;
|
||||
import mage.filter.FilterPermanent;
|
||||
import mage.filter.common.FilterControlledPermanent;
|
||||
import mage.game.Game;
|
||||
import mage.game.events.GameEvent;
|
||||
import mage.game.permanent.Permanent;
|
||||
|
@ -106,7 +106,7 @@ class ShimatsuTheBloodcloakedEffect extends ReplacementEffectImpl {
|
|||
Permanent creature = game.getPermanent(event.getTargetId());
|
||||
Player controller = game.getPlayer(source.getControllerId());
|
||||
if (creature != null && controller != null) {
|
||||
Target target = new TargetControlledPermanent(0, Integer.MAX_VALUE, new FilterPermanent(), true);
|
||||
Target target = new TargetControlledPermanent(0, Integer.MAX_VALUE, new FilterControlledPermanent(), true);
|
||||
if (!target.canChoose(source.getSourceId(), source.getControllerId(), game)) {
|
||||
return false;
|
||||
}
|
||||
|
|
|
@ -74,7 +74,7 @@ public class SiftThroughSands extends CardImpl {
|
|||
this.getSpellAbility().addEffect(effect);
|
||||
// If you've cast a spell named Peer Through Depths and a spell named Reach Through Mists this turn, you may search your library for a card named The Unspeakable, put it onto the battlefield, then shuffle your library.
|
||||
this.getSpellAbility().addEffect(new ConditionalOneShotEffect(new SearchLibraryPutInPlayEffect(new TargetCardInLibrary(filter), false, true), new SiftThroughSandsCondition(), rule));
|
||||
this.addWatcher(new SiftThroughSandsWatcher());
|
||||
this.getSpellAbility().addWatcher(new SiftThroughSandsWatcher());
|
||||
}
|
||||
|
||||
public SiftThroughSands(final SiftThroughSands card) {
|
||||
|
|
|
@ -56,8 +56,7 @@ public class SilentChantZubera extends CardImpl {
|
|||
this.power = new MageInt(1);
|
||||
this.toughness = new MageInt(2);
|
||||
Ability ability = new DiesTriggeredAbility(new GainLifeEffect(new SilentChantZuberaDynamicValue()));
|
||||
this.addAbility(ability);
|
||||
this.addWatcher(new ZuberasDiedWatcher());
|
||||
this.addAbility(ability, new ZuberasDiedWatcher());
|
||||
}
|
||||
|
||||
public SilentChantZubera (final SilentChantZubera card) {
|
||||
|
|
|
@ -41,7 +41,7 @@ import mage.abilities.keyword.FlyingAbility;
|
|||
import mage.cards.CardImpl;
|
||||
import mage.constants.Zone;
|
||||
import mage.filter.FilterSpell;
|
||||
import mage.filter.common.FilterLandPermanent;
|
||||
import mage.filter.common.FilterControlledLandPermanent;
|
||||
import mage.filter.predicate.Predicates;
|
||||
import mage.filter.predicate.mageobject.CardTypePredicate;
|
||||
import mage.target.TargetSpell;
|
||||
|
@ -67,7 +67,7 @@ public class UyoSilentProphet extends CardImpl {
|
|||
this.supertype.add("Legendary");
|
||||
this.subtype.add("Moonfolk");
|
||||
this.subtype.add("Wizard");
|
||||
this.color.setBlue(true);
|
||||
|
||||
this.power = new MageInt(4);
|
||||
this.toughness = new MageInt(4);
|
||||
|
||||
|
@ -75,7 +75,7 @@ public class UyoSilentProphet extends CardImpl {
|
|||
this.addAbility(FlyingAbility.getInstance());
|
||||
// {2}, Return two lands you control to their owner's hand: Copy target instant or sorcery spell. You may choose new targets for the copy.
|
||||
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new CopyTargetSpellEffect(), new GenericManaCost(2));
|
||||
ability.addCost(new ReturnToHandTargetCost(new TargetControlledPermanent(2, 2, new FilterLandPermanent("lands"), false)));
|
||||
ability.addCost(new ReturnToHandTargetCost(new TargetControlledPermanent(2, 2, new FilterControlledLandPermanent("lands"), false)));
|
||||
ability.addTarget(new TargetSpell(filter));
|
||||
this.addAbility(ability);
|
||||
}
|
||||
|
|
|
@ -37,6 +37,7 @@ import mage.constants.CardType;
|
|||
import mage.constants.Duration;
|
||||
import mage.constants.Rarity;
|
||||
import mage.target.common.TargetCreatureOrPlayer;
|
||||
import mage.watchers.common.DamagedByWatcher;
|
||||
|
||||
/**
|
||||
*
|
||||
|
@ -55,6 +56,7 @@ public class YamabushisFlame extends CardImpl {
|
|||
|
||||
// If a creature dealt damage this way would die this turn, exile it instead.
|
||||
this.getSpellAbility().addEffect(new DealtDamageToCreatureBySourceDies(this, Duration.EndOfTurn));
|
||||
this.getSpellAbility().addWatcher(new DamagedByWatcher());
|
||||
}
|
||||
|
||||
public YamabushisFlame(final YamabushisFlame card) {
|
||||
|
|
|
@ -63,6 +63,7 @@ public class YamabushisStorm extends CardImpl {
|
|||
this.getSpellAbility().addEffect(new DamageAllEffect(1, new FilterCreaturePermanent()));
|
||||
// If a creature dealt damage this way would die this turn, exile it instead.
|
||||
this.getSpellAbility().addEffect(new DealtDamageToCreatureBySourceDies(this, Duration.EndOfTurn));
|
||||
this.getSpellAbility().addWatcher(new DamagedByWatcher());
|
||||
}
|
||||
|
||||
public YamabushisStorm(final YamabushisStorm card) {
|
||||
|
|
|
@ -75,7 +75,7 @@ public class FuryOfTheHorde extends CardImpl {
|
|||
// Untap all creatures that attacked this turn. After this main phase, there is an additional combat phase followed by an additional main phase.
|
||||
this.getSpellAbility().addEffect(new FuryOfTheHordeUntapEffect());
|
||||
this.getSpellAbility().addEffect(new FuryOfTheHordeAddPhasesEffect());
|
||||
this.addWatcher(new AttackedThisTurnWatcher());
|
||||
this.getSpellAbility().addWatcher(new AttackedThisTurnWatcher());
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -100,7 +100,7 @@ class LightningStormCountCondition implements DynamicValue {
|
|||
public int calculate(Game game, Ability sourceAbility, Effect effect) {
|
||||
Spell spell = game.getStack().getSpell(sourceAbility.getSourceId());
|
||||
if (spell != null) {
|
||||
return spell.getCounters().getCount(counter) + 3;
|
||||
return spell.getCounters(game).getCount(counter) + 3;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -66,8 +66,7 @@ public class CourtHussar extends CardImpl {
|
|||
new LookLibraryAndPickControllerEffect(new StaticValue(3), false, new StaticValue(1), new FilterCard(), Zone.LIBRARY, false, false),
|
||||
false));
|
||||
// When Court Hussar enters the battlefield, sacrifice it unless {W} was spent to cast it.
|
||||
this.addAbility(new EntersBattlefieldTriggeredAbility(new SacrificeSourceUnlessConditionEffect(new ManaWasSpentCondition(ColoredManaSymbol.W)), false));
|
||||
this.addWatcher(new ManaSpentToCastWatcher());
|
||||
this.addAbility(new EntersBattlefieldTriggeredAbility(new SacrificeSourceUnlessConditionEffect(new ManaWasSpentCondition(ColoredManaSymbol.W)), false), new ManaSpentToCastWatcher());
|
||||
}
|
||||
|
||||
public CourtHussar(final CourtHussar card) {
|
||||
|
|
|
@ -82,8 +82,7 @@ public class KaradorGhostChieftain extends CardImpl {
|
|||
this.addAbility(new SimpleStaticAbility(Zone.STACK, new KaradorGhostChieftainCostReductionEffect()));
|
||||
|
||||
// During each of your turns, you may cast one creature card from your graveyard.
|
||||
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new KaradorGhostChieftainContinuousEffect()));
|
||||
this.addWatcher(new KaradorGhostChieftainWatcher());
|
||||
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new KaradorGhostChieftainContinuousEffect()), new KaradorGhostChieftainWatcher());
|
||||
}
|
||||
|
||||
public KaradorGhostChieftain(final KaradorGhostChieftain card) {
|
||||
|
|
|
@ -60,8 +60,7 @@ public class AzoriusHerald extends CardImpl {
|
|||
// When Azorius Herald enters the battlefield, you gain 4 life.
|
||||
this.addAbility(new EntersBattlefieldTriggeredAbility(new GainLifeEffect(4)));
|
||||
// When Azorius Herald enters the battlefield, sacrifice it unless {U} was spent to cast it.
|
||||
this.addAbility(new EntersBattlefieldTriggeredAbility(new SacrificeSourceUnlessConditionEffect(new ManaWasSpentCondition(ColoredManaSymbol.U)), false));
|
||||
this.addWatcher(new ManaSpentToCastWatcher());
|
||||
this.addAbility(new EntersBattlefieldTriggeredAbility(new SacrificeSourceUnlessConditionEffect(new ManaWasSpentCondition(ColoredManaSymbol.U)), false), new ManaSpentToCastWatcher());
|
||||
}
|
||||
|
||||
public AzoriusHerald(final AzoriusHerald card) {
|
||||
|
|
|
@ -78,8 +78,7 @@ public class FellShepherd extends CardImpl {
|
|||
this.toughness = new MageInt(6);
|
||||
|
||||
// Whenever Fell Shepherd deals combat damage to a player, you may return to your hand all creature cards that were put into your graveyard from the battlefield this turn.
|
||||
this.addAbility(new DealsCombatDamageToAPlayerTriggeredAbility(new FellShepherdEffect(), true));
|
||||
this.addWatcher(new FellShepherdWatcher());
|
||||
this.addAbility(new DealsCombatDamageToAPlayerTriggeredAbility(new FellShepherdEffect(), true), new FellShepherdWatcher());
|
||||
|
||||
// {B}, Sacrifice another creature: Target creature gets -2/-2 until end of turn.
|
||||
SimpleActivatedAbility ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new BoostTargetEffect(-2,-2, Duration.EndOfTurn), new ManaCostsImpl("{B}"));
|
||||
|
|
|
@ -76,8 +76,7 @@ public class JelevaNephaliasScourge extends CardImpl {
|
|||
// When Jeleva, Nephalia's Scourge enters the battlefield, each player exiles the top X cards of his or her library, where X is the amount of mana spent to cast Jeleva.
|
||||
this.addAbility(new EntersBattlefieldTriggeredAbility(new JelevaNephaliasScourgeEffect(), false));
|
||||
// Whenever Jeleva attacks, you may cast an instant or sorcery card exiled with it without paying its mana cost.
|
||||
this.addAbility(new AttacksTriggeredAbility(new JelevaNephaliasCastEffect(), false));
|
||||
this.addWatcher(new JelevaNephaliasWatcher());
|
||||
this.addAbility(new AttacksTriggeredAbility(new JelevaNephaliasCastEffect(), false), new JelevaNephaliasWatcher());
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -75,13 +75,12 @@ public class OpalPalace extends CardImpl {
|
|||
// {1}, {tap}: Add to your mana pool one mana of any color in your commander's color identity. If you spend this mana to cast your commander, it enters the battlefield with a number of +1/+1 counters on it equal to the number of times it's been cast from the command zone this game.
|
||||
Ability ability = new CommanderColorIdentityManaAbility(new GenericManaCost(1));
|
||||
ability.addCost(new TapSourceCost());
|
||||
this.addAbility(ability);
|
||||
this.addAbility(ability, new OpalPalaceWatcher());
|
||||
|
||||
ability = new SimpleStaticAbility(Zone.ALL, new OpalPalaceEntersBattlefieldEffect());
|
||||
ability.setRuleVisible(false);
|
||||
this.addAbility(ability);
|
||||
|
||||
this.addWatcher(new OpalPalaceWatcher());
|
||||
}
|
||||
|
||||
public OpalPalace(final OpalPalace card) {
|
||||
|
|
|
@ -68,7 +68,7 @@ public class PhantomNantuko extends CardImpl {
|
|||
// Trample
|
||||
this.addAbility(TrampleAbility.getInstance());
|
||||
// Phantom Nantuko enters the battlefield with two +1/+1 counters on it.
|
||||
this.addAbility(new EntersBattlefieldAbility(new AddCountersSourceEffect(CounterType.P1P1.createInstance(2), true)));
|
||||
this.addAbility(new EntersBattlefieldAbility(new AddCountersSourceEffect(CounterType.P1P1.createInstance(2), true), "with two +1/+1 counters on it"));
|
||||
// If damage would be dealt to Phantom Nantuko, prevent that damage. Remove a +1/+1 counter from Phantom Nantuko.
|
||||
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new PhantomNantukoPreventionEffect()));
|
||||
// {tap}: Put a +1/+1 counter on Phantom Nantuko.
|
||||
|
|
|
@ -65,8 +65,7 @@ public class AngelOfTheDireHour extends CardImpl {
|
|||
Ability ability = new EntersBattlefieldTriggeredAbility(
|
||||
new ConditionalOneShotEffect(new ExileAllEffect(new FilterAttackingCreature("attacking creatures")), new CastFromHandCondition(),
|
||||
" if you cast it from your hand, exile all attacking creatures"));
|
||||
this.addAbility(ability);
|
||||
this.addWatcher(new CastFromHandWatcher());
|
||||
this.addAbility(ability, new CastFromHandWatcher());
|
||||
}
|
||||
|
||||
public AngelOfTheDireHour(final AngelOfTheDireHour card) {
|
||||
|
|
|
@ -68,8 +68,7 @@ public class BreachingLeviathan extends CardImpl {
|
|||
Ability ability = new EntersBattlefieldTriggeredAbility(
|
||||
new ConditionalOneShotEffect(new BreachingLeviathanEffect(), new CastFromHandCondition(),
|
||||
"if you cast it from your hand, tap all nonblue creatures. Those creatures don't untap during their controllers' next untap steps"));
|
||||
this.addAbility(ability);
|
||||
this.addWatcher(new CastFromHandWatcher());
|
||||
this.addAbility(ability, new CastFromHandWatcher());
|
||||
}
|
||||
|
||||
public BreachingLeviathan(final BreachingLeviathan card) {
|
||||
|
|
|
@ -72,8 +72,7 @@ public class ContainmentPriest extends CardImpl {
|
|||
// Flash
|
||||
this.addAbility(FlashAbility.getInstance());
|
||||
// If a nontoken creature would enter the battlefield and it wasn't cast, exile it instead.
|
||||
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new ContainmentPriestReplacementEffect()));
|
||||
this.addWatcher(new CreatureCastWatcher());
|
||||
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new ContainmentPriestReplacementEffect()), new CreatureCastWatcher());
|
||||
}
|
||||
|
||||
public ContainmentPriest(final ContainmentPriest card) {
|
||||
|
|
|
@ -62,7 +62,7 @@ public class ImpactResonance extends CardImpl {
|
|||
effect.setText("{this} deals X damage divided as you choose among any number of target creatures, where X is the greatest amount of damage dealt by a source to a permanent or player this turn");
|
||||
this.getSpellAbility().addEffect(effect);
|
||||
this.getSpellAbility().addTarget(new TargetCreaturePermanentAmount(xValue));
|
||||
this.addWatcher(new GreatestAmountOfDamageWatcher());
|
||||
this.getSpellAbility().addWatcher(new GreatestAmountOfDamageWatcher());
|
||||
}
|
||||
|
||||
public ImpactResonance(final ImpactResonance card) {
|
||||
|
|
|
@ -61,7 +61,7 @@ public class SpoilsOfBlood extends CardImpl {
|
|||
|
||||
// Put an X/X black Horror creature token onto the battlefield, where X is the number of creatures that died this turn.
|
||||
this.getSpellAbility().addEffect(new SpoilsOfBloodEffect());
|
||||
this.addWatcher(new CreaturesDiedThisTurnWatcher());
|
||||
this.getSpellAbility().addWatcher(new CreaturesDiedThisTurnWatcher());
|
||||
}
|
||||
|
||||
public SpoilsOfBlood(final SpoilsOfBlood card) {
|
||||
|
|
|
@ -81,9 +81,8 @@ public class DungeonGeists extends CardImpl {
|
|||
ability.addEffect(new DungeonGeistsEffect());
|
||||
Target target = new TargetCreaturePermanent(filter);
|
||||
ability.addTarget(target);
|
||||
this.addAbility(ability);
|
||||
this.addAbility(ability, new DungeonGeistsWatcher());
|
||||
// watcher needed to send normal events to Dungeon Geists ReplacementEffect
|
||||
this.addWatcher(new DungeonGeistsWatcher());
|
||||
}
|
||||
|
||||
public DungeonGeists(final DungeonGeists card) {
|
||||
|
|
|
@ -67,7 +67,7 @@ public class Flamebreak extends CardImpl {
|
|||
// Flamebreak deals 3 damage to each creature without flying and each player. Creatures dealt damage this way can't be regenerated this turn.
|
||||
this.getSpellAbility().addEffect(new DamageEverythingEffect(new StaticValue(3), filter1));
|
||||
this.getSpellAbility().addEffect(new FlamebreakCantRegenerateEffect());
|
||||
this.addWatcher(new DamagedByWatcher());
|
||||
this.getSpellAbility().addWatcher(new DamagedByWatcher());
|
||||
}
|
||||
|
||||
public Flamebreak(final Flamebreak card) {
|
||||
|
|
|
@ -75,8 +75,7 @@ public class CryptChampion extends CardImpl {
|
|||
this.addAbility(new EntersBattlefieldTriggeredAbility(new CryptChampionEffect()));
|
||||
|
||||
// When Crypt Champion enters the battlefield, sacrifice it unless {R} was spent to cast it.
|
||||
this.addAbility(new EntersBattlefieldTriggeredAbility(new SacrificeSourceUnlessConditionEffect(new ManaWasSpentCondition(ColoredManaSymbol.R)), false));
|
||||
this.addWatcher(new ManaSpentToCastWatcher());
|
||||
this.addAbility(new EntersBattlefieldTriggeredAbility(new SacrificeSourceUnlessConditionEffect(new ManaWasSpentCondition(ColoredManaSymbol.R)), false), new ManaSpentToCastWatcher());
|
||||
}
|
||||
|
||||
public CryptChampion(final CryptChampion card) {
|
||||
|
|
|
@ -63,8 +63,7 @@ public class PatagiaViper extends CardImpl {
|
|||
this.addAbility(new EntersBattlefieldTriggeredAbility(new CreateTokenEffect(new PatagiaViperSnakeToken(), 2), false));
|
||||
|
||||
// When Patagia Viper enters the battlefield, sacrifice it unless {U} was spent to cast it.
|
||||
this.addAbility(new EntersBattlefieldTriggeredAbility(new SacrificeSourceUnlessConditionEffect(new ManaWasSpentCondition(ColoredManaSymbol.U)), false));
|
||||
this.addWatcher(new ManaSpentToCastWatcher());
|
||||
this.addAbility(new EntersBattlefieldTriggeredAbility(new SacrificeSourceUnlessConditionEffect(new ManaWasSpentCondition(ColoredManaSymbol.U)), false), new ManaSpentToCastWatcher());
|
||||
}
|
||||
|
||||
public PatagiaViper(final PatagiaViper card) {
|
||||
|
|
|
@ -72,8 +72,7 @@ public class ReiverDemon extends CardImpl {
|
|||
Ability ability = new EntersBattlefieldTriggeredAbility(
|
||||
new ConditionalOneShotEffect(new DestroyAllEffect(filter), new CastFromHandCondition(),
|
||||
"if you cast it from your hand, destroy all nonartifact, nonblack creatures. They can't be regenerated"));
|
||||
this.addAbility(ability);
|
||||
this.addWatcher(new CastFromHandWatcher());
|
||||
this.addAbility(ability, new CastFromHandWatcher());
|
||||
}
|
||||
|
||||
public ReiverDemon(final ReiverDemon card) {
|
||||
|
|
|
@ -43,14 +43,12 @@ import mage.abilities.effects.common.continious.GainAbilityTargetEffect;
|
|||
import mage.abilities.effects.common.continious.GainControlTargetEffect;
|
||||
import mage.abilities.keyword.HasteAbility;
|
||||
import mage.cards.SplitCard;
|
||||
import mage.constants.TargetController;
|
||||
import mage.filter.FilterPermanent;
|
||||
import mage.filter.common.FilterArtifactPermanent;
|
||||
import mage.filter.common.FilterCreaturePermanent;
|
||||
import mage.filter.common.FilterEnchantmentPermanent;
|
||||
import mage.filter.common.FilterLandPermanent;
|
||||
import mage.filter.common.FilterPlaneswalkerPermanent;
|
||||
import mage.filter.predicate.permanent.ControllerPredicate;
|
||||
import mage.filter.common.FilterControlledArtifactPermanent;
|
||||
import mage.filter.common.FilterControlledCreaturePermanent;
|
||||
import mage.filter.common.FilterControlledEnchantmentPermanent;
|
||||
import mage.filter.common.FilterControlledLandPermanent;
|
||||
import mage.filter.common.FilterControlledPlaneswalkerPermanent;
|
||||
import mage.game.Game;
|
||||
import mage.game.permanent.Permanent;
|
||||
import mage.players.Player;
|
||||
|
@ -70,13 +68,8 @@ public class CatchRelease extends SplitCard {
|
|||
super(ownerId, 125, "Catch", "Release", Rarity.RARE, new CardType[]{CardType.SORCERY}, "{1}{U}{R}", "{4}{R}{W}",true);
|
||||
this.expansionSetCode = "DGM";
|
||||
|
||||
this.color.setBlue(true);
|
||||
this.color.setRed(true);
|
||||
this.color.setWhite(true);
|
||||
|
||||
// Catch
|
||||
// Gain control of target permanent until end of turn. Untap it. It gains haste until end of turn.
|
||||
getLeftHalfCard().getColor().setRed(true);
|
||||
getLeftHalfCard().getSpellAbility().addTarget(new TargetPermanent(new FilterPermanent()));
|
||||
getLeftHalfCard().getSpellAbility().addEffect(new GainControlTargetEffect(Duration.EndOfTurn));
|
||||
getLeftHalfCard().getSpellAbility().addEffect(new GainAbilityTargetEffect(HasteAbility.getInstance(), Duration.EndOfTurn));
|
||||
|
@ -84,7 +77,6 @@ public class CatchRelease extends SplitCard {
|
|||
|
||||
// Release
|
||||
// Each player sacrifices an artifact, a creature, an enchantment, a land, and a planeswalker.
|
||||
getRightHalfCard().getColor().setGreen(true);
|
||||
getRightHalfCard().getSpellAbility().addEffect(new ReleaseSacrificeEffect());
|
||||
|
||||
}
|
||||
|
@ -101,20 +93,6 @@ public class CatchRelease extends SplitCard {
|
|||
|
||||
class ReleaseSacrificeEffect extends OneShotEffect {
|
||||
|
||||
private static final FilterArtifactPermanent filter1 = new FilterArtifactPermanent("artifact you control");
|
||||
private static final FilterCreaturePermanent filter2 = new FilterCreaturePermanent("creature you control");
|
||||
private static final FilterEnchantmentPermanent filter3 = new FilterEnchantmentPermanent("enchantment you control");
|
||||
private static final FilterLandPermanent filter4 = new FilterLandPermanent("land you control");
|
||||
private static final FilterPlaneswalkerPermanent filter5 = new FilterPlaneswalkerPermanent("planeswalker you control");
|
||||
|
||||
static {
|
||||
filter1.add(new ControllerPredicate(TargetController.YOU));
|
||||
filter2.add(new ControllerPredicate(TargetController.YOU));
|
||||
filter3.add(new ControllerPredicate(TargetController.YOU));
|
||||
filter4.add(new ControllerPredicate(TargetController.YOU));
|
||||
filter5.add(new ControllerPredicate(TargetController.YOU));
|
||||
}
|
||||
|
||||
public ReleaseSacrificeEffect() {
|
||||
super(Outcome.DestroyPermanent);
|
||||
staticText = "Each player sacrifices an artifact, a creature, an enchantment, a land, and a planeswalker";
|
||||
|
@ -126,7 +104,7 @@ class ReleaseSacrificeEffect extends OneShotEffect {
|
|||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
List<UUID> chosen = new ArrayList<UUID>();
|
||||
List<UUID> chosen = new ArrayList<>();
|
||||
Player controller = game.getPlayer(source.getControllerId());
|
||||
if (controller == null) {
|
||||
return false;
|
||||
|
@ -134,18 +112,11 @@ class ReleaseSacrificeEffect extends OneShotEffect {
|
|||
for (UUID playerId : controller.getInRange()) {
|
||||
Player player = game.getPlayer(playerId);
|
||||
|
||||
Target target1 = new TargetControlledPermanent(1, 1, filter1, false);
|
||||
Target target2 = new TargetControlledPermanent(1, 1, filter2, false);
|
||||
Target target3 = new TargetControlledPermanent(1, 1, filter3, false);
|
||||
Target target4 = new TargetControlledPermanent(1, 1, filter4, false);
|
||||
Target target5 = new TargetControlledPermanent(1, 1, filter5, false);
|
||||
|
||||
|
||||
target1.setNotTarget(false);
|
||||
target2.setNotTarget(false);
|
||||
target3.setNotTarget(false);
|
||||
target4.setNotTarget(false);
|
||||
target5.setNotTarget(false);
|
||||
Target target1 = new TargetControlledPermanent(1, 1, new FilterControlledArtifactPermanent(), true);
|
||||
Target target2 = new TargetControlledPermanent(1, 1, new FilterControlledCreaturePermanent(), true);
|
||||
Target target3 = new TargetControlledPermanent(1, 1, new FilterControlledEnchantmentPermanent(), true);
|
||||
Target target4 = new TargetControlledPermanent(1, 1, new FilterControlledLandPermanent(), true);
|
||||
Target target5 = new TargetControlledPermanent(1, 1, new FilterControlledPlaneswalkerPermanent(), true);
|
||||
|
||||
if (target1.canChoose(player.getId(), game)) {
|
||||
while (player.isInGame() && !target1.isChosen() && target1.canChoose(player.getId(), game)) {
|
||||
|
|
|
@ -65,8 +65,7 @@ public class NotionThief extends CardImpl {
|
|||
// Flash
|
||||
this.addAbility(FlashAbility.getInstance());
|
||||
// If an opponent would draw a card except the first one he or she draws in each of his or her draw steps, instead that player skips that draw and you draw a card.
|
||||
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new NotionThiefReplacementEffect()));
|
||||
this.addWatcher(new CardsDrawnDuringDrawStepWatcher());
|
||||
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new NotionThiefReplacementEffect()), new CardsDrawnDuringDrawStepWatcher());
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -54,7 +54,7 @@ public class RestoreThePeace extends CardImpl {
|
|||
|
||||
// Return each creature that dealt damage this turn to its owner's hand.
|
||||
this.getSpellAbility().addEffect(new RestoreThePeaceEffect());
|
||||
this.addWatcher(new SourceDidDamageWatcher());
|
||||
this.getSpellAbility().addWatcher(new SourceDidDamageWatcher());
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -59,14 +59,12 @@ public class ScionOfVituGhazi extends CardImpl {
|
|||
this.power = new MageInt(4);
|
||||
this.toughness = new MageInt(4);
|
||||
|
||||
this.addWatcher(new CastFromHandWatcher());
|
||||
|
||||
// When Scion of Vitu-Ghazi enters the battlefield, if you cast it from your hand, put a 1/1 white Bird creature token with flying onto the battlefield, then populate.
|
||||
Ability ability = new EntersBattlefieldTriggeredAbility(
|
||||
new ConditionalOneShotEffect(new CreateTokenEffect(new BirdToken()), new CastFromHandCondition(),
|
||||
"if you cast it from your hand, put a 1/1 white Bird creature token with flying onto the battlefield,"));
|
||||
ability.addEffect(new PopulateEffect("then"));
|
||||
this.addAbility(ability);
|
||||
this.addAbility(ability, new CastFromHandWatcher());
|
||||
}
|
||||
|
||||
public ScionOfVituGhazi (final ScionOfVituGhazi card) {
|
||||
|
|
|
@ -70,7 +70,7 @@ public class BatwingBrume extends CardImpl {
|
|||
new BatwingBrumeEffect(),
|
||||
new ManaWasSpentCondition(ColoredManaSymbol.B), "Each player loses 1 life for each attacking creature he or she controls if {B} was spent to cast {this}"));
|
||||
this.addInfo("Info1", "<i>(Do both if {W}{B} was spent.)<i>");
|
||||
this.addWatcher(new ManaSpentToCastWatcher());
|
||||
this.getSpellAbility().addWatcher(new ManaSpentToCastWatcher());
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -66,7 +66,7 @@ public class CankerousThirst extends CardImpl {
|
|||
"If {G} was spent to cast {this}, you may have target creature get +3/+3 until end of turn"));
|
||||
this.getSpellAbility().addTarget(new TargetCreaturePermanent());
|
||||
this.addInfo("Info1", "<i>(Do both if {B}{G} was spent.)<i>");
|
||||
this.addWatcher(new ManaSpentToCastWatcher());
|
||||
this.getSpellAbility().addWatcher(new ManaSpentToCastWatcher());
|
||||
}
|
||||
|
||||
public CankerousThirst(final CankerousThirst card) {
|
||||
|
|
|
@ -70,8 +70,7 @@ public class DreamThief extends CardImpl {
|
|||
this.addAbility(FlyingAbility.getInstance());
|
||||
|
||||
// When Dream Thief enters the battlefield, draw a card if you've cast another blue spell this turn.
|
||||
this.addAbility(new EntersBattlefieldTriggeredAbility(new ConditionalOneShotEffect(new DrawCardSourceControllerEffect(1), new CastBlueSpellThisTurnCondition(), rule)));
|
||||
this.addWatcher(new DreamThiefWatcher(this.getId()));
|
||||
this.addAbility(new EntersBattlefieldTriggeredAbility(new ConditionalOneShotEffect(new DrawCardSourceControllerEffect(1), new CastBlueSpellThisTurnCondition(), rule)), new DreamThiefWatcher(this.getId()));
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -79,8 +79,7 @@ public class GroundlingPouncer extends CardImpl {
|
|||
Effect effect2 = new GainAbilitySourceEffect(FlyingAbility.getInstance(), Duration.EndOfTurn, false, true);
|
||||
Ability ability = new ConditionalActivatedAbility(Zone.BATTLEFIELD, effect, new ManaCostsImpl("{G/U}"), condition, rule);
|
||||
ability.addEffect(effect2);
|
||||
this.addAbility(ability);
|
||||
this.addWatcher(new ActivatedAbilityUsedThisTurnWatcher());
|
||||
this.addAbility(ability, new ActivatedAbilityUsedThisTurnWatcher());
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -71,8 +71,7 @@ public class HotheadedGiant extends CardImpl {
|
|||
|
||||
// Hotheaded Giant enters the battlefield with two -1/-1 counters on it unless you've cast another red spell this turn.
|
||||
Condition condition = new CastRedSpellThisTurnCondition();
|
||||
this.addAbility(new EntersBattlefieldAbility(new ConditionalOneShotEffect(new AddCountersSourceEffect(CounterType.M1M1.createInstance(2)), new InvertCondition(condition), ""), "with two -1/-1 counters on it unless you've cast another red spell this turn"));
|
||||
this.addWatcher(new HotHeadedGiantWatcher(this.getId()));
|
||||
this.addAbility(new EntersBattlefieldAbility(new ConditionalOneShotEffect(new AddCountersSourceEffect(CounterType.M1M1.createInstance(2)), new InvertCondition(condition), ""), "with two -1/-1 counters on it unless you've cast another red spell this turn"), new HotHeadedGiantWatcher(this.getId()));
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -73,7 +73,7 @@ public class InvertTheSkies extends CardImpl {
|
|||
new LockedInCondition(new ManaWasSpentCondition(ColoredManaSymbol.U)),
|
||||
"and creatures you control gain flying until end of turn if {U} was spent to cast it"));
|
||||
this.addInfo("Info1", "<i>(Do both if {G}{U} was spent.)<i>");
|
||||
this.addWatcher(new ManaSpentToCastWatcher());
|
||||
this.getSpellAbility().addWatcher(new ManaSpentToCastWatcher());
|
||||
}
|
||||
|
||||
public InvertTheSkies(final InvertTheSkies card) {
|
||||
|
|
|
@ -73,7 +73,7 @@ public class Moonhold extends CardImpl {
|
|||
new LockedInCondition(new ManaWasSpentCondition(ColoredManaSymbol.W))));
|
||||
this.getSpellAbility().addTarget(new TargetPlayer());
|
||||
this.addInfo("Info1", "<i>(Do both if {R}{W} was spent.)</i>");
|
||||
this.addWatcher(new ManaSpentToCastWatcher());
|
||||
this.getSpellAbility().addWatcher(new ManaSpentToCastWatcher());
|
||||
}
|
||||
|
||||
public Moonhold(final Moonhold card) {
|
||||
|
|
|
@ -78,7 +78,7 @@ public class SoulReap extends CardImpl {
|
|||
this.getSpellAbility().addEffect(new DestroyTargetEffect());
|
||||
this.getSpellAbility().addTarget(new TargetCreaturePermanent(filter));
|
||||
this.getSpellAbility().addEffect(new ConditionalOneShotEffect(new SoulReapEffect(), new CastBlackSpellThisTurnCondition(), rule));
|
||||
this.addWatcher(new SoulReapWatcher(this.getId()));
|
||||
this.getSpellAbility().addWatcher(new SoulReapWatcher(this.getId()));
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -71,8 +71,7 @@ public class TalarasBattalion extends CardImpl {
|
|||
this.addAbility(TrampleAbility.getInstance());
|
||||
|
||||
// Cast Talara's Battalion only if you've cast another green spell this turn.
|
||||
this.addAbility(new SimpleStaticAbility(Zone.ALL, new TalarasBattalionEffect()));
|
||||
this.addWatcher(new TalarasBattalionWatcher(this.getId()));
|
||||
this.addAbility(new SimpleStaticAbility(Zone.ALL, new TalarasBattalionEffect()), new TalarasBattalionWatcher(this.getId()));
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -72,7 +72,7 @@ public class UnnervingAssault extends CardImpl {
|
|||
new BoostAllEffect(1, 0, Duration.EndOfTurn, filter2, false),
|
||||
new ManaWasSpentCondition(ColoredManaSymbol.R), " and creatures you control get +1/0 until end of turn if {R} was spent to cast it"));
|
||||
this.addInfo("Info1", "<i>(Do both if {U}{R} was spent.)</i>");
|
||||
this.addWatcher(new ManaSpentToCastWatcher());
|
||||
this.getSpellAbility().addWatcher(new ManaSpentToCastWatcher());
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -62,7 +62,7 @@ public class WavesOfAggression extends CardImpl {
|
|||
this.color.setWhite(true);
|
||||
|
||||
// Untap all creatures that attacked this turn. After this main phase, there is an additional combat phase followed by an additional main phase.
|
||||
this.addWatcher(new AttackedThisTurnWatcher());
|
||||
this.getSpellAbility().addWatcher(new AttackedThisTurnWatcher());
|
||||
this.getSpellAbility().addEffect(new WavesOfAggressionUntapEffect());
|
||||
this.getSpellAbility().addEffect(new WavesOfAggressionAddPhasesEffect());
|
||||
// Retrace
|
||||
|
|
|
@ -37,12 +37,10 @@ import mage.cards.CardImpl;
|
|||
import mage.constants.CardType;
|
||||
import mage.constants.Outcome;
|
||||
import mage.constants.Rarity;
|
||||
import mage.constants.TargetController;
|
||||
import mage.filter.common.FilterArtifactPermanent;
|
||||
import mage.filter.common.FilterCreaturePermanent;
|
||||
import mage.filter.common.FilterEnchantmentPermanent;
|
||||
import mage.filter.common.FilterLandPermanent;
|
||||
import mage.filter.predicate.permanent.ControllerPredicate;
|
||||
import mage.filter.common.FilterControlledArtifactPermanent;
|
||||
import mage.filter.common.FilterControlledCreaturePermanent;
|
||||
import mage.filter.common.FilterControlledEnchantmentPermanent;
|
||||
import mage.filter.common.FilterControlledLandPermanent;
|
||||
import mage.game.Game;
|
||||
import mage.game.permanent.Permanent;
|
||||
import mage.players.Player;
|
||||
|
@ -59,8 +57,6 @@ public class Cataclysm extends CardImpl {
|
|||
super(ownerId, 3, "Cataclysm", Rarity.RARE, new CardType[]{CardType.SORCERY}, "{2}{W}{W}");
|
||||
this.expansionSetCode = "EXO";
|
||||
|
||||
this.color.setWhite(true);
|
||||
|
||||
// Each player chooses from the permanents he or she controls an artifact, a creature, an enchantment, and a land, then sacrifices the rest.
|
||||
this.getSpellAbility().addEffect(new CataclysmEffect());
|
||||
}
|
||||
|
@ -77,18 +73,6 @@ public class Cataclysm extends CardImpl {
|
|||
|
||||
class CataclysmEffect extends OneShotEffect {
|
||||
|
||||
private static final FilterArtifactPermanent filter1 = new FilterArtifactPermanent("artifact you control");
|
||||
private static final FilterCreaturePermanent filter2 = new FilterCreaturePermanent("creature you control");
|
||||
private static final FilterEnchantmentPermanent filter3 = new FilterEnchantmentPermanent("enchantment you control");
|
||||
private static final FilterLandPermanent filter4 = new FilterLandPermanent("land you control");
|
||||
|
||||
static {
|
||||
filter1.add(new ControllerPredicate(TargetController.YOU));
|
||||
filter2.add(new ControllerPredicate(TargetController.YOU));
|
||||
filter3.add(new ControllerPredicate(TargetController.YOU));
|
||||
filter4.add(new ControllerPredicate(TargetController.YOU));
|
||||
}
|
||||
|
||||
public CataclysmEffect() {
|
||||
super(Outcome.DestroyPermanent);
|
||||
staticText = "Each player chooses from among the permanents he or she controls an artifact, a creature, an enchantment, and a land, then sacrifices the rest";
|
||||
|
@ -105,20 +89,14 @@ class CataclysmEffect extends OneShotEffect {
|
|||
for (UUID playerId : game.getPlayerList()) {
|
||||
Player player = game.getPlayer(playerId);
|
||||
|
||||
Target target1 = new TargetControlledPermanent(1, 1, filter1, false);
|
||||
Target target2 = new TargetControlledPermanent(1, 1, filter2, false);
|
||||
Target target3 = new TargetControlledPermanent(1, 1, filter3, false);
|
||||
Target target4 = new TargetControlledPermanent(1, 1, filter4, false);
|
||||
|
||||
|
||||
target1.setNotTarget(true);
|
||||
target2.setNotTarget(true);
|
||||
target3.setNotTarget(true);
|
||||
target4.setNotTarget(true);
|
||||
Target target1 = new TargetControlledPermanent(1, 1, new FilterControlledArtifactPermanent(), true);
|
||||
Target target2 = new TargetControlledPermanent(1, 1, new FilterControlledCreaturePermanent(), true);
|
||||
Target target3 = new TargetControlledPermanent(1, 1, new FilterControlledEnchantmentPermanent(), true);
|
||||
Target target4 = new TargetControlledPermanent(1, 1, new FilterControlledLandPermanent(), true);
|
||||
|
||||
if (target1.canChoose(player.getId(), game)) {
|
||||
while (player.isInGame() && !target1.isChosen() && target1.canChoose(player.getId(), game)) {
|
||||
player.choose(Outcome.Benefit, target1, source.getSourceId(), game);
|
||||
player.chooseTarget(Outcome.Benefit, target1, source, game);
|
||||
}
|
||||
Permanent artifact = game.getPermanent(target1.getFirstTarget());
|
||||
if (artifact != null) {
|
||||
|
@ -129,7 +107,7 @@ class CataclysmEffect extends OneShotEffect {
|
|||
|
||||
if (target2.canChoose(player.getId(), game)) {
|
||||
while (player.isInGame() && !target2.isChosen() && target2.canChoose(player.getId(), game)) {
|
||||
player.choose(Outcome.Benefit, target2, source.getSourceId(), game);
|
||||
player.chooseTarget(Outcome.Benefit, target2, source, game);
|
||||
}
|
||||
Permanent creature = game.getPermanent(target2.getFirstTarget());
|
||||
if (creature != null) {
|
||||
|
@ -140,7 +118,7 @@ class CataclysmEffect extends OneShotEffect {
|
|||
|
||||
if (target3.canChoose(player.getId(), game)) {
|
||||
while (player.isInGame() && !target3.isChosen() && target3.canChoose(player.getId(), game)) {
|
||||
player.choose(Outcome.Benefit, target3, source.getSourceId(), game);
|
||||
player.chooseTarget(Outcome.Benefit, target3, source, game);
|
||||
}
|
||||
Permanent enchantment = game.getPermanent(target3.getFirstTarget());
|
||||
if (enchantment != null) {
|
||||
|
@ -151,7 +129,7 @@ class CataclysmEffect extends OneShotEffect {
|
|||
|
||||
if (target4.canChoose(player.getId(), game)) {
|
||||
while (player.isInGame() && !target4.isChosen() && target4.canChoose(player.getId(), game)) {
|
||||
player.choose(Outcome.Benefit, target4, source.getSourceId(), game);
|
||||
player.chooseTarget(Outcome.Benefit, target4, source, game);
|
||||
}
|
||||
Permanent land = game.getPermanent(target4.getFirstTarget());
|
||||
if (land != null) {
|
||||
|
|
|
@ -116,7 +116,7 @@ class GhastlyConscriptionEffect extends OneShotEffect {
|
|||
}
|
||||
MageObjectReference objectReference= new MageObjectReference(card.getId(), card.getZoneChangeCounter() +1, game);
|
||||
game.addEffect(new BecomesFaceDownCreatureEffect(manaCosts, objectReference, Duration.Custom, FaceDownType.MANIFESTED), newSource);
|
||||
if (card.moveToZone(Zone.BATTLEFIELD, newSource.getSourceId(), game, false)) {
|
||||
if (controller.putOntoBattlefieldWithInfo(card, game, Zone.EXILED, source.getSourceId())) {
|
||||
game.informPlayers(new StringBuilder(controller.getName())
|
||||
.append(" puts facedown card from exile onto the battlefield").toString());
|
||||
}
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue