From faf9f6d826dd7b1b67d6502c44a151ea4dd02bf6 Mon Sep 17 00:00:00 2001 From: North Date: Tue, 28 Feb 2012 21:49:55 +0200 Subject: [PATCH] [DKA] 5 cards --- .../mage/sets/darkascension/ArtfulDodge.java | 69 +++++++++++ .../sets/darkascension/AvacynsCollar.java | 111 ++++++++++++++++++ .../sets/darkascension/ChillOfForeboding.java | 106 +++++++++++++++++ .../mage/sets/darkascension/DeathsCaress.java | 99 ++++++++++++++++ .../sets/darkascension/WolfhuntersQuiver.java | 111 ++++++++++++++++++ 5 files changed, 496 insertions(+) create mode 100644 Mage.Sets/src/mage/sets/darkascension/ArtfulDodge.java create mode 100644 Mage.Sets/src/mage/sets/darkascension/AvacynsCollar.java create mode 100644 Mage.Sets/src/mage/sets/darkascension/ChillOfForeboding.java create mode 100644 Mage.Sets/src/mage/sets/darkascension/DeathsCaress.java create mode 100644 Mage.Sets/src/mage/sets/darkascension/WolfhuntersQuiver.java diff --git a/Mage.Sets/src/mage/sets/darkascension/ArtfulDodge.java b/Mage.Sets/src/mage/sets/darkascension/ArtfulDodge.java new file mode 100644 index 00000000000..c3aaab69e31 --- /dev/null +++ b/Mage.Sets/src/mage/sets/darkascension/ArtfulDodge.java @@ -0,0 +1,69 @@ +/* + * 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.Duration; +import mage.Constants.Rarity; +import mage.Constants.TimingRule; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.continious.GainAbilityTargetEffect; +import mage.abilities.keyword.FlashbackAbility; +import mage.abilities.keyword.UnblockableAbility; +import mage.cards.CardImpl; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author North + */ +public class ArtfulDodge extends CardImpl { + + public ArtfulDodge(UUID ownerId) { + super(ownerId, 27, "Artful Dodge", Rarity.COMMON, new CardType[]{CardType.SORCERY}, "{U}"); + this.expansionSetCode = "DKA"; + + this.color.setBlue(true); + + // Target creature is unblockable this turn. + this.getSpellAbility().addEffect(new GainAbilityTargetEffect(UnblockableAbility.getInstance(), Duration.EndOfTurn)); + this.getSpellAbility().addTarget(new TargetCreaturePermanent()); + // Flashback {U} + this.addAbility(new FlashbackAbility(new ManaCostsImpl("{U}"), TimingRule.SORCERY)); + } + + public ArtfulDodge(final ArtfulDodge card) { + super(card); + } + + @Override + public ArtfulDodge copy() { + return new ArtfulDodge(this); + } +} diff --git a/Mage.Sets/src/mage/sets/darkascension/AvacynsCollar.java b/Mage.Sets/src/mage/sets/darkascension/AvacynsCollar.java new file mode 100644 index 00000000000..4b396fcfda8 --- /dev/null +++ b/Mage.Sets/src/mage/sets/darkascension/AvacynsCollar.java @@ -0,0 +1,111 @@ +/* + * 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.AttachmentType; +import mage.Constants.CardType; +import mage.Constants.Outcome; +import mage.Constants.Rarity; +import mage.Constants.Zone; +import mage.abilities.TriggeredAbilityImpl; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.costs.mana.GenericManaCost; +import mage.abilities.effects.common.CreateTokenEffect; +import mage.abilities.effects.common.continious.BoostEquippedEffect; +import mage.abilities.effects.common.continious.GainAbilityAttachedEffect; +import mage.abilities.keyword.EquipAbility; +import mage.abilities.keyword.VigilanceAbility; +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.game.permanent.token.SpiritWhiteToken; + +/** + * + * @author North + */ +public class AvacynsCollar extends CardImpl { + + public AvacynsCollar(UUID ownerId) { + super(ownerId, 145, "Avacyn's Collar", Rarity.UNCOMMON, new CardType[]{CardType.ARTIFACT}, "{1}"); + this.expansionSetCode = "DKA"; + this.subtype.add("Equipment"); + + // Equipped creature gets +1/+0 and has vigilance. + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostEquippedEffect(1, 0))); + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityAttachedEffect(VigilanceAbility.getInstance(), AttachmentType.EQUIPMENT))); + // Whenever equipped creature dies, if it was a Human, put a 1/1 white Spirit creature token with flying onto the battlefield. + this.addAbility(new AvacynsCollarTriggeredAbility()); + // Equip {2} + this.addAbility(new EquipAbility(Outcome.BoostCreature, new GenericManaCost(2))); + } + + public AvacynsCollar(final AvacynsCollar card) { + super(card); + } + + @Override + public AvacynsCollar copy() { + return new AvacynsCollar(this); + } +} + +class AvacynsCollarTriggeredAbility extends TriggeredAbilityImpl { + + public AvacynsCollarTriggeredAbility() { + super(Zone.BATTLEFIELD, new CreateTokenEffect(new SpiritWhiteToken())); + } + + public AvacynsCollarTriggeredAbility(final AvacynsCollarTriggeredAbility ability) { + super(ability); + } + + @Override + public AvacynsCollarTriggeredAbility copy() { + return new AvacynsCollarTriggeredAbility(this); + } + + @Override + public boolean checkTrigger(GameEvent event, Game game) { + if (event.getType() == GameEvent.EventType.ZONE_CHANGE && ((ZoneChangeEvent) event).isDiesEvent()) { + Permanent permanent = (Permanent) game.getLastKnownInformation(event.getTargetId(), Zone.BATTLEFIELD); + if (permanent.getAttachments().contains(this.getSourceId()) && permanent.hasSubtype("Human")) { + return true; + } + } + return false; + } + + @Override + public String getRule() { + return "Whenever equipped creature dies, if it was a Human, put a 1/1 white Spirit creature token with flying onto the battlefield."; + } +} diff --git a/Mage.Sets/src/mage/sets/darkascension/ChillOfForeboding.java b/Mage.Sets/src/mage/sets/darkascension/ChillOfForeboding.java new file mode 100644 index 00000000000..d2084b3eb90 --- /dev/null +++ b/Mage.Sets/src/mage/sets/darkascension/ChillOfForeboding.java @@ -0,0 +1,106 @@ +/* + * 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.Constants.Zone; +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.game.Game; +import mage.players.Player; + +/** + * + * @author North + */ +public class ChillOfForeboding extends CardImpl { + + public ChillOfForeboding(UUID ownerId) { + super(ownerId, 32, "Chill of Foreboding", Rarity.UNCOMMON, new CardType[]{CardType.SORCERY}, "{2}{U}"); + this.expansionSetCode = "DKA"; + + this.color.setBlue(true); + + // Each player puts the top five cards of his or her library into his or her graveyard. + this.getSpellAbility().addEffect(new ChillOfForebodingEffect()); + // Flashback {7}{U} + this.addAbility(new FlashbackAbility(new ManaCostsImpl("{7}{U}"), Constants.TimingRule.SORCERY)); + } + + public ChillOfForeboding(final ChillOfForeboding card) { + super(card); + } + + @Override + public ChillOfForeboding copy() { + return new ChillOfForeboding(this); + } +} + +class ChillOfForebodingEffect extends OneShotEffect { + + public ChillOfForebodingEffect() { + super(Outcome.Detriment); + this.staticText = "Each player puts the top five cards of his or her library into his or her graveyard"; + } + + public ChillOfForebodingEffect(final ChillOfForebodingEffect effect) { + super(effect); + } + + @Override + public ChillOfForebodingEffect copy() { + return new ChillOfForebodingEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Player sourcePlayer = game.getPlayer(source.getControllerId()); + for (UUID playerId : sourcePlayer.getInRange()) { + Player player = game.getPlayer(playerId); + if (player != null) { + int count = Math.min(5, player.getLibrary().size()); + for (int i = 0; i < count; i++) { + Card card = player.getLibrary().removeFromTop(game); + if (card != null) { + card.moveToZone(Zone.GRAVEYARD, source.getSourceId(), game, true); + } + } + } + } + return true; + } +} diff --git a/Mage.Sets/src/mage/sets/darkascension/DeathsCaress.java b/Mage.Sets/src/mage/sets/darkascension/DeathsCaress.java new file mode 100644 index 00000000000..d01d95a3514 --- /dev/null +++ b/Mage.Sets/src/mage/sets/darkascension/DeathsCaress.java @@ -0,0 +1,99 @@ +/* + * 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.Outcome; +import mage.Constants.Rarity; +import mage.Constants.Zone; +import mage.abilities.Ability; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.DestroyTargetEffect; +import mage.cards.CardImpl; +import mage.game.Game; +import mage.game.permanent.Permanent; +import mage.players.Player; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author North + */ +public class DeathsCaress extends CardImpl { + + public DeathsCaress(UUID ownerId) { + super(ownerId, 59, "Death's Caress", Rarity.COMMON, new CardType[]{CardType.SORCERY}, "{3}{B}{B}"); + this.expansionSetCode = "DKA"; + + this.color.setBlack(true); + + // Destroy target creature. + this.getSpellAbility().addEffect(new DestroyTargetEffect()); + this.getSpellAbility().addTarget(new TargetCreaturePermanent()); + // If that creature was a Human, you gain life equal to its toughness. + this.getSpellAbility().addEffect(new DeathsCaressEffect()); + } + + public DeathsCaress(final DeathsCaress card) { + super(card); + } + + @Override + public DeathsCaress copy() { + return new DeathsCaress(this); + } +} + +class DeathsCaressEffect extends OneShotEffect { + + public DeathsCaressEffect() { + super(Outcome.GainLife); + this.staticText = "If that creature was a Human, you gain life equal to its toughness"; + } + + public DeathsCaressEffect(final DeathsCaressEffect effect) { + super(effect); + } + + @Override + public DeathsCaressEffect copy() { + return new DeathsCaressEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Player player = game.getPlayer(source.getControllerId()); + Permanent creature = (Permanent) game.getLastKnownInformation(source.getFirstTarget(), Zone.BATTLEFIELD); + if (player != null && creature != null && creature.hasSubtype("Human")) { + player.gainLife(creature.getToughness().getValue(), game); + return true; + } + return false; + } +} diff --git a/Mage.Sets/src/mage/sets/darkascension/WolfhuntersQuiver.java b/Mage.Sets/src/mage/sets/darkascension/WolfhuntersQuiver.java new file mode 100644 index 00000000000..df2fd8218fb --- /dev/null +++ b/Mage.Sets/src/mage/sets/darkascension/WolfhuntersQuiver.java @@ -0,0 +1,111 @@ +/* + * 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.AttachmentType; +import mage.Constants.CardType; +import mage.Constants.Outcome; +import mage.Constants.Rarity; +import mage.Constants.Zone; +import mage.abilities.ActivatedAbilityImpl; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.costs.common.TapSourceCost; +import mage.abilities.costs.mana.GenericManaCost; +import mage.abilities.effects.common.DamageTargetEffect; +import mage.abilities.effects.common.continious.GainAbilityAttachedEffect; +import mage.abilities.keyword.EquipAbility; +import mage.cards.CardImpl; +import mage.filter.common.FilterCreaturePermanent; +import mage.target.Target; +import mage.target.common.TargetCreatureOrPlayer; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author North + */ +public class WolfhuntersQuiver extends CardImpl { + + private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("Werewolf creature"); + + static { + filter.getSubtype().add("Werewolf"); + } + + public WolfhuntersQuiver(UUID ownerId) { + super(ownerId, 154, "Wolfhunter's Quiver", Rarity.UNCOMMON, new CardType[]{CardType.ARTIFACT}, "{1}"); + this.expansionSetCode = "DKA"; + this.subtype.add("Equipment"); + + // Equipped creature has "{tap}: This creature deals 1 damage to target creature or player" + WolfhuntersQuiverAbility ability = new WolfhuntersQuiverAbility(1, new TargetCreatureOrPlayer()); + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityAttachedEffect(ability, AttachmentType.EQUIPMENT))); + // and "{tap}: This creature deals 3 damage to target Werewolf creature." + ability = new WolfhuntersQuiverAbility(3, new TargetCreaturePermanent(filter)); + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityAttachedEffect(ability, AttachmentType.EQUIPMENT))); + // Equip {5} + this.addAbility(new EquipAbility(Outcome.BoostCreature, new GenericManaCost(5))); + } + + public WolfhuntersQuiver(final WolfhuntersQuiver card) { + super(card); + } + + @Override + public WolfhuntersQuiver copy() { + return new WolfhuntersQuiver(this); + } +} + +class WolfhuntersQuiverAbility extends ActivatedAbilityImpl { + + private String ruleText; + + public WolfhuntersQuiverAbility(int amount, Target target) { + super(Zone.BATTLEFIELD, new DamageTargetEffect(amount), new TapSourceCost()); + this.addTarget(target); + + ruleText = "This creature deals " + amount + " damage to target " + target.getTargetName(); + } + + public WolfhuntersQuiverAbility(WolfhuntersQuiverAbility ability) { + super(ability); + this.ruleText = ability.ruleText; + } + + @Override + public WolfhuntersQuiverAbility copy() { + return new WolfhuntersQuiverAbility(this); + } + + @Override + public String getRule() { + return ruleText; + } +}