Merge pull request #5093 from NoahGleason/nightcreep

Implement Nightcreep
This commit is contained in:
LevelX2 2018-07-14 10:26:24 +02:00 committed by GitHub
commit ef8b895d5b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 255 additions and 0 deletions

View file

@ -0,0 +1,100 @@
package mage.cards.n;
import mage.ObjectColor;
import mage.abilities.Ability;
import mage.abilities.effects.common.continuous.BecomesBasicLandTargetEffect;
import mage.abilities.effects.common.continuous.BecomesColorTargetEffect;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.*;
import mage.filter.StaticFilters;
import mage.game.Game;
import mage.game.permanent.Permanent;
import mage.target.targetpointer.FixedTargets;
import java.util.ArrayList;
import java.util.List;
import java.util.UUID;
/**
*
* @author noahg
*/
public final class Nightcreep extends CardImpl {
public Nightcreep(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{B}{B}");
// Until end of turn, all creatures become black and all lands become Swamps.
this.getSpellAbility().addEffect(new NightcreepCreatureEffect());
this.getSpellAbility().addEffect(new NightcreepLandEffect());
}
public Nightcreep(final Nightcreep card) {
super(card);
}
@Override
public Nightcreep copy() {
return new Nightcreep(this);
}
}
class NightcreepLandEffect extends BecomesBasicLandTargetEffect {
public NightcreepLandEffect() {
super(Duration.EndOfTurn, SubType.SWAMP);
this.staticText = "";
}
public NightcreepLandEffect(NightcreepLandEffect effect) {
super(effect);
}
@Override
public void init(Ability source, Game game) {
super.init(source, game);
List<Permanent> targets = new ArrayList<>(game.getBattlefield().getActivePermanents(StaticFilters.FILTER_LAND, source.getControllerId(), source.getSourceId(), game));
this.setTargetPointer(new FixedTargets(targets, game));
}
@Override
public boolean apply(Layer layer, SubLayer sublayer, Ability source, Game game) {
return super.apply(layer, sublayer, source, game);
}
@Override
public NightcreepLandEffect copy() {
return new NightcreepLandEffect(this);
}
}
class NightcreepCreatureEffect extends BecomesColorTargetEffect {
public NightcreepCreatureEffect() {
super(ObjectColor.BLACK, Duration.EndOfTurn);
this.staticText = "Until end of turn, all creatures become black and all lands become Swamps";
}
public NightcreepCreatureEffect(NightcreepCreatureEffect effect) {
super(effect);
}
@Override
public void init(Ability source, Game game) {
super.init(source, game);
List<Permanent> targets = new ArrayList<>(game.getBattlefield().getActivePermanents(StaticFilters.FILTER_PERMANENT_CREATURE, source.getControllerId(), source.getSourceId(), game));
this.setTargetPointer(new FixedTargets(targets, game));
}
@Override
public boolean apply(Layer layer, SubLayer sublayer, Ability source, Game game) {
return super.apply(layer, sublayer, source, game);
}
@Override
public NightcreepCreatureEffect copy() {
return new NightcreepCreatureEffect(this);
}
}

View file

@ -110,6 +110,7 @@ public final class Dissension extends ExpansionSet {
cards.add(new SetCardInfo("Momir Vig, Simic Visionary", 118, Rarity.RARE, mage.cards.m.MomirVigSimicVisionary.class));
cards.add(new SetCardInfo("Muse Vessel", 163, Rarity.RARE, mage.cards.m.MuseVessel.class));
cards.add(new SetCardInfo("Nettling Curse", 48, Rarity.COMMON, mage.cards.n.NettlingCurse.class));
cards.add(new SetCardInfo("Nightcreep", 49, Rarity.UNCOMMON, mage.cards.n.Nightcreep.class));
cards.add(new SetCardInfo("Nihilistic Glee", 50, Rarity.RARE, mage.cards.n.NihilisticGlee.class));
cards.add(new SetCardInfo("Novijen, Heart of Progress", 175, Rarity.UNCOMMON, mage.cards.n.NovijenHeartOfProgress.class));
cards.add(new SetCardInfo("Novijen Sages", 27, Rarity.RARE, mage.cards.n.NovijenSages.class));