mirror of
https://github.com/correl/mage.git
synced 2024-12-24 11:50:45 +00:00
[ZNR] Implemented Nissa of Shadowed Boughs
This commit is contained in:
parent
3b52b4b833
commit
f467bba780
2 changed files with 161 additions and 0 deletions
160
Mage.Sets/src/mage/cards/n/NissaOfShadowedBoughs.java
Normal file
160
Mage.Sets/src/mage/cards/n/NissaOfShadowedBoughs.java
Normal file
|
@ -0,0 +1,160 @@
|
|||
package mage.cards.n;
|
||||
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.LoyaltyAbility;
|
||||
import mage.abilities.common.LandfallAbility;
|
||||
import mage.abilities.common.PlaneswalkerEntersWithLoyaltyCountersAbility;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.abilities.effects.common.UntapTargetEffect;
|
||||
import mage.abilities.effects.common.continuous.BecomesCreatureTargetEffect;
|
||||
import mage.abilities.effects.common.counter.AddCountersSourceEffect;
|
||||
import mage.abilities.keyword.HasteAbility;
|
||||
import mage.abilities.keyword.MenaceAbility;
|
||||
import mage.cards.Card;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.*;
|
||||
import mage.counters.CounterType;
|
||||
import mage.filter.FilterCard;
|
||||
import mage.filter.StaticFilters;
|
||||
import mage.filter.common.FilterCreatureCard;
|
||||
import mage.filter.predicate.mageobject.ConvertedManaCostPredicate;
|
||||
import mage.game.Game;
|
||||
import mage.game.permanent.Permanent;
|
||||
import mage.game.permanent.token.custom.CreatureToken;
|
||||
import mage.players.Player;
|
||||
import mage.target.TargetCard;
|
||||
import mage.target.TargetPermanent;
|
||||
import mage.target.common.TargetCardInHand;
|
||||
import mage.target.common.TargetCardInYourGraveyard;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
import static mage.constants.Outcome.Benefit;
|
||||
|
||||
/**
|
||||
* @author TheElk801
|
||||
*/
|
||||
public final class NissaOfShadowedBoughs extends CardImpl {
|
||||
|
||||
public NissaOfShadowedBoughs(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId, setInfo, new CardType[]{CardType.PLANESWALKER}, "{2}{B}{G}");
|
||||
|
||||
this.addSuperType(SuperType.LEGENDARY);
|
||||
this.subtype.add(SubType.NISSA);
|
||||
this.addAbility(new PlaneswalkerEntersWithLoyaltyCountersAbility(4));
|
||||
|
||||
// Landfall — Whenever a land enters the battlefield under your control, put a loyalty counter on Nissa of Shadowed Boughs.
|
||||
this.addAbility(new LandfallAbility(new AddCountersSourceEffect(CounterType.LOYALTY.createInstance())));
|
||||
|
||||
// +1: Untap target land you control. You may have it become a 3/3 Elemental creature with haste and menace until end of turn. It's still a land.
|
||||
Ability ability = new LoyaltyAbility(new UntapTargetEffect(), 1);
|
||||
ability.addEffect(new NissaOfShadowedBoughsLandEffect());
|
||||
ability.addTarget(new TargetPermanent(StaticFilters.FILTER_CONTROLLED_PERMANENT_LAND));
|
||||
|
||||
// −5: You may put a creature card with converted mana cost less than or equal to the number of lands you control onto the battlefield from your hand or graveyard with two +1/+1 counters on it.
|
||||
this.addAbility(new LoyaltyAbility(new NissaOfShadowedBoughsCreatureEffect(), -5));
|
||||
}
|
||||
|
||||
private NissaOfShadowedBoughs(final NissaOfShadowedBoughs card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public NissaOfShadowedBoughs copy() {
|
||||
return new NissaOfShadowedBoughs(this);
|
||||
}
|
||||
}
|
||||
|
||||
class NissaOfShadowedBoughsLandEffect extends OneShotEffect {
|
||||
|
||||
NissaOfShadowedBoughsLandEffect() {
|
||||
super(Benefit);
|
||||
staticText = "You may have it become a 3/3 Elemental creature with haste and menace until end of turn. It's still a land.";
|
||||
}
|
||||
|
||||
private NissaOfShadowedBoughsLandEffect(final NissaOfShadowedBoughsLandEffect effect) {
|
||||
super(effect);
|
||||
}
|
||||
|
||||
@Override
|
||||
public NissaOfShadowedBoughsLandEffect copy() {
|
||||
return new NissaOfShadowedBoughsLandEffect(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Player player = game.getPlayer(source.getControllerId());
|
||||
if (player == null || !player.chooseUse(
|
||||
Outcome.BecomeCreature, "Have it become a creature?", source, game
|
||||
)) {
|
||||
return false;
|
||||
}
|
||||
game.addEffect(new BecomesCreatureTargetEffect(
|
||||
new CreatureToken(3, 3, "", SubType.ELEMENTAL)
|
||||
.withAbility(HasteAbility.getInstance())
|
||||
.withAbility(new MenaceAbility()),
|
||||
false, true, Duration.EndOfTurn
|
||||
), source);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
class NissaOfShadowedBoughsCreatureEffect extends OneShotEffect {
|
||||
|
||||
NissaOfShadowedBoughsCreatureEffect() {
|
||||
super(Outcome.Benefit);
|
||||
staticText = "You may put a creature card with converted mana cost less than or equal to " +
|
||||
"the number of lands you control onto the battlefield from your hand or graveyard " +
|
||||
"with two +1/+1 counters on it.";
|
||||
}
|
||||
|
||||
private NissaOfShadowedBoughsCreatureEffect(final NissaOfShadowedBoughsCreatureEffect effect) {
|
||||
super(effect);
|
||||
}
|
||||
|
||||
@Override
|
||||
public NissaOfShadowedBoughsCreatureEffect copy() {
|
||||
return new NissaOfShadowedBoughsCreatureEffect(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Player player = game.getPlayer(source.getControllerId());
|
||||
if (player == null) {
|
||||
return false;
|
||||
}
|
||||
int lands = game.getBattlefield().count(
|
||||
StaticFilters.FILTER_CONTROLLED_PERMANENT_LAND,
|
||||
source.getSourceId(), source.getControllerId(), game
|
||||
);
|
||||
FilterCard filter = new FilterCreatureCard("creature card with converted mana cost " + lands + " or less");
|
||||
filter.add(new ConvertedManaCostPredicate(ComparisonType.FEWER_THAN, lands + 1));
|
||||
int inHand = player.getHand().count(filter, game);
|
||||
int inGrave = player.getGraveyard().count(filter, game);
|
||||
if (inHand < 1 && inGrave < 1) {
|
||||
return false;
|
||||
}
|
||||
TargetCard target;
|
||||
if (inHand < 1 || (inGrave > 0 && !player.chooseUse(
|
||||
outcome, "Put a card from your hand or graveyard?",
|
||||
null, "Hand", "Graveyard", source, game
|
||||
))) {
|
||||
target = new TargetCardInYourGraveyard(0, 1, filter, true);
|
||||
player.choose(outcome, player.getGraveyard(), target, game);
|
||||
} else {
|
||||
target = new TargetCardInHand(0, 1, filter);
|
||||
player.choose(outcome, player.getHand(), target, game);
|
||||
}
|
||||
Card card = game.getCard(target.getFirstTarget());
|
||||
if (card == null) {
|
||||
return false;
|
||||
}
|
||||
player.moveCards(card, Zone.BATTLEFIELD, source, game);
|
||||
Permanent permanent = game.getPermanent(card.getId());
|
||||
if (permanent != null) {
|
||||
permanent.addCounters(CounterType.P1P1.createInstance(2), source, game);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
|
@ -271,6 +271,7 @@ public final class ZendikarRising extends ExpansionSet {
|
|||
cards.add(new SetCardInfo("Nimana Skitter-Sneak", 116, Rarity.COMMON, mage.cards.n.NimanaSkitterSneak.class));
|
||||
cards.add(new SetCardInfo("Nimana Skydancer", 117, Rarity.COMMON, mage.cards.n.NimanaSkydancer.class));
|
||||
cards.add(new SetCardInfo("Nimble Trapfinder", 72, Rarity.RARE, mage.cards.n.NimbleTrapfinder.class));
|
||||
cards.add(new SetCardInfo("Nissa of Shadowed Boughs", 231, Rarity.MYTHIC, mage.cards.n.NissaOfShadowedBoughs.class));
|
||||
cards.add(new SetCardInfo("Nissa's Zendikon", 197, Rarity.COMMON, mage.cards.n.NissasZendikon.class));
|
||||
cards.add(new SetCardInfo("Nullpriest of Oblivion", 118, Rarity.RARE, mage.cards.n.NullpriestOfOblivion.class));
|
||||
cards.add(new SetCardInfo("Oblivion's Hunger", 119, Rarity.COMMON, mage.cards.o.OblivionsHunger.class));
|
||||
|
|
Loading…
Reference in a new issue