From b6f4f0082ae00bddf0557c06f1f174f3454e790f Mon Sep 17 00:00:00 2001 From: North Date: Sat, 11 Jun 2011 00:28:04 +0300 Subject: [PATCH] Added cards. Refactored some stuff regarding rule text. --- .../mage/sets/mirrodinbesieged/Bonehoard.java | 70 ++++++++++ .../mirrodinbesieged/PsychosisCrawler.java | 109 +++++++++++++++ .../sets/mirrodinbesieged/SignalPest.java | 129 ++++++++++++++++++ .../src/mage/sets/newphyrexia/SlagFiend.java | 68 +++++++++ .../mage/sets/riseoftheeldrazi/Vendetta.java | 109 +++++++++++++++ .../scarsofmirrodin/DarksteelJuggernaut.java | 4 +- .../src/mage/sets/worldwake/Smother.java | 70 ++++++++++ .../mage/sets/zendikar/GoblinBushwhacker.java | 72 ++++++++++ .../src/mage/sets/zendikar/KorDuelist.java | 96 +++++++++++++ .../mage/sets/zendikar/VinesOfVastwood.java | 2 +- Mage/src/mage/MageObject.java | 1 - Mage/src/mage/MageObjectImpl.java | 2 - .../common/CardsInAllGraveyardsCount.java | 62 +++++++++ .../CardsInControllerGraveyardCount.java | 2 +- .../common/CardsInControllerHandCount.java | 2 +- .../dynamicvalue/common/CountersCount.java | 2 +- .../common/PermanentsOnBattlefieldCount.java | 2 +- .../effects/common/CreateTokenEffect.java | 6 +- .../effects/common/DamageAllEffect.java | 9 +- .../effects/common/DamageTargetEffect.java | 6 +- .../effects/common/DiscardTargetEffect.java | 6 +- .../effects/common/DrawCardTargetEffect.java | 6 +- .../effects/common/GainLifeEffect.java | 9 +- .../effects/common/LoseLifeTargetEffect.java | 15 +- .../PutLibraryIntoGraveTargetEffect.java | 7 +- .../continious/BoostEquippedEffect.java | 20 ++- .../common/continious/BoostSourceEffect.java | 20 ++- .../common/continious/BoostTargetEffect.java | 19 ++- .../SetPowerToughnessSourceEffect.java | 34 ++--- 29 files changed, 907 insertions(+), 52 deletions(-) create mode 100644 Mage.Sets/src/mage/sets/mirrodinbesieged/Bonehoard.java create mode 100644 Mage.Sets/src/mage/sets/mirrodinbesieged/PsychosisCrawler.java create mode 100644 Mage.Sets/src/mage/sets/mirrodinbesieged/SignalPest.java create mode 100644 Mage.Sets/src/mage/sets/newphyrexia/SlagFiend.java create mode 100644 Mage.Sets/src/mage/sets/riseoftheeldrazi/Vendetta.java create mode 100644 Mage.Sets/src/mage/sets/worldwake/Smother.java create mode 100644 Mage.Sets/src/mage/sets/zendikar/GoblinBushwhacker.java create mode 100644 Mage.Sets/src/mage/sets/zendikar/KorDuelist.java create mode 100644 Mage/src/mage/abilities/dynamicvalue/common/CardsInAllGraveyardsCount.java diff --git a/Mage.Sets/src/mage/sets/mirrodinbesieged/Bonehoard.java b/Mage.Sets/src/mage/sets/mirrodinbesieged/Bonehoard.java new file mode 100644 index 00000000000..3613e328810 --- /dev/null +++ b/Mage.Sets/src/mage/sets/mirrodinbesieged/Bonehoard.java @@ -0,0 +1,70 @@ +/* + * 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.mirrodinbesieged; + +import java.util.UUID; +import mage.Constants.CardType; +import mage.Constants.Outcome; +import mage.Constants.Rarity; +import mage.Constants.Zone; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.costs.mana.GenericManaCost; +import mage.abilities.dynamicvalue.common.CardsInAllGraveyardsCount; +import mage.abilities.effects.common.continious.BoostEquippedEffect; +import mage.abilities.keyword.EquipAbility; +import mage.abilities.keyword.LivingWeaponAbility; +import mage.cards.CardImpl; +import mage.filter.common.FilterCreatureCard; + +/** + * + * @author North + */ +public class Bonehoard extends CardImpl { + + public Bonehoard(UUID ownerId) { + super(ownerId, 100, "Bonehoard", Rarity.RARE, new CardType[]{CardType.ARTIFACT}, "{4}"); + this.expansionSetCode = "MBS"; + this.subtype.add("Equipment"); + + + this.addAbility(new LivingWeaponAbility()); + CardsInAllGraveyardsCount value = new CardsInAllGraveyardsCount(new FilterCreatureCard()); + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostEquippedEffect(value, value))); + this.addAbility(new EquipAbility(Outcome.BoostCreature, new GenericManaCost(2))); + } + + public Bonehoard(final Bonehoard card) { + super(card); + } + + @Override + public Bonehoard copy() { + return new Bonehoard(this); + } +} diff --git a/Mage.Sets/src/mage/sets/mirrodinbesieged/PsychosisCrawler.java b/Mage.Sets/src/mage/sets/mirrodinbesieged/PsychosisCrawler.java new file mode 100644 index 00000000000..49c74fa75e1 --- /dev/null +++ b/Mage.Sets/src/mage/sets/mirrodinbesieged/PsychosisCrawler.java @@ -0,0 +1,109 @@ +/* + * 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.mirrodinbesieged; + +import java.util.Set; +import java.util.UUID; +import mage.Constants; +import mage.Constants.CardType; +import mage.Constants.Outcome; +import mage.Constants.Rarity; +import mage.Constants.Zone; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.DrawCardTriggeredAbility; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.dynamicvalue.common.CardsInControllerHandCount; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.continious.SetPowerToughnessSourceEffect; +import mage.cards.CardImpl; +import mage.game.Game; +import mage.players.Player; + +/** + * + * @author North + */ +public class PsychosisCrawler extends CardImpl { + + public PsychosisCrawler(UUID ownerId) { + super(ownerId, 126, "Psychosis Crawler", Rarity.RARE, new CardType[]{CardType.ARTIFACT, CardType.CREATURE}, "{5}"); + this.expansionSetCode = "MBS"; + this.subtype.add("Horror"); + + this.power = new MageInt(0); + this.toughness = new MageInt(0); + + this.addAbility(new SimpleStaticAbility(Zone.ALL, new SetPowerToughnessSourceEffect(new CardsInControllerHandCount(), Constants.Duration.EndOfGame))); + this.addAbility(new DrawCardTriggeredAbility(new LoseLifeOpponentsEffect(), false)); + } + + public PsychosisCrawler(final PsychosisCrawler card) { + super(card); + } + + @Override + public PsychosisCrawler copy() { + return new PsychosisCrawler(this); + } +} + +class LoseLifeOpponentsEffect extends OneShotEffect { + + public LoseLifeOpponentsEffect() { + super(Outcome.Damage); + } + + public LoseLifeOpponentsEffect(final LoseLifeOpponentsEffect effect) { + super(effect); + } + + @Override + public LoseLifeOpponentsEffect copy() { + return new LoseLifeOpponentsEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + boolean applied = false; + Set opponents = game.getOpponents(source.getControllerId()); + for (UUID opponentUUID : opponents) { + Player player = game.getPlayer(opponentUUID); + if (player != null) { + player.loseLife(1, game); + applied = true; + } + } + return applied; + } + + @Override + public String getText(Ability source) { + return "each opponent loses 1 life"; + } +} \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/mirrodinbesieged/SignalPest.java b/Mage.Sets/src/mage/sets/mirrodinbesieged/SignalPest.java new file mode 100644 index 00000000000..c635822fc9d --- /dev/null +++ b/Mage.Sets/src/mage/sets/mirrodinbesieged/SignalPest.java @@ -0,0 +1,129 @@ +/* + * 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.mirrodinbesieged; + +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.EvasionAbility; +import mage.abilities.effects.RestrictionEffect; +import mage.abilities.keyword.BattleCryAbility; +import mage.abilities.keyword.FlyingAbility; +import mage.abilities.keyword.ReachAbility; +import mage.cards.CardImpl; +import mage.game.Game; +import mage.game.permanent.Permanent; + +/** + * + * @author North + */ +public class SignalPest extends CardImpl { + + public SignalPest(UUID ownerId) { + super(ownerId, 131, "Signal Pest", Rarity.UNCOMMON, new CardType[]{CardType.ARTIFACT, CardType.CREATURE}, "{1}"); + this.expansionSetCode = "MBS"; + this.subtype.add("Pest"); + + this.power = new MageInt(0); + this.toughness = new MageInt(1); + + this.addAbility(new BattleCryAbility()); + this.addAbility(new SignalPestAbility()); + } + + public SignalPest(final SignalPest card) { + super(card); + } + + @Override + public SignalPest copy() { + return new SignalPest(this); + } +} + +class SignalPestAbility extends EvasionAbility { + + private static SignalPestAbility instance; + + public static SignalPestAbility getInstance() { + if (instance == null) { + instance = new SignalPestAbility(); + } + return instance; + } + + public SignalPestAbility() { + this.addEffect(new SignalPestEffect()); + } + + @Override + public String getRule() { + return "Signal Pest can't be blocked except by creatures with flying or reach"; + } + + @Override + public SignalPestAbility copy() { + return instance; + } +} + +class SignalPestEffect extends RestrictionEffect { + + public SignalPestEffect() { + super(Constants.Duration.WhileOnBattlefield); + } + + public SignalPestEffect(final SignalPestEffect effect) { + super(effect); + } + + @Override + public boolean applies(Permanent permanent, Ability source, Game game) { + if (permanent.getAbilities().containsKey(SignalPestAbility.getInstance().getId())) { + return true; + } + return false; + } + + @Override + public boolean canBlock(Permanent attacker, Permanent blocker, Game game) { + if (blocker.getAbilities().contains(FlyingAbility.getInstance()) || blocker.getAbilities().contains(ReachAbility.getInstance())) { + return true; + } + return false; + } + + @Override + public SignalPestEffect copy() { + return new SignalPestEffect(this); + } +} \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/newphyrexia/SlagFiend.java b/Mage.Sets/src/mage/sets/newphyrexia/SlagFiend.java new file mode 100644 index 00000000000..64d9ad30ed8 --- /dev/null +++ b/Mage.Sets/src/mage/sets/newphyrexia/SlagFiend.java @@ -0,0 +1,68 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.newphyrexia; + +import java.util.UUID; +import mage.Constants; +import mage.Constants.CardType; +import mage.Constants.Rarity; +import mage.Constants.Zone; +import mage.MageInt; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.dynamicvalue.common.CardsInAllGraveyardsCount; +import mage.abilities.effects.common.continious.SetPowerToughnessSourceEffect; +import mage.cards.CardImpl; +import mage.filter.common.FilterArtifactCard; + +/** + * + * @author North + */ +public class SlagFiend extends CardImpl { + + public SlagFiend(UUID ownerId) { + super(ownerId, 95, "Slag Fiend", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{R}"); + this.expansionSetCode = "NPH"; + this.subtype.add("Construct"); + + this.color.setRed(true); + this.power = new MageInt(0); + this.toughness = new MageInt(0); + + this.addAbility(new SimpleStaticAbility(Zone.ALL, new SetPowerToughnessSourceEffect(new CardsInAllGraveyardsCount(new FilterArtifactCard("artifacts")), Constants.Duration.EndOfGame))); + } + + public SlagFiend(final SlagFiend card) { + super(card); + } + + @Override + public SlagFiend copy() { + return new SlagFiend(this); + } +} \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/riseoftheeldrazi/Vendetta.java b/Mage.Sets/src/mage/sets/riseoftheeldrazi/Vendetta.java new file mode 100644 index 00000000000..2f61b29da03 --- /dev/null +++ b/Mage.Sets/src/mage/sets/riseoftheeldrazi/Vendetta.java @@ -0,0 +1,109 @@ +/* + * 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.CardType; +import mage.Constants.Outcome; +import mage.Constants.Rarity; +import mage.ObjectColor; +import mage.abilities.Ability; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.DestroyNoRegenTargetEffect; +import mage.cards.CardImpl; +import mage.filter.common.FilterCreaturePermanent; +import mage.game.Game; +import mage.game.permanent.Permanent; +import mage.players.Player; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author North + */ +public class Vendetta extends CardImpl { + + private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("nonblack creature"); + + static { + filter.setColor(ObjectColor.BLACK); + filter.setNotColor(true); + } + + public Vendetta(UUID ownerId) { + super(ownerId, 130, "Vendetta", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{B}"); + this.expansionSetCode = "ROE"; + + this.color.setBlack(true); + + this.getSpellAbility().addTarget(new TargetCreaturePermanent(filter)); + this.getSpellAbility().addEffect(new DestroyNoRegenTargetEffect()); + this.getSpellAbility().addEffect(new VendettaEffect()); + } + + public Vendetta(final Vendetta card) { + super(card); + } + + @Override + public Vendetta copy() { + return new Vendetta(this); + } +} + +class VendettaEffect extends OneShotEffect { + + public VendettaEffect() { + super(Outcome.Damage); + } + + public VendettaEffect(final VendettaEffect effect) { + super(effect); + } + + @Override + public VendettaEffect copy() { + return new VendettaEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Player player = game.getPlayer(source.getControllerId()); + Permanent target = game.getPermanent(source.getFirstTarget()); + if (player != null && target != null) { + player.loseLife(target.getToughness().getValue(), game); + return true; + } + return false; + } + + @Override + public String getText(Ability source) { + return "You lose life equal to that creature's toughness"; + } +} \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/scarsofmirrodin/DarksteelJuggernaut.java b/Mage.Sets/src/mage/sets/scarsofmirrodin/DarksteelJuggernaut.java index 12cd85a7bc7..d7c1d6f4003 100644 --- a/Mage.Sets/src/mage/sets/scarsofmirrodin/DarksteelJuggernaut.java +++ b/Mage.Sets/src/mage/sets/scarsofmirrodin/DarksteelJuggernaut.java @@ -61,9 +61,7 @@ public class DarksteelJuggernaut extends CardImpl { this.power = new MageInt(0); this.toughness = new MageInt(0); - PermanentsOnBattlefieldCount value = new PermanentsOnBattlefieldCount(filter); - SetPowerToughnessSourceEffect effect = new SetPowerToughnessSourceEffect(value, value, Constants.Duration.EndOfGame); - effect.setStaticText("Darksteel Juggernaut's power and toughness are each equal to the number of artifacts you control"); + SetPowerToughnessSourceEffect effect = new SetPowerToughnessSourceEffect(new PermanentsOnBattlefieldCount(filter), Constants.Duration.EndOfGame); this.addAbility(new SimpleStaticAbility(Constants.Zone.ALL, effect)); this.addAbility(IndestructibleAbility.getInstance()); this.addAbility(new AttacksEachTurnStaticAbility()); diff --git a/Mage.Sets/src/mage/sets/worldwake/Smother.java b/Mage.Sets/src/mage/sets/worldwake/Smother.java new file mode 100644 index 00000000000..3008109c8aa --- /dev/null +++ b/Mage.Sets/src/mage/sets/worldwake/Smother.java @@ -0,0 +1,70 @@ +/* + * 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.worldwake; + +import java.util.UUID; +import mage.Constants.CardType; +import mage.Constants.Rarity; +import mage.abilities.effects.common.DestroyNoRegenTargetEffect; +import mage.cards.CardImpl; +import mage.filter.Filter.ComparisonType; +import mage.filter.common.FilterCreaturePermanent; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author North + */ +public class Smother extends CardImpl { + + private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("creature with converted mana cost 3 or less"); + + static { + filter.setConvertedManaCost(4); + filter.setConvertedManaCostComparison(ComparisonType.LessThan); + } + + public Smother(UUID ownerId) { + super(ownerId, 68, "Smother", Rarity.UNCOMMON, new CardType[]{CardType.INSTANT}, "{1}{B}"); + this.expansionSetCode = "WWK"; + + this.color.setBlack(true); + + this.getSpellAbility().addTarget(new TargetCreaturePermanent(filter)); + this.getSpellAbility().addEffect(new DestroyNoRegenTargetEffect()); + } + + public Smother(final Smother card) { + super(card); + } + + @Override + public Smother copy() { + return new Smother(this); + } +} diff --git a/Mage.Sets/src/mage/sets/zendikar/GoblinBushwhacker.java b/Mage.Sets/src/mage/sets/zendikar/GoblinBushwhacker.java new file mode 100644 index 00000000000..31e904f3ba6 --- /dev/null +++ b/Mage.Sets/src/mage/sets/zendikar/GoblinBushwhacker.java @@ -0,0 +1,72 @@ +/* + * 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.zendikar; + +import java.util.UUID; +import mage.Constants.CardType; +import mage.Constants.Duration; +import mage.Constants.Rarity; +import mage.MageInt; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.continious.BoostControlledEffect; +import mage.abilities.effects.common.continious.GainAbilityControlledEffect; +import mage.abilities.keyword.HasteAbility; +import mage.abilities.keyword.KickerAbility; +import mage.cards.CardImpl; + +/** + * + * @author North + */ +public class GoblinBushwhacker extends CardImpl { + + public GoblinBushwhacker(UUID ownerId) { + super(ownerId, 125, "Goblin Bushwhacker", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{R}"); + this.expansionSetCode = "ZEN"; + this.subtype.add("Goblin"); + this.subtype.add("Warrior"); + + this.color.setRed(true); + this.power = new MageInt(1); + this.toughness = new MageInt(1); + + KickerAbility ability = new KickerAbility(new BoostControlledEffect(1, 0, Duration.EndOfTurn), false); + ability.addEffect(new GainAbilityControlledEffect(HasteAbility.getInstance(), Duration.EndOfTurn)); + ability.addCost(new ManaCostsImpl("{R}")); + this.addAbility(ability); + } + + public GoblinBushwhacker(final GoblinBushwhacker card) { + super(card); + } + + @Override + public GoblinBushwhacker copy() { + return new GoblinBushwhacker(this); + } +} diff --git a/Mage.Sets/src/mage/sets/zendikar/KorDuelist.java b/Mage.Sets/src/mage/sets/zendikar/KorDuelist.java new file mode 100644 index 00000000000..9466fe4c1fb --- /dev/null +++ b/Mage.Sets/src/mage/sets/zendikar/KorDuelist.java @@ -0,0 +1,96 @@ +/* + * 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.zendikar; + +import java.util.List; +import java.util.UUID; +import mage.Constants.CardType; +import mage.Constants.Duration; +import mage.Constants.Rarity; +import mage.Constants.Zone; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.condition.Condition; +import mage.abilities.decorator.ConditionalContinousEffect; +import mage.abilities.effects.common.continious.GainAbilitySourceEffect; +import mage.abilities.keyword.DoubleStrikeAbility; +import mage.cards.CardImpl; +import mage.game.Game; +import mage.game.permanent.Permanent; + +/** + * + * @author North + */ +public class KorDuelist extends CardImpl { + + private static final String ruleText = "As long as Kor Duelist is equipped, it has double strike"; + + public KorDuelist(UUID ownerId) { + super(ownerId, 19, "Kor Duelist", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{W}"); + this.expansionSetCode = "ZEN"; + this.subtype.add("Kor"); + this.subtype.add("Soldier"); + + this.color.setWhite(true); + this.power = new MageInt(1); + this.toughness = new MageInt(1); + GainAbilitySourceEffect effect = new GainAbilitySourceEffect(DoubleStrikeAbility.getInstance(), Duration.WhileOnBattlefield); + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new ConditionalContinousEffect(effect, new SourceIsEquiped(), ruleText))); + } + + public KorDuelist(final KorDuelist card) { + super(card); + } + + @Override + public KorDuelist copy() { + return new KorDuelist(this); + } +} + +class SourceIsEquiped implements Condition { + + @Override + public boolean apply(Game game, Ability source) { + Permanent permanent = game.getPermanent(source.getSourceId()); + if (permanent != null) { + List attachments = permanent.getAttachments(); + for (UUID attachmentUUID : attachments) { + Permanent attachment = game.getPermanent(attachmentUUID); + if (attachment != null) { + if (attachment.getSubtype().contains("Equipment")) { + return true; + } + } + } + } + return false; + } +} diff --git a/Mage.Sets/src/mage/sets/zendikar/VinesOfVastwood.java b/Mage.Sets/src/mage/sets/zendikar/VinesOfVastwood.java index 39bac999938..f4b967a8e04 100644 --- a/Mage.Sets/src/mage/sets/zendikar/VinesOfVastwood.java +++ b/Mage.Sets/src/mage/sets/zendikar/VinesOfVastwood.java @@ -53,7 +53,7 @@ import mage.target.common.TargetCreaturePermanent; */ public class VinesOfVastwood extends CardImpl { - private static FilterStackObject filter = new FilterStackObject("spells or abilities your opponents control"); + private static final FilterStackObject filter = new FilterStackObject("spells or abilities your opponents control"); static { filter.setTargetController(TargetController.OPPONENT); diff --git a/Mage/src/mage/MageObject.java b/Mage/src/mage/MageObject.java index 3f25755ec05..07ac7eda5bf 100644 --- a/Mage/src/mage/MageObject.java +++ b/Mage/src/mage/MageObject.java @@ -3,7 +3,6 @@ package mage; import java.io.Serializable; import java.util.List; import mage.Constants.CardType; -import mage.Constants.Zone; import mage.abilities.Abilities; import mage.abilities.Ability; import mage.abilities.costs.mana.ManaCost; diff --git a/Mage/src/mage/MageObjectImpl.java b/Mage/src/mage/MageObjectImpl.java index eb81d2736fc..749bfccf44f 100644 --- a/Mage/src/mage/MageObjectImpl.java +++ b/Mage/src/mage/MageObjectImpl.java @@ -39,8 +39,6 @@ import mage.abilities.Ability; import mage.abilities.costs.mana.ManaCost; import mage.abilities.costs.mana.ManaCosts; import mage.abilities.costs.mana.ManaCostsImpl; -import mage.counters.Counter; -import mage.counters.common.LoyaltyCounter; import mage.game.Game; public abstract class MageObjectImpl> implements MageObject { diff --git a/Mage/src/mage/abilities/dynamicvalue/common/CardsInAllGraveyardsCount.java b/Mage/src/mage/abilities/dynamicvalue/common/CardsInAllGraveyardsCount.java new file mode 100644 index 00000000000..d44d065af47 --- /dev/null +++ b/Mage/src/mage/abilities/dynamicvalue/common/CardsInAllGraveyardsCount.java @@ -0,0 +1,62 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package mage.abilities.dynamicvalue.common; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.dynamicvalue.DynamicValue; +import mage.filter.FilterCard; +import mage.game.Game; +import mage.players.Player; +import mage.players.PlayerList; + +/** + * + * @author North + */ +public class CardsInAllGraveyardsCount implements DynamicValue { + + private FilterCard filter; + + public CardsInAllGraveyardsCount() { + this(new FilterCard()); + } + + public CardsInAllGraveyardsCount(FilterCard filter) { + this.filter = filter; + } + + private CardsInAllGraveyardsCount(CardsInAllGraveyardsCount dynamicValue) { + this.filter = dynamicValue.filter; + } + + @Override + public int calculate(Game game, Ability sourceAbility) { + int amount = 0; + PlayerList playerList = game.getPlayerList(); + for (UUID playerUUID : playerList) { + Player player = game.getPlayer(playerUUID); + if (player != null) { + amount += player.getGraveyard().count(filter, game); + } + } + return amount; + } + + @Override + public DynamicValue clone() { + return new CardsInAllGraveyardsCount(this); + } + + @Override + public String toString() { + return "1"; + } + + @Override + public String getMessage() { + return filter.getMessage() + " in all graveyards"; + } +} diff --git a/Mage/src/mage/abilities/dynamicvalue/common/CardsInControllerGraveyardCount.java b/Mage/src/mage/abilities/dynamicvalue/common/CardsInControllerGraveyardCount.java index b99a14e3fce..ff147c5985b 100644 --- a/Mage/src/mage/abilities/dynamicvalue/common/CardsInControllerGraveyardCount.java +++ b/Mage/src/mage/abilities/dynamicvalue/common/CardsInControllerGraveyardCount.java @@ -54,6 +54,6 @@ public class CardsInControllerGraveyardCount implements DynamicValue { @Override public String getMessage() { - return " for each " + filter.getMessage() + " in your graveyard"; + return filter.getMessage() + " in your graveyard"; } } diff --git a/Mage/src/mage/abilities/dynamicvalue/common/CardsInControllerHandCount.java b/Mage/src/mage/abilities/dynamicvalue/common/CardsInControllerHandCount.java index 83d015ae72a..4132387353c 100644 --- a/Mage/src/mage/abilities/dynamicvalue/common/CardsInControllerHandCount.java +++ b/Mage/src/mage/abilities/dynamicvalue/common/CardsInControllerHandCount.java @@ -22,6 +22,6 @@ public class CardsInControllerHandCount implements DynamicValue { @Override public String getMessage() { - return ""; + return "card in your hand"; } } diff --git a/Mage/src/mage/abilities/dynamicvalue/common/CountersCount.java b/Mage/src/mage/abilities/dynamicvalue/common/CountersCount.java index 6d0a817d6de..ec69a94e0ec 100644 --- a/Mage/src/mage/abilities/dynamicvalue/common/CountersCount.java +++ b/Mage/src/mage/abilities/dynamicvalue/common/CountersCount.java @@ -38,6 +38,6 @@ public class CountersCount implements DynamicValue { @Override public String getMessage() { - return ""; + return counter.getName() + " on {this}"; } } diff --git a/Mage/src/mage/abilities/dynamicvalue/common/PermanentsOnBattlefieldCount.java b/Mage/src/mage/abilities/dynamicvalue/common/PermanentsOnBattlefieldCount.java index 68fbf2559ed..63d9beaec79 100644 --- a/Mage/src/mage/abilities/dynamicvalue/common/PermanentsOnBattlefieldCount.java +++ b/Mage/src/mage/abilities/dynamicvalue/common/PermanentsOnBattlefieldCount.java @@ -49,6 +49,6 @@ public class PermanentsOnBattlefieldCount implements DynamicValue { @Override public String getMessage() { - return " for each " + filter.getMessage(); + return filter.getMessage(); } } diff --git a/Mage/src/mage/abilities/effects/common/CreateTokenEffect.java b/Mage/src/mage/abilities/effects/common/CreateTokenEffect.java index b18aee1fc33..917e1698419 100644 --- a/Mage/src/mage/abilities/effects/common/CreateTokenEffect.java +++ b/Mage/src/mage/abilities/effects/common/CreateTokenEffect.java @@ -90,7 +90,11 @@ public class CreateTokenEffect extends OneShotEffect { sb.append("put ").append(amount); } sb.append(" ").append(token.getDescription()).append(" onto the battlefield"); - sb.append(amount.getMessage()); + String message = amount.getMessage(); + if (message.length() > 0) { + sb.append(" for each "); + } + sb.append(message); return sb.toString(); } diff --git a/Mage/src/mage/abilities/effects/common/DamageAllEffect.java b/Mage/src/mage/abilities/effects/common/DamageAllEffect.java index 7a608eae8d1..df5c0892dfb 100644 --- a/Mage/src/mage/abilities/effects/common/DamageAllEffect.java +++ b/Mage/src/mage/abilities/effects/common/DamageAllEffect.java @@ -76,7 +76,14 @@ public class DamageAllEffect extends OneShotEffect { @Override public String getText(Ability source) { - return "{source} deals " + amount.toString() + " damage to each " + filter.getMessage() + amount.getMessage(); + StringBuilder sb = new StringBuilder(); + sb.append("{source} deals ").append(amount.toString()).append(" damage to each ").append(filter.getMessage()); + String message = amount.getMessage(); + if (message.length() > 0) { + sb.append(" for each "); + } + sb.append(message); + return sb.toString(); } } diff --git a/Mage/src/mage/abilities/effects/common/DamageTargetEffect.java b/Mage/src/mage/abilities/effects/common/DamageTargetEffect.java index 1c8c3f2a01e..8cc0a315059 100644 --- a/Mage/src/mage/abilities/effects/common/DamageTargetEffect.java +++ b/Mage/src/mage/abilities/effects/common/DamageTargetEffect.java @@ -103,7 +103,11 @@ public class DamageTargetEffect extends OneShotEffect { StringBuilder sb = new StringBuilder(); sb.append("{source} deals ").append(amount).append(" damage to target "); sb.append(source.getTargets().get(0).getTargetName()); - sb.append(amount.getMessage()); + String message = amount.getMessage(); + if (message.length() > 0) { + sb.append(" for each "); + } + sb.append(message); if (!preventable) sb.append(". The damage can't be prevented"); return sb.toString(); diff --git a/Mage/src/mage/abilities/effects/common/DiscardTargetEffect.java b/Mage/src/mage/abilities/effects/common/DiscardTargetEffect.java index 95f317fa229..abb130dac5d 100644 --- a/Mage/src/mage/abilities/effects/common/DiscardTargetEffect.java +++ b/Mage/src/mage/abilities/effects/common/DiscardTargetEffect.java @@ -83,7 +83,11 @@ public class DiscardTargetEffect extends OneShotEffect { } catch (Exception e) { sb.append("s"); } - sb.append(amount.getMessage()); + String message = amount.getMessage(); + if (message.length() > 0) { + sb.append(" for each "); + } + sb.append(message); return sb.toString(); } } diff --git a/Mage/src/mage/abilities/effects/common/DrawCardTargetEffect.java b/Mage/src/mage/abilities/effects/common/DrawCardTargetEffect.java index f147e786853..49466084e94 100644 --- a/Mage/src/mage/abilities/effects/common/DrawCardTargetEffect.java +++ b/Mage/src/mage/abilities/effects/common/DrawCardTargetEffect.java @@ -84,7 +84,11 @@ public class DrawCardTargetEffect extends OneShotEffect { } catch (Exception e) { sb.append("s"); } - sb.append(amount.getMessage()); + String message = amount.getMessage(); + if (message.length() > 0) { + sb.append(" for each "); + } + sb.append(message); return sb.toString(); } diff --git a/Mage/src/mage/abilities/effects/common/GainLifeEffect.java b/Mage/src/mage/abilities/effects/common/GainLifeEffect.java index 5450f30d493..9b1af60afa7 100644 --- a/Mage/src/mage/abilities/effects/common/GainLifeEffect.java +++ b/Mage/src/mage/abilities/effects/common/GainLifeEffect.java @@ -74,7 +74,14 @@ public class GainLifeEffect extends OneShotEffect { @Override public String getDynamicText(Ability source) { - return "you gain " + life.toString() + " life" + life.getMessage(); + StringBuilder sb = new StringBuilder(); + sb.append("you gain ").append(life.toString()).append(" life"); + String message = life.getMessage(); + if (message.length() > 0) { + sb.append(" for each "); + } + sb.append(message); + return sb.toString(); } } diff --git a/Mage/src/mage/abilities/effects/common/LoseLifeTargetEffect.java b/Mage/src/mage/abilities/effects/common/LoseLifeTargetEffect.java index ac8f191f8de..a0f146091b1 100644 --- a/Mage/src/mage/abilities/effects/common/LoseLifeTargetEffect.java +++ b/Mage/src/mage/abilities/effects/common/LoseLifeTargetEffect.java @@ -75,14 +75,19 @@ public class LoseLifeTargetEffect extends OneShotEffect { @Override public String getText(Ability source) { - StringBuffer result = new StringBuffer(); + StringBuilder sb = new StringBuilder(); if (source.getTargets().size() > 0) { - result.append("Target " + source.getTargets().get(0).getTargetName()); + sb.append("Target ").append(source.getTargets().get(0).getTargetName()); } else { - result.append("that player"); + sb.append("that player"); } - result.append(" loses ").append(amount).append(" life").append(amount.getMessage()); - return result.toString(); + sb.append(" loses ").append(amount).append(" life"); + String message = amount.getMessage(); + if (message.length() > 0) { + sb.append(" for each "); + } + sb.append(message); + return sb.toString(); } diff --git a/Mage/src/mage/abilities/effects/common/PutLibraryIntoGraveTargetEffect.java b/Mage/src/mage/abilities/effects/common/PutLibraryIntoGraveTargetEffect.java index eb413337181..18dd1bb495a 100644 --- a/Mage/src/mage/abilities/effects/common/PutLibraryIntoGraveTargetEffect.java +++ b/Mage/src/mage/abilities/effects/common/PutLibraryIntoGraveTargetEffect.java @@ -91,7 +91,12 @@ public class PutLibraryIntoGraveTargetEffect extends OneShotEffect 0) { + sb.append(" for each "); + } + sb.append(message); return sb.toString(); } diff --git a/Mage/src/mage/abilities/effects/common/continious/BoostEquippedEffect.java b/Mage/src/mage/abilities/effects/common/continious/BoostEquippedEffect.java index 7ea1dbc29f3..b459652cac9 100644 --- a/Mage/src/mage/abilities/effects/common/continious/BoostEquippedEffect.java +++ b/Mage/src/mage/abilities/effects/common/continious/BoostEquippedEffect.java @@ -93,10 +93,26 @@ public class BoostEquippedEffect extends ContinuousEffectImpl 0) { + sb.append(" for each "); + } + sb.append(message); return sb.toString(); } diff --git a/Mage/src/mage/abilities/effects/common/continious/BoostSourceEffect.java b/Mage/src/mage/abilities/effects/common/continious/BoostSourceEffect.java index a674c34ddd7..d308296bd11 100644 --- a/Mage/src/mage/abilities/effects/common/continious/BoostSourceEffect.java +++ b/Mage/src/mage/abilities/effects/common/continious/BoostSourceEffect.java @@ -82,10 +82,26 @@ public class BoostSourceEffect extends ContinuousEffectImpl { @Override public String getDynamicText(Ability source) { StringBuilder sb = new StringBuilder(); - sb.append("{this} gets ").append(power).append("/").append(toughness); + sb.append("{this} gets "); + String p = power.toString(); + if(!p.startsWith("-")) + sb.append("+"); + sb.append(p).append("/"); + String t = toughness.toString(); + if(!t.startsWith("-")){ + if(p.startsWith("-")) + sb.append("-"); + else + sb.append("+"); + } + sb.append(t); if (duration != Duration.WhileOnBattlefield) sb.append(" ").append(duration.toString()); - sb.append(power.getMessage()); + String message = power.getMessage(); + if (message.length() > 0) { + sb.append(" for each "); + } + sb.append(message); return sb.toString(); } diff --git a/Mage/src/mage/abilities/effects/common/continious/BoostTargetEffect.java b/Mage/src/mage/abilities/effects/common/continious/BoostTargetEffect.java index 7aed6c0b6f9..f82d0d61b36 100644 --- a/Mage/src/mage/abilities/effects/common/continious/BoostTargetEffect.java +++ b/Mage/src/mage/abilities/effects/common/continious/BoostTargetEffect.java @@ -83,10 +83,25 @@ public class BoostTargetEffect extends ContinuousEffectImpl { public String getText(Ability source) { StringBuilder sb = new StringBuilder(); sb.append("Target ").append(source.getTargets().get(0).getTargetName()).append(" gets "); - sb.append(power).append("/").append(toughness); + String p = power.toString(); + if(!p.startsWith("-")) + sb.append("+"); + sb.append(p).append("/"); + String t = toughness.toString(); + if(!t.startsWith("-")){ + if(p.startsWith("-")) + sb.append("-"); + else + sb.append("+"); + } + sb.append(t); if (duration != Duration.WhileOnBattlefield) sb.append(" ").append(duration.toString()); - sb.append(power.getMessage()); + String message = power.getMessage(); + if (message.length() > 0) { + sb.append(" for each "); + } + sb.append(message); return sb.toString(); } } diff --git a/Mage/src/mage/abilities/effects/common/continious/SetPowerToughnessSourceEffect.java b/Mage/src/mage/abilities/effects/common/continious/SetPowerToughnessSourceEffect.java index 3c1209be554..e8ee671130e 100644 --- a/Mage/src/mage/abilities/effects/common/continious/SetPowerToughnessSourceEffect.java +++ b/Mage/src/mage/abilities/effects/common/continious/SetPowerToughnessSourceEffect.java @@ -34,34 +34,26 @@ import mage.Constants.Outcome; import mage.Constants.SubLayer; import mage.abilities.Ability; import mage.abilities.dynamicvalue.DynamicValue; -import mage.abilities.dynamicvalue.common.StaticValue; import mage.abilities.effects.ContinuousEffectImpl; import mage.game.Game; import mage.game.permanent.Permanent; /** * - * @author BetaSteward_at_googlemail.com + * @author BetaSteward_at_googlemail.com, North */ public class SetPowerToughnessSourceEffect extends ContinuousEffectImpl { - private DynamicValue power; - private DynamicValue toughness; + private DynamicValue amount; - public SetPowerToughnessSourceEffect(DynamicValue power, DynamicValue toughness, Duration duration) { + public SetPowerToughnessSourceEffect(DynamicValue amount, Duration duration) { super(duration, Layer.PTChangingEffects_7, SubLayer.SetPT_7b, Outcome.BoostCreature); - this.power = power; - this.toughness = toughness; + this.amount = amount; } - public SetPowerToughnessSourceEffect(int power, int toughness, Duration duration) { - this(new StaticValue(power), new StaticValue(toughness), duration); - } - public SetPowerToughnessSourceEffect(final SetPowerToughnessSourceEffect effect) { super(effect); - this.power = effect.power; - this.toughness = effect.toughness; + this.amount = effect.amount; } @Override @@ -73,8 +65,9 @@ public class SetPowerToughnessSourceEffect extends ContinuousEffectImpl