1
0
Fork 0
mirror of https://github.com/correl/mage.git synced 2025-04-10 01:01:05 -09:00

[SNC] Implemented Even the Score

This commit is contained in:
Evan Kranzler 2022-04-21 20:10:38 -04:00
parent d8a2599661
commit 0dd5ebbb23
2 changed files with 61 additions and 0 deletions
Mage.Sets/src/mage

View file

@ -0,0 +1,60 @@
package mage.cards.e;
import mage.abilities.Ability;
import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.condition.Condition;
import mage.abilities.costs.mana.ManaCostsImpl;
import mage.abilities.dynamicvalue.common.ManacostVariableValue;
import mage.abilities.effects.common.DrawCardSourceControllerEffect;
import mage.abilities.effects.common.cost.SpellCostReductionSourceEffect;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.Zone;
import mage.game.Game;
import mage.watchers.common.CardsDrawnThisTurnWatcher;
import java.util.UUID;
/**
* @author TheElk801
*/
public final class EvenTheScore extends CardImpl {
public EvenTheScore(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{X}{U}{U}{U}");
// This spell costs {U}{U}{U} less to cast if an opponent has drawn four or more cards this turn.
this.addAbility(new SimpleStaticAbility(
Zone.ALL,
new SpellCostReductionSourceEffect(
new ManaCostsImpl<>("{U}{U}{U}"),
EvenTheScoreCondition.instance
)
).setRuleAtTheTop(true), new CardsDrawnThisTurnWatcher());
// Draw X cards.
this.getSpellAbility().addEffect(new DrawCardSourceControllerEffect(ManacostVariableValue.REGULAR));
}
private EvenTheScore(final EvenTheScore card) {
super(card);
}
@Override
public EvenTheScore copy() {
return new EvenTheScore(this);
}
}
enum EvenTheScoreCondition implements Condition {
instance;
@Override
public boolean apply(Game game, Ability source) {
return game.getOpponents(source.getControllerId())
.stream()
.mapToInt(game.getState().getWatcher(CardsDrawnThisTurnWatcher.class)::getCardsDrawnThisTurn)
.anyMatch(x -> x >= 4);
}
}

View file

@ -99,6 +99,7 @@ public final class StreetsOfNewCapenna extends ExpansionSet {
cards.add(new SetCardInfo("Elspeth Resplendent", 11, Rarity.MYTHIC, mage.cards.e.ElspethResplendent.class));
cards.add(new SetCardInfo("Endless Detour", 183, Rarity.RARE, mage.cards.e.EndlessDetour.class));
cards.add(new SetCardInfo("Errant, Street Artist", 41, Rarity.RARE, mage.cards.e.ErrantStreetArtist.class));
cards.add(new SetCardInfo("Even the Score", 42, Rarity.MYTHIC, mage.cards.e.EvenTheScore.class));
cards.add(new SetCardInfo("Evolving Door", 144, Rarity.RARE, mage.cards.e.EvolvingDoor.class));
cards.add(new SetCardInfo("Exhibition Magician", 106, Rarity.COMMON, mage.cards.e.ExhibitionMagician.class));
cards.add(new SetCardInfo("Exotic Pets", 185, Rarity.UNCOMMON, mage.cards.e.ExoticPets.class));