From b7c30ea23022f132ca80529c3ba4a04e06d258a2 Mon Sep 17 00:00:00 2001 From: LevelX2 Date: Thu, 11 Oct 2012 17:17:48 +0200 Subject: [PATCH] [RTR] AshZealot, Slum Reaper, Tavern Swindler, Ultimate Price --- .../mage/sets/returntoravnica/AshZealot.java | 116 ++++++++++++++++++ .../mage/sets/returntoravnica/SlumReaper.java | 66 ++++++++++ .../sets/returntoravnica/TavernSwindler.java | 102 +++++++++++++++ .../returntoravnica/ThrillKillAssassin.java | 4 - .../sets/returntoravnica/UltimatePrice.java | 71 +++++++++++ .../mageobject/MonocoloredPredicate.java | 49 ++++++++ 6 files changed, 404 insertions(+), 4 deletions(-) create mode 100644 Mage.Sets/src/mage/sets/returntoravnica/AshZealot.java create mode 100644 Mage.Sets/src/mage/sets/returntoravnica/SlumReaper.java create mode 100644 Mage.Sets/src/mage/sets/returntoravnica/TavernSwindler.java create mode 100644 Mage.Sets/src/mage/sets/returntoravnica/UltimatePrice.java create mode 100644 Mage/src/mage/filter/predicate/mageobject/MonocoloredPredicate.java diff --git a/Mage.Sets/src/mage/sets/returntoravnica/AshZealot.java b/Mage.Sets/src/mage/sets/returntoravnica/AshZealot.java new file mode 100644 index 0000000000..df4b28bfc8 --- /dev/null +++ b/Mage.Sets/src/mage/sets/returntoravnica/AshZealot.java @@ -0,0 +1,116 @@ +/* + * 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.returntoravnica; + +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.Effect; +import mage.abilities.effects.common.DamageTargetEffect; +import mage.abilities.keyword.FirstStrikeAbility; +import mage.abilities.keyword.HasteAbility; +import mage.cards.CardImpl; +import mage.game.Game; +import mage.game.events.GameEvent; +import mage.game.stack.Spell; +import mage.target.targetpointer.FixedTarget; + + +/** + * + * @author LevelX2 + */ +public class AshZealot extends CardImpl { + + public AshZealot (UUID ownerId) { + super(ownerId, 86, "Ash Zealot", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{R}{R}"); + this.expansionSetCode = "RTR"; + this.subtype.add("Human"); + this.subtype.add("Warrior"); + this.color.setRed(true); + this.power = new MageInt(2); + this.toughness = new MageInt(2); + + // First strike, haste + this.addAbility(FirstStrikeAbility.getInstance()); + this.addAbility(HasteAbility.getInstance()); + + // Whenever a player casts a spell from a graveyard, Ash Zealot deals 3 damage to that player. + this.addAbility(new AshZealotTriggeredAbility()); + + + } + + public AshZealot (final AshZealot card) { + super(card); + } + + @Override + public AshZealot copy() { + return new AshZealot(this); + } +} + +class AshZealotTriggeredAbility extends TriggeredAbilityImpl { + + public AshZealotTriggeredAbility() { + super(Constants.Zone.BATTLEFIELD, new DamageTargetEffect(3), false); + } + + public AshZealotTriggeredAbility(final AshZealotTriggeredAbility ability) { + super(ability); + } + + @Override + public AshZealotTriggeredAbility copy() { + return new AshZealotTriggeredAbility(this); + } + + @Override + public boolean checkTrigger(GameEvent event, Game game) { + if (event.getType() == GameEvent.EventType.SPELL_CAST && event.getZone() == Constants.Zone.GRAVEYARD) { + Spell spell = game.getStack().getSpell(event.getTargetId()); + if (spell != null) { + for (Effect effect : this.getEffects()) { + effect.setTargetPointer(new FixedTarget(spell.getControllerId())); + } + return true; + } + } + return false; + } + + @Override + public String getRule() { + return "Whenever a player casts a spell from a graveyard, {this} deals 3 damage to that player."; + } +} \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/returntoravnica/SlumReaper.java b/Mage.Sets/src/mage/sets/returntoravnica/SlumReaper.java new file mode 100644 index 0000000000..540ae7652b --- /dev/null +++ b/Mage.Sets/src/mage/sets/returntoravnica/SlumReaper.java @@ -0,0 +1,66 @@ +/* + * 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.returntoravnica; + +import java.util.UUID; +import mage.Constants.CardType; +import mage.Constants.Rarity; +import mage.MageInt; +import mage.abilities.common.EntersBattlefieldTriggeredAbility; +import mage.abilities.effects.common.SacrificeAllEffect; +import mage.cards.CardImpl; +import mage.filter.common.FilterControlledCreaturePermanent; + +/** + * + * @author LevelX2 + */ +public class SlumReaper extends CardImpl { + + public SlumReaper(UUID ownerId) { + super(ownerId, 77, "Slum Reaper", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{3}{B}"); + this.expansionSetCode = "RTR"; + this.subtype.add("Horror"); + + this.color.setBlack(true); + this.power = new MageInt(4); + this.toughness = new MageInt(2); + + // When Slum Reaper enters the battlefield, each player sacrifices a creature. + this.addAbility(new EntersBattlefieldTriggeredAbility(new SacrificeAllEffect(1, new FilterControlledCreaturePermanent("creature")))); + } + + public SlumReaper(final SlumReaper card) { + super(card); + } + + @Override + public SlumReaper copy() { + return new SlumReaper(this); + } +} \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/returntoravnica/TavernSwindler.java b/Mage.Sets/src/mage/sets/returntoravnica/TavernSwindler.java new file mode 100644 index 0000000000..416169fd3f --- /dev/null +++ b/Mage.Sets/src/mage/sets/returntoravnica/TavernSwindler.java @@ -0,0 +1,102 @@ +/* + * 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.returntoravnica; + +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.SimpleActivatedAbility; +import mage.abilities.costs.common.PayLifeCost; +import mage.abilities.costs.common.TapSourceCost; +import mage.abilities.effects.OneShotEffect; +import mage.cards.CardImpl; +import mage.game.Game; +import mage.players.Player; + +/** + * + * @author LevelX2 + */ +public class TavernSwindler extends CardImpl { + + public TavernSwindler(UUID ownerId) { + super(ownerId, 79, "Tavern Swindler", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{1}{B}"); + this.expansionSetCode = "RTR"; + this.subtype.add("Human"); + this.subtype.add("Rogue"); + + this.color.setBlack(true); + this.power = new MageInt(2); + this.toughness = new MageInt(2); + + // {T}, Pay 3 life: Flip a coin. If you win the flip, you gain 6 life. + Ability ability = new SimpleActivatedAbility(Constants.Zone.BATTLEFIELD, new TavernSwindlerEffect(),new TapSourceCost()); + ability.addCost(new PayLifeCost(3)); + this.addAbility(ability); + } + + public TavernSwindler(final TavernSwindler card) { + super(card); + } + + @Override + public TavernSwindler copy() { + return new TavernSwindler(this); + } +} + +class TavernSwindlerEffect extends OneShotEffect { + + public TavernSwindlerEffect() { + super(Constants.Outcome.Damage); + staticText = "Flip a coin. If you win the flip, you gain 6 life"; + } + + public TavernSwindlerEffect(TavernSwindlerEffect effect) { + super(effect); + } + + @Override + public boolean apply(Game game, Ability source) { + Player controller = game.getPlayer(source.getControllerId()); + if (controller != null) { + if (controller.flipCoin(game)) { + game.informPlayers(controller.getName() + " got " + controller.gainLife(6, game)+ " live"); + } + } + return false; + } + + @Override + public TavernSwindlerEffect copy() { + return new TavernSwindlerEffect(this); + } +} \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/returntoravnica/ThrillKillAssassin.java b/Mage.Sets/src/mage/sets/returntoravnica/ThrillKillAssassin.java index 299a167ae9..2178e50214 100644 --- a/Mage.Sets/src/mage/sets/returntoravnica/ThrillKillAssassin.java +++ b/Mage.Sets/src/mage/sets/returntoravnica/ThrillKillAssassin.java @@ -30,11 +30,7 @@ package mage.sets.returntoravnica; import java.util.UUID; import mage.Constants.CardType; import mage.Constants.Rarity; -import mage.Constants.Zone; import mage.MageInt; -import mage.abilities.common.SimpleActivatedAbility; -import mage.abilities.costs.mana.ManaCostsImpl; -import mage.abilities.effects.common.RegenerateSourceEffect; import mage.abilities.keyword.DeathtouchAbility; import mage.abilities.keyword.UnleashAbility; import mage.cards.CardImpl; diff --git a/Mage.Sets/src/mage/sets/returntoravnica/UltimatePrice.java b/Mage.Sets/src/mage/sets/returntoravnica/UltimatePrice.java new file mode 100644 index 0000000000..815caef5b9 --- /dev/null +++ b/Mage.Sets/src/mage/sets/returntoravnica/UltimatePrice.java @@ -0,0 +1,71 @@ +/* + * 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.returntoravnica; + +import java.util.UUID; +import mage.Constants.CardType; +import mage.Constants.Rarity; +import mage.abilities.effects.common.DestroyTargetEffect; +import mage.cards.CardImpl; +import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.mageobject.MonocoloredPredicate; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author LevelX2 + */ +public class UltimatePrice extends CardImpl { + + private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("monocolored creature"); + + static { + filter.add(new MonocoloredPredicate()); + } + + public UltimatePrice(UUID ownerId) { + super(ownerId, 82, "Ultimate Price", Rarity.UNCOMMON, new CardType[]{CardType.INSTANT}, "{1}{B}"); + this.expansionSetCode = "RTR"; + + this.color.setBlack(true); + + // Destroy target monocolored creature. + this.getSpellAbility().addTarget(new TargetCreaturePermanent(filter)); + this.getSpellAbility().addEffect(new DestroyTargetEffect()); + + } + + public UltimatePrice(final UltimatePrice card) { + super(card); + } + + @Override + public UltimatePrice copy() { + return new UltimatePrice(this); + } +} \ No newline at end of file diff --git a/Mage/src/mage/filter/predicate/mageobject/MonocoloredPredicate.java b/Mage/src/mage/filter/predicate/mageobject/MonocoloredPredicate.java new file mode 100644 index 0000000000..f6bd95ba51 --- /dev/null +++ b/Mage/src/mage/filter/predicate/mageobject/MonocoloredPredicate.java @@ -0,0 +1,49 @@ +/* + * 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.filter.predicate.mageobject; + +import mage.MageObject; +import mage.filter.predicate.Predicate; +import mage.game.Game; + +/** + * + * @author LevelX2 + */ +public class MonocoloredPredicate implements Predicate { + + @Override + public boolean apply(MageObject input, Game game) { + return 1 == input.getColor().getColorCount(); + } + + @Override + public String toString() { + return "Monocolored"; + } +}