Implemented Into the Story

This commit is contained in:
Evan Kranzler 2019-09-12 07:55:34 -04:00
parent 7af23cbe23
commit 2816a516f3
2 changed files with 64 additions and 0 deletions

View file

@ -0,0 +1,63 @@
package mage.cards.i;
import mage.abilities.Ability;
import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.condition.Condition;
import mage.abilities.effects.common.DrawCardSourceControllerEffect;
import mage.abilities.effects.common.cost.SpellCostReductionSourceEffect;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.Zone;
import mage.game.Game;
import mage.game.Graveyard;
import mage.players.Player;
import java.util.UUID;
/**
* @author TheElk801
*/
public final class IntoTheStory extends CardImpl {
public IntoTheStory(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{5}{U}{U}");
// This spell costs {3} less to cast if an opponent has seven or more cards in their graveyard.
this.addAbility(new SimpleStaticAbility(
Zone.STACK, new SpellCostReductionSourceEffect(3, IntoTheStoryCondition.instance)
).setRuleAtTheTop(true));
// Draw four cards.
this.getSpellAbility().addEffect(new DrawCardSourceControllerEffect(4));
}
private IntoTheStory(final IntoTheStory card) {
super(card);
}
@Override
public IntoTheStory copy() {
return new IntoTheStory(this);
}
}
enum IntoTheStoryCondition implements Condition {
instance;
@Override
public boolean apply(Game game, Ability source) {
return game
.getOpponents(source.getControllerId())
.stream()
.map(game::getPlayer)
.map(Player::getGraveyard)
.mapToInt(Graveyard::size)
.anyMatch(i -> i >= 7);
}
@Override
public String toString() {
return "an opponent has seven or more cards in their graveyard";
}
}

View file

@ -83,6 +83,7 @@ public final class ThroneOfEldraine extends ExpansionSet {
cards.add(new SetCardInfo("Inquisitive Puppet", 223, Rarity.UNCOMMON, mage.cards.i.InquisitivePuppet.class));
cards.add(new SetCardInfo("Insatiable Appetite", 162, Rarity.COMMON, mage.cards.i.InsatiableAppetite.class));
cards.add(new SetCardInfo("Inspiring Veteran", 194, Rarity.UNCOMMON, mage.cards.i.InspiringVeteran.class));
cards.add(new SetCardInfo("Into the Story", 50, Rarity.UNCOMMON, mage.cards.i.IntoTheStory.class));
cards.add(new SetCardInfo("Joust", 129, Rarity.UNCOMMON, mage.cards.j.Joust.class));
cards.add(new SetCardInfo("Jousting Dummy", 224, Rarity.COMMON, mage.cards.j.JoustingDummy.class));
cards.add(new SetCardInfo("Keeper of Fables", 163, Rarity.UNCOMMON, mage.cards.k.KeeperOfFables.class));