mirror of
https://github.com/correl/mage.git
synced 2024-11-21 19:18:40 +00:00
[LTR] Implement Nasty End
This commit is contained in:
parent
8e1d8faaad
commit
c99068c322
2 changed files with 60 additions and 0 deletions
59
Mage.Sets/src/mage/cards/n/NastyEnd.java
Normal file
59
Mage.Sets/src/mage/cards/n/NastyEnd.java
Normal file
|
@ -0,0 +1,59 @@
|
|||
package mage.cards.n;
|
||||
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.condition.Condition;
|
||||
import mage.abilities.costs.common.SacrificeTargetCost;
|
||||
import mage.abilities.decorator.ConditionalOneShotEffect;
|
||||
import mage.abilities.effects.common.DrawCardSourceControllerEffect;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
import mage.filter.StaticFilters;
|
||||
import mage.game.Game;
|
||||
import mage.util.CardUtil;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
* @author TheElk801
|
||||
*/
|
||||
public final class NastyEnd extends CardImpl {
|
||||
|
||||
public NastyEnd(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{1}{B}");
|
||||
|
||||
// As an additional cost to cast this spell, sacrifice a creature.
|
||||
this.getSpellAbility().addCost(new SacrificeTargetCost(StaticFilters.FILTER_CONTROLLED_CREATURE_SHORT_TEXT));
|
||||
|
||||
// Draw two cards. If the sacrificed creature was legendary, draw three cards instead.
|
||||
this.getSpellAbility().addEffect(new ConditionalOneShotEffect(
|
||||
new DrawCardSourceControllerEffect(3),
|
||||
new DrawCardSourceControllerEffect(2),
|
||||
NastyEndCondition.instance, "draw two cards. If the " +
|
||||
"sacrificed creature was legendary, draw three cards instead"
|
||||
));
|
||||
}
|
||||
|
||||
private NastyEnd(final NastyEnd card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public NastyEnd copy() {
|
||||
return new NastyEnd(this);
|
||||
}
|
||||
}
|
||||
|
||||
enum NastyEndCondition implements Condition {
|
||||
instance;
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
return CardUtil
|
||||
.castStream(source.getCosts().stream(), SacrificeTargetCost.class)
|
||||
.map(SacrificeTargetCost::getPermanents)
|
||||
.flatMap(Collection::stream)
|
||||
.anyMatch(permanent -> permanent.isLegendary(game));
|
||||
}
|
||||
}
|
|
@ -161,6 +161,7 @@ public final class TheLordOfTheRingsTalesOfMiddleEarth extends ExpansionSet {
|
|||
cards.add(new SetCardInfo("Mount Doom", 258, Rarity.MYTHIC, mage.cards.m.MountDoom.class));
|
||||
cards.add(new SetCardInfo("Mountain", 268, Rarity.LAND, mage.cards.basiclands.Mountain.class, NON_FULL_USE_VARIOUS));
|
||||
cards.add(new SetCardInfo("Mushroom Watchdogs", 180, Rarity.COMMON, mage.cards.m.MushroomWatchdogs.class));
|
||||
cards.add(new SetCardInfo("Nasty End", 99, Rarity.COMMON, mage.cards.n.NastyEnd.class));
|
||||
cards.add(new SetCardInfo("Nazgul", 100, Rarity.UNCOMMON, mage.cards.n.Nazgul.class));
|
||||
cards.add(new SetCardInfo("Nimble Hobbit", 23, Rarity.COMMON, mage.cards.n.NimbleHobbit.class));
|
||||
cards.add(new SetCardInfo("Nimrodel Watcher", 63, Rarity.COMMON, mage.cards.n.NimrodelWatcher.class));
|
||||
|
|
Loading…
Reference in a new issue