[MID] Implemented Fading Hope

This commit is contained in:
Evan Kranzler 2021-09-10 08:48:55 -04:00
parent b7ddb58923
commit 0451694fac
2 changed files with 71 additions and 0 deletions

View file

@ -0,0 +1,70 @@
package mage.cards.f;
import mage.abilities.Ability;
import mage.abilities.effects.OneShotEffect;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.Outcome;
import mage.constants.Zone;
import mage.game.Game;
import mage.game.permanent.Permanent;
import mage.players.Player;
import mage.target.common.TargetCreaturePermanent;
import java.util.UUID;
/**
* @author TheElk801
*/
public final class FadingHope extends CardImpl {
public FadingHope(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{U}");
// Return target creature to its owner's hand. If its mana value was 3 or less, scry 1.
this.getSpellAbility().addEffect(new FadingHopeEffect());
this.getSpellAbility().addTarget(new TargetCreaturePermanent());
}
private FadingHope(final FadingHope card) {
super(card);
}
@Override
public FadingHope copy() {
return new FadingHope(this);
}
}
class FadingHopeEffect extends OneShotEffect {
FadingHopeEffect() {
super(Outcome.Benefit);
staticText = "return target creature to its owner's hand. If its mana value was 3 or less, scry 1";
}
private FadingHopeEffect(final FadingHopeEffect effect) {
super(effect);
}
@Override
public FadingHopeEffect copy() {
return new FadingHopeEffect(this);
}
@Override
public boolean apply(Game game, Ability source) {
Player player = game.getPlayer(source.getControllerId());
Permanent permanent = game.getPermanent(source.getFirstTarget());
if (player == null || permanent == null) {
return false;
}
boolean flag = permanent.getManaValue() <= 3;
player.moveCards(permanent, Zone.HAND, source, game);
if (flag) {
player.scry(1, source, game);
}
return true;
}
}

View file

@ -73,6 +73,7 @@ public final class InnistradMidnightHunt extends ExpansionSet {
cards.add(new SetCardInfo("Duel for Dominance", 184, Rarity.COMMON, mage.cards.d.DuelForDominance.class));
cards.add(new SetCardInfo("Eaten Alive", 99, Rarity.COMMON, mage.cards.e.EatenAlive.class));
cards.add(new SetCardInfo("Embodiment of Flame", 141, Rarity.UNCOMMON, mage.cards.e.EmbodimentOfFlame.class));
cards.add(new SetCardInfo("Fading Hope", 51, Rarity.UNCOMMON, mage.cards.f.FadingHope.class));
cards.add(new SetCardInfo("Faith Flare", 19, Rarity.COMMON, mage.cards.f.FaithFlare.class));
cards.add(new SetCardInfo("Faithful Mending", 221, Rarity.UNCOMMON, mage.cards.f.FaithfulMending.class));
cards.add(new SetCardInfo("Falkenrath Perforator", 136, Rarity.COMMON, mage.cards.f.FalkenrathPerforator.class));