implemented Boreal Elemental

This commit is contained in:
Evan Kranzler 2019-06-26 07:19:28 -04:00
parent a47b5d9675
commit 9ea96094df
3 changed files with 99 additions and 16 deletions

View file

@ -0,0 +1,92 @@
package mage.cards.b;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.SpellAbility;
import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.effects.common.cost.CostModificationEffectImpl;
import mage.abilities.keyword.FlyingAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.*;
import mage.game.Game;
import mage.util.CardUtil;
import java.util.UUID;
/**
* @author TheElk801
*/
public final class BorealElemental extends CardImpl {
public BorealElemental(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{4}{U}");
this.subtype.add(SubType.ELEMENTAL);
this.power = new MageInt(3);
this.toughness = new MageInt(4);
// Flying
this.addAbility(FlyingAbility.getInstance());
// Spells your opponents cast that target Boreal Elemental cost {2} more to cast.
this.addAbility(new SimpleStaticAbility(new BorealElementalCostIncreaseEffect()));
}
private BorealElemental(final BorealElemental card) {
super(card);
}
@Override
public BorealElemental copy() {
return new BorealElemental(this);
}
}
class BorealElementalCostIncreaseEffect extends CostModificationEffectImpl {
BorealElementalCostIncreaseEffect() {
super(Duration.WhileOnBattlefield, Outcome.Benefit, CostModificationType.INCREASE_COST);
staticText = "Spells your opponents cast that target Icefall Regent cost {2} more to cast";
}
private BorealElementalCostIncreaseEffect(BorealElementalCostIncreaseEffect effect) {
super(effect);
}
@Override
public boolean apply(Game game, Ability source, Ability abilityToModify) {
SpellAbility spellAbility = (SpellAbility) abilityToModify;
CardUtil.adjustCost(spellAbility, -2);
return true;
}
@Override
public boolean applies(Ability abilityToModify, Ability source, Game game) {
if (!(abilityToModify instanceof SpellAbility)
|| !game.getOpponents(source.getControllerId()).contains(abilityToModify.getControllerId())) {
return false;
}
return abilityToModify
.getModes()
.getSelectedModes()
.stream()
.map(uuid -> abilityToModify.getModes().get(uuid))
.anyMatch(mode -> mode
.getTargets()
.stream()
.anyMatch(target -> target
.getTargets()
.stream()
.anyMatch(uuid -> uuid.equals(source.getSourceId()))
)
);
}
@Override
public BorealElementalCostIncreaseEffect copy() {
return new BorealElementalCostIncreaseEffect(this);
}
}

View file

@ -1,7 +1,5 @@
package mage.cards.i; package mage.cards.i;
import java.util.UUID;
import mage.MageInt; import mage.MageInt;
import mage.abilities.Ability; import mage.abilities.Ability;
import mage.abilities.Mode; import mage.abilities.Mode;
@ -14,15 +12,7 @@ import mage.abilities.effects.common.cost.CostModificationEffectImpl;
import mage.abilities.keyword.FlyingAbility; import mage.abilities.keyword.FlyingAbility;
import mage.cards.CardImpl; import mage.cards.CardImpl;
import mage.cards.CardSetInfo; import mage.cards.CardSetInfo;
import mage.constants.CardType; import mage.constants.*;
import mage.constants.SubType;
import mage.constants.CostModificationType;
import mage.constants.Duration;
import mage.constants.Outcome;
import mage.constants.PhaseStep;
import mage.constants.TargetController;
import mage.constants.WatcherScope;
import mage.constants.Zone;
import mage.filter.common.FilterCreaturePermanent; import mage.filter.common.FilterCreaturePermanent;
import mage.filter.predicate.permanent.ControllerPredicate; import mage.filter.predicate.permanent.ControllerPredicate;
import mage.game.Game; import mage.game.Game;
@ -34,8 +24,9 @@ import mage.target.common.TargetCreaturePermanent;
import mage.util.CardUtil; import mage.util.CardUtil;
import mage.watchers.Watcher; import mage.watchers.Watcher;
import java.util.UUID;
/** /**
*
* @author fireshoes * @author fireshoes
*/ */
public final class IcefallRegent extends CardImpl { public final class IcefallRegent extends CardImpl {
@ -47,7 +38,7 @@ public final class IcefallRegent extends CardImpl {
} }
public IcefallRegent(UUID ownerId, CardSetInfo setInfo) { public IcefallRegent(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{3}{U}{U}"); super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{3}{U}{U}");
this.subtype.add(SubType.DRAGON); this.subtype.add(SubType.DRAGON);
this.power = new MageInt(4); this.power = new MageInt(4);
this.toughness = new MageInt(3); this.toughness = new MageInt(3);
@ -179,14 +170,13 @@ class IcefallRegentWatcher extends Watcher {
class IcefallRegentCostIncreaseEffect extends CostModificationEffectImpl { class IcefallRegentCostIncreaseEffect extends CostModificationEffectImpl {
private static final String effectText = "Spells your opponents cast that target Icefall Regent cost {2} more to cast";
IcefallRegentCostIncreaseEffect() { IcefallRegentCostIncreaseEffect() {
super(Duration.WhileOnBattlefield, Outcome.Benefit, CostModificationType.INCREASE_COST); super(Duration.WhileOnBattlefield, Outcome.Benefit, CostModificationType.INCREASE_COST);
staticText = effectText; staticText = "Spells your opponents cast that target {this} cost {2} more to cast";
} }
IcefallRegentCostIncreaseEffect(IcefallRegentCostIncreaseEffect effect) { private IcefallRegentCostIncreaseEffect(IcefallRegentCostIncreaseEffect effect) {
super(effect); super(effect);
} }

View file

@ -74,6 +74,7 @@ public final class CoreSet2020 extends ExpansionSet {
cards.add(new SetCardInfo("Bone Splinters", 92, Rarity.COMMON, mage.cards.b.BoneSplinters.class)); cards.add(new SetCardInfo("Bone Splinters", 92, Rarity.COMMON, mage.cards.b.BoneSplinters.class));
cards.add(new SetCardInfo("Bone to Ash", 48, Rarity.COMMON, mage.cards.b.BoneToAsh.class)); cards.add(new SetCardInfo("Bone to Ash", 48, Rarity.COMMON, mage.cards.b.BoneToAsh.class));
cards.add(new SetCardInfo("Boneclad Necromancer", 93, Rarity.COMMON, mage.cards.b.BonecladNecromancer.class)); cards.add(new SetCardInfo("Boneclad Necromancer", 93, Rarity.COMMON, mage.cards.b.BonecladNecromancer.class));
cards.add(new SetCardInfo("Boreal Elemental", 49, Rarity.COMMON, mage.cards.b.BorealElemental.class));
cards.add(new SetCardInfo("Brineborn Cutthroat", 50, Rarity.UNCOMMON, mage.cards.b.BrinebornCutthroat.class)); cards.add(new SetCardInfo("Brineborn Cutthroat", 50, Rarity.UNCOMMON, mage.cards.b.BrinebornCutthroat.class));
cards.add(new SetCardInfo("Brought Back", 9, Rarity.RARE, mage.cards.b.BroughtBack.class)); cards.add(new SetCardInfo("Brought Back", 9, Rarity.RARE, mage.cards.b.BroughtBack.class));
cards.add(new SetCardInfo("Captivating Gyre", 51, Rarity.UNCOMMON, mage.cards.c.CaptivatingGyre.class)); cards.add(new SetCardInfo("Captivating Gyre", 51, Rarity.UNCOMMON, mage.cards.c.CaptivatingGyre.class));