[CHK] 6 cards.

This commit is contained in:
LevelX2 2012-12-02 00:48:51 +01:00
parent c7e775fd71
commit d5024039f2
7 changed files with 710 additions and 22 deletions

View file

@ -0,0 +1,89 @@
/*
* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* The views and conclusions contained in the software and documentation are those of the
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of BetaSteward_at_googlemail.com.
*/
package mage.sets.championsofkamigawa;
import java.util.UUID;
import mage.Constants;
import mage.Constants.CardType;
import mage.Constants.Rarity;
import mage.Constants.Zone;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.BeginningOfUpkeepTriggeredAbility;
import mage.abilities.common.EntersBattlefieldAllTriggeredAbility;
import mage.abilities.effects.common.ReturnSourceFromGraveyardToHandEffect;
import mage.abilities.effects.common.SacrificeSourceEffect;
import mage.abilities.effects.common.search.SearchLibraryPutInHandEffect;
import mage.cards.CardImpl;
import mage.filter.FilterCard;
import mage.filter.common.FilterControlledCreaturePermanent;
import mage.filter.predicate.mageobject.SubtypePredicate;
import mage.target.common.TargetCardInLibrary;
/**
*
* @author LevelX2
*/
public class BloodSpeaker extends CardImpl<BloodSpeaker> {
private static final FilterControlledCreaturePermanent filter = new FilterControlledCreaturePermanent("Demon");
private static final FilterCard filterCard = new FilterCard("Demon");
static {
filter.add(new SubtypePredicate("Demon"));
filterCard.add(new SubtypePredicate("Demon"));
}
public BloodSpeaker (UUID ownerId) {
super(ownerId, 103, "Blood Speaker", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{3}{B}");
this.expansionSetCode = "CHK";
this.subtype.add("Ogre");
this.subtype.add("Shaman");
this.color.setBlack(true);
this.power = new MageInt(3);
this.toughness = new MageInt(2);
// At the beginning of your upkeep, you may sacrifice Blood Speaker. If you do, search your library for a Demon card, reveal that card, and put it into your hand. Then shuffle your library.
Ability ability = new BeginningOfUpkeepTriggeredAbility(Zone.BATTLEFIELD, new SacrificeSourceEffect(), Constants.TargetController.YOU, true);
ability.addEffect(new SearchLibraryPutInHandEffect(new TargetCardInLibrary(filterCard), true, true, "If you do, search your library for "));
this.addAbility(ability);
// Whenever a Demon enters the battlefield under your control, return Blood Speaker from your graveyard to your hand.
this.addAbility(new EntersBattlefieldAllTriggeredAbility(Zone.GRAVEYARD, new ReturnSourceFromGraveyardToHandEffect(), filter, false));
}
public BloodSpeaker (final BloodSpeaker card) {
super(card);
}
@Override
public BloodSpeaker copy() {
return new BloodSpeaker(this);
}
}

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.championsofkamigawa;
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.ActivateOncePerTurnActivatedAbility;
import mage.abilities.common.SimpleActivatedAbility;
import mage.abilities.costs.mana.GenericManaCost;
import mage.abilities.costs.mana.ManaCostsImpl;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.LookLibraryControllerEffect;
import mage.abilities.effects.common.continious.BoostSourceEffect;
import mage.abilities.effects.common.continious.GainAbilitySourceEffect;
import mage.abilities.keyword.TrampleAbility;
import mage.cards.Card;
import mage.cards.CardImpl;
import mage.cards.Cards;
import mage.cards.CardsImpl;
import mage.game.Game;
import mage.players.Player;
/**
*
* @author LevelX2
*/
public class CruelDeceiver extends CardImpl<CruelDeceiver> {
public CruelDeceiver(UUID ownerId) {
super(ownerId, 106, "Cruel Deceiver", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{1}{B}");
this.expansionSetCode = "CHK";
this.subtype.add("Spirit");
this.color.setBlack(true);
this.power = new MageInt(2);
this.toughness = new MageInt(1);
// {1}: Look at the top card of your library.
this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new LookLibraryControllerEffect(), new GenericManaCost(1)));
// {2}: Reveal the top card of your library. If it's a land card, Cruel Deceiver gains "Whenever Cruel Deceiver deals damage to a creature, destroy that creature" until end of turn. Activate this ability only once each turn.
this.addAbility(new ActivateOncePerTurnActivatedAbility(Zone.BATTLEFIELD, new CruelDeceiverEffect(), new ManaCostsImpl("{2}")));
}
public CruelDeceiver(final CruelDeceiver card) {
super(card);
}
@Override
public CruelDeceiver copy() {
return new CruelDeceiver(this);
}
}
class CruelDeceiverEffect extends OneShotEffect<CruelDeceiverEffect> {
public CruelDeceiverEffect() {
super(Outcome.AddAbility);
this.staticText = "Reveal the top card of your library. If it's a land card, {this} gets +2/+2 and gains trample until end of turn";
}
public CruelDeceiverEffect(final CruelDeceiverEffect effect) {
super(effect);
}
@Override
public CruelDeceiverEffect copy() {
return new CruelDeceiverEffect(this);
}
@Override
public boolean apply(Game game, Ability source) {
Player player = game.getPlayer(source.getControllerId());
if (player != null) {
Cards cards = new CardsImpl();
Card card = player.getLibrary().getFromTop(game);
cards.add(card);
player.revealCards("Cruel Deceiver", cards, game);
if (card != null && card.getCardType().contains(CardType.LAND)) {
game.addEffect(new BoostSourceEffect(2,2,Duration.EndOfTurn), source);
game.addEffect(new GainAbilitySourceEffect(TrampleAbility.getInstance(),Duration.EndOfTurn), source);
}
return true;
}
return false;
}
}

View file

@ -0,0 +1,117 @@
/*
* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* The views and conclusions contained in the software and documentation are those of the
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of BetaSteward_at_googlemail.com.
*/
package mage.sets.championsofkamigawa;
import java.util.UUID;
import mage.Constants.CardType;
import mage.Constants.Outcome;
import mage.Constants.Rarity;
import mage.abilities.Ability;
import mage.abilities.costs.Cost;
import mage.abilities.costs.common.SacrificeTargetCost;
import mage.abilities.effects.OneShotEffect;
import mage.cards.CardImpl;
import mage.filter.common.FilterControlledCreaturePermanent;
import mage.filter.predicate.mageobject.SubtypePredicate;
import mage.game.Game;
import mage.players.Player;
import mage.target.TargetPlayer;
import mage.target.common.TargetControlledCreaturePermanent;
/**
*
* @author LevelX2
*/
public class DevouringGreed extends CardImpl<DevouringGreed> {
private static final FilterControlledCreaturePermanent filter = new FilterControlledCreaturePermanent("any number of Spirits");
static {
filter.add(new SubtypePredicate("Spirit"));
}
public DevouringGreed(UUID ownerId) {
super(ownerId, 110, "Devouring Greed", Rarity.COMMON, new CardType[]{CardType.SORCERY}, "{2}{B}{B}");
this.expansionSetCode = "CHK";
this.subtype.add("Arcane");
this.color.setBlack(true);
// As an additional cost to cast Devouring Greed, you may sacrifice any number of Spirits.
this.getSpellAbility().addCost(new SacrificeTargetCost(new TargetControlledCreaturePermanent(0, Integer.MAX_VALUE, filter, true, false)));
// Target player loses 2 life plus 2 life for each Spirit sacrificed this way. You gain that much life.
this.getSpellAbility().addEffect(new DevouringGreedEffect());
this.getSpellAbility().addTarget(new TargetPlayer(true));
}
public DevouringGreed(final DevouringGreed card) {
super(card);
}
@Override
public DevouringGreed copy() {
return new DevouringGreed(this);
}
}
class DevouringGreedEffect extends OneShotEffect<DevouringGreedEffect> {
public DevouringGreedEffect() {
super(Outcome.LoseLife);
this.staticText = "Target player loses 2 life plus 2 life for each Spirit sacrificed this way. You gain that much life";
}
public DevouringGreedEffect(final DevouringGreedEffect effect) {
super(effect);
}
@Override
public DevouringGreedEffect copy() {
return new DevouringGreedEffect(this);
}
@Override
public boolean apply(Game game, Ability source) {
int numberSpirits = 0;
for (Cost cost :source.getCosts()) {
if (cost instanceof SacrificeTargetCost) {
numberSpirits += ((SacrificeTargetCost) cost).getPermanents().size();
}
}
int amount = 2 + (numberSpirits * 2);
Player targetPlayer = game.getPlayer(getTargetPointer().getFirst(game, source));
Player sourcePlayer = game.getPlayer(source.getControllerId());
if (targetPlayer != null && sourcePlayer != null) {
targetPlayer.loseLife(amount, game);
sourcePlayer.gainLife(amount, game);
return true;
}
return false;
}
}

View file

@ -0,0 +1,121 @@
/*
* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* The views and conclusions contained in the software and documentation are those of the
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of BetaSteward_at_googlemail.com.
*/
package mage.sets.championsofkamigawa;
import java.util.UUID;
import mage.Constants;
import mage.Constants.CardType;
import mage.Constants.Outcome;
import mage.Constants.Rarity;
import mage.abilities.Ability;
import mage.abilities.costs.Cost;
import mage.abilities.costs.common.SacrificeTargetCost;
import mage.abilities.effects.ContinuousEffect;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.continious.BoostTargetEffect;
import mage.cards.CardImpl;
import mage.filter.common.FilterControlledCreaturePermanent;
import mage.filter.predicate.mageobject.SubtypePredicate;
import mage.game.Game;
import mage.game.permanent.Permanent;
import mage.target.common.TargetControlledCreaturePermanent;
import mage.target.common.TargetCreaturePermanent;
import mage.target.targetpointer.FixedTarget;
/**
*
* @author LevelX2
*/
public class DevouringRage extends CardImpl<DevouringRage> {
private static final FilterControlledCreaturePermanent filter = new FilterControlledCreaturePermanent("any number of Spirits");
static {
filter.add(new SubtypePredicate("Spirit"));
}
public DevouringRage(UUID ownerId) {
super(ownerId, 164, "Devouring Rage", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{4}{R}");
this.expansionSetCode = "CHK";
this.subtype.add("Arcane");
this.color.setRed(true);
// As an additional cost to cast Devouring Rage, you may sacrifice any number of Spirits.
this.getSpellAbility().addCost(new SacrificeTargetCost(new TargetControlledCreaturePermanent(0, Integer.MAX_VALUE, filter, true, false)));
// Target creature gets +3/+0 until end of turn. For each Spirit sacrificed this way, that creature gets an additional +3/+0 until end of turn
this.getSpellAbility().addEffect(new DevouringRageEffect());
this.getSpellAbility().addTarget(new TargetCreaturePermanent(true));
}
public DevouringRage(final DevouringRage card) {
super(card);
}
@Override
public DevouringRage copy() {
return new DevouringRage(this);
}
}
class DevouringRageEffect extends OneShotEffect<DevouringRageEffect> {
public DevouringRageEffect() {
super(Outcome.LoseLife);
this.staticText = "Target creature gets +3/+0 until end of turn. For each Spirit sacrificed this way, that creature gets an additional +3/+0 until end of turn";
}
public DevouringRageEffect(final DevouringRageEffect effect) {
super(effect);
}
@Override
public DevouringRageEffect copy() {
return new DevouringRageEffect(this);
}
@Override
public boolean apply(Game game, Ability source) {
int numberSpirits = 0;
for (Cost cost :source.getCosts()) {
if (cost instanceof SacrificeTargetCost) {
numberSpirits = ((SacrificeTargetCost) cost).getPermanents().size();
}
}
int amount = 3 + (numberSpirits * 3);
Permanent targetCreature = game.getPermanent(getTargetPointer().getFirst(game, source));
if (targetCreature != null) {
ContinuousEffect effect = new BoostTargetEffect(amount, 0, Constants.Duration.EndOfTurn);
effect.setTargetPointer(new FixedTarget(targetCreature.getId()));
game.addEffect(effect, source);
return true;
}
return false;
}
}

View file

@ -28,7 +28,6 @@
package mage.sets.championsofkamigawa;
import java.util.UUID;
import mage.Constants.CardType;
import mage.Constants.Duration;
import mage.Constants.Rarity;
@ -36,9 +35,9 @@ import mage.Constants.Zone;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.ActivateOncePerTurnActivatedAbility;
import mage.abilities.costs.mana.GenericManaCost;
import mage.abilities.common.SimpleActivatedAbility;
import mage.abilities.costs.Cost;
import mage.abilities.costs.mana.GenericManaCost;
import mage.abilities.costs.mana.ManaCostsImpl;
import mage.abilities.effects.Effect;
import mage.abilities.effects.common.LookLibraryControllerEffect;
@ -54,7 +53,7 @@ import mage.players.Player;
/**
*
* @author LevelX
* @author LevelX2
*/
public class FeralDeceiver extends CardImpl<FeralDeceiver> {
@ -88,35 +87,35 @@ public class FeralDeceiver extends CardImpl<FeralDeceiver> {
class FeralDeceiverAbility extends ActivateOncePerTurnActivatedAbility {
public FeralDeceiverAbility(Zone zone, Effect effect, Cost cost) {
public FeralDeceiverAbility(Zone zone, Effect effect, Cost cost) {
super(zone, effect, cost);
}
public FeralDeceiverAbility(FeralDeceiverAbility ability) {
public FeralDeceiverAbility(FeralDeceiverAbility ability) {
super(ability);
}
@Override
public FeralDeceiverAbility copy() {
return new FeralDeceiverAbility(this);
}
@Override
public FeralDeceiverAbility copy() {
return new FeralDeceiverAbility(this);
}
@Override
@Override
public boolean checkIfClause(Game game) {
Player player = game.getPlayer(this.getControllerId());
if (player != null) {
Cards cards = new CardsImpl();
Card card = player.getLibrary().getFromTop(game);
cards.add(card);
player.revealCards("Feral Deceiver", cards, game);
if (card != null && card.getCardType().contains(CardType.LAND)) {
return true;
}
}
return false;
Player player = game.getPlayer(this.getControllerId());
if (player != null) {
Cards cards = new CardsImpl();
Card card = player.getLibrary().getFromTop(game);
cards.add(card);
player.revealCards("Feral Deceiver", cards, game);
if (card != null && card.getCardType().contains(CardType.LAND)) {
return true;
}
}
return false;
}
@Override
@Override
public String getRule() {
return "{2}: Reveal the top card of your library. If it's a land card, {this} gets +2/+2 and gains trample until end of turn. Activate this ability only once each turn.";
}

View file

@ -0,0 +1,87 @@
/*
* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* The views and conclusions contained in the software and documentation are those of the
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of BetaSteward_at_googlemail.com.
*/
package mage.sets.championsofkamigawa;
import java.util.UUID;
import mage.Constants;
import mage.Constants.CardType;
import mage.Constants.Rarity;
import mage.MageInt;
import mage.abilities.common.BeginningOfUpkeepTriggeredAbility;
import mage.abilities.condition.common.ControlsPermanentCondition;
import mage.abilities.decorator.ConditionalOneShotEffect;
import mage.abilities.effects.common.DiscardControllerEffect;
import mage.abilities.keyword.TrampleAbility;
import mage.cards.CardImpl;
import mage.filter.FilterPermanent;
import mage.filter.common.FilterControlledCreaturePermanent;
import mage.filter.predicate.mageobject.SubtypePredicate;
/**
*
* @author LevelX2
*/
public class GutwrencherOni extends CardImpl<GutwrencherOni> {
private static final FilterPermanent filter = new FilterControlledCreaturePermanent("Ogre");
static {
filter.add(new SubtypePredicate("Ogre"));
}
public GutwrencherOni(UUID ownerId) {
super(ownerId, 113, "Gutwrencher Oni", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{3}{B}{B}");
this.expansionSetCode = "CHK";
this.subtype.add("Demon");
this.subtype.add("Spirit");
this.color.setBlack(true);
this.power = new MageInt(5);
this.toughness = new MageInt(4);
// Trample
this.addAbility(TrampleAbility.getInstance());
// At the beginning of your upkeep, discard a card if you don't control an Ogre.
this.addAbility(new BeginningOfUpkeepTriggeredAbility(new ConditionalOneShotEffect(
new DiscardControllerEffect(1),
new ControlsPermanentCondition(filter, ControlsPermanentCondition.CountType.EQUAL_TO, 0),
"discard a card if you don't control an Ogre"), Constants.TargetController.YOU, false));
}
public GutwrencherOni(final GutwrencherOni card) {
super(card);
}
@Override
public GutwrencherOni copy() {
return new GutwrencherOni(this);
}
}

View file

@ -0,0 +1,157 @@
/*
* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* The views and conclusions contained in the software and documentation are those of the
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of BetaSteward_at_googlemail.com.
*/
package mage.sets.championsofkamigawa;
import java.util.UUID;
import mage.Constants;
import mage.Constants.CardType;
import mage.Constants.Outcome;
import mage.Constants.Rarity;
import mage.Constants.Zone;
import mage.abilities.Ability;
import mage.abilities.TriggeredAbilityImpl;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.AttachEffect;
import mage.abilities.keyword.EnchantAbility;
import mage.abilities.keyword.FlashAbility;
import mage.cards.CardImpl;
import mage.game.Game;
import mage.game.events.GameEvent;
import mage.game.permanent.Permanent;
import mage.players.Player;
import mage.target.TargetPermanent;
import mage.target.common.TargetCreaturePermanent;
import mage.target.targetpointer.FixedTarget;
/**
*
* @author Loki
*/
public class RaggedVeins extends CardImpl<RaggedVeins> {
public RaggedVeins(UUID ownerId) {
super(ownerId, 139, "Ragged Veins", Rarity.COMMON, new CardType[]{CardType.ENCHANTMENT}, "{1}{B}");
this.expansionSetCode = "CHK";
this.subtype.add("Aura");
this.color.setBlack(true);
// Flash
this.addAbility(FlashAbility.getInstance());
// Enchant creature
TargetPermanent auraTarget = new TargetCreaturePermanent();
this.getSpellAbility().addTarget(auraTarget);
this.getSpellAbility().addEffect(new AttachEffect(Constants.Outcome.AddAbility));
this.addAbility(new EnchantAbility(auraTarget.getTargetName()));
// Whenever enchanted creature is dealt damage, its controller loses that much life.
this.addAbility(new RaggedVeinsTriggeredAbility());
}
public RaggedVeins(final RaggedVeins card) {
super(card);
}
@Override
public RaggedVeins copy() {
return new RaggedVeins(this);
}
}
class RaggedVeinsTriggeredAbility extends TriggeredAbilityImpl<RaggedVeinsTriggeredAbility> {
public RaggedVeinsTriggeredAbility() {
super(Zone.BATTLEFIELD, new SpitefulShadowsEffect());
}
public RaggedVeinsTriggeredAbility(final RaggedVeinsTriggeredAbility ability) {
super(ability);
}
@Override
public RaggedVeinsTriggeredAbility copy() {
return new RaggedVeinsTriggeredAbility(this);
}
@Override
public boolean checkTrigger(GameEvent event, Game game) {
if (event.getType() == GameEvent.EventType.DAMAGED_CREATURE) {
Permanent enchantment = game.getPermanent(sourceId);
UUID targetId = event.getTargetId();
if (enchantment != null && enchantment.getAttachedTo() != null && targetId.equals(enchantment.getAttachedTo())) {
this.getEffects().get(0).setValue("damageAmount", event.getAmount());
this.getEffects().get(0).setTargetPointer(new FixedTarget(targetId));
return true;
}
}
return false;
}
@Override
public String getRule() {
return "Whenever enchanted creature is dealt damage, its controller loses that much life.";
}
}
class SpitefulShadowsEffect extends OneShotEffect<SpitefulShadowsEffect> {
public SpitefulShadowsEffect() {
super(Outcome.Damage);
this.staticText = "its controller loses that much life";
}
public SpitefulShadowsEffect(final SpitefulShadowsEffect effect) {
super(effect);
}
@Override
public SpitefulShadowsEffect copy() {
return new SpitefulShadowsEffect(this);
}
@Override
public boolean apply(Game game, Ability source) {
Integer damageAmount = (Integer) this.getValue("damageAmount");
UUID targetId = this.targetPointer.getFirst(game, source);
if (damageAmount != null && targetId != null) {
Permanent permanent = game.getPermanent(targetId);
if (permanent == null) {
permanent = (Permanent) game.getLastKnownInformation(targetId, Zone.BATTLEFIELD);
}
if (permanent != null) {
Player player = game.getPlayer(permanent.getControllerId());
if (player != null) {
player.loseLife(damageAmount, game);
return true;
}
}
}
return false;
}
}