Merge remote-tracking branch 'refs/remotes/magefree/master'

This commit is contained in:
Justin Herlehy 2016-11-19 15:22:19 -08:00
commit 41c5085a1b
67 changed files with 2176 additions and 504 deletions

View file

@ -564,7 +564,6 @@ public class DragCardGrid extends JPanel implements DragCardSource, DragCardTarg
artifactCounter,
enchantmentCounter,
instantCounter,
sorceryCounter,
planeswalkerCounter,
sorceryCounter,
tribalCounter
@ -614,6 +613,7 @@ public class DragCardGrid extends JPanel implements DragCardSource, DragCardTarg
JPopupMenu selectByPopup;
JCheckBox separateCreaturesCb;
JTextField searchByTextField;
JToggleButton multiplesButton;
JSlider cardSizeSlider;
JLabel cardSizeSliderLabel;
@ -953,8 +953,20 @@ public class DragCardGrid extends JPanel implements DragCardSource, DragCardTarg
ButtonGroup selectByTypeModeGroup = new ButtonGroup();
for (final CardType cardType : CardType.values()) {
JToggleButton button = new JToggleButton(cardType.toString());
if (cardType == cardType.CONSPIRACY) {
multiplesButton = new JToggleButton("Multiples");
selectByTypeButtons.put(cardType, multiplesButton);
selectByTypeMode.add(multiplesButton);
selectByTypeModeGroup.add(multiplesButton);
multiplesButton.addActionListener(e -> {
multiplesButton.setSelected(!multiplesButton.isSelected());
reselectBy();
});
continue;
}
JToggleButton button = new JToggleButton(cardType.toString());
selectByTypeButtons.put(cardType, button);
selectByTypeMode.add(button);
selectByTypeModeGroup.add(button);
@ -1233,6 +1245,29 @@ public class DragCardGrid extends JPanel implements DragCardSource, DragCardTarg
AbstractButton button = selectByTypeButtons.get(cardType);
if (button != null) {
if (button.isSelected()) {
// Special case - "Multiples" (CONSPIRACY type)
if (cardType == CardType.CONSPIRACY) {
HashMap<String, CardView> cardNames = new HashMap<>();
for (ArrayList<ArrayList<CardView>> gridRow : cardGrid) {
for (ArrayList<CardView> stack : gridRow) {
for (CardView card : stack) {
if (cardNames.get(card.getName()) == null) {
cardNames.put(card.getName(), card);
} else {
card.setSelected(true);
cardViews.get(card.getId()).update(card);
CardView origCard = cardNames.get(card.getName());
origCard.setSelected(true);
cardViews.get(origCard.getId()).update(origCard);
}
}
}
}
continue;
}
for (ArrayList<ArrayList<CardView>> gridRow : cardGrid) {
for (ArrayList<CardView> stack : gridRow) {
for (CardView card : stack) {
@ -1591,6 +1626,10 @@ public class DragCardGrid extends JPanel implements DragCardSource, DragCardTarg
AbstractButton button = selectByTypeButtons.get(cardType);
String text = cardType.toString();
int numCards = getCount(cardType);
if (cardType == cardType.CONSPIRACY) {
continue;
}
if (numCards > 0) {
button.setForeground(Color.BLACK);
text = text + " - " + numCards;

View file

@ -32,11 +32,12 @@ import javax.swing.JComboBox;
/**
* A custom combo box with its own renderer and editor.
*
* @author wwww.codejava.net
*
*/
public class CountryComboBox extends JComboBox {
private final DefaultComboBoxModel model;
public static String[][] countryList = {
@ -60,6 +61,7 @@ public class CountryComboBox extends JComboBox {
{"Bahrain", "bh"},
{"Bangladesh", "bd"},
{"Barbados", "bb"},
{"Basque", "bq"},
{"Belarus", "by"},
{"Belgium", "be"},
{"Belize", "bz"},
@ -285,9 +287,8 @@ public class CountryComboBox extends JComboBox {
{"Western Sahara", "eh"},
{"Yemen", "ye"},
{"Zambia", "zm"},
{"Zimbabwe", "zw"},
};
{"Zimbabwe", "zw"},};
@SuppressWarnings("unchecked")
public CountryComboBox() {
model = new DefaultComboBoxModel();
@ -296,12 +297,12 @@ public class CountryComboBox extends JComboBox {
setEditor(new CountryItemEditor());
addItems(countryList);
}
/**
* Add an array items to this combo box.
* Each item is an array of two String elements:
* - first element is country name.
* - second element is path of an image file for country flag.
* Add an array items to this combo box. Each item is an array of two String
* elements: - first element is country name. - second element is path of an
* image file for country flag.
*
* @param items
*/
@SuppressWarnings("unchecked")
@ -315,6 +316,5 @@ public class CountryComboBox extends JComboBox {
public Object getSelectedItem() {
return super.getSelectedItem(); //To change body of generated methods, choose Tools | Templates.
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 441 B

View file

@ -912,10 +912,7 @@ public class HumanPlayer extends PlayerImpl {
FilterCreatureForCombat filter = filterCreatureForCombat.copy();
filter.add(new ControllerIdPredicate(attackingPlayerId));
while (!abort) {
if (passedAllTurns || passedUntilEndStepBeforeMyTurn
|| (!getUserData().getUserSkipPrioritySteps().isStopOnDeclareAttackersDuringSkipAction() && (passedTurn || passedTurnSkipStack || passedUntilEndOfTurn || passedUntilNextMain))) {
return;
}
Map<String, Serializable> options = new HashMap<>();
List<UUID> possibleAttackers = new ArrayList<>();
@ -927,6 +924,12 @@ public class HumanPlayer extends PlayerImpl {
options.put(Constants.Option.POSSIBLE_ATTACKERS, (Serializable) possibleAttackers);
if (possibleAttackers.size() > 0) {
options.put(Constants.Option.SPECIAL_BUTTON, (Serializable) "All attack");
if (getUserData().getUserSkipPrioritySteps().isStopOnDeclareAttackersDuringSkipAction()) {
resetPlayerPassedActions();
}
} else if (passedAllTurns || passedUntilEndStepBeforeMyTurn
|| (!getUserData().getUserSkipPrioritySteps().isStopOnDeclareAttackersDuringSkipAction() && (passedTurn || passedTurnSkipStack || passedUntilEndOfTurn || passedUntilNextMain))) {
return;
}
game.fireSelectEvent(playerId, "Select attackers", options);
@ -1056,7 +1059,14 @@ public class HumanPlayer extends PlayerImpl {
}
}
if (chooseTarget(Outcome.Damage, target, null, game)) {
declareAttacker(attackerId, response.getUUID(), game, true);
UUID defenderId = response.getUUID();
for (Player player : game.getPlayers().values()) {
if (player.getId().equals(response.getUUID())) {
defenderId = player.getId(); // get the correct player object
break;
}
}
declareAttacker(attackerId, defenderId, game, true);
return true;
}
}

View file

@ -107,7 +107,7 @@ public class ChatManager {
}
private boolean containsSwearing(String message) {
if (message != null && message.toLowerCase().matches("^.*(anal|asshole|balls|bastard|bitch|blowjob|cock|crap|cunt|damn|dick|douche|fag|fuck|idiot|moron|piss|prick|pussy|rape|rapist|sex|screw you|shit|slut|vagina).*$")) {
if (message != null && message.toLowerCase().matches("^.*(anal|asshole|balls|bastard|bitch|blowjob|cock|crap|cunt|cum|damn|dick|dildo|douche|fag|fuck|idiot|moron|piss|prick|pussy|rape|rapist|sex|screw|shit|slut|vagina).*$")) {
return true;
}
return false;

View file

@ -0,0 +1,127 @@
/*
* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* The views and conclusions contained in the software and documentation are those of the
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of BetaSteward_at_googlemail.com.
*/
package mage.cards.c;
import java.util.UUID;
import mage.ObjectColor;
import mage.abilities.Ability;
import mage.abilities.TriggeredAbility;
import mage.abilities.common.BeginningOfUpkeepTriggeredAbility;
import mage.abilities.condition.common.PermanentsOnTheBattlefieldCondition;
import mage.abilities.decorator.ConditionalTriggeredAbility;
import mage.abilities.effects.OneShotEffect;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.Outcome;
import mage.constants.TargetController;
import mage.constants.Zone;
import mage.filter.common.FilterControlledPermanent;
import mage.filter.predicate.Predicates;
import mage.filter.predicate.mageobject.ColorPredicate;
import mage.game.Game;
import mage.game.permanent.Permanent;
import mage.players.Player;
/**
*
* @author Pete Rossi
*/
public class CetaSanctuary extends CardImpl {
private static final FilterControlledPermanent filter = new FilterControlledPermanent("a red or green permanent");
static {
filter.add(Predicates.or(new ColorPredicate(ObjectColor.RED), new ColorPredicate(ObjectColor.GREEN)));
}
public CetaSanctuary(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{2}{U}");
// At the beginning of your upkeep, if you control a red or green permanent, draw a card, then discard a card. If you control a red permanent and a green permanent, instead draw two cards, then discard a card.
TriggeredAbility ability = new BeginningOfUpkeepTriggeredAbility(Zone.BATTLEFIELD, new CetaSanctuaryEffect(), TargetController.YOU, true);
this.addAbility(new ConditionalTriggeredAbility(ability, new PermanentsOnTheBattlefieldCondition(filter),
"At the beginning of your upkeep, if you control a red or green permanent, draw a card, then discard a card. If you control a red permanent and a green permanent, instead draw two cards, then discard a card."));
}
public CetaSanctuary(final CetaSanctuary card) {
super(card);
}
@Override
public CetaSanctuary copy() {
return new CetaSanctuary(this);
}
}
class CetaSanctuaryEffect extends OneShotEffect {
public CetaSanctuaryEffect() {
super(Outcome.DrawCard);
}
public CetaSanctuaryEffect(final CetaSanctuaryEffect effect) {
super(effect);
}
@Override
public boolean apply(Game game, Ability source) {
Player controller = game.getPlayer(source.getControllerId());
if (controller != null) {
int red = 0;
int green = 0;
for (Permanent permanent : game.getBattlefield().getAllActivePermanents(controller.getId())) {
ObjectColor color = permanent.getColor(game);
if (color.isRed()) {
red = 1;
}
if (color.isGreen()) {
green = 1;
}
if (red == 1 && green == 1) {
break;
}
}
if (red != 0 || green != 0) {
controller.drawCards((red + green), game);
controller.discard(1, false, source, game);
return true;
}
}
return false;
}
@Override
public CetaSanctuaryEffect copy() {
return new CetaSanctuaryEffect(this);
}
}

View file

@ -0,0 +1,95 @@
/*
* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* The views and conclusions contained in the software and documentation are those of the
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of BetaSteward_at_googlemail.com.
*/
package mage.cards.c;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.common.SimpleActivatedAbility;
import mage.abilities.common.SpellCastOpponentTriggeredAbility;
import mage.abilities.costs.common.RemoveCountersSourceCost;
import mage.abilities.effects.common.continuous.BecomesCreatureSourceEffect;
import mage.abilities.effects.common.counter.AddCountersSourceEffect;
import mage.abilities.keyword.TrampleAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.Duration;
import mage.constants.Zone;
import mage.counters.Counter;
import mage.counters.CounterType;
import mage.filter.FilterSpell;
import mage.filter.predicate.Predicates;
import mage.filter.predicate.mageobject.CardTypePredicate;
import mage.game.permanent.token.Token;
/**
*
* @author Pete Rossi
*/
public class ChimericEgg extends CardImpl {
private final static FilterSpell nonArtifactFilter = new FilterSpell("a nonartifact spell");
static {
nonArtifactFilter.add(Predicates.not(new CardTypePredicate(CardType.ARTIFACT)));
}
public ChimericEgg(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.ARTIFACT}, "{3}");
// Whenever an opponent casts a nonartifact spell, put a charge counter on Chimeric Egg.
this.addAbility(new SpellCastOpponentTriggeredAbility(new AddCountersSourceEffect(CounterType.CHARGE.createInstance()), nonArtifactFilter, false));
// Remove three charge counters from Chimeric Egg: Chimeric Egg becomes a 6/6 Construct artifact creature with trample until end of turn.
this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new BecomesCreatureSourceEffect
(new ChimericEggToken(), "", Duration.EndOfTurn), new RemoveCountersSourceCost(new Counter(CounterType.CHARGE.getName(), 3))));
}
public ChimericEgg(final ChimericEgg card) {
super(card);
}
@Override
public ChimericEgg copy() {
return new ChimericEgg(this);
}
private class ChimericEggToken extends Token {
ChimericEggToken() {
super("", "6/6 Construct artifact creature with trample");
cardType.add(CardType.ARTIFACT);
cardType.add(CardType.CREATURE);
this.subtype.add("Construct");
power = new MageInt(6);
toughness = new MageInt(6);
this.addAbility(TrampleAbility.getInstance());
}
}
}

View file

@ -28,6 +28,7 @@
package mage.cards.d;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
import java.util.UUID;
@ -99,7 +100,7 @@ class DivergentTransformationsEffect extends OneShotEffect {
MageObject sourceObject = source.getSourceObject(game);
if (controller != null && sourceObject != null) {
List<UUID> controllerList = new ArrayList<>();
Cards toExile = new CardsImpl();
Set<Card> toExile = new HashSet<>();
for (UUID targetId : getTargetPointer().getTargets(game, source)) {
Permanent permanent = game.getPermanent(targetId);
if (permanent != null) {

View file

@ -0,0 +1,134 @@
/*
* 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.cards.g;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.SimpleActivatedAbility;
import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.condition.common.AttackingCondition;
import mage.abilities.costs.common.TapSourceCost;
import mage.abilities.decorator.ConditionalContinuousEffect;
import mage.abilities.dynamicvalue.DynamicValue;
import mage.abilities.dynamicvalue.common.PermanentsOnBattlefieldCount;
import mage.abilities.effects.Effect;
import mage.abilities.effects.common.continuous.BecomesBasicLandTargetEffect;
import mage.abilities.effects.common.continuous.SetPowerToughnessSourceEffect;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.Duration;
import mage.constants.Zone;
import mage.filter.common.FilterControlledPermanent;
import mage.filter.common.FilterLandPermanent;
import mage.filter.predicate.mageobject.SubtypePredicate;
import mage.game.Game;
import mage.game.combat.CombatGroup;
import mage.game.permanent.Permanent;
import mage.target.common.TargetLandPermanent;
/**
*
* @author anonymous
*/
public class GaeasLiege extends CardImpl {
final static FilterControlledPermanent filterLands = new FilterControlledPermanent("Forests you control");
static {
filterLands.add(new SubtypePredicate("Forest"));
}
public GaeasLiege(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{3}{G}{G}{G}");
this.subtype.add("Avatar");
this.power = new MageInt(0);
this.toughness = new MageInt(0);
// As long as Gaea's Liege isn't attacking, its power and toughness are each equal to the number of Forests you control. As long as Gaea's Liege is attacking, its power and toughness are each equal to the number of Forests defending player controls.
this.addAbility(new SimpleStaticAbility(Zone.ALL, new ConditionalContinuousEffect(
new SetPowerToughnessSourceEffect(new DefendersForestCount(), Duration.EndOfCombat),
new SetPowerToughnessSourceEffect(new PermanentsOnBattlefieldCount(filterLands), Duration.EndOfGame),
AttackingCondition.getInstance(),
"As long as {this} isn't attacking, its power and toughness are each equal to the number of Forests you control. As long as {this} is attacking, its power and toughness are each equal to the number of Forests defending player controls.")));
// {tap}: Target land becomes a Forest until Gaea's Liege leaves the battlefield.
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new BecomesBasicLandTargetEffect(Duration.WhileOnBattlefield, "Forest"), new TapSourceCost());
ability.addTarget(new TargetLandPermanent());
this.addAbility(ability);
}
public GaeasLiege(final GaeasLiege card) {
super(card);
}
@Override
public GaeasLiege copy() {
return new GaeasLiege(this);
}
}
class DefendersForestCount implements DynamicValue {
@Override
public int calculate(Game game, Ability sourceAbility, Effect effect) {
for (CombatGroup group :game.getCombat().getGroups()) {
if (group.getAttackers().contains(sourceAbility.getSourceId())) {
UUID defenderId = group.getDefenderId();
if (group.isDefenderIsPlaneswalker()) {
Permanent permanent = game.getPermanent(defenderId);
if (permanent != null) {
defenderId = permanent.getControllerId();
}
}
FilterLandPermanent filter = new FilterLandPermanent("forest");
filter.add(new SubtypePredicate("Forest"));
return game.getBattlefield().countAll(filter, defenderId, game);
}
}
return 0;
}
@Override
public DynamicValue copy() {
return new DefendersForestCount();
}
@Override
public String toString() {
return "X";
}
@Override
public String getMessage() {
return "the number of Forests defending player controls";
}
}

View file

@ -30,18 +30,28 @@ package mage.cards.g;
import java.util.UUID;
import mage.Mana;
import mage.abilities.Ability;
import mage.abilities.common.GemstoneCavernsAbility;
import mage.abilities.OpeningHandAction;
import mage.abilities.StaticAbility;
import mage.abilities.condition.common.SourceHasCounterCondition;
import mage.abilities.costs.Cost;
import mage.abilities.costs.common.ExileFromHandCost;
import mage.abilities.costs.common.TapSourceCost;
import mage.abilities.decorator.ConditionalManaEffect;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.AddManaOfAnyColorEffect;
import mage.abilities.effects.common.BasicManaEffect;
import mage.abilities.mana.ConditionalManaAbility;
import mage.cards.Card;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.Outcome;
import mage.constants.Zone;
import mage.counters.CounterType;
import mage.game.Game;
import mage.game.permanent.Permanent;
import mage.players.Player;
import mage.target.common.TargetCardInHand;
/**
*
@ -50,20 +60,20 @@ import mage.counters.CounterType;
public class GemstoneCaverns extends CardImpl {
public GemstoneCaverns(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.LAND},"");
super(ownerId, setInfo, new CardType[]{CardType.LAND}, "");
this.supertype.add("Legendary");
// If Gemstone Caverns is in your opening hand and you're not playing first, you may begin the game with Gemstone Caverns on the battlefield with a luck counter on it. If you do, exile a card from your hand.
this.addAbility(new GemstoneCavernsAbility());
// {tap}: Add {C} to your mana pool. If Gemstone Caverns has a luck counter on it, instead add one mana of any color to your mana pool.
Ability ability = new ConditionalManaAbility(Zone.BATTLEFIELD,
new ConditionalManaEffect(
new AddManaOfAnyColorEffect(),
new BasicManaEffect(Mana.ColorlessMana(1)),
new SourceHasCounterCondition(CounterType.LUCK),
"Add {C} to your mana pool. If {this} has a luck counter on it, instead add one mana of any color to your mana pool."),
new TapSourceCost());
new AddManaOfAnyColorEffect(),
new BasicManaEffect(Mana.ColorlessMana(1)),
new SourceHasCounterCondition(CounterType.LUCK),
"Add {C} to your mana pool. If {this} has a luck counter on it, instead add one mana of any color to your mana pool."),
new TapSourceCost());
this.addAbility(ability);
}
@ -76,3 +86,78 @@ public class GemstoneCaverns extends CardImpl {
return new GemstoneCaverns(this);
}
}
class GemstoneCavernsAbility extends StaticAbility implements OpeningHandAction {
public GemstoneCavernsAbility() {
super(Zone.HAND, new GemstoneCavernsEffect());
}
public GemstoneCavernsAbility(final GemstoneCavernsAbility ability) {
super(ability);
}
@Override
public GemstoneCavernsAbility copy() {
return new GemstoneCavernsAbility(this);
}
@Override
public String getRule() {
return "If {this} is in your opening hand and you're not playing first, you may begin the game with {this} on the battlefield with a luck counter on it. If you do, exile a card from your hand.";
}
@Override
public boolean askUseOpeningHandAction(Card card, Player player, Game game) {
return player.chooseUse(Outcome.PutCardInPlay, "Do you wish to put " + card.getIdName() + " into play?", this, game);
}
@Override
public boolean isOpeningHandActionAllowed(Card card, Player player, Game game) {
return !player.getId().equals(game.getStartingPlayerId());
}
@Override
public void doOpeningHandAction(Card card, Player player, Game game) {
this.resolve(game);
}
}
class GemstoneCavernsEffect extends OneShotEffect {
GemstoneCavernsEffect() {
super(Outcome.PutCardInPlay);
this.staticText = "you may begin the game with {this} on the battlefield with a luck counter on it. If you do, exile a card from your hand";
}
GemstoneCavernsEffect(final GemstoneCavernsEffect effect) {
super(effect);
}
@Override
public GemstoneCavernsEffect copy() {
return new GemstoneCavernsEffect(this);
}
@Override
public boolean apply(Game game, Ability source) {
Player player = game.getPlayer(source.getControllerId());
if (player != null) {
Card card = game.getCard(source.getSourceId());
if (card != null) {
if (card.putOntoBattlefield(game, Zone.HAND, source.getSourceId(), source.getControllerId())) {
Permanent permanent = game.getPermanent(card.getId());
if (permanent != null) {
permanent.addCounters(CounterType.LUCK.createInstance(), game);
Cost cost = new ExileFromHandCost(new TargetCardInHand());
if (cost.canPay(source, source.getSourceId(), source.getControllerId(), game)) {
cost.pay(source, game, source.getSourceId(), source.getControllerId(), true, null);
}
}
}
}
}
return false;
}
}

View file

@ -55,7 +55,7 @@ import mage.target.targetpointer.FixedTarget;
public class GiftOfImmortality extends CardImpl {
public GiftOfImmortality(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.ENCHANTMENT},"{2}{W}");
super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{2}{W}");
this.subtype.add("Aura");
// Enchant creature
@ -99,25 +99,27 @@ class GiftOfImmortalityEffect extends OneShotEffect {
@Override
public boolean apply(Game game, Ability source) {
Permanent enchantment = (Permanent) game.getLastKnownInformation(source.getSourceId(), Zone.BATTLEFIELD);
if (enchantment != null && enchantment.getAttachedTo() != null) {
Player controller = game.getPlayer(source.getControllerId());
if (controller != null && enchantment != null && enchantment.getAttachedTo() != null) {
Permanent enchanted = (Permanent) game.getLastKnownInformation(enchantment.getAttachedTo(), Zone.BATTLEFIELD);
Card card = game.getCard(enchantment.getAttachedTo());
if (card != null) {
Zone currentZone = game.getState().getZone(card.getId());
if (card.putOntoBattlefield(game, currentZone, source.getSourceId(), card.getOwnerId())) {
Permanent permanent = game.getPermanent(card.getId());
if (permanent != null) {
//create delayed triggered ability
Effect effect = new GiftOfImmortalityReturnEnchantmentEffect();
effect.setTargetPointer(new FixedTarget(permanent, game));
game.addDelayedTriggeredAbility(new AtTheBeginOfNextEndStepDelayedTriggeredAbility(effect), source);
}
if (card != null && enchanted != null && card.getZoneChangeCounter(game) == enchanted.getZoneChangeCounter(game) + 1) {
controller.moveCards(card, Zone.BATTLEFIELD, source, game, false, false, true, null);
Permanent permanent = game.getPermanent(card.getId());
if (permanent != null) {
//create delayed triggered ability
Effect effect = new GiftOfImmortalityReturnEnchantmentEffect();
effect.setTargetPointer(new FixedTarget(permanent, game));
game.addDelayedTriggeredAbility(new AtTheBeginOfNextEndStepDelayedTriggeredAbility(effect), source);
}
return true;
}
return true;
}
return false;
}
}
class GiftOfImmortalityReturnEnchantmentEffect extends OneShotEffect {

View file

@ -36,18 +36,18 @@ import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.Zone;
import mage.filter.common.FilterControlledCreaturePermanent;
import mage.filter.common.FilterControlledPermanent;
import mage.filter.predicate.Predicates;
import mage.filter.predicate.mageobject.SubtypePredicate;
import mage.filter.predicate.permanent.TappedPredicate;
import mage.target.common.TargetControlledCreaturePermanent;
import mage.target.common.TargetControlledPermanent;
/**
* @author Loki
*/
public class HeritageDruid extends CardImpl {
private static final FilterControlledCreaturePermanent filter = new FilterControlledCreaturePermanent("untapped Elves you control");
private static final FilterControlledPermanent filter = new FilterControlledPermanent("untapped Elves you control");
static {
filter.add(Predicates.not(new TappedPredicate()));
@ -63,7 +63,7 @@ public class HeritageDruid extends CardImpl {
this.toughness = new MageInt(1);
// Tap three untapped Elves you control: Add {G}{G}{G} to your mana pool.
this.addAbility(new SimpleManaAbility(Zone.BATTLEFIELD, Mana.GreenMana(3), new TapTargetCost(new TargetControlledCreaturePermanent(3, 3, filter, true))));
this.addAbility(new SimpleManaAbility(Zone.BATTLEFIELD, Mana.GreenMana(3), new TapTargetCost(new TargetControlledPermanent(3, 3, filter, true))));
}
public HeritageDruid(final HeritageDruid card) {

View file

@ -0,0 +1,106 @@
/*
* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* The views and conclusions contained in the software and documentation are those of the
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of BetaSteward_at_googlemail.com.
*/
package mage.cards.h;
import java.util.UUID;
import mage.MageObject;
import mage.abilities.Ability;
import mage.abilities.SpellAbility;
import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.effects.common.cost.CostModificationEffectImpl;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.CostModificationType;
import mage.constants.Duration;
import mage.constants.Outcome;
import mage.constants.Zone;
import mage.filter.common.FilterArtifactPermanent;
import mage.game.Game;
import mage.util.CardUtil;
/**
*
* @author Pete Rossi
*/
public class HumOfTheRadix extends CardImpl {
public HumOfTheRadix(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{2}{G}{G}");
// Each artifact spell costs {1} more to cast for each artifact its controller controls.
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new HumOfTheRadixCostIncreaseEffect()));
}
public HumOfTheRadix(final HumOfTheRadix card) {
super(card);
}
@Override
public HumOfTheRadix copy() {
return new HumOfTheRadix(this);
}
}
class HumOfTheRadixCostIncreaseEffect extends CostModificationEffectImpl {
HumOfTheRadixCostIncreaseEffect() {
super(Duration.WhileOnBattlefield, Outcome.Detriment, CostModificationType.INCREASE_COST);
staticText = "each artifact spell costs {1} more to cast for each artifact its controller controls";
}
HumOfTheRadixCostIncreaseEffect(final HumOfTheRadixCostIncreaseEffect effect) {
super(effect);
}
@Override
public boolean apply(Game game, Ability source, Ability abilityToModify) {
int additionalCost = game.getBattlefield().getAllActivePermanents(new FilterArtifactPermanent(), abilityToModify.getControllerId(), game).size();
if (additionalCost > 0) {
CardUtil.increaseCost(abilityToModify, additionalCost);
}
return true;
}
@Override
public boolean applies(Ability abilityToModify, Ability source, Game game) {
if (abilityToModify instanceof SpellAbility) {
MageObject sourceObject = abilityToModify.getSourceObject(game);
if (sourceObject != null && sourceObject.getCardType().contains(CardType.ARTIFACT)) {
return true;
}
}
return false;
}
@Override
public HumOfTheRadixCostIncreaseEffect copy() {
return new HumOfTheRadixCostIncreaseEffect(this);
}
}

View file

@ -0,0 +1,77 @@
/*
* 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.cards.j;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.condition.common.IsPhaseCondition;
import mage.abilities.costs.mana.ManaCostsImpl;
import mage.abilities.decorator.ConditionalActivatedAbility;
import mage.abilities.effects.common.continuous.BecomesCreatureSourceEffect;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.Duration;
import mage.constants.TurnPhase;
import mage.constants.Zone;
import mage.game.permanent.token.Token;
/**
*
* @author anonymous
*/
public class JadeStatue extends CardImpl {
public JadeStatue(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.ARTIFACT}, "{4}");
// {2}: Jade Statue becomes a 3/6 Golem artifact creature until end of combat. Activate this ability only during combat.
this.addAbility(new ConditionalActivatedAbility(Zone.BATTLEFIELD, new BecomesCreatureSourceEffect (new JadeStatueToken(), "", Duration.EndOfCombat), new ManaCostsImpl("{2}"), new IsPhaseCondition(TurnPhase.COMBAT), "{this} becomes a 3/6 Golem artifact creature until end of combat. Activate this ability only during combat."));
}
public JadeStatue(final JadeStatue card) {
super(card);
}
@Override
public JadeStatue copy() {
return new JadeStatue(this);
}
private class JadeStatueToken extends Token {
JadeStatueToken() {
super("", "3/6 Golem artifact creature");
cardType.add(CardType.ARTIFACT);
cardType.add(CardType.CREATURE);
this.subtype.add("Golem");
power = new MageInt(3);
toughness = new MageInt(6);
}
}
}

View file

@ -0,0 +1,148 @@
/*
* 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.cards.j;
import java.util.HashSet;
import java.util.UUID;
import mage.MageInt;
import mage.ObjectColor;
import mage.abilities.Ability;
import mage.abilities.common.SimpleActivatedAbility;
import mage.abilities.costs.mana.ManaCostsImpl;
import mage.abilities.effects.ContinuousEffectImpl;
import mage.abilities.effects.common.continuous.GainAbilitySourceEffect;
import mage.abilities.keyword.DoubleStrikeAbility;
import mage.abilities.keyword.ProtectionAbility;
import mage.abilities.keyword.ShadowAbility;
import mage.abilities.keyword.VigilanceAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
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.SubLayer;
import mage.constants.Zone;
import mage.game.Game;
import mage.game.permanent.Permanent;
import mage.players.Player;
/**
*
* @author Styxo
*/
public class JodahsAvenger extends CardImpl {
public JodahsAvenger(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{5}{U}");
this.subtype.add("Shapeshifter");
this.power = new MageInt(4);
this.toughness = new MageInt(4);
// {0}: Until end of turn, Jodah's Avenger gets -1/-1 and gains your choice of double strike, protection from red, vigilance, or shadow.
this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new JodahsAvengerEffect(), new ManaCostsImpl("{0}")));
}
public JodahsAvenger(final JodahsAvenger card) {
super(card);
}
@Override
public JodahsAvenger copy() {
return new JodahsAvenger(this);
}
}
class JodahsAvengerEffect extends ContinuousEffectImpl {
private static final HashSet<String> choices = new HashSet<>();
private Ability gainedAbility;
static {
choices.add("Double strike");
choices.add("Protection from red");
choices.add("Vigilance");
choices.add("Shadow");
}
public JodahsAvengerEffect() {
super(Duration.EndOfTurn, Layer.PTChangingEffects_7, SubLayer.ModifyPT_7c, Outcome.AddAbility);
this.staticText = "Until end of turn, {this} gets -1/-1 and gains your choice of double strike, protection from red, vigilance, or shadow";
}
public JodahsAvengerEffect(final JodahsAvengerEffect effect) {
super(effect);
}
@Override
public JodahsAvengerEffect copy() {
return new JodahsAvengerEffect(this);
}
@Override
public void init(Ability source, Game game) {
super.init(source, game);
Player controller = game.getPlayer(source.getControllerId());
if (controller != null) {
Choice choice = new ChoiceImpl(true);
choice.setMessage("Choose one");
choice.setChoices(choices);
if (controller.choose(outcome, choice, game)) {
switch (choice.getChoice()) {
case "Double strike":
gainedAbility = DoubleStrikeAbility.getInstance();
break;
case "Vigilance":
gainedAbility = VigilanceAbility.getInstance();
break;
case "Shadow":
gainedAbility = ShadowAbility.getInstance();
break;
default:
gainedAbility = ProtectionAbility.from(ObjectColor.RED);
break;
}
}
}
}
@Override
public boolean apply(Game game, Ability source) {
Permanent sourceObject = game.getPermanent(source.getSourceId());
if (sourceObject != null) {
sourceObject.addPower(-1);
sourceObject.addToughness(-1);
game.addEffect(new GainAbilitySourceEffect(gainedAbility, Duration.EndOfTurn), source);
return true;
}
return false;
}
}

View file

@ -62,7 +62,7 @@ import mage.target.targetpointer.FixedTarget;
public class KaronaFalseGod extends CardImpl {
public KaronaFalseGod(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{1}{W}{U}{B}{R}{G}");
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{1}{W}{U}{B}{R}{G}");
this.supertype.add("Legendary");
this.subtype.add("Avatar");
@ -71,10 +71,10 @@ public class KaronaFalseGod extends CardImpl {
// Haste
this.addAbility(HasteAbility.getInstance());
// At the beginning of each player's upkeep, that player untaps Karona, False God and gains control of it.
this.addAbility(new BeginningOfUpkeepTriggeredAbility(Zone.BATTLEFIELD, new KaronaFalseGodUntapGetControlEffect(), TargetController.ANY, false, true));
// Whenever Karona attacks, creatures of the creature type of your choice get +3/+3 until end of turn.
this.addAbility(new AttacksTriggeredAbility(new KaronaFalseGodEffect(), false));
}
@ -93,7 +93,7 @@ class KaronaFalseGodUntapGetControlEffect extends OneShotEffect {
public KaronaFalseGodUntapGetControlEffect() {
super(Outcome.GainControl);
this.staticText = "that player untaps Karona, False God and gains control of it";
this.staticText = "that player untaps {this} and gains control of it";
}
public KaronaFalseGodUntapGetControlEffect(final KaronaFalseGodUntapGetControlEffect effect) {
@ -110,9 +110,23 @@ class KaronaFalseGodUntapGetControlEffect extends OneShotEffect {
Player controller = game.getPlayer(source.getControllerId());
MageObject sourceObject = source.getSourceObject(game);
Permanent sourcePermanent = game.getPermanent(source.getSourceId());
if (controller != null && sourceObject != null && sourceObject.equals(sourcePermanent)) {
Player newController = game.getPlayer(getTargetPointer().getFirst(game, source));
if (newController != null && controller != null && sourceObject != null && sourceObject.equals(sourcePermanent)) {
sourcePermanent.untap(game);
ContinuousEffect effect = new GainControlTargetEffect(Duration.Custom, true, getTargetPointer().getFirst(game, source));
game.informPlayers(newController.getLogName() + " untaps " + sourceObject.getIdName());
// remove old control effects of the same player
for (ContinuousEffect effect : game.getState().getContinuousEffects().getLayeredEffects(game)) {
if (effect instanceof GainControlTargetEffect) {
UUID checkId = (UUID) ((GainControlTargetEffect) effect).getValue("KaronaFalseGodSourceId");
UUID controllerId = (UUID) ((GainControlTargetEffect) effect).getValue("KaronaFalseGodControllerId");
if (source.getSourceId().equals(checkId) && newController.getId().equals(controllerId)) {
effect.discard();
}
}
}
ContinuousEffect effect = new GainControlTargetEffect(Duration.Custom, true, newController.getId());
effect.setValue("KaronaFalseGodSourceId", source.getSourceId());
effect.setValue("KaronaFalseGodControllerId", newController.getId());
effect.setTargetPointer(new FixedTarget(sourcePermanent.getId()));
effect.setText("and gains control of it");
game.addEffect(effect, source);
@ -123,21 +137,21 @@ class KaronaFalseGodUntapGetControlEffect extends OneShotEffect {
}
class KaronaFalseGodEffect extends OneShotEffect {
public KaronaFalseGodEffect() {
super(Outcome.BoostCreature);
this.staticText = "creatures of the creature type of your choice get +3/+3 until end of turn";
}
public KaronaFalseGodEffect(final KaronaFalseGodEffect effect) {
super(effect);
}
@Override
public KaronaFalseGodEffect copy() {
return new KaronaFalseGodEffect(this);
}
@Override
public boolean apply(Game game, Ability source) {
Player controller = game.getPlayer(source.getControllerId());
@ -156,7 +170,7 @@ class KaronaFalseGodEffect extends OneShotEffect {
game.informPlayers(controller.getLogName() + " has chosen " + typeChosen);
FilterCreaturePermanent filter = new FilterCreaturePermanent();
filter.add(new SubtypePredicate(typeChosen));
game.addEffect(new BoostAllEffect(3,3,Duration.EndOfTurn, filter, false), source);
game.addEffect(new BoostAllEffect(3, 3, Duration.EndOfTurn, filter, false), source);
}
return true;
}

View file

@ -0,0 +1,107 @@
/*
* 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.cards.l;
import java.util.UUID;
import mage.abilities.Ability;
import mage.abilities.common.DiesCreatureTriggeredAbility;
import mage.abilities.common.delayed.AtTheBeginOfNextEndStepDelayedTriggeredAbility;
import mage.abilities.condition.common.PermanentsOnTheBattlefieldCondition;
import mage.abilities.decorator.ConditionalTriggeredAbility;
import mage.abilities.effects.Effect;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.ReturnToBattlefieldUnderOwnerControlTargetEffect;
import mage.cards.Card;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.Outcome;
import mage.constants.TargetController;
import mage.constants.Zone;
import mage.filter.common.FilterCreaturePermanent;
import mage.game.Game;
import mage.target.targetpointer.FixedTarget;
/**
*
* @author HCrescent
*/
public class Lifeline extends CardImpl {
private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("creature");
public Lifeline(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.ARTIFACT}, "{5}");
// Whenever a creature dies, if another creature is on the battlefield, return the first card to the battlefield under its owner's control at the beginning of the next end step.
Ability ability = new ConditionalTriggeredAbility(
new DiesCreatureTriggeredAbility( Zone.BATTLEFIELD, new LifelineEffect(), false, filter, true),
new PermanentsOnTheBattlefieldCondition(filter, PermanentsOnTheBattlefieldCondition.CountType.MORE_THAN, 0, false),
"Whenever a creature dies, if another creature is on the battlefield, return the first card to the battlefield under its owner's control at the beginning of the next end step.");
this.addAbility(ability);
}
public Lifeline(final Lifeline card) {
super(card);
}
@Override
public Lifeline copy() {
return new Lifeline(this);
}
}
class LifelineEffect extends OneShotEffect {
public LifelineEffect() {
super(Outcome.PutCardInPlay);
this.staticText = "";
}
public LifelineEffect(final LifelineEffect effect) {
super(effect);
}
@Override
public LifelineEffect copy() {
return new LifelineEffect(this);
}
@Override
public boolean apply(Game game, Ability source) {
Card card = game.getCard(getTargetPointer().getFirst(game, source));
if (card != null) {
Effect effect = new ReturnToBattlefieldUnderOwnerControlTargetEffect();
effect.setTargetPointer(new FixedTarget(card.getId(), card.getZoneChangeCounter(game)));
effect.setText("return that card to the battlefield under it's owner's control at the beginning of the next end step");
game.addDelayedTriggeredAbility(new AtTheBeginOfNextEndStepDelayedTriggeredAbility(Zone.BATTLEFIELD, effect, TargetController.ANY), source);
return true;
}
return false;
}
}

View file

@ -1,4 +1,4 @@
/*
/*
* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are
@ -28,8 +28,6 @@
package mage.cards.m;
import java.util.UUID;
import mage.constants.*;
import mage.MageInt;
import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.dynamicvalue.common.PermanentsOnBattlefieldCount;
@ -37,6 +35,7 @@ import mage.abilities.effects.common.continuous.BoostControlledEffect;
import mage.abilities.effects.common.continuous.SetPowerToughnessSourceEffect;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.*;
import mage.filter.common.FilterControlledPermanent;
import mage.filter.common.FilterCreaturePermanent;
import mage.filter.predicate.mageobject.CardTypePredicate;
@ -58,13 +57,17 @@ public class MasterOfEtherium extends CardImpl {
}
public MasterOfEtherium(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.ARTIFACT,CardType.CREATURE},"{2}{U}");
super(ownerId, setInfo, new CardType[]{CardType.ARTIFACT, CardType.CREATURE}, "{2}{U}");
this.subtype.add("Vedalken");
this.subtype.add("Wizard");
this.power = new MageInt(0);
this.toughness = new MageInt(0);
// Master of Etherium's power and toughness are each equal to the number of artifacts you control.
this.addAbility(new SimpleStaticAbility(Zone.ALL, new SetPowerToughnessSourceEffect(new PermanentsOnBattlefieldCount(filterCounted), Duration.EndOfGame)));
// Other artifact creatures you control get +1/+1.
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostControlledEffect(1, 1, Duration.WhileOnBattlefield, filterBoosted, true)));
}

View file

@ -37,9 +37,9 @@ import mage.abilities.condition.common.SourceOnBattlefieldControlUnchangedCondit
import mage.abilities.costs.common.TapSourceCost;
import mage.abilities.decorator.ConditionalContinuousEffect;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.DestroyTargetEffect;
import mage.abilities.effects.common.DontUntapInControllersUntapStepSourceEffect;
import mage.abilities.effects.common.continuous.GainControlTargetEffect;
import mage.abilities.effects.common.DestroyTargetEffect;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
@ -62,7 +62,7 @@ import mage.target.targetpointer.FixedTarget;
public class MeriekeRiBerit extends CardImpl {
public MeriekeRiBerit(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{W}{U}{B}");
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{W}{U}{B}");
this.supertype.add("Legendary");
this.subtype.add("Human");
this.power = new MageInt(1);
@ -97,7 +97,7 @@ class MeriekeRiBeritCreateDelayedTriggerEffect extends OneShotEffect {
public MeriekeRiBeritCreateDelayedTriggerEffect() {
super(Outcome.Detriment);
this.staticText = "When {this} leaves the battlefield or becomes untapped, destroy that creature. It can't be regenerated.";
this.staticText = "When {this} leaves the battlefield or becomes untapped, destroy that creature. It can't be regenerated";
}
public MeriekeRiBeritCreateDelayedTriggerEffect(final MeriekeRiBeritCreateDelayedTriggerEffect effect) {
@ -114,12 +114,8 @@ class MeriekeRiBeritCreateDelayedTriggerEffect extends OneShotEffect {
Permanent controlledCreature = game.getPermanent(source.getFirstTarget());
if (controlledCreature != null) {
DelayedTriggeredAbility delayedAbility = new MeriekeRiBeritDelayedTriggeredAbility();
delayedAbility.getEffects().get(0).setTargetPointer(new FixedTarget(controlledCreature.getId()));
delayedAbility.setSourceId(source.getSourceId());
delayedAbility.setControllerId(source.getControllerId());
delayedAbility.setSourceObject(source.getSourceObject(game), game);
delayedAbility.init(game);
game.addDelayedTriggeredAbility(delayedAbility);
delayedAbility.getEffects().get(0).setTargetPointer(new FixedTarget(controlledCreature, game));
game.addDelayedTriggeredAbility(delayedAbility, source);
return true;
}
return false;
@ -129,7 +125,7 @@ class MeriekeRiBeritCreateDelayedTriggerEffect extends OneShotEffect {
class MeriekeRiBeritDelayedTriggeredAbility extends DelayedTriggeredAbility {
MeriekeRiBeritDelayedTriggeredAbility() {
super(new DestroyTargetEffect(true), Duration.EndOfGame, true);
super(new DestroyTargetEffect(true), Duration.Custom, true);
}
MeriekeRiBeritDelayedTriggeredAbility(MeriekeRiBeritDelayedTriggeredAbility ability) {
@ -142,9 +138,15 @@ class MeriekeRiBeritDelayedTriggeredAbility extends DelayedTriggeredAbility {
|| event.getType() == EventType.UNTAPPED;
}
@Override
public boolean isInactive(Game game) {
return getSourceObjectIfItStillExists(game) == null
&& game.getLastKnownInformation(getSourceId(), Zone.BATTLEFIELD, getSourceObjectZoneChangeCounter()) == null;
}
@Override
public boolean checkTrigger(GameEvent event, Game game) {
if (event.getSourceId() != null) {
if (event.getTargetId() != null) {
if (GameEvent.EventType.ZONE_CHANGE.equals(event.getType())
&& event.getTargetId().equals(getSourceId())) {
ZoneChangeEvent zEvent = (ZoneChangeEvent) event;

View file

@ -0,0 +1,63 @@
/*
* 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.cards.m;
import java.util.UUID;
import mage.abilities.Ability;
import mage.abilities.common.PutIntoGraveFromBattlefieldAllTriggeredAbility;
import mage.abilities.effects.common.PutOnLibraryTargetEffect;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.filter.common.FilterCreaturePermanent;
/**
*
* @author HCrescent
*/
public class Mortuary extends CardImpl {
private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("creature");
public Mortuary(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{3}{B}");
Ability ability = new PutIntoGraveFromBattlefieldAllTriggeredAbility(new PutOnLibraryTargetEffect(true, "put that card on top of your library."), false, filter, true, true);
// Whenever a creature is put into your graveyard from the battlefield, put that card on top of your library.
this.addAbility(ability);
}
public Mortuary(final Mortuary card) {
super(card);
}
@Override
public Mortuary copy() {
return new Mortuary(this);
}
}

View file

@ -28,8 +28,6 @@
package mage.cards.m;
import java.util.UUID;
import mage.constants.CardType;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.SpellCastControllerTriggeredAbility;
@ -38,6 +36,7 @@ import mage.abilities.costs.mana.GenericManaCost;
import mage.abilities.effects.common.CreateTokenEffect;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.filter.common.FilterArtifactSpell;
import mage.game.Game;
import mage.game.permanent.token.MyrToken;
@ -47,19 +46,21 @@ import mage.game.permanent.token.MyrToken;
* @author Loki, North
*/
public class Myrsmith extends CardImpl {
public Myrsmith (UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{1}{W}");
public Myrsmith(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{1}{W}");
this.subtype.add("Human");
this.subtype.add("Artificer");
this.power = new MageInt(2);
this.toughness = new MageInt(1);
// Whenever you cast an artifact spell, you may pay {1}. If you do, put a 1/1 colorless Myr artifact creature token onto the battlefield.
FilterArtifactSpell filter = new FilterArtifactSpell("an artifact spell");
this.addAbility(new SpellCastControllerTriggeredAbility(new MyrsmithEffect(), filter, false));
}
public Myrsmith (final Myrsmith card) {
public Myrsmith(final Myrsmith card) {
super(card);
}
@ -70,6 +71,7 @@ public class Myrsmith extends CardImpl {
}
class MyrsmithEffect extends CreateTokenEffect {
public MyrsmithEffect() {
super(new MyrToken());
staticText = "you may pay {1}. If you do, create a 1/1 colorless Myr artifact creature token";

View file

@ -25,17 +25,16 @@
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of BetaSteward_at_googlemail.com.
*/
package mage.cards.p;
import java.util.UUID;
import mage.constants.CardType;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.DiesTriggeredAbility;
import mage.abilities.effects.common.DamageTargetEffect;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.target.common.TargetCreatureOrPlayer;
/**
@ -44,17 +43,19 @@ import mage.target.common.TargetCreatureOrPlayer;
*/
public class PerilousMyr extends CardImpl {
public PerilousMyr (UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.ARTIFACT,CardType.CREATURE},"{2}");
public PerilousMyr(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.ARTIFACT, CardType.CREATURE}, "{2}");
this.subtype.add("Myr");
this.power = new MageInt(1);
this.toughness = new MageInt(1);
// When Perilous Myr dies, it deals 2 damage to target creature or player.
Ability ability = new DiesTriggeredAbility(new DamageTargetEffect(2), false);
ability.addTarget(new TargetCreatureOrPlayer());
this.addAbility(ability);
}
public PerilousMyr (final PerilousMyr card) {
public PerilousMyr(final PerilousMyr card) {
super(card);
}

View file

@ -34,7 +34,6 @@ import mage.abilities.DelayedTriggeredAbility;
import mage.abilities.TriggeredAbilityImpl;
import mage.abilities.common.EntersBattlefieldAbility;
import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.effects.PreventionEffectData;
import mage.abilities.effects.PreventionEffectImpl;
import mage.abilities.effects.common.CreateDelayedTriggeredAbilityEffect;
import mage.abilities.effects.common.EntersBattlefieldWithXCountersEffect;
@ -106,12 +105,11 @@ public class ProteanHydra extends CardImpl {
@Override
public boolean replaceEvent(GameEvent event, Ability source, Game game) {
PreventionEffectData preventionEffectData = preventDamageAction(event, source, game);
if (preventionEffectData.getPreventedDamage() > 0) {
Permanent permanent = game.getPermanent(source.getSourceId());
if (permanent != null) {
permanent.removeCounters(CounterType.P1P1.createInstance(preventionEffectData.getPreventedDamage()), game);
}
int damage = event.getAmount();
preventDamageAction(event, source, game);
Permanent permanent = game.getPermanent(source.getSourceId());
if (permanent != null) {
permanent.removeCounters(CounterType.P1P1.createInstance(damage), game); //MTG ruling Protean Hydra loses counters even if the damage isn't prevented
}
return false;
}

View file

@ -53,7 +53,7 @@ import mage.target.common.TargetOpponent;
public class RainbowVale extends CardImpl {
public RainbowVale(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.LAND},"");
super(ownerId, setInfo, new CardType[]{CardType.LAND}, "");
// {tap}: Add one mana of any color to your mana pool. An opponent gains control of Rainbow Vale at the beginning of the next end step.
Ability ability = new AnyColorManaAbility();
@ -74,7 +74,7 @@ public class RainbowVale extends CardImpl {
public RainbowValeEffect() {
super(Outcome.PutManaInPool);
staticText = "An opponent gains control of {this} at the beginning of the next end step.";
staticText = "an opponent gains control of {this} at the beginning of the next end step";
}
public RainbowValeEffect(final RainbowValeEffect effect) {
@ -85,7 +85,7 @@ public class RainbowVale extends CardImpl {
public boolean apply(Game game, Ability source) {
Permanent permanent = game.getPermanent(source.getSourceId());
if (permanent != null) {
game.addDelayedTriggeredAbility(new AtTheBeginOfNextEndStepDelayedTriggeredAbility(new OpponentGainControlEffect()));
game.addDelayedTriggeredAbility(new AtTheBeginOfNextEndStepDelayedTriggeredAbility(new OpponentGainControlEffect()), source);
return true;
}
return false;

View file

@ -87,7 +87,7 @@ public class RockHydra extends CardImpl {
public RockHydraEffect() {
super(Duration.WhileOnBattlefield, Integer.MAX_VALUE, false, false);
staticText = "For each 1 damage that would be dealt to Rock Hydra, if it has a +1/+1 counter on it, remove a +1/+1 counter from it and prevent that 1 damage.";
staticText = "For each 1 damage that would be dealt to {this}, if it has a +1/+1 counter on it, remove a +1/+1 counter from it and prevent that 1 damage.";
}
public RockHydraEffect(final RockHydraEffect effect) {

View file

@ -0,0 +1,113 @@
/*
* 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.cards.s;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.SimpleActivatedAbility;
import mage.abilities.costs.Cost;
import mage.abilities.costs.common.SacrificeTargetCost;
import mage.abilities.costs.mana.ManaCostsImpl;
import mage.abilities.effects.OneShotEffect;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.Outcome;
import mage.constants.Zone;
import mage.filter.common.FilterControlledCreaturePermanent;
import mage.filter.common.FilterCreaturePermanent;
import mage.game.Game;
import mage.game.permanent.Permanent;
import mage.target.common.TargetControlledPermanent;
/**
*
* @author Pete Rossi
*/
public class SanguinePraetor extends CardImpl {
public SanguinePraetor(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{6}{B}{B}");
this.subtype.add("Avatar");
this.subtype.add("Praetor");
this.power = new MageInt(7);
this.toughness = new MageInt(5);
// {B}, Sacrifice a creature: Destroy each creature with the same converted mana cost as the sacrificed creature.
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new SanguinePraetorEffect(), new ManaCostsImpl("{B}"));
ability.addCost(new SacrificeTargetCost(new TargetControlledPermanent(new FilterControlledCreaturePermanent())));
this.addAbility(ability);
}
public SanguinePraetor(final SanguinePraetor card) {
super(card);
}
@Override
public SanguinePraetor copy() {
return new SanguinePraetor(this);
}
}
class SanguinePraetorEffect extends OneShotEffect {
public SanguinePraetorEffect() {
super(Outcome.Damage);
staticText = "Destroy each creature with the same converted mana cost as the sacrificed creature.";
}
public SanguinePraetorEffect(final SanguinePraetorEffect effect) {
super(effect);
}
@Override
public boolean apply(Game game, Ability source) {
int cmc = 0;
for (Cost cost : source.getCosts()) {
if (cost instanceof SacrificeTargetCost && ((SacrificeTargetCost) cost).getPermanents().size() > 0) {
cmc = ((SacrificeTargetCost) cost).getPermanents().get(0).getConvertedManaCost();
break;
}
}
for (Permanent permanent : game.getBattlefield().getAllActivePermanents(new FilterCreaturePermanent(), source.getControllerId(), game)) {
if (permanent.getConvertedManaCost() == cmc) {
permanent.destroy(source.getSourceId(), game, false);
}
}
return true;
}
@Override
public SanguinePraetorEffect copy() {
return new SanguinePraetorEffect(this);
}
}

View file

@ -41,10 +41,10 @@ import mage.abilities.effects.common.DamageTargetEffect;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.Zone;
import mage.filter.common.FilterControlledCreaturePermanent;
import mage.filter.common.FilterControlledPermanent;
import mage.filter.predicate.mageobject.SubtypePredicate;
import mage.game.permanent.token.GoblinToken;
import mage.target.common.TargetControlledCreaturePermanent;
import mage.target.common.TargetControlledPermanent;
import mage.target.common.TargetCreatureOrPlayer;
/**
@ -53,7 +53,7 @@ import mage.target.common.TargetCreatureOrPlayer;
*/
public class SiegeGangCommander extends CardImpl {
private static final FilterControlledCreaturePermanent filter = new FilterControlledCreaturePermanent("a Goblin");
private static final FilterControlledPermanent filter = new FilterControlledPermanent("a Goblin");
static {
filter.add(new SubtypePredicate("Goblin"));
@ -67,7 +67,7 @@ public class SiegeGangCommander extends CardImpl {
this.toughness = new MageInt(2);
this.addAbility(new EntersBattlefieldTriggeredAbility(new CreateTokenEffect(new GoblinToken(), 3), false));
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DamageTargetEffect(2), new ManaCostsImpl("{1}{R}"));
ability.addCost(new SacrificeTargetCost(new TargetControlledCreaturePermanent(1, 1, filter, false)));
ability.addCost(new SacrificeTargetCost(new TargetControlledPermanent(1, 1, filter, false)));
ability.addTarget(new TargetCreatureOrPlayer());
this.addAbility(ability);
}

View file

@ -0,0 +1,122 @@
/*
* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* The views and conclusions contained in the software and documentation are those of the
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of BetaSteward_at_googlemail.com.
*/
package mage.cards.s;
import java.util.UUID;
import mage.abilities.Ability;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.CounterTargetEffect;
import mage.cards.Card;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.cards.Cards;
import mage.cards.CardsImpl;
import mage.constants.CardType;
import mage.constants.Outcome;
import mage.constants.Zone;
import mage.filter.common.FilterInstantOrSorcerySpell;
import mage.game.Game;
import mage.game.stack.Spell;
import mage.players.Library;
import mage.players.Player;
import mage.target.TargetSpell;
/**
*
* @author Styxo
*/
public class Spellshift extends CardImpl {
public Spellshift(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{3}{U}");
// Counter target instant or sorcery spell.
this.getSpellAbility().addTarget(new TargetSpell(new FilterInstantOrSorcerySpell()));
this.getSpellAbility().addEffect(new CounterTargetEffect());
// Its controller reveals cards from the top of his or her library until he or she reveals an instant or sorcery card. That player may cast that card without paying its mana cost. Then he or she shuffles his or her library.
this.getSpellAbility().addEffect(new SpellshiftEffect());
}
public Spellshift(final Spellshift card) {
super(card);
}
@Override
public Spellshift copy() {
return new Spellshift(this);
}
}
class SpellshiftEffect extends OneShotEffect {
public SpellshiftEffect() {
super(Outcome.Detriment);
this.staticText = "Its controller reveals cards from the top of his or her library until he or she reveals an instant or sorcery card. That player may cast that card without paying its mana cost. Then he or she shuffles his or her library";
}
public SpellshiftEffect(final SpellshiftEffect effect) {
super(effect);
}
@Override
public SpellshiftEffect copy() {
return new SpellshiftEffect(this);
}
@Override
public boolean apply(Game game, Ability source) {
Player player = game.getPlayer(((Spell) game.getLastKnownInformation(targetPointer.getFirst(game, source), Zone.STACK)).getControllerId());
if (player != null) {
Library library = player.getLibrary();
if (library.size() > 0) {
Cards cards = new CardsImpl();
Card card = library.removeFromTop(game);
cards.add(card);
while (!(card.getCardType().contains(CardType.SORCERY) || card.getCardType().contains(CardType.INSTANT)) && library.size() > 0) {
card = library.removeFromTop(game);
cards.add(card);
}
if (card.getCardType().contains(CardType.SORCERY) || card.getCardType().contains(CardType.INSTANT)) {
if (player.chooseUse(outcome, "Cast " + card.getLogName() + " ?", source, game)) {
if (player.cast(card.getSpellAbility(), game, true)) {
cards.remove(card.getId());
}
}
}
if (cards.size() > 0) {
library.addAll(cards.getCards(game), game);
}
}
return true;
}
return false;
}
}

View file

@ -0,0 +1,101 @@
/*
* 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.cards.v;
import java.util.UUID;
import mage.abilities.Ability;
import mage.abilities.effects.Effect;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.discard.DiscardCardYouChooseTargetEffect;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.Outcome;
import mage.constants.TargetController;
import mage.filter.Filter;
import mage.filter.FilterCard;
import mage.filter.common.FilterNonlandCard;
import mage.filter.predicate.mageobject.ConvertedManaCostPredicate;
import mage.game.Game;
import mage.players.Player;
import mage.target.TargetPlayer;
/**
*
* @author Styxo
*/
public class VenarianGlimmer extends CardImpl {
public VenarianGlimmer(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{X}{U}");
// Target player reveals his or her hand. You choose a nonland card with converted mana cost X or less from it. That player discards that card.
this.getSpellAbility().addTarget(new TargetPlayer());
this.getSpellAbility().addEffect(new VenarianGlimmerEffect());
}
public VenarianGlimmer(final VenarianGlimmer card) {
super(card);
}
@Override
public VenarianGlimmer copy() {
return new VenarianGlimmer(this);
}
}
class VenarianGlimmerEffect extends OneShotEffect {
public VenarianGlimmerEffect() {
super(Outcome.Discard);
this.staticText = "Target player reveals his or her hand. You choose a nonland card with converted mana cost X or less from it. That player discards that card";
}
public VenarianGlimmerEffect(final VenarianGlimmerEffect effect) {
super(effect);
}
@Override
public VenarianGlimmerEffect copy() {
return new VenarianGlimmerEffect(this);
}
@Override
public boolean apply(Game game, Ability source) {
Player player = game.getPlayer(targetPointer.getFirst(game, source));
if (player != null) {
FilterCard filter = new FilterNonlandCard();
filter.add(new ConvertedManaCostPredicate(Filter.ComparisonType.LessThan, source.getManaCostsToPay().getX() + 1));
Effect effect = new DiscardCardYouChooseTargetEffect(filter, TargetController.ANY);
effect.setTargetPointer(targetPointer);
effect.apply(game, source);
return true;
}
return false;
}
}

View file

@ -34,6 +34,7 @@ public class Apocalypse extends ExpansionSet {
cards.add(new SetCardInfo("Brass Herald", 133, Rarity.UNCOMMON, mage.cards.b.BrassHerald.class));
cards.add(new SetCardInfo("Caves of Koilos", 140, Rarity.RARE, mage.cards.c.CavesOfKoilos.class));
cards.add(new SetCardInfo("Ceta Disciple", 19, Rarity.COMMON, mage.cards.c.CetaDisciple.class));
cards.add(new SetCardInfo("Ceta Sanctuary", 20, Rarity.UNCOMMON, mage.cards.c.CetaSanctuary.class));
cards.add(new SetCardInfo("Cetavolver", 21, Rarity.RARE, mage.cards.c.Cetavolver.class));
cards.add(new SetCardInfo("Coalition Flag", 2, Rarity.UNCOMMON, mage.cards.c.CoalitionFlag.class));
cards.add(new SetCardInfo("Coalition Honor Guard", 3, Rarity.COMMON, mage.cards.c.CoalitionHonorGuard.class));

View file

@ -44,6 +44,7 @@ public class Darksteel extends ExpansionSet {
cards.add(new SetCardInfo("Barbed Lightning", 55, Rarity.COMMON, mage.cards.b.BarbedLightning.class));
cards.add(new SetCardInfo("Blinkmoth Nexus", 163, Rarity.RARE, mage.cards.b.BlinkmothNexus.class));
cards.add(new SetCardInfo("Burden of Greed", 38, Rarity.COMMON, mage.cards.b.BurdenOfGreed.class));
cards.add(new SetCardInfo("Chimeric Egg", 106, Rarity.UNCOMMON, mage.cards.c.ChimericEgg.class));
cards.add(new SetCardInfo("Chittering Rats", 39, Rarity.COMMON, mage.cards.c.ChitteringRats.class));
cards.add(new SetCardInfo("Chromescale Drake", 20, Rarity.RARE, mage.cards.c.ChromescaleDrake.class));
cards.add(new SetCardInfo("Coretapper", 107, Rarity.UNCOMMON, mage.cards.c.Coretapper.class));

View file

@ -170,6 +170,7 @@ public class FourthEdition extends ExpansionSet {
cards.add(new SetCardInfo("Forest", 177, Rarity.LAND, mage.cards.basiclands.Forest.class, new CardGraphicInfo(null, true)));
cards.add(new SetCardInfo("Frozen Shade", 22, Rarity.COMMON, mage.cards.f.FrozenShade.class));
cards.add(new SetCardInfo("Fungusaur", 130, Rarity.RARE, mage.cards.f.Fungusaur.class));
cards.add(new SetCardInfo("Gaea's Liege", 131, Rarity.RARE, mage.cards.g.GaeasLiege.class));
cards.add(new SetCardInfo("Gaseous Form", 74, Rarity.COMMON, mage.cards.g.GaseousForm.class));
cards.add(new SetCardInfo("Ghost Ship", 75, Rarity.UNCOMMON, mage.cards.g.GhostShip.class));
cards.add(new SetCardInfo("Giant Growth", 132, Rarity.COMMON, mage.cards.g.GiantGrowth.class));

View file

@ -153,6 +153,7 @@ public class Guildpact extends ExpansionSet {
cards.add(new SetCardInfo("Revenant Patriarch", 59, Rarity.UNCOMMON, mage.cards.r.RevenantPatriarch.class));
cards.add(new SetCardInfo("Rumbling Slum", 126, Rarity.RARE, mage.cards.r.RumblingSlum.class));
cards.add(new SetCardInfo("Runeboggle", 33, Rarity.COMMON, mage.cards.r.Runeboggle.class));
cards.add(new SetCardInfo("Sanguine Praetor", 60, Rarity.RARE, mage.cards.s.SanguinePraetor.class));
cards.add(new SetCardInfo("Savage Twister", 127, Rarity.UNCOMMON, mage.cards.s.SavageTwister.class));
cards.add(new SetCardInfo("Scab-Clan Mauler", 128, Rarity.COMMON, mage.cards.s.ScabClanMauler.class));
cards.add(new SetCardInfo("Schismotivate", 129, Rarity.UNCOMMON, mage.cards.s.Schismotivate.class));

View file

@ -107,6 +107,7 @@ public class LimitedEditionAlpha extends ExpansionSet {
cards.add(new SetCardInfo("Fork", 153, Rarity.RARE, mage.cards.f.Fork.class));
cards.add(new SetCardInfo("Frozen Shade", 18, Rarity.COMMON, mage.cards.f.FrozenShade.class));
cards.add(new SetCardInfo("Fungusaur", 104, Rarity.RARE, mage.cards.f.Fungusaur.class));
cards.add(new SetCardInfo("Gaea's Liege", 105, Rarity.RARE, mage.cards.g.GaeasLiege.class));
cards.add(new SetCardInfo("Gauntlet of Might", 244, Rarity.RARE, mage.cards.g.GauntletOfMight.class));
cards.add(new SetCardInfo("Giant Growth", 106, Rarity.COMMON, mage.cards.g.GiantGrowth.class));
cards.add(new SetCardInfo("Giant Spider", 107, Rarity.COMMON, mage.cards.g.GiantSpider.class));
@ -139,6 +140,7 @@ public class LimitedEditionAlpha extends ExpansionSet {
cards.add(new SetCardInfo("Island Sanctuary", 209, Rarity.RARE, mage.cards.i.IslandSanctuary.class));
cards.add(new SetCardInfo("Ivory Cup", 251, Rarity.UNCOMMON, mage.cards.i.IvoryCup.class));
cards.add(new SetCardInfo("Jade Monolith", 252, Rarity.RARE, mage.cards.j.JadeMonolith.class));
cards.add(new SetCardInfo("Jade Statue", 253, Rarity.UNCOMMON, mage.cards.j.JadeStatue.class));
cards.add(new SetCardInfo("Jayemdae Tome", 254, Rarity.RARE, mage.cards.j.JayemdaeTome.class));
cards.add(new SetCardInfo("Juggernaut", 255, Rarity.UNCOMMON, mage.cards.j.Juggernaut.class));
cards.add(new SetCardInfo("Jump", 61, Rarity.COMMON, mage.cards.j.Jump.class));

View file

@ -109,6 +109,7 @@ public class LimitedEditionBeta extends ExpansionSet {
cards.add(new SetCardInfo("Fork", 154, Rarity.RARE, mage.cards.f.Fork.class));
cards.add(new SetCardInfo("Frozen Shade", 18, Rarity.COMMON, mage.cards.f.FrozenShade.class));
cards.add(new SetCardInfo("Fungusaur", 104, Rarity.RARE, mage.cards.f.Fungusaur.class));
cards.add(new SetCardInfo("Gaea's Liege", 105, Rarity.RARE, mage.cards.g.GaeasLiege.class));
cards.add(new SetCardInfo("Gauntlet of Might", 246, Rarity.RARE, mage.cards.g.GauntletOfMight.class));
cards.add(new SetCardInfo("Giant Growth", 106, Rarity.COMMON, mage.cards.g.GiantGrowth.class));
cards.add(new SetCardInfo("Giant Spider", 107, Rarity.COMMON, mage.cards.g.GiantSpider.class));
@ -142,6 +143,7 @@ public class LimitedEditionBeta extends ExpansionSet {
cards.add(new SetCardInfo("Island Sanctuary", 211, Rarity.RARE, mage.cards.i.IslandSanctuary.class));
cards.add(new SetCardInfo("Ivory Cup", 253, Rarity.UNCOMMON, mage.cards.i.IvoryCup.class));
cards.add(new SetCardInfo("Jade Monolith", 254, Rarity.RARE, mage.cards.j.JadeMonolith.class));
cards.add(new SetCardInfo("Jade Statue", 255, Rarity.UNCOMMON, mage.cards.j.JadeStatue.class));
cards.add(new SetCardInfo("Jayemdae Tome", 256, Rarity.RARE, mage.cards.j.JayemdaeTome.class));
cards.add(new SetCardInfo("Juggernaut", 257, Rarity.UNCOMMON, mage.cards.j.Juggernaut.class));
cards.add(new SetCardInfo("Jump", 61, Rarity.COMMON, mage.cards.j.Jump.class));

View file

@ -115,6 +115,7 @@ public class Mirrodin extends ExpansionSet {
cards.add(new SetCardInfo("Groffskithur", 121, Rarity.COMMON, mage.cards.g.Groffskithur.class));
cards.add(new SetCardInfo("Heartwood Shard", 184, Rarity.UNCOMMON, mage.cards.h.HeartwoodShard.class));
cards.add(new SetCardInfo("Hematite Golem", 185, Rarity.COMMON, mage.cards.h.HematiteGolem.class));
cards.add(new SetCardInfo("Hum of the Radix", 122, Rarity.RARE, mage.cards.h.HumOfTheRadix.class));
cards.add(new SetCardInfo("Icy Manipulator", 186, Rarity.UNCOMMON, mage.cards.i.IcyManipulator.class));
cards.add(new SetCardInfo("Incite War", 96, Rarity.COMMON, mage.cards.i.InciteWar.class));
cards.add(new SetCardInfo("Inertia Bubble", 37, Rarity.COMMON, mage.cards.i.InertiaBubble.class));

View file

@ -173,6 +173,7 @@ public class NinthEdition extends ExpansionSet {
cards.add(new SetCardInfo("Island", 337, Rarity.LAND, mage.cards.basiclands.Island.class, new CardGraphicInfo(null, true)));
cards.add(new SetCardInfo("Island", 338, Rarity.LAND, mage.cards.basiclands.Island.class, new CardGraphicInfo(null, true)));
cards.add(new SetCardInfo("Ivory Mask", 23, Rarity.RARE, mage.cards.i.IvoryMask.class));
cards.add(new SetCardInfo("Jade Statue", 300, Rarity.RARE, mage.cards.j.JadeStatue.class));
cards.add(new SetCardInfo("Jester's Cap", 301, Rarity.RARE, mage.cards.j.JestersCap.class));
cards.add(new SetCardInfo("Kami of Old Stone", 24, Rarity.UNCOMMON, mage.cards.k.KamiOfOldStone.class));
cards.add(new SetCardInfo("Karplusan Forest", 321, Rarity.RARE, mage.cards.k.KarplusanForest.class));

View file

@ -1,208 +1,211 @@
/*
* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* The views and conclusions contained in the software and documentation are those of the
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of BetaSteward_at_googlemail.com.
*/
package mage.sets;
import mage.constants.SetType;
import mage.cards.ExpansionSet;
import mage.constants.Rarity;
/**
*
* @author North
*/
public class PlanarChaos extends ExpansionSet {
private static final PlanarChaos fINSTANCE = new PlanarChaos();
public static PlanarChaos getInstance() {
return fINSTANCE;
}
private PlanarChaos() {
super("Planar Chaos", "PLC", ExpansionSet.buildDate(2007, 1, 2), SetType.EXPANSION);
this.blockName = "Time Spiral";
this.parentSet = TimeSpiral.getInstance();
this.hasBasicLands = false;
this.hasBoosters = true;
this.numBoosterLands = 0;
this.numBoosterCommon = 10;
this.numBoosterUncommon = 3;
this.numBoosterRare = 1;
this.ratioBoosterMythic = 0;
cards.add(new SetCardInfo("Aeon Chronicler", 32, Rarity.RARE, mage.cards.a.AeonChronicler.class));
cards.add(new SetCardInfo("Aether Membrane", 93, Rarity.UNCOMMON, mage.cards.a.AetherMembrane.class));
cards.add(new SetCardInfo("Akroma, Angel of Fury", 94, Rarity.RARE, mage.cards.a.AkromaAngelOfFury.class));
cards.add(new SetCardInfo("Ana Battlemage", 124, Rarity.UNCOMMON, mage.cards.a.AnaBattlemage.class));
cards.add(new SetCardInfo("Aquamorph Entity", 33, Rarity.COMMON, mage.cards.a.AquamorphEntity.class));
cards.add(new SetCardInfo("Aven Riftwatcher", 1, Rarity.COMMON, mage.cards.a.AvenRiftwatcher.class));
cards.add(new SetCardInfo("Battering Sliver", 95, Rarity.COMMON, mage.cards.b.BatteringSliver.class));
cards.add(new SetCardInfo("Benalish Commander", 2, Rarity.RARE, mage.cards.b.BenalishCommander.class));
cards.add(new SetCardInfo("Big Game Hunter", 63, Rarity.UNCOMMON, mage.cards.b.BigGameHunter.class));
cards.add(new SetCardInfo("Blightspeaker", 64, Rarity.COMMON, mage.cards.b.Blightspeaker.class));
cards.add(new SetCardInfo("Blood Knight", 115, Rarity.UNCOMMON, mage.cards.b.BloodKnight.class));
cards.add(new SetCardInfo("Body Double", 35, Rarity.RARE, mage.cards.b.BodyDouble.class));
cards.add(new SetCardInfo("Bog Serpent", 84, Rarity.COMMON, mage.cards.b.BogSerpent.class));
cards.add(new SetCardInfo("Boom // Bust", 112, Rarity.RARE, mage.cards.b.BoomBust.class));
cards.add(new SetCardInfo("Braids, Conjurer Adept", 36, Rarity.RARE, mage.cards.b.BraidsConjurerAdept.class));
cards.add(new SetCardInfo("Brain Gorgers", 65, Rarity.COMMON, mage.cards.b.BrainGorgers.class));
cards.add(new SetCardInfo("Brute Force", 116, Rarity.COMMON, mage.cards.b.BruteForce.class));
cards.add(new SetCardInfo("Calciderm", 23, Rarity.UNCOMMON, mage.cards.c.Calciderm.class));
cards.add(new SetCardInfo("Cautery Sliver", 154, Rarity.UNCOMMON, mage.cards.c.CauterySliver.class));
cards.add(new SetCardInfo("Chronozoa", 37, Rarity.RARE, mage.cards.c.Chronozoa.class));
cards.add(new SetCardInfo("Circle of Affliction", 66, Rarity.UNCOMMON, mage.cards.c.CircleOfAffliction.class));
cards.add(new SetCardInfo("Citanul Woodreaders", 125, Rarity.COMMON, mage.cards.c.CitanulWoodreaders.class));
cards.add(new SetCardInfo("Cradle to Grave", 67, Rarity.COMMON, mage.cards.c.CradleToGrave.class));
cards.add(new SetCardInfo("Crovax, Ascendant Hero", 3, Rarity.RARE, mage.cards.c.CrovaxAscendantHero.class));
cards.add(new SetCardInfo("Damnation", 85, Rarity.RARE, mage.cards.d.Damnation.class));
cards.add(new SetCardInfo("Darkheart Sliver", 155, Rarity.UNCOMMON, mage.cards.d.DarkheartSliver.class));
cards.add(new SetCardInfo("Dash Hopes", 68, Rarity.COMMON, mage.cards.d.DashHopes.class));
cards.add(new SetCardInfo("Dawn Charm", 4, Rarity.COMMON, mage.cards.d.DawnCharm.class));
cards.add(new SetCardInfo("Dead // Gone", 113, Rarity.COMMON, mage.cards.d.DeadGone.class));
cards.add(new SetCardInfo("Deadly Grub", 69, Rarity.COMMON, mage.cards.d.DeadlyGrub.class));
cards.add(new SetCardInfo("Deadwood Treefolk", 126, Rarity.UNCOMMON, mage.cards.d.DeadwoodTreefolk.class));
cards.add(new SetCardInfo("Detritivore", 96, Rarity.RARE, mage.cards.d.Detritivore.class));
cards.add(new SetCardInfo("Dismal Failure", 39, Rarity.UNCOMMON, mage.cards.d.DismalFailure.class));
cards.add(new SetCardInfo("Dormant Sliver", 156, Rarity.UNCOMMON, mage.cards.d.DormantSliver.class));
cards.add(new SetCardInfo("Dreamscape Artist", 40, Rarity.COMMON, mage.cards.d.DreamscapeArtist.class));
cards.add(new SetCardInfo("Dunerider Outlaw", 86, Rarity.UNCOMMON, mage.cards.d.DuneriderOutlaw.class));
cards.add(new SetCardInfo("Dust Corona", 97, Rarity.COMMON, mage.cards.d.DustCorona.class));
cards.add(new SetCardInfo("Dust Elemental", 5, Rarity.RARE, mage.cards.d.DustElemental.class));
cards.add(new SetCardInfo("Enslave", 70, Rarity.UNCOMMON, mage.cards.e.Enslave.class));
cards.add(new SetCardInfo("Erratic Mutation", 41, Rarity.COMMON, mage.cards.e.ErraticMutation.class));
cards.add(new SetCardInfo("Essence Warden", 145, Rarity.COMMON, mage.cards.e.EssenceWarden.class));
cards.add(new SetCardInfo("Evolution Charm", 127, Rarity.COMMON, mage.cards.e.EvolutionCharm.class));
cards.add(new SetCardInfo("Extirpate", 71, Rarity.RARE, mage.cards.e.Extirpate.class));
cards.add(new SetCardInfo("Fa'adiyah Seer", 146, Rarity.COMMON, mage.cards.f.FaadiyahSeer.class));
cards.add(new SetCardInfo("Fatal Frenzy", 98, Rarity.RARE, mage.cards.f.FatalFrenzy.class));
cards.add(new SetCardInfo("Firefright Mage", 99, Rarity.COMMON, mage.cards.f.FirefrightMage.class));
cards.add(new SetCardInfo("Frenetic Sliver", 157, Rarity.UNCOMMON, mage.cards.f.FreneticSliver.class));
cards.add(new SetCardInfo("Frozen Aether", 54, Rarity.UNCOMMON, mage.cards.f.FrozenAether.class));
cards.add(new SetCardInfo("Fungal Behemoth", 128, Rarity.RARE, mage.cards.f.FungalBehemoth.class));
cards.add(new SetCardInfo("Fury Charm", 100, Rarity.COMMON, mage.cards.f.FuryCharm.class));
cards.add(new SetCardInfo("Gaea's Anthem", 147, Rarity.RARE, mage.cards.g.GaeasAnthem.class));
cards.add(new SetCardInfo("Ghost Tactician", 6, Rarity.COMMON, mage.cards.g.GhostTactician.class));
cards.add(new SetCardInfo("Giant Dustwasp", 129, Rarity.COMMON, mage.cards.g.GiantDustwasp.class));
cards.add(new SetCardInfo("Gossamer Phantasm", 55, Rarity.COMMON, mage.cards.g.GossamerPhantasm.class));
cards.add(new SetCardInfo("Groundbreaker", 148, Rarity.RARE, mage.cards.g.Groundbreaker.class));
cards.add(new SetCardInfo("Hammerheim Deadeye", 101, Rarity.UNCOMMON, mage.cards.h.HammerheimDeadeye.class));
cards.add(new SetCardInfo("Harmonize", 149, Rarity.UNCOMMON, mage.cards.h.Harmonize.class));
cards.add(new SetCardInfo("Healing Leaves", 150, Rarity.COMMON, mage.cards.h.HealingLeaves.class));
cards.add(new SetCardInfo("Hedge Troll", 151, Rarity.UNCOMMON, mage.cards.h.HedgeTroll.class));
cards.add(new SetCardInfo("Heroes Remembered", 7, Rarity.RARE, mage.cards.h.HeroesRemembered.class));
cards.add(new SetCardInfo("Hunting Wilds", 130, Rarity.UNCOMMON, mage.cards.h.HuntingWilds.class));
cards.add(new SetCardInfo("Imp's Mischief", 72, Rarity.RARE, mage.cards.i.ImpsMischief.class));
cards.add(new SetCardInfo("Intet, the Dreamer", 158, Rarity.RARE, mage.cards.i.IntetTheDreamer.class));
cards.add(new SetCardInfo("Jedit Ojanen of Efrava", 131, Rarity.RARE, mage.cards.j.JeditOjanenOfEfrava.class));
cards.add(new SetCardInfo("Kavu Predator", 132, Rarity.UNCOMMON, mage.cards.k.KavuPredator.class));
cards.add(new SetCardInfo("Keen Sense", 152, Rarity.UNCOMMON, mage.cards.k.KeenSense.class));
cards.add(new SetCardInfo("Keldon Marauders", 102, Rarity.COMMON, mage.cards.k.KeldonMarauders.class));
cards.add(new SetCardInfo("Lavacore Elemental", 103, Rarity.UNCOMMON, mage.cards.l.LavacoreElemental.class));
cards.add(new SetCardInfo("Life and Limb", 133, Rarity.RARE, mage.cards.l.LifeAndLimb.class));
cards.add(new SetCardInfo("Magus of the Arena", 104, Rarity.RARE, mage.cards.m.MagusOfTheArena.class));
cards.add(new SetCardInfo("Magus of the Bazaar", 43, Rarity.RARE, mage.cards.m.MagusOfTheBazaar.class));
cards.add(new SetCardInfo("Magus of the Coffers", 73, Rarity.RARE, mage.cards.m.MagusOfTheCoffers.class));
cards.add(new SetCardInfo("Magus of the Library", 134, Rarity.RARE, mage.cards.m.MagusOfTheLibrary.class));
cards.add(new SetCardInfo("Magus of the Tabernacle", 8, Rarity.RARE, mage.cards.m.MagusOfTheTabernacle.class));
cards.add(new SetCardInfo("Malach of the Dawn", 24, Rarity.UNCOMMON, mage.cards.m.MalachOfTheDawn.class));
cards.add(new SetCardInfo("Mana Tithe", 25, Rarity.COMMON, mage.cards.m.ManaTithe.class));
cards.add(new SetCardInfo("Melancholy", 88, Rarity.COMMON, mage.cards.m.Melancholy.class));
cards.add(new SetCardInfo("Merfolk Thaumaturgist", 56, Rarity.COMMON, mage.cards.m.MerfolkThaumaturgist.class));
cards.add(new SetCardInfo("Mesa Enchantress", 26, Rarity.RARE, mage.cards.m.MesaEnchantress.class));
cards.add(new SetCardInfo("Midnight Charm", 74, Rarity.COMMON, mage.cards.m.MidnightCharm.class));
cards.add(new SetCardInfo("Mire Boa", 135, Rarity.COMMON, mage.cards.m.MireBoa.class));
cards.add(new SetCardInfo("Mirri the Cursed", 75, Rarity.RARE, mage.cards.m.MirriTheCursed.class));
cards.add(new SetCardInfo("Mycologist", 27, Rarity.UNCOMMON, mage.cards.m.Mycologist.class));
cards.add(new SetCardInfo("Necrotic Sliver", 159, Rarity.UNCOMMON, mage.cards.n.NecroticSliver.class));
cards.add(new SetCardInfo("Needlepeak Spider", 105, Rarity.COMMON, mage.cards.n.NeedlepeakSpider.class));
cards.add(new SetCardInfo("Null Profusion", 89, Rarity.RARE, mage.cards.n.NullProfusion.class));
cards.add(new SetCardInfo("Numot, the Devastator", 160, Rarity.RARE, mage.cards.n.NumotTheDevastator.class));
cards.add(new SetCardInfo("Oros, the Avenger", 161, Rarity.RARE, mage.cards.o.OrosTheAvenger.class));
cards.add(new SetCardInfo("Ovinize", 57, Rarity.UNCOMMON, mage.cards.o.Ovinize.class));
cards.add(new SetCardInfo("Pallid Mycoderm", 10, Rarity.COMMON, mage.cards.p.PallidMycoderm.class));
cards.add(new SetCardInfo("Phantasmagorian", 77, Rarity.UNCOMMON, mage.cards.p.Phantasmagorian.class));
cards.add(new SetCardInfo("Piracy Charm", 58, Rarity.COMMON, mage.cards.p.PiracyCharm.class));
cards.add(new SetCardInfo("Pongify", 44, Rarity.UNCOMMON, mage.cards.p.Pongify.class));
cards.add(new SetCardInfo("Porphyry Nodes", 28, Rarity.RARE, mage.cards.p.PorphyryNodes.class));
cards.add(new SetCardInfo("Poultice Sliver", 11, Rarity.COMMON, mage.cards.p.PoulticeSliver.class));
cards.add(new SetCardInfo("Pouncing Wurm", 136, Rarity.UNCOMMON, mage.cards.p.PouncingWurm.class));
cards.add(new SetCardInfo("Primal Plasma", 59, Rarity.COMMON, mage.cards.p.PrimalPlasma.class));
cards.add(new SetCardInfo("Prodigal Pyromancer", 118, Rarity.COMMON, mage.cards.p.ProdigalPyromancer.class));
cards.add(new SetCardInfo("Psychotrope Thallid", 137, Rarity.UNCOMMON, mage.cards.p.PsychotropeThallid.class));
cards.add(new SetCardInfo("Pyrohemia", 119, Rarity.UNCOMMON, mage.cards.p.Pyrohemia.class));
cards.add(new SetCardInfo("Radha, Heir to Keld", 162, Rarity.RARE, mage.cards.r.RadhaHeirToKeld.class));
cards.add(new SetCardInfo("Rathi Trapper", 90, Rarity.COMMON, mage.cards.r.RathiTrapper.class));
cards.add(new SetCardInfo("Reality Acid", 45, Rarity.COMMON, mage.cards.r.RealityAcid.class));
cards.add(new SetCardInfo("Rebuff the Wicked", 12, Rarity.UNCOMMON, mage.cards.r.RebuffTheWicked.class));
cards.add(new SetCardInfo("Reckless Wurm", 120, Rarity.UNCOMMON, mage.cards.r.RecklessWurm.class));
cards.add(new SetCardInfo("Reflex Sliver", 138, Rarity.COMMON, mage.cards.r.ReflexSliver.class));
cards.add(new SetCardInfo("Revered Dead", 29, Rarity.COMMON, mage.cards.r.ReveredDead.class));
cards.add(new SetCardInfo("Ridged Kusite", 78, Rarity.COMMON, mage.cards.r.RidgedKusite.class));
cards.add(new SetCardInfo("Riptide Pilferer", 60, Rarity.UNCOMMON, mage.cards.r.RiptidePilferer.class));
cards.add(new SetCardInfo("Roiling Horror", 79, Rarity.RARE, mage.cards.r.RoilingHorror.class));
cards.add(new SetCardInfo("Rough // Tumble", 114, Rarity.UNCOMMON, mage.cards.r.RoughTumble.class));
cards.add(new SetCardInfo("Saltblast", 15, Rarity.UNCOMMON, mage.cards.s.Saltblast.class));
cards.add(new SetCardInfo("Saltfield Recluse", 16, Rarity.COMMON, mage.cards.s.SaltfieldRecluse.class));
cards.add(new SetCardInfo("Seal of Primordium", 153, Rarity.COMMON, mage.cards.s.SealOfPrimordium.class));
cards.add(new SetCardInfo("Serendib Sorcerer", 61, Rarity.RARE, mage.cards.s.SerendibSorcerer.class));
cards.add(new SetCardInfo("Serra's Boon", 17, Rarity.UNCOMMON, mage.cards.s.SerrasBoon.class));
cards.add(new SetCardInfo("Serra Sphinx", 62, Rarity.RARE, mage.cards.s.SerraSphinx.class));
cards.add(new SetCardInfo("Shade of Trokair", 18, Rarity.COMMON, mage.cards.s.ShadeOfTrokair.class));
cards.add(new SetCardInfo("Shaper Parasite", 46, Rarity.COMMON, mage.cards.s.ShaperParasite.class));
cards.add(new SetCardInfo("Shivan Meteor", 106, Rarity.UNCOMMON, mage.cards.s.ShivanMeteor.class));
cards.add(new SetCardInfo("Shivan Wumpus", 121, Rarity.RARE, mage.cards.s.ShivanWumpus.class));
cards.add(new SetCardInfo("Shrouded Lore", 91, Rarity.UNCOMMON, mage.cards.s.ShroudedLore.class));
cards.add(new SetCardInfo("Simian Spirit Guide", 122, Rarity.COMMON, mage.cards.s.SimianSpiritGuide.class));
cards.add(new SetCardInfo("Sinew Sliver", 30, Rarity.COMMON, mage.cards.s.SinewSliver.class));
cards.add(new SetCardInfo("Skirk Shaman", 123, Rarity.COMMON, mage.cards.s.SkirkShaman.class));
cards.add(new SetCardInfo("Sophic Centaur", 139, Rarity.UNCOMMON, mage.cards.s.SophicCentaur.class));
cards.add(new SetCardInfo("Spitting Sliver", 80, Rarity.COMMON, mage.cards.s.SpittingSliver.class));
cards.add(new SetCardInfo("Stingscourger", 107, Rarity.COMMON, mage.cards.s.Stingscourger.class));
cards.add(new SetCardInfo("Stonecloaker", 19, Rarity.UNCOMMON, mage.cards.s.Stonecloaker.class));
cards.add(new SetCardInfo("Stormfront Riders", 20, Rarity.UNCOMMON, mage.cards.s.StormfrontRiders.class));
cards.add(new SetCardInfo("Sulfur Elemental", 108, Rarity.UNCOMMON, mage.cards.s.SulfurElemental.class));
cards.add(new SetCardInfo("Sunlance", 31, Rarity.COMMON, mage.cards.s.Sunlance.class));
cards.add(new SetCardInfo("Synchronous Sliver", 48, Rarity.COMMON, mage.cards.s.SynchronousSliver.class));
cards.add(new SetCardInfo("Temporal Extortion", 81, Rarity.RARE, mage.cards.t.TemporalExtortion.class));
cards.add(new SetCardInfo("Teneb, the Harvester", 163, Rarity.RARE, mage.cards.t.TenebTheHarvester.class));
cards.add(new SetCardInfo("Tidewalker", 49, Rarity.UNCOMMON, mage.cards.t.Tidewalker.class));
cards.add(new SetCardInfo("Timbermare", 140, Rarity.RARE, mage.cards.t.Timbermare.class));
cards.add(new SetCardInfo("Timecrafting", 109, Rarity.UNCOMMON, mage.cards.t.Timecrafting.class));
cards.add(new SetCardInfo("Torchling", 110, Rarity.RARE, mage.cards.t.Torchling.class));
cards.add(new SetCardInfo("Uktabi Drake", 141, Rarity.COMMON, mage.cards.u.UktabiDrake.class));
cards.add(new SetCardInfo("Urborg, Tomb of Yawgmoth", 165, Rarity.RARE, mage.cards.u.UrborgTombOfYawgmoth.class));
cards.add(new SetCardInfo("Utopia Vow", 142, Rarity.COMMON, mage.cards.u.UtopiaVow.class));
cards.add(new SetCardInfo("Vampiric Link", 92, Rarity.COMMON, mage.cards.v.VampiricLink.class));
cards.add(new SetCardInfo("Vitaspore Thallid", 143, Rarity.COMMON, mage.cards.v.VitasporeThallid.class));
cards.add(new SetCardInfo("Voidstone Gargoyle", 21, Rarity.RARE, mage.cards.v.VoidstoneGargoyle.class));
cards.add(new SetCardInfo("Vorosh, the Hunter", 164, Rarity.RARE, mage.cards.v.VoroshTheHunter.class));
cards.add(new SetCardInfo("Waning Wurm", 83, Rarity.UNCOMMON, mage.cards.w.WaningWurm.class));
cards.add(new SetCardInfo("Whitemane Lion", 22, Rarity.COMMON, mage.cards.w.WhitemaneLion.class));
cards.add(new SetCardInfo("Wild Pair", 144, Rarity.RARE, mage.cards.w.WildPair.class));
cards.add(new SetCardInfo("Wistful Thinking", 53, Rarity.COMMON, mage.cards.w.WistfulThinking.class));
}
}
/*
* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* The views and conclusions contained in the software and documentation are those of the
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of BetaSteward_at_googlemail.com.
*/
package mage.sets;
import mage.constants.SetType;
import mage.cards.ExpansionSet;
import mage.constants.Rarity;
/**
*
* @author North
*/
public class PlanarChaos extends ExpansionSet {
private static final PlanarChaos fINSTANCE = new PlanarChaos();
public static PlanarChaos getInstance() {
return fINSTANCE;
}
private PlanarChaos() {
super("Planar Chaos", "PLC", ExpansionSet.buildDate(2007, 1, 2), SetType.EXPANSION);
this.blockName = "Time Spiral";
this.parentSet = TimeSpiral.getInstance();
this.hasBasicLands = false;
this.hasBoosters = true;
this.numBoosterLands = 0;
this.numBoosterCommon = 10;
this.numBoosterUncommon = 3;
this.numBoosterRare = 1;
this.ratioBoosterMythic = 0;
cards.add(new SetCardInfo("Aeon Chronicler", 32, Rarity.RARE, mage.cards.a.AeonChronicler.class));
cards.add(new SetCardInfo("Aether Membrane", 93, Rarity.UNCOMMON, mage.cards.a.AetherMembrane.class));
cards.add(new SetCardInfo("Akroma, Angel of Fury", 94, Rarity.RARE, mage.cards.a.AkromaAngelOfFury.class));
cards.add(new SetCardInfo("Ana Battlemage", 124, Rarity.UNCOMMON, mage.cards.a.AnaBattlemage.class));
cards.add(new SetCardInfo("Aquamorph Entity", 33, Rarity.COMMON, mage.cards.a.AquamorphEntity.class));
cards.add(new SetCardInfo("Aven Riftwatcher", 1, Rarity.COMMON, mage.cards.a.AvenRiftwatcher.class));
cards.add(new SetCardInfo("Battering Sliver", 95, Rarity.COMMON, mage.cards.b.BatteringSliver.class));
cards.add(new SetCardInfo("Benalish Commander", 2, Rarity.RARE, mage.cards.b.BenalishCommander.class));
cards.add(new SetCardInfo("Big Game Hunter", 63, Rarity.UNCOMMON, mage.cards.b.BigGameHunter.class));
cards.add(new SetCardInfo("Blightspeaker", 64, Rarity.COMMON, mage.cards.b.Blightspeaker.class));
cards.add(new SetCardInfo("Blood Knight", 115, Rarity.UNCOMMON, mage.cards.b.BloodKnight.class));
cards.add(new SetCardInfo("Body Double", 35, Rarity.RARE, mage.cards.b.BodyDouble.class));
cards.add(new SetCardInfo("Bog Serpent", 84, Rarity.COMMON, mage.cards.b.BogSerpent.class));
cards.add(new SetCardInfo("Boom // Bust", 112, Rarity.RARE, mage.cards.b.BoomBust.class));
cards.add(new SetCardInfo("Braids, Conjurer Adept", 36, Rarity.RARE, mage.cards.b.BraidsConjurerAdept.class));
cards.add(new SetCardInfo("Brain Gorgers", 65, Rarity.COMMON, mage.cards.b.BrainGorgers.class));
cards.add(new SetCardInfo("Brute Force", 116, Rarity.COMMON, mage.cards.b.BruteForce.class));
cards.add(new SetCardInfo("Calciderm", 23, Rarity.UNCOMMON, mage.cards.c.Calciderm.class));
cards.add(new SetCardInfo("Cautery Sliver", 154, Rarity.UNCOMMON, mage.cards.c.CauterySliver.class));
cards.add(new SetCardInfo("Chronozoa", 37, Rarity.RARE, mage.cards.c.Chronozoa.class));
cards.add(new SetCardInfo("Circle of Affliction", 66, Rarity.UNCOMMON, mage.cards.c.CircleOfAffliction.class));
cards.add(new SetCardInfo("Citanul Woodreaders", 125, Rarity.COMMON, mage.cards.c.CitanulWoodreaders.class));
cards.add(new SetCardInfo("Cradle to Grave", 67, Rarity.COMMON, mage.cards.c.CradleToGrave.class));
cards.add(new SetCardInfo("Crovax, Ascendant Hero", 3, Rarity.RARE, mage.cards.c.CrovaxAscendantHero.class));
cards.add(new SetCardInfo("Damnation", 85, Rarity.RARE, mage.cards.d.Damnation.class));
cards.add(new SetCardInfo("Darkheart Sliver", 155, Rarity.UNCOMMON, mage.cards.d.DarkheartSliver.class));
cards.add(new SetCardInfo("Dash Hopes", 68, Rarity.COMMON, mage.cards.d.DashHopes.class));
cards.add(new SetCardInfo("Dawn Charm", 4, Rarity.COMMON, mage.cards.d.DawnCharm.class));
cards.add(new SetCardInfo("Dead // Gone", 113, Rarity.COMMON, mage.cards.d.DeadGone.class));
cards.add(new SetCardInfo("Deadly Grub", 69, Rarity.COMMON, mage.cards.d.DeadlyGrub.class));
cards.add(new SetCardInfo("Deadwood Treefolk", 126, Rarity.UNCOMMON, mage.cards.d.DeadwoodTreefolk.class));
cards.add(new SetCardInfo("Detritivore", 96, Rarity.RARE, mage.cards.d.Detritivore.class));
cards.add(new SetCardInfo("Dismal Failure", 39, Rarity.UNCOMMON, mage.cards.d.DismalFailure.class));
cards.add(new SetCardInfo("Dormant Sliver", 156, Rarity.UNCOMMON, mage.cards.d.DormantSliver.class));
cards.add(new SetCardInfo("Dreamscape Artist", 40, Rarity.COMMON, mage.cards.d.DreamscapeArtist.class));
cards.add(new SetCardInfo("Dunerider Outlaw", 86, Rarity.UNCOMMON, mage.cards.d.DuneriderOutlaw.class));
cards.add(new SetCardInfo("Dust Corona", 97, Rarity.COMMON, mage.cards.d.DustCorona.class));
cards.add(new SetCardInfo("Dust Elemental", 5, Rarity.RARE, mage.cards.d.DustElemental.class));
cards.add(new SetCardInfo("Enslave", 70, Rarity.UNCOMMON, mage.cards.e.Enslave.class));
cards.add(new SetCardInfo("Erratic Mutation", 41, Rarity.COMMON, mage.cards.e.ErraticMutation.class));
cards.add(new SetCardInfo("Essence Warden", 145, Rarity.COMMON, mage.cards.e.EssenceWarden.class));
cards.add(new SetCardInfo("Evolution Charm", 127, Rarity.COMMON, mage.cards.e.EvolutionCharm.class));
cards.add(new SetCardInfo("Extirpate", 71, Rarity.RARE, mage.cards.e.Extirpate.class));
cards.add(new SetCardInfo("Fa'adiyah Seer", 146, Rarity.COMMON, mage.cards.f.FaadiyahSeer.class));
cards.add(new SetCardInfo("Fatal Frenzy", 98, Rarity.RARE, mage.cards.f.FatalFrenzy.class));
cards.add(new SetCardInfo("Firefright Mage", 99, Rarity.COMMON, mage.cards.f.FirefrightMage.class));
cards.add(new SetCardInfo("Frenetic Sliver", 157, Rarity.UNCOMMON, mage.cards.f.FreneticSliver.class));
cards.add(new SetCardInfo("Frozen Aether", 54, Rarity.UNCOMMON, mage.cards.f.FrozenAether.class));
cards.add(new SetCardInfo("Fungal Behemoth", 128, Rarity.RARE, mage.cards.f.FungalBehemoth.class));
cards.add(new SetCardInfo("Fury Charm", 100, Rarity.COMMON, mage.cards.f.FuryCharm.class));
cards.add(new SetCardInfo("Gaea's Anthem", 147, Rarity.RARE, mage.cards.g.GaeasAnthem.class));
cards.add(new SetCardInfo("Ghost Tactician", 6, Rarity.COMMON, mage.cards.g.GhostTactician.class));
cards.add(new SetCardInfo("Giant Dustwasp", 129, Rarity.COMMON, mage.cards.g.GiantDustwasp.class));
cards.add(new SetCardInfo("Gossamer Phantasm", 55, Rarity.COMMON, mage.cards.g.GossamerPhantasm.class));
cards.add(new SetCardInfo("Groundbreaker", 148, Rarity.RARE, mage.cards.g.Groundbreaker.class));
cards.add(new SetCardInfo("Hammerheim Deadeye", 101, Rarity.UNCOMMON, mage.cards.h.HammerheimDeadeye.class));
cards.add(new SetCardInfo("Harmonize", 149, Rarity.UNCOMMON, mage.cards.h.Harmonize.class));
cards.add(new SetCardInfo("Healing Leaves", 150, Rarity.COMMON, mage.cards.h.HealingLeaves.class));
cards.add(new SetCardInfo("Hedge Troll", 151, Rarity.UNCOMMON, mage.cards.h.HedgeTroll.class));
cards.add(new SetCardInfo("Heroes Remembered", 7, Rarity.RARE, mage.cards.h.HeroesRemembered.class));
cards.add(new SetCardInfo("Hunting Wilds", 130, Rarity.UNCOMMON, mage.cards.h.HuntingWilds.class));
cards.add(new SetCardInfo("Imp's Mischief", 72, Rarity.RARE, mage.cards.i.ImpsMischief.class));
cards.add(new SetCardInfo("Intet, the Dreamer", 158, Rarity.RARE, mage.cards.i.IntetTheDreamer.class));
cards.add(new SetCardInfo("Jedit Ojanen of Efrava", 131, Rarity.RARE, mage.cards.j.JeditOjanenOfEfrava.class));
cards.add(new SetCardInfo("Jodah's Avenger", 42, Rarity.UNCOMMON, mage.cards.j.JodahsAvenger.class));
cards.add(new SetCardInfo("Kavu Predator", 132, Rarity.UNCOMMON, mage.cards.k.KavuPredator.class));
cards.add(new SetCardInfo("Keen Sense", 152, Rarity.UNCOMMON, mage.cards.k.KeenSense.class));
cards.add(new SetCardInfo("Keldon Marauders", 102, Rarity.COMMON, mage.cards.k.KeldonMarauders.class));
cards.add(new SetCardInfo("Lavacore Elemental", 103, Rarity.UNCOMMON, mage.cards.l.LavacoreElemental.class));
cards.add(new SetCardInfo("Life and Limb", 133, Rarity.RARE, mage.cards.l.LifeAndLimb.class));
cards.add(new SetCardInfo("Magus of the Arena", 104, Rarity.RARE, mage.cards.m.MagusOfTheArena.class));
cards.add(new SetCardInfo("Magus of the Bazaar", 43, Rarity.RARE, mage.cards.m.MagusOfTheBazaar.class));
cards.add(new SetCardInfo("Magus of the Coffers", 73, Rarity.RARE, mage.cards.m.MagusOfTheCoffers.class));
cards.add(new SetCardInfo("Magus of the Library", 134, Rarity.RARE, mage.cards.m.MagusOfTheLibrary.class));
cards.add(new SetCardInfo("Magus of the Tabernacle", 8, Rarity.RARE, mage.cards.m.MagusOfTheTabernacle.class));
cards.add(new SetCardInfo("Malach of the Dawn", 24, Rarity.UNCOMMON, mage.cards.m.MalachOfTheDawn.class));
cards.add(new SetCardInfo("Mana Tithe", 25, Rarity.COMMON, mage.cards.m.ManaTithe.class));
cards.add(new SetCardInfo("Melancholy", 88, Rarity.COMMON, mage.cards.m.Melancholy.class));
cards.add(new SetCardInfo("Merfolk Thaumaturgist", 56, Rarity.COMMON, mage.cards.m.MerfolkThaumaturgist.class));
cards.add(new SetCardInfo("Mesa Enchantress", 26, Rarity.RARE, mage.cards.m.MesaEnchantress.class));
cards.add(new SetCardInfo("Midnight Charm", 74, Rarity.COMMON, mage.cards.m.MidnightCharm.class));
cards.add(new SetCardInfo("Mire Boa", 135, Rarity.COMMON, mage.cards.m.MireBoa.class));
cards.add(new SetCardInfo("Mirri the Cursed", 75, Rarity.RARE, mage.cards.m.MirriTheCursed.class));
cards.add(new SetCardInfo("Mycologist", 27, Rarity.UNCOMMON, mage.cards.m.Mycologist.class));
cards.add(new SetCardInfo("Necrotic Sliver", 159, Rarity.UNCOMMON, mage.cards.n.NecroticSliver.class));
cards.add(new SetCardInfo("Needlepeak Spider", 105, Rarity.COMMON, mage.cards.n.NeedlepeakSpider.class));
cards.add(new SetCardInfo("Null Profusion", 89, Rarity.RARE, mage.cards.n.NullProfusion.class));
cards.add(new SetCardInfo("Numot, the Devastator", 160, Rarity.RARE, mage.cards.n.NumotTheDevastator.class));
cards.add(new SetCardInfo("Oros, the Avenger", 161, Rarity.RARE, mage.cards.o.OrosTheAvenger.class));
cards.add(new SetCardInfo("Ovinize", 57, Rarity.UNCOMMON, mage.cards.o.Ovinize.class));
cards.add(new SetCardInfo("Pallid Mycoderm", 10, Rarity.COMMON, mage.cards.p.PallidMycoderm.class));
cards.add(new SetCardInfo("Phantasmagorian", 77, Rarity.UNCOMMON, mage.cards.p.Phantasmagorian.class));
cards.add(new SetCardInfo("Piracy Charm", 58, Rarity.COMMON, mage.cards.p.PiracyCharm.class));
cards.add(new SetCardInfo("Pongify", 44, Rarity.UNCOMMON, mage.cards.p.Pongify.class));
cards.add(new SetCardInfo("Porphyry Nodes", 28, Rarity.RARE, mage.cards.p.PorphyryNodes.class));
cards.add(new SetCardInfo("Poultice Sliver", 11, Rarity.COMMON, mage.cards.p.PoulticeSliver.class));
cards.add(new SetCardInfo("Pouncing Wurm", 136, Rarity.UNCOMMON, mage.cards.p.PouncingWurm.class));
cards.add(new SetCardInfo("Primal Plasma", 59, Rarity.COMMON, mage.cards.p.PrimalPlasma.class));
cards.add(new SetCardInfo("Prodigal Pyromancer", 118, Rarity.COMMON, mage.cards.p.ProdigalPyromancer.class));
cards.add(new SetCardInfo("Psychotrope Thallid", 137, Rarity.UNCOMMON, mage.cards.p.PsychotropeThallid.class));
cards.add(new SetCardInfo("Pyrohemia", 119, Rarity.UNCOMMON, mage.cards.p.Pyrohemia.class));
cards.add(new SetCardInfo("Radha, Heir to Keld", 162, Rarity.RARE, mage.cards.r.RadhaHeirToKeld.class));
cards.add(new SetCardInfo("Rathi Trapper", 90, Rarity.COMMON, mage.cards.r.RathiTrapper.class));
cards.add(new SetCardInfo("Reality Acid", 45, Rarity.COMMON, mage.cards.r.RealityAcid.class));
cards.add(new SetCardInfo("Rebuff the Wicked", 12, Rarity.UNCOMMON, mage.cards.r.RebuffTheWicked.class));
cards.add(new SetCardInfo("Reckless Wurm", 120, Rarity.UNCOMMON, mage.cards.r.RecklessWurm.class));
cards.add(new SetCardInfo("Reflex Sliver", 138, Rarity.COMMON, mage.cards.r.ReflexSliver.class));
cards.add(new SetCardInfo("Revered Dead", 29, Rarity.COMMON, mage.cards.r.ReveredDead.class));
cards.add(new SetCardInfo("Ridged Kusite", 78, Rarity.COMMON, mage.cards.r.RidgedKusite.class));
cards.add(new SetCardInfo("Riptide Pilferer", 60, Rarity.UNCOMMON, mage.cards.r.RiptidePilferer.class));
cards.add(new SetCardInfo("Roiling Horror", 79, Rarity.RARE, mage.cards.r.RoilingHorror.class));
cards.add(new SetCardInfo("Rough // Tumble", 114, Rarity.UNCOMMON, mage.cards.r.RoughTumble.class));
cards.add(new SetCardInfo("Saltblast", 15, Rarity.UNCOMMON, mage.cards.s.Saltblast.class));
cards.add(new SetCardInfo("Saltfield Recluse", 16, Rarity.COMMON, mage.cards.s.SaltfieldRecluse.class));
cards.add(new SetCardInfo("Seal of Primordium", 153, Rarity.COMMON, mage.cards.s.SealOfPrimordium.class));
cards.add(new SetCardInfo("Serendib Sorcerer", 61, Rarity.RARE, mage.cards.s.SerendibSorcerer.class));
cards.add(new SetCardInfo("Serra's Boon", 17, Rarity.UNCOMMON, mage.cards.s.SerrasBoon.class));
cards.add(new SetCardInfo("Serra Sphinx", 62, Rarity.RARE, mage.cards.s.SerraSphinx.class));
cards.add(new SetCardInfo("Shade of Trokair", 18, Rarity.COMMON, mage.cards.s.ShadeOfTrokair.class));
cards.add(new SetCardInfo("Shaper Parasite", 46, Rarity.COMMON, mage.cards.s.ShaperParasite.class));
cards.add(new SetCardInfo("Shivan Meteor", 106, Rarity.UNCOMMON, mage.cards.s.ShivanMeteor.class));
cards.add(new SetCardInfo("Shivan Wumpus", 121, Rarity.RARE, mage.cards.s.ShivanWumpus.class));
cards.add(new SetCardInfo("Shrouded Lore", 91, Rarity.UNCOMMON, mage.cards.s.ShroudedLore.class));
cards.add(new SetCardInfo("Simian Spirit Guide", 122, Rarity.COMMON, mage.cards.s.SimianSpiritGuide.class));
cards.add(new SetCardInfo("Sinew Sliver", 30, Rarity.COMMON, mage.cards.s.SinewSliver.class));
cards.add(new SetCardInfo("Skirk Shaman", 123, Rarity.COMMON, mage.cards.s.SkirkShaman.class));
cards.add(new SetCardInfo("Sophic Centaur", 139, Rarity.UNCOMMON, mage.cards.s.SophicCentaur.class));
cards.add(new SetCardInfo("Spellshift", 47, Rarity.RARE, mage.cards.s.Spellshift.class));
cards.add(new SetCardInfo("Spitting Sliver", 80, Rarity.COMMON, mage.cards.s.SpittingSliver.class));
cards.add(new SetCardInfo("Stingscourger", 107, Rarity.COMMON, mage.cards.s.Stingscourger.class));
cards.add(new SetCardInfo("Stonecloaker", 19, Rarity.UNCOMMON, mage.cards.s.Stonecloaker.class));
cards.add(new SetCardInfo("Stormfront Riders", 20, Rarity.UNCOMMON, mage.cards.s.StormfrontRiders.class));
cards.add(new SetCardInfo("Sulfur Elemental", 108, Rarity.UNCOMMON, mage.cards.s.SulfurElemental.class));
cards.add(new SetCardInfo("Sunlance", 31, Rarity.COMMON, mage.cards.s.Sunlance.class));
cards.add(new SetCardInfo("Synchronous Sliver", 48, Rarity.COMMON, mage.cards.s.SynchronousSliver.class));
cards.add(new SetCardInfo("Temporal Extortion", 81, Rarity.RARE, mage.cards.t.TemporalExtortion.class));
cards.add(new SetCardInfo("Teneb, the Harvester", 163, Rarity.RARE, mage.cards.t.TenebTheHarvester.class));
cards.add(new SetCardInfo("Tidewalker", 49, Rarity.UNCOMMON, mage.cards.t.Tidewalker.class));
cards.add(new SetCardInfo("Timbermare", 140, Rarity.RARE, mage.cards.t.Timbermare.class));
cards.add(new SetCardInfo("Timecrafting", 109, Rarity.UNCOMMON, mage.cards.t.Timecrafting.class));
cards.add(new SetCardInfo("Torchling", 110, Rarity.RARE, mage.cards.t.Torchling.class));
cards.add(new SetCardInfo("Uktabi Drake", 141, Rarity.COMMON, mage.cards.u.UktabiDrake.class));
cards.add(new SetCardInfo("Urborg, Tomb of Yawgmoth", 165, Rarity.RARE, mage.cards.u.UrborgTombOfYawgmoth.class));
cards.add(new SetCardInfo("Utopia Vow", 142, Rarity.COMMON, mage.cards.u.UtopiaVow.class));
cards.add(new SetCardInfo("Vampiric Link", 92, Rarity.COMMON, mage.cards.v.VampiricLink.class));
cards.add(new SetCardInfo("Venarian Glimmer", 52, Rarity.UNCOMMON, mage.cards.v.VenarianGlimmer.class));
cards.add(new SetCardInfo("Vitaspore Thallid", 143, Rarity.COMMON, mage.cards.v.VitasporeThallid.class));
cards.add(new SetCardInfo("Voidstone Gargoyle", 21, Rarity.RARE, mage.cards.v.VoidstoneGargoyle.class));
cards.add(new SetCardInfo("Vorosh, the Hunter", 164, Rarity.RARE, mage.cards.v.VoroshTheHunter.class));
cards.add(new SetCardInfo("Waning Wurm", 83, Rarity.UNCOMMON, mage.cards.w.WaningWurm.class));
cards.add(new SetCardInfo("Whitemane Lion", 22, Rarity.COMMON, mage.cards.w.WhitemaneLion.class));
cards.add(new SetCardInfo("Wild Pair", 144, Rarity.RARE, mage.cards.w.WildPair.class));
cards.add(new SetCardInfo("Wistful Thinking", 53, Rarity.COMMON, mage.cards.w.WistfulThinking.class));
}
}

View file

@ -120,6 +120,7 @@ public class RevisedEdition extends ExpansionSet {
cards.add(new SetCardInfo("Fork", 152, Rarity.RARE, mage.cards.f.Fork.class));
cards.add(new SetCardInfo("Frozen Shade", 20, Rarity.COMMON, mage.cards.f.FrozenShade.class));
cards.add(new SetCardInfo("Fungusaur", 104, Rarity.RARE, mage.cards.f.Fungusaur.class));
cards.add(new SetCardInfo("Gaea's Liege", 105, Rarity.RARE, mage.cards.g.GaeasLiege.class));
cards.add(new SetCardInfo("Giant Growth", 106, Rarity.COMMON, mage.cards.g.GiantGrowth.class));
cards.add(new SetCardInfo("Giant Spider", 107, Rarity.COMMON, mage.cards.g.GiantSpider.class));
cards.add(new SetCardInfo("Glasses of Urza", 249, Rarity.UNCOMMON, mage.cards.g.GlassesOfUrza.class));

View file

@ -121,6 +121,7 @@ public class Stronghold extends ExpansionSet {
cards.add(new SetCardInfo("Mogg Infestation", 93, Rarity.RARE, mage.cards.m.MoggInfestation.class));
cards.add(new SetCardInfo("Mogg Maniac", 94, Rarity.UNCOMMON, mage.cards.m.MoggManiac.class));
cards.add(new SetCardInfo("Morgue Thrull", 15, Rarity.COMMON, mage.cards.m.MorgueThrull.class));
cards.add(new SetCardInfo("Mortuary", 16, Rarity.RARE, mage.cards.m.Mortuary.class));
cards.add(new SetCardInfo("Mox Diamond", 132, Rarity.RARE, mage.cards.m.MoxDiamond.class));
cards.add(new SetCardInfo("Mulch", 60, Rarity.COMMON, mage.cards.m.Mulch.class));
cards.add(new SetCardInfo("Nomads en-Kor", 109, Rarity.COMMON, mage.cards.n.NomadsEnKor.class));

View file

@ -87,6 +87,7 @@ public class TimeSpiralTimeshifted extends ExpansionSet {
cards.add(new SetCardInfo("Flying Men", 20, Rarity.COMMON, mage.cards.f.FlyingMen.class));
cards.add(new SetCardInfo("Funeral Charm", 44, Rarity.COMMON, mage.cards.f.FuneralCharm.class));
cards.add(new SetCardInfo("Gaea's Blessing", 77, Rarity.SPECIAL, mage.cards.g.GaeasBlessing.class));
cards.add(new SetCardInfo("Gaea's Liege", 78, Rarity.SPECIAL, mage.cards.g.GaeasLiege.class));
cards.add(new SetCardInfo("Gemstone Mine", 119, Rarity.RARE, mage.cards.g.GemstoneMine.class));
cards.add(new SetCardInfo("Ghost Ship", 21, Rarity.SPECIAL, mage.cards.g.GhostShip.class));
cards.add(new SetCardInfo("Goblin Snowman", 64, Rarity.UNCOMMON, mage.cards.g.GoblinSnowman.class));

View file

@ -109,6 +109,7 @@ public class UnlimitedEdition extends ExpansionSet {
cards.add(new SetCardInfo("Fork", 153, Rarity.RARE, mage.cards.f.Fork.class));
cards.add(new SetCardInfo("Frozen Shade", 18, Rarity.COMMON, mage.cards.f.FrozenShade.class));
cards.add(new SetCardInfo("Fungusaur", 104, Rarity.RARE, mage.cards.f.Fungusaur.class));
cards.add(new SetCardInfo("Gaea's Liege", 105, Rarity.RARE, mage.cards.g.GaeasLiege.class));
cards.add(new SetCardInfo("Gauntlet of Might", 245, Rarity.RARE, mage.cards.g.GauntletOfMight.class));
cards.add(new SetCardInfo("Giant Growth", 106, Rarity.COMMON, mage.cards.g.GiantGrowth.class));
cards.add(new SetCardInfo("Giant Spider", 107, Rarity.COMMON, mage.cards.g.GiantSpider.class));
@ -142,6 +143,7 @@ public class UnlimitedEdition extends ExpansionSet {
cards.add(new SetCardInfo("Island Sanctuary", 210, Rarity.RARE, mage.cards.i.IslandSanctuary.class));
cards.add(new SetCardInfo("Ivory Cup", 252, Rarity.UNCOMMON, mage.cards.i.IvoryCup.class));
cards.add(new SetCardInfo("Jade Monolith", 253, Rarity.RARE, mage.cards.j.JadeMonolith.class));
cards.add(new SetCardInfo("Jade Statue", 254, Rarity.UNCOMMON, mage.cards.j.JadeStatue.class));
cards.add(new SetCardInfo("Jayemdae Tome", 255, Rarity.RARE, mage.cards.j.JayemdaeTome.class));
cards.add(new SetCardInfo("Juggernaut", 256, Rarity.UNCOMMON, mage.cards.j.Juggernaut.class));
cards.add(new SetCardInfo("Jump", 61, Rarity.COMMON, mage.cards.j.Jump.class));

View file

@ -199,6 +199,7 @@ public class UrzasSaga extends ExpansionSet {
cards.add(new SetCardInfo("Karn, Silver Golem", 298, Rarity.RARE, mage.cards.k.KarnSilverGolem.class));
cards.add(new SetCardInfo("Launch", 82, Rarity.COMMON, mage.cards.l.Launch.class));
cards.add(new SetCardInfo("Lay Waste", 201, Rarity.COMMON, mage.cards.l.LayWaste.class));
cards.add(new SetCardInfo("Lifeline", 299, Rarity.RARE, mage.cards.l.Lifeline.class));
cards.add(new SetCardInfo("Lightning Dragon", 202, Rarity.RARE, mage.cards.l.LightningDragon.class));
cards.add(new SetCardInfo("Lilting Refrain", 83, Rarity.UNCOMMON, mage.cards.l.LiltingRefrain.class));
cards.add(new SetCardInfo("Lingering Mirage", 84, Rarity.UNCOMMON, mage.cards.l.LingeringMirage.class));

View file

@ -0,0 +1,86 @@
/*
* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* The views and conclusions contained in the software and documentation are those of the
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of BetaSteward_at_googlemail.com.
*/
package org.mage.test.cards.abilities.equipped;
import mage.constants.PhaseStep;
import mage.constants.Zone;
import mage.game.permanent.Permanent;
import org.junit.Assert;
import org.junit.Test;
import org.mage.test.serverside.base.CardTestPlayerBase;
/**
*
* @author LevelX2
*/
public class SwordOfTheMeekTest extends CardTestPlayerBase {
/**
* Played a game vs. the AI when I noticed the following:
*
* Had Master of Etherium and Myrsmith in play, Sword of the Meek in the
* graveyard. I cast an artifact spell, Myrsmith triggers. I pay {1} to get
* a Myr token which enters the battlefield as a 2/2 (due to Master of
* Etherium), but Sword of the Meek triggers regardless and I can have it
* enter the battlefield attached to the token. Also, Myrsmith's trigger
* wasn't optional, it didn't ask whether I wanted to pay or not.
*/
@Test
public void testEquipAlive() {
// Master of Etherium's power and toughness are each equal to the number of artifacts you control.
// Other artifact creatures you control get +1/+1.
addCard(Zone.BATTLEFIELD, playerA, "Master of Etherium", 1); // Creature 1/1
// Whenever you cast an artifact spell, you may pay . If you do, put a 1/1 colorless Myr artifact creature token onto the battlefield.
addCard(Zone.BATTLEFIELD, playerA, "Myrsmith", 1); // Creature 1/1
addCard(Zone.BATTLEFIELD, playerA, "Plains", 2);
addCard(Zone.HAND, playerA, "Chromatic Star");
// Equipped creature gets +1/+2.
// Equip {2}
// Whenever a 1/1 creature enters the battlefield under your control, you may return Sword of the Meek from your graveyard to the battlefield, then attach it to that creature.
addCard(Zone.GRAVEYARD, playerA, "Sword of the Meek");
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Chromatic Star");
setStopAt(1, PhaseStep.BEGIN_COMBAT);
execute();
assertPermanentCount(playerA, "Chromatic Star", 1);
assertPermanentCount(playerA, "Myr", 1);
assertPowerToughness(playerA, "Myr", 2, 2);
assertPermanentCount(playerA, "Sword of the Meek", 0);
assertPowerToughness(playerA, "Master of Etherium", 3, 3);
Permanent myr = getPermanent("Myr", playerA.getId());
Assert.assertTrue("Myr may not have any attachments", myr.getAttachments().isEmpty());
}
}

View file

@ -54,6 +54,7 @@ public class ReflectingPoolTest extends CardTestPlayerBase {
addCard(Zone.HAND, playerA, "Crumbling Vestige", 1);
playLand(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Crumbling Vestige");
setChoice(playerA, "Red");
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Lightning Bolt", playerB);
setStopAt(1, PhaseStep.BEGIN_COMBAT);

View file

@ -53,7 +53,7 @@ public class HavengulLichTest extends CardTestPlayerBase {
@Test
public void testCard2() {
addCard(Zone.BATTLEFIELD, playerA, "Mountain", 4);
// {1}: You may cast target creature card in a graveyard this turn. When you cast that card this turn, Havengul Lich
// {1}: You may cast target creature card in a graveyard this turn. When you cast that card this turn, Havengul Lich
// gains all activated abilities of that card until end of turn.
addCard(Zone.BATTLEFIELD, playerA, "Havengul Lich");
// {T}: Prodigal Pyromancer deals 1 damage to target creature or player.
@ -75,4 +75,42 @@ public class HavengulLichTest extends CardTestPlayerBase {
assertGraveyardCount(playerA, 0);
}
/**
* hey i play a Havengul Lich and Heartless Summoning deck. and every time
* the lich is on the field as the same time as heartless summoning i cant
* use the lich's ability correctly. because if you know magic you know that
* a creature with one toughness will still enter the battlefield and
* immediately die but the creature's effect will still trigger. like when i
* "cast" Perilous Myr from the graveyard with the lich it doesn't actually
* enter the battlefield and its death ability doesn't trigger! and that is
* one of my decks i cast from the graveyard with the lich and things are
* SUPPOSED to enter the battlefield and die triggering whatever ability the
* creature might have alot like "myr retriever"! plz fix it, this is the
* second time i have had to mention this problem!
*/
@Test
public void testCardHeartlessSummoning() {
addCard(Zone.BATTLEFIELD, playerA, "Mountain", 1);
// {1}: You may cast target creature card in a graveyard this turn. When you cast that card this turn, Havengul Lich
// gains all activated abilities of that card until end of turn.
addCard(Zone.BATTLEFIELD, playerA, "Havengul Lich");
// Creature spells you cast cost {2} less to cast.
// Creatures you control get -1/-1.
addCard(Zone.BATTLEFIELD, playerA, "Heartless Summoning"); // Enchantment
// When Perilous Myr dies, it deals 2 damage to target creature or player.
addCard(Zone.GRAVEYARD, playerA, "Perilous Myr");
activateAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "{1}: You may", "Perilous Myr");
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Perilous Myr");
addTarget(playerA, playerB);
execute();
assertLife(playerA, 20);
assertLife(playerB, 18);
assertPermanentCount(playerA, "Havengul Lich", 1);
assertGraveyardCount(playerA, "Perilous Myr", 1);
}
}

View file

@ -0,0 +1,69 @@
/*
* 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 org.mage.test.cards.triggers.delayed;
import mage.constants.PhaseStep;
import mage.constants.Zone;
import org.junit.Test;
import org.mage.test.serverside.base.CardTestPlayerBase;
/**
*
* @author LevelX2
*/
public class MeriekeRiBeritTest extends CardTestPlayerBase {
/**
* Opponent-controlled Merieke Ri Berit, and it had stolen a creature of
* mine. When I killed Merieke, I got my creature back instead of it being
* destroyed.
*/
@Test
public void testCreatureWasDestroyed() {
addCard(Zone.HAND, playerA, "Lightning Bolt", 1);
addCard(Zone.BATTLEFIELD, playerA, "Mountain", 1);
addCard(Zone.BATTLEFIELD, playerA, "Silvercoat Lion", 1);
// Merieke Ri Berit doesn't untap during your untap step.
// {T}: Gain control of target creature for as long as you control Merieke Ri Berit. When Merieke Ri Berit leaves the battlefield or becomes untapped, destroy that creature. It can't be regenerated.
addCard(Zone.BATTLEFIELD, playerB, "Merieke Ri Berit", 1); // Creature 1/1
activateAbility(2, PhaseStep.PRECOMBAT_MAIN, playerB, "{T}: Gain control", "Silvercoat Lion");
castSpell(2, PhaseStep.POSTCOMBAT_MAIN, playerA, "Lightning Bolt", "Merieke Ri Berit");
setStopAt(2, PhaseStep.END_TURN);
execute();
assertGraveyardCount(playerA, "Lightning Bolt", 1);
assertGraveyardCount(playerB, "Merieke Ri Berit", 1);
assertPermanentCount(playerA, "Silvercoat Lion", 0);
assertGraveyardCount(playerA, "Silvercoat Lion", 1);
}
}

View file

@ -0,0 +1,110 @@
/*
* 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 org.mage.test.cards.triggers.dies;
import mage.constants.PhaseStep;
import mage.constants.Zone;
import org.junit.Test;
import org.mage.test.serverside.base.CardTestPlayerBase;
/**
*
* @author LevelX2
*/
public class ReturnOnlyFromGraveyardTest extends CardTestPlayerBase {
/**
* Effects like Gift of Immortality and Fool's Demise are able to return
* Academy Rector to the battlefield after the exile trigger if they are put
* on the stack after.
*/
@Test
public void testFoolsDemise() {
// When Academy Rector dies, you may exile it. If you do, search your library for an enchantment card, put that card onto the battlefield, then shuffle your library.
addCard(Zone.BATTLEFIELD, playerA, "Academy Rector", 1); // Creature 1/2
addCard(Zone.BATTLEFIELD, playerA, "Island", 5);
addCard(Zone.LIBRARY, playerA, "Primal Rage", 2);
// Enchant creature
// When enchanted creature dies, return that card to the battlefield under your control.
// When Fool's Demise is put into a graveyard from the battlefield, return Fool's Demise to its owner's hand.
addCard(Zone.HAND, playerA, "Fool's Demise"); // Enchantment {4}{U}
addCard(Zone.BATTLEFIELD, playerB, "Mountain", 1);
addCard(Zone.HAND, playerB, "Lightning Bolt");
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Fool's Demise", "Academy Rector");
castSpell(1, PhaseStep.POSTCOMBAT_MAIN, playerB, "Lightning Bolt", "Academy Rector");
setChoice(playerA, "Yes");
addTarget(playerA, "Primal Rage");
setStopAt(1, PhaseStep.END_TURN);
execute();
assertGraveyardCount(playerB, "Lightning Bolt", 1);
assertHandCount(playerA, "Fool's Demise", 1);
assertPermanentCount(playerA, "Primal Rage", 1);
assertExileCount("Academy Rector", 1);
}
@Test
public void testGiftOfImmortality() {
// When Academy Rector dies, you may exile it. If you do, search your library for an enchantment card, put that card onto the battlefield, then shuffle your library.
addCard(Zone.BATTLEFIELD, playerA, "Academy Rector", 1); // Creature 1/2
addCard(Zone.BATTLEFIELD, playerA, "Plains", 3);
addCard(Zone.LIBRARY, playerA, "Primal Rage", 2);
// Enchant creature
// When enchanted creature dies, return that card to the battlefield under its owner's control.
// Return Gift of Immortality to the battlefield attached to that creature at the beginning of the next end step.
addCard(Zone.HAND, playerA, "Gift of Immortality"); // Enchantment {2}{W}
addCard(Zone.BATTLEFIELD, playerB, "Mountain", 1);
addCard(Zone.HAND, playerB, "Lightning Bolt");
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Gift of Immortality", "Academy Rector");
castSpell(1, PhaseStep.BEGIN_COMBAT, playerB, "Lightning Bolt", "Academy Rector");
setChoice(playerA, "Yes");
addTarget(playerA, "Primal Rage");
setStopAt(1, PhaseStep.END_COMBAT);
execute();
assertGraveyardCount(playerB, "Lightning Bolt", 1);
assertGraveyardCount(playerA, "Gift of Immortality", 1);
assertPermanentCount(playerA, "Primal Rage", 1);
assertExileCount("Academy Rector", 1);
}
}

View file

@ -0,0 +1,24 @@
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package mage.abilities;
import mage.cards.Card;
import mage.game.Game;
import mage.players.Player;
/**
*
* @author LevelX2
*/
public interface OpeningHandAction {
boolean askUseOpeningHandAction(Card card, Player player, Game game);
boolean isOpeningHandActionAllowed(Card card, Player player, Game game);
void doOpeningHandAction(Card card, Player player, Game game);
}

View file

@ -31,6 +31,7 @@ import java.util.UUID;
import mage.MageObject;
import mage.abilities.effects.Effect;
import mage.constants.AbilityType;
import mage.constants.Outcome;
import mage.constants.Zone;
import mage.game.Game;
import mage.game.events.GameEvent;
@ -88,7 +89,7 @@ public abstract class TriggeredAbilityImpl extends AbilityImpl implements Trigge
MageObject object = game.getObject(getSourceId());
Player player = game.getPlayer(this.getControllerId());
if (player != null && object != null) {
if (!player.chooseUse(getEffects().get(0).getOutcome(), this.getRule(object.getLogName()), this, game)) {
if (!player.chooseUse(getEffects().isEmpty() ? Outcome.Detriment : getEffects().get(0).getOutcome(), this.getRule(object.getLogName()), this, game)) {
return false;
}
} else {

View file

@ -29,17 +29,22 @@ package mage.abilities.common;
import mage.abilities.Ability;
import mage.abilities.DelayedTriggeredAbility;
import mage.abilities.OpeningHandAction;
import mage.abilities.StaticAbility;
import mage.abilities.effects.OneShotEffect;
import mage.cards.Card;
import mage.cards.Cards;
import mage.cards.CardsImpl;
import mage.constants.Outcome;
import mage.constants.Zone;
import mage.game.Game;
import mage.players.Player;
/**
*
* @author BetaSteward_at_googlemail.com
*/
public class ChancellorAbility extends StaticAbility {
public class ChancellorAbility extends StaticAbility implements OpeningHandAction {
public ChancellorAbility(DelayedTriggeredAbility ability, String text) {
super(Zone.HAND, new ChancellorEffect(ability, text));
@ -63,6 +68,23 @@ public class ChancellorAbility extends StaticAbility {
return "You may reveal this card from your opening hand. If you do, " + super.getRule();
}
@Override
public boolean askUseOpeningHandAction(Card card, Player player, Game game) {
return player.chooseUse(Outcome.PutCardInPlay, "Do you wish to reveal " + card.getIdName() + "?", this, game);
}
@Override
public boolean isOpeningHandActionAllowed(Card card, Player player, Game game) {
return true;
}
@Override
public void doOpeningHandAction(Card card, Player player, Game game) {
Cards cards = new CardsImpl();
cards.add(card);
player.revealCards(card.getName(), cards, game);
this.resolve(game);
}
}
class ChancellorEffect extends OneShotEffect {

View file

@ -1,104 +0,0 @@
/*
* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* The views and conclusions contained in the software and documentation are those of the
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of BetaSteward_at_googlemail.com.
*/
package mage.abilities.common;
/**
*
* @author emerald000
*/
import mage.abilities.Ability;
import mage.abilities.StaticAbility;
import mage.abilities.costs.Cost;
import mage.abilities.costs.common.ExileFromHandCost;
import mage.abilities.effects.OneShotEffect;
import mage.cards.Card;
import mage.constants.Outcome;
import mage.constants.Zone;
import mage.counters.CounterType;
import mage.game.Game;
import mage.game.permanent.Permanent;
import mage.players.Player;
import mage.target.common.TargetCardInHand;
public class GemstoneCavernsAbility extends StaticAbility {
public GemstoneCavernsAbility() {
super(Zone.HAND, new GemstoneCavernsEffect());
}
public GemstoneCavernsAbility(final GemstoneCavernsAbility ability) {
super(ability);
}
@Override
public GemstoneCavernsAbility copy() {
return new GemstoneCavernsAbility(this);
}
@Override
public String getRule() {
return "If {this} is in your opening hand and you're not playing first, you may begin the game with {this} on the battlefield with a luck counter on it. If you do, exile a card from your hand.";
}
}
class GemstoneCavernsEffect extends OneShotEffect {
GemstoneCavernsEffect() {
super(Outcome.PutCardInPlay);
this.staticText = "you may begin the game with {this} on the battlefield with a luck counter on it. If you do, exile a card from your hand.";
}
GemstoneCavernsEffect(final GemstoneCavernsEffect effect) {
super(effect);
}
@Override
public GemstoneCavernsEffect copy() {
return new GemstoneCavernsEffect(this);
}
@Override
public boolean apply(Game game, Ability source) {
Player player = game.getPlayer(source.getControllerId());
if (player != null) {
Card card = game.getCard(source.getSourceId());
if (card != null) {
if (card.putOntoBattlefield(game, Zone.HAND, source.getSourceId(), source.getControllerId())) {
Permanent permanent = game.getPermanent(card.getId());
if (permanent != null) {
permanent.addCounters(CounterType.LUCK.createInstance(), game);
Cost cost = new ExileFromHandCost(new TargetCardInHand());
if (cost.canPay(source, source.getSourceId(), source.getControllerId(), game)) {
cost.pay(source, game, source.getSourceId(), source.getControllerId(), true, null);
}
}
}
}
}
return false;
}
}

View file

@ -0,0 +1,30 @@
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package mage.abilities.condition.common;
import mage.abilities.Ability;
import mage.abilities.condition.Condition;
import mage.game.Game;
import mage.game.permanent.Permanent;
/**
*
* @author anonymous
*/
public class AttackingCondition implements Condition {
private static final AttachedCondition fInstance = new AttachedCondition();
public static AttachedCondition getInstance() {
return fInstance;
}
@Override
public boolean apply(Game game, Ability source) {
Permanent permanent = game.getPermanent(source.getSourceId());
return permanent != null && permanent.isAttacking();
}
}

View file

@ -131,10 +131,10 @@ public class AlternativeCostSourceAbility extends StaticAbility implements Alter
@Override
public boolean isAvailable(Ability source, Game game) {
if (condition != null) {
return condition.apply(game, source);
}
return true;
boolean conditionApplies = condition == null || condition.apply(game, source);
boolean filterApplies = filter == null || filter.match(game.getCard(source.getSourceId()), game);
return conditionApplies && filterApplies;
}
@Override

View file

@ -32,6 +32,7 @@ import mage.abilities.DelayedTriggeredAbility;
import mage.abilities.Mode;
import mage.abilities.effects.Effect;
import mage.abilities.effects.OneShotEffect;
import mage.constants.Outcome;
import mage.game.Game;
/**
@ -53,7 +54,7 @@ public class CreateDelayedTriggeredAbilityEffect extends OneShotEffect {
}
public CreateDelayedTriggeredAbilityEffect(DelayedTriggeredAbility ability, boolean copyTargets, boolean initAbility) {
super(ability.getEffects().get(0).getOutcome());
super(ability.getEffects().isEmpty() ? Outcome.Detriment : ability.getEffects().get(0).getOutcome());
this.ability = ability;
this.copyTargets = copyTargets;
this.initAbility = initAbility;

View file

@ -25,13 +25,13 @@
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of BetaSteward_at_googlemail.com.
*/
package mage.abilities.effects.common;
import mage.abilities.Ability;
import mage.abilities.Mode;
import mage.abilities.SpecialAction;
import mage.abilities.effects.OneShotEffect;
import mage.constants.Outcome;
import mage.game.Game;
/**
@ -43,7 +43,7 @@ public class CreateSpecialActionEffect extends OneShotEffect {
protected SpecialAction action;
public CreateSpecialActionEffect(SpecialAction action) {
super(action.getEffects().get(0).getOutcome());
super(action.getEffects().isEmpty() ? Outcome.Detriment : action.getEffects().get(0).getOutcome());
this.action = action;
}

View file

@ -97,6 +97,7 @@ public class CreateTokenEffect extends OneShotEffect {
token.putOntoBattlefield(value, game, source.getSourceId(), source.getControllerId(), tapped, attacking);
this.lastAddedTokenId = token.getLastAddedToken();
this.lastAddedTokenIds = token.getLastAddedTokenIds();
return true;
}

View file

@ -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,21 +20,21 @@
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
*
* The views and conclusions contained in the software and documentation are those of the
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of BetaSteward_at_googlemail.com.
*/
package mage.abilities.effects.common;
import mage.constants.Outcome;
import mage.constants.Zone;
import mage.abilities.Ability;
import mage.abilities.effects.OneShotEffect;
import mage.cards.Card;
import mage.constants.Outcome;
import mage.constants.Zone;
import mage.game.Game;
import mage.game.permanent.Permanent;
import mage.players.Player;
/**
*
@ -59,13 +59,13 @@ public class ReturnToBattlefieldUnderYourControlAttachedEffect extends OneShotEf
@Override
public boolean apply(Game game, Ability source) {
Object object = getValue("attachedTo");
if (object != null && object instanceof Permanent) {
Card card = game.getCard(((Permanent)object).getId());
if (card != null) {
Zone currentZone = game.getState().getZone(card.getId());
if (card.putOntoBattlefield(game, currentZone, source.getSourceId(), source.getControllerId())) {
return true;
}
Player controller = game.getPlayer(source.getControllerId());
if (controller != null && object != null && object instanceof Permanent) {
Card card = game.getCard(((Permanent) object).getId());
// Move the card only, if it is still in the next zone after the battlefield
if (card != null && card.getZoneChangeCounter(game) == ((Permanent) object).getZoneChangeCounter(game) + 1) {
controller.moveCards(card, Zone.BATTLEFIELD, source, game, false, false, false, null);
return true;
}
}

View file

@ -146,7 +146,6 @@ public class BoostControlledEffect extends ContinuousEffectImpl {
perm.addToughness(toughness.calculate(game, source, this));
}
}
}
return true;
}

View file

@ -58,7 +58,8 @@ public class GainControlTargetEffect extends ContinuousEffectImpl {
/**
*
* @param duration
* @param fixedControl Controlling player is fixed even if the controller of the ability changes later
* @param fixedControl Controlling player is fixed even if the controller of
* the ability changes later
*/
public GainControlTargetEffect(Duration duration, boolean fixedControl) {
this(duration, fixedControl, null);
@ -104,23 +105,22 @@ public class GainControlTargetEffect extends ContinuousEffectImpl {
Player controller = game.getPlayer(source.getControllerId());
if (controller != null) {
boolean targetStillExists = false;
for (UUID permanentId: getTargetPointer().getTargets(game, source)) {
for (UUID permanentId : getTargetPointer().getTargets(game, source)) {
Permanent permanent = game.getPermanent(permanentId);
if (permanent != null) {
targetStillExists = true;
GameEvent loseControlEvent = GameEvent.getEvent(GameEvent.EventType.LOSE_CONTROL, permanentId, source.getId(), permanent.getControllerId());
if (game.replaceEvent(loseControlEvent)) {
return false;
}
if (controllingPlayerId != null) {
permanent.changeControllerId(controllingPlayerId, game);
permanent.getAbilities().setControllerId(controllingPlayerId);
} else {
permanent.changeControllerId(source.getControllerId(), game);
permanent.getAbilities().setControllerId(source.getControllerId());
if (!permanent.getControllerId().equals(controllingPlayerId)) {
GameEvent loseControlEvent = GameEvent.getEvent(GameEvent.EventType.LOSE_CONTROL, permanentId, source.getId(), permanent.getControllerId());
if (game.replaceEvent(loseControlEvent)) {
return false;
}
if (controllingPlayerId != null) {
permanent.changeControllerId(controllingPlayerId, game);
permanent.getAbilities().setControllerId(controllingPlayerId);
} else {
permanent.changeControllerId(source.getControllerId(), game);
permanent.getAbilities().setControllerId(source.getControllerId());
}
}
}
}
@ -140,16 +140,14 @@ public class GainControlTargetEffect extends ContinuousEffectImpl {
}
Target target = mode.getTargets().get(0);
StringBuilder sb = new StringBuilder("gain control of ");
if (target.getMaxNumberOfTargets() > 1){
if (target.getMaxNumberOfTargets() > 1) {
if (target.getNumberOfTargets() < target.getMaxNumberOfTargets()) {
sb.append("up to ");
}
sb.append(CardUtil.numberToText(target.getMaxNumberOfTargets())).append(" target ");
} else {
if (!target.getTargetName().startsWith("another")) {
} else if (!target.getTargetName().startsWith("another")) {
sb.append("target ");
}
}
sb.append(mode.getTargets().get(0).getTargetName());
if (!duration.toString().isEmpty()) {
sb.append(" ").append(duration.toString());

View file

@ -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,27 +20,30 @@
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
*
* The views and conclusions contained in the software and documentation are those of the
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of BetaSteward_at_googlemail.com.
*/
package mage.abilities.keyword;
import mage.constants.Zone;
import mage.abilities.MageSingleton;
import mage.abilities.StaticAbility;
import java.io.ObjectStreamException;
import mage.abilities.MageSingleton;
import mage.abilities.OpeningHandAction;
import mage.abilities.StaticAbility;
import mage.cards.Card;
import mage.constants.Outcome;
import mage.constants.Zone;
import mage.game.Game;
import mage.players.Player;
/**
*
* @author BetaSteward_at_googlemail.com
*/
public class LeylineAbility extends StaticAbility implements MageSingleton {
public class LeylineAbility extends StaticAbility implements MageSingleton, OpeningHandAction {
private static final LeylineAbility fINSTANCE = new LeylineAbility();
private static final LeylineAbility fINSTANCE = new LeylineAbility();
private Object readResolve() throws ObjectStreamException {
return fINSTANCE;
@ -64,4 +67,18 @@ public class LeylineAbility extends StaticAbility implements MageSingleton {
return fINSTANCE;
}
@Override
public boolean askUseOpeningHandAction(Card card, Player player, Game game) {
return player.chooseUse(Outcome.PutCardInPlay, "Do you wish to put " + card.getName() + " on the battlefield?", this, game);
}
@Override
public boolean isOpeningHandActionAllowed(Card card, Player player, Game game) {
return true;
}
@Override
public void doOpeningHandAction(Card card, Player player, Game game) {
player.moveCards(card, Zone.BATTLEFIELD, this, game);
}
}

View file

@ -98,7 +98,7 @@ class MyriadEffect extends OneShotEffect {
}
List<Permanent> tokens = new ArrayList<>();
for (UUID playerId : game.getState().getPlayersInRange(controller.getId(), game)) {
if (playerId != defendingPlayerId && controller.hasOpponent(playerId, game)) {
if (!playerId.equals(defendingPlayerId) && controller.hasOpponent(playerId, game)) {
Player opponent = game.getPlayer(playerId);
if (opponent != null && controller.chooseUse(Outcome.PutCreatureInPlay,
"Put a copy of " + sourceObject.getIdName() + " onto battlefield attacking " + opponent.getName() + "?", source, game)) {

View file

@ -48,17 +48,15 @@ import mage.MageObject;
import mage.abilities.Ability;
import mage.abilities.ActivatedAbility;
import mage.abilities.DelayedTriggeredAbility;
import mage.abilities.OpeningHandAction;
import mage.abilities.SpellAbility;
import mage.abilities.TriggeredAbility;
import mage.abilities.common.AttachableToRestrictedAbility;
import mage.abilities.common.ChancellorAbility;
import mage.abilities.common.GemstoneCavernsAbility;
import mage.abilities.effects.ContinuousEffect;
import mage.abilities.effects.ContinuousEffects;
import mage.abilities.effects.Effect;
import mage.abilities.effects.PreventionEffectData;
import mage.abilities.effects.common.CopyEffect;
import mage.abilities.keyword.LeylineAbility;
import mage.abilities.keyword.MorphAbility;
import mage.abilities.keyword.TransformAbility;
import mage.abilities.mana.DelayedTriggeredManaAbility;
@ -84,6 +82,7 @@ import mage.constants.Zone;
import mage.counters.CounterType;
import mage.counters.Counters;
import mage.filter.Filter;
import mage.filter.FilterCard;
import mage.filter.FilterPermanent;
import mage.filter.common.FilterControlledCreaturePermanent;
import mage.filter.common.FilterPlaneswalkerPermanent;
@ -119,6 +118,7 @@ import mage.players.Player;
import mage.players.PlayerList;
import mage.players.Players;
import mage.target.Target;
import mage.target.TargetCard;
import mage.target.TargetPermanent;
import mage.target.TargetPlayer;
import mage.util.GameLog;
@ -1028,35 +1028,39 @@ public abstract class GameImpl implements Game, Serializable {
//20100716 - 103.5
for (UUID playerId : state.getPlayerList(startingPlayerId)) {
Player player = getPlayer(playerId);
Cards cardsWithOpeningAction = new CardsImpl();
for (Card card : player.getHand().getCards(this)) {
if (player.getHand().contains(card.getId())) {
if (card.getAbilities().containsKey(LeylineAbility.getInstance().getId())) {
if (player.chooseUse(Outcome.PutCardInPlay, "Do you wish to put " + card.getName() + " on the battlefield?", null, this)) {
card.putOntoBattlefield(this, Zone.HAND, null, player.getId());
}
}
for (Ability ability : card.getAbilities()) {
if (ability instanceof ChancellorAbility) {
if (player.chooseUse(Outcome.PutCardInPlay, "Do you wish to reveal " + card.getName() + "?", ability, this)) {
Cards cards = new CardsImpl();
cards.add(card);
player.revealCards("Revealed", cards, this);
ability.resolve(this);
}
}
if (ability instanceof GemstoneCavernsAbility) {
if (!playerId.equals(startingPlayerId)) {
if (player.chooseUse(Outcome.PutCardInPlay, "Do you wish to put " + card.getName() + " into play?", ability, this)) {
Cards cards = new CardsImpl();
cards.add(card);
player.revealCards("Revealed", cards, this);
ability.resolve(this);
}
}
for (Ability ability : card.getAbilities()) {
if (ability instanceof OpeningHandAction) {
OpeningHandAction action = (OpeningHandAction) ability;
if (action.isOpeningHandActionAllowed(card, player, this)) {
cardsWithOpeningAction.add(card);
}
}
}
}
while (!cardsWithOpeningAction.isEmpty() && player.canRespond()) {
Card card;
if (cardsWithOpeningAction.size() > 1) {
TargetCard targetCard = new TargetCard(1, Zone.HAND, new FilterCard("card for opening hand action"));
player.chooseTarget(Outcome.Benefit, cardsWithOpeningAction, targetCard, null, this);
card = getCard(targetCard.getFirstTarget());
} else {
card = cardsWithOpeningAction.getRandom(this);
}
if (card != null) {
for (Ability ability : card.getAbilities()) {
if (ability instanceof OpeningHandAction) {
OpeningHandAction action = (OpeningHandAction) ability;
if (action.askUseOpeningHandAction(card, player, this)) {
action.doOpeningHandAction(card, player, this);
}
}
}
}
cardsWithOpeningAction.remove(card);
}
}
}
@ -1397,6 +1401,7 @@ public abstract class GameImpl implements Game, Serializable {
@Override
public synchronized void applyEffects() {
resetShortLivingLKI();
state.applyEffects(this);
}

View file

@ -544,11 +544,10 @@ public class GameState implements Serializable, Copyable<GameState> {
// 608.2e
public void processAction(Game game) {
game.getState().handleSimultaneousEvent(game);
applyEffects(game);
game.applyEffects();
}
public void applyEffects(Game game) {
game.resetShortLivingLKI();
for (Player player : players.values()) {
player.reset();
}
@ -563,13 +562,13 @@ public class GameState implements Serializable, Copyable<GameState> {
public void removeEocEffects(Game game) {
effects.removeEndOfCombatEffects();
delayed.removeEndOfCombatAbilities();
applyEffects(game);
game.applyEffects();
}
public void removeEotEffects(Game game) {
effects.removeEndOfTurnEffects();
delayed.removeEndOfTurnAbilities();
applyEffects(game);
game.applyEffects();
}
public void addEffect(ContinuousEffect effect, Ability source) {

View file

@ -234,6 +234,7 @@ public class Token extends MageObjectImpl {
}
}
game.getState().applyEffects(game); // Needed to do it here without LKIReset i.e. do get SwordOfTheMeekTest running correctly.
return true;
}
return false;

View file

@ -54,6 +54,7 @@ import mage.constants.AbilityType;
import mage.constants.AbilityWord;
import mage.constants.CardType;
import mage.constants.EffectType;
import mage.constants.Outcome;
import mage.constants.Zone;
import mage.constants.ZoneDetail;
import mage.game.Game;
@ -194,7 +195,7 @@ public class StackAbility extends StackObjImpl implements Ability {
public ObjectColor getColor(Game game) {
return emptyColor;
}
@Override
public ObjectColor getFrameColor(Game game) {
return ability.getSourceObject(game).getFrameColor(game);
@ -220,7 +221,7 @@ public class StackAbility extends StackObjImpl implements Ability {
public MageInt getToughness() {
return MageInt.EmptyMageInt;
}
@Override
public int getStartingLoyalty() {
return 0;
@ -590,9 +591,10 @@ public class StackAbility extends StackObjImpl implements Ability {
game.getStack().push(newStackAbility);
if (chooseNewTargets && newAbility.getTargets().size() > 0) {
Player controller = game.getPlayer(newControllerId);
if (controller.chooseUse(newAbility.getEffects().get(0).getOutcome(), "Choose new targets?", source, game)) {
Outcome outcome = newAbility.getEffects().isEmpty() ? Outcome.Detriment : newAbility.getEffects().get(0).getOutcome();
if (controller.chooseUse(outcome, "Choose new targets?", source, game)) {
newAbility.getTargets().clearChosen();
newAbility.getTargets().chooseTargets(newAbility.getEffects().get(0).getOutcome(), newControllerId, newAbility, false, game);
newAbility.getTargets().chooseTargets(outcome, newControllerId, newAbility, false, game);
}
}
game.fireEvent(new GameEvent(GameEvent.EventType.COPIED_STACKOBJECT, newStackAbility.getId(), this.getId(), newControllerId));

View file

@ -163,8 +163,9 @@ public abstract class StackObjImpl implements StackObject {
for (UUID targetId : target.getTargets()) {
String targetNames = getNamesOftargets(targetId, game);
// change the target?
Outcome outcome = mode.getEffects().isEmpty() ? Outcome.Detriment : mode.getEffects().get(0).getOutcome();
if (targetNames != null
&& (forceChange || targetController.chooseUse(mode.getEffects().get(0).getOutcome(), "Change this target: " + targetNames + "?", ability, game))) {
&& (forceChange || targetController.chooseUse(outcome, "Change this target: " + targetNames + "?", ability, game))) {
Set<UUID> possibleTargets = target.possibleTargets(this.getSourceId(), getControllerId(), game);
// choose exactly one other target - already targeted objects are not counted
if (forceChange && possibleTargets != null && possibleTargets.size() > 1) { // controller of spell must be used (e.g. TargetOpponent)
@ -176,7 +177,7 @@ public abstract class StackObjImpl implements StackObject {
iteration++;
newTarget.clearChosen();
newTarget.chooseTarget(mode.getEffects().get(0).getOutcome(), getControllerId(), ability, game);
newTarget.chooseTarget(outcome, getControllerId(), ability, game);
// check target restriction
if (newTarget.getFirstTarget() != null && filterNewTarget != null) {
Permanent newTargetPermanent = game.getPermanent(newTarget.getFirstTarget());
@ -203,7 +204,7 @@ public abstract class StackObjImpl implements StackObject {
do {
again = false;
tempTarget.clearChosen();
if (!tempTarget.chooseTarget(mode.getEffects().get(0).getOutcome(), getControllerId(), ability, game)) {
if (!tempTarget.chooseTarget(outcome, getControllerId(), ability, game)) {
if (targetController.chooseUse(Outcome.Benefit, "No target object selected. Reset to original target?", ability, game)) {
// use previous target no target was selected
newTarget.addTarget(targetId, target.getTargetAmount(targetId), ability, game, false);
@ -211,7 +212,8 @@ public abstract class StackObjImpl implements StackObject {
again = true;
}
} else // if possible add the alternate Target - it may not be included in the old definition nor in the already selected targets of the new definition
if (newTarget.getTargets().contains(tempTarget.getFirstTarget()) || target.getTargets().contains(tempTarget.getFirstTarget())) {
{
if (newTarget.getTargets().contains(tempTarget.getFirstTarget()) || target.getTargets().contains(tempTarget.getFirstTarget())) {
if (targetController.isHuman()) {
if (targetController.chooseUse(Outcome.Benefit, "This target was already selected from origin spell. Reset to original target?", ability, game)) {
// use previous target no target was selected
@ -240,6 +242,7 @@ public abstract class StackObjImpl implements StackObject {
// valid target was selected, add it to the new target definition
newTarget.addTarget(tempTarget.getFirstTarget(), target.getTargetAmount(targetId), ability, game, false);
}
}
} while (again && targetController.canRespond());
}
} // keep the target