This commit is contained in:
Michael Ludwig 2013-07-12 20:54:02 -04:00
commit 8e517e91aa
39 changed files with 1641 additions and 47 deletions

Binary file not shown.

Binary file not shown.

Binary file not shown.

View file

@ -1,31 +0,0 @@
NAME:Sami Häggkvist's WRB Midrange
4 [GTC:215] Boros Reckoner
2 [ISD:105] Liliana of the Veil
1 [DKA:158] Vault of the Archangel
4 [M13:222] Dragonskull Summit
1 [RTR:1] Angel of Serenity
2 [RTR:82] Ultimate Price
2 [ISD:215] Olivia Voldaren
2 [RTR:188] Rakdos's Return
2 [RTR:265] Mountain
4 [DKA:12] Lingering Souls
4 [DKA:87] Faithless Looting
2 [AVR:32] Restoration Angel
4 [ISD:242] Isolated Chapel
3 [ISD:238] Clifftop Retreat
4 [RTR:238] Blood Crypt
3 [RTR:101] Mizzium Mortars
2 [RTR:157] Dreadbore
2 [GTC:182] Obzedat, Ghost Council
4 [GTC:242] Godless Shrine
2 [ISD:122] Unburial Rites
2 [M13:150] Thundermaw Hellkite
4 [GTC:245] Sacred Foundry
SB: 2 [AVR:104] Gloom Surgeon
SB: 1 [RTR:93] Electrickery
SB: 4 [AVR:84] Appetite for Brains
SB: 2 [M13:107] Rise from the Grave
SB: 1 [ISD:27] Purify the Grave
SB: 2 [M13:90] Duress
SB: 2 [RTR:197] Slaughter Games
SB: 1 [M13:22] Oblivion Ring

View file

@ -18,21 +18,19 @@
<outputDirectory>/lib/</outputDirectory> <outputDirectory>/lib/</outputDirectory>
<excludes> <excludes>
<exclude>org.mage:mage-client</exclude> <exclude>org.mage:mage-client</exclude>
<exclude>org.mage:mage-theme-plugin</exclude>
<exclude>org.mage:mage-counter-plugin</exclude> <exclude>org.mage:mage-counter-plugin</exclude>
</excludes> </excludes>
</dependencySet> </dependencySet>
<dependencySet> <dependencySet>
<outputDirectory>/plugins</outputDirectory> <outputDirectory>/plugins</outputDirectory>
<includes> <includes>
<include>org.mage:mage-theme-plugin</include>
<include>org.mage:mage-counter-plugin</include> <include>org.mage:mage-counter-plugin</include>
</includes> </includes>
</dependencySet> </dependencySet>
</dependencySets> </dependencySets>
<fileSets> <fileSets>
<fileSet> <fileSet>
<filtered>true</filtered> <filtered>false</filtered>
<directory>release/</directory> <directory>release/</directory>
<outputDirectory>/</outputDirectory> <outputDirectory>/</outputDirectory>
</fileSet> </fileSet>
@ -44,13 +42,6 @@
</includes> </includes>
<outputDirectory>/</outputDirectory> <outputDirectory>/</outputDirectory>
</fileSet> </fileSet>
<fileSet>
<filtered>false</filtered>
<directory>plugins/sounds/</directory>
<includes>
<include>*.wav</include>
</includes>
<outputDirectory>plugins/sounds/</outputDirectory>
</fileSet>
</fileSets> </fileSets>
</assembly> </assembly>

View file

@ -79,8 +79,8 @@ public final class Constants {
public static final String RESOURCE_PATH_MANA_MEDIUM = IO.imageBaseDir + "symbols" + File.separator + "medium"; public static final String RESOURCE_PATH_MANA_MEDIUM = IO.imageBaseDir + "symbols" + File.separator + "medium";
public static final String RESOURCE_PATH_SET = IO.imageBaseDir + "sets" + File.separator; public static final String RESOURCE_PATH_SET = IO.imageBaseDir + "sets" + File.separator;
public static final String RESOURCE_PATH_SET_SMALL = RESOURCE_PATH_SET + File.separator + "small" + File.separator; public static final String RESOURCE_PATH_SET_SMALL = RESOURCE_PATH_SET + File.separator + "small" + File.separator;
public static final String BASE_SOUND_PATH = "plugins" + File.separator + "sounds" + File.separator; public static final String BASE_SOUND_PATH = "sounds" + File.separator;
public static final String BASE_MUSICS_PATH = "plugins" + File.separator + "sounds" + File.separator + "music" + File.separator ; public static final String BASE_MUSICS_PATH = "music" + File.separator ;
public interface IO { public interface IO {
String imageBaseDir = "plugins" + File.separator + "images" + File.separator; String imageBaseDir = "plugins" + File.separator + "images" + File.separator;

View file

@ -20,13 +20,13 @@ import java.util.Map;
@PluginImplementation @PluginImplementation
@Author(name = "nantuko") @Author(name = "nantuko")
/* udpated by Noahsark */
public class ThemePluginImpl implements ThemePlugin { public class ThemePluginImpl implements ThemePlugin {
private static final Logger log = Logger.getLogger(ThemePluginImpl.class); private static final Logger log = Logger.getLogger(ThemePluginImpl.class);
private static BufferedImage background; private static BufferedImage background;
private List flist = new List(); private List flist = new List();
private String BackgroundDir = "plugins" + File.separator + "plugin.data" + File.separator private String BackgroundDir = "backgrounds" + File.separator;
+ "background" + File.separator;
@Init @Init
public void init() { public void init() {
} }

View file

@ -0,0 +1,115 @@
/*
* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* The views and conclusions contained in the software and documentation are those of the
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of BetaSteward_at_googlemail.com.
*/
package mage.sets.commander;
import java.util.UUID;
import mage.abilities.Ability;
import mage.abilities.effects.OneShotEffect;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Outcome;
import mage.constants.Rarity;
import mage.filter.FilterStackObject;
import mage.filter.predicate.Predicates;
import mage.filter.predicate.mageobject.CardTypePredicate;
import mage.game.Game;
import mage.game.stack.Spell;
import mage.players.Player;
import mage.target.TargetStackObject;
/**
*
* @author jeffwadsworth
*/
public class WildRicochet extends CardImpl<WildRicochet> {
private static final FilterStackObject filter = new FilterStackObject("instant or sorcery spell");
static {
filter.add(Predicates.or(
new CardTypePredicate(CardType.INSTANT),
new CardTypePredicate(CardType.SORCERY)));
}
public WildRicochet(UUID ownerId) {
super(ownerId, 139, "Wild Ricochet", Rarity.RARE, new CardType[]{CardType.INSTANT}, "{2}{R}{R}");
this.expansionSetCode = "CMD";
this.color.setRed(true);
// You may choose new targets for target instant or sorcery spell. Then copy that spell. You may choose new targets for the copy.
this.getSpellAbility().addEffect(new WildRicochetEffect());
this.getSpellAbility().addTarget(new TargetStackObject(filter));
}
public WildRicochet(final WildRicochet card) {
super(card);
}
@Override
public WildRicochet copy() {
return new WildRicochet(this);
}
}
class WildRicochetEffect extends OneShotEffect<WildRicochetEffect> {
public WildRicochetEffect() {
super(Outcome.Neutral);
staticText = "You may choose new targets for target instant or sorcery spell. Then copy that spell. You may choose new targets for the copy";
}
public WildRicochetEffect(final WildRicochetEffect effect) {
super(effect);
}
@Override
public boolean apply(Game game, Ability source) {
Spell spell = game.getStack().getSpell(source.getFirstTarget());
Player you = game.getPlayer(source.getControllerId());
if (spell != null && you != null && you.chooseUse(Outcome.Benefit, "Do you wish to choose new targets for " + spell.getName() + "?", game)) {
spell.chooseNewTargets(game, you.getId());
}
if (spell != null) {
Spell copy = spell.copySpell();
copy.setControllerId(source.getControllerId());
copy.setCopiedSpell(true);
game.getStack().push(copy);
if (you != null && you.chooseUse(Outcome.Benefit, "Do you wish to choose new targets for the copied " + spell.getName() + "?", game)) {
return copy.chooseNewTargets(game, you.getId());
}
}
return false;
}
@Override
public WildRicochetEffect copy() {
return new WildRicochetEffect(this);
}
}

View file

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

View file

@ -0,0 +1,333 @@
/*
* 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.magic2014;
import java.util.HashSet;
import java.util.Set;
import java.util.UUID;
import mage.MageObject;
import mage.abilities.Ability;
import mage.abilities.LoyaltyAbility;
import mage.abilities.SpellAbility;
import mage.abilities.common.EntersBattlefieldAbility;
import mage.abilities.effects.AsThoughEffectImpl;
import mage.abilities.effects.ContinuousEffect;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.CantBlockTargetEffect;
import mage.abilities.effects.common.counter.AddCountersSourceEffect;
import mage.cards.Card;
import mage.cards.CardImpl;
import mage.cards.Cards;
import mage.cards.CardsImpl;
import mage.constants.AsThoughEffectType;
import mage.constants.CardType;
import mage.constants.Duration;
import mage.constants.Outcome;
import mage.constants.Rarity;
import mage.constants.Zone;
import mage.counters.CounterType;
import mage.filter.common.FilterCreaturePermanent;
import mage.filter.common.FilterInstantOrSorceryCard;
import mage.game.Game;
import mage.game.permanent.Permanent;
import mage.game.stack.StackObject;
import mage.players.Library;
import mage.players.Player;
import mage.target.Target;
import mage.target.TargetCard;
import mage.target.TargetPermanent;
import mage.target.TargetPlayer;
import mage.target.targetpointer.FixedTarget;
/**
*
* @author jeffwadsworth
*/
public class ChandraPyromaster extends CardImpl<ChandraPyromaster> {
public ChandraPyromaster(UUID ownerId) {
super(ownerId, 132, "Chandra, Pyromaster", Rarity.MYTHIC, new CardType[]{CardType.PLANESWALKER}, "{2}{R}{R}");
this.expansionSetCode = "M14";
this.subtype.add("Chandra");
this.color.setRed(true);
this.addAbility(new EntersBattlefieldAbility(new AddCountersSourceEffect(CounterType.LOYALTY.createInstance(4)), false));
// +1: Chandra, Pyromaster deals 1 damage to target player and 1 damage to up to one target creature that player controls. That creature can't block this turn.
LoyaltyAbility ability1 = new LoyaltyAbility(new ChandraPyromasterEffect1(), 1);
Target target1 = new TargetPlayer(true);
ability1.addTarget(target1);
ability1.addTarget(new ChandraPyromasterTarget());
this.addAbility(ability1);
// 0: Exile the top card of your library. You may play it this turn.
LoyaltyAbility ability2 = new LoyaltyAbility(new ChandraPyromasterEffect2(), 0);
this.addAbility(ability2);
// -7: Exile the top ten cards of your library. Choose an instant or sorcery card exiled this way and copy it three times. You may cast the copies without paying their mana costs.
LoyaltyAbility ability3 = new LoyaltyAbility(new ChandraPyromasterEffect3(), -7);
this.addAbility(ability3);
}
public ChandraPyromaster(final ChandraPyromaster card) {
super(card);
}
@Override
public ChandraPyromaster copy() {
return new ChandraPyromaster(this);
}
}
class ChandraPyromasterEffect1 extends OneShotEffect<ChandraPyromasterEffect1> {
public ChandraPyromasterEffect1() {
super(Outcome.Damage);
staticText = "Chandra, Pyromaster deals 1 damage to target player and 1 damage to up to one target creature that player controls. That creature can't block this turn";
}
public ChandraPyromasterEffect1(final ChandraPyromasterEffect1 effect) {
super(effect);
}
@Override
public ChandraPyromasterEffect1 copy() {
return new ChandraPyromasterEffect1(this);
}
@Override
public boolean apply(Game game, Ability source) {
Player player = game.getPlayer(source.getTargets().get(0).getFirstTarget());
if (player != null) {
player.damage(1, source.getSourceId(), game, false, true);
}
Permanent creature = game.getPermanent(source.getTargets().get(1).getFirstTarget());
if (creature != null) {
creature.damage(1, source.getSourceId(), game, true, false);
ContinuousEffect effect = new CantBlockTargetEffect(Duration.EndOfTurn);
effect.setTargetPointer(new FixedTarget(creature.getId()));
game.addEffect(effect, source);
}
return true;
}
}
class ChandraPyromasterTarget extends TargetPermanent<ChandraPyromasterTarget> {
public ChandraPyromasterTarget() {
super(0, 1, new FilterCreaturePermanent("creature that the targeted player controls"), false);
}
public ChandraPyromasterTarget(final ChandraPyromasterTarget target) {
super(target);
}
@Override
public boolean canTarget(UUID id, Ability source, Game game) {
UUID firstTarget = source.getFirstTarget();
Permanent permanent = game.getPermanent(id);
if (firstTarget != null && permanent != null && permanent.getControllerId().equals(firstTarget)) {
return super.canTarget(id, source, game);
}
return false;
}
@Override
public Set<UUID> possibleTargets(UUID sourceId, UUID sourceControllerId, Game game) {
Set<UUID> availablePossibleTargets = super.possibleTargets(sourceId, sourceControllerId, game);
Set<UUID> possibleTargets = new HashSet<UUID>();
MageObject object = game.getObject(sourceId);
for (StackObject item : game.getState().getStack()) {
if (item.getId().equals(sourceId)) {
object = item;
}
if (item.getSourceId().equals(sourceId)) {
object = item;
}
}
if (object instanceof StackObject) {
UUID playerId = ((StackObject) object).getStackAbility().getFirstTarget();
for (UUID targetId : availablePossibleTargets) {
Permanent permanent = game.getPermanent(targetId);
if (permanent != null && permanent.getControllerId().equals(playerId)) {
possibleTargets.add(targetId);
}
}
}
return possibleTargets;
}
@Override
public ChandraPyromasterTarget copy() {
return new ChandraPyromasterTarget(this);
}
}
class ChandraPyromasterEffect2 extends OneShotEffect<ChandraPyromasterEffect2> {
public ChandraPyromasterEffect2() {
super(Outcome.Detriment);
this.staticText = "Exile the top card of your library. You may play it this turn";
}
public ChandraPyromasterEffect2(final ChandraPyromasterEffect2 effect) {
super(effect);
}
@Override
public ChandraPyromasterEffect2 copy() {
return new ChandraPyromasterEffect2(this);
}
@Override
public boolean apply(Game game, Ability source) {
Player you = game.getPlayer(source.getControllerId());
if (you != null && you.getLibrary().size() > 0) {
Library library = you.getLibrary();
Card card = library.removeFromTop(game);
if (card != null) {
card.moveToExile(source.getSourceId(), "Chandra Pyromaster <this card may be played the turn it was exiled>", source.getSourceId(), game);
game.addEffect(new ChandraPyromasterCastFromExileEffect(card.getId()), source);
}
return true;
}
return false;
}
}
class ChandraPyromasterCastFromExileEffect extends AsThoughEffectImpl<ChandraPyromasterCastFromExileEffect> {
private UUID cardId;
public ChandraPyromasterCastFromExileEffect(UUID cardId) {
super(AsThoughEffectType.CAST, Duration.EndOfTurn, Outcome.Benefit);
staticText = "You may play card from exile";
this.cardId = cardId;
}
public ChandraPyromasterCastFromExileEffect(final ChandraPyromasterCastFromExileEffect effect) {
super(effect);
cardId = effect.cardId;
}
@Override
public boolean apply(Game game, Ability source) {
return true;
}
@Override
public ChandraPyromasterCastFromExileEffect copy() {
return new ChandraPyromasterCastFromExileEffect(this);
}
@Override
public boolean applies(UUID sourceId, Ability source, Game game) {
if (sourceId.equals(this.cardId)) {
Card card = game.getCard(this.cardId);
if (card != null && game.getState().getZone(this.cardId) == Zone.EXILED) {
Player player = game.getPlayer(source.getControllerId());
if (player != null && player.chooseUse(Outcome.Benefit, "Play this card?", game)) {
if (card.getCardType().contains(CardType.LAND)) {
// If the revealed card is a land, you can play it only if it's your turn and you haven't yet played a land this turn.
if (game.getActivePlayerId().equals(player.getId()) && player.getLandsPlayed() < player.getLandsPerTurn()) {
return player.playLand(card, game);
}
} else {
Ability ability = card.getSpellAbility();
if (ability != null && ability instanceof SpellAbility) {
return player.cast((SpellAbility) ability, game, false);
}
}
}
}
}
return false;
}
}
class ChandraPyromasterEffect3 extends OneShotEffect<ChandraPyromasterEffect3> {
public ChandraPyromasterEffect3() {
super(Outcome.PutCardInPlay);
this.staticText = "Exile the top ten cards of your library. Choose an instant or sorcery card exiled this way and copy it three times. You may cast the copies without paying their mana costs";
}
public ChandraPyromasterEffect3(final ChandraPyromasterEffect3 effect) {
super(effect);
}
@Override
public ChandraPyromasterEffect3 copy() {
return new ChandraPyromasterEffect3(this);
}
@Override
public boolean apply(Game game, Ability source) {
Player you = game.getPlayer(source.getControllerId());
if (you == null) {
return false;
}
Cards cards = new CardsImpl();
int max = Math.min(you.getLibrary().size(), 10);
for (int i = 0; i < max; i++) {
Card card = you.getLibrary().removeFromTop(game);
if (card != null) {
card.moveToExile(source.getSourceId(), "Chandra Pyromaster", source.getId(), game);
cards.add(card);
}
}
if (cards.getCards(new FilterInstantOrSorceryCard(), game).size() > 0) {
TargetCard target = new TargetCard(Zone.EXILED, new FilterInstantOrSorceryCard());
target.setRequired(true);
if (you.chooseTarget(Outcome.PlayForFree, cards, target, source, game)) {
Card card = cards.get(target.getFirstTarget(), game);
if (card != null) {
Card copy1 = card.copy();
Card copy2 = card.copy();
Card copy3 = card.copy();
if (copy1 != null && you.chooseUse(outcome, "Do you wish to cast copy 1 of " + card.getName(), game)) {
you.cast(copy1.getSpellAbility(), game, true);
}
if (copy2 != null && you.chooseUse(outcome, "Do you wish to cast copy 2 of " + card.getName(), game)) {
you.cast(copy2.getSpellAbility(), game, true);
}
if (copy3 != null && you.chooseUse(outcome, "Do you wish to cast copy 3 of " + card.getName(), game)) {
you.cast(copy3.getSpellAbility(), game, true);
}
return true;
}
}
}
return false;
}
}

View file

@ -0,0 +1,204 @@
/*
* 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.magic2014;
import java.util.UUID;
import mage.ObjectColor;
import mage.abilities.Ability;
import mage.abilities.TriggeredAbilityImpl;
import mage.abilities.common.AsEntersBattlefieldAbility;
import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.effects.ContinuousEffectImpl;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.counter.AddCountersSourceEffect;
import mage.cards.CardImpl;
import mage.cards.repository.CardRepository;
import mage.choices.Choice;
import mage.choices.ChoiceImpl;
import mage.constants.CardType;
import mage.constants.Duration;
import mage.constants.Layer;
import mage.constants.Outcome;
import mage.constants.Rarity;
import mage.constants.SubLayer;
import mage.constants.TargetController;
import mage.constants.Zone;
import mage.counters.CounterType;
import mage.filter.FilterSpell;
import mage.filter.common.FilterCreaturePermanent;
import mage.filter.predicate.mageobject.SubtypePredicate;
import mage.filter.predicate.permanent.ControllerIdPredicate;
import mage.filter.predicate.permanent.ControllerPredicate;
import mage.game.Game;
import mage.game.events.GameEvent;
import mage.game.permanent.Permanent;
import mage.game.stack.Spell;
import mage.players.Player;
/**
*
* @author Plopman
*/
public class DoorOfDestinies extends CardImpl<DoorOfDestinies> {
public DoorOfDestinies(UUID ownerId) {
super(ownerId, 208, "Door of Destinies", Rarity.RARE, new CardType[]{CardType.ARTIFACT}, "{4}");
this.expansionSetCode = "M14";
// As Door of Destinies enters the battlefield, choose a creature type.
this.addAbility(new AsEntersBattlefieldAbility(new ChooseCreatureTypeEffect()));
// Whenever you cast a spell of the chosen type, put a charge counter on Door of Destinies.
this.addAbility(new AddCounterAbility());
// Creatures you control of the chosen type get +1/+1 for each charge counter on Door of Destinies.
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostCreatureEffectEffect()));
}
public DoorOfDestinies(final DoorOfDestinies card) {
super(card);
}
@Override
public DoorOfDestinies copy() {
return new DoorOfDestinies(this);
}
}
class ChooseCreatureTypeEffect extends OneShotEffect<ChooseCreatureTypeEffect> {
public ChooseCreatureTypeEffect() {
super(Outcome.BoostCreature);
staticText = "choose a creature type";
}
public ChooseCreatureTypeEffect(final ChooseCreatureTypeEffect effect) {
super(effect);
}
@Override
public boolean apply(Game game, Ability source) {
Player player = game.getPlayer(source.getControllerId());
Permanent permanent = game.getPermanent(source.getSourceId());
if (player != null && permanent != null) {
Choice typeChoice = new ChoiceImpl(true);
typeChoice.setMessage("Choose creature type");
typeChoice.setChoices(CardRepository.instance.getCreatureTypes());
while (!player.choose(Outcome.BoostCreature, typeChoice, game)) {
game.debugMessage("player canceled choosing type. retrying.");
}
game.informPlayers(permanent.getName() + ": " + player.getName() + " has chosen " + typeChoice.getChoice());
game.getState().setValue(permanent.getId() + "_type", typeChoice.getChoice());
}
return false;
}
@Override
public ChooseCreatureTypeEffect copy() {
return new ChooseCreatureTypeEffect(this);
}
}
class AddCounterAbility extends TriggeredAbilityImpl<AddCounterAbility> {
public AddCounterAbility() {
super(Zone.BATTLEFIELD, new AddCountersSourceEffect(CounterType.CHARGE.createInstance(1)), false);
}
public AddCounterAbility(final AddCounterAbility ability) {
super(ability);
}
@Override
public AddCounterAbility copy() {
return new AddCounterAbility(this);
}
@Override
public boolean checkTrigger(GameEvent event, Game game) {
Permanent doorOfDestinies = game.getPermanent(getSourceId());
if (doorOfDestinies != null) {
String subtype = (String) game.getState().getValue(doorOfDestinies.getId() + "_type");
if (subtype != null) {
if (event.getType() == GameEvent.EventType.SPELL_CAST) {
FilterSpell filter = new FilterSpell();
filter.add(new ControllerPredicate(TargetController.YOU));
filter.add(new SubtypePredicate(subtype));
Spell spell = game.getStack().getSpell(event.getTargetId());
if (spell != null && filter.match(spell, controllerId, game)) {
return true;
}
}
}
}
return false;
}
@Override
public String getRule() {
return "Whenever you cast a spell of the chosen type, put a charge counter on {source}";
}
}
class BoostCreatureEffectEffect extends ContinuousEffectImpl<BoostCreatureEffectEffect> {
private static final FilterCreaturePermanent filter = new FilterCreaturePermanent();
public BoostCreatureEffectEffect() {
super(Duration.WhileOnBattlefield, Layer.PTChangingEffects_7, SubLayer.ModifyPT_7c, Outcome.BoostCreature);
staticText = "Creatures you control of the chosen type get +1/+1 for each charge counter on Door of Destinies";
}
public BoostCreatureEffectEffect(final BoostCreatureEffectEffect effect) {
super(effect);
}
@Override
public BoostCreatureEffectEffect copy() {
return new BoostCreatureEffectEffect(this);
}
@Override
public boolean apply(Game game, Ability source) {
Permanent permanent = game.getPermanent(source.getSourceId());
if (permanent != null) {
String subtype = (String) game.getState().getValue(permanent.getId() + "_type");
if (subtype != null) {
for (Permanent perm: game.getBattlefield().getAllActivePermanents(filter, source.getControllerId(), game)) {
if (perm.hasSubtype(subtype)) {
int boost = permanent.getCounters().getCount(CounterType.CHARGE);
perm.addPower(boost);
perm.addToughness(boost);
}
}
}
}
return true;
}
}

View file

@ -0,0 +1,117 @@
/*
* 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.magic2014;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.SimpleActivatedAbility;
import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.costs.CostImpl;
import mage.abilities.costs.mana.ManaCostsImpl;
import mage.abilities.effects.common.continious.BecomesCreatureSourceEffect;
import mage.abilities.effects.common.continious.BoostEnchantedEffect;
import mage.abilities.keyword.EquipAbility;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Duration;
import mage.constants.Outcome;
import mage.constants.Rarity;
import mage.constants.Zone;
import mage.filter.common.FilterControlledCreaturePermanent;
import mage.game.Game;
import mage.game.permanent.token.Token;
/**
*
* @author Plopman
*/
public class HauntedPlateMail extends CardImpl<HauntedPlateMail> {
public HauntedPlateMail(UUID ownerId) {
super(ownerId, 212, "Haunted Plate Mail", Rarity.RARE, new CardType[]{CardType.ARTIFACT}, "{4}");
this.expansionSetCode = "M14";
this.subtype.add("Equipment");
// Equipped creature gets +4/+4.
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostEnchantedEffect(2, 2)));
// {0}: Until end of turn, Haunted Plate Mail becomes a 4/4 Spirit artifact creature that's no longer an Equipment. Activate this ability only if you control no creatures.
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new BecomesCreatureSourceEffect(new HauntedPlateMailToken(), "", Duration.Custom), new HauntedPlateMailCost());
this.addAbility(ability);
// Equip {4}
this.addAbility(new EquipAbility(Outcome.BoostCreature, new ManaCostsImpl("{4}")));
}
public HauntedPlateMail(final HauntedPlateMail card) {
super(card);
}
@Override
public HauntedPlateMail copy() {
return new HauntedPlateMail(this);
}
}
class HauntedPlateMailCost extends CostImpl<HauntedPlateMailCost> {
public HauntedPlateMailCost() {
this.text = "Activate this ability only if you control no creatures";
}
public HauntedPlateMailCost(final HauntedPlateMailCost cost) {
super(cost);
}
@Override
public boolean canPay(UUID sourceId, UUID controllerId, Game game) {
return !game.getBattlefield().contains(new FilterControlledCreaturePermanent(), controllerId, 1, game);
}
@Override
public boolean pay(Ability ability, Game game, UUID sourceId, UUID controllerId, boolean noMana) {
this.paid = true;
return paid;
}
@Override
public HauntedPlateMailCost copy() {
return new HauntedPlateMailCost(this);
}
}
class HauntedPlateMailToken extends Token {
public HauntedPlateMailToken() {
super("Spirit", "4/4 Spirit artifact creature that's no longer an Equipment");
cardType.add(CardType.ARTIFACT);
cardType.add(CardType.CREATURE);
subtype.add("Spirit");
power = new MageInt(4);
toughness = new MageInt(4);
}
}

View file

@ -0,0 +1,118 @@
/*
* 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.magic2014;
import java.util.UUID;
import mage.MageObject;
import mage.abilities.Ability;
import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.effects.ReplacementEffectImpl;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Duration;
import mage.constants.Outcome;
import mage.constants.Rarity;
import mage.constants.Zone;
import mage.game.Game;
import mage.game.events.GameEvent;
import mage.game.permanent.Permanent;
import mage.game.stack.Spell;
/**
*
* @author Plopman
*/
public class PyromancersGauntlet extends CardImpl<PyromancersGauntlet> {
public PyromancersGauntlet(UUID ownerId) {
super(ownerId, 214, "Pyromancer's Gauntlet", Rarity.RARE, new CardType[]{CardType.ARTIFACT}, "{5}");
this.expansionSetCode = "M14";
// If a red instant or sorcery spell you control or a red planeswalker you control would deal damage to a permanent or player, it deals that much damage plus 2 to that permanent or player instead.
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new PyromancersGauntletReplacementEffect()));
}
public PyromancersGauntlet(final PyromancersGauntlet card) {
super(card);
}
@Override
public PyromancersGauntlet copy() {
return new PyromancersGauntlet(this);
}
}
class PyromancersGauntletReplacementEffect extends ReplacementEffectImpl<PyromancersGauntletReplacementEffect> {
PyromancersGauntletReplacementEffect() {
super(Duration.WhileOnBattlefield, Outcome.Benefit);
staticText = "If a red instant or sorcery spell you control or a red planeswalker you control would deal damage to a permanent or player, it deals that much damage plus 2 to that permanent or player instead";
}
PyromancersGauntletReplacementEffect(final PyromancersGauntletReplacementEffect effect) {
super(effect);
}
@Override
public boolean applies(GameEvent event, Ability source, Game game) {
if (event.getType().equals(GameEvent.EventType.DAMAGE_PLAYER)
|| event.getType().equals(GameEvent.EventType.DAMAGE_CREATURE)
|| event.getType().equals(GameEvent.EventType.DAMAGE_PLANESWALKER)) {
MageObject object = game.getObject(event.getSourceId());
if (object != null && object instanceof Spell) {
if (((Spell) object).getControllerId().equals(source.getControllerId())
&& (object.getCardType().contains(CardType.INSTANT)
|| object.getCardType().contains(CardType.SORCERY))){
return true;
}
}
Permanent permanent = game.getBattlefield().getPermanent(event.getSourceId());
if(permanent != null && permanent.getCardType().contains(CardType.PLANESWALKER)){
return true;
}
}
return false;
}
@Override
public boolean apply(Game game, Ability source) {
return true;
}
@Override
public boolean replaceEvent(GameEvent event, Ability source, Game game) {
event.setAmount(event.getAmount() + 2);
return false;
}
@Override
public PyromancersGauntletReplacementEffect copy() {
return new PyromancersGauntletReplacementEffect(this);
}
}

View file

@ -0,0 +1,75 @@
/*
* 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.magic2014;
import java.util.UUID;
import mage.ObjectColor;
import mage.abilities.common.EntersBattlefieldControlledTriggeredAbility;
import mage.abilities.common.SpellCastTriggeredAbility;
import mage.abilities.effects.common.GainLifeEffect;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Rarity;
import mage.constants.Zone;
import mage.filter.FilterSpell;
import mage.filter.common.FilterLandPermanent;
import mage.filter.predicate.mageobject.ColorPredicate;
import mage.filter.predicate.mageobject.SubtypePredicate;
/**
*
* @author Plopman
*/
public class StaffOfTheDeathMagus extends CardImpl<StaffOfTheDeathMagus> {
private static final FilterSpell filterSpell = new FilterSpell("a black spell");
private static final FilterLandPermanent filterLand = new FilterLandPermanent("a Swamp");
static {
filterSpell.add(new ColorPredicate(ObjectColor.BLACK));
filterLand.add(new SubtypePredicate("Swamp"));
}
public StaffOfTheDeathMagus(UUID ownerId) {
super(ownerId, 219, "Staff of the Death Magus", Rarity.UNCOMMON, new CardType[]{CardType.ARTIFACT}, "{3}");
this.expansionSetCode = "M14";
// Whenever you cast a black spell or a Swamp enters the battlefield under your control, you gain 1 life.
this.addAbility(new SpellCastTriggeredAbility(new GainLifeEffect(1), filterSpell,false));
this.addAbility(new EntersBattlefieldControlledTriggeredAbility(Zone.BATTLEFIELD, new GainLifeEffect(1), filterLand, false));
}
public StaffOfTheDeathMagus(final StaffOfTheDeathMagus card) {
super(card);
}
@Override
public StaffOfTheDeathMagus copy() {
return new StaffOfTheDeathMagus(this);
}
}

View file

@ -0,0 +1,75 @@
/*
* 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.magic2014;
import java.util.UUID;
import mage.ObjectColor;
import mage.abilities.common.EntersBattlefieldControlledTriggeredAbility;
import mage.abilities.common.SpellCastTriggeredAbility;
import mage.abilities.effects.common.GainLifeEffect;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Rarity;
import mage.constants.Zone;
import mage.filter.FilterSpell;
import mage.filter.common.FilterLandPermanent;
import mage.filter.predicate.mageobject.ColorPredicate;
import mage.filter.predicate.mageobject.SubtypePredicate;
/**
*
* @author Plopman
*/
public class StaffOfTheFlameMagus extends CardImpl<StaffOfTheFlameMagus> {
private static final FilterSpell filterSpell = new FilterSpell("a red spell");
private static final FilterLandPermanent filterLand = new FilterLandPermanent("a Mountain");
static {
filterSpell.add(new ColorPredicate(ObjectColor.RED));
filterLand.add(new SubtypePredicate("Mountain"));
}
public StaffOfTheFlameMagus(UUID ownerId) {
super(ownerId, 220, "Staff of the Flame Magus", Rarity.UNCOMMON, new CardType[]{CardType.ARTIFACT}, "{3}");
this.expansionSetCode = "M14";
// Whenever you cast a red spell or a Mountain enters the battlefield under your control, you gain 1 life.
this.addAbility(new SpellCastTriggeredAbility(new GainLifeEffect(1), filterSpell,false));
this.addAbility(new EntersBattlefieldControlledTriggeredAbility(Zone.BATTLEFIELD, new GainLifeEffect(1), filterLand, false));
}
public StaffOfTheFlameMagus(final StaffOfTheFlameMagus card) {
super(card);
}
@Override
public StaffOfTheFlameMagus copy() {
return new StaffOfTheFlameMagus(this);
}
}

View file

@ -0,0 +1,75 @@
/*
* 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.magic2014;
import java.util.UUID;
import mage.ObjectColor;
import mage.abilities.common.EntersBattlefieldControlledTriggeredAbility;
import mage.abilities.common.SpellCastTriggeredAbility;
import mage.abilities.effects.common.GainLifeEffect;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Rarity;
import mage.constants.Zone;
import mage.filter.FilterSpell;
import mage.filter.common.FilterLandPermanent;
import mage.filter.predicate.mageobject.ColorPredicate;
import mage.filter.predicate.mageobject.SubtypePredicate;
/**
*
* @author Plopman
*/
public class StaffOfTheMindMagus extends CardImpl<StaffOfTheMindMagus> {
private static final FilterSpell filterSpell = new FilterSpell("a blue spell");
private static final FilterLandPermanent filterLand = new FilterLandPermanent("an Island");
static {
filterSpell.add(new ColorPredicate(ObjectColor.BLUE));
filterLand.add(new SubtypePredicate("Island"));
}
public StaffOfTheMindMagus(UUID ownerId) {
super(ownerId, 221, "Staff of the Mind Magus", Rarity.UNCOMMON, new CardType[]{CardType.ARTIFACT}, "{3}");
this.expansionSetCode = "M14";
// Whenever you cast a blue spell or an Island enters the battlefield under your control, you gain 1 life.
this.addAbility(new SpellCastTriggeredAbility(new GainLifeEffect(1), filterSpell,false));
this.addAbility(new EntersBattlefieldControlledTriggeredAbility(Zone.BATTLEFIELD, new GainLifeEffect(1), filterLand, false));
}
public StaffOfTheMindMagus(final StaffOfTheMindMagus card) {
super(card);
}
@Override
public StaffOfTheMindMagus copy() {
return new StaffOfTheMindMagus(this);
}
}

View file

@ -0,0 +1,75 @@
/*
* 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.magic2014;
import java.util.UUID;
import mage.ObjectColor;
import mage.abilities.common.EntersBattlefieldControlledTriggeredAbility;
import mage.abilities.common.SpellCastTriggeredAbility;
import mage.abilities.effects.common.GainLifeEffect;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Rarity;
import mage.constants.Zone;
import mage.filter.FilterSpell;
import mage.filter.common.FilterLandPermanent;
import mage.filter.predicate.mageobject.ColorPredicate;
import mage.filter.predicate.mageobject.SubtypePredicate;
/**
*
* @author Plopman
*/
public class StaffOfTheSunMagus extends CardImpl<StaffOfTheSunMagus> {
private static final FilterSpell filterSpell = new FilterSpell("a white spell");
private static final FilterLandPermanent filterLand = new FilterLandPermanent("a Plains");
static {
filterSpell.add(new ColorPredicate(ObjectColor.WHITE));
filterLand.add(new SubtypePredicate("Plains"));
}
public StaffOfTheSunMagus(UUID ownerId) {
super(ownerId, 222, "Staff of the Sun Magus", Rarity.UNCOMMON, new CardType[]{CardType.ARTIFACT}, "{3}");
this.expansionSetCode = "M14";
// Whenever you cast a white spell or a Plains enters the battlefield under your control, you gain 1 life.
this.addAbility(new SpellCastTriggeredAbility(new GainLifeEffect(1), filterSpell,false));
this.addAbility(new EntersBattlefieldControlledTriggeredAbility(Zone.BATTLEFIELD, new GainLifeEffect(1), filterLand, false));
}
public StaffOfTheSunMagus(final StaffOfTheSunMagus card) {
super(card);
}
@Override
public StaffOfTheSunMagus copy() {
return new StaffOfTheSunMagus(this);
}
}

View file

@ -0,0 +1,75 @@
/*
* 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.magic2014;
import java.util.UUID;
import mage.ObjectColor;
import mage.abilities.common.EntersBattlefieldControlledTriggeredAbility;
import mage.abilities.common.SpellCastTriggeredAbility;
import mage.abilities.effects.common.GainLifeEffect;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Rarity;
import mage.constants.Zone;
import mage.filter.FilterSpell;
import mage.filter.common.FilterLandPermanent;
import mage.filter.predicate.mageobject.ColorPredicate;
import mage.filter.predicate.mageobject.SubtypePredicate;
/**
*
* @author Plopman
*/
public class StaffOfTheWildMagus extends CardImpl<StaffOfTheWildMagus> {
private static final FilterSpell filterSpell = new FilterSpell("a green spell");
private static final FilterLandPermanent filterLand = new FilterLandPermanent("a Forest");
static {
filterSpell.add(new ColorPredicate(ObjectColor.GREEN));
filterLand.add(new SubtypePredicate("Forest"));
}
public StaffOfTheWildMagus(UUID ownerId) {
super(ownerId, 223, "Staff of the Wild Magus", Rarity.UNCOMMON, new CardType[]{CardType.ARTIFACT}, "{3}");
this.expansionSetCode = "M14";
// Whenever you cast a green spell or a Forest enters the battlefield under your control, you may gain 1 life.
this.addAbility(new SpellCastTriggeredAbility(new GainLifeEffect(1), filterSpell,false));
this.addAbility(new EntersBattlefieldControlledTriggeredAbility(Zone.BATTLEFIELD, new GainLifeEffect(1), filterLand, false));
}
public StaffOfTheWildMagus(final StaffOfTheWildMagus card) {
super(card);
}
@Override
public StaffOfTheWildMagus copy() {
return new StaffOfTheWildMagus(this);
}
}

View file

@ -0,0 +1,201 @@
/*
* 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.magic2014;
import java.util.HashSet;
import java.util.Set;
import java.util.UUID;
import mage.abilities.Ability;
import mage.abilities.Mode;
import mage.abilities.TriggeredAbility;
import mage.abilities.common.SimpleActivatedAbility;
import mage.abilities.costs.common.TapSourceCost;
import mage.abilities.costs.mana.ManaCostsImpl;
import mage.abilities.effects.OneShotEffect;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Outcome;
import mage.constants.Rarity;
import mage.constants.Zone;
import mage.filter.Filter;
import mage.filter.FilterAbility;
import mage.game.Game;
import mage.game.permanent.Permanent;
import mage.game.stack.StackAbility;
import mage.game.stack.StackObject;
import mage.players.Player;
import mage.target.TargetObject;
/**
*
* @author Plopman
*/
public class StrionicResonator extends CardImpl<StrionicResonator> {
public StrionicResonator(UUID ownerId) {
super(ownerId, 224, "Strionic Resonator", Rarity.RARE, new CardType[]{CardType.ARTIFACT}, "{2}");
this.expansionSetCode = "M14";
// {2}, {T}: Copy target triggered ability you control. You may choose new targets for the copy.
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new StrionicResonatorEffect(), new ManaCostsImpl("{2}"));
ability.addCost(new TapSourceCost());
ability.addTarget(new TargetTriggeredAbility());
this.addAbility(ability);
}
public StrionicResonator(final StrionicResonator card) {
super(card);
}
@Override
public StrionicResonator copy() {
return new StrionicResonator(this);
}
}
class StrionicResonatorEffect extends OneShotEffect<StrionicResonatorEffect> {
public StrionicResonatorEffect() {
super(Outcome.Copy);
}
public StrionicResonatorEffect(final StrionicResonatorEffect effect) {
super(effect);
}
@Override
public boolean apply(Game game, Ability source) {
StackAbility stackAbility = (StackAbility)game.getStack().getStackObject(targetPointer.getFirst(game, source));
if(stackAbility != null){
Ability ability = (Ability) stackAbility.getStackAbility();
Player controller = game.getPlayer(source.getControllerId());
Permanent sourcePermanent = game.getPermanent(source.getSourceId());
if (ability != null && controller != null && sourcePermanent != null) {
Ability newAbility = ability.copy();
newAbility.newId();
game.getStack().push(new StackAbility(newAbility, source.getControllerId()));
if (newAbility.getTargets().size() > 0) {
if (controller.chooseUse(newAbility.getEffects().get(0).getOutcome(), "Choose new targets?", game)) {
newAbility.getTargets().clearChosen();
if (newAbility.getTargets().chooseTargets(newAbility.getEffects().get(0).getOutcome(), source.getControllerId(), newAbility, game) == false) {
return false;
}
}
}
game.informPlayers(new StringBuilder(sourcePermanent.getName()).append(": ").append(controller.getName()).append(" copied activated ability").toString());
return true;
}
}
return false;
}
@Override
public StrionicResonatorEffect copy() {
return new StrionicResonatorEffect(this);
}
@Override
public String getText(Mode mode) {
StringBuilder sb = new StringBuilder();
sb.append("Copy target ").append(mode.getTargets().get(0).getTargetName()).append(". You may choose new targets for the copy");
return sb.toString();
}
}
class TargetTriggeredAbility extends TargetObject<TargetTriggeredAbility> {
public TargetTriggeredAbility() {
this.minNumberOfTargets = 1;
this.maxNumberOfTargets = 1;
this.zone = Zone.STACK;
this.targetName = "target triggered ability";
}
public TargetTriggeredAbility(final TargetTriggeredAbility target) {
super(target);
}
@Override
public boolean canTarget(UUID id, Ability source, Game game) {
if (source != null && source.getId().equals(id)) {
return false;
}
StackObject stackObject = game.getStack().getStackObject(id);
if (stackObject.getStackAbility() != null && stackObject.getStackAbility() instanceof TriggeredAbility) {
return true;
}
return false;
}
@Override
public boolean canChoose(UUID sourceId, UUID sourceControllerId, Game game) {
return canChoose(sourceControllerId, game);
}
@Override
public boolean canChoose(UUID sourceControllerId, Game game) {
for (StackObject stackObject : game.getStack()) {
if (stackObject.getStackAbility() != null && stackObject.getStackAbility() instanceof TriggeredAbility && game.getPlayer(sourceControllerId).getInRange().contains(stackObject.getStackAbility().getControllerId())) {
return true;
}
}
return false;
}
@Override
public Set<UUID> possibleTargets(UUID sourceId, UUID sourceControllerId, Game game) {
return possibleTargets(sourceControllerId, game);
}
@Override
public Set<UUID> possibleTargets(UUID sourceControllerId, Game game) {
Set<UUID> possibleTargets = new HashSet<UUID>();
for (StackObject stackObject : game.getStack()) {
if (stackObject.getStackAbility() != null && stackObject.getStackAbility() instanceof TriggeredAbility && game.getPlayer(sourceControllerId).getInRange().contains(stackObject.getStackAbility().getControllerId())) {
possibleTargets.add(stackObject.getStackAbility().getId());
}
}
return possibleTargets;
}
@Override
public TargetTriggeredAbility copy() {
return new TargetTriggeredAbility(this);
}
@Override
public Filter getFilter() {
return new FilterAbility();
}
}

View file

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

View file

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

View file

@ -28,12 +28,15 @@
package mage.abilities.keyword; package mage.abilities.keyword;
import java.util.UUID;
import mage.constants.Outcome; import mage.constants.Outcome;
import mage.constants.TimingRule; import mage.constants.TimingRule;
import mage.constants.Zone; import mage.constants.Zone;
import mage.abilities.ActivatedAbilityImpl; import mage.abilities.ActivatedAbilityImpl;
import mage.abilities.costs.Cost; import mage.abilities.costs.Cost;
import mage.abilities.effects.common.AttachEffect; import mage.abilities.effects.common.AttachEffect;
import mage.game.Game;
import mage.game.permanent.Permanent;
import mage.target.Target; import mage.target.Target;
import mage.target.common.TargetControlledCreaturePermanent; import mage.target.common.TargetControlledCreaturePermanent;
@ -52,6 +55,18 @@ public class EquipAbility extends ActivatedAbilityImpl<EquipAbility> {
this.timing = TimingRule.SORCERY; this.timing = TimingRule.SORCERY;
} }
@Override
public boolean canActivate(UUID playerId, Game game) {
if(super.canActivate(playerId, game)){
Permanent permanent = game.getPermanent(sourceId);
if(permanent != null && permanent.hasSubtype("Equipment")){
return true;
}
}
return false;
}
public EquipAbility(final EquipAbility ability) { public EquipAbility(final EquipAbility ability) {
super(ability); super(ability);