Merge branch 'master' into nightcreep

This commit is contained in:
Noah Gleason 2018-07-01 15:25:15 -04:00 committed by GitHub
commit b246a47ece
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 428 additions and 1 deletions

View file

@ -0,0 +1,57 @@
package mage.cards.a;
import java.util.UUID;
import mage.abilities.Ability;
import mage.abilities.AbilityImpl;
import mage.abilities.SpellAbility;
import mage.abilities.effects.Effect;
import mage.abilities.effects.common.PreventCombatDamageBySourceEffect;
import mage.abilities.effects.common.PreventDamageByTargetEffect;
import mage.abilities.effects.common.PreventDamageToTargetEffect;
import mage.abilities.effects.common.continuous.BoostTargetEffect;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.Duration;
import mage.filter.common.FilterCreaturePermanent;
import mage.target.Target;
import mage.target.common.TargetCreaturePermanent;
import mage.target.targetpointer.SecondTargetPointer;
/**
*
* @author noahg
*/
public final class AzoriusPloy extends CardImpl {
public AzoriusPloy(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{1}{W}{W}{U}");
// Prevent all combat damage target creature would deal this turn.
Effect effect = new PreventDamageByTargetEffect( Duration.EndOfTurn, true);
effect.setText("Prevent all combat damage target creature would deal this turn.");
this.getSpellAbility().addEffect(effect);
Target target = new TargetCreaturePermanent(new FilterCreaturePermanent("first creature"));
this.getSpellAbility().addTarget(target);
// Prevent all combat damage that would be dealt to target creature this turn.
Effect effect2 = new PreventDamageToTargetEffect(Duration.EndOfTurn, true);
effect2.setText("<br></br>Prevent all combat damage that would be dealt to target creature this turn.");
effect2.setTargetPointer(SecondTargetPointer.getInstance());
this.getSpellAbility().addEffect(effect2);
target = new TargetCreaturePermanent(new FilterCreaturePermanent("second creature (can be the same as the first)"));
this.getSpellAbility().addTarget(target);
}
public AzoriusPloy(final AzoriusPloy card) {
super(card);
}
@Override
public AzoriusPloy copy() {
return new AzoriusPloy(this);
}
}

View file

@ -80,7 +80,7 @@ class BloodOathEffect extends OneShotEffect {
if (player != null && opponent != null && sourceObject != null) {
Choice choiceImpl = new ChoiceImpl();
choiceImpl.setChoices(choice);
if (!player.choose(Outcome.Neutral, choiceImpl, game)) {
if (player.choose(Outcome.Neutral, choiceImpl, game)) {
CardType type = null;
String choosenType = choiceImpl.getChoice();

View file

@ -0,0 +1,85 @@
package mage.cards.c;
import java.util.UUID;
import mage.MageObject;
import mage.abilities.Ability;
import mage.abilities.effects.ContinuousRuleModifyingEffectImpl;
import mage.abilities.effects.common.ChooseACardNameEffect;
import mage.abilities.effects.common.DrawCardSourceControllerEffect;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.Duration;
import mage.constants.Outcome;
import mage.game.Game;
import mage.game.events.GameEvent;
/**
*
* @author noahg
*/
public final class ConjurersBan extends CardImpl {
public ConjurersBan(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{W}{B}");
// Choose a card name. Until your next turn, spells with the chosen name cant be cast and lands with the chosen name cant be played.
this.getSpellAbility().addEffect(new ChooseACardNameEffect(ChooseACardNameEffect.TypeOfName.ALL));
this.getSpellAbility().addEffect(new ConjurersBanEffect());
// Draw a card.
this.getSpellAbility().addEffect(new DrawCardSourceControllerEffect(1));
}
public ConjurersBan(final ConjurersBan card) {
super(card);
}
@Override
public ConjurersBan copy() {
return new ConjurersBan(this);
}
}
class ConjurersBanEffect extends ContinuousRuleModifyingEffectImpl {
public ConjurersBanEffect() {
super(Duration.UntilYourNextTurn, Outcome.Detriment, true, false);
this.staticText = "spells with the chosen name can't be cast and lands with the chosen name can't be played";
}
public ConjurersBanEffect(final ConjurersBanEffect effect) {
super(effect);
}
@Override
public boolean apply(Game game, Ability source) {
return true;
}
@Override
public ConjurersBanEffect copy() {
return new ConjurersBanEffect(this);
}
@Override
public boolean applies(GameEvent event, Ability source, Game game) {
if (event.getType() == GameEvent.EventType.CAST_SPELL || event.getType() == GameEvent.EventType.PLAY_LAND) {
MageObject object = game.getObject(event.getSourceId());
return object != null && object.getName().equals(game.getState().getValue(source.getSourceId().toString() + ChooseACardNameEffect.INFO_KEY));
}
return false;
}
@Override
public String getInfoMessage(Ability source, GameEvent event, Game game) {
String namedCard = (String) game.getState().getValue(source.getSourceId().toString() + ChooseACardNameEffect.INFO_KEY);
String playerName = game.getPlayer(source.getControllerId()).getName();
if (namedCard == null || playerName == null || source.getSourceObject(game) == null){
return super.getInfoMessage(source, event, game);
}
return "Until "+playerName+"'s next turn, spells named "+namedCard+" can't be cast and lands named "+namedCard+" can't be played ("+source.getSourceObject(game).getIdName()+").";
}
}

View file

@ -0,0 +1,125 @@
package mage.cards.f;
import java.util.LinkedHashSet;
import java.util.Set;
import java.util.UUID;
import mage.MageObject;
import mage.abilities.Ability;
import mage.abilities.effects.OneShotEffect;
import mage.cards.Card;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.cards.Cards;
import mage.choices.Choice;
import mage.choices.ChoiceImpl;
import mage.constants.CardType;
import mage.constants.Outcome;
import mage.game.Game;
import mage.game.permanent.token.SaprolingToken;
import mage.players.Player;
import mage.target.common.TargetOpponent;
/**
*
* @author noahg
*/
public final class FertileImagination extends CardImpl {
public FertileImagination(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{2}{G}{G}");
// Choose a card type. Target opponent reveals their hand. Create two 1/1 green Saproling creature tokens for each card of the chosen type revealed this way.
this.getSpellAbility().addEffect(new FertileImaginationEffect());
this.getSpellAbility().addTarget(new TargetOpponent());
}
public FertileImagination(final FertileImagination card) {
super(card);
}
@Override
public FertileImagination copy() {
return new FertileImagination(this);
}
}
class FertileImaginationEffect extends OneShotEffect {
private static final Set<String> choice = new LinkedHashSet<>();
static {
choice.add(CardType.ARTIFACT.toString());
choice.add(CardType.CREATURE.toString());
choice.add(CardType.ENCHANTMENT.toString());
choice.add(CardType.INSTANT.toString());
choice.add(CardType.LAND.toString());
choice.add(CardType.PLANESWALKER.toString());
choice.add(CardType.SORCERY.toString());
choice.add(CardType.TRIBAL.toString());
}
public FertileImaginationEffect() {
super(Outcome.Benefit);
staticText = "Choose a card type. Target opponent reveals their hand. Create two 1/1 green Saproling creature tokens for each card of the chosen type revealed this way";
}
public FertileImaginationEffect(final FertileImaginationEffect effect) {
super(effect);
}
@Override
public FertileImaginationEffect copy() {
return new FertileImaginationEffect(this);
}
@Override
public boolean apply(Game game, Ability source) {
MageObject sourceObject = game.getObject(source.getSourceId());
Player player = game.getPlayer(source.getControllerId());
Player opponent = game.getPlayer(source.getFirstTarget());
if (player != null && opponent != null && sourceObject != null) {
Choice choiceImpl = new ChoiceImpl();
choiceImpl.setChoices(choice);
if (player.choose(Outcome.Neutral, choiceImpl, game)) {
CardType type = null;
String choosenType = choiceImpl.getChoice();
if (choosenType.equals(CardType.ARTIFACT.toString())) {
type = CardType.ARTIFACT;
} else if (choosenType.equals(CardType.LAND.toString())) {
type = CardType.LAND;
} else if (choosenType.equals(CardType.CREATURE.toString())) {
type = CardType.CREATURE;
} else if (choosenType.equals(CardType.ENCHANTMENT.toString())) {
type = CardType.ENCHANTMENT;
} else if (choosenType.equals(CardType.INSTANT.toString())) {
type = CardType.INSTANT;
} else if (choosenType.equals(CardType.SORCERY.toString())) {
type = CardType.SORCERY;
} else if (choosenType.equals(CardType.PLANESWALKER.toString())) {
type = CardType.PLANESWALKER;
} else if (choosenType.equals(CardType.TRIBAL.toString())) {
type = CardType.TRIBAL;
}
if (type != null) {
Cards hand = opponent.getHand();
SaprolingToken saprolingToken = new SaprolingToken();
opponent.revealCards(sourceObject.getIdName(), hand, game);
Set<Card> cards = hand.getCards(game);
int tokensToMake = 0;
for (Card card : cards) {
if (card != null && card.getCardType().contains(type)) {
tokensToMake += 2;
}
}
game.informPlayers(sourceObject.getLogName() + " creates " + (tokensToMake == 0 ? "no" : "" + tokensToMake) + " 1/1 green Saproling creature tokens.");
saprolingToken.putOntoBattlefield(tokensToMake, game, source.getId(), source.getControllerId());
return true;
}
}
}
return false;
}
}

View file

@ -0,0 +1,101 @@
package mage.cards.f;
import java.util.UUID;
import mage.abilities.Ability;
import mage.abilities.common.CastOnlyDuringPhaseStepSourceAbility;
import mage.abilities.condition.common.AfterBlockersAreDeclaredCondition;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.DrawCardSourceControllerEffect;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.Outcome;
import mage.constants.TurnPhase;
import mage.game.Game;
import mage.game.combat.CombatGroup;
import mage.game.permanent.Permanent;
import mage.game.permanent.token.SaprolingToken;
import mage.game.permanent.token.Token;
import mage.players.Player;
import mage.target.common.FilterCreatureAttackingYou;
import mage.target.common.TargetCreaturePermanent;
/**
*
* @author noahg
*/
public final class FlashFoliage extends CardImpl {
public FlashFoliage(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{2}{G}");
// Cast Flash Foliage only during combat after blockers are declared.
this.addAbility(new CastOnlyDuringPhaseStepSourceAbility(TurnPhase.COMBAT, AfterBlockersAreDeclaredCondition.instance));
// Create a 1/1 green Saproling creature token thats blocking target creature attacking you.
this.getSpellAbility().addEffect(new FlashFoliageEffect());
this.getSpellAbility().addTarget(new TargetCreaturePermanent(new FilterCreatureAttackingYou()));
// Draw a card.
this.getSpellAbility().addEffect(new DrawCardSourceControllerEffect(1));
}
public FlashFoliage(final FlashFoliage card) {
super(card);
}
@Override
public FlashFoliage copy() {
return new FlashFoliage(this);
}
}
class FlashFoliageEffect extends OneShotEffect {
public FlashFoliageEffect() {
super(Outcome.Benefit);
this.staticText = "create a 1/1 green Saproling creature token thats blocking target creature attacking you";
}
public FlashFoliageEffect(final FlashFoliageEffect effect) {
super(effect);
}
@Override
public FlashFoliageEffect copy() {
return new FlashFoliageEffect(this);
}
@Override
public boolean apply(Game game, Ability source) {
Player controller = game.getPlayer(source.getControllerId());
if (controller != null) {
Token token = new SaprolingToken();
token.putOntoBattlefield(1, game, source.getSourceId(), source.getControllerId());
Permanent attackingCreature = game.getPermanent(getTargetPointer().getFirst(game, source));
if (attackingCreature != null && game.getState().getCombat() != null) {
// Possible ruling (see Aetherplasm)
// The token you created is blocking the attacking creature,
// even if the block couldn't legally be declared (for example, if that creature
// enters the battlefield tapped, or it can't block, or the attacking creature
// has protection from it)
CombatGroup combatGroup = game.getState().getCombat().findGroup(attackingCreature.getId());
if (combatGroup != null) {
for (UUID tokenId : token.getLastAddedTokenIds()) {
Permanent saprolingToken = game.getPermanent(tokenId);
if (saprolingToken != null) {
combatGroup.addBlocker(tokenId, source.getControllerId(), game);
game.getCombat().addBlockingGroup(tokenId, attackingCreature.getId(), controller.getId(), game);
}
}
combatGroup.pickBlockerOrder(attackingCreature.getControllerId(), game);
}
}
return true;
}
return false;
}
}

View file

@ -0,0 +1,54 @@
package mage.cards.n;
import java.util.UUID;
import mage.abilities.common.AttacksOrBlocksEnchantedTriggeredAbility;
import mage.abilities.common.SimpleActivatedAbility;
import mage.abilities.costs.mana.ManaCostsImpl;
import mage.abilities.effects.common.LoseLifeControllerAttachedEffect;
import mage.abilities.effects.common.LoseLifeTargetEffect;
import mage.abilities.effects.common.combat.AttacksIfAbleAttachedEffect;
import mage.constants.*;
import mage.target.TargetPlayer;
import mage.target.common.TargetCreaturePermanent;
import mage.abilities.Ability;
import mage.abilities.effects.common.AttachEffect;
import mage.target.TargetPermanent;
import mage.abilities.keyword.EnchantAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
/**
*
* @author noahg
*/
public final class NettlingCurse extends CardImpl {
public NettlingCurse(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{2}{B}");
this.subtype.add(SubType.AURA);
// Enchant creature
TargetPermanent auraTarget = new TargetCreaturePermanent();
this.getSpellAbility().addTarget(auraTarget);
this.getSpellAbility().addEffect(new AttachEffect(Outcome.BoostCreature));
Ability ability = new EnchantAbility(auraTarget.getTargetName());
this.addAbility(ability);
// Whenever enchanted creature attacks or blocks, its controller loses 3 life.
this.addAbility(new AttacksOrBlocksEnchantedTriggeredAbility(Zone.BATTLEFIELD, new LoseLifeControllerAttachedEffect(3)));
// {1}{R}: Enchanted creature attacks this turn if able.
this.addAbility(new SimpleActivatedAbility(new AttacksIfAbleAttachedEffect(Duration.EndOfTurn, AttachmentType.AURA).setText("Enchanted creature attacks this turn if able."), new ManaCostsImpl("{1}{R}")));
}
public NettlingCurse(final NettlingCurse card) {
super(card);
}
@Override
public NettlingCurse copy() {
return new NettlingCurse(this);
}
}

View file

@ -38,6 +38,7 @@ public final class Dissension extends ExpansionSet {
cards.add(new SetCardInfo("Azorius First-Wing", 105, Rarity.COMMON, mage.cards.a.AzoriusFirstWing.class));
cards.add(new SetCardInfo("Azorius Guildmage", 141, Rarity.UNCOMMON, mage.cards.a.AzoriusGuildmage.class));
cards.add(new SetCardInfo("Azorius Herald", 2, Rarity.UNCOMMON, mage.cards.a.AzoriusHerald.class));
cards.add(new SetCardInfo("Azorius Ploy", 106, Rarity.UNCOMMON, mage.cards.a.AzoriusPloy.class));
cards.add(new SetCardInfo("Azorius Signet", 159, Rarity.COMMON, mage.cards.a.AzoriusSignet.class));
cards.add(new SetCardInfo("Beacon Hawk", 3, Rarity.COMMON, mage.cards.b.BeaconHawk.class));
cards.add(new SetCardInfo("Biomantic Mastery", 142, Rarity.RARE, mage.cards.b.BiomanticMastery.class));
@ -73,8 +74,10 @@ public final class Dissension extends ExpansionSet {
cards.add(new SetCardInfo("Entropic Eidolon", 45, Rarity.COMMON, mage.cards.e.EntropicEidolon.class));
cards.add(new SetCardInfo("Evolution Vat", 161, Rarity.RARE, mage.cards.e.EvolutionVat.class));
cards.add(new SetCardInfo("Experiment Kraj", 110, Rarity.RARE, mage.cards.e.ExperimentKraj.class));
cards.add(new SetCardInfo("Fertile Imagination", 84, Rarity.UNCOMMON, mage.cards.f.FertileImagination.class));
cards.add(new SetCardInfo("Flame-Kin War Scout", 61, Rarity.UNCOMMON, mage.cards.f.FlameKinWarScout.class));
cards.add(new SetCardInfo("Flaring Flame-Kin", 62, Rarity.UNCOMMON, mage.cards.f.FlaringFlameKin.class));
cards.add(new SetCardInfo("Flash Foliage", 85, Rarity.UNCOMMON, mage.cards.f.FlashFoliage.class));
cards.add(new SetCardInfo("Freewind Equenaut", 9, Rarity.COMMON, mage.cards.f.FreewindEquenaut.class));
cards.add(new SetCardInfo("Ghost Quarter", 173, Rarity.UNCOMMON, mage.cards.g.GhostQuarter.class));
cards.add(new SetCardInfo("Gnat Alley Creeper", 63, Rarity.UNCOMMON, mage.cards.g.GnatAlleyCreeper.class));
@ -105,6 +108,7 @@ public final class Dissension extends ExpansionSet {
cards.add(new SetCardInfo("Minister of Impediments", 144, Rarity.COMMON, mage.cards.m.MinisterOfImpediments.class));
cards.add(new SetCardInfo("Mistral Charger", 13, Rarity.UNCOMMON, mage.cards.m.MistralCharger.class));
cards.add(new SetCardInfo("Momir Vig, Simic Visionary", 118, Rarity.RARE, mage.cards.m.MomirVigSimicVisionary.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));

View file

@ -44,6 +44,7 @@ public final class Guildpact extends ExpansionSet {
cards.add(new SetCardInfo("Castigate", 106, Rarity.COMMON, mage.cards.c.Castigate.class));
cards.add(new SetCardInfo("Caustic Rain", 44, Rarity.UNCOMMON, mage.cards.c.CausticRain.class));
cards.add(new SetCardInfo("Cerebral Vortex", 107, Rarity.RARE, mage.cards.c.CerebralVortex.class));
cards.add(new SetCardInfo("Conjurer's Ban", 108, Rarity.UNCOMMON, mage.cards.c.ConjurersBan.class));
cards.add(new SetCardInfo("Crash Landing", 82, Rarity.UNCOMMON, mage.cards.c.CrashLanding.class));
cards.add(new SetCardInfo("Cremate", 45, Rarity.COMMON, mage.cards.c.Cremate.class));
cards.add(new SetCardInfo("Cry of Contrition", 46, Rarity.COMMON, mage.cards.c.CryOfContrition.class));