From ec9bb538edf053cf96bc20dbf2fa0fa1f74beebc Mon Sep 17 00:00:00 2001 From: Backfir3 Date: Tue, 2 Jul 2013 17:26:46 +0200 Subject: [PATCH] Added 5 cards [USG] Attunement, Bereavement, Pariah [DRK] Barl's Cage [PCY] Verdant Field --- .../src/mage/sets/fifthedition/BarlsCage.java | 52 ++++++++ .../src/mage/sets/prophecy/VerdantField.java | 81 ++++++++++++ .../mage/sets/seventhedition/Bereavement.java | 52 ++++++++ .../src/mage/sets/seventhedition/Pariah.java | 52 ++++++++ Mage.Sets/src/mage/sets/tenth/Pariah.java | 52 ++++++++ .../src/mage/sets/thedark/BarlsCage.java | 64 ++++++++++ .../src/mage/sets/urzassaga/Attunement.java | 65 ++++++++++ .../src/mage/sets/urzassaga/Bereavement.java | 99 +++++++++++++++ Mage.Sets/src/mage/sets/urzassaga/Pariah.java | 120 ++++++++++++++++++ 9 files changed, 637 insertions(+) create mode 100644 Mage.Sets/src/mage/sets/fifthedition/BarlsCage.java create mode 100644 Mage.Sets/src/mage/sets/prophecy/VerdantField.java create mode 100644 Mage.Sets/src/mage/sets/seventhedition/Bereavement.java create mode 100644 Mage.Sets/src/mage/sets/seventhedition/Pariah.java create mode 100644 Mage.Sets/src/mage/sets/tenth/Pariah.java create mode 100644 Mage.Sets/src/mage/sets/thedark/BarlsCage.java create mode 100644 Mage.Sets/src/mage/sets/urzassaga/Attunement.java create mode 100644 Mage.Sets/src/mage/sets/urzassaga/Bereavement.java create mode 100644 Mage.Sets/src/mage/sets/urzassaga/Pariah.java diff --git a/Mage.Sets/src/mage/sets/fifthedition/BarlsCage.java b/Mage.Sets/src/mage/sets/fifthedition/BarlsCage.java new file mode 100644 index 0000000000..bde4c70328 --- /dev/null +++ b/Mage.Sets/src/mage/sets/fifthedition/BarlsCage.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 Backfir3 + */ +public class BarlsCage extends mage.sets.thedark.BarlsCage { + + public BarlsCage(UUID ownerId) { + super(ownerId); + this.cardNumber = 352; + this.expansionSetCode = "5ED"; + } + + public BarlsCage(final BarlsCage card) { + super(card); + } + + @Override + public BarlsCage copy() { + return new BarlsCage(this); + } +} diff --git a/Mage.Sets/src/mage/sets/prophecy/VerdantField.java b/Mage.Sets/src/mage/sets/prophecy/VerdantField.java new file mode 100644 index 0000000000..1e617f5558 --- /dev/null +++ b/Mage.Sets/src/mage/sets/prophecy/VerdantField.java @@ -0,0 +1,81 @@ +/* + * 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.prophecy; + +import java.util.UUID; + +import mage.constants.*; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.costs.common.TapSourceCost; +import mage.abilities.effects.common.AttachEffect; +import mage.abilities.effects.common.continious.BoostTargetEffect; +import mage.abilities.effects.common.continious.GainAbilityAttachedEffect; +import mage.abilities.keyword.EnchantAbility; +import mage.cards.CardImpl; +import mage.target.TargetPermanent; +import mage.target.common.TargetCreaturePermanent; +import mage.target.common.TargetLandPermanent; + +/** + * + * @author Backfir3 + */ +public class VerdantField extends CardImpl { + + public VerdantField(UUID ownerId) { + super(ownerId, 130, "Verdant Field", Rarity.UNCOMMON, new CardType[]{CardType.ENCHANTMENT}, "{2}{G}"); + this.expansionSetCode = "PCY"; + this.subtype.add("Aura"); + + this.color.setGreen(true); + + // Enchant land + TargetPermanent auraTarget = new TargetLandPermanent(); + this.getSpellAbility().addTarget(auraTarget); + this.getSpellAbility().addEffect(new AttachEffect(Outcome.Benefit)); + Ability ability = new EnchantAbility(auraTarget.getTargetName()); + this.addAbility(ability); + + // Enchanted land has "{T}: Target creature gets +1/+1 until end of turn." + Ability gainAbility = new SimpleActivatedAbility(Zone.BATTLEFIELD, new BoostTargetEffect(1, 1, Duration.EndOfTurn), new TapSourceCost()); + gainAbility.addTarget(new TargetCreaturePermanent()); + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityAttachedEffect(gainAbility, AttachmentType.AURA, + Duration.WhileOnBattlefield, "Enchanted land has \"{T}: Target creature gets +1/+1 until end of turn.\""))); + } + + public VerdantField(final VerdantField card) { + super(card); + } + + @Override + public VerdantField copy() { + return new VerdantField(this); + } +} diff --git a/Mage.Sets/src/mage/sets/seventhedition/Bereavement.java b/Mage.Sets/src/mage/sets/seventhedition/Bereavement.java new file mode 100644 index 0000000000..bc6690d42d --- /dev/null +++ b/Mage.Sets/src/mage/sets/seventhedition/Bereavement.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.seventhedition; + +import java.util.UUID; + +/** + * + * @author Backfir3 + */ +public class Bereavement extends mage.sets.urzassaga.Bereavement { + + public Bereavement(UUID ownerId) { + super(ownerId); + this.cardNumber = 120; + this.expansionSetCode = "7ED"; + } + + public Bereavement(final Bereavement card) { + super(card); + } + + @Override + public Bereavement copy() { + return new Bereavement(this); + } +} diff --git a/Mage.Sets/src/mage/sets/seventhedition/Pariah.java b/Mage.Sets/src/mage/sets/seventhedition/Pariah.java new file mode 100644 index 0000000000..87c52a3757 --- /dev/null +++ b/Mage.Sets/src/mage/sets/seventhedition/Pariah.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.seventhedition; + +import java.util.UUID; + +/** + * + * @author Backfir3 + */ +public class Pariah extends mage.sets.urzassaga.Pariah { + + public Pariah(UUID ownerId) { + super(ownerId); + this.cardNumber = 30; + this.expansionSetCode = "7ED"; + } + + public Pariah(final Pariah card) { + super(card); + } + + @Override + public Pariah copy() { + return new Pariah(this); + } +} diff --git a/Mage.Sets/src/mage/sets/tenth/Pariah.java b/Mage.Sets/src/mage/sets/tenth/Pariah.java new file mode 100644 index 0000000000..395dfce38b --- /dev/null +++ b/Mage.Sets/src/mage/sets/tenth/Pariah.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.tenth; + +import java.util.UUID; + +/** + * + * @author Backfir3 + */ +public class Pariah extends mage.sets.urzassaga.Pariah { + + public Pariah(UUID ownerId) { + super(ownerId); + this.cardNumber = 33; + this.expansionSetCode = "10E"; + } + + public Pariah(final Pariah card) { + super(card); + } + + @Override + public Pariah copy() { + return new Pariah(this); + } +} diff --git a/Mage.Sets/src/mage/sets/thedark/BarlsCage.java b/Mage.Sets/src/mage/sets/thedark/BarlsCage.java new file mode 100644 index 0000000000..9ef249186c --- /dev/null +++ b/Mage.Sets/src/mage/sets/thedark/BarlsCage.java @@ -0,0 +1,64 @@ +/* + * 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.thedark; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.mana.GenericManaCost; +import mage.abilities.effects.common.SkipNextUntapTargetEffect; +import mage.cards.CardImpl; +import mage.constants.Zone; +import mage.target.common.TargetCreaturePermanent; + +/** + * @author Backfir3 + */ +public class BarlsCage extends CardImpl { + + public BarlsCage(UUID ownerId) { + super(ownerId, 93, "Barl's Cage", Rarity.RARE, new CardType[]{CardType.ARTIFACT}, "{4}"); + this.expansionSetCode = "DRK"; + + // {3}: Target creature doesn't untap during its controller's next untap step. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new SkipNextUntapTargetEffect("Target creature"), new GenericManaCost(3)); + ability.addTarget(new TargetCreaturePermanent()); + this.addAbility(ability); + } + + public BarlsCage(final BarlsCage card) { + super(card); + } + + @Override + public BarlsCage copy() { + return new BarlsCage(this); + } +} diff --git a/Mage.Sets/src/mage/sets/urzassaga/Attunement.java b/Mage.Sets/src/mage/sets/urzassaga/Attunement.java new file mode 100644 index 0000000000..8e7abf466b --- /dev/null +++ b/Mage.Sets/src/mage/sets/urzassaga/Attunement.java @@ -0,0 +1,65 @@ +/* + * 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.urzassaga; + +import java.util.UUID; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.common.ReturnToHandSourceCost; +import mage.abilities.effects.common.DiscardControllerEffect; +import mage.abilities.effects.common.DrawCardControllerEffect; +import mage.cards.CardImpl; + +/** + * + * @author Backfir3 + */ +public class Attunement extends CardImpl { + + public Attunement(UUID ownerId) { + super(ownerId, 61, "Attunement", Rarity.RARE, new CardType[]{CardType.ENCHANTMENT}, "{2}{U}"); + this.expansionSetCode = "USG"; + this.color.setBlue(true); + + // Return Attunement to its owner's hand: Draw three cards, then discard four cards. + SimpleActivatedAbility ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DrawCardControllerEffect(3), new ReturnToHandSourceCost()); + ability.addEffect(new DiscardControllerEffect(4)); + this.addAbility(ability); + } + + public Attunement(final Attunement card) { + super(card); + } + + @Override + public Attunement copy() { + return new Attunement(this); + } +} diff --git a/Mage.Sets/src/mage/sets/urzassaga/Bereavement.java b/Mage.Sets/src/mage/sets/urzassaga/Bereavement.java new file mode 100644 index 0000000000..3a705206eb --- /dev/null +++ b/Mage.Sets/src/mage/sets/urzassaga/Bereavement.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.urzassaga; + +import java.util.UUID; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.abilities.TriggeredAbilityImpl; +import mage.abilities.effects.common.DiscardTargetEffect; +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.target.targetpointer.FixedTarget; + +/** + * + * @author Backfir3 + */ +public class Bereavement extends CardImpl { + + public Bereavement(UUID ownerId) { + super(ownerId, 117, "Bereavement", Rarity.UNCOMMON, new CardType[]{CardType.ENCHANTMENT}, "{1}{B}"); + this.expansionSetCode = "USG"; + this.color.setBlack(true); + + // Whenever a green creature dies, its controller discards a card. + this.addAbility(new BereavementTriggeredAbility()); + } + + public Bereavement(final Bereavement card) { + super(card); + } + + @Override + public Bereavement copy() { + return new Bereavement(this); + } +} + +class BereavementTriggeredAbility extends TriggeredAbilityImpl { + + public BereavementTriggeredAbility() { + super(Zone.BATTLEFIELD, new DiscardTargetEffect(1)); + } + + public BereavementTriggeredAbility(final BereavementTriggeredAbility ability) { + super(ability); + } + + @Override + public BereavementTriggeredAbility copy() { + return new BereavementTriggeredAbility(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 != null && permanent.getCardType().contains(CardType.CREATURE) && permanent.getColor().isGreen()) { + this.getEffects().get(0).setTargetPointer(new FixedTarget(permanent.getControllerId())); + return true; + } + } + return false; + } + + @Override + public String getRule() { + return "Whenever a green creature dies, its controller discards a card"; + } +} diff --git a/Mage.Sets/src/mage/sets/urzassaga/Pariah.java b/Mage.Sets/src/mage/sets/urzassaga/Pariah.java new file mode 100644 index 0000000000..9492e24865 --- /dev/null +++ b/Mage.Sets/src/mage/sets/urzassaga/Pariah.java @@ -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.urzassaga; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.effects.ReplacementEffectImpl; +import mage.abilities.effects.common.AttachEffect; +import mage.abilities.keyword.EnchantAbility; +import mage.cards.CardImpl; +import mage.constants.Duration; +import mage.game.Game; +import mage.game.events.DamagePlayerEvent; +import mage.game.events.GameEvent; +import mage.game.permanent.Permanent; +import mage.target.TargetPermanent; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author Backfir3 + */ +public class Pariah extends CardImpl { + + public Pariah(UUID ownerId) { + super(ownerId, 28, "Pariah", Rarity.RARE, new CardType[]{CardType.ENCHANTMENT}, "{2}{W}"); + this.expansionSetCode = "USG"; + this.subtype.add("Aura"); + this.color.setWhite(true); + + // Enchant creature + TargetPermanent auraTarget = new TargetCreaturePermanent(); + this.getSpellAbility().addTarget(auraTarget); + this.getSpellAbility().addEffect(new AttachEffect(Outcome.BoostCreature)); + this.addAbility(new EnchantAbility(auraTarget.getTargetName())); + // All damage that would be dealt to you is dealt to enchanted creature instead. + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new PariahEffect())); + } + + public Pariah(final Pariah card) { + super(card); + } + + @Override + public Pariah copy() { + return new Pariah(this); + } +} + +class PariahEffect extends ReplacementEffectImpl { + PariahEffect() { + super(Duration.WhileOnBattlefield, Outcome.RedirectDamage); + staticText = "All damage that would be dealt to you is dealt to enchanted creature instead"; + } + + PariahEffect(final PariahEffect effect) { + super(effect); + } + + @Override + public boolean replaceEvent(GameEvent event, Ability source, Game game) { + DamagePlayerEvent damageEvent = (DamagePlayerEvent) event; + Permanent equipment = game.getPermanent(source.getSourceId()); + if(equipment != null){ + Permanent p = game.getPermanent(equipment.getAttachedTo()); + if (p != null) { + p.damage(damageEvent.getAmount(), event.getSourceId(), game, damageEvent.isPreventable(), damageEvent.isCombatDamage()); + return true; + } + } + return true; + } + + @Override + public boolean applies(GameEvent event, Ability source, Game game) { + if (event.getType() == GameEvent.EventType.DAMAGE_PLAYER && event.getPlayerId().equals(source.getControllerId())) + return true; + return false; + } + + @Override + public boolean apply(Game game, Ability source) { + return true; + } + + @Override + public PariahEffect copy() { + return new PariahEffect(this); + } +}