From 58bf7cff3f2b6abd183a6377f7f1033c5a24df22 Mon Sep 17 00:00:00 2001 From: LevelX2 Date: Mon, 17 Jun 2013 07:44:21 +0200 Subject: [PATCH 01/10] [MMA] Added two cards. --- .../sets/modernmasters/HammerheimDeadeye.java | 54 ++++++++++++ .../mage/sets/modernmasters/SuddenShock.java | 52 ++++++++++++ .../sets/planarchaos/HammerheimDeadeye.java | 84 +++++++++++++++++++ .../src/mage/sets/timespiral/SuddenShock.java | 65 ++++++++++++++ 4 files changed, 255 insertions(+) create mode 100644 Mage.Sets/src/mage/sets/modernmasters/HammerheimDeadeye.java create mode 100644 Mage.Sets/src/mage/sets/modernmasters/SuddenShock.java create mode 100644 Mage.Sets/src/mage/sets/planarchaos/HammerheimDeadeye.java create mode 100644 Mage.Sets/src/mage/sets/timespiral/SuddenShock.java diff --git a/Mage.Sets/src/mage/sets/modernmasters/HammerheimDeadeye.java b/Mage.Sets/src/mage/sets/modernmasters/HammerheimDeadeye.java new file mode 100644 index 00000000000..0191efbba38 --- /dev/null +++ b/Mage.Sets/src/mage/sets/modernmasters/HammerheimDeadeye.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.modernmasters; + +import java.util.UUID; +import mage.constants.Rarity; + +/** + * + * @author LevelX2 + */ +public class HammerheimDeadeye extends mage.sets.planarchaos.HammerheimDeadeye { + + public HammerheimDeadeye(UUID ownerId) { + super(ownerId); + this.cardNumber = 119; + this.expansionSetCode = "MMA"; + this.rarity = Rarity.COMMON; + } + + public HammerheimDeadeye(final HammerheimDeadeye card) { + super(card); + } + + @Override + public HammerheimDeadeye copy() { + return new HammerheimDeadeye(this); + } +} diff --git a/Mage.Sets/src/mage/sets/modernmasters/SuddenShock.java b/Mage.Sets/src/mage/sets/modernmasters/SuddenShock.java new file mode 100644 index 00000000000..98e2c948213 --- /dev/null +++ b/Mage.Sets/src/mage/sets/modernmasters/SuddenShock.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.modernmasters; + +import java.util.UUID; + +/** + * + * @author LevelX2 + */ +public class SuddenShock extends mage.sets.timespiral.SuddenShock { + + public SuddenShock(UUID ownerId) { + super(ownerId); + this.cardNumber = 133; + this.expansionSetCode = "MMA"; + } + + public SuddenShock(final SuddenShock card) { + super(card); + } + + @Override + public SuddenShock copy() { + return new SuddenShock(this); + } +} diff --git a/Mage.Sets/src/mage/sets/planarchaos/HammerheimDeadeye.java b/Mage.Sets/src/mage/sets/planarchaos/HammerheimDeadeye.java new file mode 100644 index 00000000000..986f064450b --- /dev/null +++ b/Mage.Sets/src/mage/sets/planarchaos/HammerheimDeadeye.java @@ -0,0 +1,84 @@ +/* + * 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.planarchaos; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.EntersBattlefieldTriggeredAbility; +import mage.abilities.effects.common.DestroyTargetEffect; +import mage.abilities.keyword.EchoAbility; +import mage.abilities.keyword.FlyingAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.mageobject.AbilityPredicate; +import mage.target.Target; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author LevelX2 + */ +public class HammerheimDeadeye extends CardImpl { + + private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("creature with flying"); + static { + filter.add(new AbilityPredicate(FlyingAbility.class)); + } + + public HammerheimDeadeye(UUID ownerId) { + super(ownerId, 101, "Hammerheim Deadeye", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{3}{R}"); + this.expansionSetCode = "PLC"; + this.subtype.add("Giant"); + this.subtype.add("Warrior"); + + this.color.setRed(true); + this.power = new MageInt(3); + this.toughness = new MageInt(3); + + // Echo {5}{R} + this.addAbility(new EchoAbility("{5}{R}")); + // When Hammerheim Deadeye enters the battlefield, destroy target creature with flying. + Ability ability = new EntersBattlefieldTriggeredAbility(new DestroyTargetEffect()); + Target target = new TargetCreaturePermanent(filter); + target.setRequired(true); + ability.addTarget(target); + this.addAbility(ability); + } + + public HammerheimDeadeye(final HammerheimDeadeye card) { + super(card); + } + + @Override + public HammerheimDeadeye copy() { + return new HammerheimDeadeye(this); + } +} diff --git a/Mage.Sets/src/mage/sets/timespiral/SuddenShock.java b/Mage.Sets/src/mage/sets/timespiral/SuddenShock.java new file mode 100644 index 00000000000..899a2c50527 --- /dev/null +++ b/Mage.Sets/src/mage/sets/timespiral/SuddenShock.java @@ -0,0 +1,65 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.timespiral; + +import java.util.UUID; +import mage.abilities.effects.common.DamageTargetEffect; +import mage.abilities.keyword.SplitSecondAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.target.common.TargetCreatureOrPlayer; + +/** + * + * @author LevelX2 + */ +public class SuddenShock extends CardImpl { + + public SuddenShock(UUID ownerId) { + super(ownerId, 179, "Sudden Shock", Rarity.UNCOMMON, new CardType[]{CardType.INSTANT}, "{1}{R}"); + this.expansionSetCode = "TSP"; + + this.color.setRed(true); + + // Split second + this.addAbility(SplitSecondAbility.getInstance()); + // Sudden Shock deals 2 damage to target creature or player. + this.getSpellAbility().addEffect(new DamageTargetEffect(2, true)); + this.getSpellAbility().addTarget(new TargetCreatureOrPlayer(true)); + } + + public SuddenShock(final SuddenShock card) { + super(card); + } + + @Override + public SuddenShock copy() { + return new SuddenShock(this); + } +} From 57b517282ddc274f77e36ae0cc524b5955e5701a Mon Sep 17 00:00:00 2001 From: LevelX2 Date: Mon, 17 Jun 2013 07:44:44 +0200 Subject: [PATCH 02/10] Added missing implementation of Take Possession. --- .../sets/modernmasters/TakePossession.java | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/Mage.Sets/src/mage/sets/modernmasters/TakePossession.java b/Mage.Sets/src/mage/sets/modernmasters/TakePossession.java index 0e5b4650853..6dc266b9ca3 100644 --- a/Mage.Sets/src/mage/sets/modernmasters/TakePossession.java +++ b/Mage.Sets/src/mage/sets/modernmasters/TakePossession.java @@ -28,9 +28,19 @@ package mage.sets.modernmasters; import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.effects.Effect; +import mage.abilities.effects.common.AttachEffect; +import mage.abilities.effects.common.continious.ControlEnchantedEffect; +import mage.abilities.keyword.EnchantAbility; +import mage.abilities.keyword.SplitSecondAbility; import mage.cards.CardImpl; import mage.constants.CardType; +import mage.constants.Outcome; import mage.constants.Rarity; +import mage.constants.Zone; +import mage.target.TargetPermanent; /** * @@ -46,8 +56,18 @@ public class TakePossession extends CardImpl { this.color.setBlue(true); // Split second + this.addAbility(SplitSecondAbility.getInstance()); // Enchant permanent + TargetPermanent auraTarget = new TargetPermanent(); + this.getSpellAbility().addTarget(auraTarget); + this.getSpellAbility().addEffect(new AttachEffect(Outcome.GainControl)); + Ability ability = new EnchantAbility(auraTarget.getTargetName()); + this.addAbility(ability); // You control enchanted permanent. + Effect effect = new ControlEnchantedEffect(); + effect.setText("You control enchanted permanent"); + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, effect)); + } public TakePossession(final TakePossession card) { From 8362ea3b00bd49d089743a5f8da6442d7ad11f0f Mon Sep 17 00:00:00 2001 From: LevelX2 Date: Mon, 17 Jun 2013 07:44:55 +0200 Subject: [PATCH 03/10] [minor] Formatting. --- .../effects/common/DestroyTargetEffect.java | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/Mage/src/mage/abilities/effects/common/DestroyTargetEffect.java b/Mage/src/mage/abilities/effects/common/DestroyTargetEffect.java index 944254c350c..bd5578f504f 100644 --- a/Mage/src/mage/abilities/effects/common/DestroyTargetEffect.java +++ b/Mage/src/mage/abilities/effects/common/DestroyTargetEffect.java @@ -28,15 +28,14 @@ package mage.abilities.effects.common; -import mage.constants.Outcome; +import java.util.UUID; import mage.abilities.Ability; import mage.abilities.Mode; import mage.abilities.effects.OneShotEffect; +import mage.constants.Outcome; import mage.game.Game; import mage.game.permanent.Permanent; import mage.target.Target; - -import java.util.UUID; import mage.target.targetpointer.FirstTargetPointer; /** @@ -105,12 +104,14 @@ public class DestroyTargetEffect extends OneShotEffect { StringBuilder sb = new StringBuilder(); if (mode.getTargets().size() == 0) { sb.append("destroy that creature"); //TODO add possibility to specify text with targetPointer usage - } else if (mode.getTargets().get(0).getNumberOfTargets() == 1) + } else if (mode.getTargets().get(0).getNumberOfTargets() == 1) { sb.append("Destroy target ").append(mode.getTargets().get(0).getTargetName()); - else + } else { sb.append("Destroy ").append(mode.getTargets().get(0).getNumberOfTargets()).append(" target ").append(mode.getTargets().get(0).getTargetName()); - if (noRegen) + } + if (noRegen) { sb.append(". It can't be regenerated"); + } return sb.toString(); } From dcf1b27decc4c9a40f15eb34d124944d4c567be8 Mon Sep 17 00:00:00 2001 From: LevelX2 Date: Mon, 17 Jun 2013 08:12:45 +0200 Subject: [PATCH 04/10] Added reminder text to SunburstAbility. --- Mage/src/mage/abilities/keyword/SunburstAbility.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Mage/src/mage/abilities/keyword/SunburstAbility.java b/Mage/src/mage/abilities/keyword/SunburstAbility.java index c399361a14a..9f42bdc4b9a 100644 --- a/Mage/src/mage/abilities/keyword/SunburstAbility.java +++ b/Mage/src/mage/abilities/keyword/SunburstAbility.java @@ -65,7 +65,7 @@ public class SunburstAbility extends EntersBattlefieldAbility{ @Override public String getRule() { - return "Sunburst"; + return "Sunburst (This enters the battlefield with a +1/+1 counter on it for each color of mana spent to cast it.)"; } From d1153d26a3e8a8715fde3768644c07e6615488de Mon Sep 17 00:00:00 2001 From: LevelX2 Date: Mon, 17 Jun 2013 13:48:43 +0200 Subject: [PATCH 05/10] [MMA] Added Phthisis. --- .../src/mage/sets/modernmasters/Phthisis.java | 52 +++++++++ .../src/mage/sets/timespiral/Phthisis.java | 105 ++++++++++++++++++ 2 files changed, 157 insertions(+) create mode 100644 Mage.Sets/src/mage/sets/modernmasters/Phthisis.java create mode 100644 Mage.Sets/src/mage/sets/timespiral/Phthisis.java diff --git a/Mage.Sets/src/mage/sets/modernmasters/Phthisis.java b/Mage.Sets/src/mage/sets/modernmasters/Phthisis.java new file mode 100644 index 00000000000..98d12ebded6 --- /dev/null +++ b/Mage.Sets/src/mage/sets/modernmasters/Phthisis.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.modernmasters; + +import java.util.UUID; + +/** + * + * @author LevelX2 + */ +public class Phthisis extends mage.sets.timespiral.Phthisis { + + public Phthisis(UUID ownerId) { + super(ownerId); + this.cardNumber = 93; + this.expansionSetCode = "MMA"; + } + + public Phthisis(final Phthisis card) { + super(card); + } + + @Override + public Phthisis copy() { + return new Phthisis(this); + } +} diff --git a/Mage.Sets/src/mage/sets/timespiral/Phthisis.java b/Mage.Sets/src/mage/sets/timespiral/Phthisis.java new file mode 100644 index 00000000000..deedf7444a9 --- /dev/null +++ b/Mage.Sets/src/mage/sets/timespiral/Phthisis.java @@ -0,0 +1,105 @@ +/* + * 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.timespiral; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.keyword.SuspendAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.game.Game; +import mage.game.permanent.Permanent; +import mage.players.Player; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author LevelX2 + */ +public class Phthisis extends CardImpl { + + public Phthisis(UUID ownerId) { + super(ownerId, 122, "Phthisis", Rarity.UNCOMMON, new CardType[]{CardType.SORCERY}, "{3}{B}{B}{B}{B}"); + this.expansionSetCode = "TSP"; + + this.color.setBlack(true); + + // Destroy target creature. Its controller loses life equal to its power plus its toughness. + this.getSpellAbility().addEffect(new PhthisisEffect()); + this.getSpellAbility().addTarget(new TargetCreaturePermanent(true)); + + // Suspend 5-{1}{B} + this.addAbility(new SuspendAbility(5, new ManaCostsImpl("{1}{B}"), this)); + } + + public Phthisis(final Phthisis card) { + super(card); + } + + @Override + public Phthisis copy() { + return new Phthisis(this); + } +} + +class PhthisisEffect extends OneShotEffect { + + public PhthisisEffect() { + super(Outcome.DestroyPermanent); + this.staticText = "Destroy target creature. Its controller loses life equal to its power plus its toughness"; + } + + public PhthisisEffect(final PhthisisEffect effect) { + super(effect); + } + + @Override + public PhthisisEffect copy() { + return new PhthisisEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Permanent creature = game.getPermanent(getTargetPointer().getFirst(game, source)); + if (creature != null) { + Player controller = game.getPlayer(creature.getControllerId()); + if (controller != null) { + int lifeLoss = creature.getPower().getValue() + creature.getToughness().getValue(); + creature.destroy(source.getSourceId(), game, false); + // the life loss happens also if the creature is indestructible or regenerated (legal targets) + controller.loseLife(lifeLoss, game); + return true; + } + } + return false; + } +} From c6a283583a6259dbbcfbe477ab5a7662088144f7 Mon Sep 17 00:00:00 2001 From: LevelX2 Date: Mon, 17 Jun 2013 13:50:20 +0200 Subject: [PATCH 06/10] [minor] Some code cleaning. --- Mage.Sets/src/mage/sets/gatecrash/PredatorsRapport.java | 4 ++-- .../effects/common/PutLibraryIntoGraveTargetEffect.java | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/Mage.Sets/src/mage/sets/gatecrash/PredatorsRapport.java b/Mage.Sets/src/mage/sets/gatecrash/PredatorsRapport.java index 7c00e84e1b3..c75af84fbf2 100644 --- a/Mage.Sets/src/mage/sets/gatecrash/PredatorsRapport.java +++ b/Mage.Sets/src/mage/sets/gatecrash/PredatorsRapport.java @@ -28,13 +28,13 @@ package mage.sets.gatecrash; import java.util.UUID; -import mage.constants.CardType; -import mage.constants.Rarity; import mage.abilities.Ability; import mage.abilities.dynamicvalue.DynamicValue; import mage.abilities.effects.Effect; import mage.abilities.effects.common.GainLifeEffect; import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; import mage.game.Game; import mage.game.permanent.Permanent; import mage.target.common.TargetControlledCreaturePermanent; diff --git a/Mage/src/mage/abilities/effects/common/PutLibraryIntoGraveTargetEffect.java b/Mage/src/mage/abilities/effects/common/PutLibraryIntoGraveTargetEffect.java index 40307e1aa22..9d0f893fbf6 100644 --- a/Mage/src/mage/abilities/effects/common/PutLibraryIntoGraveTargetEffect.java +++ b/Mage/src/mage/abilities/effects/common/PutLibraryIntoGraveTargetEffect.java @@ -86,8 +86,9 @@ public class PutLibraryIntoGraveTargetEffect extends OneShotEffect Date: Mon, 17 Jun 2013 13:51:20 +0200 Subject: [PATCH 07/10] * Grisly Spectacle - Fixed a bug that no card milling was done, if the target was not destroyed (e.g. regenerated). --- Mage.Sets/src/mage/sets/gatecrash/GrislySpectacle.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Mage.Sets/src/mage/sets/gatecrash/GrislySpectacle.java b/Mage.Sets/src/mage/sets/gatecrash/GrislySpectacle.java index ac86f0194d2..a8efff42caf 100644 --- a/Mage.Sets/src/mage/sets/gatecrash/GrislySpectacle.java +++ b/Mage.Sets/src/mage/sets/gatecrash/GrislySpectacle.java @@ -100,11 +100,11 @@ class GrislySpectacleEffect extends OneShotEffect { Player controller = game.getPlayer(creature.getControllerId()); if (controller != null) { int power = creature.getPower().getValue(); - if (creature.destroy(source.getSourceId(), game, false)) { - Effect effect = new PutLibraryIntoGraveTargetEffect(power); - effect.setTargetPointer(new FixedTarget(controller.getId())); - return effect.apply(game, source); - } + creature.destroy(source.getSourceId(), game, false); + // the mill effect works also if creature is indestructible or regenerated + Effect effect = new PutLibraryIntoGraveTargetEffect(power); + effect.setTargetPointer(new FixedTarget(controller.getId())); + return effect.apply(game, source); } } return false; From 5216eddb7144e082ce22a63d8273719c798bc953 Mon Sep 17 00:00:00 2001 From: LevelX2 Date: Mon, 17 Jun 2013 13:59:23 +0200 Subject: [PATCH 08/10] In the card info (tooltip) tokens have now the work "Token" written below the expansion symbol. Some code cleaning concering handling of counters. --- .../plugins/card/info/CardInfoPaneImpl.java | 15 +++++++----- Mage.Common/src/mage/view/CardView.java | 7 ++++++ Mage.Common/src/mage/view/GameView.java | 24 ++++++++++--------- Mage.Common/src/mage/view/PermanentView.java | 13 +--------- 4 files changed, 30 insertions(+), 29 deletions(-) diff --git a/Mage.Client/src/main/java/org/mage/plugins/card/info/CardInfoPaneImpl.java b/Mage.Client/src/main/java/org/mage/plugins/card/info/CardInfoPaneImpl.java index bc47999e41c..16269a07503 100644 --- a/Mage.Client/src/main/java/org/mage/plugins/card/info/CardInfoPaneImpl.java +++ b/Mage.Client/src/main/java/org/mage/plugins/card/info/CardInfoPaneImpl.java @@ -154,12 +154,15 @@ public class CardInfoPaneImpl extends JEditorPane implements CardInfoPane { } else if (CardUtil.isPlaneswalker(card)) { pt = card.getLoyalty().toString(); } - if (pt.length() > 0) { - buffer.append("
"); - buffer.append(""); - buffer.append(pt); - buffer.append(""); - buffer.append("
"); + + if (pt.length() > 0 || card.isToken()) { + buffer.append(""); + if (card.isToken()) { + buffer.append(""); + } + + buffer.append("
"); + buffer.append(pt).append("Token
"); } StringBuilder rule = new StringBuilder("
"); diff --git a/Mage.Common/src/mage/view/CardView.java b/Mage.Common/src/mage/view/CardView.java index 1c27582361f..24598179aed 100644 --- a/Mage.Common/src/mage/view/CardView.java +++ b/Mage.Common/src/mage/view/CardView.java @@ -82,6 +82,7 @@ public class CardView extends SimpleCardView { protected boolean transformed; protected boolean isSplitCard; + protected boolean isToken; protected String leftSplitName; protected ManaCosts leftSplitCosts; protected List leftSplitRules; @@ -156,8 +157,10 @@ public class CardView extends SimpleCardView { this.expansionSetCode = ((PermanentToken) card).getExpansionSetCode(); this.rules = ((PermanentToken) card).getRules(); this.type = ((PermanentToken)card).getToken().getTokenType(); + this.isToken = true; } else { this.rarity = card.getRarity(); + this.isToken = false; } if (card.getCounters() != null && !card.getCounters().isEmpty()) { counters = new ArrayList(); @@ -453,6 +456,10 @@ public class CardView extends SimpleCardView { return this.secondCardFace; } + public boolean isToken() { + return this.isToken; + } + public void setTransformed(boolean transformed) { this.transformed = transformed; } diff --git a/Mage.Common/src/mage/view/GameView.java b/Mage.Common/src/mage/view/GameView.java index 09d2734ea6b..3913b9f9548 100644 --- a/Mage.Common/src/mage/view/GameView.java +++ b/Mage.Common/src/mage/view/GameView.java @@ -28,11 +28,16 @@ package mage.view; -import mage.constants.PhaseStep; -import mage.constants.TurnPhase; +import java.io.Serializable; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.UUID; import mage.MageObject; import mage.abilities.costs.Cost; import mage.cards.Card; +import mage.constants.PhaseStep; +import mage.constants.TurnPhase; import mage.constants.Zone; import mage.game.ExileZone; import mage.game.Game; @@ -46,11 +51,6 @@ import mage.game.stack.StackAbility; import mage.game.stack.StackObject; import mage.players.Player; -import java.io.Serializable; -import java.util.ArrayList; -import java.util.List; -import java.util.Map; -import java.util.UUID; /** * @@ -131,14 +131,16 @@ public class GameView implements Serializable { this.phase = state.getTurn().getPhaseType(); this.step = state.getTurn().getStepType(); this.turn = state.getTurnNum(); - if (state.getActivePlayerId() != null) + if (state.getActivePlayerId() != null) { this.activePlayerName = state.getPlayer(state.getActivePlayerId()).getName(); - else + } else { this.activePlayerName = ""; - if (state.getPriorityPlayerId() != null) + } + if (state.getPriorityPlayerId() != null) { this.priorityPlayerName = state.getPlayer(state.getPriorityPlayerId()).getName(); - else + } else { this.priorityPlayerName = ""; + } for (CombatGroup combatGroup: state.getCombat().getGroups()) { combat.add(new CombatGroupView(combatGroup, game)); } diff --git a/Mage.Common/src/mage/view/PermanentView.java b/Mage.Common/src/mage/view/PermanentView.java index a88791d000a..09e00e4e419 100644 --- a/Mage.Common/src/mage/view/PermanentView.java +++ b/Mage.Common/src/mage/view/PermanentView.java @@ -50,7 +50,6 @@ public class PermanentView extends CardView { private boolean summoningSickness; private int damage; private List attachments; - private List counters; private CardView original; public PermanentView(Permanent permanent, Card card) { @@ -66,13 +65,7 @@ public class PermanentView extends CardView { attachments = new ArrayList(); attachments.addAll(permanent.getAttachments()); } - if (permanent.getCounters().size() > 0) { - counters = new ArrayList(); - for (Counter counter: permanent.getCounters().values()) { - counters.add(new CounterView(counter)); - } - } - if (permanent instanceof PermanentToken) { + if (isToken()) { original = new CardView(((PermanentToken)permanent).getToken()); original.expansionSetCode = permanent.getExpansionSetCode(); } @@ -110,10 +103,6 @@ public class PermanentView extends CardView { return attachments; } - public List getCounters() { - return counters; - } - public CardView getOriginal() { return original; } From 95a12028e6d7fba87df0aaab188b9d6fc6727bb6 Mon Sep 17 00:00:00 2001 From: LevelX2 Date: Mon, 17 Jun 2013 17:00:17 +0200 Subject: [PATCH 09/10] Added small icon for tokens on token permanents. Token copied from permanents (Giant Adephage) show now the image of the permanent. --- .../java/org/mage/card/arcane/CardPanel.java | 22 ++++++++++++++++++ .../mage/plugins/card/utils/ImageManager.java | 2 ++ .../card/utils/impl/ImageManagerImpl.java | 11 +++++++++ Mage.Client/src/main/resources/card/token.png | Bin 0 -> 753 bytes Mage.Common/src/mage/view/CardView.java | 13 +++++++++-- .../sets/dragonsmaze/AdventOfTheWurm.java | 2 ++ Mage/src/mage/game/permanent/token/Token.java | 19 +++++++++++++++ .../util/functions/CopyTokenFunction.java | 3 ++- 8 files changed, 69 insertions(+), 3 deletions(-) create mode 100644 Mage.Client/src/main/resources/card/token.png diff --git a/Mage.Client/src/main/java/org/mage/card/arcane/CardPanel.java b/Mage.Client/src/main/java/org/mage/card/arcane/CardPanel.java index 8067b9d56e4..cc9ce07983e 100644 --- a/Mage.Client/src/main/java/org/mage/card/arcane/CardPanel.java +++ b/Mage.Client/src/main/java/org/mage/card/arcane/CardPanel.java @@ -65,6 +65,7 @@ public class CardPanel extends MagePermanent implements MouseListener, MouseMoti public final ScaledImagePanel imagePanel; public ImagePanel overlayPanel; public JPanel buttonPanel; + public JPanel iconPanel; private GlowText titleText; private GlowText ptText; @@ -94,6 +95,7 @@ public class CardPanel extends MagePermanent implements MouseListener, MouseMoti private boolean transformed; private boolean animationInProgress = false; private JButton dayNightButton; + private JButton tokenButton; private boolean displayTitleAnyway; @@ -142,6 +144,23 @@ public class CardPanel extends MagePermanent implements MouseListener, MouseMoti } }); + // token icon + iconPanel = new JPanel(); + iconPanel.setLayout(null); + iconPanel.setOpaque(false); + add(iconPanel); + + tokenButton = new JButton(""); + tokenButton.setLocation(2, 2); + tokenButton.setSize(25, 25); + + iconPanel.setVisible(this.gameCard.isToken()); + + BufferedImage tokenIconImage = ImageManagerImpl.getInstance().getTokenIconImage(); + tokenButton.setIcon(new ImageIcon(tokenIconImage)); + + iconPanel.add(tokenButton); + setBackground(Color.black); setOpaque(false); @@ -411,6 +430,9 @@ public class CardPanel extends MagePermanent implements MouseListener, MouseMoti buttonPanel.setLocation(cardXOffset + borderSize, cardYOffset + borderSize); buttonPanel.setSize(cardWidth - borderSize * 2, cardHeight - borderSize * 2); + iconPanel.setLocation(cardXOffset + borderSize, cardYOffset + borderSize); + iconPanel.setSize(cardWidth - borderSize * 2, cardHeight - borderSize * 2); + int fontHeight = Math.round(cardHeight * (27f / 680)); boolean showText = (!isAnimationPanel && fontHeight < 12); titleText.setVisible(showText); diff --git a/Mage.Client/src/main/java/org/mage/plugins/card/utils/ImageManager.java b/Mage.Client/src/main/java/org/mage/plugins/card/utils/ImageManager.java index 390e2dd121a..fd8a65891ee 100644 --- a/Mage.Client/src/main/java/org/mage/plugins/card/utils/ImageManager.java +++ b/Mage.Client/src/main/java/org/mage/plugins/card/utils/ImageManager.java @@ -11,6 +11,8 @@ public interface ImageManager { Image getSicknessImage(); Image getDayImage(); Image getNightImage(); + + Image getTokenIconImage(); Image getDlgAcceptButtonImage(); Image getDlgActiveAcceptButtonImage(); diff --git a/Mage.Client/src/main/java/org/mage/plugins/card/utils/impl/ImageManagerImpl.java b/Mage.Client/src/main/java/org/mage/plugins/card/utils/impl/ImageManagerImpl.java index c99196e2ac3..a161c643c4d 100644 --- a/Mage.Client/src/main/java/org/mage/plugins/card/utils/impl/ImageManagerImpl.java +++ b/Mage.Client/src/main/java/org/mage/plugins/card/utils/impl/ImageManagerImpl.java @@ -97,6 +97,15 @@ public class ImageManagerImpl implements ImageManager { return imageNight; } + @Override + public BufferedImage getTokenIconImage() { + if (imageTokenIcon == null) { + Image image = getImageFromResourceTransparent("/card/token.png", Color.WHITE, new Rectangle(20, 20)); + imageTokenIcon = BufferedImageBuilder.bufferImage(image, BufferedImage.TYPE_INT_ARGB); + } + return imageTokenIcon; + } + @Override public Image getDlgCancelButtonImage() { if (imageDlgCancelButton == null) { @@ -216,6 +225,8 @@ public class ImageManagerImpl implements ImageManager { private static BufferedImage imageDay; private static BufferedImage imageNight; + private static BufferedImage imageTokenIcon; + private static BufferedImage imageDlgAcceptButton; private static BufferedImage imageDlgActiveAcceptButton; private static BufferedImage imageDlgCancelButton; diff --git a/Mage.Client/src/main/resources/card/token.png b/Mage.Client/src/main/resources/card/token.png new file mode 100644 index 0000000000000000000000000000000000000000..e63f67cb0918b653bb8a129170a70ae3e2a3de2e GIT binary patch literal 753 zcmVPELMDI6FIw($Z4sbUGpR`F!~J_`ufImJrciQc{A|)z!Q#H3jihg@pwi9UZ}JHj9nHJRT2TUS6~bL!l5_TU$|GT@8oBf$QsQA!%r6KwDcI zVzC&Wo}SRr(SeGJ3N$x2!-LZ4_VyOr z+uLGiRlMcl;bGL()nQ^{Le5EsE|*IY5~HJ|Ld59oyXWU;JU%`Om~=ermzO2`_V#u~Mj!U7Dw!WV#4Og=*Ci|J<8(T6q##Jl zbF6~BT2@vDuh)y4o16STBr(Bv>~_2J$g;3nt=QSw!Q|wmy!WfCD|K;sjZNLAr>Ao? z)x!ArxJuyLm%`0pFen3|5E)TfS&8%W^TNY{w>L5}@*^2R?WkozLcWlurluT6qtPf6 z#%8n0ch=5-&dP#>ESb-+zrSCac5G}6OG`^QK0e0f 0) { + // a token copied from permanent + this.expansionSetCode = ((PermanentToken) card).getToken().getOriginalExpansionSetCode(); + this.cardNumber = ((PermanentToken) card).getToken().getOriginalCardNumber(); + } else { + // a created token + this.expansionSetCode = ((PermanentToken) card).getExpansionSetCode(); + } + // + // set code und card number for token copies to get the image this.rules = ((PermanentToken) card).getRules(); this.type = ((PermanentToken)card).getToken().getTokenType(); - this.isToken = true; } else { this.rarity = card.getRarity(); this.isToken = false; diff --git a/Mage.Sets/src/mage/sets/dragonsmaze/AdventOfTheWurm.java b/Mage.Sets/src/mage/sets/dragonsmaze/AdventOfTheWurm.java index 670e174ecfd..ea962b98eff 100644 --- a/Mage.Sets/src/mage/sets/dragonsmaze/AdventOfTheWurm.java +++ b/Mage.Sets/src/mage/sets/dragonsmaze/AdventOfTheWurm.java @@ -75,6 +75,8 @@ public class AdventOfTheWurm extends CardImpl { subtype.add("Wurm"); power = new MageInt(5); toughness = new MageInt(5); + expansionSetCode = "RTR"; + addAbility(TrampleAbility.getInstance()); } diff --git a/Mage/src/mage/game/permanent/token/Token.java b/Mage/src/mage/game/permanent/token/Token.java index 75355cecb6f..743e1459f6c 100644 --- a/Mage/src/mage/game/permanent/token/Token.java +++ b/Mage/src/mage/game/permanent/token/Token.java @@ -49,6 +49,8 @@ public class Token extends MageObjectImpl { protected String description; private UUID lastAddedTokenId; private int tokenType; + private int originalCardNumber; + private String originalExpansionSetCode; public enum Type { FIRST(1), @@ -146,4 +148,21 @@ public class Token extends MageObjectImpl { public void setTokenType(int tokenType) { this.tokenType = tokenType; } + + public int getOriginalCardNumber() { + return originalCardNumber; + } + + public void setOriginalCardNumber(int originalCardNumber) { + this.originalCardNumber = originalCardNumber; + } + + public String getOriginalExpansionSetCode() { + return originalExpansionSetCode; + } + + public void setOriginalExpansionSetCode(String originalExpansionSetCode) { + this.originalExpansionSetCode = originalExpansionSetCode; + } + } diff --git a/Mage/src/mage/util/functions/CopyTokenFunction.java b/Mage/src/mage/util/functions/CopyTokenFunction.java index 4943f498e56..b83582c791e 100644 --- a/Mage/src/mage/util/functions/CopyTokenFunction.java +++ b/Mage/src/mage/util/functions/CopyTokenFunction.java @@ -79,7 +79,8 @@ public class CopyTokenFunction implements Function { for (String type : sourceObj.getSupertype()) { target.getSupertype().add(type); } - //target.setExpansionSetCode(source.getExpansionSetCode()); + target.setOriginalExpansionSetCode(source.getExpansionSetCode()); + target.setOriginalCardNumber(source.getCardNumber()); target.getAbilities().clear(); for (Ability ability0 : sourceObj.getAbilities()) { From 6339038a6f50cfad588624d63bdac1750347f0e0 Mon Sep 17 00:00:00 2001 From: LevelX2 Date: Mon, 17 Jun 2013 17:14:20 +0200 Subject: [PATCH 10/10] Improved log text generation of Test of Faith. --- Mage.Sets/src/mage/sets/modernmasters/TestOfFaith.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Mage.Sets/src/mage/sets/modernmasters/TestOfFaith.java b/Mage.Sets/src/mage/sets/modernmasters/TestOfFaith.java index b06abd575e2..8547c2564cc 100644 --- a/Mage.Sets/src/mage/sets/modernmasters/TestOfFaith.java +++ b/Mage.Sets/src/mage/sets/modernmasters/TestOfFaith.java @@ -116,7 +116,8 @@ class TestOfFaithPreventDamageTargetEffect extends PreventionEffectImpl