New Cards

[APO] Index
[CHK] Cranial Extraction / Eight-And-A-Half-Tale / Ethereal Haze / Hankyu / He Who Hungers / Sensei's Divining Top
[GPC] CrystalSeer
[LRW] InkfathomDivers
[SHM] AphoticWisps / CeruleanWisps / CrimsonWisps / CrimsonWisps / ViridescentWisps
[10E] Discombobulate
Fixes
Glissa The Traitor - Changed flying to firststrike (solves issue 431)
HiddenHorror - minor text fix

Framework
PreventAllDamageEffect - replaces PreventAllCombatDamageEffect and supports now also preventing damage outside comnbat, refactored some cards with previous individual effect
SetCardColorTargetEffect - refactored some cards with previous individual effect
LookLibraryControllerEffect - supports now variable number of cards and may shuffle after look at cards
SacrificeSourceUnlessPaysEffect - refactored getText()
This commit is contained in:
LevelX 2011-12-31 13:53:19 +01:00
parent 569d2c240a
commit 9aeacd5cde
36 changed files with 2104 additions and 359 deletions

View file

@ -0,0 +1,61 @@
/*
* 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.apocalypse;
import java.util.UUID;
import mage.Constants.CardType;
import mage.Constants.Rarity;
import mage.abilities.effects.common.LookLibraryControllerEffect;
import mage.cards.CardImpl;
/**
*
* @author LevelX
*/
public class Index extends CardImpl<Index> {
public Index(UUID ownerId) {
super(ownerId, 25, "Index", Rarity.UNCOMMON, new CardType[]{CardType.INSTANT}, "{2}{U}{U}");
this.expansionSetCode = "APC";
this.color.setBlue(true);
// Look at the top five cards of your library, then put them back in any order.
this.getSpellAbility().addEffect(new LookLibraryControllerEffect(5));
}
public Index(final Index card) {
super(card);
}
@Override
public Index copy() {
return new Index(this);
}
}

View file

@ -0,0 +1,129 @@
/*
* Copyright 2011 BetaSteward_at_googlemail.com. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* The views and conclusions contained in the software and documentation are those of the
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of BetaSteward_at_googlemail.com.
*/
package mage.sets.championsofkamigawa;
import java.util.UUID;
import mage.Constants.CardType;
import mage.Constants.Outcome;
import mage.Constants.Rarity;
import mage.Constants.Zone;
import mage.abilities.Ability;
import mage.abilities.effects.OneShotEffect;
import mage.cards.Card;
import mage.cards.CardImpl;
import mage.cards.CardsImpl;
import mage.choices.Choice;
import mage.choices.ChoiceImpl;
import mage.game.Game;
import mage.players.Player;
import mage.sets.Sets;
import mage.target.TargetPlayer;
/**
*
* @author BetaSteward_at_googlemail.com
*/
public class CranialExtraction extends CardImpl<CranialExtraction> {
public CranialExtraction(UUID ownerId) {
super(ownerId, 105, "Cranial Extraction", Rarity.RARE, new CardType[]{CardType.SORCERY}, "{3}{B}");
this.expansionSetCode = "CHK";
this.subtype.add("Arcane");
this.color.setBlack(true);
/* Name a nonland card. Search target player's graveyard, hand, and library for
* all cards with that name and exile them. Then that player shuffles his or her library. */
this.getSpellAbility().addTarget(new TargetPlayer());
this.getSpellAbility().addEffect(new CranialExtractionEffect());
}
public CranialExtraction(final CranialExtraction card) {
super(card);
}
@Override
public CranialExtraction copy() {
return new CranialExtraction(this);
}
}
class CranialExtractionEffect extends OneShotEffect<CranialExtractionEffect> {
public CranialExtractionEffect() {
super(Outcome.Exile);
staticText = "Name a nonland card. Search target player's graveyard, hand, and library for all cards with that name and exile them. Then that player shuffles his or her library";
}
public CranialExtractionEffect(final CranialExtractionEffect effect) {
super(effect);
}
@Override
public boolean apply(Game game, Ability source) {
Player player = game.getPlayer(targetPointer.getFirst(source));
Player controller = game.getPlayer(source.getControllerId());
if (player != null && controller != null) {
Choice cardChoice = new ChoiceImpl();
cardChoice.setChoices(Sets.getNonLandCardNames());
cardChoice.clearChoice();
while (!controller.choose(Outcome.Exile, cardChoice, game)) {
game.debugMessage("player canceled choosing name. retrying.");
}
String cardName = cardChoice.getChoice();
game.informPlayers("CranialExtraction, named card: [" + cardName + "]");
for (Card card: player.getGraveyard().getCards(game)) {
if (card.getName().equals(cardName)) {
card.moveToExile(null, "", source.getId(), game);
}
}
for (Card card: player.getHand().getCards(game)) {
if (card.getName().equals(cardName)) {
card.moveToExile(null, "", source.getId(), game);
}
}
for (Card card: player.getLibrary().getCards(game)) {
if (card.getName().equals(cardName)) {
card.moveToExile(null, "", source.getId(), game);
}
}
controller.lookAtCards("CranialExtraction Hand", player.getHand(), game);
controller.lookAtCards("CranialExtraction Library", new CardsImpl(Zone.PICK, player.getLibrary().getCards(game)), game);
player.shuffleLibrary(game);
}
return true;
}
@Override
public CranialExtractionEffect copy() {
return new CranialExtractionEffect(this);
}
}

View file

@ -0,0 +1,92 @@
/*
* 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.championsofkamigawa;
import java.util.UUID;
import mage.Constants;
import mage.Constants.CardType;
import mage.Constants.Rarity;
import mage.Constants.Zone;
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.common.continious.GainAbilityTargetEffect;
import mage.abilities.effects.common.continious.SetCardColorTargetEffect;
import mage.abilities.keyword.ProtectionAbility;
import mage.cards.CardImpl;
import mage.filter.FilterCard;
import mage.target.common.TargetControlledPermanent;
import mage.target.common.TargetSpellOrPermanent;
/**
*
* @author LevelX
*/
public class EightAndAHalfTale extends CardImpl<EightAndAHalfTale> {
private final static FilterCard filter = new FilterCard("white");
static {
filter.setUseColor(true);
filter.getColor().setWhite(true);
}
public EightAndAHalfTale(UUID ownerId) {
super(ownerId, 8, "Eight-and-a-Half-Tails", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{W}{W}");
this.expansionSetCode = "CHK";
this.supertype.add("Legendary");
this.subtype.add("Fox");
this.subtype.add("Cleric");
this.color.setWhite(true);
this.power = new MageInt(2);
this.toughness = new MageInt(2);
// {1}{W}: Target permanent you control gains protection from white until end of turn.
Ability ability1 = new SimpleActivatedAbility(Zone.BATTLEFIELD, new GainAbilityTargetEffect(
new ProtectionAbility(filter), Constants.Duration.EndOfTurn), new ManaCostsImpl("{1}{W}"));
ability1.addTarget(new TargetControlledPermanent());
this.addAbility(ability1);
// {1}: Target spell or permanent becomes white until end of turn.
Ability ability2 = new SimpleActivatedAbility(Constants.Zone.BATTLEFIELD, new SetCardColorTargetEffect(
ObjectColor.WHITE, Constants.Duration.EndOfTurn),new ManaCostsImpl("{1}"));
ability2.addTarget(new TargetSpellOrPermanent());
this.addAbility(ability2);
}
public EightAndAHalfTale(final EightAndAHalfTale card) {
super(card);
}
@Override
public EightAndAHalfTale copy() {
return new EightAndAHalfTale(this);
}
}

View file

@ -0,0 +1,64 @@
/*
* Copyright 2011 BetaSteward_at_googlemail.com. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* The views and conclusions contained in the software and documentation are those of the
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of BetaSteward_at_googlemail.com.
*/
package mage.sets.championsofkamigawa;
import java.util.UUID;
import mage.Constants.CardType;
import mage.Constants.Duration;
import mage.Constants.Rarity;
import mage.abilities.effects.common.PreventAllDamageEffect;
import mage.cards.CardImpl;
import mage.filter.common.FilterCreaturePermanent;
/**
*
* @author LevelX
*/
public class EtherealHaze extends CardImpl<EtherealHaze> {
public EtherealHaze (UUID ownerId) {
super(ownerId, 9, "Ethereal Haze", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{W}");
this.expansionSetCode = "CHK";
this.color.setWhite(true);
// Prevent all damage that would be dealt by creatures this turn.
this.getSpellAbility().addEffect(new PreventAllDamageEffect(new FilterCreaturePermanent("creatures"), Duration.EndOfTurn, false));
}
public EtherealHaze (final EtherealHaze card) {
super(card);
}
@Override
public EtherealHaze copy() {
return new EtherealHaze(this);
}
}

View file

@ -0,0 +1,208 @@
/*
* 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.championsofkamigawa;
import java.util.UUID;
import mage.Constants.AttachmentType;
import mage.Constants.CardType;
import mage.Constants.Outcome;
import mage.Constants.Rarity;
import mage.Constants.Zone;
import mage.abilities.Ability;
import mage.abilities.common.SimpleActivatedAbility;
import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.costs.CostImpl;
import mage.abilities.costs.common.TapSourceCost;
import mage.abilities.costs.mana.GenericManaCost;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.continious.GainAbilityAttachedEffect;
import mage.abilities.effects.common.counter.AddCountersSourceEffect;
import mage.abilities.keyword.EquipAbility;
import mage.cards.CardImpl;
import mage.counters.Counter;
import mage.counters.CounterType;
import mage.counters.common.AimCounter;
import mage.game.Game;
import mage.game.permanent.Permanent;
import mage.players.Player;
import mage.target.common.TargetCreatureOrPlayer;
/**
*
* @author North
*/
public class Hankyu extends CardImpl<Hankyu> {
public Hankyu(UUID ownerId) {
super(ownerId, 253, "Hankyu", Rarity.UNCOMMON, new CardType[]{CardType.ARTIFACT}, "{1}");
this.expansionSetCode = "CHK";
this.subtype.add("Equipment");
/* Equipped creature has "{T}: Put an aim counter on Hankyu" and */
SimpleActivatedAbility ability1 = new SimpleActivatedAbility(Zone.BATTLEFIELD, new HankyuAddCounterEffect(this.getId()), new TapSourceCost());
ability1.setSourceId(this.getId()); // to know where to put the counters on
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityAttachedEffect(ability1, AttachmentType.EQUIPMENT)));
/* "{T}, Remove all aim counters from Hankyu: This creature deals
* damage to target creature or player equal to the number of
* aim counters removed this way." */
SimpleActivatedAbility ability2 = new SimpleActivatedAbility(Zone.BATTLEFIELD, new HankyuDealsDamageEffect(), new TapSourceCost());
ability2.addCost(new HankyuCountersSourceCost(this.getId()));
ability2.addTarget(new TargetCreatureOrPlayer());
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityAttachedEffect(ability2, AttachmentType.EQUIPMENT)));
// Equip {4} ({4}: Attach to target creature you control. Equip only as a sorcery.)
this.addAbility(new EquipAbility(Outcome.BoostCreature, new GenericManaCost(4)));
}
public Hankyu(final Hankyu card) {
super(card);
}
@Override
public Hankyu copy() {
return new Hankyu(this);
}
}
class HankyuAddCounterEffect extends OneShotEffect<HankyuAddCounterEffect> {
private UUID effectGivingEquipmentId;
public HankyuAddCounterEffect(UUID effectGivingEquipmentId) {
super(Outcome.Benefit);
this.effectGivingEquipmentId = effectGivingEquipmentId;
staticText = "Put an aim counter on Hankyu";
}
public HankyuAddCounterEffect(final HankyuAddCounterEffect effect) {
super(effect);
this.effectGivingEquipmentId = effect.effectGivingEquipmentId;
}
@Override
public boolean apply(Game game, Ability source) {
Permanent equipment = game.getPermanent(this.effectGivingEquipmentId);
if (equipment != null) {
equipment.addCounters(new AimCounter(), game);
}
return true;
}
@Override
public HankyuAddCounterEffect copy() {
return new HankyuAddCounterEffect(this);
}
}
class HankyuDealsDamageEffect extends OneShotEffect<HankyuDealsDamageEffect> {
public HankyuDealsDamageEffect() {
super(Outcome.Damage);
staticText = "This creature deals damage to target creature or player equal to the number of aim counters removed this way";
}
public HankyuDealsDamageEffect(final HankyuDealsDamageEffect effect) {
super(effect);
}
@Override
public HankyuDealsDamageEffect copy() {
return new HankyuDealsDamageEffect(this);
}
@Override
public boolean apply(Game game, Ability source) {
// get the number of removed counters as damage amount
HankyuCountersSourceCost cost = (HankyuCountersSourceCost) source.getCosts().get(1);
if (cost != null) {
int damageAmount = cost.getRemovedCounters();
if (damageAmount > 0) {
Permanent permanent = game.getPermanent(source.getFirstTarget());
if (permanent != null) {
permanent.damage(damageAmount, source.getSourceId(), game, true, false);
}
Player player = game.getPlayer(source.getFirstTarget());
if (player != null) {
player.damage(damageAmount, source.getSourceId(), game, false, true);
}
}
return true;
}
return false;
}
}
class HankyuCountersSourceCost extends CostImpl<HankyuCountersSourceCost> {
private int removedCounters;
private UUID effectGivingEquipmentId;
public HankyuCountersSourceCost(UUID effectGivingEquipmentId) {
super();
this.removedCounters = 0;
this.effectGivingEquipmentId = effectGivingEquipmentId;
this.text = "Remove all aim counters from Hankyu";
}
public HankyuCountersSourceCost(HankyuCountersSourceCost cost) {
super(cost);
this.effectGivingEquipmentId = cost.effectGivingEquipmentId;
this.removedCounters = cost.removedCounters;
}
@Override
public boolean canPay(UUID sourceId, UUID controllerId, Game game) {
return true;
}
@Override
public boolean pay(Ability ability, Game game, UUID sourceId, UUID controllerId, boolean noMana) {
Permanent equipment = game.getPermanent(this.effectGivingEquipmentId);
this.removedCounters = equipment.getCounters().getCount(CounterType.AIM);
if (equipment != null && this.removedCounters > 0) {
equipment.removeCounters("aim", this.removedCounters, game);
}
this.paid = true;
return true;
}
@Override
public HankyuCountersSourceCost copy() {
return new HankyuCountersSourceCost(this);
}
public int getRemovedCounters() {
return this.removedCounters;
}
}

View file

@ -0,0 +1,144 @@
/*
* 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.championsofkamigawa;
/**
*
* @author LevelX
*/
import java.util.UUID;
import mage.Constants;
import mage.Constants.CardType;
import mage.Constants.Rarity;
import mage.Constants.Zone;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.ActivateAsSorceryActivatedAbility;
import mage.abilities.costs.common.SacrificeTargetCost;
import mage.abilities.costs.mana.ManaCostsImpl;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.keyword.FlyingAbility;
import mage.abilities.keyword.SoulshiftAbility;
import mage.cards.Card;
import mage.cards.CardImpl;
import mage.filter.Filter;
import mage.filter.FilterCard;
import mage.filter.common.FilterControlledPermanent;
import mage.game.Game;
import mage.players.Player;
import mage.target.TargetCard;
import mage.target.common.TargetControlledPermanent;
import mage.target.common.TargetOpponent;
/**
* @author LevelX
*/
public class HeWhoHungers extends CardImpl<HeWhoHungers> {
private final static FilterControlledPermanent filter = new FilterControlledPermanent("a Spirit");
static {
filter.getSubtype().add("Spirit");
filter.setScopeSubtype(Filter.ComparisonScope.Any);
}
public HeWhoHungers(UUID ownerId) {
super(ownerId, 114, "He Who Hungers", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{4}{B}");
this.expansionSetCode = "CHK";
this.supertype.add("Legendary");
this.subtype.add("Spirit");
this.color.setBlack(true);
this.power = new MageInt(3);
this.toughness = new MageInt(2);
//Flying
this.addAbility(FlyingAbility.getInstance());
/* {1}, Sacrifice a Spirit: Target opponent reveals his or her hand. You choose a card from it.
* That player discards that card. Activate this ability only any time you could cast a sorcery. */
Ability ability = new ActivateAsSorceryActivatedAbility(Zone.BATTLEFIELD, new HeWhoHungersEffect(), new ManaCostsImpl("{1}"));
ability.addTarget(new TargetOpponent());
ability.addCost(new SacrificeTargetCost(new TargetControlledPermanent(filter)));
this.addAbility(ability);
//Soulshift 4 (When this creature dies, you may return target Spirit card with converted mana cost 4 or less from your graveyard to your hand.)
this.addAbility(new SoulshiftAbility(4));
}
public HeWhoHungers(final HeWhoHungers card) {
super(card);
}
@Override
public HeWhoHungers copy() {
return new HeWhoHungers(this);
}
}
class HeWhoHungersEffect extends OneShotEffect<HeWhoHungersEffect> {
public HeWhoHungersEffect() {
super(Constants.Outcome.Discard);
staticText = "Target opponent reveals his or her hand. You choose a card from it. That player discards that card";
}
public HeWhoHungersEffect(final HeWhoHungersEffect effect) {
super(effect);
}
@Override
public boolean apply(Game game, Ability source) {
Player player = game.getPlayer(source.getFirstTarget());
if (player != null) {
player.revealCards("He Who Hungers", player.getHand(), game);
Player you = game.getPlayer(source.getControllerId());
if (you != null) {
TargetCard target = new TargetCard(Constants.Zone.PICK, new FilterCard());
target.setRequired(true);
if (you.choose(Constants.Outcome.Benefit, player.getHand(), target, game)) {
Card card = player.getHand().get(target.getFirstTarget(), game);
if (card != null) {
return player.discard(card, source, game);
}
}
}
}
return false;
}
@Override
public HeWhoHungersEffect copy() {
return new HeWhoHungersEffect(this);
}
}

View file

@ -0,0 +1,97 @@
/*
* 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.championsofkamigawa;
import java.util.UUID;
import mage.Constants.CardType;
import mage.Constants.Outcome;
import mage.Constants.Rarity;
import mage.Constants.Zone;
import mage.abilities.Ability;
import mage.abilities.common.SimpleActivatedAbility;
import mage.abilities.costs.common.TapSourceCost;
import mage.abilities.costs.mana.ManaCostsImpl;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.DrawCardControllerEffect;
import mage.abilities.effects.common.LookLibraryControllerEffect;
import mage.cards.CardImpl;
import mage.game.Game;
import mage.game.permanent.Permanent;
/**
* @author LevelX
*/
public class SenseisDiviningTop extends CardImpl<SenseisDiviningTop> {
public SenseisDiviningTop(UUID ownerId) {
super(ownerId, 268, "Sensei's Divining Top", Rarity.UNCOMMON, new CardType[]{CardType.ARTIFACT}, "{1}");
this.expansionSetCode = "CHK";
this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new LookLibraryControllerEffect(3),new ManaCostsImpl("{1}")));
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DrawCardControllerEffect(1),new TapSourceCost());
ability.addEffect(new SenseisDiviningTopEffect());
this.addAbility(ability);
}
public SenseisDiviningTop(final SenseisDiviningTop card) {
super(card);
}
@Override
public SenseisDiviningTop copy() {
return new SenseisDiviningTop(this);
}
}
class SenseisDiviningTopEffect extends OneShotEffect<SenseisDiviningTopEffect> {
public SenseisDiviningTopEffect() {
super(Outcome.ReturnToHand);
staticText = ", then put Sensei's Divining Top on top of its owner's library";
}
public SenseisDiviningTopEffect(final SenseisDiviningTopEffect effect) {
super(effect);
}
@Override
public SenseisDiviningTopEffect copy() {
return new SenseisDiviningTopEffect(this);
}
@Override
public boolean apply(Game game, Ability source) {
Permanent permanent = game.getPermanent(source.getSourceId());
if (permanent != null) {
return permanent.moveToZone(Zone.LIBRARY, source.getId(), game, true);
}
return false;
}
}

View file

@ -0,0 +1,76 @@
/*
* 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.guildpact;
import java.util.UUID;
import mage.Constants.CardType;
import mage.Constants.Rarity;
import mage.Constants.Zone;
import mage.MageInt;
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
import mage.abilities.common.SimpleActivatedAbility;
import mage.abilities.costs.mana.ManaCostsImpl;
import mage.abilities.effects.common.LookLibraryControllerEffect;
import mage.abilities.effects.common.ReturnToHandSourceEffect;
import mage.cards.CardImpl;
/**
*
* @author LevelX
*/
public class CrystalSeer extends CardImpl<CrystalSeer> {
public CrystalSeer (UUID ownerId) {
super(ownerId, 23, "Crystal Seer", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{4}{U}");
this.expansionSetCode = "GPT";
this.subtype.add("Vedalken");
this.subtype.add("Wizard");
this.color.setBlue(true);
this.power = new MageInt(2);
this.toughness = new MageInt(2);
// When Crystal Seer enters the battlefield, look at the top four cards of your library, then put them back in any order.
this.addAbility(new EntersBattlefieldTriggeredAbility(new LookLibraryControllerEffect(4)));
// {4}{U}: Return Crystal Seer to its owner's hand.
this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new ReturnToHandSourceEffect(), new ManaCostsImpl("{4}{U}")));
}
public CrystalSeer (final CrystalSeer card) {
super(card);
}
@Override
public CrystalSeer copy() {
return new CrystalSeer(this);
}
}

View file

@ -34,7 +34,7 @@ import mage.Constants.Outcome;
import mage.Constants.Rarity;
import mage.abilities.Ability;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.PreventAllCombatDamageEffect;
import mage.abilities.effects.common.PreventAllDamageEffect;
import mage.cards.CardImpl;
import mage.filter.Filter.ComparisonScope;
import mage.filter.common.FilterCreaturePermanent;
@ -64,7 +64,7 @@ public class Moonmist extends CardImpl<Moonmist> {
// Transform all Humans. Prevent all combat damage that would be dealt this turn by creatures other than Werewolves and Wolves.
this.getSpellAbility().addEffect(new MoonmistEffect());
this.getSpellAbility().addEffect(new PreventAllCombatDamageEffect(filter, Duration.EndOfTurn));
this.getSpellAbility().addEffect(new PreventAllDamageEffect(filter, Duration.EndOfTurn, true));
}
public Moonmist(final Moonmist card) {

View file

@ -28,7 +28,6 @@
package mage.sets.lorwyn;
import mage.Constants.CardType;
import mage.Constants.Outcome;
import mage.Constants.Rarity;
import mage.Constants.Zone;
import mage.MageInt;
@ -36,17 +35,10 @@ import mage.abilities.Ability;
import mage.abilities.common.SimpleActivatedAbility;
import mage.abilities.costs.common.TapSourceCost;
import mage.abilities.costs.mana.ManaCostsImpl;
import mage.abilities.effects.OneShotEffect;
import mage.cards.Card;
import mage.cards.CardImpl;
import mage.cards.Cards;
import mage.cards.CardsImpl;
import mage.filter.FilterCard;
import mage.game.Game;
import mage.players.Player;
import mage.target.TargetCard;
import java.util.UUID;
import mage.abilities.effects.common.LookLibraryControllerEffect;
/**
*
@ -65,7 +57,7 @@ public class GiltLeafSeer extends CardImpl<GiltLeafSeer> {
this.toughness = new MageInt(2);
// {G}, {tap}: Look at the top two cards of your library, then put them back in any order.
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new GiltLeafSeerEffect(), new ManaCostsImpl("{G}"));
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new LookLibraryControllerEffect(2), new ManaCostsImpl("{G}"));
ability.addCost(new TapSourceCost());
this.addAbility(ability);
}
@ -78,58 +70,4 @@ public class GiltLeafSeer extends CardImpl<GiltLeafSeer> {
public GiltLeafSeer copy() {
return new GiltLeafSeer(this);
}
}
class GiltLeafSeerEffect extends OneShotEffect<GiltLeafSeerEffect> {
public GiltLeafSeerEffect() {
super(Outcome.Neutral);
this.staticText = "look at the top two cards of your library, then put them back in any order";
}
public GiltLeafSeerEffect(final GiltLeafSeerEffect effect) {
super(effect);
}
@Override
public GiltLeafSeerEffect copy() {
return new GiltLeafSeerEffect(this);
}
@Override
public boolean apply(Game game, Ability source) {
Player player = game.getPlayer(source.getControllerId());
if (player == null) {
return false;
}
Cards cards = new CardsImpl(Zone.PICK);
int count = Math.min(player.getLibrary().size(), 2);
for (int i = 0; i < count; i++) {
Card card = player.getLibrary().removeFromTop(game);
if (card != null) {
cards.add(card);
game.setZone(card.getId(), Zone.PICK);
}
}
player.lookAtCards("Sage Owl", cards, game);
TargetCard target = new TargetCard(Zone.PICK, new FilterCard("card to put on the top of your library"));
target.setRequired(true);
while (cards.size() > 1) {
player.choose(Outcome.Neutral, cards, target, game);
Card card = cards.get(target.getFirstTarget(), game);
if (card != null) {
cards.remove(card);
card.moveToZone(Zone.LIBRARY, source.getId(), game, true);
}
target.clearChosen();
}
if (cards.size() == 1) {
Card card = cards.get(cards.iterator().next(), game);
card.moveToZone(Zone.LIBRARY, source.getId(), game, true);
}
return true;
}
}

View file

@ -0,0 +1,73 @@
/*
* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* The views and conclusions contained in the software and documentation are those of the
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of BetaSteward_at_googlemail.com.
*/
package mage.sets.lorwyn;
import java.util.UUID;
import mage.Constants.CardType;
import mage.Constants.Rarity;
import mage.MageInt;
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
import mage.abilities.effects.common.LookLibraryControllerEffect;
import mage.abilities.keyword.IslandwalkAbility;
import mage.cards.CardImpl;
/**
*
* @author LevelX
*/
public class InkfathomDivers extends CardImpl<InkfathomDivers> {
public InkfathomDivers (UUID ownerId) {
super(ownerId, 70, "Inkfathom Divers", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{3}{U}{U}");
this.expansionSetCode = "LRW";
this.subtype.add("Merfolk");
this.subtype.add("Soldier");
this.color.setBlue(true);
this.power = new MageInt(3);
this.toughness = new MageInt(3);
// Islandwalk
this.addAbility(new IslandwalkAbility());
// When Inkfathom Divers enters the battlefield, look at the top four cards of your library, then put them back in any order.
this.addAbility(new EntersBattlefieldTriggeredAbility(new LookLibraryControllerEffect(4)));
}
public InkfathomDivers (final InkfathomDivers card) {
super(card);
}
@Override
public InkfathomDivers copy() {
return new InkfathomDivers(this);
}
}

View file

@ -32,7 +32,7 @@ import java.util.UUID;
import mage.Constants.CardType;
import mage.Constants.Duration;
import mage.Constants.Rarity;
import mage.abilities.effects.common.PreventAllCombatDamageEffect;
import mage.abilities.effects.common.PreventAllDamageEffect;
import mage.cards.CardImpl;
/**
@ -45,7 +45,7 @@ public class Fog extends CardImpl<Fog> {
super(ownerId, 182, "Fog", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{G}");
this.expansionSetCode = "M10";
this.color.setGreen(true);
this.getSpellAbility().addEffect(new PreventAllCombatDamageEffect(Duration.EndOfTurn));
this.getSpellAbility().addEffect(new PreventAllDamageEffect(Duration.EndOfTurn, true));
}
public Fog(final Fog card) {

View file

@ -29,20 +29,11 @@ package mage.sets.magic2010;
import java.util.UUID;
import mage.Constants;
import mage.Constants.CardType;
import mage.Constants.Rarity;
import mage.abilities.Ability;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.DrawCardControllerEffect;
import mage.cards.Card;
import mage.abilities.effects.common.LookLibraryControllerEffect;
import mage.cards.CardImpl;
import mage.cards.Cards;
import mage.cards.CardsImpl;
import mage.filter.FilterCard;
import mage.game.Game;
import mage.players.Player;
import mage.target.TargetCard;
/**
* @author nantuko
@ -56,7 +47,7 @@ public class Ponder extends CardImpl<Ponder> {
this.color.setBlue(true);
// Look at the top three cards of your library, then put them back in any order. You may shuffle your library.
this.getSpellAbility().addEffect(new PonderEffect());
this.getSpellAbility().addEffect(new LookLibraryControllerEffect(3, true));
// Draw a card.
this.getSpellAbility().addEffect(new DrawCardControllerEffect(1));
}
@ -69,62 +60,4 @@ public class Ponder extends CardImpl<Ponder> {
public Ponder copy() {
return new Ponder(this);
}
}
class PonderEffect extends OneShotEffect<PonderEffect> {
protected static FilterCard filter = new FilterCard("card to put on the top of your library");
public PonderEffect() {
super(Constants.Outcome.Benefit);
staticText = "Look at the top three cards of your library, then put them back in any order. You may shuffle your library";
}
public PonderEffect(final PonderEffect effect) {
super(effect);
}
@Override
public boolean apply(Game game, Ability source) {
Player player = game.getPlayer(source.getControllerId());
Cards cards = new CardsImpl(Constants.Zone.PICK);
int count = Math.min(3, player.getLibrary().size());
if (count == 0) {
return false;
}
for (int i = 0; i < count; i++) {
Card card = player.getLibrary().removeFromTop(game);
if (card != null) {
cards.add(card);
}
game.setZone(card.getId(), Constants.Zone.PICK);
}
if (cards.size() > 1) {
TargetCard target2 = new TargetCard(Constants.Zone.PICK, filter);
target2.setRequired(true);
while (cards.size() > 1) {
player.choose(Constants.Outcome.Benefit, cards, target2, game);
Card card = cards.get(target2.getFirstTarget(), game);
if (card != null) {
cards.remove(card);
card.moveToZone(Constants.Zone.LIBRARY, source.getId(), game, true);
}
target2.clearChosen();
}
}
if (cards.size() == 1) {
Card card = cards.get(cards.iterator().next(), game);
card.moveToZone(Constants.Zone.LIBRARY, source.getId(), game, true);
}
if (player.chooseUse(Constants.Outcome.Benefit, "Shuffle you library?", game)) {
player.shuffleLibrary(game);
}
return true;
}
@Override
public PonderEffect copy() {
return new PonderEffect(this);
}
}
}

View file

@ -29,22 +29,12 @@ package mage.sets.magic2010;
import java.util.UUID;
import mage.Constants.CardType;
import mage.Constants.Outcome;
import mage.Constants.Rarity;
import mage.Constants.Zone;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.LookLibraryControllerEffect;
import mage.abilities.keyword.FlyingAbility;
import mage.cards.Card;
import mage.cards.CardImpl;
import mage.cards.Cards;
import mage.cards.CardsImpl;
import mage.filter.FilterCard;
import mage.game.Game;
import mage.players.Player;
import mage.target.TargetCard;
/**
*
@ -62,7 +52,8 @@ public class SageOwl extends CardImpl<SageOwl> {
this.toughness = new MageInt(1);
this.addAbility(FlyingAbility.getInstance());
this.addAbility(new EntersBattlefieldTriggeredAbility(new SageOwlEffect()));
// When Sage Owl enters the battlefield, look at the top four cards of your library, then put them back in any order.
this.addAbility(new EntersBattlefieldTriggeredAbility(new LookLibraryControllerEffect(4)));
}
public SageOwl(final SageOwl card) {
@ -73,58 +64,4 @@ public class SageOwl extends CardImpl<SageOwl> {
public SageOwl copy() {
return new SageOwl(this);
}
}
class SageOwlEffect extends OneShotEffect<SageOwlEffect> {
public SageOwlEffect() {
super(Outcome.Neutral);
this.staticText = "look at the top four cards of your library, then put them back in any order";
}
public SageOwlEffect(final SageOwlEffect effect) {
super(effect);
}
@Override
public SageOwlEffect copy() {
return new SageOwlEffect(this);
}
@Override
public boolean apply(Game game, Ability source) {
Player player = game.getPlayer(source.getControllerId());
if (player == null) {
return false;
}
Cards cards = new CardsImpl(Zone.PICK);
int count = Math.min(player.getLibrary().size(), 4);
for (int i = 0; i < count; i++) {
Card card = player.getLibrary().removeFromTop(game);
if (card != null) {
cards.add(card);
game.setZone(card.getId(), Zone.PICK);
}
}
player.lookAtCards("Sage Owl", cards, game);
TargetCard target = new TargetCard(Zone.PICK, new FilterCard("card to put on the top of your library"));
target.setRequired(true);
while (cards.size() > 1) {
player.choose(Outcome.Neutral, cards, target, game);
Card card = cards.get(target.getFirstTarget(), game);
if (card != null) {
cards.remove(card);
card.moveToZone(Zone.LIBRARY, source.getId(), game, true);
}
target.clearChosen();
}
if (cards.size() == 1) {
Card card = cards.get(cards.iterator().next(), game);
card.moveToZone(Zone.LIBRARY, source.getId(), game, true);
}
return true;
}
}
}

View file

@ -29,15 +29,18 @@
package mage.sets.magic2011;
import java.util.UUID;
import mage.Constants;
import mage.Constants.CardType;
import mage.Constants.Duration;
import mage.Constants.Layer;
import mage.Constants.Outcome;
import mage.Constants.Rarity;
import mage.Constants.SubLayer;
import mage.ObjectColor;
import mage.abilities.Ability;
import mage.abilities.effects.ContinuousEffectImpl;
import mage.abilities.effects.common.AttacksIfAbleTargetEffect;
import mage.abilities.effects.common.continious.SetCardColorTargetEffect;
import mage.cards.CardImpl;
import mage.game.Game;
import mage.game.permanent.Permanent;
@ -53,8 +56,10 @@ public class Incite extends CardImpl<Incite> {
super(ownerId, 145, "Incite", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{R}");
this.expansionSetCode = "M11";
this.color.setRed(true);
this.getSpellAbility().addTarget(new TargetCreaturePermanent());
this.getSpellAbility().addEffect(new InciteEffect());
// Target creature becomes red until end of turn and attacks this turn if able.
this.getSpellAbility().addTarget(new TargetCreaturePermanent());
// this.getSpellAbility().addEffect(new InciteEffect());
this.getSpellAbility().addEffect(new SetCardColorTargetEffect(ObjectColor.RED, Constants.Duration.EndOfTurn, "Target creature becomes red until end of turn"));
this.getSpellAbility().addEffect(new AttacksIfAbleTargetEffect(Duration.EndOfTurn));
}
@ -68,34 +73,34 @@ public class Incite extends CardImpl<Incite> {
}
}
class InciteEffect extends ContinuousEffectImpl<InciteEffect> {
public InciteEffect() {
super(Duration.EndOfTurn, Layer.ColorChangingEffects_5, SubLayer.NA, Outcome.Detriment);
staticText = "Target creature becomes red until end of turn";
}
public InciteEffect(final InciteEffect effect) {
super(effect);
}
@Override
public InciteEffect copy() {
return new InciteEffect(this);
}
@Override
public boolean apply(Game game, Ability source) {
Permanent permanent = game.getPermanent(source.getFirstTarget());
if (permanent != null) {
permanent.getColor().setRed(true);
permanent.getColor().setWhite(false);
permanent.getColor().setGreen(false);
permanent.getColor().setBlue(false);
permanent.getColor().setBlack(false);
return true;
}
return false;
}
}
//class InciteEffect extends ContinuousEffectImpl<InciteEffect> {
//
// public InciteEffect() {
// super(Duration.EndOfTurn, Layer.ColorChangingEffects_5, SubLayer.NA, Outcome.Detriment);
// staticText = "Target creature becomes red until end of turn";
// }
//
// public InciteEffect(final InciteEffect effect) {
// super(effect);
// }
//
// @Override
// public InciteEffect copy() {
// return new InciteEffect(this);
// }
//
// @Override
// public boolean apply(Game game, Ability source) {
// Permanent permanent = game.getPermanent(source.getFirstTarget());
// if (permanent != null) {
// permanent.getColor().setRed(true);
// permanent.getColor().setWhite(false);
// permanent.getColor().setGreen(false);
// permanent.getColor().setBlue(false);
// permanent.getColor().setBlack(false);
// return true;
// }
// return false;
// }
//
//}

View file

@ -37,7 +37,7 @@ import mage.MageInt;
import mage.abilities.TriggeredAbilityImpl;
import mage.abilities.effects.common.ReturnToHandTargetEffect;
import mage.abilities.keyword.DeathtouchAbility;
import mage.abilities.keyword.FlyingAbility;
import mage.abilities.keyword.FirstStrikeAbility;
import mage.cards.CardImpl;
import mage.filter.Filter;
import mage.filter.FilterCard;
@ -62,8 +62,11 @@ public class GlissaTheTraitor extends CardImpl<GlissaTheTraitor> {
this.color.setGreen(true);
this.power = new MageInt(3);
this.toughness = new MageInt(3);
this.addAbility(FlyingAbility.getInstance());
// First strike,
this.addAbility(FirstStrikeAbility.getInstance());
// Deathtouch
this.addAbility(DeathtouchAbility.getInstance());
// Whenever a creature an opponent controls dies, you may return target artifact card from your graveyard to your hand.
this.addAbility(new GlissaTheTraitorTriggeredAbility());
}
@ -113,6 +116,6 @@ class GlissaTheTraitorTriggeredAbility extends TriggeredAbilityImpl<GlissaTheTra
@Override
public String getRule() {
return "Whenever a creature an opponent controls is put into a graveyard from the battlefield, " + super.getRule();
return "Whenever a creature an opponent controls is put into a graveyard from the battlefield, you may " + super.getRule();
}
}

View file

@ -31,7 +31,7 @@ import java.util.UUID;
import mage.Constants.CardType;
import mage.Constants.Duration;
import mage.Constants.Rarity;
import mage.abilities.effects.common.PreventAllCombatDamageEffect;
import mage.abilities.effects.common.PreventAllDamageEffect;
import mage.cards.CardImpl;
import mage.filter.common.FilterCreaturePermanent;
@ -58,7 +58,7 @@ public class HarmlessAssault extends CardImpl<HarmlessAssault> {
// Prevent all combat damage that would be dealt this turn by attacking
// creatures.
this.getSpellAbility().addEffect(
new PreventAllCombatDamageEffect(filter, Duration.EndOfTurn));
new PreventAllDamageEffect(filter, Duration.EndOfTurn, true));
}
public HarmlessAssault(final HarmlessAssault card) {

View file

@ -35,7 +35,7 @@ import mage.Constants.CardType;
import mage.Constants.Rarity;
import mage.abilities.dynamicvalue.common.PermanentsOnBattlefieldCount;
import mage.abilities.effects.common.GainLifeEffect;
import mage.abilities.effects.common.PreventAllCombatDamageEffect;
import mage.abilities.effects.common.PreventAllDamageEffect;
import mage.cards.CardImpl;
import mage.filter.FilterPermanent;
@ -56,7 +56,7 @@ public class BluntTheAssault extends CardImpl<BluntTheAssault> {
this.expansionSetCode = "SOM";
this.color.setGreen(true);
this.getSpellAbility().addEffect(new GainLifeEffect(new PermanentsOnBattlefieldCount(filter)));
this.getSpellAbility().addEffect(new PreventAllCombatDamageEffect(Constants.Duration.EndOfTurn));
this.getSpellAbility().addEffect(new PreventAllDamageEffect(Constants.Duration.EndOfTurn, true));
}
public BluntTheAssault (final BluntTheAssault card) {

View file

@ -0,0 +1,72 @@
/*
* 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.shadowmoor;
import java.util.UUID;
import mage.Constants;
import mage.Constants.CardType;
import mage.Constants.Rarity;
import mage.ObjectColor;
import mage.abilities.effects.common.DrawCardControllerEffect;
import mage.abilities.effects.common.continious.GainAbilityTargetEffect;
import mage.abilities.effects.common.continious.SetCardColorTargetEffect;
import mage.abilities.keyword.FearAbility;
import mage.cards.CardImpl;
import mage.target.common.TargetCreaturePermanent;
/**
*
* @author LevelX
*/
public class AphoticWisps extends CardImpl<AphoticWisps> {
public AphoticWisps (UUID ownerId) {
super(ownerId, 55, "Aphotic Wisps", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{B}");
this.expansionSetCode = "SHM";
this.color.setBlack(true);
// Target creature becomes black and gains fear until end of turn. (It can't be blocked except by artifact creatures and/or black creatures.)
this.getSpellAbility().addTarget(new TargetCreaturePermanent());
this.getSpellAbility().addEffect(new SetCardColorTargetEffect(ObjectColor.BLACK, Constants.Duration.EndOfTurn));
this.getSpellAbility().addEffect(new GainAbilityTargetEffect(FearAbility.getInstance(), Constants.Duration.EndOfTurn));
// Draw a card.
this.getSpellAbility().addEffect(new DrawCardControllerEffect(1));
}
public AphoticWisps (final AphoticWisps card) {
super(card);
}
@Override
public AphoticWisps copy() {
return new AphoticWisps(this);
}
}

View file

@ -0,0 +1,71 @@
/*
* 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.shadowmoor;
import java.util.UUID;
import mage.Constants;
import mage.Constants.CardType;
import mage.Constants.Rarity;
import mage.ObjectColor;
import mage.abilities.effects.common.DrawCardControllerEffect;
import mage.abilities.effects.common.UntapTargetEffect;
import mage.abilities.effects.common.continious.SetCardColorTargetEffect;
import mage.cards.CardImpl;
import mage.target.common.TargetCreaturePermanent;
/**
*
* @author LevelX
*/
public class CeruleanWisps extends CardImpl<CeruleanWisps> {
public CeruleanWisps (UUID ownerId) {
super(ownerId, 31, "Cerulean Wisps", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{U}");
this.expansionSetCode = "SHM";
this.color.setBlue(true);
// Target creature becomes blue until end of turn. Untap that creature.
this.getSpellAbility().addTarget(new TargetCreaturePermanent());
this.getSpellAbility().addEffect(new SetCardColorTargetEffect(ObjectColor.BLUE, Constants.Duration.EndOfTurn));
this.getSpellAbility().addEffect(new UntapTargetEffect());
// Draw a card.
this.getSpellAbility().addEffect(new DrawCardControllerEffect(1));
}
public CeruleanWisps (final CeruleanWisps card) {
super(card);
}
@Override
public CeruleanWisps copy() {
return new CeruleanWisps(this);
}
}

View file

@ -0,0 +1,73 @@
/*
* 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.shadowmoor;
import java.util.UUID;
import mage.Constants;
import mage.Constants.CardType;
import mage.Constants.Rarity;
import mage.ObjectColor;
import mage.abilities.effects.common.DrawCardControllerEffect;
import mage.abilities.effects.common.continious.GainAbilityTargetEffect;
import mage.abilities.effects.common.continious.SetCardColorTargetEffect;
import mage.abilities.keyword.HasteAbility;
import mage.cards.CardImpl;
import mage.target.common.TargetCreaturePermanent;
/**
*
* @author LevelX
*/
public class CrimsonWisps extends CardImpl<CrimsonWisps> {
public CrimsonWisps (UUID ownerId) {
super(ownerId, 88, "Crimson Wisps", Rarity.UNCOMMON, new CardType[]{CardType.INSTANT}, "{R}");
this.expansionSetCode = "SHM";
this.color.setRed(true);
// Target creature becomes red and gains haste until end of turn.
this.getSpellAbility().addTarget(new TargetCreaturePermanent());
this.getSpellAbility().addEffect(new SetCardColorTargetEffect(ObjectColor.RED, Constants.Duration.EndOfTurn));
this.getSpellAbility().addEffect(new GainAbilityTargetEffect(HasteAbility.getInstance(), Constants.Duration.EndOfTurn));
// Draw a card.
this.getSpellAbility().addEffect(new DrawCardControllerEffect(1));
}
public CrimsonWisps (final CrimsonWisps card) {
super(card);
}
@Override
public CrimsonWisps copy() {
return new CrimsonWisps(this);
}
}

View file

@ -0,0 +1,71 @@
/*
* 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.shadowmoor;
import java.util.UUID;
import mage.Constants;
import mage.Constants.CardType;
import mage.Constants.Rarity;
import mage.ObjectColor;
import mage.abilities.effects.common.DrawCardControllerEffect;
import mage.abilities.effects.common.TapTargetEffect;
import mage.abilities.effects.common.continious.SetCardColorTargetEffect;
import mage.cards.CardImpl;
import mage.target.common.TargetCreaturePermanent;
/**
*
* @author LevelX
*/
public class NiveousWisps extends CardImpl<NiveousWisps> {
public NiveousWisps (UUID ownerId) {
super(ownerId, 15, "Niveous Wisps", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{W}");
this.expansionSetCode = "SHM";
this.color.setWhite(true);
// Target creature becomes white until end of turn. Tap that creature.
this.getSpellAbility().addTarget(new TargetCreaturePermanent());
this.getSpellAbility().addEffect(new SetCardColorTargetEffect(ObjectColor.WHITE, Constants.Duration.EndOfTurn));
this.getSpellAbility().addEffect(new TapTargetEffect());
// Draw a card.
this.getSpellAbility().addEffect(new DrawCardControllerEffect(1));
}
public NiveousWisps (final NiveousWisps card) {
super(card);
}
@Override
public NiveousWisps copy() {
return new NiveousWisps(this);
}
}

View file

@ -0,0 +1,71 @@
/*
* 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.shadowmoor;
import java.util.UUID;
import mage.Constants;
import mage.Constants.CardType;
import mage.Constants.Rarity;
import mage.ObjectColor;
import mage.abilities.effects.common.DrawCardControllerEffect;
import mage.abilities.effects.common.continious.BoostTargetEffect;
import mage.abilities.effects.common.continious.SetCardColorTargetEffect;
import mage.cards.CardImpl;
import mage.target.common.TargetCreaturePermanent;
/**
*
* @author LevelX
*/
public class ViridescentWisps extends CardImpl<ViridescentWisps> {
public ViridescentWisps (UUID ownerId) {
super(ownerId, 132, "Viridescent Wisps", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{G}");
this.expansionSetCode = "SHM";
this.color.setGreen(true);
// Target creature becomes green and gets +1/+0 until end of turn.
this.getSpellAbility().addTarget(new TargetCreaturePermanent());
this.getSpellAbility().addEffect(new SetCardColorTargetEffect(ObjectColor.GREEN, Constants.Duration.EndOfTurn));
this.getSpellAbility().addEffect(new BoostTargetEffect(1,0, Constants.Duration.EndOfTurn));
// Draw a card.
this.getSpellAbility().addEffect(new DrawCardControllerEffect(1));
}
public ViridescentWisps (final ViridescentWisps card) {
super(card);
}
@Override
public ViridescentWisps copy() {
return new ViridescentWisps(this);
}
}

View file

@ -33,7 +33,7 @@ import mage.Constants.CardType;
import mage.Constants.Duration;
import mage.Constants.Rarity;
import mage.abilities.costs.mana.ManaCostsImpl;
import mage.abilities.effects.common.PreventAllCombatDamageEffect;
import mage.abilities.effects.common.PreventAllDamageEffect;
import mage.abilities.keyword.CyclingAbility;
import mage.cards.CardImpl;
@ -47,7 +47,7 @@ public class Angelsong extends CardImpl<Angelsong> {
super(ownerId, 4, "Angelsong", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{1}{W}");
this.expansionSetCode = "ALA";
this.color.setWhite(true);
this.getSpellAbility().addEffect(new PreventAllCombatDamageEffect(Duration.EndOfTurn));
this.getSpellAbility().addEffect(new PreventAllDamageEffect(Duration.EndOfTurn, true));
this.addAbility(new CyclingAbility(new ManaCostsImpl("{2}")));
}

View file

@ -38,7 +38,7 @@ import mage.abilities.common.SimpleActivatedAbility;
import mage.abilities.costs.common.SacrificeTargetCost;
import mage.abilities.costs.mana.ManaCostsImpl;
import mage.abilities.effects.common.CreateTokenEffect;
import mage.abilities.effects.common.PreventAllCombatDamageEffect;
import mage.abilities.effects.common.PreventAllDamageEffect;
import mage.cards.CardImpl;
import mage.filter.common.FilterControlledCreaturePermanent;
import mage.game.permanent.token.SoldierToken;
@ -67,7 +67,7 @@ public class KnightCaptainOfEos extends CardImpl<KnightCaptainOfEos> {
this.toughness = new MageInt(2);
this.addAbility(new EntersBattlefieldTriggeredAbility(new CreateTokenEffect(new SoldierToken(), 2), false));
SimpleActivatedAbility ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new PreventAllCombatDamageEffect(Duration.EndOfTurn), new ManaCostsImpl("{W}"));
SimpleActivatedAbility ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new PreventAllDamageEffect(Duration.EndOfTurn, true), new ManaCostsImpl("{W}"));
ability.addCost(new SacrificeTargetCost(new TargetControlledCreaturePermanent(1, 1, filter, true)));
this.addAbility(ability);
}

View file

@ -0,0 +1,64 @@
/*
* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* The views and conclusions contained in the software and documentation are those of the
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of BetaSteward_at_googlemail.com.
*/
package mage.sets.tenth;
import java.util.UUID;
import mage.Constants.CardType;
import mage.Constants.Rarity;
import mage.abilities.effects.common.CounterTargetEffect;
import mage.abilities.effects.common.LookLibraryControllerEffect;
import mage.cards.CardImpl;
import mage.target.TargetSpell;
/**
*
* @author LevelX
*/
public class Discombobulate extends CardImpl<Discombobulate> {
public Discombobulate(UUID ownerId) {
super(ownerId, 81, "Discombobulate", Rarity.UNCOMMON, new CardType[]{CardType.INSTANT}, "{2}{U}{U}");
this.expansionSetCode = "10E";
this.color.setBlue(true);
// Counter target spell. Look at the top four cards of your library, then put them back in any order.
this.getSpellAbility().addTarget(new TargetSpell());
this.getSpellAbility().addEffect(new CounterTargetEffect());
this.getSpellAbility().addEffect(new LookLibraryControllerEffect(4));
}
public Discombobulate(final Discombobulate card) {
super(card);
}
@Override
public Discombobulate copy() {
return new Discombobulate(this);
}
}

View file

@ -51,7 +51,7 @@ public class HiddenHorror extends CardImpl<HiddenHorror> {
this.color.setBlack(true);
this.power = new MageInt(4);
this.toughness = new MageInt(4);
this.addAbility(new EntersBattlefieldTriggeredAbility(new SacrificeSourceUnlessPaysEffect(new DiscardTargetCost(new TargetCardInHand(new FilterCreatureCard())))));
this.addAbility(new EntersBattlefieldTriggeredAbility(new SacrificeSourceUnlessPaysEffect(new DiscardTargetCost(new TargetCardInHand(new FilterCreatureCard("a creature card"))))));
}
public HiddenHorror(final HiddenHorror card) {

View file

@ -30,22 +30,12 @@ package mage.sets.worldwake;
import java.util.UUID;
import mage.Constants.CardType;
import mage.Constants.Outcome;
import mage.Constants.Rarity;
import mage.Constants.Zone;
import mage.abilities.Ability;
import mage.abilities.common.EntersBattlefieldTappedAbility;
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.LookLibraryControllerEffect;
import mage.abilities.mana.BlueManaAbility;
import mage.cards.Card;
import mage.cards.CardImpl;
import mage.cards.Cards;
import mage.cards.CardsImpl;
import mage.filter.FilterCard;
import mage.game.Game;
import mage.players.Player;
import mage.target.TargetCard;
/**
*
@ -56,8 +46,10 @@ public class HalimarDepths extends CardImpl<HalimarDepths> {
public HalimarDepths(UUID ownerId) {
super(ownerId, 137, "Halimar Depths", Rarity.COMMON, new CardType[]{CardType.LAND}, null);
this.expansionSetCode = "WWK";
this.addAbility(new EntersBattlefieldTappedAbility());
this.addAbility(new EntersBattlefieldTriggeredAbility(new HalimarDepthsEffect()));
// Halimar Depths enters the battlefield tapped.
this.addAbility(new EntersBattlefieldTappedAbility());
// When Halimar Depths enters the battlefield, look at the top three cards of your library, then put them back in any order.
this.addAbility(new EntersBattlefieldTriggeredAbility(new LookLibraryControllerEffect(3)));
this.addAbility(new BlueManaAbility());
}
@ -71,57 +63,3 @@ public class HalimarDepths extends CardImpl<HalimarDepths> {
}
}
class HalimarDepthsEffect extends OneShotEffect<HalimarDepthsEffect> {
protected static FilterCard filter2 = new FilterCard("card to put on the top of your library");
public HalimarDepthsEffect() {
super(Outcome.Benefit);
staticText = "look at the top three cards of your library, then put them back in any order";
}
public HalimarDepthsEffect(final HalimarDepthsEffect effect) {
super(effect);
}
@Override
public boolean apply(Game game, Ability source) {
Player player = game.getPlayer(source.getControllerId());
Cards cards = new CardsImpl(Zone.PICK);
int count = Math.min(player.getLibrary().size(), 3);
for (int i = 0; i < count; i++) {
Card card = player.getLibrary().removeFromTop(game);
if (card != null) {
cards.add(card);
game.setZone(card.getId(), Zone.PICK);
}
}
if (cards.size() > 1) {
TargetCard target2 = new TargetCard(Zone.PICK, filter2);
target2.setRequired(true);
while (cards.size() > 1) {
player.choose(Outcome.Detriment, cards, target2, game);
Card card = cards.get(target2.getFirstTarget(), game);
if (card != null) {
cards.remove(card);
card.moveToZone(Zone.LIBRARY, source.getId(), game, true);
}
target2.clearChosen();
}
}
if (cards.size() == 1) {
Card card = cards.get(cards.iterator().next(), game);
if (card != null) {
card.moveToZone(Zone.LIBRARY, source.getId(), game, true);
}
}
return true;
}
@Override
public HalimarDepthsEffect copy() {
return new HalimarDepthsEffect(this);
}
}