[ZNR] Implemented Mind Carver

This commit is contained in:
Evan Kranzler 2020-09-03 10:08:13 -04:00
parent da65fa2cc1
commit b54c9449ef
6 changed files with 113 additions and 59 deletions

View file

@ -3,6 +3,7 @@ package mage.cards.i;
import mage.abilities.Ability;
import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.condition.Condition;
import mage.abilities.condition.common.CardsInOpponentGraveCondition;
import mage.abilities.effects.common.DrawCardSourceControllerEffect;
import mage.abilities.effects.common.cost.SpellCostReductionSourceEffect;
import mage.abilities.hint.ConditionHint;
@ -26,8 +27,8 @@ public final class IntoTheStory extends CardImpl {
// This spell costs {3} less to cast if an opponent has seven or more cards in their graveyard.
this.addAbility(new SimpleStaticAbility(
Zone.ALL, new SpellCostReductionSourceEffect(3, IntoTheStoryCondition.instance)
).setRuleAtTheTop(true).addHint(new ConditionHint(IntoTheStoryCondition.instance, "Opponent has seven or more cards in their graveyard")));
Zone.ALL, new SpellCostReductionSourceEffect(3, CardsInOpponentGraveCondition.SEVEN)
).setRuleAtTheTop(true).addHint(CardsInOpponentGraveCondition.SEVEN.getHint()));
// Draw four cards.
this.getSpellAbility().addEffect(new DrawCardSourceControllerEffect(4));
@ -42,23 +43,3 @@ public final class IntoTheStory extends CardImpl {
return new IntoTheStory(this);
}
}
enum IntoTheStoryCondition implements Condition {
instance;
@Override
public boolean apply(Game game, Ability source) {
return game
.getOpponents(source.getControllerId())
.stream()
.map(game::getPlayer)
.map(Player::getGraveyard)
.mapToInt(Graveyard::size)
.anyMatch(i -> i >= 7);
}
@Override
public String toString() {
return "an opponent has seven or more cards in their graveyard";
}
}

View file

@ -1,12 +1,13 @@
package mage.cards.j;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.condition.common.CardsInOpponentGraveCondition;
import mage.abilities.decorator.ConditionalContinuousEffect;
import mage.abilities.effects.common.continuous.BoostSourceEffect;
import mage.abilities.hint.ConditionHint;
import mage.abilities.keyword.FlyingAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
@ -16,7 +17,6 @@ import mage.constants.Duration;
import mage.constants.Zone;
/**
*
* @author Loki
*/
public final class JacesPhantasm extends CardImpl {
@ -31,7 +31,11 @@ public final class JacesPhantasm extends CardImpl {
// Flying
this.addAbility(FlyingAbility.getInstance());
// Jace's Phantasm gets +4/+4 as long as an opponent has ten or more cards in their graveyard.
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new ConditionalContinuousEffect(new BoostSourceEffect(4, 4, Duration.WhileOnBattlefield), new CardsInOpponentGraveCondition(10), "{this} gets +4/+4 as long as an opponent has ten or more cards in their graveyard")));
this.addAbility(new SimpleStaticAbility(new ConditionalContinuousEffect(
new BoostSourceEffect(4, 4, Duration.WhileOnBattlefield),
CardsInOpponentGraveCondition.TEN, "{this} gets +4/+4 as long as " +
"an opponent has ten or more cards in their graveyard"
)).addHint(CardsInOpponentGraveCondition.TEN.getHint()));
}
public JacesPhantasm(final JacesPhantasm card) {

View file

@ -0,0 +1,58 @@
package mage.cards.m;
import java.util.UUID;
import mage.abilities.Ability;
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.condition.common.CardsInOpponentGraveCondition;
import mage.abilities.costs.mana.ManaCostsImpl;
import mage.abilities.decorator.ConditionalContinuousEffect;
import mage.abilities.effects.common.AttachEffect;
import mage.abilities.effects.common.continuous.BoostEquippedEffect;
import mage.abilities.keyword.EquipAbility;
import mage.constants.Outcome;
import mage.constants.SubType;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.target.common.TargetControlledCreaturePermanent;
/**
* @author TheElk801
*/
public final class MindCarver extends CardImpl {
public MindCarver(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.ARTIFACT}, "{B}");
this.subtype.add(SubType.EQUIPMENT);
// When Mind Carver enters the battlefield, attach it to target creature you control.
Ability ability = new EntersBattlefieldTriggeredAbility(new AttachEffect(
Outcome.BoostCreature, "attach it to target creature you control"
), false);
ability.addTarget(new TargetControlledCreaturePermanent());
this.addAbility(ability);
// Equipped Creature gets +1/+0. It gets +3/+1 instead as long as an opponent has eight or more cards in their graveyard.
this.addAbility(new SimpleStaticAbility(new ConditionalContinuousEffect(
new BoostEquippedEffect(3, 1),
new BoostEquippedEffect(1, 0),
CardsInOpponentGraveCondition.EIGHT, "Equipped creature gets +1/+0. " +
"It gets +3/+1 instead as long as an opponent has eight or more cards in their graveyard."
)));
// Equip {2}{B}
this.addAbility(new EquipAbility(Outcome.BoostCreature, new ManaCostsImpl<>("{2}{B}")));
}
private MindCarver(final MindCarver card) {
super(card);
}
@Override
public MindCarver copy() {
return new MindCarver(this);
}
}

View file

@ -5,10 +5,12 @@ import mage.abilities.Ability;
import mage.abilities.common.EntersBattlefieldThisOrAnotherTriggeredAbility;
import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.condition.Condition;
import mage.abilities.condition.common.CardsInOpponentGraveCondition;
import mage.abilities.decorator.ConditionalContinuousEffect;
import mage.abilities.effects.common.PutTopCardOfLibraryIntoGraveEachPlayerEffect;
import mage.abilities.effects.common.continuous.BoostSourceEffect;
import mage.abilities.effects.common.continuous.GainAbilitySourceEffect;
import mage.abilities.hint.ConditionHint;
import mage.abilities.keyword.DeathtouchAbility;
import mage.abilities.keyword.FlashAbility;
import mage.cards.CardImpl;
@ -53,13 +55,13 @@ public final class ThievesGuildEnforcer extends CardImpl {
// As long as an opponent has eight or more cards in their graveyard, Thieves' Guild Enforcer gets +2/+1 and has deathtouch.
Ability ability = new SimpleStaticAbility(new ConditionalContinuousEffect(
new BoostSourceEffect(2, 1, Duration.WhileOnBattlefield),
ThievesGuildEnforcerCondition.instance, "as long as an opponent " +
CardsInOpponentGraveCondition.EIGHT, "as long as an opponent " +
"has eight or more cards in their graveyard, {this} gets +2/+1"
));
ability.addEffect(new ConditionalContinuousEffect(new GainAbilitySourceEffect(
DeathtouchAbility.getInstance(), Duration.WhileOnBattlefield
), ThievesGuildEnforcerCondition.instance, "and has deathtouch"));
this.addAbility(ability);
), CardsInOpponentGraveCondition.EIGHT, "and has deathtouch"));
this.addAbility(ability.addHint(CardsInOpponentGraveCondition.EIGHT.getHint()));
}
private ThievesGuildEnforcer(final ThievesGuildEnforcer card) {
@ -71,19 +73,3 @@ public final class ThievesGuildEnforcer extends CardImpl {
return new ThievesGuildEnforcer(this);
}
}
enum ThievesGuildEnforcerCondition implements Condition {
instance;
@Override
public boolean apply(Game game, Ability source) {
return game
.getOpponents(source.getControllerId())
.stream()
.map(game::getPlayer)
.filter(Objects::nonNull)
.map(Player::getGraveyard)
.mapToInt(Graveyard::size)
.anyMatch(i -> i >= 8);
}
}

View file

@ -112,6 +112,7 @@ public final class ZendikarRising extends ExpansionSet {
cards.add(new SetCardInfo("Linvala, Shield of Sea Gate", 226, Rarity.RARE, mage.cards.l.LinvalaShieldOfSeaGate.class));
cards.add(new SetCardInfo("Lotus Cobra", 193, Rarity.RARE, mage.cards.l.LotusCobra.class));
cards.add(new SetCardInfo("Might of Murasa", 194, Rarity.COMMON, mage.cards.m.MightOfMurasa.class));
cards.add(new SetCardInfo("Mind Carver", 113, Rarity.UNCOMMON, mage.cards.m.MindCarver.class));
cards.add(new SetCardInfo("Mountain", 275, Rarity.LAND, mage.cards.basiclands.Mountain.class, FULL_ART_BFZ_VARIOUS));
cards.add(new SetCardInfo("Murasa Rootgrazer", 229, Rarity.UNCOMMON, mage.cards.m.MurasaRootgrazer.class));
cards.add(new SetCardInfo("Murkwater Pathway", 260, Rarity.RARE, mage.cards.m.MurkwaterPathway.class));

View file

@ -2,33 +2,57 @@ package mage.abilities.condition.common;
import mage.abilities.Ability;
import mage.abilities.condition.Condition;
import mage.abilities.hint.ConditionHint;
import mage.abilities.hint.Hint;
import mage.game.Game;
import mage.game.Graveyard;
import mage.players.Player;
import mage.util.CardUtil;
import java.util.Objects;
import java.util.UUID;
/**
* Condition for -
* Any opponent has X or more cards in their graveyard
* @author Loki
*
* @author TheElk801
*/
public class CardsInOpponentGraveCondition implements Condition {
private final int value;
public enum CardsInOpponentGraveCondition implements Condition {
SEVEN(7),
EIGHT(8),
TEN(10);
public CardsInOpponentGraveCondition(int value) {
private final int value;
private final Hint hint;
CardsInOpponentGraveCondition(int value) {
this.value = value;
this.hint = new ConditionHint(this, "O" + this.makeStem());
}
@Override
public boolean apply(Game game, Ability source) {
Player player = game.getPlayer(source.getControllerId());
if (player != null) {
for (UUID playerId : game.getOpponents(source.getControllerId())) {
Player opponent = game.getPlayer(playerId);
if (opponent != null && opponent.getGraveyard().size() >= value)
return true;
}
}
return false;
return game
.getOpponents(source.getControllerId())
.stream()
.map(game::getPlayer)
.filter(Objects::nonNull)
.map(Player::getGraveyard)
.mapToInt(Graveyard::size)
.anyMatch(i -> i >= this.value);
}
@Override
public String toString() {
return "an o" + this.makeStem();
}
private String makeStem() {
return "pponent has " + CardUtil.numberToText(value) + " or more cards in their graveyard";
}
public Hint getHint() {
return hint;
}
}