From dc2238e3003a86b3d18abd86734471dda2bf91c0 Mon Sep 17 00:00:00 2001 From: jeffwadsworth Date: Sat, 28 Jul 2012 13:28:02 -0500 Subject: [PATCH] - Added Blinking Spirit, Domestication, Raid Bombardment. <5th,9th> --- .../sets/fifthedition/BlinkingSpirit.java | 52 +++++++++ .../sets/ninthedition/BlinkingSpirit.java | 67 ++++++++++++ .../sets/riseoftheeldrazi/Domestication.java | 103 ++++++++++++++++++ .../riseoftheeldrazi/RaidBombardment.java | 103 ++++++++++++++++++ 4 files changed, 325 insertions(+) create mode 100644 Mage.Sets/src/mage/sets/fifthedition/BlinkingSpirit.java create mode 100644 Mage.Sets/src/mage/sets/ninthedition/BlinkingSpirit.java create mode 100644 Mage.Sets/src/mage/sets/riseoftheeldrazi/Domestication.java create mode 100644 Mage.Sets/src/mage/sets/riseoftheeldrazi/RaidBombardment.java diff --git a/Mage.Sets/src/mage/sets/fifthedition/BlinkingSpirit.java b/Mage.Sets/src/mage/sets/fifthedition/BlinkingSpirit.java new file mode 100644 index 00000000000..203734f438d --- /dev/null +++ b/Mage.Sets/src/mage/sets/fifthedition/BlinkingSpirit.java @@ -0,0 +1,52 @@ +/* + * 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.fifthedition; + +import java.util.UUID; + +/** + * + * @author jeffwadsworth + */ +public class BlinkingSpirit extends mage.sets.ninthedition.BlinkingSpirit { + + public BlinkingSpirit(UUID ownerId) { + super(ownerId); + this.cardNumber = 288; + this.expansionSetCode = "5ED"; + } + + public BlinkingSpirit(final BlinkingSpirit card) { + super(card); + } + + @Override + public BlinkingSpirit copy() { + return new BlinkingSpirit(this); + } +} diff --git a/Mage.Sets/src/mage/sets/ninthedition/BlinkingSpirit.java b/Mage.Sets/src/mage/sets/ninthedition/BlinkingSpirit.java new file mode 100644 index 00000000000..4d3629bf3a4 --- /dev/null +++ b/Mage.Sets/src/mage/sets/ninthedition/BlinkingSpirit.java @@ -0,0 +1,67 @@ +/* + * 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.ninthedition; + +import java.util.UUID; +import mage.Constants; +import mage.Constants.CardType; +import mage.Constants.Rarity; +import mage.MageInt; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.mana.GenericManaCost; +import mage.abilities.effects.common.ReturnToHandSourceEffect; +import mage.cards.CardImpl; + +/** + * + * @author jeffwadsworth + */ +public class BlinkingSpirit extends CardImpl { + + public BlinkingSpirit(UUID ownerId) { + super(ownerId, 8, "Blinking Spirit", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{3}{W}"); + this.expansionSetCode = "9ED"; + this.subtype.add("Spirit"); + + this.color.setWhite(true); + this.power = new MageInt(2); + this.toughness = new MageInt(2); + + // {0}: Return Blinking Spirit to its owner's hand. + this.addAbility(new SimpleActivatedAbility(Constants.Zone.BATTLEFIELD, new ReturnToHandSourceEffect(), new GenericManaCost(0))); + } + + public BlinkingSpirit(final BlinkingSpirit card) { + super(card); + } + + @Override + public BlinkingSpirit copy() { + return new BlinkingSpirit(this); + } +} diff --git a/Mage.Sets/src/mage/sets/riseoftheeldrazi/Domestication.java b/Mage.Sets/src/mage/sets/riseoftheeldrazi/Domestication.java new file mode 100644 index 00000000000..40a7a62329f --- /dev/null +++ b/Mage.Sets/src/mage/sets/riseoftheeldrazi/Domestication.java @@ -0,0 +1,103 @@ +/* + * 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.riseoftheeldrazi; + +import java.util.UUID; +import mage.Constants; +import mage.Constants.CardType; +import mage.Constants.Rarity; +import mage.abilities.Ability; +import mage.abilities.TriggeredAbility; +import mage.abilities.common.BeginningOfYourEndStepTriggeredAbility; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.condition.Condition; +import mage.abilities.decorator.ConditionalTriggeredAbility; +import mage.abilities.effects.common.AttachEffect; +import mage.abilities.effects.common.SacrificeSourceEffect; +import mage.abilities.effects.common.continious.ControlEnchantedEffect; +import mage.abilities.keyword.EnchantAbility; +import mage.cards.CardImpl; +import mage.game.Game; +import mage.game.permanent.Permanent; +import mage.target.TargetPermanent; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author jeffwadsworth + */ +public class Domestication extends CardImpl { + + public Domestication(UUID ownerId) { + super(ownerId, 61, "Domestication", Rarity.UNCOMMON, new CardType[]{CardType.ENCHANTMENT}, "{2}{U}{U}"); + this.expansionSetCode = "ROE"; + this.subtype.add("Aura"); + + this.color.setBlue(true); + + // Enchant creature + TargetPermanent auraTarget = new TargetCreaturePermanent(); + this.getSpellAbility().addTarget(auraTarget); + this.getSpellAbility().addEffect(new AttachEffect(Constants.Outcome.GainControl)); + Ability ability = new EnchantAbility(auraTarget.getTargetName()); + this.addAbility(ability); + + // You control enchanted creature. + this.addAbility(new SimpleStaticAbility(Constants.Zone.BATTLEFIELD, new ControlEnchantedEffect())); + + // At the beginning of your end step, if enchanted creature's power is 4 or greater, sacrifice Domestication. + TriggeredAbility ability2 = new BeginningOfYourEndStepTriggeredAbility(new SacrificeSourceEffect(), false); + this.addAbility(new ConditionalTriggeredAbility(ability2, new DomesticationCondition(), "At the beginning of your end step, if enchanted creature's power is 4 or greater, sacrifice {this}")); + } + + public Domestication(final Domestication card) { + super(card); + } + + @Override + public Domestication copy() { + return new Domestication(this); + } +} + +class DomesticationCondition implements Condition { + + @Override + public boolean apply(Game game, Ability source) { + Permanent enchantment = game.getPermanent(source.getSourceId()); + if (enchantment != null) { + Permanent enchanted = game.getPermanent(enchantment.getAttachedTo()); + if (enchanted != null) { + if (enchanted.getPower().getValue() >= 4) { + return true; + } + } + } + return false; + } +} diff --git a/Mage.Sets/src/mage/sets/riseoftheeldrazi/RaidBombardment.java b/Mage.Sets/src/mage/sets/riseoftheeldrazi/RaidBombardment.java new file mode 100644 index 00000000000..9dd371afe57 --- /dev/null +++ b/Mage.Sets/src/mage/sets/riseoftheeldrazi/RaidBombardment.java @@ -0,0 +1,103 @@ +/* + * 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.riseoftheeldrazi; + +import java.util.UUID; +import mage.Constants; +import mage.Constants.CardType; +import mage.Constants.Rarity; +import mage.abilities.TriggeredAbilityImpl; +import mage.abilities.effects.common.DamageTargetEffect; +import mage.cards.CardImpl; +import mage.game.Game; +import mage.game.events.GameEvent; +import mage.game.permanent.Permanent; +import mage.target.targetpointer.FixedTarget; + +/** + * + * @author jeffwadsworth + */ +public class RaidBombardment extends CardImpl { + + public RaidBombardment(UUID ownerId) { + super(ownerId, 161, "Raid Bombardment", Rarity.COMMON, new CardType[]{CardType.ENCHANTMENT}, "{2}{R}"); + this.expansionSetCode = "ROE"; + + this.color.setRed(true); + + // Whenever a creature you control with power 2 or less attacks, Raid Bombardment deals 1 damage to defending player. + this.addAbility(new RaidBombardmentTriggeredAbility()); + } + + public RaidBombardment(final RaidBombardment card) { + super(card); + } + + @Override + public RaidBombardment copy() { + return new RaidBombardment(this); + } +} + +class RaidBombardmentTriggeredAbility extends TriggeredAbilityImpl { + + public RaidBombardmentTriggeredAbility() { + super(Constants.Zone.BATTLEFIELD, new DamageTargetEffect(1)); + } + + public RaidBombardmentTriggeredAbility(final RaidBombardmentTriggeredAbility ability) { + super(ability); + } + + @Override + public RaidBombardmentTriggeredAbility copy() { + return new RaidBombardmentTriggeredAbility(this); + } + + @Override + public boolean checkTrigger(GameEvent event, Game game) { + if (event.getType() == GameEvent.EventType.ATTACKER_DECLARED && game.getActivePlayerId().equals(this.controllerId) ) { + Permanent attacker = game.getPermanent(event.getSourceId()); + if (attacker != null) { + if (attacker.getPower().getValue() <= 2) { + this.getEffects().get(0).setTargetPointer(new FixedTarget(event.getTargetId())); + return true; + } + } + } + return false; + } + + @Override + public String getRule() { + return "Whenever a creature you control with power 2 or less attacks, {this} deals 1 damage to defending player."; + } + +} +