[C14] Added some colorless cards. + Ruhan of the Fomori.

This commit is contained in:
LevelX2 2014-11-27 15:20:08 +01:00
parent 56e60db454
commit eca6042257
9 changed files with 783 additions and 149 deletions

View file

@ -0,0 +1,73 @@
NAME:Sworn to Darkness
1 [C14:54] Commander's Sphere
1 [C14:307] Polluted Mire
1 [C14:59] Arcane Lighthouse
1 [C14:58] Unstable Obelisk
1 [C14:149] Morkrut Banshee
1 [C14:148] Magus of the Coffers
1 [C14:147] Liliana's Reaver
1 [C14:146] Gray Merchant of Asphodel
1 [C14:145] Grave Titan
1 [C14:144] Evernight Shade
1 [C14:143] Dregs of Sorrow
1 [C14:142] Dread Return
1 [C14:141] Drana, Kalastria Bloodchief
1 [C14:140] Disciple of Bolas
1 [C14:23] Ghoulcaller Gisa
1 [C14:22] Flesh Carver
1 [C14:21] Demon of Wailing Agonies
1 [C14:61] Myriad Landscape
1 [C14:29] Raving Dead
1 [C14:28] Overseer of the Damned
1 [C14:26] Necromantic Selection
1 [C14:25] Malicious Affliction
1 [C14:24] Infernal Offering
1 [C14:159] Reaper from the Abyss
1 [C14:235] Charcoal Diamond
1 [C14:158] Read the Bones
1 [C14:157] Promise of Power
1 [C14:156] Profane Command
1 [C14:232] Burnished Hart
1 [C14:155] Pontiff of Blight
1 [C14:154] Phyrexian Gargantua
1 [C14:275] Swiftfoot Boots
1 [C14:153] Pestilence Demon
1 [C14:152] Nekrataal
1 [C14:151] Nantuko Shade
1 [C14:150] Mutilate
1 [C14:270] Sol Ring
1 [C14:31] Wake the Dead
1 [C14:30] Spoils of Blood
8 [C14:329] Swamp
8 [C14:328] Swamp
8 [C14:327] Swamp
8 [C14:326] Swamp
1 [C14:169] Victimize
1 [C14:168] Vampire Hexmage
1 [C14:245] Lashwrithe
1 [C14:167] Tragic Slip
1 [C14:288] Crypt of Agadeem
1 [C14:243] Jet Medallion
1 [C14:166] Tendrils of Corruption
1 [C14:165] Syphon Mind
1 [C14:164] Sudden Spoiling
1 [C14:285] Bojuka Bog
1 [C14:163] Skirsdag High Priest
1 [C14:284] Barren Moor
1 [C14:162] Skeletal Scrying
1 [C14:282] Worn Powerstone
1 [C14:161] Sign in Blood
1 [C14:160] Shriekmaw
1 [C14:139] Crypt Ghast
1 [C14:138] Butcher of Malakir
1 [C14:137] Bloodgift Demon
1 [C14:136] Black Sun's Zenith
1 [C14:135] Bad Moon
1 [C14:134] Annihilate
1 [C14:133] AEther Snap
1 [C14:298] Ghost Quarter
1 [C14:132] Abyssal Persecutor
1 [C14:250] Mind Stone
1 [C14:294] Everglades
1 [C14:170] Xathrid Demon
SB: 1 [C14:27] Ob Nixilis of the Black Oath

View file

@ -3,10 +3,10 @@ package org.mage.plugins.card.info;
import java.awt.Color;
import java.awt.Component;
import java.awt.Dimension;
import javax.swing.JEditorPane;
import javax.swing.SwingUtilities;
import mage.client.util.gui.GuiDisplayUtil;
import mage.client.util.gui.GuiDisplayUtil.TextLines;
import mage.components.CardInfoPane;
import mage.utils.ThreadUtils;
import mage.view.CardView;
@ -50,14 +50,9 @@ public class CardInfoPaneImpl extends JEditorPane implements CardInfoPane {
if (!card.equals(currentCard)) {
return;
}
StringBuilder buffer = GuiDisplayUtil.getRulefromCardView(card);
int ruleLength = 0;
int rules = 0;
for (String rule :card.getRules()) {
ruleLength += rule.length();
rules++;
}
resizeTooltipIfNeeded(container, ruleLength, rules);
TextLines textLines = GuiDisplayUtil.getTextLinesfromCardView(card);
StringBuilder buffer = GuiDisplayUtil.getRulefromCardView(card, textLines);
resizeTooltipIfNeeded(container, textLines.basicTextLength, textLines.lines.size());
setText(buffer.toString());
setCaretPosition(0);
}

View file

@ -0,0 +1,158 @@
/*
* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* The views and conclusions contained in the software and documentation are those of the
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of BetaSteward_at_googlemail.com.
*/
package mage.sets.commander;
import java.util.ArrayList;
import java.util.List;
import java.util.Random;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.BeginningOfCombatTriggeredAbility;
import mage.abilities.effects.ContinuousEffect;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.RequirementEffect;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Duration;
import mage.constants.Outcome;
import mage.constants.Rarity;
import mage.constants.TargetController;
import mage.game.Game;
import mage.game.permanent.Permanent;
import mage.players.Player;
import mage.target.targetpointer.FixedTarget;
/**
*
* @author LevelX2
*/
public class RuhanOfTheFomori extends CardImpl {
public RuhanOfTheFomori(UUID ownerId) {
super(ownerId, 221, "Ruhan of the Fomori", Rarity.MYTHIC, new CardType[]{CardType.CREATURE}, "{1}{R}{W}{U}");
this.expansionSetCode = "CMD";
this.supertype.add("Legendary");
this.subtype.add("Giant");
this.subtype.add("Warrior");
this.color.setRed(true);
this.color.setBlue(true);
this.color.setWhite(true);
this.power = new MageInt(7);
this.toughness = new MageInt(7);
// At the beginning of combat on your turn, choose an opponent at random. Ruhan of the Fomori attacks that player this combat if able.
this.addAbility(new BeginningOfCombatTriggeredAbility(new RuhanOfTheFomoriEffect(), TargetController.YOU, false));
}
public RuhanOfTheFomori(final RuhanOfTheFomori card) {
super(card);
}
@Override
public RuhanOfTheFomori copy() {
return new RuhanOfTheFomori(this);
}
}
class RuhanOfTheFomoriEffect extends OneShotEffect {
public RuhanOfTheFomoriEffect() {
super(Outcome.Benefit);
this.staticText = "choose an opponent at random. {this} attacks that player this combat if able";
}
public RuhanOfTheFomoriEffect(final RuhanOfTheFomoriEffect effect) {
super(effect);
}
@Override
public RuhanOfTheFomoriEffect copy() {
return new RuhanOfTheFomoriEffect(this);
}
@Override
public boolean apply(Game game, Ability source) {
Player controller = game.getPlayer(source.getControllerId());
if (controller != null) {
Random random = new Random();
List<UUID> opponents = new ArrayList<>();
opponents.addAll(game.getOpponents(controller.getId()));
Player opponent = game.getPlayer(opponents.get(random.nextInt(opponents.size())));
if (opponent != null) {
ContinuousEffect effect = new AttacksIfAbleTargetPlayerSourceEffect();
effect.setTargetPointer(new FixedTarget(opponent.getId()));
game.addEffect(effect, source);
return true;
}
}
return false;
}
}
class AttacksIfAbleTargetPlayerSourceEffect extends RequirementEffect {
public AttacksIfAbleTargetPlayerSourceEffect() {
super(Duration.EndOfTurn);
staticText = "{this} attacks that player this combat if able";
}
public AttacksIfAbleTargetPlayerSourceEffect(final AttacksIfAbleTargetPlayerSourceEffect effect) {
super(effect);
}
@Override
public AttacksIfAbleTargetPlayerSourceEffect copy() {
return new AttacksIfAbleTargetPlayerSourceEffect(this);
}
@Override
public boolean applies(Permanent permanent, Ability source, Game game) {
if (permanent.getId().equals(source.getSourceId())) {
return true;
}
return false;
}
@Override
public boolean mustAttack(Game game) {
return true;
}
@Override
public boolean mustBlock(Game game) {
return false;
}
@Override
public UUID mustAttackDefender(Ability source, Game game) {
return getTargetPointer().getFirst(game, source);
}
}

View file

@ -27,24 +27,11 @@
*/
package mage.sets.commander2013;
import java.util.List;
import java.util.UUID;
import mage.Mana;
import mage.abilities.Ability;
import mage.abilities.costs.common.TapSourceCost;
import mage.abilities.effects.common.ManaEffect;
import mage.abilities.mana.ManaAbility;
import mage.abilities.mana.SimpleManaAbility;
import mage.cards.Card;
import mage.abilities.mana.CommanderColorIdentityManaAbility;
import mage.cards.CardImpl;
import mage.choices.Choice;
import mage.choices.ChoiceImpl;
import mage.constants.CardType;
import mage.constants.ColoredManaSymbol;
import mage.constants.Rarity;
import mage.constants.Zone;
import mage.game.Game;
import mage.players.Player;
/**
*
@ -57,7 +44,7 @@ public class CommandTower extends CardImpl {
this.expansionSetCode = "C13";
// {tap}: Add to your mana pool one mana of any color in your commander's color identity.
this.addAbility(new CommandTowerManaAbility());
this.addAbility(new CommanderColorIdentityManaAbility());
}
public CommandTower(final CommandTower card) {
@ -69,128 +56,3 @@ public class CommandTower extends CardImpl {
return new CommandTower(this);
}
}
class CommandTowerManaAbility extends ManaAbility {
public CommandTowerManaAbility() {
super(Zone.BATTLEFIELD, new CommandTowerManaEffect(),new TapSourceCost());
}
public CommandTowerManaAbility(final CommandTowerManaAbility ability) {
super(ability);
}
@Override
public CommandTowerManaAbility copy() {
return new CommandTowerManaAbility(this);
}
@Override
public List<Mana> getNetMana(Game game) {
if (netMana.isEmpty()) {
Player controller = game.getPlayer(getControllerId());
if (controller != null) {
Card commander = game.getCard(controller.getCommanderId());
if (commander != null) {
Mana commanderMana = commander.getManaCost().getMana();
if (commanderMana.getBlack() > 0) {
netMana.add(new Mana(ColoredManaSymbol.B));
}
if (commanderMana.getBlue() > 0) {
netMana.add(new Mana(ColoredManaSymbol.U));
}
if (commanderMana.getGreen() > 0) {
netMana.add(new Mana(ColoredManaSymbol.G));
}
if (commanderMana.getRed() > 0) {
netMana.add(new Mana(ColoredManaSymbol.R));
}
if (commanderMana.getWhite() > 0) {
netMana.add(new Mana(ColoredManaSymbol.W));
}
}
}
}
return netMana;
}
@Override
public boolean definesMana() {
return true;
}
}
class CommandTowerManaEffect extends ManaEffect {
public CommandTowerManaEffect() {
super();
this.staticText = "Add to your mana pool one mana of any color in your commander's color identity";
}
public CommandTowerManaEffect(final CommandTowerManaEffect effect) {
super(effect);
}
@Override
public CommandTowerManaEffect copy() {
return new CommandTowerManaEffect(this);
}
@Override
public boolean apply(Game game, Ability source) {
Player controller = game.getPlayer(source.getControllerId());
if (controller != null) {
Card commander = game.getCard(controller.getCommanderId());
if (commander != null) {
Mana commanderMana = commander.getManaCost().getMana();
Choice choice = new ChoiceImpl();
choice.setMessage("Pick a mana color");
if (commanderMana.getBlack() > 0) {
choice.getChoices().add("Black");
}
if (commanderMana.getRed() > 0) {
choice.getChoices().add("Red");
}
if (commanderMana.getBlue() > 0) {
choice.getChoices().add("Blue");
}
if (commanderMana.getGreen() > 0) {
choice.getChoices().add("Green");
}
if (commanderMana.getWhite() > 0) {
choice.getChoices().add("White");
}
if (choice.getChoices().size() > 0) {
if (choice.getChoices().size() == 1) {
choice.setChoice(choice.getChoices().iterator().next());
} else {
if (!controller.choose(outcome, choice, game)) {
return false;
}
}
switch (choice.getChoice()) {
case "Black":
controller.getManaPool().addMana(Mana.BlackMana, game, source);
break;
case "Blue":
controller.getManaPool().addMana(Mana.BlueMana, game, source);
break;
case "Red":
controller.getManaPool().addMana(Mana.RedMana, game, source);
break;
case "Green":
controller.getManaPool().addMana(Mana.GreenMana, game, source);
break;
case "White":
controller.getManaPool().addMana(Mana.WhiteMana, game, source);
break;
}
}
return true;
}
}
return false;
}
}

View file

@ -0,0 +1,89 @@
/*
* 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.commander2014;
import java.util.UUID;
import mage.abilities.Ability;
import mage.abilities.common.SimpleActivatedAbility;
import mage.abilities.costs.common.TapSourceCost;
import mage.abilities.costs.mana.GenericManaCost;
import mage.abilities.effects.Effect;
import mage.abilities.effects.common.continious.CreaturesCantGetOrHaveAbilityEffect;
import mage.abilities.keyword.HexproofAbility;
import mage.abilities.keyword.ShroudAbility;
import mage.abilities.mana.ColorlessManaAbility;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Duration;
import mage.constants.Rarity;
import mage.constants.TargetController;
import mage.constants.Zone;
import mage.filter.common.FilterCreaturePermanent;
import mage.filter.predicate.permanent.ControllerPredicate;
/**
*
* @author LevelX2
*/
public class ArcaneLighthouse extends CardImpl {
private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("creatures your opponents control");
static {
filter.add(new ControllerPredicate(TargetController.OPPONENT));
}
public ArcaneLighthouse(UUID ownerId) {
super(ownerId, 59, "Arcane Lighthouse", Rarity.UNCOMMON, new CardType[]{CardType.LAND}, "");
this.expansionSetCode = "C14";
// {tap}: Add {1} to your mana pool.
this.addAbility(new ColorlessManaAbility());
// {1}, {tap}: Until end of turn, creatures your opponents control lose hexproof and shroud and can't have hexproof or shroud.
Effect effect = new CreaturesCantGetOrHaveAbilityEffect(HexproofAbility.getInstance(), Duration.EndOfTurn, filter);
effect.setText("Until end of turn, creatures your opponents control lose hexproof");
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, effect, new GenericManaCost(1));
ability.addCost(new TapSourceCost());
effect = new CreaturesCantGetOrHaveAbilityEffect(ShroudAbility.getInstance(), Duration.EndOfTurn, filter);
effect.setText("and shroud and can't have hexproof or shroud");
ability.addEffect(effect);
this.addAbility(ability);
}
public ArcaneLighthouse(final ArcaneLighthouse card) {
super(card);
}
@Override
public ArcaneLighthouse copy() {
return new ArcaneLighthouse(this);
}
}

View file

@ -0,0 +1,65 @@
/*
* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* The views and conclusions contained in the software and documentation are those of the
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of BetaSteward_at_googlemail.com.
*/
package mage.sets.commander2014;
import java.util.UUID;
import mage.abilities.common.SimpleActivatedAbility;
import mage.abilities.costs.common.SacrificeSourceCost;
import mage.abilities.effects.common.DrawCardSourceControllerEffect;
import mage.abilities.mana.CommanderColorIdentityManaAbility;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Rarity;
import mage.constants.Zone;
/**
*
* @author LevelX2
*/
public class CommandersSphere extends CardImpl {
public CommandersSphere(UUID ownerId) {
super(ownerId, 54, "Commander's Sphere", Rarity.COMMON, new CardType[]{CardType.ARTIFACT}, "{3}");
this.expansionSetCode = "C14";
// {tap}: Add to your mana pool one mana of any color in your commander's color identity.
this.addAbility(new CommanderColorIdentityManaAbility());
// Sacrifice Commander's Sphere: Draw a card.
this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new DrawCardSourceControllerEffect(1), new SacrificeSourceCost()));
}
public CommandersSphere(final CommandersSphere card) {
super(card);
}
@Override
public CommandersSphere copy() {
return new CommandersSphere(this);
}
}

View file

@ -0,0 +1,147 @@
/*
* 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.commander2014;
import java.util.HashSet;
import java.util.Iterator;
import java.util.UUID;
import mage.abilities.Ability;
import mage.abilities.common.EntersBattlefieldTappedAbility;
import mage.abilities.common.SimpleActivatedAbility;
import mage.abilities.costs.common.SacrificeSourceCost;
import mage.abilities.costs.common.TapSourceCost;
import mage.abilities.costs.mana.GenericManaCost;
import mage.abilities.effects.Effect;
import mage.abilities.effects.common.search.SearchLibraryPutInPlayEffect;
import mage.abilities.mana.ColorlessManaAbility;
import mage.cards.Card;
import mage.cards.CardImpl;
import mage.cards.Cards;
import mage.constants.CardType;
import mage.constants.Rarity;
import mage.constants.Zone;
import mage.filter.FilterCard;
import mage.filter.common.FilterBasicLandCard;
import mage.game.Game;
import mage.target.common.TargetCardInLibrary;
/**
*
* @author LevelX2
*/
public class MyriadLandscape extends CardImpl {
private static final FilterBasicLandCard filter = new FilterBasicLandCard();
public MyriadLandscape(UUID ownerId) {
super(ownerId, 61, "Myriad Landscape", Rarity.UNCOMMON, new CardType[]{CardType.LAND}, "");
this.expansionSetCode = "C14";
// Myriad Landscape enters the battlefield tapped.
this.addAbility(new EntersBattlefieldTappedAbility());
// {tap}: Add {1} to your mana pool.
this.addAbility(new ColorlessManaAbility());
// {2}, {tap}, Sacrifice Myriad Landscape: Search your library for up to two basic land cards that share a land type, put them onto the battlefield tapped, then shuffle your library.
Effect effect = new SearchLibraryPutInPlayEffect(new TargetCardInLibrarySharingLandType(0, 2, filter), true);
effect.setText("Search your library for up to two basic land cards that share a land type, put them onto the battlefield tapped, then shuffle your library");
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, effect, new GenericManaCost(2));
ability.addCost(new TapSourceCost());
ability.addCost(new SacrificeSourceCost());
this.addAbility(ability);
}
public MyriadLandscape(final MyriadLandscape card) {
super(card);
}
@Override
public MyriadLandscape copy() {
return new MyriadLandscape(this);
}
}
class TargetCardInLibrarySharingLandType extends TargetCardInLibrary {
public TargetCardInLibrarySharingLandType(int minNumTargets, int maxNumTargets, FilterCard filter) {
super(minNumTargets, maxNumTargets, filter);
}
public TargetCardInLibrarySharingLandType(final TargetCardInLibrarySharingLandType target) {
super(target);
}
@Override
public boolean canTarget(UUID id, Cards cards, Game game) {
if (super.canTarget(id, cards, game)) {
if (!getTargets().isEmpty()) {
// check if new target shares a Land Type
HashSet<String> landTypes = null;
for (UUID landId: getTargets()) {
Card landCard = game.getCard(landId);
if (landCard != null) {
if (landTypes == null) {
landTypes = new HashSet<>();
landTypes.addAll(landCard.getSubtype());
} else {
for (Iterator<String> iterator = landTypes.iterator(); iterator.hasNext();) {
String next = iterator.next();
if (!landCard.getSubtype().contains(next)) {
iterator.remove();
}
}
}
}
}
Card card = game.getCard(id);
if (card != null && landTypes != null) {
for (Iterator<String> iterator = landTypes.iterator(); iterator.hasNext();) {
String next = iterator.next();
if (card.getSubtype().contains(next)) {
return true;
}
}
}
} else {
// first target
return true;
}
}
return false;
}
@Override
public TargetCardInLibrarySharingLandType copy() {
return new TargetCardInLibrarySharingLandType(this);
}
}

View file

@ -0,0 +1,74 @@
/*
* 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.commander2014;
import java.util.UUID;
import mage.abilities.Ability;
import mage.abilities.common.SimpleActivatedAbility;
import mage.abilities.costs.common.SacrificeSourceCost;
import mage.abilities.costs.common.TapSourceCost;
import mage.abilities.costs.mana.GenericManaCost;
import mage.abilities.effects.common.DestroyTargetEffect;
import mage.abilities.mana.ColorlessManaAbility;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Rarity;
import mage.constants.Zone;
import mage.target.TargetPermanent;
/**
*
* @author LevelX2
*/
public class UnstableObelisk extends CardImpl {
public UnstableObelisk(UUID ownerId) {
super(ownerId, 58, "Unstable Obelisk", Rarity.UNCOMMON, new CardType[]{CardType.ARTIFACT}, "{3}");
this.expansionSetCode = "C14";
// {tap}: Add {1} to your mana pool.
this.addAbility(new ColorlessManaAbility());
// {7}, {tap}, Sacrifice Unstable Obelisk: Destroy target permanent.
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DestroyTargetEffect(), new GenericManaCost(7));
ability.addCost(new TapSourceCost());
ability.addCost(new SacrificeSourceCost());
ability.addTarget(new TargetPermanent());
this.addAbility(ability);
}
public UnstableObelisk(final UnstableObelisk card) {
super(card);
}
@Override
public UnstableObelisk copy() {
return new UnstableObelisk(this);
}
}

View file

@ -0,0 +1,171 @@
/*
* 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.mana;
import java.util.List;
import mage.Mana;
import mage.abilities.Ability;
import mage.abilities.costs.common.TapSourceCost;
import mage.abilities.effects.common.ManaEffect;
import mage.cards.Card;
import mage.choices.Choice;
import mage.choices.ChoiceImpl;
import mage.constants.ColoredManaSymbol;
import mage.constants.Zone;
import mage.game.Game;
import mage.players.Player;
/**
*
* @author LevelX2
*/
public class CommanderColorIdentityManaAbility extends ManaAbility {
public CommanderColorIdentityManaAbility() {
super(Zone.BATTLEFIELD, new CommanderIdentityManaEffect(),new TapSourceCost());
}
public CommanderColorIdentityManaAbility(final CommanderColorIdentityManaAbility ability) {
super(ability);
}
@Override
public CommanderColorIdentityManaAbility copy() {
return new CommanderColorIdentityManaAbility(this);
}
@Override
public List<Mana> getNetMana(Game game) {
if (netMana.isEmpty()) {
Player controller = game.getPlayer(getControllerId());
if (controller != null) {
Card commander = game.getCard(controller.getCommanderId());
if (commander != null) {
Mana commanderMana = commander.getManaCost().getMana();
if (commanderMana.getBlack() > 0) {
netMana.add(new Mana(ColoredManaSymbol.B));
}
if (commanderMana.getBlue() > 0) {
netMana.add(new Mana(ColoredManaSymbol.U));
}
if (commanderMana.getGreen() > 0) {
netMana.add(new Mana(ColoredManaSymbol.G));
}
if (commanderMana.getRed() > 0) {
netMana.add(new Mana(ColoredManaSymbol.R));
}
if (commanderMana.getWhite() > 0) {
netMana.add(new Mana(ColoredManaSymbol.W));
}
}
}
}
return netMana;
}
@Override
public boolean definesMana() {
return true;
}
}
class CommanderIdentityManaEffect extends ManaEffect {
public CommanderIdentityManaEffect() {
super();
this.staticText = "Add to your mana pool one mana of any color in your commander's color identity";
}
public CommanderIdentityManaEffect(final CommanderIdentityManaEffect effect) {
super(effect);
}
@Override
public CommanderIdentityManaEffect copy() {
return new CommanderIdentityManaEffect(this);
}
@Override
public boolean apply(Game game, Ability source) {
Player controller = game.getPlayer(source.getControllerId());
if (controller != null) {
Card commander = game.getCard(controller.getCommanderId());
if (commander != null) {
Mana commanderMana = commander.getManaCost().getMana();
Choice choice = new ChoiceImpl();
choice.setMessage("Pick a mana color");
if (commanderMana.getBlack() > 0) {
choice.getChoices().add("Black");
}
if (commanderMana.getRed() > 0) {
choice.getChoices().add("Red");
}
if (commanderMana.getBlue() > 0) {
choice.getChoices().add("Blue");
}
if (commanderMana.getGreen() > 0) {
choice.getChoices().add("Green");
}
if (commanderMana.getWhite() > 0) {
choice.getChoices().add("White");
}
if (choice.getChoices().size() > 0) {
if (choice.getChoices().size() == 1) {
choice.setChoice(choice.getChoices().iterator().next());
} else {
if (!controller.choose(outcome, choice, game)) {
return false;
}
}
switch (choice.getChoice()) {
case "Black":
controller.getManaPool().addMana(Mana.BlackMana, game, source);
break;
case "Blue":
controller.getManaPool().addMana(Mana.BlueMana, game, source);
break;
case "Red":
controller.getManaPool().addMana(Mana.RedMana, game, source);
break;
case "Green":
controller.getManaPool().addMana(Mana.GreenMana, game, source);
break;
case "White":
controller.getManaPool().addMana(Mana.WhiteMana, game, source);
break;
}
}
return true;
}
}
return false;
}
}