From 8bbcf05c860ee69c0f0c57b54a8da2bcd7055aba Mon Sep 17 00:00:00 2001 From: Loki Date: Thu, 29 Sep 2011 00:19:03 +0300 Subject: [PATCH] 2 ISD --- .../sets/conflux/SigilOfTheEmptyThrone.java | 17 +-- .../mage/sets/innistrad/DarkthicketWolf.java | 68 +++++++++++ .../sets/innistrad/GeistOfSaintTraft.java | 111 ++++++++++++++++++ .../mage/game/permanent/token/AngelToken.java | 18 +++ 4 files changed, 198 insertions(+), 16 deletions(-) create mode 100644 Mage.Sets/src/mage/sets/innistrad/DarkthicketWolf.java create mode 100644 Mage.Sets/src/mage/sets/innistrad/GeistOfSaintTraft.java create mode 100644 Mage/src/mage/game/permanent/token/AngelToken.java diff --git a/Mage.Sets/src/mage/sets/conflux/SigilOfTheEmptyThrone.java b/Mage.Sets/src/mage/sets/conflux/SigilOfTheEmptyThrone.java index b32d36e3a11..848ba3161b4 100644 --- a/Mage.Sets/src/mage/sets/conflux/SigilOfTheEmptyThrone.java +++ b/Mage.Sets/src/mage/sets/conflux/SigilOfTheEmptyThrone.java @@ -31,14 +31,11 @@ package mage.sets.conflux; import java.util.UUID; import mage.Constants.CardType; import mage.Constants.Rarity; -import mage.MageInt; -import mage.ObjectColor; import mage.abilities.common.SpellCastTriggeredAbility; import mage.abilities.effects.common.CreateTokenEffect; -import mage.abilities.keyword.FlyingAbility; import mage.cards.CardImpl; import mage.filter.FilterCard; -import mage.game.permanent.token.Token; +import mage.game.permanent.token.AngelToken; /** * @@ -70,15 +67,3 @@ public class SigilOfTheEmptyThrone extends CardImpl { } } - -class AngelToken extends Token { - public AngelToken() { - super("Angel", "4/4 white Angel creature token with flying"); - cardType.add(CardType.CREATURE); - color = ObjectColor.WHITE; - subtype.add("Angel"); - power = new MageInt(4); - toughness = new MageInt(4); - addAbility(FlyingAbility.getInstance()); - } -} \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/innistrad/DarkthicketWolf.java b/Mage.Sets/src/mage/sets/innistrad/DarkthicketWolf.java new file mode 100644 index 00000000000..fe813863d71 --- /dev/null +++ b/Mage.Sets/src/mage/sets/innistrad/DarkthicketWolf.java @@ -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.innistrad; + +import java.util.UUID; + +import mage.Constants; +import mage.Constants.CardType; +import mage.Constants.Rarity; +import mage.MageInt; +import mage.abilities.common.ActivateOncePerTurnActivatedAbility; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.continious.BoostSourceEffect; +import mage.cards.CardImpl; + +/** + * + * @author Loki + */ +public class DarkthicketWolf extends CardImpl { + + public DarkthicketWolf(UUID ownerId) { + super(ownerId, 175, "Darkthicket Wolf", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{1}{G}"); + this.expansionSetCode = "ISD"; + this.subtype.add("Wolf"); + + this.color.setGreen(true); + this.power = new MageInt(2); + this.toughness = new MageInt(2); + + // {2}{G}: Darkthicket Wolf gets +2/+2 until end of turn. Activate this ability only once each turn. + this.addAbility(new ActivateOncePerTurnActivatedAbility(Constants.Zone.BATTLEFIELD, new BoostSourceEffect(2, 2, Constants.Duration.EndOfTurn), new ManaCostsImpl("{2}{G}"))); + } + + public DarkthicketWolf(final DarkthicketWolf card) { + super(card); + } + + @Override + public DarkthicketWolf copy() { + return new DarkthicketWolf(this); + } +} diff --git a/Mage.Sets/src/mage/sets/innistrad/GeistOfSaintTraft.java b/Mage.Sets/src/mage/sets/innistrad/GeistOfSaintTraft.java new file mode 100644 index 00000000000..7cbf9be2d67 --- /dev/null +++ b/Mage.Sets/src/mage/sets/innistrad/GeistOfSaintTraft.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.innistrad; + +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.AttacksTriggeredAbility; +import mage.abilities.common.delayed.AtTheEndOfCombatDelayedTriggeredAbility; +import mage.abilities.effects.Effect; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.CreateDelayedTriggeredAbilityEffect; +import mage.abilities.effects.common.ExileTargetEffect; +import mage.abilities.keyword.HexproofAbility; +import mage.cards.CardImpl; +import mage.game.Game; +import mage.game.permanent.Permanent; +import mage.game.permanent.token.AngelToken; +import mage.target.targetpointer.FixedTarget; + +/** + * @author Loki + */ +public class GeistOfSaintTraft extends CardImpl { + + public GeistOfSaintTraft(UUID ownerId) { + super(ownerId, 213, "Geist of Saint Traft", Rarity.MYTHIC, new CardType[]{CardType.CREATURE}, "{1}{W}{U}"); + this.expansionSetCode = "ISD"; + this.supertype.add("Legendary"); + this.subtype.add("Spirit"); + this.subtype.add("Cleric"); + + this.color.setBlue(true); + this.color.setWhite(true); + this.power = new MageInt(2); + this.toughness = new MageInt(2); + + this.addAbility(new HexproofAbility()); + // Whenever Geist of Saint Traft attacks, put a 4/4 white Angel creature token with flying onto the battlefield tapped and attacking. Exile that token at end of combat. + this.addAbility(new AttacksTriggeredAbility(new GeistOfSaintTraftEffect(), false)); + } + + public GeistOfSaintTraft(final GeistOfSaintTraft card) { + super(card); + } + + @Override + public GeistOfSaintTraft copy() { + return new GeistOfSaintTraft(this); + } +} + +class GeistOfSaintTraftEffect extends OneShotEffect { + GeistOfSaintTraftEffect() { + super(Constants.Outcome.PutCreatureInPlay); + staticText = "put a 4/4 white Angel creature token with flying onto the battlefield tapped and attacking. Exile that token at end of combat"; + } + + GeistOfSaintTraftEffect(final GeistOfSaintTraftEffect effect) { + super(effect); + } + + @Override + public boolean apply(Game game, Ability source) { + AngelToken token = new AngelToken(); + if (token.putOntoBattlefield(game, source.getSourceId(), source.getControllerId())) { + Permanent p = game.getPermanent(token.getLastAddedToken()); + game.getCombat().declareAttacker(p.getId(), game.getCombat().getDefendingPlayer(source.getSourceId()), game); + Effect effect = new ExileTargetEffect(); + effect.setTargetPointer(new FixedTarget(token.getLastAddedToken())); + CreateDelayedTriggeredAbilityEffect createEffect = new CreateDelayedTriggeredAbilityEffect(new AtTheEndOfCombatDelayedTriggeredAbility(effect)); + createEffect.apply(game, source); + return true; + } + return false; + } + + @Override + public GeistOfSaintTraftEffect copy() { + return new GeistOfSaintTraftEffect(this); + } +} \ No newline at end of file diff --git a/Mage/src/mage/game/permanent/token/AngelToken.java b/Mage/src/mage/game/permanent/token/AngelToken.java new file mode 100644 index 00000000000..aec6564f596 --- /dev/null +++ b/Mage/src/mage/game/permanent/token/AngelToken.java @@ -0,0 +1,18 @@ +package mage.game.permanent.token; + +import mage.Constants; +import mage.MageInt; +import mage.ObjectColor; +import mage.abilities.keyword.FlyingAbility; + +public class AngelToken extends Token { + public AngelToken() { + super("Angel", "4/4 white Angel creature token with flying"); + cardType.add(Constants.CardType.CREATURE); + color = ObjectColor.WHITE; + subtype.add("Angel"); + power = new MageInt(4); + toughness = new MageInt(4); + addAbility(FlyingAbility.getInstance()); + } +}