diff --git a/.gitignore b/.gitignore index b7e5239232..7a7fb62ee6 100644 --- a/.gitignore +++ b/.gitignore @@ -46,6 +46,7 @@ Utils/author.txt .metadata .project .settings +.idea syntax: regexp \.class \.jar diff --git a/Mage.Client/mage-rate-executable.jar b/Mage.Client/mage-rate-executable.jar deleted file mode 100644 index 91c91d4838..0000000000 Binary files a/Mage.Client/mage-rate-executable.jar and /dev/null differ diff --git a/Mage.Sets/src/mage/sets/alliances/Pyrokinesis.java b/Mage.Sets/src/mage/sets/alliances/Pyrokinesis.java new file mode 100644 index 0000000000..d36852fe14 --- /dev/null +++ b/Mage.Sets/src/mage/sets/alliances/Pyrokinesis.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.alliances; + +import java.util.UUID; +import mage.Constants.CardType; +import mage.Constants.Rarity; +import mage.ObjectColor; +import mage.abilities.costs.AlternativeCostImpl; +import mage.abilities.costs.Cost; +import mage.abilities.costs.CostsImpl; +import mage.abilities.costs.common.ExileFromHandCost; +import mage.abilities.effects.common.DamageMultiEffect; +import mage.cards.CardImpl; +import mage.filter.common.FilterOwnedCard; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.mageobject.CardIdPredicate; +import mage.filter.predicate.mageobject.ColorPredicate; +import mage.target.common.TargetCardInHand; +import mage.target.common.TargetCreatureOrPlayerAmount; +import mage.target.common.TargetCreaturePermanentAmount; + +/** + * + * @author Plopman + */ +public class Pyrokinesis extends CardImpl { + + public Pyrokinesis(UUID ownerId) { + super(ownerId, 115, "Pyrokinesis", Rarity.UNCOMMON, new CardType[]{CardType.INSTANT}, "{4}{R}{R}"); + this.expansionSetCode = "ALL"; + + this.color.setRed(true); + + // You may exile a red card from your hand rather than pay Pyrokinesis's mana cost. + FilterOwnedCard filter = new FilterOwnedCard("red card from your hand"); + filter.add(new ColorPredicate(ObjectColor.RED)); + filter.add(Predicates.not(new CardIdPredicate(this.getId()))); // the exile cost can never be paid with the card itself + CostsImpl costs = new CostsImpl(); + costs.add(new ExileFromHandCost(new TargetCardInHand(filter))); + this.getSpellAbility().addAlternativeCost(new AlternativeCostImpl("You may exile a red card from your hand rather than pay Pyrokinesis's mana cost", costs)); + + // Pyrokinesis deals 4 damage divided as you choose among any number of target creatures. + this.getSpellAbility().addEffect(new DamageMultiEffect(4)); + this.getSpellAbility().addTarget(new TargetCreaturePermanentAmount(4)); + } + + public Pyrokinesis(final Pyrokinesis card) { + super(card); + } + + @Override + public Pyrokinesis copy() { + return new Pyrokinesis(this); + } +} diff --git a/Mage.Sets/src/mage/sets/apocalypse/GoblinRingleader.java b/Mage.Sets/src/mage/sets/apocalypse/GoblinRingleader.java new file mode 100644 index 0000000000..1c50b4e7b2 --- /dev/null +++ b/Mage.Sets/src/mage/sets/apocalypse/GoblinRingleader.java @@ -0,0 +1,138 @@ +/* + * 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.apocalypse; + +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.EntersBattlefieldTriggeredAbility; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.keyword.HasteAbility; +import mage.cards.Card; +import mage.cards.CardImpl; +import mage.cards.Cards; +import mage.cards.CardsImpl; +import mage.filter.FilterCard; +import mage.filter.predicate.mageobject.SubtypePredicate; +import mage.game.Game; +import mage.players.Player; +import mage.target.TargetCard; + +/** + * + * @author Plopman + */ +public class GoblinRingleader extends CardImpl { + + public GoblinRingleader(UUID ownerId) { + super(ownerId, 62, "Goblin Ringleader", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{3}{R}"); + this.expansionSetCode = "APC"; + this.subtype.add("Goblin"); + + this.color.setRed(true); + this.power = new MageInt(2); + this.toughness = new MageInt(2); + + // Haste + this.addAbility(HasteAbility.getInstance()); + // When Goblin Ringleader enters the battlefield, reveal the top four cards of your library. Put all Goblin cards revealed this way into your hand and the rest on the bottom of your library in any order. + this.addAbility(new EntersBattlefieldTriggeredAbility(new GoblinRingleaderEffect())); + } + + public GoblinRingleader(final GoblinRingleader card) { + super(card); + } + + @Override + public GoblinRingleader copy() { + return new GoblinRingleader(this); + } +} + +class GoblinRingleaderEffect extends OneShotEffect { + + private static final FilterCard filter = new FilterCard("Goblin"); + static { + filter.add(new SubtypePredicate("Goblin")); + } + + public GoblinRingleaderEffect() { + super(Constants.Outcome.DrawCard); + this.staticText = "reveal the top four cards of your library. Put all Goblin cards revealed this way into your hand and the rest on the bottom of your library in any order"; + } + + public GoblinRingleaderEffect(final GoblinRingleaderEffect effect) { + super(effect); + } + + @Override + public GoblinRingleaderEffect copy() { + return new GoblinRingleaderEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Player player = game.getPlayer(source.getControllerId()); + if (player != null) { + Cards cards = new CardsImpl(Constants.Zone.PICK); + Cards cards2 = new CardsImpl(Constants.Zone.PICK); + int count = Math.min(player.getLibrary().size(), 4); + for (int i = 0; i < count; i++) { + Card card = player.getLibrary().removeFromTop(game); + if (card != null) { + cards.add(card); + game.setZone(card.getId(), Constants.Zone.PICK); + if (filter.match(card, game)) { + card.moveToZone(Constants.Zone.HAND, source.getId(), game, true); + } else { + cards2.add(card); + } + } + } + + Card sourceCard = game.getCard(source.getSourceId()); + if (!cards.isEmpty() && sourceCard != null) { + player.revealCards(sourceCard.getName(), cards, game); + } + TargetCard target = new TargetCard(Constants.Zone.PICK, new FilterCard("card to put on the bottom of your library")); + target.setRequired(true); + while (cards2.size() > 0 && player.choose(Constants.Outcome.Detriment, cards2, target, game)) { + Card card = cards.get(target.getFirstTarget(), game); + if (card != null) { + cards2.remove(card); + card.moveToZone(Constants.Zone.LIBRARY, source.getId(), game, false); + } + target.clearChosen(); + } + } + return true; + } +} diff --git a/Mage.Sets/src/mage/sets/fifthedition/Pyroblast.java b/Mage.Sets/src/mage/sets/fifthedition/Pyroblast.java new file mode 100644 index 0000000000..2f9d81090e --- /dev/null +++ b/Mage.Sets/src/mage/sets/fifthedition/Pyroblast.java @@ -0,0 +1,54 @@ +/* + * 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; +import mage.Constants.Rarity; + +/** + * + * @author Plopman + */ +public class Pyroblast extends mage.sets.iceage.Pyroblast { + + public Pyroblast(UUID ownerId) { + super(ownerId); + this.cardNumber = 262; + this.expansionSetCode = "5ED"; + this.rarity = Rarity.UNCOMMON; + } + + public Pyroblast(final Pyroblast card) { + super(card); + } + + @Override + public Pyroblast copy() { + return new Pyroblast(this); + } +} diff --git a/Mage.Sets/src/mage/sets/iceage/Pyroblast.java b/Mage.Sets/src/mage/sets/iceage/Pyroblast.java new file mode 100644 index 0000000000..a4adf7dbbb --- /dev/null +++ b/Mage.Sets/src/mage/sets/iceage/Pyroblast.java @@ -0,0 +1,141 @@ +/* + * 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.iceage; + +import java.util.UUID; +import mage.Constants; +import mage.Constants.CardType; +import mage.Constants.Rarity; +import mage.ObjectColor; +import mage.abilities.Ability; +import mage.abilities.Mode; +import mage.abilities.effects.OneShotEffect; +import mage.cards.CardImpl; +import mage.filter.FilterPermanent; +import mage.filter.FilterSpell; +import mage.filter.predicate.mageobject.ColorPredicate; +import mage.game.Game; +import mage.game.permanent.Permanent; +import mage.target.TargetPermanent; +import mage.target.TargetSpell; + +/** + * + * @author Plopman + */ +public class Pyroblast extends CardImpl { + + public Pyroblast(UUID ownerId) { + super(ownerId, 213, "Pyroblast", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{R}"); + this.expansionSetCode = "ICE"; + + this.color.setRed(true); + + // Choose one - Counter target spell if it's blue; or destroy target permanent if it's blue. + this.getSpellAbility().addEffect(new CounterTargetEffect()); + this.getSpellAbility().addTarget(new TargetSpell()); + + Mode mode = new Mode(); + mode.getEffects().add(new DestroyTargetEffect()); + mode.getTargets().add(new TargetPermanent()); + + this.getSpellAbility().addMode(mode); + } + + public Pyroblast(final Pyroblast card) { + super(card); + } + + @Override + public Pyroblast copy() { + return new Pyroblast(this); + } +} + +class CounterTargetEffect extends OneShotEffect { + + public CounterTargetEffect() { + super(Constants.Outcome.Detriment); + } + + public CounterTargetEffect(final CounterTargetEffect effect) { + super(effect); + } + + @Override + public CounterTargetEffect copy() { + return new CounterTargetEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + if(game.getStack().getSpell(source.getFirstTarget()).getColor().isBlue()){ + game.getStack().counter(source.getFirstTarget(), source.getSourceId(), game); + } + return true; + } + + @Override + public String getText(Mode mode) { + return "Counter target spell if it's blue"; + } + +} + + +class DestroyTargetEffect extends OneShotEffect { + + + public DestroyTargetEffect() { + super(Constants.Outcome.DestroyPermanent); + } + + public DestroyTargetEffect(final DestroyTargetEffect effect) { + super(effect); + } + + @Override + public DestroyTargetEffect copy() { + return new DestroyTargetEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Permanent permanent = game.getPermanent(source.getTargets().getFirstTarget()); + if (permanent != null && permanent.getColor().isBlue()) { + permanent.destroy(source.getId(), game, false); + } + return true; + } + + @Override + public String getText(Mode mode) { + return "Destroy target permanent if it's blue"; + } + +} diff --git a/Mage.Sets/src/mage/sets/legions/GempalmIncinerator.java b/Mage.Sets/src/mage/sets/legions/GempalmIncinerator.java new file mode 100644 index 0000000000..c8b63c324f --- /dev/null +++ b/Mage.Sets/src/mage/sets/legions/GempalmIncinerator.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.legions; + +import java.util.UUID; +import mage.Constants.CardType; +import mage.Constants.Rarity; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.CycleTriggeredAbility; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.dynamicvalue.common.PermanentsOnBattlefieldCount; +import mage.abilities.effects.common.DamageTargetEffect; +import mage.abilities.keyword.CyclingAbility; +import mage.cards.CardImpl; +import mage.filter.FilterPermanent; +import mage.filter.predicate.mageobject.SubtypePredicate; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author Plopman + */ +public class GempalmIncinerator extends CardImpl { + + private static final FilterPermanent filter = new FilterPermanent("Goblins on the battlefield"); + static { + filter.add(new SubtypePredicate("Goblin")); + } + + public GempalmIncinerator(UUID ownerId) { + super(ownerId, 94, "Gempalm Incinerator", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{2}{R}"); + this.expansionSetCode = "LGN"; + this.subtype.add("Goblin"); + + this.color.setRed(true); + this.power = new MageInt(2); + this.toughness = new MageInt(1); + + // Cycling {1}{R} + this.addAbility(new CyclingAbility(new ManaCostsImpl("{1}{R}"))); + // When you cycle Gempalm Incinerator, you may have it deal X damage to target creature, where X is the number of Goblins on the battlefield. + Ability ability = new CycleTriggeredAbility(new DamageTargetEffect(new PermanentsOnBattlefieldCount(filter)),true); + ability.addTarget(new TargetCreaturePermanent()); + this.addAbility(ability); + } + + public GempalmIncinerator(final GempalmIncinerator card) { + super(card); + } + + @Override + public GempalmIncinerator copy() { + return new GempalmIncinerator(this); + } +} diff --git a/Mage.Sets/src/mage/sets/onslaught/GoblinPiledriver.java b/Mage.Sets/src/mage/sets/onslaught/GoblinPiledriver.java index a1db5805ae..2a6fb54fe5 100644 --- a/Mage.Sets/src/mage/sets/onslaught/GoblinPiledriver.java +++ b/Mage.Sets/src/mage/sets/onslaught/GoblinPiledriver.java @@ -74,7 +74,7 @@ public class GoblinPiledriver extends CardImpl { this.addAbility(new ProtectionAbility(filter1)); // Whenever Goblin Piledriver attacks, it gets +2/+0 until end of turn for each other attacking Goblin. PermanentsOnBattlefieldCount value = new PermanentsOnBattlefieldCount(filter2, 2); - this.addAbility(new AttacksTriggeredAbility(new BoostSourceEffect(value, new StaticValue(0), Duration.EndOfTurn), false)); + this.addAbility(new AttacksTriggeredAbility(new BoostSourceEffect(value, new StaticValue(0), Duration.EndOfTurn, true), false)); } public GoblinPiledriver(final GoblinPiledriver card) { diff --git a/Mage.Sets/src/mage/sets/onslaught/GoblinSharpshooter.java b/Mage.Sets/src/mage/sets/onslaught/GoblinSharpshooter.java index 02183db0e1..4661c467f9 100644 --- a/Mage.Sets/src/mage/sets/onslaught/GoblinSharpshooter.java +++ b/Mage.Sets/src/mage/sets/onslaught/GoblinSharpshooter.java @@ -61,7 +61,7 @@ public class GoblinSharpshooter extends CardImpl { // Goblin Sharpshooter doesn't untap during your untap step. this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new SkipUntapSourceEffect())); // Whenever a creature dies, untap Goblin Sharpshooter. - this.addAbility(new DiesCreatureTriggeredAbility(new UntapSourceEffect(), true)); + this.addAbility(new DiesCreatureTriggeredAbility(new UntapSourceEffect(), false)); // {tap}: Goblin Sharpshooter deals 1 damage to target creature or player. Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DamageTargetEffect(1), new TapSourceCost()); ability.addTarget(new TargetCreatureOrPlayer()); diff --git a/Mage.Sets/src/mage/sets/onslaught/SkirkProspector.java b/Mage.Sets/src/mage/sets/onslaught/SkirkProspector.java new file mode 100644 index 0000000000..68b4a4523c --- /dev/null +++ b/Mage.Sets/src/mage/sets/onslaught/SkirkProspector.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.onslaught; + +import java.util.UUID; +import mage.Constants; +import mage.Constants.CardType; +import mage.Constants.Rarity; +import mage.MageInt; +import mage.Mana; +import mage.abilities.costs.common.SacrificeSourceCost; +import mage.abilities.mana.SimpleManaAbility; +import mage.cards.CardImpl; + +/** + * + * @author Plopman + */ +public class SkirkProspector extends CardImpl { + + public SkirkProspector(UUID ownerId) { + super(ownerId, 230, "Skirk Prospector", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{R}"); + this.expansionSetCode = "ONS"; + this.subtype.add("Goblin"); + + this.color.setRed(true); + this.power = new MageInt(1); + this.toughness = new MageInt(1); + + // Sacrifice a Goblin: Add {R} to your mana pool. + this.addAbility(new SimpleManaAbility(Constants.Zone.BATTLEFIELD, Mana.RedMana, new SacrificeSourceCost())); + } + + public SkirkProspector(final SkirkProspector card) { + super(card); + } + + @Override + public SkirkProspector copy() { + return new SkirkProspector(this); + } +} diff --git a/Mage.Sets/src/mage/sets/onslaught/Sparksmith.java b/Mage.Sets/src/mage/sets/onslaught/Sparksmith.java new file mode 100644 index 0000000000..95f7f30f49 --- /dev/null +++ b/Mage.Sets/src/mage/sets/onslaught/Sparksmith.java @@ -0,0 +1,82 @@ +/* + * 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.onslaught; + +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.TapSourceCost; +import mage.abilities.dynamicvalue.common.PermanentsOnBattlefieldCount; +import mage.abilities.effects.common.DamageControllerEffect; +import mage.abilities.effects.common.DamageTargetEffect; +import mage.cards.CardImpl; +import mage.filter.FilterPermanent; +import mage.filter.predicate.mageobject.SubtypePredicate; +import mage.target.common.TargetCreatureOrPlayer; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author Plopman + */ +public class Sparksmith extends CardImpl { + + private static final FilterPermanent filter = new FilterPermanent("Goblins on the battlefield"); + static { + filter.add(new SubtypePredicate("Goblin")); + } + + public Sparksmith(UUID ownerId) { + super(ownerId, 235, "Sparksmith", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{1}{R}"); + this.expansionSetCode = "ONS"; + this.subtype.add("Goblin"); + + this.color.setRed(true); + this.power = new MageInt(1); + this.toughness = new MageInt(1); + + // {tap}: Sparksmith deals X damage to target creature and X damage to you, where X is the number of Goblins on the battlefield. + Ability ability = new SimpleActivatedAbility(Constants.Zone.BATTLEFIELD, new DamageTargetEffect(new PermanentsOnBattlefieldCount(filter)), new TapSourceCost()); + ability.addTarget(new TargetCreaturePermanent()); + ability.addEffect(new DamageControllerEffect(new PermanentsOnBattlefieldCount(filter))); + this.addAbility(ability); + } + + public Sparksmith(final Sparksmith card) { + super(card); + } + + @Override + public Sparksmith copy() { + return new Sparksmith(this); + } +} diff --git a/Mage.Sets/src/mage/sets/planarchaos/Stingscourger.java b/Mage.Sets/src/mage/sets/planarchaos/Stingscourger.java index 879cf4bf5d..99e7dc60ee 100644 --- a/Mage.Sets/src/mage/sets/planarchaos/Stingscourger.java +++ b/Mage.Sets/src/mage/sets/planarchaos/Stingscourger.java @@ -67,7 +67,9 @@ public class Stingscourger extends CardImpl { this.addAbility(new EchoAbility("{3}{R}")); // When Stingscourger enters the battlefield, return target creature an opponent controls to its owner's hand. Ability ability = new EntersBattlefieldTriggeredAbility(new ReturnToHandTargetEffect()); - ability.addTarget(new TargetCreaturePermanent(filter)); + TargetCreaturePermanent target = new TargetCreaturePermanent(filter); + target.setRequired(true); + ability.addTarget(target); this.addAbility(ability); } diff --git a/Mage.Sets/src/mage/sets/scourge/GoblinWarchief.java b/Mage.Sets/src/mage/sets/scourge/GoblinWarchief.java index 8463a959a2..e2ccfe733f 100644 --- a/Mage.Sets/src/mage/sets/scourge/GoblinWarchief.java +++ b/Mage.Sets/src/mage/sets/scourge/GoblinWarchief.java @@ -49,7 +49,7 @@ import mage.filter.predicate.mageobject.SubtypePredicate; public class GoblinWarchief extends CardImpl { private static final FilterCard filterSpells = new FilterCard("Goblin spells"); - private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("Goblin creatures"); + private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("Goblins"); static { filter.add(new SubtypePredicate("Goblin")); @@ -68,7 +68,7 @@ public class GoblinWarchief extends CardImpl { // Goblin spells you cast cost {1} less to cast. this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new SpellsCostReductionEffect(filterSpells, 1))); // Goblin creatures you control have haste. - this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityControlledEffect(HasteAbility.getInstance(), Duration.WhileOnBattlefield, filter, true))); + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityControlledEffect(HasteAbility.getInstance(), Duration.WhileOnBattlefield, filter, false))); } public GoblinWarchief(final GoblinWarchief card) { diff --git a/Mage/src/mage/abilities/effects/common/DamageControllerEffect.java b/Mage/src/mage/abilities/effects/common/DamageControllerEffect.java index d20400f73d..27a0c501e8 100644 --- a/Mage/src/mage/abilities/effects/common/DamageControllerEffect.java +++ b/Mage/src/mage/abilities/effects/common/DamageControllerEffect.java @@ -30,6 +30,9 @@ package mage.abilities.effects.common; import mage.Constants.Outcome; import mage.abilities.Ability; +import mage.abilities.Mode; +import mage.abilities.dynamicvalue.DynamicValue; +import mage.abilities.dynamicvalue.common.StaticValue; import mage.abilities.effects.OneShotEffect; import mage.game.Game; import mage.players.Player; @@ -40,7 +43,7 @@ import mage.players.Player; */ public class DamageControllerEffect extends OneShotEffect { - protected int amount; + protected DynamicValue amount; protected boolean preventable; public DamageControllerEffect(int amount) { @@ -49,13 +52,22 @@ public class DamageControllerEffect extends OneShotEffect 0) { + if (message.equals("1")) { + sb.append(" equal to the number of "); + } else { + if (message.startsWith("the") || message.startsWith("twice")) { + sb.append(" equal to "); + } else { + sb.append(" for each "); + } + } + sb.append(message); + } + if (!preventable) { sb.append(". The damage can't be prevented"); - staticText = sb.toString(); + } + return sb.toString(); } }