Implemented Nightpack Ambusher

This commit is contained in:
Evan Kranzler 2019-06-21 22:39:33 -04:00
parent a9238aba9d
commit 337d582c74
2 changed files with 85 additions and 0 deletions

View file

@ -0,0 +1,84 @@
package mage.cards.n;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.BeginningOfEndStepTriggeredAbility;
import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.condition.Condition;
import mage.abilities.decorator.ConditionalInterveningIfTriggeredAbility;
import mage.abilities.effects.common.CreateTokenEffect;
import mage.abilities.effects.common.continuous.BoostControlledEffect;
import mage.abilities.keyword.FlashAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.Duration;
import mage.constants.SubType;
import mage.constants.TargetController;
import mage.filter.common.FilterCreaturePermanent;
import mage.filter.predicate.Predicates;
import mage.filter.predicate.mageobject.SubtypePredicate;
import mage.game.Game;
import mage.game.permanent.token.WolfToken;
import mage.watchers.common.CastSpellLastTurnWatcher;
import java.util.UUID;
/**
* @author TheElk801
*/
public final class NightpackAmbusher extends CardImpl {
private static final FilterCreaturePermanent filter
= new FilterCreaturePermanent("Wolves and Werewolves");
static {
filter.add(Predicates.or(
new SubtypePredicate(SubType.WEREWOLF),
new SubtypePredicate(SubType.WOLF)
));
}
public NightpackAmbusher(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{2}{G}{G}");
this.subtype.add(SubType.WOLF);
this.power = new MageInt(4);
this.toughness = new MageInt(4);
// Flash
this.addAbility(FlashAbility.getInstance());
// Other Wolves and Werewolves you control get +1/+1.
this.addAbility(new SimpleStaticAbility(new BoostControlledEffect(
1, 1, Duration.WhileOnBattlefield, filter, true
)));
// At the beginning of your end step, if you didn't cast a spell this turn, create a 2/2 green Wolf creature token.
this.addAbility(new ConditionalInterveningIfTriggeredAbility(
new BeginningOfEndStepTriggeredAbility(
new CreateTokenEffect(new WolfToken()), TargetController.YOU, false
), NightpackAmbusherCondition.instance, "At the beginning of your end step, " +
"if you didn't cast a spell this turn, create a 2/2 green Wolf creature token."
));
}
private NightpackAmbusher(final NightpackAmbusher card) {
super(card);
}
@Override
public NightpackAmbusher copy() {
return new NightpackAmbusher(this);
}
}
enum NightpackAmbusherCondition implements Condition {
instance;
@Override
public boolean apply(Game game, Ability source) {
CastSpellLastTurnWatcher watcher = game.getState().getWatcher(CastSpellLastTurnWatcher.class);
return watcher != null && watcher.getAmountOfSpellsPlayerCastOnCurrentTurn(source.getControllerId()) == 0;
}
}

View file

@ -107,6 +107,7 @@ public final class CoreSet2020 extends ExpansionSet {
cards.add(new SetCardInfo("Mu Yanling, Sky Dancer", 68, Rarity.MYTHIC, mage.cards.m.MuYanlingSkyDancer.class));
cards.add(new SetCardInfo("Murder", 109, Rarity.COMMON, mage.cards.m.Murder.class));
cards.add(new SetCardInfo("Negate", 69, Rarity.COMMON, mage.cards.n.Negate.class));
cards.add(new SetCardInfo("Nightpack Ambusher", 185, Rarity.RARE, mage.cards.n.NightpackAmbusher.class));
cards.add(new SetCardInfo("Octoprophet", 70, Rarity.COMMON, mage.cards.o.Octoprophet.class));
cards.add(new SetCardInfo("Ogre Siegebreaker", 215, Rarity.UNCOMMON, mage.cards.o.OgreSiegebreaker.class));
cards.add(new SetCardInfo("Pacifism", 32, Rarity.COMMON, mage.cards.p.Pacifism.class));