From 81ffd9d87f5196879466f21615e148311e1e9bad Mon Sep 17 00:00:00 2001 From: daagar Date: Sun, 15 Feb 2015 16:22:42 -0600 Subject: [PATCH 1/2] Implement Holy Light --- .../src/mage/sets/thedark/HolyLight.java | 72 +++++++++++++++++++ 1 file changed, 72 insertions(+) create mode 100644 Mage.Sets/src/mage/sets/thedark/HolyLight.java diff --git a/Mage.Sets/src/mage/sets/thedark/HolyLight.java b/Mage.Sets/src/mage/sets/thedark/HolyLight.java new file mode 100644 index 0000000000..fb82b8e302 --- /dev/null +++ b/Mage.Sets/src/mage/sets/thedark/HolyLight.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.thedark; + +import java.util.UUID; +import mage.ObjectColor; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.effects.common.continious.BoostAllEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.mageobject.ColorPredicate; + +/** + * + * @author daagar + */ +public class HolyLight extends CardImpl { + + private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("Nonwhite creatures"); + + static { + filter.add(Predicates.not(new ColorPredicate(ObjectColor.WHITE))); + } + + + public HolyLight(UUID ownerId) { + super(ownerId, 83, "Holy Light", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{2}{W}"); + this.expansionSetCode = "DRK"; + + // Nonwhite creatures get -1/-1 until end of turn. + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostAllEffect(-1, -1, Duration.EndOfTurn, filter, false))); + } + + public HolyLight(final HolyLight card) { + super(card); + } + + @Override + public HolyLight copy() { + return new HolyLight(this); + } +} From a30b34f97673f26395cc2c5dd90e2140c882c104 Mon Sep 17 00:00:00 2001 From: daagar Date: Sun, 15 Feb 2015 16:30:49 -0600 Subject: [PATCH 2/2] Account for player being null in Mortal Combat graveyard creature count check. --- Mage.Sets/src/mage/sets/tenth/MortalCombat.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Mage.Sets/src/mage/sets/tenth/MortalCombat.java b/Mage.Sets/src/mage/sets/tenth/MortalCombat.java index 4b8217de17..129248a7b4 100644 --- a/Mage.Sets/src/mage/sets/tenth/MortalCombat.java +++ b/Mage.Sets/src/mage/sets/tenth/MortalCombat.java @@ -75,6 +75,6 @@ class TwentyGraveyardCreatureCondition implements Condition { @Override public boolean apply(Game game, Ability source) { Player player = game.getPlayer(source.getControllerId()); - return player.getGraveyard().count(filter, game) >= 20; + return player != null && player.getGraveyard().count(filter, game) >= 20; } }