[AKH] Updated tooltip text on several white and blue cards. Some minor fixes.

This commit is contained in:
fireshoes 2017-04-15 23:37:50 -05:00
parent 88d25b7a3a
commit 06fdd17e7d
25 changed files with 666 additions and 613 deletions

View file

@ -1,7 +1,6 @@
package mage.cards.a;
import mage.abilities.Ability;
import mage.abilities.SpellAbility;
import mage.abilities.effects.OneShotEffect;
import mage.cards.Card;
import mage.cards.CardImpl;
@ -10,15 +9,15 @@ import mage.constants.CardType;
import mage.constants.Outcome;
import mage.constants.WatcherScope;
import mage.game.Game;
import mage.game.events.DamagedPlayerEvent;
import mage.game.events.GameEvent;
import mage.game.stack.Spell;
import mage.players.Player;
import mage.watchers.Watcher;
import java.util.ArrayList;
import java.util.List;
import java.util.UUID;
import mage.constants.Zone;
import mage.game.stack.Spell;
/**
* @author stravant
@ -46,8 +45,8 @@ class ApproachOfTheSecondSunEffect extends OneShotEffect {
public ApproachOfTheSecondSunEffect() {
super(Outcome.Win);
this.staticText =
"If you cast {this} from you hand and you cast another spell named {this} this game, you win the game. " +
"If not, you gain 7 life and put {this} back into your library as the seventh card from the top.";
"If Approach of the Second Sun was cast from your hand and you've cast another spell named Approach of the Second Sun this game, you win the game. "
+ "Otherwise, put Approach of the Second Sun into its owner's library seventh from the top and you gain 7 life.";
}
public ApproachOfTheSecondSunEffect(final ApproachOfTheSecondSunEffect effect) {
@ -73,21 +72,24 @@ class ApproachOfTheSecondSunEffect extends OneShotEffect {
controller.gainLife(7, game);
// Put this into the library as the 7th from the top
List<Card> top6 = new ArrayList<>();
// Cut the top 6 cards off into a temporary array
for (int i = 0; i < 6 && controller.getLibrary().hasCards(); ++i) {
top6.add(controller.getLibrary().removeFromTop(game));
}
// Put this card (if the ability came from an ApproachOfTheSecondSun spell card) on top
Card sourceCard = game.getCard(source.getSourceId());
if (sourceCard != null) {
controller.getLibrary().putOnTop(sourceCard, game);
}
Spell spell = game.getStack().getSpell(source.getSourceId());
if (spell != null) {
Card spellCard = game.getStack().getSpell(source.getSourceId()).getCard();
if (spellCard != null) {
List<Card> top6 = new ArrayList<>();
// Cut the top 6 cards off into a temporary array
for (int i = 0; i < 6 && controller.getLibrary().hasCards(); ++i) {
top6.add(controller.getLibrary().removeFromTop(game));
}
// Put this card (if the ability came from an ApproachOfTheSecondSun spell card) on top
controller.moveCardToLibraryWithInfo(spellCard, source.getSourceId(), game, Zone.STACK, true, true);
// put the top 6 we took earlier back on top (going in reverse order this time to get them back
// on top in the proper order)
for (int i = top6.size() - 1; i >= 0; --i) {
controller.getLibrary().putOnTop(top6.get(i), game);
// put the top 6 we took earlier back on top (going in reverse order this time to get them back
// on top in the proper order)
for (int i = top6.size() - 1; i >= 0; --i) {
controller.getLibrary().putOnTop(top6.get(i), game);
}
}
}
}
return true;

View file

@ -60,7 +60,7 @@ import mage.watchers.Watcher;
public class AsForetold extends CardImpl {
public AsForetold(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{2}{U}");
// At the beginning of your upkeep, put a time counter on As Foretold.
addAbility(
@ -145,7 +145,7 @@ class AsForetoldAlternativeCost extends AlternativeCostSourceAbility {
class AsForetoldAddAltCostEffect extends ContinuousEffectImpl {
public AsForetoldAddAltCostEffect() {
super(Duration.WhileOnBattlefield, Outcome.Benefit);
staticText = "Once each turn, you may pay {0} rather than pay the mana cost for a spelly ou cast with converted mana cost X or less, where X is the number of time counters on {this}.";
staticText = "Once each turn, you may pay {0} rather than pay the mana cost for a spell you cast with converted mana cost X or less, where X is the number of time counters on {this}.";
}
public AsForetoldAddAltCostEffect(final AsForetoldAddAltCostEffect effect) {

View file

@ -35,15 +35,14 @@ import mage.abilities.effects.common.continuous.GainAbilityControlledEffect;
import mage.abilities.keyword.FlyingAbility;
import mage.abilities.keyword.VigilanceAbility;
import mage.abilities.costs.mana.ManaCostsImpl;
import mage.abilities.effects.Effect;
import mage.abilities.keyword.EmbalmAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.cards.v.Vigilance;
import mage.constants.CardType;
import mage.constants.Duration;
import mage.constants.Zone;
import mage.filter.StaticFilters;
import mage.filter.predicate.permanent.TokenPredicate;
/**
*
@ -53,7 +52,7 @@ public class AvenWindGuide extends CardImpl {
public AvenWindGuide(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{2}{W}{U}");
this.subtype.add("Bird");
this.subtype.add("Warrior");
this.power = new MageInt(2);
@ -66,18 +65,18 @@ public class AvenWindGuide extends CardImpl {
this.addAbility(VigilanceAbility.getInstance());
// Creature tokens you control have flying and vigilance.
Ability ability =
new SimpleStaticAbility(
Zone.BATTLEFIELD,
new GainAbilityControlledEffect(
Effect effect = new GainAbilityControlledEffect(
FlyingAbility.getInstance(),
Duration.WhileOnBattlefield,
StaticFilters.FILTER_CREATURE_TOKENS));
ability.addEffect(
new GainAbilityControlledEffect(
StaticFilters.FILTER_CREATURE_TOKENS);
effect.setText("Creature tokens you control have flying");
Ability ability = new SimpleStaticAbility(Zone.BATTLEFIELD, effect);
effect = new GainAbilityControlledEffect(
VigilanceAbility.getInstance(),
Duration.WhileOnBattlefield,
StaticFilters.FILTER_CREATURE_TOKENS));
StaticFilters.FILTER_CREATURE_TOKENS);
effect.setText("and vigilance");
ability.addEffect(effect);
this.addAbility(ability);
// Embalm {4}{W}{U}

View file

@ -1,112 +1,112 @@
/*
* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* The views and conclusions contained in the software and documentation are those of the
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of BetaSteward_at_googlemail.com.
*/
package mage.cards.b;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import java.util.UUID;
import mage.Mana;
import mage.abilities.Ability;
import mage.abilities.common.BeginningOfPreCombatMainTriggeredAbility;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.DrawCardSourceControllerEffect;
import mage.abilities.effects.common.counter.AddCountersSourceEffect;
import mage.constants.Outcome;
import mage.constants.TargetController;
import mage.counters.CounterType;
import mage.game.Game;
import mage.game.permanent.Permanent;
import mage.players.Player;
/**
*
* @author jeffwadsworth
*/
public class BountyOfTheLuxa extends CardImpl {
public BountyOfTheLuxa(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{2}{G}{U}");
//At the beginning of your precombat main phase, remove all flood counters from Bounty of the Luxa. If no flood counters were removed this way, put a flood counter on Bounty of the Luxa and draw a card. Otherwise, add {C}{G}{U} to your mana pool.
this.addAbility(new BeginningOfPreCombatMainTriggeredAbility(new BountyOfTheLuxaEffect(), TargetController.YOU, false));
}
public BountyOfTheLuxa(final BountyOfTheLuxa card) {
super(card);
}
@Override
public BountyOfTheLuxa copy() {
return new BountyOfTheLuxa(this);
}
}
class BountyOfTheLuxaEffect extends OneShotEffect {
public BountyOfTheLuxaEffect() {
super(Outcome.Benefit);
staticText = "remove all flood counters from {this}. If no flood counters were removed this way, put a flood counter on {this} and draw a card. Otherwise, add {C}{G}{U} to your mana pool";
}
public BountyOfTheLuxaEffect(final BountyOfTheLuxaEffect effect) {
super(effect);
}
@Override
public BountyOfTheLuxaEffect copy() {
return new BountyOfTheLuxaEffect(this);
}
@Override
public boolean apply(Game game, Ability source) {
Player controller = game.getPlayer(source.getControllerId());
Permanent bountyOfLuxa = game.getPermanent(source.getSourceId());
if (controller != null
&& bountyOfLuxa != null) {
if (bountyOfLuxa.getCounters(game).getCount(CounterType.FLOOD) > 0) {
bountyOfLuxa.removeCounters(CounterType.FLOOD.createInstance(bountyOfLuxa.getCounters(game).getCount(CounterType.FLOOD)), game);
if (bountyOfLuxa.getCounters(game).getCount(CounterType.FLOOD) == 0) {
Mana manaToAdd = new Mana();
manaToAdd.increaseColorless();
manaToAdd.increaseGreen();
manaToAdd.increaseBlue();
controller.getManaPool().addMana(manaToAdd, game, source);
}
} else {
new AddCountersSourceEffect(CounterType.FLOOD.createInstance()).apply(game, source);
new DrawCardSourceControllerEffect(1).apply(game, source);
}
return true;
}
return false;
}
}
/*
* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* The views and conclusions contained in the software and documentation are those of the
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of BetaSteward_at_googlemail.com.
*/
package mage.cards.b;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import java.util.UUID;
import mage.Mana;
import mage.abilities.Ability;
import mage.abilities.common.BeginningOfPreCombatMainTriggeredAbility;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.DrawCardSourceControllerEffect;
import mage.abilities.effects.common.counter.AddCountersSourceEffect;
import mage.constants.Outcome;
import mage.constants.TargetController;
import mage.counters.CounterType;
import mage.game.Game;
import mage.game.permanent.Permanent;
import mage.players.Player;
/**
*
* @author jeffwadsworth
*/
public class BountyOfTheLuxa extends CardImpl {
public BountyOfTheLuxa(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{2}{G}{U}");
//At the beginning of your precombat main phase, remove all flood counters from Bounty of the Luxa. If no counters were removed this way, put a flood counter on Bounty of the Luxa and draw a card. Otherwise, add {C}{G}{U} to your mana pool.
this.addAbility(new BeginningOfPreCombatMainTriggeredAbility(new BountyOfTheLuxaEffect(), TargetController.YOU, false));
}
public BountyOfTheLuxa(final BountyOfTheLuxa card) {
super(card);
}
@Override
public BountyOfTheLuxa copy() {
return new BountyOfTheLuxa(this);
}
}
class BountyOfTheLuxaEffect extends OneShotEffect {
public BountyOfTheLuxaEffect() {
super(Outcome.Benefit);
staticText = "remove all flood counters from {this}. If no counters were removed this way, put a flood counter on {this} and draw a card. Otherwise, add {C}{G}{U} to your mana pool";
}
public BountyOfTheLuxaEffect(final BountyOfTheLuxaEffect effect) {
super(effect);
}
@Override
public BountyOfTheLuxaEffect copy() {
return new BountyOfTheLuxaEffect(this);
}
@Override
public boolean apply(Game game, Ability source) {
Player controller = game.getPlayer(source.getControllerId());
Permanent bountyOfLuxa = game.getPermanent(source.getSourceId());
if (controller != null
&& bountyOfLuxa != null) {
if (bountyOfLuxa.getCounters(game).getCount(CounterType.FLOOD) > 0) {
bountyOfLuxa.removeCounters(CounterType.FLOOD.createInstance(bountyOfLuxa.getCounters(game).getCount(CounterType.FLOOD)), game);
if (bountyOfLuxa.getCounters(game).getCount(CounterType.FLOOD) == 0) {
Mana manaToAdd = new Mana();
manaToAdd.increaseColorless();
manaToAdd.increaseGreen();
manaToAdd.increaseBlue();
controller.getManaPool().addMana(manaToAdd, game, source);
}
} else {
new AddCountersSourceEffect(CounterType.FLOOD.createInstance()).apply(game, source);
new DrawCardSourceControllerEffect(1).apply(game, source);
}
return true;
}
return false;
}
}

View file

@ -1,87 +1,90 @@
/*
* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* The views and conclusions contained in the software and documentation are those of the
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of BetaSteward_at_googlemail.com.
*/
package mage.cards.c;
import java.util.UUID;
import mage.target.common.TargetCreaturePermanent;
import mage.abilities.Ability;
import mage.abilities.common.SimpleActivatedAbility;
import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.costs.common.SacrificeSourceCost;
import mage.abilities.costs.mana.GenericManaCost;
import mage.abilities.effects.common.AttachEffect;
import mage.abilities.effects.common.GainLifeEffect;
import mage.abilities.effects.common.combat.CantAttackBlockAttachedEffect;
import mage.abilities.effects.common.continuous.GainAbilityAttachedEffect;
import mage.constants.Outcome;
import mage.target.TargetPermanent;
import mage.abilities.keyword.EnchantAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.AttachmentType;
import mage.constants.CardType;
import mage.constants.Duration;
import mage.constants.Zone;
/**
*
* @author Styxo
*/
public class CompulsoryRest extends CardImpl {
public CompulsoryRest(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{1}{W}");
this.subtype.add("Aura");
// Enchant creature
TargetPermanent auraTarget = new TargetCreaturePermanent();
this.getSpellAbility().addTarget(auraTarget);
this.getSpellAbility().addEffect(new AttachEffect(Outcome.BoostCreature));
Ability ability = new EnchantAbility(auraTarget.getTargetName());
this.addAbility(ability);
// Enchanted creature can't attack or block.
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new CantAttackBlockAttachedEffect(AttachmentType.AURA)));
// Enchanted creature has "{2}, Sacrifice this creature: You gain 2 life."
Ability grantedAbility = new SimpleActivatedAbility(Zone.BATTLEFIELD, new GainLifeEffect(2), new GenericManaCost(2));
grantedAbility.addCost(new SacrificeSourceCost());
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityAttachedEffect(grantedAbility, AttachmentType.AURA, Duration.WhileOnBattlefield)));
}
public CompulsoryRest(final CompulsoryRest card) {
super(card);
}
@Override
public CompulsoryRest copy() {
return new CompulsoryRest(this);
}
}
/*
* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* The views and conclusions contained in the software and documentation are those of the
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of BetaSteward_at_googlemail.com.
*/
package mage.cards.c;
import java.util.UUID;
import mage.target.common.TargetCreaturePermanent;
import mage.abilities.Ability;
import mage.abilities.common.SimpleActivatedAbility;
import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.costs.Cost;
import mage.abilities.costs.common.SacrificeSourceCost;
import mage.abilities.costs.mana.GenericManaCost;
import mage.abilities.effects.common.AttachEffect;
import mage.abilities.effects.common.GainLifeEffect;
import mage.abilities.effects.common.combat.CantAttackBlockAttachedEffect;
import mage.abilities.effects.common.continuous.GainAbilityAttachedEffect;
import mage.constants.Outcome;
import mage.target.TargetPermanent;
import mage.abilities.keyword.EnchantAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.AttachmentType;
import mage.constants.CardType;
import mage.constants.Duration;
import mage.constants.Zone;
/**
*
* @author Styxo
*/
public class CompulsoryRest extends CardImpl {
public CompulsoryRest(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{1}{W}");
this.subtype.add("Aura");
// Enchant creature
TargetPermanent auraTarget = new TargetCreaturePermanent();
this.getSpellAbility().addTarget(auraTarget);
this.getSpellAbility().addEffect(new AttachEffect(Outcome.BoostCreature));
Ability ability = new EnchantAbility(auraTarget.getTargetName());
this.addAbility(ability);
// Enchanted creature can't attack or block.
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new CantAttackBlockAttachedEffect(AttachmentType.AURA)));
// Enchanted creature has "{2}, Sacrifice this creature: You gain 2 life."
Ability grantedAbility = new SimpleActivatedAbility(Zone.BATTLEFIELD, new GainLifeEffect(2), new GenericManaCost(2));
Cost cost = new SacrificeSourceCost();
cost.setText("Sacrifice this creature");
grantedAbility.addCost(cost);
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityAttachedEffect(grantedAbility, AttachmentType.AURA, Duration.WhileOnBattlefield)));
}
public CompulsoryRest(final CompulsoryRest card) {
super(card);
}
@Override
public CompulsoryRest copy() {
return new CompulsoryRest(this);
}
}

View file

@ -1,78 +1,81 @@
/*
* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* The views and conclusions contained in the software and documentation are those of the
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of BetaSteward_at_googlemail.com.
*/
package mage.cards.d;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.common.BecomesExertSourceTriggeredAbility;
import mage.abilities.effects.common.ReturnFromGraveyardToBattlefieldTargetEffect;
import mage.abilities.keyword.ExertAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.ComparisonType;
import mage.filter.common.FilterCreatureCard;
import mage.filter.predicate.mageobject.ConvertedManaCostPredicate;
import mage.target.common.TargetCardInYourGraveyard;
/**
*
* @author Styxo
*/
public class DevotedCropMate extends CardImpl {
private static final FilterCreatureCard filter = new FilterCreatureCard("creature card with converted mana cost 2 or less from your graveyard");
static {
filter.add(new ConvertedManaCostPredicate(ComparisonType.FEWER_THAN, 3));
}
public DevotedCropMate(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{2}{W}");
this.subtype.add("Human");
this.subtype.add("Warrior");
this.power = new MageInt(3);
this.toughness = new MageInt(2);
// You may exert Devoted Crop-Mate as it attacks. When you do, return target creature card with converted mana cost 2 or less from your graveyard to the battlefield.
BecomesExertSourceTriggeredAbility ability = new BecomesExertSourceTriggeredAbility(new ReturnFromGraveyardToBattlefieldTargetEffect());
ability.addTarget(new TargetCardInYourGraveyard(filter));
addAbility(new ExertAbility(ability));
}
public DevotedCropMate(final DevotedCropMate card) {
super(card);
}
@Override
public DevotedCropMate copy() {
return new DevotedCropMate(this);
}
}
/*
* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* The views and conclusions contained in the software and documentation are those of the
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of BetaSteward_at_googlemail.com.
*/
package mage.cards.d;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.common.BecomesExertSourceTriggeredAbility;
import mage.abilities.effects.Effect;
import mage.abilities.effects.common.ReturnFromGraveyardToBattlefieldTargetEffect;
import mage.abilities.keyword.ExertAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.ComparisonType;
import mage.filter.common.FilterCreatureCard;
import mage.filter.predicate.mageobject.ConvertedManaCostPredicate;
import mage.target.common.TargetCardInYourGraveyard;
/**
*
* @author Styxo
*/
public class DevotedCropMate extends CardImpl {
private static final FilterCreatureCard filter = new FilterCreatureCard("creature card with converted mana cost 2 or less from your graveyard");
static {
filter.add(new ConvertedManaCostPredicate(ComparisonType.FEWER_THAN, 3));
}
public DevotedCropMate(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{2}{W}");
this.subtype.add("Human");
this.subtype.add("Warrior");
this.power = new MageInt(3);
this.toughness = new MageInt(2);
// You may exert Devoted Crop-Mate as it attacks. When you do, return target creature card with converted mana cost 2 or less from your graveyard to the battlefield.
Effect effect = new ReturnFromGraveyardToBattlefieldTargetEffect();
effect.setText("return target creature card with converted mana cost 2 or less from your graveyard to the battlefield");
BecomesExertSourceTriggeredAbility ability = new BecomesExertSourceTriggeredAbility(effect);
ability.addTarget(new TargetCardInYourGraveyard(filter));
addAbility(new ExertAbility(ability));
}
public DevotedCropMate(final DevotedCropMate card) {
super(card);
}
@Override
public DevotedCropMate copy() {
return new DevotedCropMate(this);
}
}

View file

@ -33,7 +33,6 @@ import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.dynamicvalue.common.CardsInControllerGraveyardCount;
import mage.abilities.effects.common.continuous.SetPowerSourceEffect;
import mage.abilities.keyword.FlyingAbility;
import mage.abilities.keyword.TrampleAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
@ -59,7 +58,7 @@ public class EnigmaDrake extends CardImpl {
// Enigma Drakes's power is equal to the number of instant and sorcery cards in your graveyard.
this.addAbility(new SimpleStaticAbility(Zone.ALL, new SetPowerSourceEffect(
new CardsInControllerGraveyardCount(new FilterInstantOrSorceryCard("instant and sorcery cards in your graveyard")), Duration.EndOfGame)));
new CardsInControllerGraveyardCount(new FilterInstantOrSorceryCard("instant and sorcery cards")), Duration.EndOfGame)));
}
public EnigmaDrake(final EnigmaDrake card) {

View file

@ -45,6 +45,7 @@ import mage.game.events.GameEvent.EventType;
import mage.abilities.effects.common.NameACardEffect;
import java.util.UUID;
import mage.abilities.effects.Effect;
/**
* @author spjspj
@ -63,7 +64,9 @@ public class FailureComply extends SplitCard {
// Comply
// Choose a card name. Until your next turn, your opponents can't cast spells with the chosen name
((CardImpl) (getRightHalfCard())).addAbility(new AftermathAbility());
getRightHalfCard().getSpellAbility().addEffect(new NameACardEffect(NameACardEffect.TypeOfName.ALL));
Effect effect = new NameACardEffect(NameACardEffect.TypeOfName.ALL);
effect.setText("Choose a card name");
getRightHalfCard().getSpellAbility().addEffect(effect);
getRightHalfCard().getSpellAbility().addEffect(new ComplyCantCastEffect());
}
@ -81,7 +84,7 @@ class ComplyCantCastEffect extends ContinuousRuleModifyingEffectImpl {
public ComplyCantCastEffect() {
super(Duration.UntilYourNextTurn, Outcome.Benefit);
staticText = "Your opponents can't cast spells with the chosen name";
staticText = "Until your next turn, your opponents can't cast spells with the chosen name";
}
public ComplyCantCastEffect(final ComplyCantCastEffect effect) {

View file

@ -34,8 +34,6 @@ import mage.abilities.Ability;
import mage.abilities.LoyaltyAbility;
import mage.abilities.common.PlanswalkerEntersWithLoyalityCountersAbility;
import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.dynamicvalue.common.StaticValue;
import mage.abilities.effects.ContinuousEffect;
import mage.abilities.effects.ContinuousRuleModifyingEffectImpl;
import mage.abilities.effects.Effect;
import mage.abilities.effects.common.GetEmblemEffect;
@ -48,7 +46,6 @@ import mage.cards.CardSetInfo;
import mage.constants.*;
import mage.filter.common.FilterPlaneswalkerPermanent;
import mage.filter.predicate.mageobject.SubtypePredicate;
import mage.filter.predicate.permanent.ControllerPredicate;
import mage.game.Game;
import mage.game.command.Emblem;
import mage.game.events.GameEvent;
@ -63,20 +60,22 @@ public class GideonOfTheTrials extends CardImpl {
public GideonOfTheTrials(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.PLANESWALKER}, "{1}{W}{W}");
this.subtype.add("Gideon");
//Starting Loyalty: 3
this.addAbility(new PlanswalkerEntersWithLoyalityCountersAbility(3));
// +1: Until your next turn, prevent all damage target permanent would deal.
LoyaltyAbility ability = new LoyaltyAbility(new PreventDamageByTargetEffect(Duration.UntilYourNextTurn), 1);
Effect effect = new PreventDamageByTargetEffect(Duration.UntilYourNextTurn);
effect.setText("Until your next turn, prevent all damage target permanent would deal");
LoyaltyAbility ability = new LoyaltyAbility(effect, 1);
ability.addTarget(new TargetPermanent());
this.addAbility(ability);
// 0: Until end of turn, Gideon of the Trials becomes a 4/4 Human Soldier creature with indestructible that's still a planeswalker. Prevent all damage that would be dealt to him this turn.
ability = new LoyaltyAbility(new BecomesCreatureSourceEffect(new GideonOfTheTrialsToken(), "planeswalker", Duration.EndOfTurn), 0);
Effect effect = new PreventAllDamageToSourceEffect(Duration.EndOfTurn);
effect = new PreventAllDamageToSourceEffect(Duration.EndOfTurn);
effect.setText("Prevent all damage that would be dealt to him this turn");
ability.addEffect(effect);
this.addAbility(ability);
@ -106,7 +105,7 @@ class GideonOfTheTrialsCantLoseEffect extends ContinuousRuleModifyingEffectImpl
public GideonOfTheTrialsCantLoseEffect() {
super(Duration.EndOfGame, Outcome.Benefit);
staticText = "As long as you control a Gideon planeswalker, you can't lose the game and your opponent can't win the game";
staticText = "As long as you control a Gideon planeswalker, you can't lose the game and your opponents can't win the game";
}
public GideonOfTheTrialsCantLoseEffect(final GideonOfTheTrialsCantLoseEffect effect) {

View file

@ -33,6 +33,7 @@ import mage.abilities.Ability;
import mage.abilities.common.AsEntersBattlefieldAbility;
import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.effects.ContinuousRuleModifyingEffectImpl;
import mage.abilities.effects.Effect;
import mage.abilities.effects.PreventionEffectImpl;
import mage.abilities.effects.common.NameACardEffect;
import mage.cards.CardImpl;
@ -56,7 +57,9 @@ public class GideonsIntervention extends CardImpl {
super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{2}{W}{W}");
// As Gideon's Intervention enters the battlefield, choose a card name.
this.addAbility(new AsEntersBattlefieldAbility(new NameACardEffect(NameACardEffect.TypeOfName.ALL)));
Effect effect = new NameACardEffect(NameACardEffect.TypeOfName.ALL);
effect.setText("choose a card name");
this.addAbility(new AsEntersBattlefieldAbility(effect));
// Your opponents can't cast spells with the chosen name.
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GideonsInterventionCantCastEffect()));

View file

@ -29,8 +29,9 @@ package mage.cards.n;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.common.EntersBattlefieldAbility;
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
import mage.abilities.dynamicvalue.common.StaticValue;
import mage.abilities.effects.Effect;
import mage.abilities.effects.common.LookLibraryAndPickControllerEffect;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
@ -46,15 +47,15 @@ public class NagaOracle extends CardImpl {
public NagaOracle(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{3}{U}");
this.subtype.add("Naga");
this.subtype.add("Cleric");
this.power = new MageInt(2);
this.toughness = new MageInt(4);
// When Naga Oracle enters the battlefield, look at the top three cards of your library. Put any number of them into your graveyard and the rest back on top of your library in any order.
addAbility(new EntersBattlefieldAbility(
new LookLibraryAndPickControllerEffect(
// When Naga Oracle enters the battlefield, look at the top three cards of your library. Put any number of them into your graveyard
// and the rest back on top of your library in any order.
Effect effect = new LookLibraryAndPickControllerEffect(
/* oh god, Microsoft looks conservative with their function parameters in comparison */
new StaticValue(3),
false,
@ -65,7 +66,10 @@ public class NagaOracle extends CardImpl {
false,
true,
Zone.GRAVEYARD,
false)));
false);
effect.setText("look at the top three cards of your library. Put any number of them into your graveyard "
+ "and the rest back on top of your library in any order");
addAbility(new EntersBattlefieldTriggeredAbility(effect));
}
public NagaOracle(final NagaOracle card) {

View file

@ -53,6 +53,7 @@ import mage.players.Player;
import mage.target.TargetPermanent;
import java.util.UUID;
import mage.abilities.effects.Effect;
/**
*
@ -65,7 +66,9 @@ public class NissaStewardOfElements extends CardImpl {
this.subtype.add("Nissa");
this.addAbility(new EntersBattlefieldAbility(new EntersBattlefieldWithXCountersEffect(CounterType.LOYALTY.createInstance())));
Ability abilityETB = new EntersBattlefieldAbility(new EntersBattlefieldWithXCountersEffect(CounterType.LOYALTY.createInstance()));
abilityETB.setRuleVisible(false);
this.addAbility(abilityETB);
// +2: Scry 2.
this.addAbility(new LoyaltyAbility(new ScryEffect(2), 2));
@ -75,8 +78,12 @@ public class NissaStewardOfElements extends CardImpl {
this.addAbility(new LoyaltyAbility(new NissaStewardOfElementsEffect(), 0));
// -6: Untap up to two target lands you control. They become 5/5 Elemental creatures with flying and haste until end of turn. They're still lands.
LoyaltyAbility ability = new LoyaltyAbility(new UntapTargetEffect(), 6);
ability.addEffect(new BecomesCreatureTargetEffect(new NissaStewardOfElementsToken(), false, true, Duration.EndOfTurn));
Effect effect = new UntapTargetEffect();
effect.setText("Untap up to two target lands you control");
LoyaltyAbility ability = new LoyaltyAbility(effect, 6);
effect = new BecomesCreatureTargetEffect(new NissaStewardOfElementsToken(), false, true, Duration.EndOfTurn);
effect.setText("They become 5/5 Elemental creatures with flying and haste until end of turn. They're still lands");
ability.addEffect(effect);
ability.addTarget(new TargetPermanent(0, 2, new FilterControlledLandPermanent(), false));
this.addAbility(ability);
}
@ -95,7 +102,7 @@ class NissaStewardOfElementsEffect extends OneShotEffect {
public NissaStewardOfElementsEffect() {
super(Outcome.PutCardInPlay);
this.staticText = "look at the top card of your library. If it's a land card or a creature card with converted mana cost less than or equal"
this.staticText = "look at the top card of your library. If it's a land card or a creature card with converted mana cost less than or equal "
+ "to the number of loyalty counters on {this}, you may put that card onto the battlefield";
}

View file

@ -32,6 +32,7 @@ import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.effects.Effect;
import mage.abilities.effects.common.CreateTokenEffect;
import mage.abilities.effects.common.continuous.BoostControlledEffect;
import mage.abilities.effects.common.continuous.GainAbilityControlledEffect;
@ -75,7 +76,9 @@ public class RegalCaracal extends CardImpl {
this.addAbility(ability);
// When Regal Caracal enters the battlefield, create two 1/1 white Cat creature tokens with lifelink.
this.addAbility(new EntersBattlefieldTriggeredAbility(new CreateTokenEffect(new CatToken2(), 2)));
Effect effect2 = new CreateTokenEffect(new CatToken2(), 2);
effect2.setText("create two 1/1 white Cat creature tokens with lifelink");
this.addAbility(new EntersBattlefieldTriggeredAbility(effect2));
}
public RegalCaracal(final RegalCaracal card) {

View file

@ -30,6 +30,7 @@ package mage.cards.r;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.common.BecomesExertSourceTriggeredAbility;
import mage.abilities.effects.Effect;
import mage.abilities.effects.common.continuous.BoostSourceEffect;
import mage.abilities.effects.common.continuous.GainAbilitySourceEffect;
import mage.abilities.keyword.ExertAbility;
@ -47,17 +48,19 @@ public class RhetCropSpearmaster extends CardImpl {
public RhetCropSpearmaster(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{2}{W}");
this.subtype.add("Human");
this.subtype.add("Warrior");
this.power = new MageInt(3);
this.toughness = new MageInt(1);
// You may exert Rhet-Crop Spearmaster as it attacks. When you do, it gets +1/+0 and gains first strike until end of turn.
BecomesExertSourceTriggeredAbility ability =
new BecomesExertSourceTriggeredAbility(
new BoostSourceEffect(1, 0, Duration.EndOfTurn));
ability.addEffect(new GainAbilitySourceEffect(FirstStrikeAbility.getInstance(), Duration.EndOfTurn));
Effect effect = new BoostSourceEffect(1, 0, Duration.EndOfTurn);
effect.setText("it gets +1/+0");
BecomesExertSourceTriggeredAbility ability = new BecomesExertSourceTriggeredAbility(effect);
effect = new GainAbilitySourceEffect(FirstStrikeAbility.getInstance(), Duration.EndOfTurn);
effect.setText(" and gains first strike until end of turn");
ability.addEffect(effect);
this.addAbility(new ExertAbility(ability));
}

View file

@ -31,6 +31,7 @@ import java.util.UUID;
import mage.MageObject;
import mage.abilities.Ability;
import mage.abilities.effects.Effect;
import mage.abilities.effects.common.ReturnFromGraveyardToHandTargetEffect;
import mage.abilities.keyword.CyclingAbility;
import mage.cards.CardImpl;
@ -38,7 +39,6 @@ import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.filter.FilterCard;
import mage.filter.predicate.Predicate;
import mage.filter.predicate.mageobject.AbilityPredicate;
import mage.game.Game;
import mage.target.common.TargetCardInYourGraveyard;
@ -56,7 +56,9 @@ public class SacredExcavation extends CardImpl {
super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{3}{U}");
// Return up to two target cards with cycling from your graveyard to your hand.
getSpellAbility().addEffect(new ReturnFromGraveyardToHandTargetEffect());
Effect effect = new ReturnFromGraveyardToHandTargetEffect();
effect.setText("Return up to two target cards with cycling from your graveyard to your hand");
getSpellAbility().addEffect(effect);
getSpellAbility().addTarget(new TargetCardInYourGraveyard(0, 2, cardsWithCycling));
}

View file

@ -34,6 +34,7 @@ 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.ReturnToHandTargetEffect;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
@ -67,7 +68,9 @@ public class ScribeOfTheMindful extends CardImpl {
this.toughness = new MageInt(2);
// {1}, {T}, Sacrifice Scribe of the Mindful: Return target instant or sorcery card from your graveyard to your hand.
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new ReturnToHandTargetEffect(), new GenericManaCost(1));
Effect effect = new ReturnToHandTargetEffect();
effect.setText("Return target instant or sorcery card from your graveyard to your hand");
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, effect, new GenericManaCost(1));
ability.addCost(new TapSourceCost());
ability.addCost(new SacrificeSourceCost());
ability.addTarget(new TargetCardInYourGraveyard(filter));

View file

@ -51,7 +51,7 @@ public class SeekerOfInsight extends CardImpl {
public SeekerOfInsight(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{1}{U}");
this.subtype.add("Human");
this.subtype.add("Wizard");
this.power = new MageInt(1);
@ -93,4 +93,9 @@ class CastNonCreatureSpellCondition implements Condition {
}
return false;
}
@Override
public String toString() {
return "you've cast a noncreature spell this turn";
}
}

View file

@ -29,6 +29,7 @@ package mage.cards.s;
import java.util.UUID;
import mage.abilities.costs.common.SacrificeTargetCost;
import mage.abilities.effects.Effect;
import mage.abilities.effects.common.CreateTokenEffect;
import mage.abilities.effects.common.DestroyTargetEffect;
import mage.abilities.keyword.AftermathAbility;
@ -53,7 +54,9 @@ public class StartFinish extends SplitCard {
// Start
// Create two 1/1 white Warrior creature tokens with vigilance.
getLeftHalfCard().getSpellAbility().addEffect(new CreateTokenEffect(new WarriorVigilantToken(), 2));
Effect effect = new CreateTokenEffect(new WarriorVigilantToken(), 2);
effect.setText("Create two 1/1 white Warrior creature tokens with vigilance");
getLeftHalfCard().getSpellAbility().addEffect(effect);
// Finish
// Aftermath

View file

@ -1,151 +1,151 @@
/*
* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* The views and conclusions contained in the software and documentation are those of the
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of BetaSteward_at_googlemail.com.
*/
package mage.cards.v;
import java.util.ArrayList;
import java.util.List;
import java.util.UUID;
import mage.MageInt;
import mage.MageObjectReference;
import mage.abilities.Ability;
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
import mage.abilities.common.delayed.AtTheBeginOfNextEndStepDelayedTriggeredAbility;
import mage.abilities.effects.Effect;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.ReturnToBattlefieldUnderOwnerControlTargetEffect;
import mage.abilities.keyword.FlashAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.Outcome;
import mage.constants.Zone;
import mage.filter.common.FilterCreaturePermanent;
import mage.filter.predicate.Predicates;
import mage.filter.predicate.permanent.PermanentIdPredicate;
import mage.game.Game;
import mage.game.permanent.Permanent;
import mage.players.Player;
import mage.target.common.TargetCreaturePermanent;
import mage.target.targetpointer.FixedTarget;
import mage.watchers.common.AttackedThisTurnWatcher;
import mage.watchers.common.BlockedThisTurnWatcher;
/**
*
* @author jeffwadsworth
*/
public class VizierOfDeferment extends CardImpl {
public VizierOfDeferment(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{2}{W}");
this.subtype.add("Human");
this.subtype.add("Cleric");
this.power = new MageInt(2);
this.toughness = new MageInt(2);
// Flash
this.addAbility(FlashAbility.getInstance());
// When Vizier of Deferment enters the battlefield, you may exile target creature if it attacked or blocked this turn. Return that card to the battlefield under its owner's control at the beginning of the next end step.
Ability ability = new EntersBattlefieldTriggeredAbility(new VizierOfDefermentEffect(), true);
ability.addWatcher(new AttackedThisTurnWatcher());
ability.addWatcher(new BlockedThisTurnWatcher());
this.addAbility(ability);
}
@Override
public void adjustTargets(Ability ability, Game game) {
if (ability instanceof EntersBattlefieldTriggeredAbility) {
List<PermanentIdPredicate> creaturesThatCanBeTargeted = new ArrayList<>();
FilterCreaturePermanent filter = new FilterCreaturePermanent("creature that attacked or blocked this turn.");
AttackedThisTurnWatcher watcherAttacked = (AttackedThisTurnWatcher) game.getState().getWatchers().get("AttackedThisTurn");
BlockedThisTurnWatcher watcherBlocked = (BlockedThisTurnWatcher) game.getState().getWatchers().get("BlockedThisTurn");
if (watcherAttacked != null) {
for (UUID creatureId : watcherAttacked.getAttackedThisTurnCreatures()) {
creaturesThatCanBeTargeted.add(new PermanentIdPredicate(creatureId));
}
}
if (watcherBlocked != null) {
for (MageObjectReference mor : watcherBlocked.getBlockedThisTurnCreatures()) {
creaturesThatCanBeTargeted.add(new PermanentIdPredicate(mor.getPermanent(game).getId()));
}
}
filter.add(Predicates.or(creaturesThatCanBeTargeted));
ability.getTargets().clear();
ability.addTarget(new TargetCreaturePermanent(filter));
}
}
public VizierOfDeferment(final VizierOfDeferment card) {
super(card);
}
@Override
public VizierOfDeferment copy() {
return new VizierOfDeferment(this);
}
}
class VizierOfDefermentEffect extends OneShotEffect {
public VizierOfDefermentEffect() {
super(Outcome.Detriment);
staticText = "you may exile target creature if it attacked or blocked this turn. Return it to the battlefield under its owner's control at the beginning of the next end step";
}
public VizierOfDefermentEffect(final VizierOfDefermentEffect effect) {
super(effect);
}
@Override
public boolean apply(Game game, Ability source) {
Permanent permanent = game.getPermanent(source.getFirstTarget());
Player controller = game.getPlayer(source.getControllerId());
Permanent sourcePermanent = game.getPermanentOrLKIBattlefield(source.getSourceId());
if (controller != null
&& permanent != null
&& sourcePermanent != null) {
if (controller.moveCardToExileWithInfo(permanent, source.getSourceId(), sourcePermanent.getIdName(), source.getSourceId(), game, Zone.BATTLEFIELD, true)) {
Effect effect = new ReturnToBattlefieldUnderOwnerControlTargetEffect();
effect.setText("Return that card to the battlefield under its owner's control at the beginning of the next end step");
effect.setTargetPointer(new FixedTarget(source.getFirstTarget(), game));
game.addDelayedTriggeredAbility(new AtTheBeginOfNextEndStepDelayedTriggeredAbility(effect), source);
return true;
}
}
return false;
}
@Override
public VizierOfDefermentEffect copy() {
return new VizierOfDefermentEffect(this);
}
}
/*
* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* The views and conclusions contained in the software and documentation are those of the
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of BetaSteward_at_googlemail.com.
*/
package mage.cards.v;
import java.util.ArrayList;
import java.util.List;
import java.util.UUID;
import mage.MageInt;
import mage.MageObjectReference;
import mage.abilities.Ability;
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
import mage.abilities.common.delayed.AtTheBeginOfNextEndStepDelayedTriggeredAbility;
import mage.abilities.effects.Effect;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.ReturnToBattlefieldUnderOwnerControlTargetEffect;
import mage.abilities.keyword.FlashAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.Outcome;
import mage.constants.Zone;
import mage.filter.common.FilterCreaturePermanent;
import mage.filter.predicate.Predicates;
import mage.filter.predicate.permanent.PermanentIdPredicate;
import mage.game.Game;
import mage.game.permanent.Permanent;
import mage.players.Player;
import mage.target.common.TargetCreaturePermanent;
import mage.target.targetpointer.FixedTarget;
import mage.watchers.common.AttackedThisTurnWatcher;
import mage.watchers.common.BlockedThisTurnWatcher;
/**
*
* @author jeffwadsworth
*/
public class VizierOfDeferment extends CardImpl {
public VizierOfDeferment(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{2}{W}");
this.subtype.add("Human");
this.subtype.add("Cleric");
this.power = new MageInt(2);
this.toughness = new MageInt(2);
// Flash
this.addAbility(FlashAbility.getInstance());
// When Vizier of Deferment enters the battlefield, you may exile target creature if it attacked or blocked this turn. Return that card to the battlefield under its owner's control at the beginning of the next end step.
Ability ability = new EntersBattlefieldTriggeredAbility(new VizierOfDefermentEffect(), true);
ability.addWatcher(new AttackedThisTurnWatcher());
ability.addWatcher(new BlockedThisTurnWatcher());
this.addAbility(ability);
}
@Override
public void adjustTargets(Ability ability, Game game) {
if (ability instanceof EntersBattlefieldTriggeredAbility) {
List<PermanentIdPredicate> creaturesThatCanBeTargeted = new ArrayList<>();
FilterCreaturePermanent filter = new FilterCreaturePermanent("creature that attacked or blocked this turn.");
AttackedThisTurnWatcher watcherAttacked = (AttackedThisTurnWatcher) game.getState().getWatchers().get("AttackedThisTurn");
BlockedThisTurnWatcher watcherBlocked = (BlockedThisTurnWatcher) game.getState().getWatchers().get("BlockedThisTurn");
if (watcherAttacked != null) {
for (UUID creatureId : watcherAttacked.getAttackedThisTurnCreatures()) {
creaturesThatCanBeTargeted.add(new PermanentIdPredicate(creatureId));
}
}
if (watcherBlocked != null) {
for (MageObjectReference mor : watcherBlocked.getBlockedThisTurnCreatures()) {
creaturesThatCanBeTargeted.add(new PermanentIdPredicate(mor.getPermanent(game).getId()));
}
}
filter.add(Predicates.or(creaturesThatCanBeTargeted));
ability.getTargets().clear();
ability.addTarget(new TargetCreaturePermanent(filter));
}
}
public VizierOfDeferment(final VizierOfDeferment card) {
super(card);
}
@Override
public VizierOfDeferment copy() {
return new VizierOfDeferment(this);
}
}
class VizierOfDefermentEffect extends OneShotEffect {
public VizierOfDefermentEffect() {
super(Outcome.Detriment);
staticText = "you may exile target creature if it attacked or blocked this turn. Return that card to the battlefield under its owner's control at the beginning of the next end step";
}
public VizierOfDefermentEffect(final VizierOfDefermentEffect effect) {
super(effect);
}
@Override
public boolean apply(Game game, Ability source) {
Permanent permanent = game.getPermanent(source.getFirstTarget());
Player controller = game.getPlayer(source.getControllerId());
Permanent sourcePermanent = game.getPermanentOrLKIBattlefield(source.getSourceId());
if (controller != null
&& permanent != null
&& sourcePermanent != null) {
if (controller.moveCardToExileWithInfo(permanent, source.getSourceId(), sourcePermanent.getIdName(), source.getSourceId(), game, Zone.BATTLEFIELD, true)) {
Effect effect = new ReturnToBattlefieldUnderOwnerControlTargetEffect();
effect.setText("Return that card to the battlefield under its owner's control at the beginning of the next end step");
effect.setTargetPointer(new FixedTarget(source.getFirstTarget(), game));
game.addDelayedTriggeredAbility(new AtTheBeginOfNextEndStepDelayedTriggeredAbility(effect), source);
return true;
}
}
return false;
}
@Override
public VizierOfDefermentEffect copy() {
return new VizierOfDefermentEffect(this);
}
}

View file

@ -34,12 +34,15 @@ import mage.abilities.common.CycleTriggeredAbility;
import mage.abilities.common.SimpleActivatedAbility;
import mage.abilities.costs.common.TapSourceCost;
import mage.abilities.costs.mana.ManaCostsImpl;
import mage.abilities.effects.Effect;
import mage.abilities.effects.common.UntapTargetEffect;
import mage.abilities.keyword.CyclingAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.Zone;
import mage.filter.FilterPermanent;
import mage.filter.predicate.permanent.AnotherPredicate;
import mage.target.TargetPermanent;
/**
@ -48,6 +51,12 @@ import mage.target.TargetPermanent;
*/
public class VizierOfTumblingSands extends CardImpl {
private static final FilterPermanent filter = new FilterPermanent("another target permanent");
static {
filter.add(new AnotherPredicate());
}
public VizierOfTumblingSands(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{2}{U}");
@ -57,8 +66,10 @@ public class VizierOfTumblingSands extends CardImpl {
this.toughness = new MageInt(3);
// {T}: Untap another target permanent.
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new UntapTargetEffect(), new TapSourceCost());
ability.addTarget(new TargetPermanent());
Effect effect = new UntapTargetEffect();
effect.setText("Untap another target permanent");
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, effect, new TapSourceCost());
ability.addTarget(new TargetPermanent(filter));
this.addAbility(ability);
// Cycling {1}{U}

View file

@ -94,7 +94,7 @@ public class ActivateIfConditionActivatedAbility extends ActivatedAbilityImpl {
}
sb.append(condition.toString()).append('.');
} else {
sb.append(" [Condition toSting() == null] ");
sb.append(" [Condition toString() == null] ");
}
return sb.toString() ;
}

View file

@ -167,9 +167,9 @@ public class BecomesCreatureSourceEffect extends ContinuousEffectImpl implements
private void setText() {
if (type != null && !type.isEmpty()) {
staticText = duration.toString() + " {this} becomes a " + token.getDescription() + " that's still a " + this.type;
staticText = duration.toString() + ", {this} becomes a " + token.getDescription() + " that's still a " + this.type;
} else {
staticText = duration.toString() + " {this} becomes a " + token.getDescription();
staticText = duration.toString() + ", {this} becomes a " + token.getDescription();
}
}

View file

@ -1,113 +1,114 @@
/*
* 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.effects.common.search;
import mage.MageObject;
import mage.abilities.Ability;
import mage.abilities.effects.OneShotEffect;
import mage.cards.Card;
import mage.cards.CardsImpl;
import mage.constants.Outcome;
import mage.constants.Zone;
import mage.filter.FilterCard;
import mage.game.Game;
import mage.players.Player;
import mage.target.TargetCard;
import mage.target.common.TargetCardInLibrary;
/**
*
* @author Styxo
*/
public class SearchLibraryGraveyardPutInHandEffect extends OneShotEffect {
private FilterCard filter;
private boolean forceToSearchBoth;
public SearchLibraryGraveyardPutInHandEffect(FilterCard filter) {
this(filter, false);
}
public SearchLibraryGraveyardPutInHandEffect(FilterCard filter, boolean forceToSearchBoth) {
super(Outcome.Benefit);
this.filter = filter;
this.forceToSearchBoth = forceToSearchBoth;
staticText = "Search your library and" + (forceToSearchBoth ? "" : "/or ") + " graveyard for a card named " + filter.getMessage() + ", reveal it, and put it into your hand. Then shuffle your library";
}
public SearchLibraryGraveyardPutInHandEffect(final SearchLibraryGraveyardPutInHandEffect effect) {
super(effect);
this.filter = effect.filter;
this.forceToSearchBoth = effect.forceToSearchBoth;
}
@Override
public SearchLibraryGraveyardPutInHandEffect copy() {
return new SearchLibraryGraveyardPutInHandEffect(this);
}
@Override
public boolean apply(Game game, Ability source) {
Player controller = game.getPlayer(source.getControllerId());
MageObject sourceObject = source.getSourceObject(game);
Card cardFound = null;
if (controller != null && sourceObject != null) {
if (forceToSearchBoth || controller.chooseUse(outcome, "Search your library for a card named " + filter.getMessage() + '?', source, game)) {
TargetCardInLibrary target = new TargetCardInLibrary(0, 1, filter);
target.clearChosen();
if (controller.searchLibrary(target, game)) {
if (!target.getTargets().isEmpty()) {
cardFound = game.getCard(target.getFirstTarget());
}
}
controller.shuffleLibrary(source, game);
}
if (cardFound == null && controller.chooseUse(outcome, "Search your graveyard for a card named " + filter.getMessage() + '?', source, game)) {
TargetCard target = new TargetCard(0, 1, Zone.GRAVEYARD, filter);
target.clearChosen();
if (controller.choose(outcome, controller.getGraveyard(), target, game)) {
if (!target.getTargets().isEmpty()) {
cardFound = game.getCard(target.getFirstTarget());
}
}
}
if (cardFound != null) {
controller.revealCards(sourceObject.getIdName(), new CardsImpl(cardFound), game);
controller.moveCards(cardFound, Zone.HAND, source, game);
}
return true;
}
return false;
}
}
/*
* 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.effects.common.search;
import mage.MageObject;
import mage.abilities.Ability;
import mage.abilities.effects.OneShotEffect;
import mage.cards.Card;
import mage.cards.CardsImpl;
import mage.constants.Outcome;
import mage.constants.Zone;
import mage.filter.FilterCard;
import mage.game.Game;
import mage.players.Player;
import mage.target.TargetCard;
import mage.target.common.TargetCardInLibrary;
/**
*
* @author Styxo
*/
public class SearchLibraryGraveyardPutInHandEffect extends OneShotEffect {
private FilterCard filter;
private boolean forceToSearchBoth;
public SearchLibraryGraveyardPutInHandEffect(FilterCard filter) {
this(filter, false);
}
public SearchLibraryGraveyardPutInHandEffect(FilterCard filter, boolean forceToSearchBoth) {
super(Outcome.Benefit);
this.filter = filter;
this.forceToSearchBoth = forceToSearchBoth;
staticText = "Search your library and" + (forceToSearchBoth ? "" : "/or ") + " graveyard for a card named " + filter.getMessage() +
", reveal it, and put it into your hand. " + (forceToSearchBoth ? "Then shuffle your library" : "If you search your library this way, shuffle it");
}
public SearchLibraryGraveyardPutInHandEffect(final SearchLibraryGraveyardPutInHandEffect effect) {
super(effect);
this.filter = effect.filter;
this.forceToSearchBoth = effect.forceToSearchBoth;
}
@Override
public SearchLibraryGraveyardPutInHandEffect copy() {
return new SearchLibraryGraveyardPutInHandEffect(this);
}
@Override
public boolean apply(Game game, Ability source) {
Player controller = game.getPlayer(source.getControllerId());
MageObject sourceObject = source.getSourceObject(game);
Card cardFound = null;
if (controller != null && sourceObject != null) {
if (forceToSearchBoth || controller.chooseUse(outcome, "Search your library for a card named " + filter.getMessage() + '?', source, game)) {
TargetCardInLibrary target = new TargetCardInLibrary(0, 1, filter);
target.clearChosen();
if (controller.searchLibrary(target, game)) {
if (!target.getTargets().isEmpty()) {
cardFound = game.getCard(target.getFirstTarget());
}
}
controller.shuffleLibrary(source, game);
}
if (cardFound == null && controller.chooseUse(outcome, "Search your graveyard for a card named " + filter.getMessage() + '?', source, game)) {
TargetCard target = new TargetCard(0, 1, Zone.GRAVEYARD, filter);
target.clearChosen();
if (controller.choose(outcome, controller.getGraveyard(), target, game)) {
if (!target.getTargets().isEmpty()) {
cardFound = game.getCard(target.getFirstTarget());
}
}
}
if (cardFound != null) {
controller.revealCards(sourceObject.getIdName(), new CardsImpl(cardFound), game);
controller.moveCards(cardFound, Zone.HAND, source, game);
}
return true;
}
return false;
}
}

View file

@ -94,7 +94,7 @@ public class GameEvent implements Serializable {
INVESTIGATED,
DISCARD_CARD,
DISCARDED_CARD,
// CYCLE_CARD, CYCLED_CARD,
CYCLE_CARD, CYCLED_CARD,
PAY_CYCLE_COST, CAN_PAY_CYCLE_COST,
CLASH, CLASHED,
DAMAGE_PLAYER,

View file

@ -30832,7 +30832,7 @@ Verdant Catacombs|Modern Masters 2017|249|R||Land|||{T}, Pay 1 life, Sacrifice V
Angel of Sanctions|Amonkhet|1|M|{3}{W}{W}|Creature - Angel|3|4|Flying$When Angel of Sanctions enters the battlefield, you may exile target nonland permanent an opponent controls until Angel of Sanctions leaves the battlefield.$Embalm {5}{W}|
Anointed Procession|Amonkhet|2|R|{3}{W}|Enchantment|||If an effect would create one or more tokens under your control, it creates twice that many of those tokens instead.|
Anointer Priest|Amonkhet|3|C|{1}{W}|Creature - Human Cleric|1|3|Whenever a creature token enters the battlefield under your control, you gain 1 life.$Embalm {3}{W}|
Approach of the Second Sun|Amonkhet|4|R|{6}{W}|Sorcery|||If Approach of the Second Sun was cast from your hand and you cast another spell named Approach of the Second Sun this game, you win the game. If not, you gain 7 life and put Approach of the Second Sun back into your library as the 7th card from the top.|
Approach of the Second Sun|Amonkhet|4|R|{6}{W}|Sorcery|||If Approach of the Second Sun was cast from your hand and you've cast another spell named Approach of the Second Sun this game, you win the game. Otherwise, put Approach of the Second Sun into its owner's library seventh from the top and you gain 7 life.|
Aven Mindcensor|Amonkhet|5|R|{2}{W}|Creature - Bird Wizard|2|1|Flash$Flying$If an opponent would search a library, that player searches the top four cards of that library instead.|
Binding Mummy|Amonkhet|6|C|{1}{W}|Creature - Zombie|2|2|Whenever another Zombie enters the battlefield under your control, you may tap target artifact or creature.|
Cartouche of Solidarity|Amonkhet|7|C|{W}|Enchantment - Aura Cartouche|||Enchant creature you control$When Cartouche of Solidarity enters the battlefield, create a 1/1 white Warrior creature token with vigilance.$Enchanted creature gets +1/+1 and has first strike.|