mirror of
https://github.com/correl/mage.git
synced 2024-12-24 11:50:45 +00:00
implemented Boreal Elemental
This commit is contained in:
parent
a47b5d9675
commit
9ea96094df
3 changed files with 99 additions and 16 deletions
92
Mage.Sets/src/mage/cards/b/BorealElemental.java
Normal file
92
Mage.Sets/src/mage/cards/b/BorealElemental.java
Normal 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);
|
||||
}
|
||||
|
||||
}
|
|
@ -1,7 +1,5 @@
|
|||
|
||||
package mage.cards.i;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.MageInt;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.Mode;
|
||||
|
@ -14,15 +12,7 @@ import mage.abilities.effects.common.cost.CostModificationEffectImpl;
|
|||
import mage.abilities.keyword.FlyingAbility;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
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.constants.*;
|
||||
import mage.filter.common.FilterCreaturePermanent;
|
||||
import mage.filter.predicate.permanent.ControllerPredicate;
|
||||
import mage.game.Game;
|
||||
|
@ -34,8 +24,9 @@ import mage.target.common.TargetCreaturePermanent;
|
|||
import mage.util.CardUtil;
|
||||
import mage.watchers.Watcher;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author fireshoes
|
||||
*/
|
||||
public final class IcefallRegent extends CardImpl {
|
||||
|
@ -47,7 +38,7 @@ public final class IcefallRegent extends CardImpl {
|
|||
}
|
||||
|
||||
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.power = new MageInt(4);
|
||||
this.toughness = new MageInt(3);
|
||||
|
@ -179,14 +170,13 @@ class IcefallRegentWatcher extends Watcher {
|
|||
|
||||
class IcefallRegentCostIncreaseEffect extends CostModificationEffectImpl {
|
||||
|
||||
private static final String effectText = "Spells your opponents cast that target Icefall Regent cost {2} more to cast";
|
||||
|
||||
IcefallRegentCostIncreaseEffect() {
|
||||
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);
|
||||
}
|
||||
|
||||
|
|
|
@ -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 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("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("Brought Back", 9, Rarity.RARE, mage.cards.b.BroughtBack.class));
|
||||
cards.add(new SetCardInfo("Captivating Gyre", 51, Rarity.UNCOMMON, mage.cards.c.CaptivatingGyre.class));
|
||||
|
|
Loading…
Reference in a new issue