mirror of
https://github.com/correl/mage.git
synced 2024-12-26 11:09:27 +00:00
[ZEN] 5 cards
This commit is contained in:
parent
8a34285d0f
commit
b031b751be
5 changed files with 561 additions and 0 deletions
115
Mage.Sets/src/mage/sets/zendikar/ElementalAppeal.java
Normal file
115
Mage.Sets/src/mage/sets/zendikar/ElementalAppeal.java
Normal file
|
@ -0,0 +1,115 @@
|
|||
/*
|
||||
* 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.zendikar;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.Constants.CardType;
|
||||
import mage.Constants.Duration;
|
||||
import mage.Constants.Outcome;
|
||||
import mage.Constants.Rarity;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.DelayedTriggeredAbility;
|
||||
import mage.abilities.common.delayed.AtEndOfTurnDelayedTriggeredAbility;
|
||||
import mage.abilities.condition.common.KickedCondition;
|
||||
import mage.abilities.costs.mana.KickerManaCost;
|
||||
import mage.abilities.decorator.ConditionalContinousEffect;
|
||||
import mage.abilities.effects.Effect;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.abilities.effects.common.ExileTargetEffect;
|
||||
import mage.abilities.effects.common.continious.BoostTargetEffect;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.game.Game;
|
||||
import mage.target.targetpointer.FixedTarget;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author North
|
||||
*/
|
||||
public class ElementalAppeal extends CardImpl<ElementalAppeal> {
|
||||
|
||||
public ElementalAppeal(UUID ownerId) {
|
||||
super(ownerId, 123, "Elemental Appeal", Rarity.RARE, new CardType[]{CardType.SORCERY}, "{R}{R}{R}{R}");
|
||||
this.expansionSetCode = "ZEN";
|
||||
|
||||
this.color.setRed(true);
|
||||
|
||||
// Kicker {5}
|
||||
this.getSpellAbility().addOptionalCost(new KickerManaCost("{5}"));
|
||||
// Put a 7/1 red Elemental creature token with trample and haste onto the battlefield. Exile it at the beginning of the next end step.
|
||||
this.getSpellAbility().addEffect(new ElementalAppealEffect());
|
||||
// If Elemental Appeal was kicked, that creature gets +7/+0 until end of turn.
|
||||
this.getSpellAbility().addEffect(new ConditionalContinousEffect(
|
||||
new BoostTargetEffect(7, 0, Duration.EndOfTurn),
|
||||
KickedCondition.getInstance(),
|
||||
"If {this} was kicked, that creature gets +7/+0 until end of turn"));
|
||||
}
|
||||
|
||||
public ElementalAppeal(final ElementalAppeal card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ElementalAppeal copy() {
|
||||
return new ElementalAppeal(this);
|
||||
}
|
||||
}
|
||||
|
||||
class ElementalAppealEffect extends OneShotEffect<ElementalAppealEffect> {
|
||||
|
||||
public ElementalAppealEffect() {
|
||||
super(Outcome.PutCreatureInPlay);
|
||||
this.staticText = "Put a 7/1 red Elemental creature token with trample and haste onto the battlefield. Exile it at the beginning of the next end step";
|
||||
}
|
||||
|
||||
public ElementalAppealEffect(final ElementalAppealEffect effect) {
|
||||
super(effect);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ElementalAppealEffect copy() {
|
||||
return new ElementalAppealEffect(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
ElementalToken token = new ElementalToken();
|
||||
token.putOntoBattlefield(1, game, source.getSourceId(), source.getControllerId());
|
||||
|
||||
FixedTarget fixedTarget = new FixedTarget(token.getLastAddedToken());
|
||||
source.getEffects().get(1).setTargetPointer(fixedTarget);
|
||||
|
||||
ExileTargetEffect exileEffect = new ExileTargetEffect();
|
||||
exileEffect.setTargetPointer(fixedTarget);
|
||||
DelayedTriggeredAbility delayedAbility = new AtEndOfTurnDelayedTriggeredAbility(exileEffect);
|
||||
delayedAbility.setSourceId(source.getSourceId());
|
||||
delayedAbility.setControllerId(source.getControllerId());
|
||||
game.addDelayedTriggeredAbility(delayedAbility);
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
116
Mage.Sets/src/mage/sets/zendikar/GrimDiscovery.java
Normal file
116
Mage.Sets/src/mage/sets/zendikar/GrimDiscovery.java
Normal file
|
@ -0,0 +1,116 @@
|
|||
/*
|
||||
* 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.zendikar;
|
||||
|
||||
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.Mode;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.abilities.effects.common.ReturnToHandTargetEffect;
|
||||
import mage.cards.Card;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.filter.common.FilterCreatureCard;
|
||||
import mage.filter.common.FilterLandCard;
|
||||
import mage.game.Game;
|
||||
import mage.target.common.TargetCardInYourGraveyard;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author North
|
||||
*/
|
||||
public class GrimDiscovery extends CardImpl<GrimDiscovery> {
|
||||
|
||||
private static final FilterCreatureCard filterCreatureCard = new FilterCreatureCard("creature card from your graveyard");
|
||||
private static final FilterLandCard filterLandCard = new FilterLandCard("land card from your graveyard");
|
||||
|
||||
public GrimDiscovery(UUID ownerId) {
|
||||
super(ownerId, 91, "Grim Discovery", Rarity.COMMON, new CardType[]{CardType.SORCERY}, "{1}{B}");
|
||||
this.expansionSetCode = "ZEN";
|
||||
|
||||
this.color.setBlack(true);
|
||||
|
||||
// Choose one or both - Return target creature card from your graveyard to your hand; and/or return target land card from your graveyard to your hand.
|
||||
this.getSpellAbility().addEffect(new ReturnToHandTargetEffect());
|
||||
this.getSpellAbility().addTarget(new TargetCardInYourGraveyard(filterCreatureCard));
|
||||
|
||||
Mode mode1 = new Mode();
|
||||
mode1.getEffects().add(new ReturnToHandTargetEffect());
|
||||
mode1.getTargets().add(new TargetCardInYourGraveyard(filterLandCard));
|
||||
this.getSpellAbility().addMode(mode1);
|
||||
|
||||
Mode mode2 = new Mode();
|
||||
mode2.getEffects().add(new GrimDiscoveryEffect());
|
||||
mode2.getTargets().add(new TargetCardInYourGraveyard(filterCreatureCard));
|
||||
mode2.getTargets().add(new TargetCardInYourGraveyard(filterLandCard));
|
||||
this.getSpellAbility().addMode(mode2);
|
||||
}
|
||||
|
||||
public GrimDiscovery(final GrimDiscovery card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public GrimDiscovery copy() {
|
||||
return new GrimDiscovery(this);
|
||||
}
|
||||
}
|
||||
|
||||
class GrimDiscoveryEffect extends OneShotEffect<GrimDiscoveryEffect> {
|
||||
|
||||
public GrimDiscoveryEffect() {
|
||||
super(Outcome.ReturnToHand);
|
||||
this.staticText = "Return target creature card from your graveyard and target land card from your graveyard to your hand";
|
||||
}
|
||||
|
||||
public GrimDiscoveryEffect(final GrimDiscoveryEffect effect) {
|
||||
super(effect);
|
||||
}
|
||||
|
||||
@Override
|
||||
public GrimDiscoveryEffect copy() {
|
||||
return new GrimDiscoveryEffect(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
boolean result = false;
|
||||
Card card = game.getCard(source.getFirstTarget());
|
||||
if (card != null) {
|
||||
result |= card.moveToZone(Zone.HAND, source.getId(), game, true);
|
||||
}
|
||||
card = game.getCard(source.getTargets().get(1).getFirstTarget());
|
||||
if (card != null) {
|
||||
result |= card.moveToZone(Zone.HAND, source.getId(), game, true);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
}
|
100
Mage.Sets/src/mage/sets/zendikar/PunishingFire.java
Normal file
100
Mage.Sets/src/mage/sets/zendikar/PunishingFire.java
Normal file
|
@ -0,0 +1,100 @@
|
|||
/*
|
||||
* 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.zendikar;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.Constants.CardType;
|
||||
import mage.Constants.Rarity;
|
||||
import mage.Constants.Zone;
|
||||
import mage.abilities.TriggeredAbilityImpl;
|
||||
import mage.abilities.costs.mana.ManaCostsImpl;
|
||||
import mage.abilities.effects.common.DamageTargetEffect;
|
||||
import mage.abilities.effects.common.DoIfCostPaid;
|
||||
import mage.abilities.effects.common.ReturnToHandSourceEffect;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.game.Game;
|
||||
import mage.game.events.GameEvent;
|
||||
import mage.target.common.TargetCreatureOrPlayer;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author North
|
||||
*/
|
||||
public class PunishingFire extends CardImpl<PunishingFire> {
|
||||
|
||||
public PunishingFire(UUID ownerId) {
|
||||
super(ownerId, 142, "Punishing Fire", Rarity.UNCOMMON, new CardType[]{CardType.INSTANT}, "{1}{R}");
|
||||
this.expansionSetCode = "ZEN";
|
||||
|
||||
this.color.setRed(true);
|
||||
|
||||
// Punishing Fire deals 2 damage to target creature or player.
|
||||
this.getSpellAbility().addEffect(new DamageTargetEffect(2));
|
||||
this.getSpellAbility().addTarget(new TargetCreatureOrPlayer());
|
||||
// Whenever an opponent gains life, you may pay {R}. If you do, return Punishing Fire from your graveyard to your hand.
|
||||
this.addAbility(new PunishingFireTriggeredAbility());
|
||||
}
|
||||
|
||||
public PunishingFire(final PunishingFire card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PunishingFire copy() {
|
||||
return new PunishingFire(this);
|
||||
}
|
||||
}
|
||||
|
||||
class PunishingFireTriggeredAbility extends TriggeredAbilityImpl<PunishingFireTriggeredAbility> {
|
||||
|
||||
public PunishingFireTriggeredAbility() {
|
||||
super(Zone.GRAVEYARD, new DoIfCostPaid(new ReturnToHandSourceEffect(), new ManaCostsImpl("{R}")));
|
||||
}
|
||||
|
||||
public PunishingFireTriggeredAbility(final PunishingFireTriggeredAbility ability) {
|
||||
super(ability);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PunishingFireTriggeredAbility copy() {
|
||||
return new PunishingFireTriggeredAbility(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean checkTrigger(GameEvent event, Game game) {
|
||||
if (event.getType() == GameEvent.EventType.GAINED_LIFE && game.getOpponents(this.controllerId).contains(event.getPlayerId())) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getRule() {
|
||||
return "Whenever an opponent gains life, " + super.getRule();
|
||||
}
|
||||
}
|
127
Mage.Sets/src/mage/sets/zendikar/SadisticSacrament.java
Normal file
127
Mage.Sets/src/mage/sets/zendikar/SadisticSacrament.java
Normal file
|
@ -0,0 +1,127 @@
|
|||
/*
|
||||
* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without modification, are
|
||||
* permitted provided that the following conditions are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright notice, this list of
|
||||
* conditions and the following disclaimer.
|
||||
*
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
|
||||
* of conditions and the following disclaimer in the documentation and/or other materials
|
||||
* provided with the distribution.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED
|
||||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
|
||||
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR
|
||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
|
||||
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
|
||||
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
* The views and conclusions contained in the software and documentation are those of the
|
||||
* authors and should not be interpreted as representing official policies, either expressed
|
||||
* or implied, of BetaSteward_at_googlemail.com.
|
||||
*/
|
||||
package mage.sets.zendikar;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
import mage.Constants.CardType;
|
||||
import mage.Constants.Outcome;
|
||||
import mage.Constants.Rarity;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.condition.common.KickedCondition;
|
||||
import mage.abilities.costs.mana.KickerManaCost;
|
||||
import mage.abilities.decorator.ConditionalOneShotEffect;
|
||||
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.TargetPlayer;
|
||||
import mage.target.common.TargetCardInLibrary;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author North
|
||||
*/
|
||||
public class SadisticSacrament extends CardImpl<SadisticSacrament> {
|
||||
|
||||
public SadisticSacrament(UUID ownerId) {
|
||||
super(ownerId, 110, "Sadistic Sacrament", Rarity.RARE, new CardType[]{CardType.SORCERY}, "{B}{B}{B}");
|
||||
this.expansionSetCode = "ZEN";
|
||||
|
||||
this.color.setBlack(true);
|
||||
|
||||
// Kicker {7}
|
||||
this.getSpellAbility().addOptionalCost(new KickerManaCost("{7}"));
|
||||
// Search target player's library for up to three cards, exile them, then that player shuffles his or her library.
|
||||
// If Sadistic Sacrament was kicked, instead search that player's library for up to fifteen cards, exile them, then that player shuffles his or her library.
|
||||
this.getSpellAbility().addEffect(new ConditionalOneShotEffect(
|
||||
new SadisticSacramentEffect(15),
|
||||
new SadisticSacramentEffect(3),
|
||||
KickedCondition.getInstance(),
|
||||
"Search target player's library for up to three cards, exile them, then that player shuffles his or her library. If Sadistic Sacrament was kicked, instead search that player's library for up to fifteen cards, exile them, then that player shuffles his or her library"));
|
||||
this.getSpellAbility().addTarget(new TargetPlayer());
|
||||
}
|
||||
|
||||
public SadisticSacrament(final SadisticSacrament card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public SadisticSacrament copy() {
|
||||
return new SadisticSacrament(this);
|
||||
}
|
||||
}
|
||||
|
||||
class SadisticSacramentEffect extends OneShotEffect<SadisticSacramentEffect> {
|
||||
|
||||
private int amount;
|
||||
|
||||
public SadisticSacramentEffect(int amount) {
|
||||
super(Outcome.Exile);
|
||||
this.amount = amount;
|
||||
}
|
||||
|
||||
public SadisticSacramentEffect(final SadisticSacramentEffect effect) {
|
||||
super(effect);
|
||||
this.amount = effect.amount;
|
||||
}
|
||||
|
||||
@Override
|
||||
public SadisticSacramentEffect copy() {
|
||||
return new SadisticSacramentEffect(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Player targetPlayer = game.getPlayer(source.getFirstTarget());
|
||||
Player player = game.getPlayer(source.getControllerId());
|
||||
if (player != null && targetPlayer != null) {
|
||||
Cards targetPlayersLibrary = new CardsImpl();
|
||||
targetPlayersLibrary.addAll(targetPlayer.getLibrary().getCardList());
|
||||
|
||||
TargetCardInLibrary target = new TargetCardInLibrary(0, amount, new FilterCard("cards to exile"));
|
||||
if (player.choose(Outcome.Benefit, targetPlayersLibrary, target, game)) {
|
||||
List<UUID> targets = target.getTargets();
|
||||
for (UUID targetId : targets) {
|
||||
Card card = targetPlayer.getLibrary().remove(targetId, game);
|
||||
if (card != null) {
|
||||
card.moveToExile(null, "", source.getId(), game);
|
||||
}
|
||||
}
|
||||
}
|
||||
targetPlayer.shuffleLibrary(game);
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
103
Mage.Sets/src/mage/sets/zendikar/TrapfindersTrick.java
Normal file
103
Mage.Sets/src/mage/sets/zendikar/TrapfindersTrick.java
Normal file
|
@ -0,0 +1,103 @@
|
|||
/*
|
||||
* 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.zendikar;
|
||||
|
||||
import java.util.Set;
|
||||
import java.util.UUID;
|
||||
import mage.Constants.CardType;
|
||||
import mage.Constants.Outcome;
|
||||
import mage.Constants.Rarity;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.cards.Card;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.Cards;
|
||||
import mage.game.Game;
|
||||
import mage.players.Player;
|
||||
import mage.target.TargetPlayer;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author North
|
||||
*/
|
||||
public class TrapfindersTrick extends CardImpl<TrapfindersTrick> {
|
||||
|
||||
public TrapfindersTrick(UUID ownerId) {
|
||||
super(ownerId, 73, "Trapfinder's Trick", Rarity.COMMON, new CardType[]{CardType.SORCERY}, "{1}{U}");
|
||||
this.expansionSetCode = "ZEN";
|
||||
|
||||
this.color.setBlue(true);
|
||||
|
||||
// Target player reveals his or her hand and discards all Trap cards.
|
||||
this.getSpellAbility().addEffect(new TrapfindersTrickEffect());
|
||||
this.getSpellAbility().addTarget(new TargetPlayer());
|
||||
}
|
||||
|
||||
public TrapfindersTrick(final TrapfindersTrick card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public TrapfindersTrick copy() {
|
||||
return new TrapfindersTrick(this);
|
||||
}
|
||||
}
|
||||
|
||||
class TrapfindersTrickEffect extends OneShotEffect<TrapfindersTrickEffect> {
|
||||
|
||||
public TrapfindersTrickEffect() {
|
||||
super(Outcome.Discard);
|
||||
this.staticText = "Target player reveals his or her hand and discards all Trap cards";
|
||||
}
|
||||
|
||||
public TrapfindersTrickEffect(final TrapfindersTrickEffect effect) {
|
||||
super(effect);
|
||||
}
|
||||
|
||||
@Override
|
||||
public TrapfindersTrickEffect copy() {
|
||||
return new TrapfindersTrickEffect(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Player player = game.getPlayer(source.getFirstTarget());
|
||||
if (player != null) {
|
||||
Cards hand = player.getHand();
|
||||
player.revealCards("Trapfinder's Trick", hand, game);
|
||||
Set<Card> cards = hand.getCards(game);
|
||||
for (Card card : cards) {
|
||||
if (card != null && card.hasSubtype("Trap")) {
|
||||
player.discard(card, source, game);
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue