Implemented Forgotten Harvest

This commit is contained in:
Evan Kranzler 2017-10-05 18:02:10 -04:00
parent b91342f0c6
commit b320d1d0f0
3 changed files with 81 additions and 3 deletions

View file

@ -0,0 +1,74 @@
/*
* 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.f;
import java.util.UUID;
import mage.abilities.Ability;
import mage.abilities.common.BeginningOfUpkeepTriggeredAbility;
import mage.abilities.costs.common.ExileFromGraveCost;
import mage.abilities.effects.common.DoIfCostPaid;
import mage.abilities.effects.common.counter.AddCountersTargetEffect;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.TargetController;
import mage.counters.CounterType;
import mage.filter.common.FilterLandCard;
import mage.target.common.TargetCardInYourGraveyard;
import mage.target.common.TargetCreaturePermanent;
/**
*
* @author TheElk801
*/
public class ForgottenHarvest extends CardImpl {
public ForgottenHarvest(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{1}{G}");
// At the beginning of your upkeep, you may exile a land card from your graveyard. If you do, put a +1/+1 counter on target creature.
Ability ability = new BeginningOfUpkeepTriggeredAbility(
new DoIfCostPaid(
new AddCountersTargetEffect(CounterType.P1P1.createInstance()),
new ExileFromGraveCost(new TargetCardInYourGraveyard(new FilterLandCard("land card from your graveyard")))
),
TargetController.YOU, false
);
ability.addTarget(new TargetCreaturePermanent());
this.addAbility(ability);
}
public ForgottenHarvest(final ForgottenHarvest card) {
super(card);
}
@Override
public ForgottenHarvest copy() {
return new ForgottenHarvest(this);
}
}

View file

@ -90,6 +90,7 @@ public class Prophecy extends ExpansionSet {
cards.add(new SetCardInfo("Flameshot", 90, Rarity.UNCOMMON, mage.cards.f.Flameshot.class));
cards.add(new SetCardInfo("Flowering Field", 9, Rarity.UNCOMMON, mage.cards.f.FloweringField.class));
cards.add(new SetCardInfo("Foil", 34, Rarity.UNCOMMON, mage.cards.f.Foil.class));
cards.add(new SetCardInfo("Forgotten Harvest", 114, Rarity.RARE, mage.cards.f.ForgottenHarvest.class));
cards.add(new SetCardInfo("Greel's Caress", 67, Rarity.COMMON, mage.cards.g.GreelsCaress.class));
cards.add(new SetCardInfo("Greel, Mind Raker", 66, Rarity.RARE, mage.cards.g.GreelMindRaker.class));
cards.add(new SetCardInfo("Gulf Squid", 35, Rarity.COMMON, mage.cards.g.GulfSquid.class));

View file

@ -53,6 +53,7 @@ public class ExileFromGraveCost extends CostImpl {
private final List<Card> exiledCards = new ArrayList<>();
public ExileFromGraveCost(TargetCardInYourGraveyard target) {
target.setNotTarget(true);
this.addTarget(target);
if (target.getMaxNumberOfTargets() > 1) {
this.text = "Exile "
@ -69,11 +70,13 @@ public class ExileFromGraveCost extends CostImpl {
}
public ExileFromGraveCost(TargetCardInYourGraveyard target, String text) {
this(target);
target.setNotTarget(true);
this.addTarget(target);
this.text = text;
}
public ExileFromGraveCost(TargetCardInASingleGraveyard target) {
target.setNotTarget(true);
this.addTarget(target);
this.text = "Exile " + target.getTargetName();
}