From 642b14db17fdd7564db64c4a41e1d94c698abdde Mon Sep 17 00:00:00 2001 From: Brik Royster Date: Tue, 27 Dec 2016 20:41:20 -0700 Subject: [PATCH 1/4] [PLS] Dralnu's Crusade --- .../src/mage/cards/d/DralnusCrusade.java | 126 ++++++++++++++++++ Mage.Sets/src/mage/sets/Planeshift.java | 1 + 2 files changed, 127 insertions(+) create mode 100755 Mage.Sets/src/mage/cards/d/DralnusCrusade.java diff --git a/Mage.Sets/src/mage/cards/d/DralnusCrusade.java b/Mage.Sets/src/mage/cards/d/DralnusCrusade.java new file mode 100755 index 0000000000..03d03b4a29 --- /dev/null +++ b/Mage.Sets/src/mage/cards/d/DralnusCrusade.java @@ -0,0 +1,126 @@ +/* + * 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.cards.d; + +import java.util.UUID; + +import mage.ObjectColor; +import mage.abilities.Ability; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.effects.ContinuousEffectImpl; +import mage.abilities.effects.common.continuous.BoostAllEffect; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.*; +import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.mageobject.CardTypePredicate; +import mage.filter.predicate.mageobject.SubtypePredicate; +import mage.game.Game; +import mage.game.permanent.Permanent; + +/** + * + * @author brikr + */ +public class DralnusCrusade extends CardImpl { + + private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("Goblin creatures"); + + static { + filter.add(new SubtypePredicate("Goblin")); + } + + public DralnusCrusade(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{1}{B}{R}"); + + // Goblin creatures get +1/+1. + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostAllEffect(1, 1, Duration.WhileOnBattlefield, filter, false))); + + // All Goblins are black and are Zombies in addition to their other creature types. + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new DralnusCrusadeEffect())); + } + + public DralnusCrusade(final DralnusCrusade card) { + super(card); + } + + @Override + public DralnusCrusade copy() { + return new DralnusCrusade(this); + } +} + +class DralnusCrusadeEffect extends ContinuousEffectImpl { + + private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("Goblin creatures"); + + static { + filter.add(new SubtypePredicate("Goblin")); + } + + public DralnusCrusadeEffect() { + super(Duration.WhileOnBattlefield, Outcome.Neutral); + staticText = "All Goblins are black and are Zombies in addition to their other creature types"; + } + + @Override + public boolean apply(Layer layer, SubLayer sublayer, Ability source, Game game) { + for(Permanent permanent : game.getState().getBattlefield().getActivePermanents(filter, source.getControllerId(), source.getSourceId(), game)) { + switch (layer) { + case TypeChangingEffects_4: + if(!permanent.getSubtype(game).contains("Zombie")) { + permanent.getSubtype(game).add("Zombie"); + } + break; + case ColorChangingEffects_5: + permanent.getColor(game).setColor(ObjectColor.BLACK); + break; + } + } + return true; + } + + public DralnusCrusadeEffect(final DralnusCrusadeEffect effect) { + super(effect); + } + + @Override + public DralnusCrusadeEffect copy() { + return new DralnusCrusadeEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + return false; + } + + @Override + public boolean hasLayer(Layer layer) { + return layer == Layer.TypeChangingEffects_4 || layer == Layer.ColorChangingEffects_5; + } +} diff --git a/Mage.Sets/src/mage/sets/Planeshift.java b/Mage.Sets/src/mage/sets/Planeshift.java index 6c2409f16b..26a48fe2a8 100644 --- a/Mage.Sets/src/mage/sets/Planeshift.java +++ b/Mage.Sets/src/mage/sets/Planeshift.java @@ -82,6 +82,7 @@ public class Planeshift extends ExpansionSet { cards.add(new SetCardInfo("Disciple of Kangee", 3, Rarity.COMMON, mage.cards.d.DiscipleOfKangee.class)); cards.add(new SetCardInfo("Doomsday Specter", 103, Rarity.RARE, mage.cards.d.DoomsdaySpecter.class)); cards.add(new SetCardInfo("Draco", 131, Rarity.RARE, mage.cards.d.Draco.class)); + cards.add(new SetCardInfo("Dralnu's Crusade", 104, Rarity.RARE, mage.cards.d.DralnusCrusade.class)); cards.add(new SetCardInfo("Dralnu's Pet", 23, Rarity.RARE, mage.cards.d.DralnusPet.class)); cards.add(new SetCardInfo("Dromar's Cavern", 138, Rarity.UNCOMMON, mage.cards.d.DromarsCavern.class)); cards.add(new SetCardInfo("Dromar's Charm", 105, Rarity.UNCOMMON, mage.cards.d.DromarsCharm.class)); From 7484e46b04697b067c3bfacfd90f0984a0d67379 Mon Sep 17 00:00:00 2001 From: Justin Herlehy Date: Tue, 27 Dec 2016 22:41:29 -0500 Subject: [PATCH 2/4] Duskwatch Recruiter Fix Ability was incorrectly requiring a pick from the hidden zone if an applicable card was in the zone. Fixed to properly recognize the "may" ability. --- Mage.Sets/src/mage/cards/d/DuskwatchRecruiter.java | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/Mage.Sets/src/mage/cards/d/DuskwatchRecruiter.java b/Mage.Sets/src/mage/cards/d/DuskwatchRecruiter.java index 6df06ab3b3..ac7299a391 100644 --- a/Mage.Sets/src/mage/cards/d/DuskwatchRecruiter.java +++ b/Mage.Sets/src/mage/cards/d/DuskwatchRecruiter.java @@ -27,7 +27,6 @@ */ package mage.cards.d; -import java.util.UUID; import mage.MageInt; import mage.abilities.TriggeredAbility; import mage.abilities.common.BeginningOfUpkeepTriggeredAbility; @@ -35,26 +34,28 @@ import mage.abilities.common.SimpleActivatedAbility; import mage.abilities.condition.common.NoSpellsWereCastLastTurnCondition; import mage.abilities.costs.mana.ManaCostsImpl; import mage.abilities.decorator.ConditionalTriggeredAbility; -import mage.abilities.dynamicvalue.common.StaticValue; import mage.abilities.effects.common.LookLibraryAndPickControllerEffect; import mage.abilities.effects.common.TransformSourceEffect; import mage.abilities.keyword.TransformAbility; -import mage.cards.k.KrallenhordeHowler; import mage.cards.CardImpl; import mage.cards.CardSetInfo; +import mage.cards.k.KrallenhordeHowler; import mage.constants.CardType; import mage.constants.TargetController; import mage.constants.Zone; import mage.filter.common.FilterCreatureCard; +import java.util.UUID; + /** - * * @author fireshoes */ public class DuskwatchRecruiter extends CardImpl { + private static final FilterCreatureCard filter = new FilterCreatureCard("a creature card"); + public DuskwatchRecruiter(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{1}{G}"); + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{1}{G}"); this.subtype.add("Human"); this.subtype.add("Warrior"); this.subtype.add("Werewolf"); @@ -68,7 +69,7 @@ public class DuskwatchRecruiter extends CardImpl { // {2}{G}: Look at the top three cards of your library. You may reveal a creature card from among them and put it into your hand. // Put the rest on the bottom of your library in any order. this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, - new LookLibraryAndPickControllerEffect(new StaticValue(3), false, new StaticValue(1), new FilterCreatureCard("a creature card"), false), + new LookLibraryAndPickControllerEffect(3, 1, filter, true, false, Zone.HAND, true), new ManaCostsImpl("{2}{G}"))); // At the beginning of each upkeep, if no spells were cast last turn, transform Duskwatch Recruiter. @@ -85,4 +86,5 @@ public class DuskwatchRecruiter extends CardImpl { public DuskwatchRecruiter copy() { return new DuskwatchRecruiter(this); } + } From d0b405f41bbb5724e43a3dbf1d12ddb7b301c7bc Mon Sep 17 00:00:00 2001 From: Brik Royster Date: Tue, 27 Dec 2016 20:56:05 -0700 Subject: [PATCH 3/4] Updated author for Harsh Judgment --- Mage.Sets/src/mage/cards/h/HarshJudgment.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Mage.Sets/src/mage/cards/h/HarshJudgment.java b/Mage.Sets/src/mage/cards/h/HarshJudgment.java index 75aefc378c..e4bd384823 100755 --- a/Mage.Sets/src/mage/cards/h/HarshJudgment.java +++ b/Mage.Sets/src/mage/cards/h/HarshJudgment.java @@ -55,7 +55,7 @@ import mage.target.TargetPlayer; /** * - * @author anonymous + * @author brikr */ public class HarshJudgment extends CardImpl { From 4cb4d1ea4eac12285d7a2078938fb026c7c7972e Mon Sep 17 00:00:00 2001 From: Brik Royster Date: Wed, 28 Dec 2016 00:31:49 -0700 Subject: [PATCH 4/4] using hasSubtype instead of getSubtype().contains --- Mage.Sets/src/mage/cards/d/DralnusCrusade.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Mage.Sets/src/mage/cards/d/DralnusCrusade.java b/Mage.Sets/src/mage/cards/d/DralnusCrusade.java index 03d03b4a29..b4bc52baa7 100755 --- a/Mage.Sets/src/mage/cards/d/DralnusCrusade.java +++ b/Mage.Sets/src/mage/cards/d/DralnusCrusade.java @@ -93,7 +93,7 @@ class DralnusCrusadeEffect extends ContinuousEffectImpl { for(Permanent permanent : game.getState().getBattlefield().getActivePermanents(filter, source.getControllerId(), source.getSourceId(), game)) { switch (layer) { case TypeChangingEffects_4: - if(!permanent.getSubtype(game).contains("Zombie")) { + if(!permanent.hasSubtype("Zombie", game)) { permanent.getSubtype(game).add("Zombie"); } break;