[ISD] cards

This commit is contained in:
North 2011-09-28 23:04:36 +03:00
parent a0ca150a64
commit 0c0f7a0bc5
6 changed files with 668 additions and 0 deletions

View file

@ -0,0 +1,124 @@
/*
* 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.innistrad;
import java.util.Random;
import java.util.UUID;
import mage.Constants.CardType;
import mage.Constants.Duration;
import mage.Constants.Outcome;
import mage.Constants.Rarity;
import mage.Constants.Zone;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.OnEventTriggeredAbility;
import mage.abilities.common.SpellCastTriggeredAbility;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.continious.BoostSourceEffect;
import mage.cards.Card;
import mage.cards.CardImpl;
import mage.filter.Filter.ComparisonScope;
import mage.filter.FilterCard;
import mage.game.Game;
import mage.game.events.GameEvent.EventType;
import mage.players.Player;
/**
*
* @author North
*/
public class CharmbreakerDevils extends CardImpl<CharmbreakerDevils> {
private static final FilterCard filter = new FilterCard("instant or sorcery card");
static {
filter.getCardType().add(CardType.INSTANT);
filter.getCardType().add(CardType.SORCERY);
filter.setScopeSubtype(ComparisonScope.Any);
}
public CharmbreakerDevils(UUID ownerId) {
super(ownerId, 134, "Charmbreaker Devils", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{5}{R}");
this.expansionSetCode = "ISD";
this.subtype.add("Devil");
this.color.setRed(true);
this.power = new MageInt(4);
this.toughness = new MageInt(4);
// At the beginning of your upkeep, return an instant or sorcery card at random from your graveyard to your hand.
this.addAbility(new OnEventTriggeredAbility(EventType.UPKEEP_STEP_PRE, "beginning of your upkeep", new CharmbreakerDevilsEffect(), false));
// Whenever you cast an instant or sorcery spell, Charmbreaker Devils gets +4/+0 until end of turn.
this.addAbility(new SpellCastTriggeredAbility(new BoostSourceEffect(4, 0, Duration.EndOfTurn), filter, false));
}
public CharmbreakerDevils(final CharmbreakerDevils card) {
super(card);
}
@Override
public CharmbreakerDevils copy() {
return new CharmbreakerDevils(this);
}
}
class CharmbreakerDevilsEffect extends OneShotEffect<CharmbreakerDevilsEffect> {
public CharmbreakerDevilsEffect() {
super(Outcome.ReturnToHand);
this.staticText = "return an instant or sorcery card at random from your graveyard to your hand";
}
public CharmbreakerDevilsEffect(final CharmbreakerDevilsEffect effect) {
super(effect);
}
@Override
public CharmbreakerDevilsEffect copy() {
return new CharmbreakerDevilsEffect(this);
}
@Override
public boolean apply(Game game, Ability source) {
Player player = game.getPlayer(source.getControllerId());
if (player != null) {
FilterCard filter = new FilterCard("instant or sorcery card");
filter.getCardType().add(CardType.INSTANT);
filter.getCardType().add(CardType.SORCERY);
filter.setScopeSubtype(ComparisonScope.Any);
Card[] cards = player.getGraveyard().getCards(filter, game).toArray(new Card[0]);
if (cards.length > 0) {
Random rnd = new Random();
Card card = cards[rnd.nextInt(cards.length)];
card.moveToZone(Zone.HAND, source.getId(), game, true);
return true;
}
}
return false;
}
}

View 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.innistrad;
import java.util.UUID;
import mage.Constants.CardType;
import mage.Constants.Outcome;
import mage.Constants.Rarity;
import mage.Constants.TimingRule;
import mage.abilities.Ability;
import mage.abilities.costs.mana.ManaCostsImpl;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.keyword.FlashbackAbility;
import mage.cards.Card;
import mage.cards.CardImpl;
import mage.cards.Cards;
import mage.game.Game;
import mage.players.Player;
/**
*
* @author North
*/
public class DesperateRavings extends CardImpl<DesperateRavings> {
public DesperateRavings(UUID ownerId) {
super(ownerId, 139, "Desperate Ravings", Rarity.UNCOMMON, new CardType[]{CardType.INSTANT}, "{1}{R}");
this.expansionSetCode = "ISD";
this.color.setRed(true);
// Draw two cards, then discard a card at random.
this.getSpellAbility().addEffect(new DesperateRavingsEffect());
// Flashback {2}{U}
this.addAbility(new FlashbackAbility(new ManaCostsImpl("{2}{U}"), TimingRule.INSTANT));
}
public DesperateRavings(final DesperateRavings card) {
super(card);
}
@Override
public DesperateRavings copy() {
return new DesperateRavings(this);
}
}
class DesperateRavingsEffect extends OneShotEffect<DesperateRavingsEffect> {
public DesperateRavingsEffect() {
super(Outcome.DrawCard);
this.staticText = "Draw two cards, then discard a card at random";
}
public DesperateRavingsEffect(final DesperateRavingsEffect effect) {
super(effect);
}
@Override
public DesperateRavingsEffect copy() {
return new DesperateRavingsEffect(this);
}
@Override
public boolean apply(Game game, Ability source) {
Player player = game.getPlayer(source.getControllerId());
if (player != null) {
player.drawCards(2, game);
Cards hand = player.getHand();
Card card = hand.getRandom(game);
if (card != null) {
player.discard(card, source, game);
}
return true;
}
return false;
}
}

View file

@ -0,0 +1,118 @@
/*
* 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.innistrad;
import java.util.UUID;
import mage.Constants.CardType;
import mage.Constants.Rarity;
import mage.Constants.Zone;
import mage.MageInt;
import mage.abilities.TriggeredAbilityImpl;
import mage.abilities.effects.Effect;
import mage.abilities.effects.common.GainLifeEffect;
import mage.abilities.effects.common.LoseLifeTargetEffect;
import mage.abilities.keyword.FlyingAbility;
import mage.cards.CardImpl;
import mage.game.Game;
import mage.game.events.GameEvent;
import mage.game.events.ZoneChangeEvent;
import mage.game.permanent.Permanent;
import mage.target.TargetPlayer;
/**
*
* @author North
*/
public class FalkenrathNoble extends CardImpl<FalkenrathNoble> {
public FalkenrathNoble(UUID ownerId) {
super(ownerId, 100, "Falkenrath Noble", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{3}{B}");
this.expansionSetCode = "ISD";
this.subtype.add("Vampire");
this.color.setBlack(true);
this.power = new MageInt(2);
this.toughness = new MageInt(2);
this.addAbility(FlyingAbility.getInstance());
// Whenever Falkenrath Noble or another creature dies, target player loses 1 life and you gain 1 life.
this.addAbility(new FalkenrathNobleTriggeredAbility());
}
public FalkenrathNoble(final FalkenrathNoble card) {
super(card);
}
@Override
public FalkenrathNoble copy() {
return new FalkenrathNoble(this);
}
}
class FalkenrathNobleTriggeredAbility extends TriggeredAbilityImpl<FalkenrathNobleTriggeredAbility> {
public FalkenrathNobleTriggeredAbility() {
super(Zone.BATTLEFIELD, new LoseLifeTargetEffect(1), false);
this.addEffect(new GainLifeEffect(1));
this.addTarget(new TargetPlayer());
}
public FalkenrathNobleTriggeredAbility(final FalkenrathNobleTriggeredAbility ability) {
super(ability);
}
@Override
public FalkenrathNobleTriggeredAbility copy() {
return new FalkenrathNobleTriggeredAbility(this);
}
@Override
public boolean checkTrigger(GameEvent event, Game game) {
if (event.getType() == GameEvent.EventType.ZONE_CHANGE) {
ZoneChangeEvent zEvent = (ZoneChangeEvent) event;
if (zEvent.getFromZone() == Zone.BATTLEFIELD && zEvent.getToZone() == Zone.GRAVEYARD) {
Permanent permanent = (Permanent) game.getLastKnownInformation(event.getTargetId(), Zone.BATTLEFIELD);
if (permanent != null) {
if (permanent.getId().equals(this.getSourceId())) {
return true;
} else {
if (permanent.getCardType().contains(CardType.CREATURE)) {
return true;
}
}
}
}
}
return false;
}
@Override
public String getRule() {
return "Whenever {this} or another creature dies, target player loses 1 life and you gain 1 life.";
}
}

View file

@ -0,0 +1,109 @@
/*
* 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.innistrad;
import java.util.Random;
import java.util.UUID;
import mage.Constants.CardType;
import mage.Constants.Outcome;
import mage.Constants.Rarity;
import mage.Constants.Zone;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
import mage.abilities.effects.OneShotEffect;
import mage.cards.Card;
import mage.cards.CardImpl;
import mage.filter.Filter.ComparisonScope;
import mage.filter.FilterCard;
import mage.game.Game;
import mage.players.Player;
/**
*
* @author North
*/
public class Ghoulraiser extends CardImpl<Ghoulraiser> {
public Ghoulraiser(UUID ownerId) {
super(ownerId, 102, "Ghoulraiser", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{1}{B}{B}");
this.expansionSetCode = "ISD";
this.subtype.add("Zombie");
this.color.setBlack(true);
this.power = new MageInt(2);
this.toughness = new MageInt(2);
// When Ghoulraiser enters the battlefield, return a Zombie card at random from your graveyard to your hand.
this.addAbility(new EntersBattlefieldTriggeredAbility(new GhoulraiserEffect(), false));
}
public Ghoulraiser(final Ghoulraiser card) {
super(card);
}
@Override
public Ghoulraiser copy() {
return new Ghoulraiser(this);
}
}
class GhoulraiserEffect extends OneShotEffect<GhoulraiserEffect> {
public GhoulraiserEffect() {
super(Outcome.ReturnToHand);
this.staticText = "return a Zombie card at random from your graveyard to your hand";
}
public GhoulraiserEffect(final GhoulraiserEffect effect) {
super(effect);
}
@Override
public GhoulraiserEffect copy() {
return new GhoulraiserEffect(this);
}
@Override
public boolean apply(Game game, Ability source) {
Player player = game.getPlayer(source.getControllerId());
if (player != null) {
FilterCard filter = new FilterCard("Zombie card");
filter.getSubtype().add("Zombie");
filter.setScopeSubtype(ComparisonScope.Any);
Card[] cards = player.getGraveyard().getCards(filter, game).toArray(new Card[0]);
if (cards.length > 0) {
Random rnd = new Random();
Card card = cards[rnd.nextInt(cards.length)];
card.moveToZone(Zone.HAND, source.getId(), game, true);
return true;
}
}
return false;
}
}

View 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.innistrad;
import java.util.UUID;
import mage.Constants.CardType;
import mage.Constants.Outcome;
import mage.Constants.Rarity;
import mage.Constants.Zone;
import mage.abilities.Ability;
import mage.abilities.effects.OneShotEffect;
import mage.cards.Card;
import mage.cards.CardImpl;
import mage.cards.Cards;
import mage.game.Game;
import mage.players.Player;
/**
*
* @author North
*/
public class MakeAWish extends CardImpl<MakeAWish> {
public MakeAWish(UUID ownerId) {
super(ownerId, 192, "Make a Wish", Rarity.UNCOMMON, new CardType[]{CardType.SORCERY}, "{3}{G}");
this.expansionSetCode = "ISD";
this.color.setGreen(true);
// Return two cards at random from your graveyard to your hand.
this.getSpellAbility().addEffect(new MakeAWishEffect());
}
public MakeAWish(final MakeAWish card) {
super(card);
}
@Override
public MakeAWish copy() {
return new MakeAWish(this);
}
}
class MakeAWishEffect extends OneShotEffect<MakeAWishEffect> {
public MakeAWishEffect() {
super(Outcome.ReturnToHand);
this.staticText = "Return two cards at random from your graveyard to your hand";
}
public MakeAWishEffect(final MakeAWishEffect effect) {
super(effect);
}
@Override
public MakeAWishEffect copy() {
return new MakeAWishEffect(this);
}
@Override
public boolean apply(Game game, Ability source) {
Player player = game.getPlayer(source.getControllerId());
if (player != null) {
Cards cards = player.getGraveyard();
for (int i = 0; i < 2 && !cards.isEmpty(); i++) {
Card card = cards.getRandom(game);
if (card != null) {
card.moveToZone(Zone.HAND, source.getId(), game, true);
}
}
return true;
}
return false;
}
}

View file

@ -0,0 +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.sets.innistrad;
import java.util.UUID;
import mage.Constants.CardType;
import mage.Constants.Rarity;
import mage.Constants.Zone;
import mage.MageInt;
import mage.abilities.TriggeredAbilityImpl;
import mage.abilities.effects.common.PutLibraryIntoGraveTargetEffect;
import mage.cards.CardImpl;
import mage.game.Game;
import mage.game.events.GameEvent;
import mage.game.events.ZoneChangeEvent;
import mage.game.permanent.Permanent;
import mage.target.TargetPlayer;
/**
*
* @author North
*/
public class SelhoffOccultist extends CardImpl<SelhoffOccultist> {
public SelhoffOccultist(UUID ownerId) {
super(ownerId, 73, "Selhoff Occultist", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{2}{U}");
this.expansionSetCode = "ISD";
this.subtype.add("Human");
this.subtype.add("Rogue");
this.color.setBlue(true);
this.power = new MageInt(2);
this.toughness = new MageInt(3);
// Whenever Selhoff Occultist or another creature dies, target player puts the top card of his or her library into his or her graveyard.
this.addAbility(new SelhoffOccultistTriggeredAbility());
}
public SelhoffOccultist(final SelhoffOccultist card) {
super(card);
}
@Override
public SelhoffOccultist copy() {
return new SelhoffOccultist(this);
}
}
class SelhoffOccultistTriggeredAbility extends TriggeredAbilityImpl<SelhoffOccultistTriggeredAbility> {
public SelhoffOccultistTriggeredAbility() {
super(Zone.BATTLEFIELD, new PutLibraryIntoGraveTargetEffect(1), false);
this.addTarget(new TargetPlayer());
}
public SelhoffOccultistTriggeredAbility(final SelhoffOccultistTriggeredAbility ability) {
super(ability);
}
@Override
public SelhoffOccultistTriggeredAbility copy() {
return new SelhoffOccultistTriggeredAbility(this);
}
@Override
public boolean checkTrigger(GameEvent event, Game game) {
if (event.getType() == GameEvent.EventType.ZONE_CHANGE) {
ZoneChangeEvent zEvent = (ZoneChangeEvent) event;
if (zEvent.getFromZone() == Zone.BATTLEFIELD && zEvent.getToZone() == Zone.GRAVEYARD) {
Permanent permanent = (Permanent) game.getLastKnownInformation(event.getTargetId(), Zone.BATTLEFIELD);
if (permanent != null) {
if (permanent.getId().equals(this.getSourceId())) {
return true;
} else {
if (permanent.getCardType().contains(CardType.CREATURE)) {
return true;
}
}
}
}
}
return false;
}
@Override
public String getRule() {
return "Whenever {this} or another creature dies, target player puts the top card of his or her library into his or her graveyard.";
}
}