From 5b96b6ccb1fe47a4808955159a8640990d7080c2 Mon Sep 17 00:00:00 2001
From: drmDev <dmontur1@gmail.com>
Date: Tue, 29 Mar 2016 20:18:38 -0400
Subject: [PATCH] bug fixes for ConfrontTheUnknown, RelenlessDead. Card
 implementation HarvestHand and nightside fix for it

---
 .../ConfrontTheUnknown.java                   |   2 +-
 .../shadowsoverinnistrad/HarvestHand.java     | 108 ++++++++++++++++++
 .../shadowsoverinnistrad/RelentlessDead.java  |   6 +-
 .../shadowsoverinnistrad/ScroungedScythe.java |   5 +-
 4 files changed, 117 insertions(+), 4 deletions(-)
 create mode 100644 Mage.Sets/src/mage/sets/shadowsoverinnistrad/HarvestHand.java

diff --git a/Mage.Sets/src/mage/sets/shadowsoverinnistrad/ConfrontTheUnknown.java b/Mage.Sets/src/mage/sets/shadowsoverinnistrad/ConfrontTheUnknown.java
index cefff87aa9..0d76511976 100644
--- a/Mage.Sets/src/mage/sets/shadowsoverinnistrad/ConfrontTheUnknown.java
+++ b/Mage.Sets/src/mage/sets/shadowsoverinnistrad/ConfrontTheUnknown.java
@@ -60,7 +60,7 @@ public class ConfrontTheUnknown extends CardImpl {
         Effect effect = new InvestigateEffect();
         effect.setText("Investigate");
         getSpellAbility().addEffect(effect);
-        effect = new BoostTargetEffect(new PermanentsOnBattlefieldCount(filter), new PermanentsOnBattlefieldCount(filter), Duration.EndOfTurn);
+        effect = new BoostTargetEffect(new PermanentsOnBattlefieldCount(filter), new PermanentsOnBattlefieldCount(filter), Duration.EndOfTurn, true);
         effect.setText(", then target creature gets +1/+1 until end of turn for each Clue you control. <i>(To investigate, "
                 + "put a colorless Clue artifact token onto the battlefield with \"{2}, Sacrifice this artifact: Draw a card.\")</i>");
         getSpellAbility().addEffect(effect);
diff --git a/Mage.Sets/src/mage/sets/shadowsoverinnistrad/HarvestHand.java b/Mage.Sets/src/mage/sets/shadowsoverinnistrad/HarvestHand.java
new file mode 100644
index 0000000000..c1a20316fa
--- /dev/null
+++ b/Mage.Sets/src/mage/sets/shadowsoverinnistrad/HarvestHand.java
@@ -0,0 +1,108 @@
+/*
+ *  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.shadowsoverinnistrad;
+
+import java.util.UUID;
+import mage.MageInt;
+import mage.abilities.Ability;
+import mage.abilities.common.DiesTriggeredAbility;
+import mage.abilities.effects.OneShotEffect;
+import mage.abilities.keyword.TransformAbility;
+import mage.cards.Card;
+import mage.cards.CardImpl;
+import mage.constants.CardType;
+import mage.constants.Outcome;
+import mage.constants.Rarity;
+import mage.constants.Zone;
+import mage.game.Game;
+import mage.players.Player;
+
+/**
+ *
+ * @author halljared
+ */
+public class HarvestHand extends CardImpl {
+
+    public HarvestHand(UUID ownerId) {
+        super(ownerId, 256, "Harvest Hand", Rarity.UNCOMMON, new CardType[]{CardType.ARTIFACT, CardType.CREATURE}, "{3}");
+        this.expansionSetCode = "SOI";
+        this.subtype.add("Scarecrow");
+        this.power = new MageInt(2);
+        this.toughness = new MageInt(2);
+
+        this.canTransform = true;
+        this.secondSideCard = new ScroungedScythe(ownerId);
+
+        // When Harvest Hand dies, return it to the battlefield transformed under your control.
+        this.addAbility(new TransformAbility());
+        this.addAbility(new DiesTriggeredAbility(new HarvestHandReturnTransformedEffect()));
+    }
+
+    public HarvestHand(final HarvestHand card) {
+        super(card);
+    }
+
+    @Override
+    public HarvestHand copy() {
+        return new HarvestHand(this);
+    }
+}
+
+class HarvestHandReturnTransformedEffect extends OneShotEffect {
+
+    public HarvestHandReturnTransformedEffect() {
+        super(Outcome.PutCardInPlay);
+        this.staticText = "Return {this} to the battlefield transformed under your control";
+    }
+
+    public HarvestHandReturnTransformedEffect(final HarvestHandReturnTransformedEffect effect) {
+        super(effect);
+    }
+
+    @Override
+    public HarvestHandReturnTransformedEffect copy() {
+        return new HarvestHandReturnTransformedEffect(this);
+    }
+
+    @Override
+    public boolean apply(Game game, Ability source) {
+        Player controller = game.getPlayer(source.getControllerId());
+        if (controller != null) {
+            if (game.getState().getZone(source.getSourceId()).equals(Zone.GRAVEYARD)) {
+                game.getState().setValue(TransformAbility.VALUE_KEY_ENTER_TRANSFORMED + source.getSourceId(), Boolean.TRUE);
+                Card card = game.getCard(source.getSourceId());
+                if (card != null) {
+                    controller.moveCards(card, Zone.BATTLEFIELD, source, game);
+                }
+            }
+            return true;
+        }
+        return false;
+    }
+
+}
\ No newline at end of file
diff --git a/Mage.Sets/src/mage/sets/shadowsoverinnistrad/RelentlessDead.java b/Mage.Sets/src/mage/sets/shadowsoverinnistrad/RelentlessDead.java
index f768d83ec1..2b6fc10eb7 100644
--- a/Mage.Sets/src/mage/sets/shadowsoverinnistrad/RelentlessDead.java
+++ b/Mage.Sets/src/mage/sets/shadowsoverinnistrad/RelentlessDead.java
@@ -46,6 +46,7 @@ import mage.constants.Rarity;
 import mage.constants.Zone;
 import mage.filter.Filter;
 import mage.filter.FilterCard;
+import mage.filter.predicate.mageobject.AnotherCardPredicate;
 import mage.filter.predicate.mageobject.ConvertedManaCostPredicate;
 import mage.filter.predicate.mageobject.SubtypePredicate;
 import mage.game.Game;
@@ -105,13 +106,14 @@ class RelentlessDeadEffect extends OneShotEffect {
     public boolean apply(Game game, Ability source) {
         Player controller = game.getPlayer(source.getControllerId());
         if (controller != null) {
-            if (controller.chooseUse(Outcome.BoostCreature, "Do you want to to pay {X}?", source, game)) {
+            if (controller.chooseUse(Outcome.BoostCreature, "Do you want to pay {X}?", source, game)) {
                 int costX = controller.announceXMana(0, Integer.MAX_VALUE, "Announce the value for {X}", game, source);
                 Cost cost = new GenericManaCost(costX);
                 if (cost.pay(source, game, source.getSourceId(), source.getControllerId(), false, null)) {
-                    FilterCard filter = new FilterCard("Zombie card with converted mana cost " + costX);
+                    FilterCard filter = new FilterCard("Another target Zombie card with converted mana cost " + costX);
                     filter.add(new SubtypePredicate("Zombie"));
                     filter.add(new ConvertedManaCostPredicate(Filter.ComparisonType.Equal, costX));
+                    filter.add(new AnotherCardPredicate());
                     TargetCardInYourGraveyard target = new TargetCardInYourGraveyard(filter);
                     if (controller.chooseTarget(outcome, target, source, game)) {
                         Card card = game.getCard(target.getFirstTarget());
diff --git a/Mage.Sets/src/mage/sets/shadowsoverinnistrad/ScroungedScythe.java b/Mage.Sets/src/mage/sets/shadowsoverinnistrad/ScroungedScythe.java
index 620779982e..627cb3be78 100644
--- a/Mage.Sets/src/mage/sets/shadowsoverinnistrad/ScroungedScythe.java
+++ b/Mage.Sets/src/mage/sets/shadowsoverinnistrad/ScroungedScythe.java
@@ -1,3 +1,4 @@
+
 /*
  *  Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved.
  *
@@ -56,6 +57,8 @@ public class ScroungedScythe extends CardImpl {
         this.expansionSetCode = "SOI";
         this.subtype.add("Equipment");
 
+        this.nightCard = true;
+
         // Equipped creature gets +1/+1.
         this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostEquippedEffect(1, 1)));
 
@@ -76,4 +79,4 @@ public class ScroungedScythe extends CardImpl {
     public ScroungedScythe copy() {
         return new ScroungedScythe(this);
     }
-}
+}
\ No newline at end of file