This commit is contained in:
BetaSteward 2012-02-19 23:13:08 -05:00
parent 828662f6f3
commit 1951fd314b
6 changed files with 431 additions and 1 deletions

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.darkascension;
import java.util.UUID;
import mage.Constants;
import mage.Constants.CardType;
import mage.Constants.Rarity;
import mage.abilities.Ability;
import mage.abilities.common.DealsCombatDamageToAPlayerAttachedTriggeredAbility;
import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.costs.mana.GenericManaCost;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.DrawCardControllerEffect;
import mage.abilities.effects.common.continious.BoostEquippedEffect;
import mage.abilities.keyword.EquipAbility;
import mage.abilities.keyword.TransformAbility;
import mage.cards.CardImpl;
import mage.game.Game;
import mage.game.permanent.Permanent;
/**
*
* @author BetaSteward
*/
public class ElbrusTheBindingBlade extends CardImpl<ElbrusTheBindingBlade> {
public ElbrusTheBindingBlade(UUID ownerId) {
super(ownerId, 147, "Elbrus, the Binding Blade", Rarity.MYTHIC, new CardType[]{CardType.ARTIFACT}, "{7}");
this.expansionSetCode = "DKA";
this.supertype.add("Legendary");
this.subtype.add("Equipment");
this.canTransform = true;
this.secondSideCard = new WithengarUnbound(ownerId);
this.addAbility(new TransformAbility());
// Equipped creature gets +1/+0.
this.addAbility(new SimpleStaticAbility(Constants.Zone.BATTLEFIELD, new BoostEquippedEffect(1, 0)));
// When equipped creature deals combat damage to a player, unattach Elbrus, the Binding Blade, then transform it.
this.addAbility(new DealsCombatDamageToAPlayerAttachedTriggeredAbility(new ElbrusTheBindingBladeEffect(), "equipped", true));
// Equip {1}
this.addAbility(new EquipAbility(Constants.Outcome.AddAbility, new GenericManaCost(1)));
}
public ElbrusTheBindingBlade(final ElbrusTheBindingBlade card) {
super(card);
}
@Override
public ElbrusTheBindingBlade copy() {
return new ElbrusTheBindingBlade(this);
}
}
class ElbrusTheBindingBladeEffect extends OneShotEffect<ElbrusTheBindingBladeEffect> {
public ElbrusTheBindingBladeEffect() {
super(Constants.Outcome.BecomeCreature);
staticText = "unattach {this}, then transform it";
}
public ElbrusTheBindingBladeEffect(final ElbrusTheBindingBladeEffect effect) {
super(effect);
}
@Override
public boolean apply(Game game, Ability source) {
Permanent equipment = game.getPermanent(source.getSourceId());
if (equipment != null && equipment.getAttachedTo() != null) {
Permanent attachedTo = game.getPermanent(equipment.getAttachedTo());
if (attachedTo != null) {
attachedTo.removeAttachment(equipment.getId(), game);
equipment.transform(game);
}
}
return false;
}
@Override
public ElbrusTheBindingBladeEffect copy() {
return new ElbrusTheBindingBladeEffect(this);
}
}

View file

@ -0,0 +1,110 @@
/*
* 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.TriggeredAbilityImpl;
import mage.abilities.effects.common.TapTargetEffect;
import mage.abilities.effects.common.counter.AddCountersSourceEffect;
import mage.abilities.keyword.FlyingAbility;
import mage.abilities.keyword.IntimidateAbility;
import mage.abilities.keyword.TrampleAbility;
import mage.cards.CardImpl;
import mage.counters.CounterType;
import mage.game.Game;
import mage.game.events.GameEvent;
import mage.target.common.TargetCreaturePermanent;
/**
*
* @author BetaSteward
*/
public class WithengarUnbound extends CardImpl<WithengarUnbound> {
public WithengarUnbound(UUID ownerId) {
super(ownerId, 147, "Withengar Unbound", Rarity.MYTHIC, new CardType[]{CardType.CREATURE}, "");
this.expansionSetCode = "DKA";
this.supertype.add("Legendary");
this.subtype.add("Demon");
// this card is the second face of double-faced card
this.nightCard = true;
this.canTransform = true;
this.power = new MageInt(13);
this.toughness = new MageInt(13);
this.addAbility(FlyingAbility.getInstance());
this.addAbility(IntimidateAbility.getInstance());
this.addAbility(TrampleAbility.getInstance());
// Whenever a player loses the game, put thirteen +1/+1 counters on Withengar Unbound.
this.addAbility(new WithengarUnboundTriggeredAbility());
}
public WithengarUnbound(final WithengarUnbound card) {
super(card);
}
@Override
public WithengarUnbound copy() {
return new WithengarUnbound(this);
}
}
class WithengarUnboundTriggeredAbility extends TriggeredAbilityImpl<WithengarUnboundTriggeredAbility> {
public WithengarUnboundTriggeredAbility() {
super(Constants.Zone.BATTLEFIELD, new AddCountersSourceEffect(CounterType.P1P1.createInstance(13)), false);
}
public WithengarUnboundTriggeredAbility(final WithengarUnboundTriggeredAbility ability) {
super(ability);
}
@Override
public WithengarUnboundTriggeredAbility copy() {
return new WithengarUnboundTriggeredAbility(this);
}
@Override
public boolean checkTrigger(GameEvent event, Game game) {
if (event.getType() == GameEvent.EventType.LOST)
return true;
return false;
}
@Override
public String getRule() {
return "Whenever a player loses the game, put thirteen +1/+1 counters on Withengar Unbound.";
}
}

View file

@ -0,0 +1,120 @@
/*
* 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.ArrayList;
import java.util.List;
import java.util.UUID;
import mage.Constants;
import mage.Constants.CardType;
import mage.Constants.Rarity;
import mage.abilities.Ability;
import mage.abilities.effects.OneShotEffect;
import mage.cards.Card;
import mage.cards.CardImpl;
import mage.filter.Filter;
import mage.filter.FilterCard;
import mage.filter.common.FilterCreatureCard;
import mage.filter.common.FilterCreaturePermanent;
import mage.game.Game;
import mage.game.permanent.Permanent;
import mage.players.Player;
import mage.target.common.TargetCardInLibrary;
import mage.target.common.TargetControlledPermanent;
/**
*
* @author BetaSteward
*/
public class ZombieApocalypse extends CardImpl<ZombieApocalypse> {
public ZombieApocalypse(UUID ownerId) {
super(ownerId, 80, "Zombie Apocalypse", Rarity.RARE, new CardType[]{CardType.SORCERY}, "{3}{B}{B}{B}");
this.expansionSetCode = "DKA";
this.color.setBlack(true);
// Return all Zombie creature cards from your graveyard to the battlefield tapped, then destroy all Humans.
this.getSpellAbility().addEffect(new ZombieApocalypseEffect());
}
public ZombieApocalypse(final ZombieApocalypse card) {
super(card);
}
@Override
public ZombieApocalypse copy() {
return new ZombieApocalypse(this);
}
}
class ZombieApocalypseEffect extends OneShotEffect<ZombieApocalypseEffect> {
private static final FilterCreatureCard filterZombie = new FilterCreatureCard();
private static final FilterCreaturePermanent filterHuman = new FilterCreaturePermanent();
static {
filterZombie.getSubtype().add("Zombie");
filterZombie.setScopeSubtype(Filter.ComparisonScope.Any);
filterHuman.getSubtype().add("Human");
filterHuman.setScopeSubtype(Filter.ComparisonScope.Any);
}
public ZombieApocalypseEffect() {
super(Constants.Outcome.PutCreatureInPlay);
this.staticText = "Return all Zombie creature cards from your graveyard to the battlefield tapped, then destroy all Humans.";
}
public ZombieApocalypseEffect(final ZombieApocalypseEffect effect) {
super(effect);
}
@Override
public ZombieApocalypseEffect copy() {
return new ZombieApocalypseEffect(this);
}
@Override
public boolean apply(Game game, Ability source) {
Player player = game.getPlayer(source.getControllerId());
for (Card card : player.getGraveyard().getCards(filterZombie, game)) {
player.getGraveyard().remove(card);
card.putOntoBattlefield(game, Constants.Zone.GRAVEYARD, source.getId(), source.getControllerId());
Permanent permanent = game.getPermanent(card.getId());
if (permanent != null) {
permanent.setTapped(true);
}
}
for (Permanent permanent: game.getBattlefield().getActivePermanents(filterHuman, source.getControllerId(), game)) {
permanent.destroy(source.getSourceId(), game, false);
}
return true;
}
}