This commit is contained in:
BetaSteward 2012-03-11 23:20:56 -04:00
parent c709d862ae
commit de4153c5aa
9 changed files with 694 additions and 19 deletions

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.darkascension;
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.common.BeginningOfYourEndStepTriggeredAbility;
import mage.abilities.effects.OneShotEffect;
import mage.cards.CardImpl;
import mage.filter.Filter;
import mage.filter.common.FilterNonTokenPermanent;
import mage.game.Game;
import mage.game.permanent.Permanent;
import mage.game.permanent.token.WolfToken;
import mage.players.Player;
import mage.target.Target;
import mage.target.TargetPermanent;
import mage.target.common.TargetControlledPermanent;
/**
*
* @author BetaSteward
*/
public class FeedThePack extends CardImpl<FeedThePack> {
public FeedThePack(UUID ownerId) {
super(ownerId, 114, "Feed the Pack", Rarity.RARE, new CardType[]{CardType.ENCHANTMENT}, "{5}{G}");
this.expansionSetCode = "DKA";
this.color.setGreen(true);
// At the beginning of your end step, you may sacrifice a nontoken creature. If you do, put X 2/2 green Wolf creature tokens onto the battlefield, where X is the sacrificed creature's toughness.
this.addAbility(new BeginningOfYourEndStepTriggeredAbility(new FeedThePackEffect(), true));
}
public FeedThePack(final FeedThePack card) {
super(card);
}
@Override
public FeedThePack copy() {
return new FeedThePack(this);
}
}
class FeedThePackEffect extends OneShotEffect<FeedThePackEffect> {
private static final FilterNonTokenPermanent filter = new FilterNonTokenPermanent("nontoken creature");
static {
filter.getCardType().add(CardType.CREATURE);
filter.setScopeCardType(Filter.ComparisonScope.Any);
filter.setTargetController(Constants.TargetController.YOU);
}
public FeedThePackEffect() {
super(Constants.Outcome.Sacrifice);
this.staticText = "sacrifice a nontoken creature. If you do, put X 2/2 green Wolf creature tokens onto the battlefield, where X is the sacrificed creature's toughness";
}
public FeedThePackEffect(final FeedThePackEffect effect) {
super(effect);
}
@Override
public FeedThePackEffect copy() {
return new FeedThePackEffect(this);
}
@Override
public boolean apply(Game game, Ability source) {
Target target = new TargetPermanent(filter);
Player player = game.getPlayer(source.getControllerId());
if (player.choose(Outcome.PutCreatureInPlay, target, source.getSourceId(), game)) {
Permanent permanent = game.getPermanent(target.getFirstTarget());
if (permanent != null && permanent.sacrifice(source.getSourceId(), game)) {
int toughness = permanent.getToughness().getValue();
WolfToken token = new WolfToken();
token.putOntoBattlefield(toughness, game, source.getSourceId(), source.getControllerId());
return true;
}
}
return false;
}
}

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.darkascension;
import java.util.UUID;
import mage.Constants;
import mage.Constants.CardType;
import mage.Constants.Rarity;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.TriggeredAbilityImpl;
import mage.abilities.effects.Effect;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.keyword.UndyingAbility;
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.players.Player;
import mage.target.common.TargetCreatureOrPlayer;
/**
*
* @author BetaSteward
*/
public class FlayerOfTheHatebound extends CardImpl<FlayerOfTheHatebound> {
public FlayerOfTheHatebound(UUID ownerId) {
super(ownerId, 89, "Flayer of the Hatebound", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{5}{R}");
this.expansionSetCode = "DKA";
this.subtype.add("Devil");
this.color.setRed(true);
this.power = new MageInt(4);
this.toughness = new MageInt(2);
this.addAbility(new UndyingAbility());
// Whenever Flayer of the Hatebound or another creature enters the battlefield from your graveyard, that creature deals damage equal to its power to target creature or player.
Ability ability = new FlayerTriggeredAbility();
ability.addTarget(new TargetCreatureOrPlayer());
this.addAbility(ability);
}
public FlayerOfTheHatebound(final FlayerOfTheHatebound card) {
super(card);
}
@Override
public FlayerOfTheHatebound copy() {
return new FlayerOfTheHatebound(this);
}
}
class FlayerTriggeredAbility extends TriggeredAbilityImpl<FlayerTriggeredAbility> {
public FlayerTriggeredAbility() {
super(Constants.Zone.BATTLEFIELD, new FlayerEffect(), false);
}
public FlayerTriggeredAbility(FlayerTriggeredAbility ability) {
super(ability);
}
@Override
public boolean checkTrigger(GameEvent event, Game game) {
if (event.getType() == GameEvent.EventType.ZONE_CHANGE) {
Permanent permanent = game.getPermanent(event.getTargetId());
if (((ZoneChangeEvent) event).getToZone() == Constants.Zone.BATTLEFIELD
&& ((ZoneChangeEvent) event).getFromZone() == Constants.Zone.GRAVEYARD
&& permanent.getOwnerId().equals(controllerId)
&& permanent.getCardType().contains(CardType.CREATURE)) {
Effect effect = this.getEffects().get(0);
effect.setValue("damageSource", event.getTargetId());
return true;
}
}
return false;
}
@Override
public String getRule() {
return "Whenever Flayer of the Hatebound or another creature enters the battlefield from your graveyard, that creature deals damage equal to its power to target creature or player.";
}
@Override
public FlayerTriggeredAbility copy() {
return new FlayerTriggeredAbility(this);
}
}
class FlayerEffect extends OneShotEffect<FlayerEffect> {
public FlayerEffect() {
super(Constants.Outcome.Damage);
staticText = "that creature deals damage equal to its power to target creature or player";
}
public FlayerEffect(final FlayerEffect effect) {
super(effect);
}
@Override
public FlayerEffect copy() {
return new FlayerEffect(this);
}
@Override
public boolean apply(Game game, Ability source) {
UUID creatureId = (UUID) getValue("damageSource");
Permanent creature = game.getPermanent(creatureId);
if (creature == null) {
creature = (Permanent) game.getLastKnownInformation(creatureId, Constants.Zone.BATTLEFIELD);
}
if (creature != null) {
int amount = creature.getPower().getValue();
UUID target = source.getTargets().getFirstTarget();
Permanent targetCreature = game.getPermanent(target);
if (targetCreature != null) {
targetCreature.damage(amount, creature.getId(), game, true, false);
return true;
}
Player player = game.getPlayer(target);
if (player != null) {
player.damage(amount, creature.getId(), game, false, true);
return true;
}
}
return false;
}
}

View file

@ -0,0 +1,148 @@
/*
* 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.darkascension;
import java.util.UUID;
import mage.Constants;
import mage.Constants.CardType;
import mage.Constants.Rarity;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.DiesTriggeredAbility;
import mage.abilities.common.delayed.AtEndOfTurnDelayedTriggeredAbility;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.ReturnFromExileEffect;
import mage.abilities.keyword.TransformAbility;
import mage.abilities.keyword.VigilanceAbility;
import mage.cards.Card;
import mage.cards.CardImpl;
import mage.game.ExileZone;
import mage.game.Game;
import mage.game.permanent.Permanent;
/**
*
* @author BetaSteward
*/
public class LoyalCathar extends CardImpl<LoyalCathar> {
public LoyalCathar(UUID ownerId) {
super(ownerId, 13, "Loyal Cathar", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{W}{W}");
this.expansionSetCode = "DKA";
this.subtype.add("Human");
this.subtype.add("Soldier");
this.canTransform = true;
this.secondSideCard = new UnhallowedCathar(ownerId);
this.color.setWhite(true);
this.power = new MageInt(2);
this.toughness = new MageInt(2);
this.addAbility(VigilanceAbility.getInstance());
// When Loyal Cathar dies, return it to the battlefield transformed under your control at the beginning of the next end step.
this.addAbility(new TransformAbility());
this.addAbility(new DiesTriggeredAbility(new LoyalCatharEffect()));
}
public LoyalCathar(final LoyalCathar card) {
super(card);
}
@Override
public LoyalCathar copy() {
return new LoyalCathar(this);
}
}
class LoyalCatharEffect extends OneShotEffect<LoyalCatharEffect> {
private static final String effectText = "return it to the battlefield transformed under your control at the beginning of the next end step";
LoyalCatharEffect ( ) {
super(Constants.Outcome.Benefit);
staticText = effectText;
}
LoyalCatharEffect(LoyalCatharEffect effect) {
super(effect);
}
@Override
public boolean apply(Game game, Ability source) {
//create delayed triggered ability
AtEndOfTurnDelayedTriggeredAbility delayedAbility = new AtEndOfTurnDelayedTriggeredAbility(new ReturnLoyalCatharEffect(source.getSourceId()));
delayedAbility.setSourceId(source.getSourceId());
delayedAbility.setControllerId(source.getControllerId());
game.addDelayedTriggeredAbility(delayedAbility);
return true;
}
@Override
public LoyalCatharEffect copy() {
return new LoyalCatharEffect(this);
}
}
class ReturnLoyalCatharEffect extends OneShotEffect<ReturnLoyalCatharEffect> {
private UUID cardId;
public ReturnLoyalCatharEffect(UUID cardId) {
super(Constants.Outcome.PutCardInPlay);
this.cardId = cardId;
this.staticText = "return it to the battlefield transformed under your control";
}
public ReturnLoyalCatharEffect(final ReturnLoyalCatharEffect effect) {
super(effect);
this.cardId = effect.cardId;
}
@Override
public ReturnLoyalCatharEffect copy() {
return new ReturnLoyalCatharEffect(this);
}
@Override
public boolean apply(Game game, Ability source) {
Card card = game.getCard(cardId);
if (card != null) {
card.putOntoBattlefield(game, Constants.Zone.GRAVEYARD, source.getSourceId(), source.getControllerId());
Permanent perm = game.getPermanent(cardId);
if (perm != null && perm.canTransform()) {
perm.transform(game);
return true;
}
}
return false;
}
}

View file

@ -0,0 +1,68 @@
/*
* 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.darkascension;
import java.util.UUID;
import mage.Constants.CardType;
import mage.Constants.Rarity;
import mage.MageInt;
import mage.abilities.common.CantBlockAbility;
import mage.cards.CardImpl;
/**
*
* @author BetaSteward
*/
public class UnhallowedCathar extends CardImpl<UnhallowedCathar> {
public UnhallowedCathar(UUID ownerId) {
super(ownerId, 13, "Unhallowed Cathar", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "");
this.expansionSetCode = "DKA";
this.subtype.add("Zombie");
this.subtype.add("Soldier");
// this card is the second face of double-faced card
this.nightCard = true;
this.canTransform = true;
this.power = new MageInt(2);
this.toughness = new MageInt(1);
// Unhallowed Cathar can't block.
this.addAbility(CantBlockAbility.getInstance());
}
public UnhallowedCathar(final UnhallowedCathar card) {
super(card);
}
@Override
public UnhallowedCathar copy() {
return new UnhallowedCathar(this);
}
}

View file

@ -43,11 +43,11 @@ import mage.abilities.effects.ContinuousEffectImpl;
import mage.abilities.effects.OneShotEffect;
import mage.cards.Card;
import mage.cards.CardImpl;
import mage.filter.common.FilterCreaturePermanent;
import mage.filter.Filter;
import mage.filter.common.FilterNonTokenPermanent;
import mage.game.Game;
import mage.game.permanent.Permanent;
import mage.game.permanent.PermanentToken;
import mage.target.common.TargetCreaturePermanent;
import mage.target.TargetPermanent;
/**
*
@ -55,6 +55,13 @@ import mage.target.common.TargetCreaturePermanent;
*/
public class PhyrexianIngester extends CardImpl<PhyrexianIngester> {
private static final FilterNonTokenPermanent filter = new FilterNonTokenPermanent("nontoken creature");
static {
filter.getCardType().add(CardType.CREATURE);
filter.setScopeCardType(Filter.ComparisonScope.Any);
}
public PhyrexianIngester(UUID ownerId) {
super(ownerId, 41, "Phyrexian Ingester", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{6}{U}");
this.expansionSetCode = "NPH";
@ -66,22 +73,7 @@ public class PhyrexianIngester extends CardImpl<PhyrexianIngester> {
// Imprint - When Phyrexian Ingester enters the battlefield, you may exile target nontoken creature.
Ability ability = new EntersBattlefieldTriggeredAbility(new PhyrexianIngesterImprintEffect(), true);
FilterCreaturePermanent filter = new FilterCreaturePermanent("nontoken creature") {
@Override
public boolean match(Permanent permanent) {
if (!super.match(permanent)) {
return notFilter;
}
if (permanent instanceof PermanentToken) {
return notFilter;
}
return !notFilter;
}
};
ability.addTarget(new TargetCreaturePermanent(filter));
ability.addTarget(new TargetPermanent(filter));
this.addAbility(ability);
// Phyrexian Ingester gets +X/+Y, where X is the exiled creature card's power and Y is its toughness.
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new PhyrexianIngesterBoostEffect()));