mirror of
https://github.com/magefree/mage.git
synced 2025-12-25 21:12:04 -08:00
Merge branch 'master' of https://github.com/magefree/mage
This commit is contained in:
commit
0ebd773caf
55 changed files with 28614 additions and 28269 deletions
|
|
@ -25,18 +25,21 @@
|
|||
* 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.ArrayList;
|
||||
import java.util.GregorianCalendar;
|
||||
import java.util.List;
|
||||
import mage.cards.ExpansionSet;
|
||||
import mage.cards.repository.CardCriteria;
|
||||
import mage.cards.repository.CardInfo;
|
||||
import mage.cards.repository.CardRepository;
|
||||
import mage.constants.SetType;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author fireshoes
|
||||
*/
|
||||
|
||||
public class BattleForZendikar extends ExpansionSet {
|
||||
|
||||
private static final BattleForZendikar fINSTANCE = new BattleForZendikar();
|
||||
|
|
@ -45,16 +48,33 @@ public class BattleForZendikar extends ExpansionSet {
|
|||
return fINSTANCE;
|
||||
}
|
||||
|
||||
List<CardInfo> savedSpecialLand = new ArrayList<>();
|
||||
|
||||
private BattleForZendikar() {
|
||||
super("Battle for Zendikar", "BFZ", "mage.sets.battleforzendikar", new GregorianCalendar(2015, 10, 2).getTime(), SetType.EXPANSION);
|
||||
this.blockName = "Battle for Zendikar";
|
||||
this.hasBoosters = true;
|
||||
this.hasBasicLands = true;
|
||||
this.numBoosterLands = 1;
|
||||
this.ratioBoosterSpecialLand = 20; // Approximately as rare as opening a foil mythic = 8 * 6 = ~every 48th booster includes one
|
||||
// I set it to 20 to get it more often
|
||||
this.numBoosterCommon = 10;
|
||||
this.numBoosterUncommon = 3;
|
||||
this.numBoosterRare = 1;
|
||||
this.ratioBoosterMythic = 8;
|
||||
this.numBoosterSpecial = 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<CardInfo> getSpecialLand() {
|
||||
List<CardInfo> specialLand = new ArrayList<>();
|
||||
if (savedSpecialLand.isEmpty()) {
|
||||
CardCriteria criteria = new CardCriteria();
|
||||
criteria.setCodes("EXP");
|
||||
specialLand.addAll(CardRepository.instance.findCards(criteria));
|
||||
}
|
||||
|
||||
specialLand.addAll(savedSpecialLand);
|
||||
return specialLand;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,38 +1,37 @@
|
|||
/*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without modification, are
|
||||
* permitted provided that the following conditions are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright notice, this list of
|
||||
* conditions and the following disclaimer.
|
||||
*
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
|
||||
* of conditions and the following disclaimer in the documentation and/or other materials
|
||||
* provided with the distribution.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED
|
||||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
|
||||
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR
|
||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
|
||||
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
|
||||
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
* The views and conclusions contained in the software and documentation are those of the
|
||||
* authors and should not be interpreted as representing official policies, either expressed
|
||||
* or implied, of BetaSteward_at_googlemail.com.
|
||||
*/
|
||||
package mage.sets.alarareborn;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Rarity;
|
||||
import mage.abilities.effects.common.DestroyTargetEffect;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Rarity;
|
||||
import mage.target.common.TargetCreaturePermanent;
|
||||
|
||||
/**
|
||||
|
|
@ -44,8 +43,6 @@ public class Terminate extends CardImpl {
|
|||
public Terminate(UUID ownerId) {
|
||||
super(ownerId, 46, "Terminate", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{B}{R}");
|
||||
this.expansionSetCode = "ARB";
|
||||
|
||||
|
||||
|
||||
// Destroy target creature. It can't be regenerated.
|
||||
this.getSpellAbility().addTarget(new TargetCreaturePermanent());
|
||||
|
|
|
|||
|
|
@ -27,22 +27,26 @@
|
|||
*/
|
||||
package mage.sets.avacynrestored;
|
||||
|
||||
import mage.constants.*;
|
||||
import java.util.UUID;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
|
||||
import mage.abilities.common.SimpleStaticAbility;
|
||||
import mage.abilities.costs.common.TapSourceCost;
|
||||
import mage.abilities.effects.Effect;
|
||||
import mage.abilities.effects.common.AttachEffect;
|
||||
import mage.abilities.effects.common.DrawCardSourceControllerEffect;
|
||||
import mage.abilities.effects.common.continuous.GainAbilityAttachedEffect;
|
||||
import mage.abilities.keyword.EnchantAbility;
|
||||
import mage.abilities.mana.AnyColorManaAbility;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.constants.AttachmentType;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Outcome;
|
||||
import mage.constants.Rarity;
|
||||
import mage.constants.Zone;
|
||||
import mage.target.TargetPermanent;
|
||||
import mage.target.common.TargetLandPermanent;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
* @author noxx
|
||||
*/
|
||||
|
|
@ -53,7 +57,6 @@ public class AbundantGrowth extends CardImpl {
|
|||
this.expansionSetCode = "AVR";
|
||||
this.subtype.add("Aura");
|
||||
|
||||
|
||||
// Enchant land
|
||||
TargetPermanent auraTarget = new TargetLandPermanent();
|
||||
this.getSpellAbility().addTarget(auraTarget);
|
||||
|
|
@ -66,7 +69,9 @@ public class AbundantGrowth extends CardImpl {
|
|||
|
||||
// Enchanted land has "{tap}: Add one mana of any color to your mana pool."
|
||||
Ability gainedAbility = new AnyColorManaAbility(new TapSourceCost());
|
||||
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityAttachedEffect(gainedAbility, AttachmentType.AURA)));
|
||||
Effect effect = new GainAbilityAttachedEffect(gainedAbility, AttachmentType.AURA);
|
||||
effect.setText("Enchanted land has \"{tap}: Add one mana of any color to your mana pool.\"");
|
||||
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, effect));
|
||||
}
|
||||
|
||||
public AbundantGrowth(final AbundantGrowth card) {
|
||||
|
|
|
|||
|
|
@ -60,7 +60,7 @@ public class GideonAllyOfZendikar extends CardImpl {
|
|||
super(ownerId, 29, "Gideon, Ally of Zendikar", Rarity.MYTHIC, new CardType[]{CardType.PLANESWALKER}, "{2}{W}{W}");
|
||||
this.expansionSetCode = "BFZ";
|
||||
this.subtype.add("Gideon");
|
||||
|
||||
|
||||
this.addAbility(new EntersBattlefieldAbility(new AddCountersSourceEffect(CounterType.LOYALTY.createInstance(4)), false));
|
||||
|
||||
// +1: Until end of turn, Gideon, Ally of Zendikar becomes a 5/5 Human Soldier Ally creature with indestructible that's still a planeswalker. Prevent all damage that would be dealt to him this turn.
|
||||
|
|
@ -69,7 +69,7 @@ public class GideonAllyOfZendikar extends CardImpl {
|
|||
effect.setText("Prevent all damage that would be dealt to him this turn");
|
||||
ability.addEffect(effect);
|
||||
this.addAbility(ability);
|
||||
|
||||
|
||||
// 0: Put a 2/2 white Knight Ally creature token onto the battlefield.
|
||||
this.addAbility(new LoyaltyAbility(new CreateTokenEffect(new KnightAllyToken()), 0));
|
||||
|
||||
|
|
@ -94,6 +94,7 @@ class GideonAllyOfZendikarEmblem extends Emblem {
|
|||
BoostControlledEffect effect = new BoostControlledEffect(1, 1, Duration.EndOfGame);
|
||||
Ability ability = new SimpleStaticAbility(Zone.COMMAND, effect);
|
||||
this.getAbilities().add(ability);
|
||||
this.setExpansionSetCodeForImage("BFZ");
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -107,8 +108,8 @@ class GideonAllyOfZendikarToken extends Token {
|
|||
subtype.add("Ally");
|
||||
power = new MageInt(5);
|
||||
toughness = new MageInt(5);
|
||||
|
||||
addAbility(IndestructibleAbility.getInstance());
|
||||
|
||||
addAbility(IndestructibleAbility.getInstance());
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -123,4 +124,4 @@ class KnightAllyToken extends Token {
|
|||
power = new MageInt(2);
|
||||
toughness = new MageInt(2);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -33,10 +33,12 @@ import mage.MageObject;
|
|||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.DiesTriggeredAbility;
|
||||
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
|
||||
import mage.abilities.effects.Effect;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.abilities.effects.common.ExileSourceEffect;
|
||||
import mage.abilities.effects.common.ReturnFromGraveyardToHandTargetEffect;
|
||||
import mage.abilities.effects.common.ReturnToHandTargetEffect;
|
||||
import mage.cards.Card;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Outcome;
|
||||
|
|
@ -44,6 +46,7 @@ import mage.constants.Rarity;
|
|||
import mage.game.Game;
|
||||
import mage.players.Player;
|
||||
import mage.target.common.TargetCardInYourGraveyard;
|
||||
import mage.target.targetpointer.FixedTarget;
|
||||
|
||||
/**
|
||||
*
|
||||
|
|
@ -99,10 +102,15 @@ class GreenwardenOfMurasaEffect extends OneShotEffect {
|
|||
public boolean apply(Game game, Ability source) {
|
||||
Player controller = game.getPlayer(source.getControllerId());
|
||||
MageObject sourceObject = game.getObject(source.getSourceId());
|
||||
if (controller != null && sourceObject != null) {
|
||||
Card targetCard = game.getCard(getTargetPointer().getFirst(game, source));
|
||||
if (controller != null && sourceObject != null && targetCard != null) {
|
||||
if (controller.chooseUse(outcome, "Exile " + sourceObject.getLogName() + " to return card from your graveyard to your hand?", source, game)) {
|
||||
new ExileSourceEffect().apply(game, source);
|
||||
return new ReturnToHandTargetEffect().apply(game, source);
|
||||
// Setting the fixed target prevents to return Greenwarden of Murasa itself (becuase it's exiled meanwhile),
|
||||
// but of course you can target it as the ability triggers I guess
|
||||
Effect effect = new ReturnToHandTargetEffect();
|
||||
effect.setTargetPointer(new FixedTarget(targetCard.getId(), targetCard.getZoneChangeCounter(game)));
|
||||
return effect.apply(game, source);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -46,9 +46,8 @@ import mage.target.targetpointer.SecondTargetPointer;
|
|||
public class GripOfDesolation extends CardImpl {
|
||||
|
||||
public GripOfDesolation(UUID ownerId) {
|
||||
super(ownerId, 94, "Grip of Desolation", Rarity.UNCOMMON, new CardType[]{}, "{4}{B}{B}");
|
||||
super(ownerId, 94, "Grip of Desolation", Rarity.UNCOMMON, new CardType[]{CardType.INSTANT}, "{4}{B}{B}");
|
||||
this.expansionSetCode = "BFZ";
|
||||
this.supertype.add("Intant");
|
||||
|
||||
// Devoid
|
||||
Ability ability = new DevoidAbility(this.color);
|
||||
|
|
|
|||
|
|
@ -53,7 +53,7 @@ public class InfuseWithTheElements extends CardImpl {
|
|||
|
||||
// <i>Converge</i> - Put X +1/+1 counters on target creature, where X is the number of colors of mana spent to cast Infuse with the Elements.
|
||||
this.getSpellAbility().setAbilityWord(AbilityWord.CONVERGE);
|
||||
Effect effect = new AddCountersTargetEffect(CounterType.P1P1.createInstance(), ColorsOfManaSpentToCastCount.getInstance());
|
||||
Effect effect = new AddCountersTargetEffect(CounterType.P1P1.createInstance(0), ColorsOfManaSpentToCastCount.getInstance());
|
||||
effect.setText("Put X +1/+1 counters on target creature, where X is the number of colors of mana spent to cast {this}");
|
||||
this.getSpellAbility().addEffect(effect);
|
||||
this.getSpellAbility().addTarget(new TargetCreaturePermanent());
|
||||
|
|
|
|||
|
|
@ -150,17 +150,16 @@ class KioraRevealEffect extends OneShotEffect {
|
|||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Player player = game.getPlayer(source.getControllerId());
|
||||
Player controller = game.getPlayer(source.getControllerId());
|
||||
MageObject sourceObject = game.getObject(source.getSourceId());
|
||||
if (sourceObject != null && player != null) {
|
||||
Cards cards = new CardsImpl(Zone.PICK);
|
||||
if (sourceObject != null && controller != null) {
|
||||
Cards cards = new CardsImpl(Zone.LIBRARY);
|
||||
cards.addAll(controller.getLibrary().getTopCards(game, 4));
|
||||
boolean creatureCardFound = false;
|
||||
boolean landCardFound = false;
|
||||
int count = Math.min(player.getLibrary().size(), 4);
|
||||
for (int i = 0; i < count; i++) {
|
||||
Card card = player.getLibrary().removeFromTop(game);
|
||||
for (UUID cardId : cards) {
|
||||
Card card = game.getCard(cardId);
|
||||
if (card != null) {
|
||||
game.setZone(card.getId(), Zone.PICK);
|
||||
cards.add(card);
|
||||
if (card.getCardType().contains(CardType.CREATURE)) {
|
||||
creatureCardFound = true;
|
||||
|
|
@ -172,30 +171,30 @@ class KioraRevealEffect extends OneShotEffect {
|
|||
}
|
||||
|
||||
if (!cards.isEmpty()) {
|
||||
player.revealCards(sourceObject.getName(), cards, game);
|
||||
if ((creatureCardFound || landCardFound)
|
||||
&& player.chooseUse(Outcome.DrawCard,
|
||||
controller.revealCards(sourceObject.getName(), cards, game);
|
||||
if ((creatureCardFound || landCardFound)
|
||||
&& controller.chooseUse(Outcome.DrawCard,
|
||||
"Put a creature card and/or a land card into your hand?", source, game)) {
|
||||
TargetCard target = new TargetCard(Zone.PICK, new FilterCreatureCard("creature card to put into your hand"));
|
||||
if (creatureCardFound && player.choose(Outcome.DrawCard, cards, target, game)) {
|
||||
if (creatureCardFound && controller.chooseTarget(Outcome.DrawCard, cards, target, source, game)) {
|
||||
Card card = cards.get(target.getFirstTarget(), game);
|
||||
if (card != null) {
|
||||
cards.remove(card);
|
||||
card.moveToZone(Zone.HAND, source.getSourceId(), game, false);
|
||||
controller.moveCards(card, null, Zone.HAND, source, game);
|
||||
}
|
||||
}
|
||||
|
||||
target = new TargetCard(Zone.PICK, new FilterLandCard("land card to put into your hand"));
|
||||
if (landCardFound && player.choose(Outcome.DrawCard, cards, target, game)) {
|
||||
target = new TargetCard(Zone.LIBRARY, new FilterLandCard("land card to put into your hand"));
|
||||
if (landCardFound && controller.chooseTarget(Outcome.DrawCard, cards, target, source, game)) {
|
||||
Card card = cards.get(target.getFirstTarget(), game);
|
||||
if (card != null) {
|
||||
cards.remove(card);
|
||||
card.moveToZone(Zone.HAND, source.getSourceId(), game, false);
|
||||
controller.moveCards(card, null, Zone.HAND, source, game);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
player.moveCards(cards, Zone.PICK, Zone.GRAVEYARD, source, game);
|
||||
controller.moveCards(cards, null, Zone.GRAVEYARD, source, game);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
|
@ -208,12 +207,13 @@ class KioraMasterOfTheDepthsEmblem extends Emblem {
|
|||
|
||||
public KioraMasterOfTheDepthsEmblem() {
|
||||
this.setName("EMBLEM: Kiora, Master of the Depths");
|
||||
|
||||
|
||||
Ability ability = new EntersBattlefieldControlledTriggeredAbility(Zone.COMMAND,
|
||||
new KioraFightEffect(), filter, true, SetTargetPointer.PERMANENT,
|
||||
"Whenever a creature enters the battlefield under your control, you may have it fight target creature.");
|
||||
ability.addTarget(new TargetCreaturePermanent());
|
||||
this.getAbilities().add(ability);
|
||||
this.setExpansionSetCodeForImage("BFZ");
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -55,7 +55,7 @@ public class MakindiPatrol extends CardImpl {
|
|||
|
||||
// <i>Rally</i> — Whenever Makindi Patrol or another Ally enters the battlefield under your control, creatures you control gain vigilance until end of turn.
|
||||
this.addAbility(new AllyEntersBattlefieldTriggeredAbility(
|
||||
new GainAbilityControlledEffect(VigilanceAbility.getInstance(), Duration.EndOfTurn, new FilterControlledCreaturePermanent("creatures you control")), false));
|
||||
new GainAbilityControlledEffect(VigilanceAbility.getInstance(), Duration.EndOfTurn, new FilterControlledCreaturePermanent("creatures")), false));
|
||||
}
|
||||
|
||||
public MakindiPatrol(final MakindiPatrol card) {
|
||||
|
|
|
|||
|
|
@ -40,10 +40,12 @@ import mage.cards.CardsImpl;
|
|||
import mage.constants.CardType;
|
||||
import mage.constants.Outcome;
|
||||
import mage.constants.Rarity;
|
||||
import mage.constants.Zone;
|
||||
import mage.filter.FilterCard;
|
||||
import mage.filter.predicate.mageobject.SubtypePredicate;
|
||||
import mage.game.Game;
|
||||
import mage.players.Player;
|
||||
import mage.target.TargetCard;
|
||||
|
||||
/**
|
||||
*
|
||||
|
|
@ -79,7 +81,7 @@ public class MundaAmbushLeader extends CardImpl {
|
|||
|
||||
class MundaAmbushLeaderEffect extends OneShotEffect {
|
||||
|
||||
private static final FilterCard filter = new FilterCard("Ally cards");
|
||||
private static final FilterCard filter = new FilterCard("Ally cards to reveal and put on top of your libraray");
|
||||
|
||||
static {
|
||||
filter.add(new SubtypePredicate("Ally"));
|
||||
|
|
@ -107,12 +109,16 @@ class MundaAmbushLeaderEffect extends OneShotEffect {
|
|||
Cards allCards = new CardsImpl();
|
||||
allCards.addAll(controller.getLibrary().getTopCards(game, 4));
|
||||
controller.lookAtCards(sourceObject.getIdName(), allCards, game);
|
||||
Cards allyCards = new CardsImpl();
|
||||
allyCards.addAll(allCards.getCards(filter, source.getSourceId(), source.getControllerId(), game));
|
||||
if (!allyCards.isEmpty()) {
|
||||
controller.revealCards(sourceObject.getIdName(), allyCards, game, true);
|
||||
allCards.removeAll(allyCards);
|
||||
controller.putCardsOnTopOfLibrary(allyCards, game, source, true);
|
||||
if (!allCards.isEmpty()) {
|
||||
Cards cardsToReveal = new CardsImpl();
|
||||
TargetCard target = new TargetCard(0, Integer.MAX_VALUE, Zone.LIBRARY, new FilterCard("Ally cards to put on top of your libraray"));
|
||||
controller.chooseTarget(outcome, allCards, target, source, game);
|
||||
cardsToReveal.addAll(target.getTargets());
|
||||
if (!cardsToReveal.isEmpty()) {
|
||||
controller.revealCards(sourceObject.getIdName(), cardsToReveal, game, true);
|
||||
allCards.removeAll(cardsToReveal);
|
||||
}
|
||||
controller.putCardsOnTopOfLibrary(cardsToReveal, game, source, true);
|
||||
}
|
||||
if (!allCards.isEmpty()) {
|
||||
controller.putCardsOnBottomOfLibrary(allCards, game, source, true);
|
||||
|
|
|
|||
|
|
@ -100,6 +100,7 @@ class ObNixilisReignitedEmblem extends Emblem {
|
|||
setName("EMBLEM: Ob Nixilis Reignited");
|
||||
|
||||
this.getAbilities().add(new ObNixilisEmblemTriggeredAbility(new LoseLifeSourceControllerEffect(2), false));
|
||||
this.setExpansionSetCodeForImage("BFZ");
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -106,7 +106,9 @@ class OblivionSowerEffect extends OneShotEffect {
|
|||
Cards exiledLands = new CardsImpl();
|
||||
exiledLands.addAll(exiledCards.getCards(filter, source.getSourceId(), controller.getId(), game));
|
||||
if (!exiledLands.isEmpty() && controller.chooseUse(outcome, "Put lands into play?", source, game)) {
|
||||
FilterCard filterToPlay = new FilterCard("Lands owned by " + targetPlayer.getName() + " to put into play under your control");
|
||||
FilterCard filterToPlay = new FilterCard("land"
|
||||
+ (exiledLands.size() > 1 ? "s" : "") + " from exile owned by "
|
||||
+ targetPlayer.getName() + " to put into play under your control");
|
||||
TargetCard targetCards = new TargetCard(0, exiledLands.size(), Zone.EXILED, filterToPlay);
|
||||
if (controller.chooseTarget(outcome, exiledLands, targetCards, source, game)) {
|
||||
controller.moveCards(new CardsImpl(targetCards.getTargets()), null, Zone.BATTLEFIELD, source, game);
|
||||
|
|
|
|||
|
|
@ -41,7 +41,6 @@ import mage.constants.Duration;
|
|||
import mage.constants.Outcome;
|
||||
import mage.constants.Rarity;
|
||||
import mage.filter.common.FilterControlledLandPermanent;
|
||||
import mage.target.TargetPermanent;
|
||||
import mage.target.common.TargetControlledPermanent;
|
||||
|
||||
/**
|
||||
|
|
@ -60,7 +59,6 @@ public class SlabHammer extends CardImpl {
|
|||
new DoIfCostPaid(new BoostEquippedEffect(2, 2, Duration.EndOfTurn),
|
||||
new ReturnToHandTargetPermanentCost(new TargetControlledPermanent(new FilterControlledLandPermanent())),
|
||||
"Return a land you control to its owner's hand? (giving +2/+2 to the equipped creature)"));
|
||||
ability.addTarget(new TargetPermanent());
|
||||
this.addAbility(ability);
|
||||
|
||||
// Equip {2}
|
||||
|
|
|
|||
|
|
@ -52,7 +52,7 @@ import mage.target.common.TargetCreaturePermanent;
|
|||
*/
|
||||
public class TitansPresence extends CardImpl {
|
||||
|
||||
private static final FilterCreatureCard filter = new FilterCreatureCard("a colorless creature card from your hand to reveal");
|
||||
private static final FilterCreatureCard filter = new FilterCreatureCard("a colorless creature card from your hand");
|
||||
|
||||
static {
|
||||
filter.add(new ColorlessPredicate());
|
||||
|
|
|
|||
|
|
@ -40,6 +40,7 @@ import mage.constants.TargetController;
|
|||
import mage.constants.Zone;
|
||||
import mage.filter.common.FilterCreaturePermanent;
|
||||
import mage.filter.predicate.permanent.ControllerPredicate;
|
||||
import mage.watchers.common.AttackedThisTurnWatcher;
|
||||
|
||||
/**
|
||||
*
|
||||
|
|
@ -63,7 +64,7 @@ public class FumikoTheLowblood extends CardImpl {
|
|||
// Creatures your opponents control attack each turn if able.
|
||||
FilterCreaturePermanent filter = new FilterCreaturePermanent("Creatures your opponents control");
|
||||
filter.add(new ControllerPredicate(TargetController.OPPONENT));
|
||||
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new AttacksIfAbleAllEffect(filter)));
|
||||
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new AttacksIfAbleAllEffect(filter)), new AttackedThisTurnWatcher());
|
||||
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -58,8 +58,8 @@ import mage.target.TargetSpell;
|
|||
import mage.util.CardUtil;
|
||||
|
||||
/**
|
||||
import mage.constants.Outcome;
|
||||
*
|
||||
* import mage.constants.Outcome;
|
||||
*
|
||||
* @author LevelX2
|
||||
*/
|
||||
public class Mindreaver extends CardImpl {
|
||||
|
|
@ -77,10 +77,10 @@ public class Mindreaver extends CardImpl {
|
|||
Ability ability = new HeroicAbility(new MindreaverExileEffect(), false);
|
||||
ability.addTarget(new TargetPlayer());
|
||||
this.addAbility(ability);
|
||||
|
||||
// {U}{U}, Sacrifice Mindreaver: Counter target spell with the same name as a card exiled with mindreaver.
|
||||
|
||||
// {U}{U}, Sacrifice Mindreaver: Counter target spell with the same name as a card exiled with Mindreaver.
|
||||
ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new CounterTargetEffect(), new ManaCostsImpl("{U}{U}"));
|
||||
FilterSpell filter = new FilterSpell("spell with the same name as a card exiled with mindreaver");
|
||||
FilterSpell filter = new FilterSpell("spell with the same name as a card exiled with {this}");
|
||||
filter.add(new MindreaverNamePredicate(this.getId()));
|
||||
ability.addTarget(new TargetSpell(filter));
|
||||
ability.addCost(new SacrificeSourceCost());
|
||||
|
|
@ -116,12 +116,13 @@ class MindreaverExileEffect extends OneShotEffect {
|
|||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
UUID exileId = CardUtil.getCardExileZoneId(game, source);
|
||||
MageObject sourceObject = source.getSourceObject(game);
|
||||
Player opponent = game.getPlayer(this.getTargetPointer().getFirst(game, source));
|
||||
if (opponent != null) {
|
||||
if (opponent != null && sourceObject != null) {
|
||||
for (int i = 0; i < 3; i++) {
|
||||
Card card = opponent.getLibrary().getFromTop(game);
|
||||
if (card != null) {
|
||||
card.moveToExile(exileId, "Mindreaver", source.getSourceId(), game);
|
||||
card.moveToExile(exileId, sourceObject.getIdName(), source.getSourceId(), game);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -130,29 +131,29 @@ class MindreaverExileEffect extends OneShotEffect {
|
|||
}
|
||||
|
||||
class MindreaverNamePredicate implements Predicate<MageObject> {
|
||||
|
||||
|
||||
private final UUID sourceId;
|
||||
|
||||
|
||||
public MindreaverNamePredicate(UUID sourceId) {
|
||||
this.sourceId = sourceId;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean apply(MageObject input, Game game) {
|
||||
Set<String> cardNames = new HashSet<String>();
|
||||
UUID exileId = CardUtil.getCardExileZoneId(game, sourceId);
|
||||
ExileZone exileZone = game.getExile().getExileZone(exileId);
|
||||
if (exileZone != null) {
|
||||
for(Card card : exileZone.getCards(game)) {
|
||||
for (Card card : exileZone.getCards(game)) {
|
||||
cardNames.add(card.getName());
|
||||
}
|
||||
}
|
||||
// If a player names a card, the player may name either half of a split card, but not both.
|
||||
// If a player names a card, the player may name either half of a split card, but not both.
|
||||
// A split card has the chosen name if one of its two names matches the chosen name.
|
||||
if (input instanceof SplitCard) {
|
||||
return cardNames.contains(((SplitCard)input).getLeftHalfCard().getName()) || cardNames.contains(((SplitCard)input).getRightHalfCard().getName());
|
||||
} else if (input instanceof Spell && ((Spell)input).getSpellAbility().getSpellAbilityType().equals(SpellAbilityType.SPLIT_FUSED)){
|
||||
SplitCard card = (SplitCard) ((Spell)input).getCard();
|
||||
return cardNames.contains(((SplitCard) input).getLeftHalfCard().getName()) || cardNames.contains(((SplitCard) input).getRightHalfCard().getName());
|
||||
} else if (input instanceof Spell && ((Spell) input).getSpellAbility().getSpellAbilityType().equals(SpellAbilityType.SPLIT_FUSED)) {
|
||||
SplitCard card = (SplitCard) ((Spell) input).getCard();
|
||||
return cardNames.contains(card.getLeftHalfCard().getName()) || cardNames.contains(card.getRightHalfCard().getName());
|
||||
} else {
|
||||
return cardNames.contains(input.getName());
|
||||
|
|
@ -163,4 +164,4 @@ class MindreaverNamePredicate implements Predicate<MageObject> {
|
|||
public String toString() {
|
||||
return "spell with the same name as a card exiled with {source}";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -41,6 +41,7 @@ import mage.constants.Duration;
|
|||
import mage.constants.Rarity;
|
||||
import mage.constants.Zone;
|
||||
import mage.filter.common.FilterCreaturePermanent;
|
||||
import mage.watchers.common.AttackedThisTurnWatcher;
|
||||
|
||||
/**
|
||||
*
|
||||
|
|
@ -62,7 +63,7 @@ public class AvatarOfSlaughter extends CardImpl {
|
|||
effect = new AttacksIfAbleAllEffect(new FilterCreaturePermanent("creatures"));
|
||||
effect.setText("and attack each turn if able");
|
||||
ability.addEffect(effect);
|
||||
this.addAbility(ability);
|
||||
this.addAbility(ability, new AttackedThisTurnWatcher());
|
||||
}
|
||||
|
||||
public AvatarOfSlaughter(final AvatarOfSlaughter card) {
|
||||
|
|
|
|||
|
|
@ -38,7 +38,7 @@ import mage.filter.common.FilterEnchantmentPermanent;
|
|||
import mage.target.Target;
|
||||
import mage.target.TargetPermanent;
|
||||
import mage.target.common.TargetArtifactPermanent;
|
||||
import mage.target.targetpointer.SecondTargetPointer;
|
||||
import mage.target.common.TargetEnchantmentPermanent;
|
||||
|
||||
/**
|
||||
*
|
||||
|
|
@ -62,12 +62,11 @@ public class HullBreach extends CardImpl {
|
|||
this.getSpellAbility().addMode(mode);
|
||||
// or destroy target artifact and target enchantment.
|
||||
mode = new Mode();
|
||||
Effect effect = new DestroyTargetEffect();
|
||||
effect.setTargetPointer(new SecondTargetPointer());
|
||||
Effect effect = new DestroyTargetEffect(false, true);
|
||||
effect.setText("destroy target artifact and target enchantment");
|
||||
mode.getEffects().add(effect);
|
||||
mode.getTargets().add(new TargetArtifactPermanent());
|
||||
mode.getTargets().add(new TargetPermanent(new FilterEnchantmentPermanent()));
|
||||
mode.getTargets().add(new TargetEnchantmentPermanent());
|
||||
this.getSpellAbility().addMode(mode);
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -27,6 +27,8 @@
|
|||
*/
|
||||
package mage.sets.commander2013;
|
||||
|
||||
import java.util.LinkedHashSet;
|
||||
import java.util.Set;
|
||||
import java.util.UUID;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
|
|
@ -51,7 +53,6 @@ public class TemptWithDiscovery extends CardImpl {
|
|||
super(ownerId, 174, "Tempt with Discovery", Rarity.RARE, new CardType[]{CardType.SORCERY}, "{3}{G}");
|
||||
this.expansionSetCode = "C13";
|
||||
|
||||
|
||||
// Tempting offer - Search your library for a land card and put it onto the battlefield.
|
||||
// Each opponent may search his or her library for a land card and put it onto the battlefield.
|
||||
// For each opponent who searches a library this way, search your library for a land card and put it onto the battlefield.
|
||||
|
|
@ -89,12 +90,14 @@ class TemptWithDiscoveryEffect extends OneShotEffect {
|
|||
public boolean apply(Game game, Ability source) {
|
||||
Player controller = game.getPlayer(source.getControllerId());
|
||||
if (controller != null) {
|
||||
Set<UUID> playersShuffle = new LinkedHashSet<>();
|
||||
playersShuffle.add(controller.getId());
|
||||
TargetCardInLibrary target = new TargetCardInLibrary(new FilterLandCard());
|
||||
if (controller.searchLibrary(target, game)) {
|
||||
for (UUID cardId: target.getTargets()) {
|
||||
for (UUID cardId : target.getTargets()) {
|
||||
Card card = game.getCard(cardId);
|
||||
if (card != null) {
|
||||
card.putOntoBattlefield(game, Zone.LIBRARY, source.getSourceId(), controller.getId());
|
||||
controller.moveCards(card, null, Zone.BATTLEFIELD, source, game);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -105,11 +108,12 @@ class TemptWithDiscoveryEffect extends OneShotEffect {
|
|||
if (opponent.chooseUse(outcome, "Search your library for a land card and put it onto the battlefield?", source, game)) {
|
||||
target.clearChosen();
|
||||
opponentsUsedSearch++;
|
||||
playersShuffle.add(playerId);
|
||||
if (opponent.searchLibrary(target, game)) {
|
||||
for (UUID cardId: target.getTargets()) {
|
||||
for (UUID cardId : target.getTargets()) {
|
||||
Card card = game.getCard(cardId);
|
||||
if (card != null) {
|
||||
card.putOntoBattlefield(game, Zone.LIBRARY, source.getSourceId(), opponent.getId());
|
||||
opponent.moveCards(card, null, Zone.BATTLEFIELD, source, game);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -119,17 +123,23 @@ class TemptWithDiscoveryEffect extends OneShotEffect {
|
|||
if (opponentsUsedSearch > 0) {
|
||||
target = new TargetCardInLibrary(0, opponentsUsedSearch, new FilterLandCard());
|
||||
if (controller.searchLibrary(target, game)) {
|
||||
for (UUID cardId: target.getTargets()) {
|
||||
for (UUID cardId : target.getTargets()) {
|
||||
Card card = game.getCard(cardId);
|
||||
if (card != null) {
|
||||
card.putOntoBattlefield(game, Zone.LIBRARY, source.getSourceId(), controller.getId());
|
||||
controller.moveCards(card, null, Zone.BATTLEFIELD, source, game);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
for (UUID playerId : playersShuffle) {
|
||||
Player player = game.getPlayer(playerId);
|
||||
if (player != null) {
|
||||
player.shuffleLibrary(game);
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -62,7 +62,7 @@ public class WarmongerHellkite extends CardImpl {
|
|||
this.addAbility(FlyingAbility.getInstance());
|
||||
|
||||
// All creatures attack each combat if able.
|
||||
Effect effect = new AttacksIfAbleAllEffect(new FilterCreaturePermanent("creatures"));
|
||||
Effect effect = new AttacksIfAbleAllEffect(new FilterCreaturePermanent("creatures"), Duration.WhileOnBattlefield, true);
|
||||
effect.setText("All creatures attack each combat if able");
|
||||
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, effect));
|
||||
|
||||
|
|
|
|||
|
|
@ -1,16 +1,16 @@
|
|||
/*
|
||||
* 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
|
||||
|
|
@ -20,20 +20,19 @@
|
|||
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
|
||||
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
*
|
||||
* The views and conclusions contained in the software and documentation are those of the
|
||||
* authors and should not be interpreted as representing official policies, either expressed
|
||||
* or implied, of BetaSteward_at_googlemail.com.
|
||||
*/
|
||||
|
||||
package mage.sets.conflux;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Rarity;
|
||||
import mage.ObjectColor;
|
||||
import mage.abilities.effects.common.ExileTargetEffect;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Rarity;
|
||||
import mage.filter.FilterPermanent;
|
||||
import mage.filter.predicate.Predicates;
|
||||
import mage.filter.predicate.mageobject.ColorPredicate;
|
||||
|
|
@ -57,6 +56,7 @@ public class CelestialPurge extends CardImpl {
|
|||
super(ownerId, 5, "Celestial Purge", Rarity.UNCOMMON, new CardType[]{CardType.INSTANT}, "{1}{W}");
|
||||
this.expansionSetCode = "CON";
|
||||
|
||||
// Exile target black or red permanent.
|
||||
this.getSpellAbility().addTarget(new TargetPermanent(filter));
|
||||
this.getSpellAbility().addEffect(new ExileTargetEffect());
|
||||
}
|
||||
|
|
|
|||
|
|
@ -61,7 +61,7 @@ public class ThrabenDoomsayer extends CardImpl {
|
|||
// {tap}: Put a 1/1 white Human creature token onto the battlefield.
|
||||
this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new CreateTokenEffect(new HumanToken()), new TapSourceCost()));
|
||||
// Fateful hour - As long as you have 5 or less life, other creatures you control get +2/+2.
|
||||
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new ConditionalContinuousEffect(new BoostControlledEffect(2, 2, Duration.WhileOnBattlefield, false),
|
||||
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new ConditionalContinuousEffect(new BoostControlledEffect(2, 2, Duration.WhileOnBattlefield, true),
|
||||
FatefulHourCondition.getInstance(), "As long as you have 5 or less life, other creatures you control get +2/+2")));
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -44,22 +44,21 @@ import mage.filter.predicate.permanent.ControllerPredicate;
|
|||
* @author LevelX2
|
||||
*/
|
||||
public class DictateOfErebos extends CardImpl {
|
||||
|
||||
|
||||
private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("creature you control");
|
||||
|
||||
|
||||
static {
|
||||
filter.add(new ControllerPredicate(TargetController.YOU));
|
||||
}
|
||||
|
||||
|
||||
public DictateOfErebos(UUID ownerId) {
|
||||
super(ownerId, 65, "Dictate of Erebos", Rarity.RARE, new CardType[]{CardType.ENCHANTMENT}, "{3}{B}{B}");
|
||||
this.expansionSetCode = "JOU";
|
||||
|
||||
|
||||
// Flash
|
||||
this.addAbility(FlashAbility.getInstance());
|
||||
// Whenever a creature you control dies, each opponent sacrifices a creature.
|
||||
this.addAbility(new DiesCreatureTriggeredAbility(new SacrificeOpponentsEffect(new FilterControlledCreaturePermanent("a creature")), false, filter));
|
||||
this.addAbility(new DiesCreatureTriggeredAbility(new SacrificeOpponentsEffect(new FilterControlledCreaturePermanent("a creature")), false, filter));
|
||||
}
|
||||
|
||||
public DictateOfErebos(final DictateOfErebos card) {
|
||||
|
|
|
|||
|
|
@ -1,16 +1,16 @@
|
|||
/*
|
||||
* 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
|
||||
|
|
@ -20,26 +20,25 @@
|
|||
* 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.magic2011;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Rarity;
|
||||
import mage.constants.Zone;
|
||||
import mage.MageInt;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.EntersBattlefieldAbility;
|
||||
import mage.abilities.common.SimpleActivatedAbility;
|
||||
import mage.abilities.costs.common.RemoveCountersSourceCost;
|
||||
import mage.abilities.effects.common.counter.AddCountersSourceEffect;
|
||||
import mage.abilities.effects.common.DamageTargetEffect;
|
||||
import mage.abilities.effects.common.counter.AddCountersSourceEffect;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Rarity;
|
||||
import mage.constants.Zone;
|
||||
import mage.counters.CounterType;
|
||||
import mage.target.common.TargetCreatureOrPlayer;
|
||||
|
||||
|
|
@ -56,7 +55,10 @@ public class Triskelion extends CardImpl {
|
|||
this.power = new MageInt(1);
|
||||
this.toughness = new MageInt(1);
|
||||
|
||||
// Triskelion enters the battlefield with three +1/+1 counters on it.
|
||||
this.addAbility(new EntersBattlefieldAbility(new AddCountersSourceEffect(CounterType.P1P1.createInstance(3)), "with three +1/+1 counters on it"));
|
||||
|
||||
// Remove a +1/+1 counter from Triskelion: Triskelion deals 1 damage to target creature or player.
|
||||
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DamageTargetEffect(1), new RemoveCountersSourceCost(CounterType.P1P1.createInstance()));
|
||||
ability.addTarget(new TargetCreatureOrPlayer());
|
||||
this.addAbility(ability);
|
||||
|
|
|
|||
|
|
@ -74,7 +74,6 @@ public class ChandraPyromaster extends CardImpl {
|
|||
this.expansionSetCode = "M14";
|
||||
this.subtype.add("Chandra");
|
||||
|
||||
|
||||
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.
|
||||
|
|
@ -215,7 +214,7 @@ class ChandraPyromasterEffect2 extends OneShotEffect {
|
|||
Card card = library.removeFromTop(game);
|
||||
if (card != null) {
|
||||
controller.moveCardToExileWithInfo(card, source.getSourceId(), sourceObject.getIdName() + " <this card may be played the turn it was exiled>", source.getSourceId(), game, Zone.LIBRARY, true);
|
||||
ContinuousEffect effect = new ChandraPyromasterCastFromExileEffect();
|
||||
ContinuousEffect effect = new ChandraPyromasterCastFromExileEffect();
|
||||
effect.setTargetPointer(new FixedTarget(card.getId()));
|
||||
game.addEffect(effect, source);
|
||||
}
|
||||
|
|
@ -273,36 +272,31 @@ class ChandraPyromasterEffect3 extends OneShotEffect {
|
|||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Player you = game.getPlayer(source.getControllerId());
|
||||
if (you == null) {
|
||||
Player controller = game.getPlayer(source.getControllerId());
|
||||
MageObject sourceObject = source.getSourceObject(game);
|
||||
if (controller == null || sourceObject == 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.getSourceId(), game);
|
||||
cards.add(card);
|
||||
}
|
||||
}
|
||||
cards.addAll(controller.getLibrary().getTopCards(game, 10));
|
||||
controller.moveCardsToExile(cards.getCards(game), source, game, true, source.getSourceId(), sourceObject.getIdName());
|
||||
|
||||
if (cards.getCards(new FilterInstantOrSorceryCard(), game).size() > 0) {
|
||||
TargetCard target = new TargetCard(Zone.EXILED, new FilterInstantOrSorceryCard());
|
||||
if (you.chooseTarget(Outcome.PlayForFree, cards, target, source, game)) {
|
||||
if (controller.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(), source, game)) {
|
||||
you.cast(copy1.getSpellAbility(), game, true);
|
||||
if (controller.chooseUse(outcome, "Do you wish to cast copy 1 of " + card.getName(), source, game)) {
|
||||
Card copy1 = card.copy();
|
||||
controller.cast(copy1.getSpellAbility(), game, true);
|
||||
}
|
||||
if (copy2 != null && you.chooseUse(outcome, "Do you wish to cast copy 2 of " + card.getName(), source, game)) {
|
||||
you.cast(copy2.getSpellAbility(), game, true);
|
||||
if (controller.chooseUse(outcome, "Do you wish to cast copy 2 of " + card.getName(), source, game)) {
|
||||
Card copy2 = card.copy();
|
||||
controller.cast(copy2.getSpellAbility(), game, true);
|
||||
}
|
||||
if (copy3 != null && you.chooseUse(outcome, "Do you wish to cast copy 3 of " + card.getName(), source, game)) {
|
||||
you.cast(copy3.getSpellAbility(), game, true);
|
||||
if (controller.chooseUse(outcome, "Do you wish to cast copy 3 of " + card.getName(), source, game)) {
|
||||
Card copy3 = card.copy();
|
||||
controller.cast(copy3.getSpellAbility(), game, true);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -50,6 +50,7 @@ import mage.filter.predicate.permanent.AnotherPredicate;
|
|||
import mage.filter.predicate.permanent.AttackingPredicate;
|
||||
import mage.filter.predicate.permanent.ControllerPredicate;
|
||||
import mage.game.permanent.token.Token;
|
||||
import mage.watchers.common.AttackedThisTurnWatcher;
|
||||
|
||||
/**
|
||||
*
|
||||
|
|
@ -59,15 +60,15 @@ public class GoblinRabblemaster extends CardImpl {
|
|||
|
||||
private static final FilterCreaturePermanent otherGoblinFilter = new FilterCreaturePermanent("Goblin", "Other Goblin creatures you control");
|
||||
private static final FilterCreaturePermanent attackingFilter = new FilterCreaturePermanent("Goblin", "other attacking Goblin");
|
||||
|
||||
|
||||
static {
|
||||
otherGoblinFilter.add(new AnotherPredicate());
|
||||
otherGoblinFilter.add(new ControllerPredicate(TargetController.YOU));
|
||||
|
||||
|
||||
attackingFilter.add(new AttackingPredicate());
|
||||
attackingFilter.add(new AnotherPredicate());
|
||||
}
|
||||
|
||||
|
||||
public GoblinRabblemaster(UUID ownerId) {
|
||||
super(ownerId, 145, "Goblin Rabblemaster", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{2}{R}");
|
||||
this.expansionSetCode = "M15";
|
||||
|
|
@ -79,11 +80,11 @@ public class GoblinRabblemaster extends CardImpl {
|
|||
|
||||
// Other Goblin creatures you control attack each turn if able.
|
||||
Effect effect = new AttacksIfAbleAllEffect(otherGoblinFilter);
|
||||
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, effect));
|
||||
|
||||
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, effect), new AttackedThisTurnWatcher());
|
||||
|
||||
// At the beginning of combat on your turn, put a 1/1 red Goblin creature token with haste onto the battlefield.
|
||||
this.addAbility(new BeginningOfCombatTriggeredAbility(new CreateTokenEffect(new GoblinToken()), TargetController.YOU, false));
|
||||
|
||||
|
||||
// When Goblin Rabblemaster attacks, it gets +1/+0 until end of turn for each other attacking Goblin.
|
||||
this.addAbility(new AttacksTriggeredAbility(new BoostSourceEffect(new PermanentsOnBattlefieldCount(attackingFilter), new StaticValue(0), Duration.EndOfTurn, true), false));
|
||||
}
|
||||
|
|
@ -110,5 +111,5 @@ class GoblinToken extends Token {
|
|||
toughness = new MageInt(1);
|
||||
addAbility(HasteAbility.getInstance());
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -42,6 +42,7 @@ import mage.constants.CardType;
|
|||
import mage.constants.Outcome;
|
||||
import mage.constants.Rarity;
|
||||
import mage.constants.Zone;
|
||||
import mage.filter.common.FilterControlledCreaturePermanent;
|
||||
import mage.filter.common.FilterCreatureCard;
|
||||
import mage.game.Game;
|
||||
import mage.players.Library;
|
||||
|
|
@ -60,7 +61,7 @@ public class EvolutionaryLeap extends CardImpl {
|
|||
|
||||
// {G}, Sacrifice a creature: Reveal cards from the top of your library until you reveal a creature card. Put that card into your hand and the rest on the bottom of your library in a random order.
|
||||
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new EvolutionaryLeapEffect(), new ManaCostsImpl("{G}"));
|
||||
ability.addCost(new SacrificeTargetCost(new TargetControlledCreaturePermanent()));
|
||||
ability.addCost(new SacrificeTargetCost(new TargetControlledCreaturePermanent(new FilterControlledCreaturePermanent("a creature"))));
|
||||
this.addAbility(ability);
|
||||
}
|
||||
|
||||
|
|
@ -96,7 +97,7 @@ class EvolutionaryLeapEffect extends OneShotEffect {
|
|||
public boolean apply(Game game, Ability source) {
|
||||
Player controller = game.getPlayer(source.getControllerId());
|
||||
MageObject sourceObject = game.getObject(source.getSourceId());
|
||||
if (controller != null && controller.getLibrary().size() > 0) {
|
||||
if (controller != null && controller.getLibrary().size() > 0) {
|
||||
Cards cards = new CardsImpl();
|
||||
Library library = controller.getLibrary();
|
||||
Card card = null;
|
||||
|
|
@ -108,22 +109,27 @@ class EvolutionaryLeapEffect extends OneShotEffect {
|
|||
} while (library.size() > 0 && card != null && !filter.match(card, game));
|
||||
// reveal cards
|
||||
if (!cards.isEmpty()) {
|
||||
controller.revealCards(sourceObject.getName(), cards, game);
|
||||
}
|
||||
// put creature card in hand
|
||||
controller.moveCards(card, Zone.LIBRARY, Zone.HAND, source, game);
|
||||
// remove it from revealed card list
|
||||
cards.remove(card);
|
||||
// Put the rest on the bottom of your library in a random order
|
||||
while (cards.size() > 0) {
|
||||
card = cards.getRandom(game);
|
||||
if (card != null) {
|
||||
controller.revealCards(sourceObject.getIdName(), cards, game);
|
||||
if (filter.match(card, game)) {
|
||||
// put creature card in hand
|
||||
controller.moveCards(card, Zone.LIBRARY, Zone.HAND, source, game);
|
||||
// remove it from revealed card list
|
||||
cards.remove(card);
|
||||
controller.moveCardToLibraryWithInfo(card, source.getSourceId(), game, Zone.HAND, false, false);
|
||||
}
|
||||
// Put the rest on the bottom of your library in a random order
|
||||
Cards randomOrder = new CardsImpl();
|
||||
while (cards.size() > 0) {
|
||||
card = cards.getRandom(game);
|
||||
if (card != null) {
|
||||
cards.remove(card);
|
||||
randomOrder.add(card);
|
||||
controller.moveCardToLibraryWithInfo(card, source.getSourceId(), game, Zone.HAND, false, false);
|
||||
}
|
||||
}
|
||||
controller.putCardsOnBottomOfLibrary(randomOrder, game, source, false);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -48,18 +48,19 @@ import mage.filter.predicate.permanent.ControllerPredicate;
|
|||
import mage.game.Game;
|
||||
import mage.players.Player;
|
||||
import mage.target.TargetPlayer;
|
||||
import mage.watchers.common.AttackedThisTurnWatcher;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author fireshoes
|
||||
*/
|
||||
public class InciteWar extends CardImpl {
|
||||
|
||||
|
||||
private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("creatures you control");
|
||||
|
||||
static {
|
||||
filter.add(new ControllerPredicate(TargetController.YOU));
|
||||
}
|
||||
}
|
||||
|
||||
public InciteWar(UUID ownerId) {
|
||||
super(ownerId, 96, "Incite War", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{2}{R}");
|
||||
|
|
@ -68,12 +69,13 @@ public class InciteWar extends CardImpl {
|
|||
// Choose one - Creatures target player controls attack this turn if able;
|
||||
this.getSpellAbility().addEffect(new InciteWarMustAttackEffect());
|
||||
this.getSpellAbility().addTarget(new TargetPlayer());
|
||||
|
||||
this.getSpellAbility().addWatcher(new AttackedThisTurnWatcher());
|
||||
|
||||
// or creatures you control gain first strike until end of turn.
|
||||
Mode mode = new Mode();
|
||||
mode.getEffects().add(new GainAbilityAllEffect(FirstStrikeAbility.getInstance(), Duration.EndOfTurn, filter));
|
||||
this.getSpellAbility().getModes().addMode(mode);
|
||||
|
||||
|
||||
// Entwine {2}
|
||||
this.addAbility(new EntwineAbility("{2}"));
|
||||
}
|
||||
|
|
@ -91,7 +93,7 @@ public class InciteWar extends CardImpl {
|
|||
class InciteWarMustAttackEffect extends OneShotEffect {
|
||||
|
||||
public InciteWarMustAttackEffect() {
|
||||
super(Outcome.Detriment);
|
||||
super(Outcome.Detriment);
|
||||
staticText = "Creatures target player control attack this turn if able";
|
||||
}
|
||||
|
||||
|
|
@ -116,4 +118,4 @@ class InciteWarMustAttackEffect extends OneShotEffect {
|
|||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,66 +1,66 @@
|
|||
/*
|
||||
* 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;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.BeginningOfUpkeepTriggeredAbility;
|
||||
import mage.abilities.effects.common.CreateTokenEffect;
|
||||
import mage.abilities.effects.common.LoseLifeSourceControllerEffect;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Rarity;
|
||||
import mage.constants.TargetController;
|
||||
import mage.game.permanent.token.FaerieRogueToken;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Loki
|
||||
*/
|
||||
public class Bitterblossom extends CardImpl {
|
||||
|
||||
public Bitterblossom(UUID ownerId) {
|
||||
super(ownerId, 58, "Bitterblossom", Rarity.RARE, new CardType[]{CardType.TRIBAL, CardType.ENCHANTMENT}, "{1}{B}");
|
||||
this.expansionSetCode = "MOR";
|
||||
this.subtype.add("Faerie");
|
||||
|
||||
// At the beginning of your upkeep, you lose 1 life and put a 1/1 black Faerie Rogue creature token with flying onto the battlefield.
|
||||
Ability ability = new BeginningOfUpkeepTriggeredAbility(new LoseLifeSourceControllerEffect(1), TargetController.YOU, false);
|
||||
ability.addEffect(new CreateTokenEffect(new FaerieRogueToken(), 1));
|
||||
this.addAbility(ability);
|
||||
}
|
||||
|
||||
public Bitterblossom(final Bitterblossom card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Bitterblossom copy() {
|
||||
return new Bitterblossom(this);
|
||||
}
|
||||
}
|
||||
/*
|
||||
* 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;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.BeginningOfUpkeepTriggeredAbility;
|
||||
import mage.abilities.effects.common.CreateTokenEffect;
|
||||
import mage.abilities.effects.common.LoseLifeSourceControllerEffect;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Rarity;
|
||||
import mage.constants.TargetController;
|
||||
import mage.game.permanent.token.FaerieRogueToken;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Loki
|
||||
*/
|
||||
public class Bitterblossom extends CardImpl {
|
||||
|
||||
public Bitterblossom(UUID ownerId) {
|
||||
super(ownerId, 58, "Bitterblossom", Rarity.RARE, new CardType[]{CardType.TRIBAL, CardType.ENCHANTMENT}, "{1}{B}");
|
||||
this.expansionSetCode = "MOR";
|
||||
this.subtype.add("Faerie");
|
||||
|
||||
// At the beginning of your upkeep, you lose 1 life and put a 1/1 black Faerie Rogue creature token with flying onto the battlefield.
|
||||
Ability ability = new BeginningOfUpkeepTriggeredAbility(new LoseLifeSourceControllerEffect(1), TargetController.YOU, false);
|
||||
ability.addEffect(new CreateTokenEffect(new FaerieRogueToken(), 1));
|
||||
this.addAbility(ability);
|
||||
}
|
||||
|
||||
public Bitterblossom(final Bitterblossom card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Bitterblossom copy() {
|
||||
return new Bitterblossom(this);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -31,7 +31,7 @@ import java.util.UUID;
|
|||
import mage.MageInt;
|
||||
import mage.MageObject;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.SpellCastAllTriggeredAbility;
|
||||
import mage.abilities.common.SpellCastControllerTriggeredAbility;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.abilities.keyword.SoulshiftAbility;
|
||||
import mage.cards.Card;
|
||||
|
|
@ -61,7 +61,7 @@ public class ElderPineOfJukai extends CardImpl {
|
|||
this.toughness = new MageInt(1);
|
||||
|
||||
// Whenever you cast a Spirit or Arcane spell, reveal the top three cards of your library. Put all land cards revealed this way into your hand and the rest on the bottom of your library in any order.
|
||||
this.addAbility(new SpellCastAllTriggeredAbility(new ElderPineOfJukaiEffect(), new FilterSpiritOrArcaneCard(), false));
|
||||
this.addAbility(new SpellCastControllerTriggeredAbility(new ElderPineOfJukaiEffect(), new FilterSpiritOrArcaneCard(), false));
|
||||
|
||||
// Soulshift 2
|
||||
this.addAbility(new SoulshiftAbility(2));
|
||||
|
|
|
|||
|
|
@ -28,22 +28,22 @@
|
|||
package mage.sets.shardsofalara;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
import mage.constants.*;
|
||||
import mage.MageInt;
|
||||
import mage.ObjectColor;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.BeginningOfUpkeepTriggeredAbility;
|
||||
import mage.abilities.common.SimpleStaticAbility;
|
||||
import mage.abilities.effects.RequirementEffect;
|
||||
import mage.abilities.effects.common.CreateTokenEffect;
|
||||
import mage.abilities.effects.common.combat.AttacksIfAbleAllEffect;
|
||||
import mage.abilities.keyword.HasteAbility;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Duration;
|
||||
import mage.constants.Rarity;
|
||||
import mage.constants.TargetController;
|
||||
import mage.constants.Zone;
|
||||
import mage.filter.common.FilterCreaturePermanent;
|
||||
import mage.filter.predicate.mageobject.SubtypePredicate;
|
||||
import mage.game.Game;
|
||||
import mage.game.permanent.Permanent;
|
||||
import mage.game.permanent.token.Token;
|
||||
import mage.watchers.common.AttackedThisTurnWatcher;
|
||||
|
||||
/**
|
||||
*
|
||||
|
|
@ -51,15 +51,21 @@ import mage.game.permanent.token.Token;
|
|||
*/
|
||||
public class GoblinAssault extends CardImpl {
|
||||
|
||||
private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("Goblin creatures");
|
||||
|
||||
static {
|
||||
filter.add(new SubtypePredicate("Goblin"));
|
||||
}
|
||||
|
||||
public GoblinAssault(UUID ownerId) {
|
||||
super(ownerId, 101, "Goblin Assault", Rarity.RARE, new CardType[]{CardType.ENCHANTMENT}, "{2}{R}");
|
||||
this.expansionSetCode = "ALA";
|
||||
|
||||
|
||||
// At the beginning of your upkeep, put a 1/1 red Goblin creature token with haste onto the battlefield.
|
||||
this.addAbility(new BeginningOfUpkeepTriggeredAbility(new CreateTokenEffect(new GoblinAssaultToken()), TargetController.YOU, false));
|
||||
|
||||
// Goblin creatures attack each turn if able.
|
||||
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GoblinAssaultEffect()));
|
||||
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new AttacksIfAbleAllEffect(filter, Duration.WhileOnBattlefield)), new AttackedThisTurnWatcher());
|
||||
}
|
||||
|
||||
public GoblinAssault(final GoblinAssault card) {
|
||||
|
|
@ -72,48 +78,6 @@ public class GoblinAssault extends CardImpl {
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
class GoblinAssaultEffect extends RequirementEffect {
|
||||
|
||||
private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("Goblin creatures");
|
||||
static {
|
||||
filter.add(new SubtypePredicate("Goblin"));
|
||||
}
|
||||
|
||||
public GoblinAssaultEffect() {
|
||||
super(Duration.WhileOnBattlefield);
|
||||
staticText = "Goblin creatures attack each turn if able";
|
||||
}
|
||||
|
||||
public GoblinAssaultEffect(final GoblinAssaultEffect effect) {
|
||||
super(effect);
|
||||
}
|
||||
|
||||
@Override
|
||||
public GoblinAssaultEffect copy() {
|
||||
return new GoblinAssaultEffect(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean applies(Permanent permanent, Ability source, Game game) {
|
||||
if (filter.match(permanent, source.getSourceId(), source.getControllerId(), game)) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean mustAttack(Game game) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean mustBlock(Game game) {
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
class GoblinAssaultToken extends Token {
|
||||
|
||||
public GoblinAssaultToken() {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue