[BRO] Implement Evangel of Synthesis

This commit is contained in:
Evan Kranzler 2022-11-02 09:56:17 -04:00
parent d4492b797a
commit beacccf558
10 changed files with 98 additions and 17 deletions

View file

@ -0,0 +1,73 @@
package mage.cards.e;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.condition.Condition;
import mage.abilities.decorator.ConditionalContinuousEffect;
import mage.abilities.dynamicvalue.common.CardsDrawnThisTurnDynamicValue;
import mage.abilities.effects.common.DrawDiscardControllerEffect;
import mage.abilities.effects.common.continuous.BoostSourceEffect;
import mage.abilities.effects.common.continuous.GainAbilitySourceEffect;
import mage.abilities.keyword.MenaceAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.Duration;
import mage.constants.SubType;
import mage.game.Game;
import mage.watchers.common.CardsDrawnThisTurnWatcher;
import java.util.UUID;
/**
* @author TheElk801
*/
public final class EvangelOfSynthesis extends CardImpl {
public EvangelOfSynthesis(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{U}{B}");
this.subtype.add(SubType.PHYREXIAN);
this.subtype.add(SubType.HUMAN);
this.subtype.add(SubType.CLERIC);
this.power = new MageInt(2);
this.toughness = new MageInt(3);
// When Evangel of Synthesis enters the battlefield, draw a card, then discard a card.
this.addAbility(new EntersBattlefieldTriggeredAbility(
new DrawDiscardControllerEffect(1, 1)
));
// As long as you've drawn two or more cards this turn, Evangel of Synthesis gets +1/+0 and has menace.
Ability ability = new SimpleStaticAbility(new ConditionalContinuousEffect(
new BoostSourceEffect(1, 0, Duration.WhileOnBattlefield),
EvangelOfSynthesisCondition.instance, "as long as you've drawn " +
"two or more cards this turn, {this} gets +1/+0"
));
ability.addEffect(new ConditionalContinuousEffect(new GainAbilitySourceEffect(
new MenaceAbility(false), Duration.WhileOnBattlefield
), EvangelOfSynthesisCondition.instance, "and has menace"));
this.addAbility(ability.addHint(CardsDrawnThisTurnDynamicValue.getHint()));
}
private EvangelOfSynthesis(final EvangelOfSynthesis card) {
super(card);
}
@Override
public EvangelOfSynthesis copy() {
return new EvangelOfSynthesis(this);
}
}
enum EvangelOfSynthesisCondition implements Condition {
instance;
@Override
public boolean apply(Game game, Ability source) {
CardsDrawnThisTurnWatcher watcher = game.getState().getWatcher(CardsDrawnThisTurnWatcher.class);
return watcher != null && watcher.getCardsDrawnThisTurn(source.getControllerId()) > 1;
}
}

View file

@ -31,7 +31,7 @@ public final class EvenTheScore extends CardImpl {
new ManaCostsImpl<>("{U}{U}{U}"),
EvenTheScoreCondition.instance
)
).setRuleAtTheTop(true), new CardsDrawnThisTurnWatcher());
).setRuleAtTheTop(true));
// Draw X cards.
this.getSpellAbility().addEffect(new DrawCardSourceControllerEffect(ManacostVariableValue.REGULAR));

View file

@ -5,6 +5,7 @@ import mage.abilities.Ability;
import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.condition.Condition;
import mage.abilities.decorator.ConditionalContinuousEffect;
import mage.abilities.dynamicvalue.common.CardsDrawnThisTurnDynamicValue;
import mage.abilities.effects.common.continuous.BoostSourceEffect;
import mage.abilities.keyword.FlyingAbility;
import mage.cards.CardImpl;
@ -36,7 +37,7 @@ public final class Eyekite extends CardImpl {
this.addAbility(new SimpleStaticAbility(new ConditionalContinuousEffect(
new BoostSourceEffect(2, 0, Duration.WhileOnBattlefield),
EyekiteCondition.instance, "{this} gets +2/+0 as long as you've drawn two or more cards this turn."
)));
)).addHint(CardsDrawnThisTurnDynamicValue.getHint()));
}
private Eyekite(final Eyekite card) {

View file

@ -11,7 +11,6 @@ import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.Duration;
import mage.target.common.TargetCreaturePermanent;
import mage.watchers.common.CardsDrawnThisTurnWatcher;
import java.util.UUID;
@ -33,6 +32,7 @@ public final class FistsOfFlame extends CardImpl {
StaticValue.get(0), Duration.EndOfTurn
).setText("and gets +1/+0 for each card you've drawn this turn."));
this.getSpellAbility().addTarget(new TargetCreaturePermanent());
this.getSpellAbility().addHint(CardsDrawnThisTurnDynamicValue.getHint());
}
private FistsOfFlame(final FistsOfFlame card) {

View file

@ -11,7 +11,6 @@ import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.SubType;
import mage.constants.SuperType;
import mage.watchers.common.CardsDrawnThisTurnWatcher;
import java.util.UUID;
@ -30,10 +29,10 @@ public final class KydeleChosenOfKruphix extends CardImpl {
this.toughness = new MageInt(3);
// {T}: Add {C} for each card you've drawn this turn.
DynamicManaAbility ability = new DynamicManaAbility(
this.addAbility(new DynamicManaAbility(
Mana.ColorlessMana(1), CardsDrawnThisTurnDynamicValue.instance,
new TapSourceCost(), null, false, CardsDrawnThisTurnDynamicValue.instance);
this.addAbility(ability);
new TapSourceCost(), null, false, CardsDrawnThisTurnDynamicValue.instance
).addHint(CardsDrawnThisTurnDynamicValue.getHint()));
// Partner
this.addAbility(PartnerAbility.getInstance());

View file

@ -28,7 +28,6 @@ import mage.game.events.GameEvent;
import mage.game.permanent.token.ShardToken;
import mage.target.TargetPermanent;
import mage.target.common.TargetControlledCreaturePermanent;
import mage.watchers.common.CardsDrawnThisTurnWatcher;
import java.util.Objects;
import java.util.UUID;
@ -69,7 +68,7 @@ public final class NikoAris extends CardImpl {
"{this} deals 2 damage to target tapped creature for each card you've drawn this turn"
), -1);
ability.addTarget(new TargetPermanent(filter));
this.addAbility(ability, new CardsDrawnThisTurnWatcher());
this.addAbility(ability.addHint(CardsDrawnThisTurnDynamicValue.getHint()));
// 1: Create a Shard token.
this.addAbility(new LoyaltyAbility(new CreateTokenEffect(new ShardToken()), -1));

View file

@ -31,7 +31,7 @@ public final class ScionOfHalaster extends CardImpl {
this.addAbility(new SimpleStaticAbility(new GainAbilityAllEffect(
new SimpleStaticAbility(new ScionOfHalasterReplacementEffect()),
Duration.WhileOnBattlefield, StaticFilters.FILTER_CREATURES_OWNED_COMMANDER
)), new CardsDrawnThisTurnWatcher());
)));
}
private ScionOfHalaster(final ScionOfHalaster card) {

View file

@ -11,7 +11,6 @@ import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.SubType;
import mage.target.common.TargetAnyTarget;
import mage.watchers.common.CardsDrawnThisTurnWatcher;
import java.util.UUID;
@ -31,11 +30,13 @@ public final class ThunderingDjinn extends CardImpl {
this.addAbility(FlyingAbility.getInstance());
// Whenever Thundering Djinn attacks, it deals damage to any target equal to the number of cards you've drawn this turn.
Ability ability = new AttacksTriggeredAbility(new DamageTargetEffect(
CardsDrawnThisTurnDynamicValue.instance
).setText("it deals damage to any target equal to the number of cards you've drawn this turn."), false);
Ability ability = new AttacksTriggeredAbility(
new DamageTargetEffect(CardsDrawnThisTurnDynamicValue.instance)
.setText("it deals damage to any target equal to the number of cards you've drawn this turn."),
false
);
ability.addTarget(new TargetAnyTarget());
this.addAbility(ability);
this.addAbility(ability.addHint(CardsDrawnThisTurnDynamicValue.getHint()));
}
private ThunderingDjinn(final ThunderingDjinn card) {

View file

@ -50,6 +50,7 @@ public final class TheBrothersWar extends ExpansionSet {
cards.add(new SetCardInfo("Disfigure", 91, Rarity.COMMON, mage.cards.d.Disfigure.class));
cards.add(new SetCardInfo("Drafna, Founder of Lat-Nam", 47, Rarity.RARE, mage.cards.d.DrafnaFounderOfLatNam.class));
cards.add(new SetCardInfo("Epic Confrontation", 176, Rarity.COMMON, mage.cards.e.EpicConfrontation.class));
cards.add(new SetCardInfo("Evangel of Synthesis", 209, Rarity.UNCOMMON, mage.cards.e.EvangelOfSynthesis.class));
cards.add(new SetCardInfo("Fade from History", 177, Rarity.RARE, mage.cards.f.FadeFromHistory.class));
cards.add(new SetCardInfo("Fallaji Chaindancer", 134, Rarity.COMMON, mage.cards.f.FallajiChaindancer.class));
cards.add(new SetCardInfo("Fallaji Dragon Engine", 159, Rarity.UNCOMMON, mage.cards.f.FallajiDragonEngine.class));

View file

@ -3,6 +3,7 @@ package mage.abilities.dynamicvalue.common;
import mage.abilities.Ability;
import mage.abilities.dynamicvalue.DynamicValue;
import mage.abilities.effects.Effect;
import mage.abilities.hint.ValueHint;
import mage.game.Game;
import mage.watchers.common.CardsDrawnThisTurnWatcher;
@ -13,6 +14,7 @@ import mage.watchers.common.CardsDrawnThisTurnWatcher;
*/
public enum CardsDrawnThisTurnDynamicValue implements DynamicValue {
instance;
private static final ValueHint hint = new ValueHint("Cards you've drawn this turn", instance);
@Override
public int calculate(Game game, Ability sourceAbility, Effect effect) {
@ -35,7 +37,12 @@ public enum CardsDrawnThisTurnDynamicValue implements DynamicValue {
@Override
public String getMessage() {
return "card you've drawn this turn";
}
public static ValueHint getHint() {
return hint;
}
}