mirror of
https://github.com/correl/mage.git
synced 2025-01-12 19:25:44 +00:00
- Added Graven Abomination. [HOU]
This commit is contained in:
parent
74dc8994f3
commit
05c4c558d0
2 changed files with 94 additions and 0 deletions
93
Mage.Sets/src/mage/cards/g/GravenAbomination.java
Normal file
93
Mage.Sets/src/mage/cards/g/GravenAbomination.java
Normal file
|
@ -0,0 +1,93 @@
|
|||
/*
|
||||
* 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.g;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.MageInt;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.AttacksTriggeredAbility;
|
||||
import mage.abilities.effects.common.ExileTargetEffect;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
import mage.filter.FilterCard;
|
||||
import mage.filter.predicate.other.OwnerIdPredicate;
|
||||
import mage.game.Game;
|
||||
import mage.players.Player;
|
||||
import mage.target.common.TargetCardInGraveyard;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author jeffwadsworth
|
||||
*/
|
||||
public class GravenAbomination extends CardImpl {
|
||||
|
||||
private final UUID originalId;
|
||||
|
||||
private final static String rule = "Whenever {this} attacks, exile target card from defending player's graveyard.";
|
||||
|
||||
public GravenAbomination(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId, setInfo, new CardType[]{CardType.ARTIFACT, CardType.CREATURE}, "{3}");
|
||||
|
||||
this.subtype.add("Horror");
|
||||
this.power = new MageInt(3);
|
||||
this.toughness = new MageInt(1);
|
||||
|
||||
// Whenever Graven Abomination attacks, exile target card from defending player's graveyard.
|
||||
Ability ability = new AttacksTriggeredAbility(new ExileTargetEffect(), false, rule);
|
||||
ability.addTarget(new TargetCardInGraveyard());
|
||||
this.addAbility(ability);
|
||||
originalId = ability.getOriginalId();
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void adjustTargets(Ability ability, Game game) {
|
||||
UUID gravenAbominationId = ability.getSourceId();
|
||||
FilterCard filter = new FilterCard("target card from defending player's graveyard");
|
||||
if (ability.getOriginalId().equals(originalId)) {
|
||||
UUID defendingPlayerId = game.getCombat().getDefendingPlayerId(gravenAbominationId, game);
|
||||
Player defendingPlayer = game.getPlayer(defendingPlayerId);
|
||||
if (defendingPlayer != null) {
|
||||
filter.add(new OwnerIdPredicate(defendingPlayerId));
|
||||
ability.getTargets().clear();
|
||||
ability.getTargets().add(new TargetCardInGraveyard(filter));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public GravenAbomination(final GravenAbomination card) {
|
||||
super(card);
|
||||
this.originalId = card.originalId;
|
||||
}
|
||||
|
||||
@Override
|
||||
public GravenAbomination copy() {
|
||||
return new GravenAbomination(this);
|
||||
}
|
||||
}
|
|
@ -129,6 +129,7 @@ public class HourOfDevastation extends ExpansionSet {
|
|||
cards.add(new SetCardInfo("Gilded Cerodon", 94, Rarity.COMMON, mage.cards.g.GildedCerodon.class));
|
||||
cards.add(new SetCardInfo("God-Pharaoh's Faithful", 14, Rarity.COMMON, mage.cards.g.GodPharaohsFaithful.class));
|
||||
cards.add(new SetCardInfo("Granitic Titan", 95, Rarity.COMMON, mage.cards.g.GraniticTitan.class));
|
||||
cards.add(new SetCardInfo("Graven Abomination", 162, Rarity.COMMON, mage.cards.g.GravenAbomination.class));
|
||||
cards.add(new SetCardInfo("Grind // Dust", 155, Rarity.RARE, mage.cards.g.GrindDust.class));
|
||||
cards.add(new SetCardInfo("Harrier Naga", 118, Rarity.COMMON, mage.cards.h.HarrierNaga.class));
|
||||
cards.add(new SetCardInfo("Hollow One", 163, Rarity.RARE, mage.cards.h.HollowOne.class));
|
||||
|
|
Loading…
Reference in a new issue