mirror of
https://github.com/correl/mage.git
synced 2025-01-12 11:08:01 +00:00
Implemented Into the Story
This commit is contained in:
parent
7af23cbe23
commit
2816a516f3
2 changed files with 64 additions and 0 deletions
63
Mage.Sets/src/mage/cards/i/IntoTheStory.java
Normal file
63
Mage.Sets/src/mage/cards/i/IntoTheStory.java
Normal 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";
|
||||
}
|
||||
}
|
|
@ -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));
|
||||
|
|
Loading…
Reference in a new issue