forked from External/mage
[MID] Implemented Seize the Storm
This commit is contained in:
parent
8d26761eb5
commit
520528293a
3 changed files with 124 additions and 0 deletions
80
Mage.Sets/src/mage/cards/s/SeizeTheStorm.java
Normal file
80
Mage.Sets/src/mage/cards/s/SeizeTheStorm.java
Normal file
|
|
@ -0,0 +1,80 @@
|
|||
package mage.cards.s;
|
||||
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.costs.mana.ManaCostsImpl;
|
||||
import mage.abilities.dynamicvalue.DynamicValue;
|
||||
import mage.abilities.effects.Effect;
|
||||
import mage.abilities.effects.common.CreateTokenEffect;
|
||||
import mage.abilities.hint.Hint;
|
||||
import mage.abilities.hint.ValueHint;
|
||||
import mage.abilities.keyword.FlashbackAbility;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
import mage.filter.StaticFilters;
|
||||
import mage.game.Game;
|
||||
import mage.game.permanent.token.SeizeTheStormToken;
|
||||
import mage.players.Player;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
* @author TheElk801
|
||||
*/
|
||||
public final class SeizeTheStorm extends CardImpl {
|
||||
|
||||
private static final Hint hint = new ValueHint(
|
||||
"Spells in your graveyard and flashback cards in exile", SeizeTheStormValue.instance
|
||||
);
|
||||
|
||||
public SeizeTheStorm(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{4}{R}");
|
||||
|
||||
// Create a red Elemental creature token with trample and "This creature's power and toughness are each equal to the number of instant and sorcery cards in your graveyard, plus the number of cards with flashback you own in exile."
|
||||
this.getSpellAbility().addEffect(new CreateTokenEffect(
|
||||
new SeizeTheStormToken(SeizeTheStormValue.instance, hint)
|
||||
));
|
||||
this.getSpellAbility().addHint(hint);
|
||||
|
||||
// Flashback {6}{R}
|
||||
this.addAbility(new FlashbackAbility(this, new ManaCostsImpl<>("{6}{R}")));
|
||||
}
|
||||
|
||||
private SeizeTheStorm(final SeizeTheStorm card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public SeizeTheStorm copy() {
|
||||
return new SeizeTheStorm(this);
|
||||
}
|
||||
}
|
||||
|
||||
enum SeizeTheStormValue implements DynamicValue {
|
||||
instance;
|
||||
|
||||
@Override
|
||||
public int calculate(Game game, Ability sourceAbility, Effect effect) {
|
||||
Player player = game.getPlayer(sourceAbility.getControllerId());
|
||||
if (player == null) {
|
||||
return 0;
|
||||
}
|
||||
return player.getGraveyard().count(
|
||||
StaticFilters.FILTER_CARD_INSTANT_OR_SORCERY, game
|
||||
) + game.getExile()
|
||||
.getAllCards(game, sourceAbility.getControllerId())
|
||||
.stream()
|
||||
.filter(card -> card.getAbilities(game).containsClass(FlashbackAbility.class))
|
||||
.mapToInt(x -> 1).sum();
|
||||
}
|
||||
|
||||
@Override
|
||||
public SeizeTheStormValue copy() {
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getMessage() {
|
||||
return "instant and sorcery cards in your graveyard, plus the number of cards with flashback you own in exile";
|
||||
}
|
||||
}
|
||||
|
|
@ -246,6 +246,7 @@ public final class InnistradMidnightHunt extends ExpansionSet {
|
|||
cards.add(new SetCardInfo("Seafaring Werewolf", 80, Rarity.RARE, mage.cards.s.SeafaringWerewolf.class));
|
||||
cards.add(new SetCardInfo("Seasoned Cathar", 2, Rarity.UNCOMMON, mage.cards.s.SeasonedCathar.class));
|
||||
cards.add(new SetCardInfo("Secrets of the Key", 73, Rarity.COMMON, mage.cards.s.SecretsOfTheKey.class));
|
||||
cards.add(new SetCardInfo("Seize the Storm", 158, Rarity.UNCOMMON, mage.cards.s.SeizeTheStorm.class));
|
||||
cards.add(new SetCardInfo("Shadowbeast Sighting", 198, Rarity.COMMON, mage.cards.s.ShadowbeastSighting.class));
|
||||
cards.add(new SetCardInfo("Shady Traveler", 120, Rarity.COMMON, mage.cards.s.ShadyTraveler.class));
|
||||
cards.add(new SetCardInfo("Shipwreck Marsh", 267, Rarity.RARE, mage.cards.s.ShipwreckMarsh.class));
|
||||
|
|
|
|||
|
|
@ -0,0 +1,43 @@
|
|||
package mage.game.permanent.token;
|
||||
|
||||
import mage.MageInt;
|
||||
import mage.abilities.common.SimpleStaticAbility;
|
||||
import mage.abilities.dynamicvalue.DynamicValue;
|
||||
import mage.abilities.effects.common.continuous.SetPowerToughnessSourceEffect;
|
||||
import mage.abilities.hint.Hint;
|
||||
import mage.abilities.keyword.TrampleAbility;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Duration;
|
||||
import mage.constants.SubType;
|
||||
|
||||
/**
|
||||
* @author TheElk801
|
||||
*/
|
||||
public final class SeizeTheStormToken extends TokenImpl {
|
||||
|
||||
public SeizeTheStormToken(DynamicValue xValue, Hint hint) {
|
||||
super("Elemental", "red Elemental creature token with trample and " +
|
||||
"\"This creature's power and toughness are each equal to the number of instant " +
|
||||
"and sorcery cards in your graveyard, plus the number of cards with flashback you own in exile.\"");
|
||||
cardType.add(CardType.CREATURE);
|
||||
color.setRed(true);
|
||||
subtype.add(SubType.ELEMENTAL);
|
||||
power = new MageInt(0);
|
||||
toughness = new MageInt(0);
|
||||
this.addAbility(TrampleAbility.getInstance());
|
||||
this.addAbility(new SimpleStaticAbility(new SetPowerToughnessSourceEffect(
|
||||
xValue, Duration.WhileOnBattlefield
|
||||
).setText("this creature's power and toughness are each equal to the number of " +
|
||||
"instant and sorcery cards in your graveyard, plus the number of cards with flashback you own in exile")
|
||||
).addHint(hint));
|
||||
}
|
||||
|
||||
private SeizeTheStormToken(final SeizeTheStormToken token) {
|
||||
super(token);
|
||||
}
|
||||
|
||||
@Override
|
||||
public SeizeTheStormToken copy() {
|
||||
return new SeizeTheStormToken(this);
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue